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)

See POST /changedEntityExportJobs.

fields(resource, /)

See GET /changedEntityExportJobs/fields/{resourceType}.

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, /)

See GET /changedEntityExportJobs/{exportJobId}.

name_to_change_type(resource)

Gives a mapping from names to the ChangeTypes of the same name, case-insensitive.

name_to_field(resource)

Gives a mapping from names to the Fields of the same name, case-insensitive.

resources()

See GET /changedEntityExportJobs/resources.

change_types(resource: str, /) List[ChangeType]

See GET /changedEntityExportJobs/changeTypes/{resourceType}.

Parameters

resource – The resourceType path parameter.

Returns

List of the resulting ChangeType objects.

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 ChangedEntityFields to 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 ChangedEntityExportJob is appropriate to unpack here.

Returns

The resulting ChangedEntityExportJob object.

Keyword Arguments
fields(resource: str, /) List[ChangedEntityField]

See GET /changedEntityExportJobs/fields/{resourceType}.

Parameters

resource – The resourceType path parameter.

Returns

The resulting ChangedEntityField object.

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 ChangedEntityExportJobData object.

name_to_change_type(resource: str) Dict[str, ChangeType]

Gives a mapping from names to the ChangeTypes of the same name, case-insensitive.

Parameters

resource – Resource to get change types for.

Returns

Name of Change Type to the resulting ChangeType objects.

name_to_field(resource: str) Dict[str, ChangedEntityField]

Gives a mapping from names to the Fields of the same name, case-insensitive.

Parameters

resource – Resource to get fields for.

Returns

Name of field to the resulting ChangedEntityField objects.

resources() List[str]

See GET /changedEntityExportJobs/resources.

Returns

List of the resource type names.