everyaction.services.People

class everyaction.services.People(ea: EAClient)

Represents the People service.

Methods

activist_codes(van_id, /, *[, limit])

See GET /people/{vanId}/activistCodes.

add_canvass_responses(van_id, /, **kwargs)

See POST /people/{vanId}/canvassResponses.

add_canvass_responses_(person_id_type, ...)

See POST /people/{personIdType}:{personId}/canvassResponses.

add_code(van_id, **kwargs)

See POST /people/{vanId}/codes.

add_code_(person_id_type, person_id, /, **kwargs)

See POST /people/{personIdType}:{personId}/codes.

add_my_activist_flag(van_id, /)

See PUT /people/{vanId}/myActivistFlags.

add_notes(van_id, /, **kwargs)

See POST /people/{vanId}/notes.

add_notes_(person_id_type, person_id, /, ...)

See POST /people/{personIdType}:{personId}/notes.

add_relationship(van_id, /, **kwargs)

See POST /people/{vanId}/relationships.

apply_activist_code(activist_code, **kwargs)

Apply the given activist code to the person distinguished by the specified data.

apply_notes(notes, **kwargs)

Apply the given notes to the person distinguished by the specified data.

apply_result_code(result_code, **kwargs)

Apply the given result code to the person distinguished by the given data.

find(**kwargs)

See POST /people/find.

find_by_phone(**kwargs)

See POST /people/findByPhone.

find_or_create(**kwargs)

See POST /people/findOrCreate.

get(van_id, /, **kwargs)

See GET /people/{vanId}.

get_(person_id_type, person_id, /, **kwargs)

See GET /people/{personIdType}:{personId}.

list(*[, limit])

See GET /people.

lookup(*[, expand])

Attempt to find a person using the data in kwargs by invoking POST /people/find.

membership(van_id, /)

See GET /people/{vanId}/membership.

merge_into(van_id, /, **kwargs)

See PUT /people/{vanId}/mergeInto.

notes(van_id, /, *[, limit])

See GET /people/{vanId}/notes.

remove_activist_code(activist_code, **kwargs)

Remove the given activist code from the person distinguished by the specified data.

remove_code(van_id, code_id, /)

See DELETE /people/{vanId}/codes/{codeId}.

remove_code_(person_id_type, person_id, ...)

See DELETE /people/{personIdType}:{personId}/codes/{codeId}.

remove_my_activist_flag(van_id, /)

See DELETE /people/{vanId}/myActivistFlags.

set_disclosures_fields(van_id, /, **kwargs)

See POST /people/{vanId}/disclosureFieldValues.

set_disclosures_fields_(person_id_type, ...)

See POST /people/{personIdType}:{personId}/disclosureFieldValues.

update(van_id, /, **kwargs)

See POST /people/{vanId}.

update_(person_id_type, person_id, /, **kwargs)

See POST /people/{personIdType}:{personId}.

update_if_exists(lookup_args, update_args)

Update a person with the given properties if they already exist as a record.

update_names(van_id, /, **kwargs)

See PATCH /people/{vanId}/names.

update_note(van_id, note_id, /, **kwargs)

See PUT /people/{vanId}/notes/{noteId}.

activist_codes(van_id: int, /, *, limit: Optional[int] = None, **kwargs: EAValue) List[ActivistCodeData]

See GET /people/{vanId}/activistCodes.

Parameters
  • van_id – The vanId path parameter.

  • limit – Maximum number of records to get for this request.

  • kwargs – The applicable query arguments and JSON data for the request.

Returns

List of the resulting ActivistCodeData objects.

add_canvass_responses(van_id: int, /, **kwargs: EAValue) None

See POST /people/{vanId}/canvassResponses.

Parameters
  • van_id – The vanId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request. A CanvassResponse is appropriate to unpack here.

Keyword Arguments
add_canvass_responses_(person_id_type: str, person_id: str, /, **kwargs: EAValue) None

See POST /people/{personIdType}:{personId}/canvassResponses.

Parameters
  • person_id_type – The personIdType path parameter.

  • person_id – The personId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request. A CanvassResponse is appropriate to unpack here.

Keyword Arguments
add_code(van_id: int, **kwargs: EAValue) None

See POST /people/{vanId}/codes.

Parameters
  • van_id – The vanId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request. A Code is appropriate to unpack here.

Keyword Arguments
add_code_(person_id_type: str, person_id: str, /, **kwargs: EAValue) None

See POST /people/{personIdType}:{personId}/codes.

Parameters
  • person_id_type – The personIdType path parameter.

  • person_id – The personId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request. A Code is appropriate to unpack here.

Keyword Arguments
add_my_activist_flag(van_id: int, /) None

See PUT /people/{vanId}/myActivistFlags.

Parameters

van_id – The vanId path parameter.

add_notes(van_id: int, /, **kwargs: EAValue) None

See POST /people/{vanId}/notes.

Parameters
  • van_id – The vanId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request. A Note is appropriate to unpack here.

Keyword Arguments
add_notes_(person_id_type: str, person_id: str, /, **kwargs: EAValue) None

See POST /people/{personIdType}:{personId}/notes.

Parameters
  • person_id_type – The personIdType path parameter.

  • person_id – The personId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request. A Note is appropriate to unpack here.

Keyword Arguments
add_relationship(van_id: int, /, **kwargs: EAValue) None

See POST /people/{vanId}/relationships.

Parameters
  • van_id – The vanId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request.

Keyword Arguments
apply_activist_code(activist_code: Union[int, str], **kwargs: EAValue) None

Apply the given activist code to the person distinguished by the specified data. Does not create a contact history.

Parameters
  • activist_code – The activist code name or ID.

  • kwargs – The JSON data to lookup the person with. A Person is appropriate to unpack here.

Raises

EAFindFailedException – If either the given activist code or a person could not be found.

apply_notes(notes: Note, **kwargs: EAValue) None

Apply the given notes to the person distinguished by the specified data.

Parameters
  • notes – The notes to add.

  • kwargs – The JSON data to lookup the person with. A Person is appropriate to unpack here.

Raises

EAFindFailedException – If a person could not be found.

apply_result_code(result_code: Union[int, str], **kwargs: EAValue) None

Apply the given result code to the person distinguished by the given data.

Parameters
  • result_code – The ID or name of the result code to apply.

  • kwargs – The JSON data to lookup the person with. A Person is appropriate to unpack here.

Raises

EAFindFailedException – If either the given result code or a person could not be found.

find(**kwargs: EAValue) Optional[Person]

See POST /people/find.

Parameters

kwargs – The applicable query arguments and JSON data for the request. A Person is appropriate to unpack here.

Returns

The found Person object, or None if no person could be found.

Keyword Arguments
find_by_phone(**kwargs: EAValue) Optional[Person]

See POST /people/findByPhone.

Parameters

kwargs – The applicable query arguments and JSON data for the request.

Returns

The resulting Person object.

Keyword Arguments
find_or_create(**kwargs: EAValue) Person

See POST /people/findOrCreate.

Parameters

kwargs – The applicable query arguments and JSON data for the request. A Person is appropriate to unpack here.

Returns

The found or else created Person object.

Keyword Arguments
get(van_id: int, /, **kwargs: EAValue) Person

See GET /people/{vanId}.

Parameters
  • van_id – The vanId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request.

Returns

The resulting Person object.

Keyword Arguments
  • expand

get_(person_id_type: str, person_id: str, /, **kwargs: EAValue) Person

See GET /people/{personIdType}:{personId}.

Parameters
  • person_id_type – The personIdType path parameter.

  • person_id – The personId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request.

Returns

The resulting Person object.

Keyword Arguments
  • expand

list(*, limit: Optional[int] = None, **kwargs: EAValue) List[Person]

See GET /people.

Parameters
  • limit – Maximum number of records to get for this request.

  • kwargs – The applicable query arguments and JSON data for the request.

Returns

List of the resulting Person objects.

Keyword Arguments
lookup(*, expand: Union[str, Iterable[str]] = '', **kwargs: EAValue) Optional[Person]

Attempt to find a person using the data in kwargs by invoking POST /people/find. Then, if a person was found, use their VAN ID to retrieve their stored Person record by invoking GET /people/{vanId}.

Parameters
  • expand – List or comma-separated string of names of properties to get for the person.

  • kwargs – The JSON data to lookup the person with. A Person is appropriate to unpack here.

Returns

The resulting Person object if found, otherwise None.

membership(van_id: int, /) Membership

See GET /people/{vanId}/membership.

Parameters

van_id – The vanId path parameter.

Returns

The resulting Membership object.

merge_into(van_id: int, /, **kwargs: EAValue) Person

See PUT /people/{vanId}/mergeInto.

Parameters
  • van_id – The vanId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request.

Returns

The resulting Person object.

Keyword Arguments
notes(van_id: int, /, *, limit: Optional[int] = None, **kwargs: EAValue) List[Note]

See GET /people/{vanId}/notes.

Parameters
  • van_id – The vanId path parameter.

  • limit – Maximum number of records to get for this request.

  • kwargs – The applicable query arguments and JSON data for the request.

Returns

List of the resulting Note objects.

remove_activist_code(activist_code: Union[int, str], **kwargs: EAValue) None

Remove the given activist code from the person distinguished by the specified data. Does not create a contact history.

Parameters
  • activist_code – The activist code name or ID.

  • kwargs – The JSON data to lookup the person with. A Person is appropriate to unpack here.

Raises

EAFindFailedException – If either the given activist code or a person could not be found.

remove_code(van_id: int, code_id: int, /) None

See DELETE /people/{vanId}/codes/{codeId}.

Parameters
  • van_id – The vanId path parameter.

  • code_id – The code_id path parameter.

remove_code_(person_id_type: str, person_id: str, code_id: int, /) None

See DELETE /people/{personIdType}:{personId}/codes/{codeId}.

Parameters
  • person_id_type – The personIdType path parameter.

  • person_id – The personId path parameter.

  • code_id – The codeId path parameter.

remove_my_activist_flag(van_id: int, /) None

See DELETE /people/{vanId}/myActivistFlags.

Parameters

van_id – The vanId path parameter.

set_disclosures_fields(van_id: int, /, **kwargs: EAValue) None

See POST /people/{vanId}/disclosureFieldValues.

Parameters
  • van_id – The vanId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request.

Keyword Arguments
set_disclosures_fields_(person_id_type: str, person_id: str, /, **kwargs: EAValue) None

See POST /people/{personIdType}:{personId}/disclosureFieldValues.

Parameters
  • person_id_type – The personIdType path parameter.

  • person_id – The personId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request.

Keyword Arguments
update(van_id: int, /, **kwargs: EAValue) Optional[Person]

See POST /people/{vanId}.

Parameters
  • van_id – The vanId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request. A Person is appropriate to unpack here.

Returns

The found Person object, or None if no person could be found.

Keyword Arguments
update_(person_id_type: str, person_id: str, /, **kwargs: EAValue) Optional[Person]

See POST /people/{personIdType}:{personId}.

Parameters
  • person_id_type – The personIdType path parameter.

  • person_id – The personId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request. A Person is appropriate to unpack here.

Returns

The found Person object, or None if no person could be found.

Keyword Arguments
update_if_exists(lookup_args: EAMap, update_args: EAMap) Optional[int]

Update a person with the given properties if they already exist as a record. Works by invoking POST /people/find followed by POST /people/{vanId} if the person exists.

Parameters
  • lookup_args – The JSON data to lookup the person with. A Person is an appropriate argument here.

  • update_args – The JSON data to update the person with. A Person is an appropriate argument here.

Returns

The VAN ID of the person, or None is no such record was found.

update_names(van_id: int, /, **kwargs: EAValue) Person

See PATCH /people/{vanId}/names.

Parameters
  • van_id – The vanId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request. A Person is appropriate to unpack here.

Returns

The resulting Person object.

Keyword Arguments
update_note(van_id: int, note_id: int, /, **kwargs: EAValue) None

See PUT /people/{vanId}/notes/{noteId}.

Parameters
  • van_id – The vanId path parameter.

  • note_id – The noteId path parameter.

  • kwargs – The applicable query arguments and JSON data for the request. A Note is appropriate to unpack here.

Keyword Arguments