everyaction.services.ChangedEntities¶
- class everyaction.services.ChangedEntities(ea: EAClient)¶
Represents the Changed Entities service.
Methods
change_types(resource, /)See GET /changedEntityExportJobs/changeTypes/{resourceType}.
changes([field_cache])Creates a ChangedEntityExportJob, waits for its completion, and then parses the results from the downloadable csv.
create_job(**kwargs)fields(resource, /)find_change_type(resource, name)Find the changeType with the given case-insensitive name for the given resource.
find_field(resource, name)Find the fields with the given case-insensitive name for the given resource.
job(job_id, /)name_to_change_type(resource)Gives a mapping from names to the
ChangeTypesof the same name, case-insensitive.name_to_field(resource)Gives a mapping from names to the
Fieldsof the same name, case-insensitive.- change_types(resource: str, /) List[ChangeType]¶
See GET /changedEntityExportJobs/changeTypes/{resourceType}.
- Parameters
resource – The resourceType path parameter.
- Returns
List of the resulting
ChangeTypeobjects.
- changes(field_cache: Optional[List[ChangedEntityField]] = None, **kwargs: EAValue) List[Dict[str, Union[bool, int, str, datetime]]]¶
Creates a ChangedEntityExportJob, waits for its completion, and then parses the results from the downloadable csv.
- Parameters
field_cache – If provided, use these
ChangedEntityFieldsto parse the data instead of getting them automatically in this function. Useful for saving bandwidth by reducing the volume of requests, especially if export jobs are made frequently. Note that all other fields will be excluded from the resulting dictionary when this is specified. If a field could not be found as a header in the resulting CSV file, no exception is raised: that field is simply missing from the resulting dictionary.kwargs – The applicable query arguments and JSON data to pass to POST /changedEntityExportJobs.
- Returns
List of mappings, each representing one row in the downloaded CSV, from names of changed entity fields to their corresponding values.
- Raises
EAChangedEntityJobFailedException – If the changed entity export job failed.
- create_job(**kwargs: EAValue) ChangedEntityExportRequest¶
See POST /changedEntityExportJobs.
- Parameters
kwargs – The applicable query arguments and JSON data for the request. A
ChangedEntityExportJobis appropriate to unpack here.- Returns
The resulting
ChangedEntityExportJobobject.- Keyword Arguments
dateChangedFrom (date_changed_from, changed_from)
dateChangedTo (date_changed_to, changed_to)
excludeChangesFromSelf (exclude_changes_from_self, exclude_self)
exportJobId (export_job_id, id)
fileSizeKbLimit (file_size_kb_limit, size_kb_limit, kb_limit)
includeInactive (include_inactive)
requestedCustomFieldIds (requested_custom_field_ids, custom_field_ids, custom_fields, custom_field (singular))
requestedFields (requested_fields, fields, field (singular))
requestedIds (requested_ids, ids, requested_id (singular))
resourceType (resource_type, resource)
- fields(resource: str, /) List[ChangedEntityField]¶
See GET /changedEntityExportJobs/fields/{resourceType}.
- Parameters
resource – The resourceType path parameter.
- Returns
The resulting
ChangedEntityFieldobject.
- find_change_type(resource: str, name: str) ChangeType¶
Find the changeType with the given case-insensitive name for the given resource.
- Parameters
resource – Resource to find change type for.
name – Name of change type to find.
- Returns
The resulting
ChangeType.
- find_field(resource: str, name: str) ChangedEntityField¶
Find the fields with the given case-insensitive name for the given resource.
- Parameters
resource – Resource to find field for.
name – Name of field to find.
- Returns
The resulting
ChangedEntityField.
- job(job_id: int, /) ChangedEntityExportJob¶
See GET /changedEntityExportJobs/{exportJobId}.
- Parameters
job_id – The exportJobId path parameter.
- Returns
The resulting
ChangedEntityExportJobDataobject.
- name_to_change_type(resource: str) Dict[str, ChangeType]¶
Gives a mapping from names to the
ChangeTypesof the same name, case-insensitive.- Parameters
resource – Resource to get change types for.
- Returns
Name of Change Type to the resulting
ChangeTypeobjects.
- name_to_field(resource: str) Dict[str, ChangedEntityField]¶
Gives a mapping from names to the
Fieldsof the same name, case-insensitive.- Parameters
resource – Resource to get fields for.
- Returns
Name of field to the resulting
ChangedEntityFieldobjects.
- resources() List[str]¶
See GET /changedEntityExportJobs/resources.
- Returns
List of the resource type names.