diff --git a/.gitignore b/.gitignore index 8b1ee6b888..99a87cf379 100644 --- a/.gitignore +++ b/.gitignore @@ -84,9 +84,9 @@ celerybeat-schedule # Environments .env -.venv +.venv* env/ -venv/ +venv*/ ENV/ env.bak/ venv.bak/ diff --git a/parsons/action_network/action_network.py b/parsons/action_network/action_network.py index 9c2e499e9e..484e7878f2 100644 --- a/parsons/action_network/action_network.py +++ b/parsons/action_network/action_network.py @@ -51,7 +51,7 @@ def _get_entry_list(self, object_name, limit=None, per_page=25, filter=None): while True: response = self._get_page(object_name, page, per_page, filter=filter) page = page + 1 - response_list = response["_embedded"][f"osdi:{object_name}"] + response_list = response["_embedded"][list(response["_embedded"])[0]] if not response_list: return Table(return_list) return_list.extend(response_list) @@ -60,6 +60,660 @@ def _get_entry_list(self, object_name, limit=None, per_page=25, filter=None): if count >= limit: return Table(return_list[0:limit]) + # Advocacy Campaigns + def get_advocacy_campaigns(self, limit=None, per_page=25, page=None, filter=None): + """ + `Args:` + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + + `Returns:` + A JSON with all of the advocacy_campaigns (letters) entries + """ + if page: + return self._get_page("advocacy_campaigns", page, per_page, filter) + return self._get_entry_list("advocacy_campaigns", limit, per_page, filter) + + def get_advocacy_campaign(self, advocacy_campaign_id): + """ + `Args:` + advocacy_campaign_id: + The unique id of the advocacy_campaign + `Returns:` + A JSON with advocacy_campaign entry + """ + return self.api.get_request(f"advocacy_campaigns/{advocacy_campaign_id}") + + # Attendances + def get_person_attendances( + self, person_id, limit=None, per_page=25, page=None, filter=None + ): + """ + `Args:` + person_id: + The unique id of the person + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + `Returns:` + A JSON with all the attendances entries + """ + if page: + return self._get_page( + f"people/{person_id}/attendances", page, per_page, filter + ) + return self._get_entry_list( + f"people/{person_id}/attendances", limit, per_page, filter + ) + + def get_event_attendances( + self, event_id, limit=None, per_page=25, page=None, filter=None + ): + """ + `Args:` + event_id: the unique id of the event + limit: + The number of entries to return. When None, returns all entries. + per_page + The number of entries per page to return. 25 maximum. + page + Which page of results to return + filter + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + `Returns:` + A JSON with the attendances entries related to the event + """ + if page: + return self._get_page( + f"events/{event_id}/attendances", page, per_page, filter + ) + return self._get_entry_list( + f"events/{event_id}/attendances", limit, per_page, filter + ) + + def get_event_attendance(self, event_id, attendance_id): + """ + `Args:` + event_id: + The unique id of the event + attendance_id: + The unique id of the attendance + `Returns:` + A JSON with the attendance entry + """ + return self.api.get_request(f"events/{event_id}/attendances/{attendance_id}") + + def get_person_attendance(self, person_id, attendance_id): + """ + `Args:` + person_id: + The unique id of the person + attendance_id: + The unique id of the attendance + `Returns:` + A JSON with the attendance entry + """ + return self.api.get_request(f"people/{person_id}/attendances/{attendance_id}") + + # Campaigns + def get_campaigns(self, limit=None, per_page=25, page=None, filter=None): + """ + `Args:` + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + `Returns:` + A JSON with all of the campaigns entries + """ + if page: + return self._get_page("campaigns", page, per_page, filter) + return self._get_entry_list("campaigns", limit, per_page, filter) + + def get_campaign(self, campaign_id): + """ + `Args:` + campaign_id: + The unique id of the campaign + `Returns:` + A JSON with the campaign entry + """ + return self.api.get_request(f"campaigns/{campaign_id}") + + # Custom Fields + def get_custom_fields(self): + """ + `Args:` + None + `Returns:` + A JSON with the custom_fields associated with your API key. + """ + return self.api.get_request("metadata/custom_fields") + + # Donations + def get_donation(self, donation_id): + """ + `Args:` + donation_id: The unique id of the donation + `Returns:` + A JSON with donation data + """ + return self.api.get_request(url=f"donations/{donation_id}") + + def get_donations(self, limit=None, per_page=25, page=None, filter=None): + """ + `Args:` + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + `Returns:` + A JSON with all the donations entries + """ + if page: + return self._get_page("donations", page, per_page, filter) + return self._get_entry_list("donations", limit, per_page, filter) + + def get_fundraising_page_donations( + self, fundraising_page_id, limit=None, per_page=25, page=None, filter=None + ): + """ + `Args:` + fundraising_page_id: The id of the fundraiser + limit: + The number of entries to return. When None, returns all entries. + per_page + The number of entries per page to return. 25 maximum. + page + Which page of results to return + filter + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + + `Returns:` + A JSON with fundraising_page entry + """ + if page: + return self._get_page( + f"fundraising_pages/{fundraising_page_id}/donations", + page, + per_page, + filter, + ) + return self._get_entry_list( + f"fundraising_pages/{fundraising_page_id}/donations", + limit, + per_page, + filter, + ) + + def get_person_donations( + self, person_id, limit=None, per_page=25, page=None, filter=None + ): + """ + `Args:` + person_id: The id of the person + limit: + The number of entries to return. When None, returns all entries. + per_page + The number of entries per page to return. 25 maximum. + page + Which page of results to return + filter + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + + `Returns:` + A JSON with all donations related to person + """ + if page: + return self._get_page( + f"people/{person_id}/donations", + page, + per_page, + filter, + ) + return self._get_entry_list( + f"people/{person_id}/donations", + limit, + per_page, + filter, + ) + + # Embeds + def get_embeds(self, action_type, action_id): + """ + `Args:` + action_type: + The action type (petition, events, etc.) + action_id: + The unique id of the action + `Returns:` + A JSON with the embeds (for you to be able to embed action outside of ActionNetwork). + """ + return self.api.get_request(f"{action_type}/{action_id}/embed") + + # Event Campaigns + def get_event_campaigns(self, limit=None, per_page=25, page=None, filter=None): + """ + `Args:` + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + `Returns:` + A JSON with all the event_campaigns entries + """ + if page: + return self._get_page("event_campaigns", page, per_page, filter) + return self._get_entry_list("event_campaigns", limit, per_page, filter) + + def get_event_campaign(self, event_campaign_id): + """ + `Args:` + event_campaign_id: + The unique id of the event_campaign + `Returns:` + A JSON with event_campaign entry + """ + return self.api.get_request(f"event_campaigns/{event_campaign_id}") + + # Events + def get_events(self, limit=None, per_page=25, page=None, filter=None): + """ + `Args:` + limit: + The number of entries to return. When None, returns all entries. + per_page + The number of entries per page to return. 25 maximum. + page + Which page of results to return + filter + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + `Returns:` + A JSON with all the events entries + """ + if page: + return self._get_page("events", page, per_page, filter) + return self._get_entry_list("events", limit, per_page, filter) + + def get_event(self, event_id): + """ + `Args:` + event_id: the unique id of the event + `Returns:` + A JSON with event entry + """ + return self.api.get_request(f"events/{event_id}") + + def get_event_campaign_events( + self, event_campaign_id, limit=None, per_page=25, page=None, filter=None + ): + """ + `Args:` + event_campaign_id: + The unique id of the event_campaign + limit: + The number of entries to return. When None, returns all entries. + per_page + The number of entries per page to return. 25 maximum. + page + Which page of results to return + filter + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + `Returns:` + A JSON with all the eventes related to the event_campaign entry + """ + if page: + return self._get_page( + f"event_campaigns/{event_campaign_id}/events", page, per_page, filter + ) + return self._get_entry_list( + f"event_campaigns/{event_campaign_id}/events", limit, per_page, filter + ) + + def create_event(self, title, start_date=None, location=None): + """ + Create an event in Action Network + + `Args:` + title: str + The public title of the event + start_date: str OR datetime + OPTIONAL: The starting date & time. If a string, use format "YYYY-MM-DD HH:MM:SS" + (hint: the default format you get when you use `str()` on a datetime) + location: dict + OPTIONAL: A dict of location details. Can include any combination of the types of + values in the following example: + .. code-block:: python + + my_location = { + "venue": "White House", + "address_lines": [ + "1600 Pennsylvania Ave" + ], + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US" + } + + `Returns:` + Dict of Action Network Event data. + """ + + data = {"title": title} + + if start_date: + start_date = str(start_date) + data["start_date"] = start_date + + if isinstance(location, dict): + data["location"] = location + + event_dict = self.api.post_request( + url=f"{self.api_url}/events", data=json.dumps(data) + ) + + an_event_id = event_dict["_links"]["self"]["href"].split("/")[-1] + event_dict["event_id"] = an_event_id + + return event_dict + + # Forms + def get_forms(self, limit=None, per_page=25, page=None, filter=None): + """ + `Args:` + limit: + The number of entries to return. When None, returns all entries. + per_page + The number of entries per page to return. 25 maximum. + page + Which page of results to return + filter + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + `Returns:` + A JSON with all the forms entries + """ + if page: + return self._get_page("forms", page, per_page, filter) + return self._get_entry_list("forms", limit, per_page, filter) + + def get_form(self, form_id): + """ + `Args:` + form_id: + The unique id of the form + `Returns:` + A JSON with form entry + """ + return self.api.get_request(f"forms/{form_id}") + + # Fundraising Pages + def get_fundraising_page(self, fundraising_page_id): + """ + `Args:` + fundraising_page_id: The id of the fundraiser + `Returns:` + A JSON with fundraising_page entry + """ + return self.api.get_request(url=f"fundraising_pages/{fundraising_page_id}") + + def get_fundraising_pages(self, limit=None, per_page=25, page=None, filter=None): + """ + `Args:` + limit: + The number of entries to return. When None, returns all entries. + per_page + The number of entries per page to return. 25 maximum. + page + Which page of results to return + filter + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + + `Returns:` + A JSON with all the fundraising_pages entries + """ + if page: + return self._get_page("fundraising_pages", page, per_page, filter) + return self._get_entry_list( + "fundraising_pages", + limit, + ) + + # Items + def get_items(self, list_id, limit=None, per_page=25, page=None, filter=None): + """ + `Args:` + list_id: + The unique id of the list + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + + + `Returns:` + A JSON with all the list item entries + """ + if page: + return self._get_page(f"lists/{list_id}/items", page, per_page, filter) + return self._get_entry_list(f"lists/{list_id}/items", limit, per_page, filter) + + def get_item(self, list_id, item_id): + """ + `Args:` + list_id: + The unique id of the list + item_id: + The unique id of the item + `Returns:` + A JSON with the item entry + """ + return self.api.get_request(f"lists/{list_id}/items/{item_id}") + + # Lists + def get_lists(self, limit=None, per_page=25, page=None, filter=None): + """ + `Args:` + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + + + `Returns:` + A JSON with all the list entries + """ + if page: + return self._get_page("lists", page, per_page, filter) + return self._get_entry_list("lists", limit, per_page, filter) + + def get_list(self, list_id): + """ + `Args:` + list_id: + The unique id of the list + `Returns:` + A JSON with the list entry + """ + return self.api.get_request(f"lists/{list_id}") + + # Messages + def get_messages(self, limit=None, per_page=25, page=None, filter=None): + """ + `Args:` + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + + + `Returns:` + A JSON with all the messages related entries + """ + if page: + return self._get_page("messages", page, per_page, filter) + return self._get_entry_list("messages", limit, per_page, filter) + + def get_message(self, message_id): + """ + `Args:` + message_id: + The unique id of the message + `Returns:` + A JSON with the signature entry. + """ + return self.api.get_request(f"messages/{message_id}") + + # Metadata + def get_metadata(self): + """ + `Args:` + None + `Returns:` + A JSON with the metadata entry + """ + return self.api.get_request("metadata") + + # Outreaches + def get_advocacy_campaign_outreaches( + self, advocacy_campaign_id, limit=None, per_page=25, page=None, filter=None + ): + """ + `Args:` + advocacy_campaign_id: + The unique id of the advocacy_campaign + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + + `Returns:` + A JSON with all the outreaches entries related to the advocacy_campaign_id + """ + if page: + return self._get_page( + f"advocacy_campaigns/{advocacy_campaign_id}/outreaches", + page, + per_page, + filter, + ) + return self._get_entry_list( + f"advocacy_campaigns/{advocacy_campaign_id}/outreaches", + limit, + per_page, + filter, + ) + + def get_person_outreaches( + self, person_id, limit=None, per_page=25, page=None, filter=None + ): + """ + `Args:` + person_id: + The unique id of the person + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + + `Returns:` + A JSON with all the outreaches entries related to our group + """ + if page: + return self._get_page( + f"people/{person_id}/outreaches", page, per_page, filter + ) + return self._get_entry_list( + f"people/{person_id}/outreaches", limit, per_page, filter + ) + + def get_advocacy_campaign_outreach(self, advocacy_campaign_id, outreach_id): + """ + `Args:` + advocacy_campaign_id: + The unique id of the campaign + outreach_id: + The unique id of the outreach + `Returns:` + A JSON with the outreach entry + """ + return self.api.get_request( + f"advocacy_campaigns/{advocacy_campaign_id}/outreaches/{outreach_id}" + ) + + def get_person_outreach(self, person_id, outreach_id): + """ + `Args:` + person_id: + The unique id of the campaign + outreach_id: + The unique id of the outreach + `Returns:` + A JSON with the outreach entry + """ + return self.api.get_request(f"people/{person_id}/outreaches/{outreach_id}") + + # People def get_people(self, limit=None, per_page=25, page=None, filter=None): """ `Args:` @@ -331,6 +985,232 @@ def update_person(self, entry_id, background_processing=False, **kwargs): logger.info(f"Person {entry_id} successfully updated") return response + # Petitions + def get_petitions(self, limit=None, per_page=25, page=None, filter=None): + """ + `Args:` + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + `Returns:` + A JSON with all of the petitions entries + """ + if page: + return self._get_page("petitions", page, per_page, filter) + return self._get_entry_list("petitions", limit, per_page, filter) + + def get_petition(self, petition_id): + """ + `Args:` + petition_id: + The unique id of the petition + `Returns:` + A JSON with the petition entry + """ + return self.api.get_request(f"petitions/{petition_id}") + + # Queries + def get_queries(self, limit=None, per_page=25, page=None, filter=None): + """ + `Args:` + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + + + `Returns:` + A JSON with all the query entries + """ + if page: + return self._get_page("queries", page, per_page, filter) + return self._get_entry_list("queries", limit, per_page, filter) + + def get_query(self, query_id): + """ + `Args:` + query_id: + The unique id of the query + `Returns:` + A JSON with the query entry + """ + return self.api.get_request(f"queries/{query_id}") + + # Signatures + def get_petition_signatures( + self, petition_id, limit=None, per_page=25, page=None, filter=None + ): + """ + `Args:` + petition_id: + The unique id of the petition + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + `Returns:` + A JSON with all the signatures related to the petition entry + """ + if page: + return self._get_page( + f"petitions/{petition_id}/signatures", page, per_page, filter + ) + return self._get_entry_list( + f"petitions/{petition_id}/signatures", limit, per_page, filter + ) + + def get_person_signatures( + self, person_id, limit=None, per_page=25, page=None, filter=None + ): + """ + `Args:` + person_id: + The unique id of the person + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + + + `Returns:` + A JSON with all the signatures related to the petition entry + """ + if page: + return self._get_page( + f"people/{person_id}/signatures", page, per_page, filter + ) + return self._get_entry_list( + f"people/{person_id}/signatures", limit, per_page, filter + ) + + def get_petition_signature(self, petition_id, signature_id): + """ + `Args:` + petition_id: + The unique id of the petition + signature_id: + The unique id of the signature + `Returns:` + A JSON with the signature entry + """ + return self.api.get_request( + f"petitions/{petition_id}/signatures/{signature_id}" + ) + + def get_person_signature(self, person_id, signature_id): + """ + `Args:` + person_id: + The unique id of the person + signature_id: + The unique id of the signature + `Returns:` + A JSON with the signature entry + """ + return self.api.get_request(f"people/{person_id}/signatures/{signature_id}") + + # Submissions + def get_form_submissions( + self, form_id, limit=None, per_page=25, page=None, filter=None + ): + """ + `Args:` + form_id: + The unique id of the form + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + + `Returns:` + A JSON with all the submissions entries related to the form + """ + if page: + return self._get_page( + f"forms/{form_id}/submissions", page, per_page, filter + ) + return self._get_entry_list( + f"forms/{form_id}/submissions", limit, per_page, filter + ) + + def get_person_submissions( + self, person_id, limit=None, per_page=25, page=None, filter=None + ): + """ + `Args:` + person_id: + The unique id of the person + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. + `Returns:` + A JSON with all the submissions entries related with our group + """ + if page: + return self._get_page( + f"people/{person_id}/submissions", page, per_page, filter + ) + return self._get_entry_list( + f"people/{person_id}/submissions", limit, per_page, filter + ) + + def get_form_submission(self, form_id, submission_id): + """ + `Args:` + form_id: + The unique id of the form + submission_id: + The unique id of the submission + `Returns:` + A JSON with the submission entry + """ + return self.api.get_request(f"forms/{form_id}/submissions/{submission_id}") + + def get_person_submission(self, person_id, submission_id): + """ + `Args:` + person_id: + The unique id of the submission + submission_id: + The unique id of the submission + `Returns:` + A JSON with the submission entry + """ + return self.api.get_request(f"people/{person_id}/submissions/{submission_id}") + + # Tags def get_tags(self, limit=None, per_page=None): """ `Args:` @@ -380,50 +1260,72 @@ def add_tag(self, name): logger.info(f"Tag {person_id} successfully added to tags.") return response - def create_event(self, title, start_date=None, location=None): + # Taggings + def get_taggings(self, tag_id, limit=None, per_page=25, page=None, filter=None): """ - Create an event in Action Network - `Args:` - title: str - The public title of the event - start_date: str OR datetime - OPTIONAL: The starting date & time. If a string, use format "YYYY-MM-DD HH:MM:SS" - (hint: the default format you get when you use `str()` on a datetime) - location: dict - OPTIONAL: A dict of location details. Can include any combination of the types of - values in the following example: - .. code-block:: python + tag_id: + The unique id of the tag + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. - my_location = { - "venue": "White House", - "address_lines": [ - "1600 Pennsylvania Ave" - ], - "locality": "Washington", - "region": "DC", - "postal_code": "20009", - "country": "US" - } `Returns:` - Dict of Action Network Event data. + A JSON with all the tagging entries associated with the tag_id """ + if page: + return self._get_page(f"tags/{tag_id}/taggings", page, per_page, filter) + return self._get_entry_list(f"tags/{tag_id}/taggings", limit, per_page, filter) - data = {"title": title} - - if start_date: - start_date = str(start_date) - data["start_date"] = start_date + def get_tagging(self, tag_id, tagging_id): + """ + `Args:` + tag_id: + The unique id of the tag + tagging_id: + The unique id of the tagging + `Returns:` + A JSON with the tagging entry + """ + return self.api.get_request(f"tags/{tag_id}/taggings/{tagging_id}") - if isinstance(location, dict): - data["location"] = location + # Wrappers + def get_wrappers(self, limit=None, per_page=25, page=None, filter=None): + """ + `Args:` + limit: + The number of entries to return. When None, returns all entries. + per_page: + The number of entries per page to return. 25 maximum. + page: + Which page of results to return + filter: + The OData query for filtering results. E.g. "modified_date gt '2014-03-25'". + When None, no filter is applied. - event_dict = self.api.post_request( - url=f"{self.api_url}/events", data=json.dumps(data) - ) - an_event_id = event_dict["_links"]["self"]["href"].split("/")[-1] - event_dict["event_id"] = an_event_id + `Returns:` + A JSON with all the wrapper entries + """ + if page: + return self._get_page("wrappers", page, per_page, filter) + return self._get_entry_list("wrappers", limit, per_page, filter) - return event_dict + def get_wrapper(self, wrapper_id): + """ + `Args:` + wrapper_id: + The unique id of the wrapper + tagging_id: + The unique id of the tagging + `Returns:` + A JSON with the wrapper entry + """ + return self.api.get_request(f"wrappers/{wrapper_id}") diff --git a/test/test_action_network/test_action_network.py b/test/test_action_network/test_action_network.py index c6984d3861..4387afc006 100644 --- a/test/test_action_network/test_action_network.py +++ b/test/test_action_network/test_action_network.py @@ -344,81 +344,3618 @@ def setUp(self, m): "start_date": self.fake_date, "location": self.fake_location, "_links": { - "self": {"href": "https://actionnetwork.org/api/v2/events/fake-id"}, + "self": {"href": f"{self.api_url}/events/fake-id"}, }, "event_id": "fake-id", } + # Advocacy Campaigns + self.fake_advocacy_campaigns = { + "total_pages": 1, + "per_page": 25, + "page": 1, + "total_records": 3, + "_links": { + "next": {"href": f"{self.api_url}/advocacy_campaigns?page=2"}, + "self": {"href": f"{self.api_url}/advocacy_campaigns"}, + "osdi:advocacy_campaigns": [ + {"href": f"{self.api_url}/advocacy_campaigns/fake_url"}, + {"href": f"{self.api_url}/advocacy_campaigns/fake_url"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:advocacy_campaigns": [ + { + "origin_system": "FreeAdvocacy.com", + "identifiers": [ + "action_network:65345d7d-cd24-466a-a698-4a7686ef684f", + "free_forms:1", + ], + "created_date": "2014-03-25T14:40:07Z", + "modified_date": "2014-03-25T14:47:44Z", + "title": "Tell your Senator to stop the bad thing!", + "targets": "U.S. Senate", + "type": "email", + "total_outreaches": 25, + "action_network:hidden": False, + "_embedded": { + "osdi:creator": { + "given_name": "John", + "family_name": "Doe", + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "email_addresses": [ + { + "primary": True, + "address": "jdoe@mail.com", + "status": "subscribed", + } + ], + "phone_numbers": [ + { + "primary": True, + "number": "12021234444", + "number_type": "Mobile", + "status": "subscribed", + } + ], + "postal_addresses": [ + { + "primary": True, + "address_lines": ["1600 Pennsylvania Ave"], + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US", + "language": "en", + "location": { + "latitude": 32.935, + "longitude": -73.1338, + "accuracy": "Approximate", + }, + } + ], + "languages_spoken": ["en"], + "_links": { + "self": {"href": f"{self.api_url}/people/fake_url"}, + "osdi:attendances": { + "href": f"{self.api_url}/people/fake_url" + }, + "osdi:signatures": { + "href": f"{self.api_url}/people/fake_url" + }, + "osdi:submissions": { + "href": f"{self.api_url}/people/fake_url" + }, + "osdi:donations": { + "href": f"{self.api_url}/people/fake_url" + }, + "osdi:outreaches": { + "href": f"{self.api_url}/people/fake_url" + }, + "osdi:taggings": { + "href": f"{self.api_url}/people/fake_url" + }, + }, + } + }, + "_links": { + "self": { + "href": f"{self.api_url}/advocacy_campaigns/fake_url" + }, + "osdi:outreaches": { + "href": f"{self.api_url}/advocacy_campaigns/fake_url" + }, + "osdi:record_outreach_helper": { + "href": f"{self.api_url}/advocacy_campaigns/fake_url" + }, + "osdi:creator": {"href": f"{self.api_url}/people/fake_url"}, + "action_network:embed": { + "href": f"{self.api_url}/advocacy_campaigns/fake_url" + }, + }, + }, + { + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-21T23:39:53Z", + "modified_date": "2014-03-25T15:26:45Z", + "title": "Thank Acme's CEO for going green", + "description": "
Write a letter today!
", + "browser_url": "https://actionnetwork.org/letters/thanks-acme", + "featured_image_url": "https://actionnetwork.org/images/acme.jpg", + "targets": "Acme CEO", + "type": "email", + "total_outreaches": 6, + "action_network:hidden": False, + "_embedded": { + "osdi:creator": { + "given_name": "John", + "family_name": "Doe", + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "email_addresses": [ + { + "primary": True, + "address": "jdoe@mail.com", + "status": "subscribed", + } + ], + "phone_numbers": [ + { + "primary": True, + "number": "12021234444", + "number_type": "Mobile", + "status": "subscribed", + } + ], + "postal_addresses": [ + { + "primary": True, + "address_lines": ["1600 Pennsylvania Ave."], + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US", + "language": "en", + "location": { + "latitude": 32.934, + "longitude": -74.5319, + "accuracy": "Approximate", + }, + } + ], + "languages_spoken": ["en"], + "_links": { + "self": {"href": f"{self.api_url}/people/fake_url"}, + "osdi:attendances": { + "href": f"{self.api_url}/people/fake_url" + }, + "osdi:signatures": { + "href": f"{self.api_url}/people/fake_url" + }, + "osdi:submissions": { + "href": f"{self.api_url}/people/fake_url" + }, + "osdi:donations": { + "href": f"{self.api_url}/people/fake_url" + }, + "osdi:outreaches": { + "href": f"{self.api_url}/people/fake_url" + }, + "osdi:taggings": { + "href": f"{self.api_url}/people/fake_url" + }, + }, + } + }, + "_links": { + "self": { + "href": f"{self.api_url}/advocacy_campaigns/fake_url" + }, + "osdi:outreaches": { + "href": f"{self.api_url}/advocacy_campaigns/fake_url" + }, + "osdi:record_outreach_helper": { + "href": f"{self.api_url}/advocacy_campaigns/fake_url" + }, + "osdi:creator": {"href": f"{self.api_url}/people/fake_id"}, + "action_network:embed": { + "href": f"{self.api_url}/advocacy_campaigns/fake_url" + }, + }, + }, + { + "created_date": "2021-01-06T21:02:39Z", + "modified_date": "2021-01-11T19:34:59Z", + "identifiers": [ + "action_network:44618be7-29cb-439e-bc68-70e6e85dda1b" + ], + "origin_system": "Action Network", + "name": "Call your elected officials", + "title": "Call your elected officials", + "type": "phone", + "total_outreaches": 9, + "action_network:sponsor": {"title": "Progressive Action Now"}, + "action_network:hidden": False, + "_links": { + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + "self": { + "href": f"{self.api_url}/advocacy_campaigns/fake_url" + }, + "osdi:outreaches": { + "href": f"{self.api_url}/advocacy_campaigns/fake_url" + }, + "osdi:creator": {"href": f"{self.api_url}/people/fake_url"}, + "osdi:record_outreach_helper": { + "href": f"{self.api_url}/advocacy_campaigns/fake_url" + }, + }, + }, + ] + }, + } + self.fake_advocacy_campaign = { + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-21T23:39:53Z", + "modified_date": "2014-03-25T15:26:45Z", + "title": "Thank Acme's CEO for going green", + "description": "Write a letter today!
", + "browser_url": "https://actionnetwork.org/letters/thanks-acme", + "featured_image_url": "https://actionnetwork.org/images/acme.jpg", + "targets": "Acme CEO", + "type": "email", + "total_outreaches": 6, + "action_network:hidden": True, + "_embedded": { + "osdi:creator": { + "given_name": "John", + "family_name": "Doe", + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "email_addresses": [ + { + "primary": True, + "address": "jdoe@mail.com", + "status": "subscribed", + } + ], + "phone_numbers": [ + { + "primary": True, + "number": "12021234444", + "number_type": "Mobile", + "status": "subscribed", + } + ], + "postal_addresses": [ + { + "primary": True, + "address_lines": ["1600 Pennsylvania Ave"], + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US", + "language": "en", + "location": { + "latitude": 32.934, + "longitude": -72.0377, + "accuracy": "Approximate", + }, + } + ], + "languages_spoken": ["en"], + "_links": { + "self": {"href": f"{self.api_url}/people/fake_id"}, + "osdi:attendances": { + "href": f"{self.api_url}/people/fake_id/attendances" + }, + "osdi:signatures": { + "href": f"{self.api_url}/people/fake_id/signatures" + }, + "osdi:submissions": { + "href": f"{self.api_url}/people/fake_id/submissions" + }, + "osdi:donations": { + "href": f"{self.api_url}/people/fake_id/donations" + }, + "osdi:outreaches": { + "href": f"{self.api_url}/people/fake_id/outreaches" + }, + "osdi:taggings": { + "href": f"{self.api_url}/people/fake_id/taggings" + }, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + }, + "_links": { + "self": {"href": f"{self.api_url}/advocacy_campaigns/fake_id"}, + "osdi:outreaches": { + "href": f"{self.api_url}/advocacy_campaigns/fake_id/outreaches" + }, + "osdi:record_outreach_helper": { + "href": f"{self.api_url}/advocacy_campaigns/fake_id/outreaches" + }, + "osdi:creator": {"href": f"{self.api_url}/people/fake_id"}, + "action_network:embed": { + "href": f"{self.api_url}/advocacy_campaigns/fake_id/embed" + }, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + + # Attendances + self.fake_attendances = { + "total_pages": 1, + "per_page": 25, + "page": 1, + "total_records": 20, + "_links": { + "self": {"href": f"{self.api_url}/events/fake_id/attendances"}, + "osdi:attendance": [ + {"href": f"{self.api_url}/events/fake_id/attendances/fake_id"}, + {"href": f"{self.api_url}/events/fake_id/attendances/fake_id"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:attendances": [ + { + "identifiers": [ + "action_network:d51ca19e-9fe9-11e3-a2e9-12313d316c29" + ], + "created_date": "2014-02-18T20:52:59Z", + "modified_date": "2014-02-18T20:53:00Z", + "status": "accepted", + "action_network:person_id": "fake_id", + "action_network:event_id": "fake_id", + "_links": { + "self": { + "href": f"{self.api_url}/events/fake_id/attendances/fake_id" + }, + "osdi:event": {"href": f"{self.api_url}/events/fake_id"}, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + }, + }, + { + "identifiers": ["action_network:fake_id"], + "created_date": "2014-02-18T20:23:42Z", + "modified_date": "2014-02-18T20:23:42Z", + "status": "accepted", + "action_network:person_id": "fake_id", + "action_network:event_id": "fake_id", + "_links": { + "self": { + "href": f"{self.api_url}/events/fake_id/attendances/fake_id" + }, + "osdi:event": {"href": f"{self.api_url}/events/fake_id"}, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + }, + }, + ] + }, + } + self.fake_attendance = { + "identifiers": ["action_network:d51ca19e-9fe9-11e3-a2e9-12313d316c29"], + "created_date": "2014-02-18T20:52:59Z", + "modified_date": "2014-02-18T20:53:00Z", + "status": "accepted", + "action_network:person_id": "fake_id", + "action_network:event_id": "fake_id", + "_links": { + "self": {"href": f"{self.api_url}/events/fake_id/attendances/fake_id"}, + "osdi:event": {"href": f"{self.api_url}/events/fake_id"}, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + + # Campaigns + self.fake_campaigns = { + "total_pages": 2, + "per_page": 25, + "page": 1, + "total_records": 30, + "_links": { + "next": {"href": f"{self.api_url}/campaigns?page=2"}, + "self": {"href": f"{self.api_url}/campaigns"}, + "action_network:campaigns": [ + {"href": f"{self.api_url}/campaigns/fake_id"}, + {"href": f"{self.api_url}/campaigns/fake_id"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "action_network:campaigns": [ + { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2013-10-02T14:21:32Z", + "modified_date": "2013-10-02T14:22:06Z", + "title": "Join our week of actions!", + "description": "Our week of action is here --" + "click the links on the right to join in!
", + "browser_url": "fake_url", + "featured_image_url": "fake_url", + "action_network:hidden": False, + "action_network:sponsor": { + "title": "Progressive Action Now", + "browser_url": "fake_url", + }, + "actions": [ + { + "title": "Sign the petition", + "browser_url": "fake_url", + }, + { + "title": "Attend the rally", + "browser_url": "fake_url", + }, + ], + "_links": { + "self": {"href": f"{self.api_url}/campaigns/fake_id"} + }, + }, + { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2013-09-30T15:55:44Z", + "modified_date": "2014-01-16T19:07:00Z", + "title": "Welcome to our Action Center", + "description": "Welcome to our Action Center." + "Take action on the right.
", + "browser_url": "fake_url", + "action_network:sponsor": { + "title": "Progressive Action Now", + "browser_url": "fake_url", + }, + "actions": [ + { + "title": "Sign up for email updates", + "browser_url": "fake_url", + }, + { + "title": "Take our survey", + "browser_url": "fake_url", + }, + ], + "_links": { + "self": {"href": f"{self.api_url}/campaigns/fake_id"} + }, + }, + ] + }, + } + self.fake_campaign = { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2013-10-02T14:21:32Z", + "modified_date": "2013-10-02T14:22:06Z", + "title": "Join our week of actions!", + "description": "Our week of action is here --" + "click the links on the right to join in!
", + "browser_url": "https://actionnetwork.org/campaigns/join-our-week-of-action", + "featured_image_url": "https://actionnetwork.org/images/week-of-action.jpg", + "action_network:hidden": False, + "action_network:sponsor": { + "title": "Progressive Action Now", + "browser_url": "https://actionnetwork.org/groups/progressive-action-now", + }, + "actions": [ + { + "title": "Sign the petition", + "browser_url": "https://actionnetwork.org/petitions/sign-the-petition", + }, + { + "title": "Attend the rally", + "browser_url": "https://actionnetwork.org/events/attend-the-rally", + }, + ], + "_links": { + "self": {"href": f"{self.api_url}/campaigns/fake_id"}, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + + # Custom Fields + self.fake_custom_fields = { + "origin_system": "Action Network", + "name": "Custom Fields", + "description": "The collection of custom fields available at this endpoint.", + "_links": { + "self": [ + { + "href": "https://dev.actionnetwork.org/api/v2/metadata/custom_fields" + } + ], + "curies": [ + { + "name": "osdi", + "href": "https://dev.actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://dev.actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "action_network:custom_fields": [ + { + "name": "employer", + "created_date": "2020-04-21T18:24:11Z", + "modified_date": "2020-04-21T18:24:11Z", + "notes": None, + }, + { + "name": "mobile_message_referrer", + "created_date": "2020-04-22T15:39:25Z", + "modified_date": "2020-04-22T15:39:25Z", + "notes": None, + }, + { + "name": "occupation", + "created_date": "2020-04-21T18:25:35Z", + "modified_date": "2020-04-21T18:25:35Z", + "notes": None, + }, + { + "name": "volunteer", + "created_date": "2019-09-26T18:06:06Z", + "modified_date": "2019-09-26T18:06:06Z", + "notes": None, + }, + ], + } + + # Donations + self.fake_donations = { + "total_pages": 1, + "per_page": 25, + "page": 1, + "total_records": 6, + "_links": { + "self": {"href": f"{self.api_url}/fundraising_pages/fake_id/donations"}, + "osdi:donations": [ + { + "href": f"{self.api_url}/fundraising_pages/fake_id/donations/fake_id" + }, + { + "href": f"{self.api_url}/fundraising_pages/fake_id/donations/fake_id" + }, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "Ttemplated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:donations": [ + { + "identifiers": [ + "action_network:f1119c4e-b8ca-44ff-bfa7-f78f7ca3ec16" + ], + "created_date": "2014-03-27T17:42:21Z", + "modified_date": "2014-03-27T17:42:24Z", + "currency": "USD", + "amount": "20.01", + "recipients": [ + {"display_name": "John Doe", "amount": "6.67"}, + { + "display_name": "Progressive Action Now", + "amount": "6.67", + }, + {"display_name": "Jane Black", "amount": "6.67"}, + ], + "payment": { + "method": "Credit Card", + "reference_number": "f1119c4e-b8ca-44ff-bfa7-f78f7ca3ec16", + "authorization_stored": False, + }, + "action_network:recurrence": { + "recurring": True, + "period": "Monthly", + }, + "action_network:person_id": "fake_id", + "action_network:fundraising_page_id": "fake_id", + "_links": { + "self": { + "href": f"{self.api_url}/fundraising_pages/fake_url" + }, + "osdi:fundraising_page": { + "href": f"{self.api_url}/fake_url" + }, + "osdi:person": {"href": f"{self.api_url}/people/fake_url"}, + }, + }, + { + "identifiers": [ + "action_network:d86538c1-e8f7-46e1-8320-552da81bd48d" + ], + "created_date": "2014-03-27T17:40:56Z", + "modified_date": "2014-03-27T17:41:11Z", + "currency": "USD", + "amount": "20.00", + "recipients": [ + {"display_name": "John Doe", "amount": "10.00"}, + { + "display_name": "Progressive Action Now", + "amount": "10.00", + }, + ], + "payment": { + "method": "Credit Card", + "reference_number": "d86538c1-e8f7-46e1-8320-552da81bd48d", + "authorization_stored": False, + }, + "action_network:recurrence": {"recurring": False}, + "action_network:person_id": "fake_id", + "action_network:fundraising_page_id": "fake_id", + "_links": { + "self": { + "href": "fundraising_pages/fake_id/donations/fake_id" + }, + "osdi:fundraising_page": { + "href": f"{self.api_url}/fundraising_pages/fake_id" + }, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + }, + }, + ] + }, + } + self.fake_donation = { + "identifiers": ["action_network:f1119c4e-b8ca-44ff-bfa7-f78f7ca3ec16"], + "created_date": "2014-03-27T17:42:21Z", + "modified_date": "2014-03-27T17:42:24Z", + "currency": "USD", + "amount": "20.01", + "recipients": [ + {"display_name": "John Doe", "amount": "6.67"}, + {"display_name": "Progressive Action Now", "amount": "6.67"}, + {"display_name": "Jane Black", "amount": "6.67"}, + ], + "payment": { + "method": "Credit Card", + "reference_number": "f1119c4e-b8ca-44ff-bfa7-f78f7ca3ec16", + "authorization_stored": False, + }, + "action_network:recurrence": {"recurring": True, "period": "Monthly"}, + "action_network:person_id": "fake_id", + "action_network:fundraising_page_id": "fake_id", + "_links": { + "self": { + "href": f"{self.api_url}/fundraising_pages/fake_id/donations/fake_id" + }, + "osdi:fundraising_page": { + "href": f"{self.api_url}/fundraising_pages/fake_id" + }, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + + # Embeds + self.fake_embed = { + "embed_standard_default_styles": "Host house parties next " + "week to help us win our campaign!
", + "host_pitch": "Hosting a house party is easy! Sign up and we'll give " + "you what you need to know.", + "host_instructions": "Download our toolkit for all the " + "instructions you need to host an event.
", + "browser_url": "fake_url", + "host_url": "fake_url", + "featured_image_url": "fake_url", + "total_events": 35, + "total_rsvps": 467, + "action_network:hidden": False, + "action_network:sponsor": { + "title": "Progressive Action Now", + "url": "fake_url", + }, + "_links": { + "self": {"href": f"{self.api_url}/event_campaigns/fake_id"}, + "osdi:events": { + "href": f"{self.api_url}/event_campaigns/fake_id/events" + }, + "action_network:embed": { + "href": f"{self.api_url}/event_campaigns/fake_id/embed" + }, + }, + }, + { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2014-02-03T16:32:34Z", + "modified_date": "2014-02-03T16:42:10Z", + "title": "Protest the bad bill in your town", + "description": "Help us stop this bad bill from " + "becoming law by joining a local protest.
", + "host_pitch": "Hosting is easy, we'll help you out, do it now!", + "host_instructions": "Here's everything " + "you need to host a protest...
", + "browser_url": "fake_url", + "host_url": "fake_url", + "total_events": 4, + "total_rsvps": 11, + "action_network:sponsor": { + "title": "Progressive Action Now", + "url": "fake_url", + }, + "_links": { + "self": {"href": f"{self.api_url}/event_campaigns/fake_id"}, + "osdi:events": { + "href": f"{self.api_url}/event_campaigns/fake_id/events" + }, + "action_network:embed": { + "href": f"{self.api_url}/event_campaigns/fake_id/embed" + }, + }, + }, + ] + }, + } + self.fake_event_campaign = { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2014-02-03T16:32:34Z", + "modified_date": "2014-02-03T16:42:10Z", + "title": "Protest the bad bill in your town", + "description": "Help us stop this bad bill from becoming" + "law by joining a local protest.
", + "host_pitch": "Hosting is easy, we'll help you out, do it now!", + "host_instructions": "Here's everything you need to host a protest...
", + "browser_url": "fake_url", + "host_url": "fake_url", + "featured_image_url": "fake_url", + "total_events": 4, + "total_rsvps": 11, + "action_network:hidden": False, + "action_network:sponsor": { + "title": "Progressive Action Now", + "url": "fake_url", + }, + "_links": { + "self": {"href": f"{self.api_url}/event_campaigns/fake_id"}, + "osdi:events": { + "href": f"{self.api_url}/event_campaigns/fake_id/events" + }, + "action_network:embed": { + "href": f"{self.api_url}/event_campaigns/fake_id/embed" + }, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + + # Events + self.fake_events = { + "total_pages": 10, + "per_page": 25, + "page": 1, + "total_records": 250, + "_links": { + "next": {"href": f"{self.api_url}/events?page=2"}, + "self": {"href": f"{self.api_url}/events"}, + "osdi:events": [ + {"href": f"{self.api_url}/events/fake_id"}, + {"href": f"{self.api_url}/events/fake_id"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:events": [ + { + "origin_system": "FreeEvents.com", + "identifiers": [ + "action_network:fake_id", + "free_events:1", + ], + "status": "confirmed", + "created_date": "2014-03-18T22:17:36Z", + "modified_date": "2014-03-19T14:07:41Z", + "title": "House Party for Justice", + "transparence": "opaque", + "visibility": "public", + "guests_can_invite_others": True, + "capacity": 10, + "reminders": [{"method": "email", "minutes": 1440}], + "total_accepted": 5, + "action_network:hidden": False, + "location": { + "venue": "My House", + "address_lines": ["1600 Pennsylvania Ave"], + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US", + "language": "en", + "location": { + "latitude": 33.1037330420451, + "longitude": -72.0439414557911, + "accuracy": "Rooftop", + }, + }, + "_links": { + "self": {"href": f"{self.api_url}/events/fake_id"}, + "osdi:attendances": { + "href": f"{self.api_url}/events/fake_id/attendances" + }, + "osdi:record_attendance_helper": { + "href": f"{self.api_url}/events/fake_id/attendances" + }, + "osdi:organizer": { + "href": f"{self.api_url}/people/fake_id" + }, + "osdi:creator": {"href": f"{self.api_url}/people/fake_id"}, + "action_network:embed": { + "href": f"{self.api_url}/events/fake_id/embed" + }, + }, + }, + { + "identifiers": ["action_network:fake_id"], + "status": "confirmed", + "created_date": "2014-03-18T21:08:18Z", + "modified_date": "2014-03-18T22:15:11Z", + "origin_system": "Action Network", + "title": "Movie Screening", + "description": "Come watch this awesome movie!
", + "instructions": "Feel free to bring a friend
", + "browser_url": "https://actionnetwork.org/events/movie-screening", + "featured_image_url": "https://actionnetwork.org/images/screening.jpg", + "start_date": "2014-03-22T17:45:00Z", + "transparence": "opaque", + "visibility": "public", + "guests_can_invite_others": True, + "reminders": [{"method": "email", "minutes": 1440}], + "total_accepted": 7, + "action_network:hidden": False, + "action_network:sponsor": { + "title": "Progressive Action Now", + "browser_url": "fake_url", + }, + "location": { + "venue": "My house", + "address_lines": ["1600 Pennsylvania Ave"], + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US", + "language": "en", + "location": { + "latitude": 32.9135624691629, + "longitude": -76.0487183148486, + "accuracy": "Rooftop", + }, + }, + "_links": { + "self": {"href": f"{self.api_url}/events/fake_id"}, + "osdi:attendances": { + "href": f"{self.api_url}/events/fake_id/attendances" + }, + "osdi:record_attendance_helper": { + "href": f"{self.api_url}/events/fake_id/attendances" + }, + "osdi:organizer": { + "href": f"{self.api_url}/people/fake_id" + }, + "osdi:creator": {"href": f"{self.api_url}/people/fake_id"}, + "action_network:embed": { + "href": f"{self.api_url}/events/fake_id/embed" + }, + }, + }, + ] + }, + } + self.fake_event2 = { + "origin_system": "FreeEvents.com", + "identifiers": [ + "action_network:fake_id", + "free_events:1", + ], + "status": "confirmed", + "created_date": "2014-03-18T22:17:36Z", + "modified_date": "2014-03-19T14:07:41Z", + "title": "House Party for Justice", + "transparence": "opaque", + "visibility": "public", + "guests_can_invite_others": True, + "capacity": 10, + "reminders": [{"method": "email", "minutes": 1440}], + "total_accepted": 5, + "action_network:hidden": False, + "location": { + "venue": "My House", + "address_lines": ["1600 Pennsylvania Ave"], + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US", + "language": "en", + "location": { + "latitude": 33.1037330420451, + "longitude": -72.0439414557911, + "accuracy": "Rooftop", + }, + }, + "_links": { + "self": {"href": f"{self.api_url}/events/fake_id"}, + "osdi:attendances": { + "href": f"{self.api_url}/events/fake_id/attendances" + }, + "osdi:record_attendance_helper": { + "href": f"{self.api_url}/events/fake_id/attendances" + }, + "osdi:organizer": {"href": f"{self.api_url}/people/fake_id"}, + "osdi:creator": {"href": f"{self.api_url}/people/fake_id"}, + "action_network:embed": { + "href": f"{self.api_url}/events/fake_id/embed" + }, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + + # Forms + self.fake_forms = { + "total_pages": 10, + "per_page": 25, + "page": 1, + "total_records": 250, + "_links": { + "next": {"href": f"{self.api_url}/forms?page=2"}, + "self": {"href": f"{self.api_url}/forms"}, + "osdi:forms": [ + { + "href": f"{self.api_url}/forms/65345d7d-cd24-466a-a698-4a7686ef684f" + }, + {"href": f"{self.api_url}/forms/fake_id"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:forms": [ + { + "origin_system": "FreeForms.com", + "identifiers": [ + "action_network:65345d7d-cd24-466a-a698-4a7686ef684f", + "free_forms:1", + ], + "created_date": "2014-03-25T14:40:07Z", + "modified_date": "2014-03-25T14:47:44Z", + "title": "Tell your story", + "total_submissions": 25, + "action_network:hidden": False, + "_embedded": { + "osdi:creator": { + "given_name": "John", + "family_name": "Doe", + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "email_addresses": [ + { + "primary": True, + "address": "jdoe@mail.com", + "status": "subscribed", + } + ], + "phone_numbers": [ + { + "primary": True, + "number": "12021234444", + "number_type": "Mobile", + "status": "subscribed", + } + ], + "postal_addresses": [ + { + "primary": True, + "address_lines": ["1600 Pennsylvania Ave"], + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US", + "language": "en", + "location": { + "latitude": 32.935, + "longitude": -73.1338, + "accuracy": "Approximate", + }, + } + ], + "languages_spoken": ["en"], + "_links": { + "self": {"href": f"{self.api_url}/people/fake_id"}, + "osdi:attendances": { + "href": f"{self.api_url}/people/fake_id/attendances" + }, + "osdi:signatures": { + "href": f"{self.api_url}/people/fake_id/signatures" + }, + "osdi:submissions": { + "href": f"{self.api_url}/people/fake_id/submissions" + }, + "osdi:donations": { + "href": f"{self.api_url}/people/fake_id/donations" + }, + "osdi:outreaches": { + "href": f"{self.api_url}/people/fake_id/outreaches" + }, + "osdi:taggings": { + "href": f"{self.api_url}/people/fake_id/taggings" + }, + }, + } + }, + "_links": { + "self": {"href": f"{self.api_url}/forms/fake_id"}, + "osdi:submissions": { + "href": f"{self.api_url}/forms/fake_id/submissions" + }, + "osdi:record_submission_helper": { + "href": f"{self.api_url}/forms/fake_id/submissions" + }, + "osdi:creator": {"href": f"{self.api_url}/people/fake_id"}, + "action_network:embed": { + "href": f"{self.api_url}/forms/fake_id/embed" + }, + }, + }, + { + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-21T23:39:53Z", + "modified_date": "2014-03-25T15:26:45Z", + "title": "Take our end of year survey", + "description": "Let us know what you think!
", + "call_to_action": "Let us know", + "browser_url": "https://actionnetwork.org/forms/end-of-year-survey", + "featured_image_url": "https://actionnetwork.org/images/survey.jpg", + "total_submissions": 6, + "action_network:hidden": False, + "_embedded": { + "osdi:creator": { + "given_name": "John", + "family_name": "Doe", + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "email_addresses": [ + { + "primary": True, + "address": "jdoe@mail.com", + "status": "subscribed", + } + ], + "phone_numbers": [ + { + "primary": True, + "number": "12021234444", + "number_type": "Mobile", + "status": "subscribed", + } + ], + "postal_addresses": [ + { + "primary": True, + "address_lines": ["1600 Pennsylvania Ave."], + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US", + "language": "en", + "location": { + "latitude": 32.934, + "longitude": -74.5319, + "accuracy": "Approximate", + }, + } + ], + "languages_spoken": ["en"], + "_links": { + "self": {"href": f"{self.api_url}/people/fake_id"}, + "osdi:attendances": { + "href": f"{self.api_url}/people/fake_id/attendances" + }, + "osdi:signatures": { + "href": f"{self.api_url}/people/fake_id/signatures" + }, + "osdi:submissions": { + "href": f"{self.api_url}/people/fake_id/submissions" + }, + "osdi:donations": { + "href": f"{self.api_url}/people/fake_id/donations" + }, + "osdi:outreaches": { + "href": f"{self.api_url}/people/fake_id/outreaches" + }, + "osdi:taggings": { + "href": f"{self.api_url}/people/fake_id/taggings" + }, + }, + } + }, + "_links": { + "self": {"href": f"{self.api_url}/forms/fake_id"}, + "osdi:submissions": { + "href": f"{self.api_url}/forms/fake_id/submissions" + }, + "osdi:record_submission_helper": { + "href": f"{self.api_url}/forms/fake_id/submissions" + }, + "osdi:creator": {"href": f"{self.api_url}/people/fake_id"}, + "action_network:embed": { + "href": f"{self.api_url}/forms/fake_id/embed" + }, + }, + }, + ] + }, + } + self.fake_form = { + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-21T23:39:53Z", + "modified_date": "2014-03-25T15:26:45Z", + "title": "Take our end of year survey", + "description": "Let us know what you think!
", + "call_to_action": "Let us know", + "browser_url": "https://actionnetwork.org/forms/end-of-year-survey", + "featured_image_url": "https://actionnetwork.org/images/survey.jpg", + "total_submissions": 6, + "action_network:hidden": False, + "_embedded": { + "osdi:creator": { + "given_name": "John", + "family_name": "Doe", + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "email_addresses": [ + { + "primary": True, + "address": "jdoe@mail.com", + "status": "subscribed", + } + ], + "phone_numbers": [ + { + "primary": True, + "number": "12021234444", + "number_type": "Mobile", + "status": "subscribed", + } + ], + "postal_addresses": [ + { + "primary": True, + "address_lines": ["1600 Pennsylvania Ave"], + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US", + "language": "en", + "location": { + "latitude": 32.934, + "longitude": -72.0377, + "accuracy": "Approximate", + }, + } + ], + "languages_spoken": ["en"], + "_links": { + "self": {"href": f"{self.api_url}/people/fake_id"}, + "osdi:attendances": { + "href": f"{self.api_url}/people/fake_id/attendances" + }, + "osdi:signatures": { + "href": f"{self.api_url}/people/fake_id/signatures" + }, + "osdi:submissions": { + "href": f"{self.api_url}/people/fake_id/submissions" + }, + "osdi:donations": { + "href": f"{self.api_url}/people/fake_id/donations" + }, + "osdi:outreaches": { + "href": f"{self.api_url}/people/fake_id/outreaches" + }, + "osdi:taggings": { + "href": f"{self.api_url}/people/fake_id/taggings" + }, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + }, + "_links": { + "self": {"href": f"{self.api_url}/forms/fake_id"}, + "osdi:submissions": { + "href": f"{self.api_url}/forms/fake_id/submissions" + }, + "osdi:record_submission_helper": { + "href": f"{self.api_url}/forms/fake_id/submissions" + }, + "osdi:creator": {"href": f"{self.api_url}/people/fake_id"}, + "action_network:embed": {"href": f"{self.api_url}/forms/fake_id/embed"}, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + + # Fundraising Pages + self.fake_fundraising_pages = { + "total_pages": 1, + "per_page": 1, + "page": 1, + "total_records": 1, + "_links": { + "next": {"href": f"{self.api_url}/fundraising_pages?page=2"}, + "osdi:fundraising_pages": [ + {"href": f"{self.api_url}/fundraising_pages/{self.fake_tag_id_1}"}, + ], + "curies": [ + {"name": "osdi", "templated": True}, + {"name": "action_network", "templated": True}, + ], + "self": {"href": f"{self.api_url}/fundraising_pages"}, + }, + "_embedded": { + "osdi:fundraising_pages": [ + { + "identifiers": [""], + "created_date": self.fake_date, + "total_donations": 0, + "total_amount": "0.00", + "currency": "USD", + "action_network:sponsor": {"title": "", "browser_url": ""}, + "_links": { + "self": {"href": f"{self.api_url}/fundraising_pages"}, + "osdi:creator": {"href": "fake_url"}, + "osdi:donations": {"href": "fake_url"}, + "osdi:record_donation_helper": {"href": "fake_url"}, + }, + "modified_date": self.fake_date, + "origin_system": "Test", + "title": "Hello", + "_embedded": {"osdi:creator": ""}, + "action_network:hidden": False, + } + ] + }, + } + self.fake_fundraising_page = { + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-04T18:14:03Z", + "modified_date": "2014-03-24T16:07:13Z", + "title": "Year end fundraising", + "description": "Donate today!
", + "browser_url": "https://actionnetwork.org/fundraising/year-end-fundraising-2", + "featured_image_url": "https://actionnetwork.org/images/donate.jpg", + "total_donations": 5, + "total_amount": "302.14", + "currency": "USD", + "action_network:hidden": False, + "_embedded": { + "osdi:creator": { + "given_name": "John", + "family_name": "Doe", + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-24T19:39:40Z", + "modified_date": "2014-03-24T19:48:23Z", + "email_addresses": [ + { + "primary": True, + "address": "jdoe@mail.com", + "status": "subscribed", + } + ], + "phone_numbers": [ + { + "primary": True, + "number": "12021234444", + "number_type": "Mobile", + "status": "subscribed", + } + ], + "postal_addresses": [ + { + "primary": True, + "address_lines": ["1600 Pennsylvania Ave"], + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US", + "language": "en", + "location": { + "latitude": 32.945, + "longitude": -76.3477, + "accuracy": "Approximate", + }, + } + ], + "languages_spoken": ["en"], + "_links": { + "self": {"href": f"{self.api_url}/people/fake_id"}, + "osdi:attendances": { + "href": f"{self.api_url}/people/fake_id/attendances" + }, + "osdi:signatures": { + "href": f"{self.api_url}/people/fake_id/signatures" + }, + "osdi:submissions": { + "href": f"{self.api_url}/people/fake_id/submissions" + }, + "osdi:donations": { + "href": f"{self.api_url}/people/fake_id/donations" + }, + "osdi:outreaches": { + "href": f"{self.api_url}/people/fake_id/outreaches" + }, + "osdi:taggings": { + "href": f"{self.api_url}/people/fake_id/taggings" + }, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + }, + "action_network:sponsor": { + "title": "Progressive Action Now", + "url": "https://actionnetwork.org/groups/progressive-action-now", + }, + "_links": { + "self": {"href": f"{self.api_url}/fundraising_pages/fake_id"}, + "osdi:donations": { + "href": f"{self.api_url}/fundraising_pages/fake_id/donations" + }, + "osdi:record_donation_helper": { + "href": f"{self.api_url}/fundraising_pages/fake_id/donations" + }, + "osdi:creator": {"href": f"{self.api_url}/people/fake_id"}, + "action_network:embed": { + "href": f"{self.api_url}/fundraising_pages/fake_id/embed" + }, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + + # Items + self.fake_items = { + "per_page": 25, + "page": 1, + "_links": { + "next": {"href": f"{self.api_url}/lists/fake_id/items?page=2"}, + "self": {"href": f"{self.api_url}/lists/fake_id/items"}, + "osdi:items": [ + {"href": f"{self.api_url}/lists/fake_id/items/fake_id"}, + {"href": f"{self.api_url}/lists/fake_id/items/fake_id"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:items": [ + { + "_links": { + "self": { + "href": f"{self.api_url}/lists/fake_id/items/fake_id" + }, + "osdi:list": {"href": f"{self.api_url}/lists/fake_id"}, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + }, + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-18T22:25:31Z", + "modified_date": "2014-03-18T22:25:38Z", + "item_type": "osdi:person", + "action_network:person_id": "fake_id", + "action_network:list_id": "fake_id", + }, + { + "_links": { + "self": { + "href": f"{self.api_url}/lists/fake_id/items/fake_id" + }, + "osdi:list": {"href": f"{self.api_url}/lists/fake_id"}, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + }, + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-18T22:24:24Z", + "modified_date": "2014-03-18T22:24:24Z", + "item_type": "osdi:person", + "action_network:person_id": "fake_id", + "action_network:list_id": "fake_id", + }, + ] + }, + } + self.fake_item = { + "_links": { + "self": {"href": f"{self.api_url}/lists/fake_id/items/fake_id"}, + "osdi:list": {"href": f"{self.api_url}/lists/fake_id"}, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-18T22:25:31Z", + "modified_date": "2014-03-18T22:25:38Z", + "item_type": "osdi:person", + "action_network:person_id": "fake_id", + "action_network:list_id": "fake_id", + } + + # Lists + self.fake_lists = { + "total_pages": 10, + "per_page": 25, + "page": 1, + "total_records": 243, + "_links": { + "next": {"href": f"{self.api_url}/lists?page=2"}, + "self": {"href": f"{self.api_url}/lists"}, + "osdi:lists": [ + {"href": f"{self.api_url}/lists/fake_id"}, + {"href": f"{self.api_url}/lists/fake_id"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:lists": [ + { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2014-03-25T17:11:33Z", + "modified_date": "2014-03-25T17:13:33Z", + "title": "Stop Doing The Bad Thing Petition Signers", + "description": "Report", + "browser_url": "fake_url", + "_links": { + "self": {"href": f"{self.api_url}/lists/fake_id"}, + "osdi:items": { + "href": f"{self.api_url}/lists/fake_id/items" + }, + }, + }, + { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2014-03-24T18:26:42Z", + "modified_date": "2014-03-24T18:27:17Z", + "title": "Sign our new petition!", + "description": "Email", + "browser_url": "fake_url", + "_links": { + "self": {"href": f"{self.api_url}/lists/fake_id"}, + "osdi:items": { + "href": f"{self.api_url}/lists/fake_id/items" + }, + }, + }, + ] + }, + } + self.fake_list = { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2014-03-25T17:11:33Z", + "modified_date": "2014-03-25T17:13:33Z", + "title": "Stop Doing The Bad Thing Petition Signers", + "description": "Report", + "browser_url": "fake_url", + "_links": { + "self": {"href": f"{self.api_url}/lists/fake_id"}, + "osdi:items": {"href": f"{self.api_url}/lists/fake_id/items"}, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + + # Messages + self.fake_messages = { + "total_pages": 7, + "per_page": 25, + "page": 1, + "total_records": 162, + "_links": { + "next": {"href": f"{self.api_url}/messages?page=2"}, + "self": {"href": f"{self.api_url}/messages"}, + "osdi:messages": [ + {"href": f"{self.api_url}/messages/fake_id"}, + {"href": f"{self.api_url}/messages/fake_id"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:messages": [ + { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "subject": "Stop doing the bad thing", + "body": "The mayor should stop doing the bad thing.
", + "from": "Progressive Action Now", + "reply_to": "jane@progressiveactionnow.org", + "administrative_url": "fake_url", + "total_targeted": 2354, + "status": "sent", + "sent_start_date": "2014-03-26T15:00:22Z", + "type": "email", + "targets": [{"href": f"{self.api_url}/queries/fake_id"}], + "statistics": { + "sent": 2354, + "opened": 563, + "clicked": 472, + "actions": 380, + "action_network:donated": 14, + "action_network:total_amount": 320.25, + "unsubscribed": 12, + "bounced": 2, + "spam_reports": 1, + }, + "_links": { + "self": {"href": f"{self.api_url}/messages/fake_id"}, + "osdi:wrapper": { + "href": f"{self.api_url}/wrappers/fake_id" + }, + "osdi:recipients": { + "href": f"{self.api_url}/lists/950e9954-606f-43e6-be99-2bc0bc2072a1" + }, + "osdi:send_helper": { + "href": f"{self.api_url}/messages/fake_id/send" + }, + "osdi:schedule_helper": { + "href": f"{self.api_url}/messages/fake_id/schedule" + }, + }, + }, + { + "identifiers": [ + "action_network:fake_id", + "foreign_system:1", + ], + "origin_system": "My Email Making System", + "created_date": "2014-03-27T18:03:45Z", + "modified_date": "2014-03-28T15:00:22Z", + "subject": "FWD: Stop doing the bad thing", + "body": "Have you signed yet? " + "The mayor should stop doing the bad thing.
", + "from": "Progressive Action Now", + "reply_to": "jane@progressiveactionnow.org", + "administrative_url": "fake_url", + "total_targeted": 12673, + "status": "draft", + "type": "email", + "targets": [], + "_links": { + "self": {"href": f"{self.api_url}/messages/fake_id"}, + "osdi:send_helper": { + "href": f"{self.api_url}/messages/fake_id/send" + }, + "osdi:schedule_helper": { + "href": f"{self.api_url}/messages/fake_id/schedule" + }, + }, + }, + ] + }, + } + self.fake_message = { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "subject": "Stop doing the bad thing", + "body": "The mayor should stop doing the bad thing.
", + "from": "Progressive Action Now", + "reply_to": "jane@progressiveactionnow.org", + "administrative_url": "fake_url", + "total_targeted": 2354, + "status": "sent", + "sent_start_date": "2014-03-26T15:00:22Z", + "type": "email", + "targets": [{"href": f"{self.api_url}/queries/fake_id"}], + "statistics": { + "sent": 2354, + "opened": 563, + "clicked": 472, + "actions": 380, + "action_network:donated": 14, + "action_network:total_amount": 320.25, + "unsubscribed": 12, + "bounced": 2, + "spam_reports": 1, + }, + "_links": { + "self": {"href": f"{self.api_url}/messages/fake_id"}, + "osdi:wrapper": {"href": f"{self.api_url}/wrappers/fake_id"}, + "osdi:recipients": { + "href": f"{self.api_url}/lists/950e9954-606f-43e6-be99-2bc0bc2072a1" + }, + "osdi:send_helper": {"href": f"{self.api_url}/messages/fake_id/send"}, + "osdi:schedule_helper": { + "href": f"{self.api_url}/messages/fake_id/schedule" + }, + }, + } + + # Metadata + self.fake_metadata = { + "name": "Action Network", + "_links": { + "curies": [ + { + "name": "osdi", + "href": "https://dev.actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://dev.actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + "self": {"href": "https://dev.actionnetwork.org/api/v2/metadata"}, + "action_network:custom_fields": { + "href": "https://dev.actionnetwork.org/api/v2/metadata/custom_fields" + }, + }, + } + + # Outreaches + self.fake_outreaches = { + "total_pages": 1, + "per_page": 25, + "page": 1, + "total_records": 6, + "_links": { + "self": { + "href": f"{self.api_url}/advocacy_campaigns/fake_id/outreaches" + }, + "osdi:outreaches": [ + { + "href": f"{self.api_url}/advocacy_campaigns/fake_id/outreaches/fake_id" + }, + { + "href": f"{self.api_url}/advocacy_campaigns/fake_id/outreaches/dfake_id" + }, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:outreaches": [ + { + "identifiers": [ + "action_network:f1119c4e-b8ca-44ff-bfa7-f78f7ca3ec16" + ], + "created_date": "2014-03-27T17:42:21Z", + "modified_date": "2014-03-27T17:42:24Z", + "type": "email", + "subject": "Please vote no!", + "message": "Please vote no on bill 12345.", + "targets": [ + { + "title": "Representative", + "given_name": "Jill", + "family_name": "Black", + "ocdid": "ocd-division/country:us/state:ny/cd:18", + } + ], + "action_network:person_id": "fake_id", + "action_network:advocacy_campaign_id": "fake_id", + "_links": { + "self": { + "href": "/advocacy_campaigns/fake_id/outreaches/fake_id" + }, + "osdi:advocacy_campaign": { + "href": f"{self.api_url}/advocacy_campaigns/fake_id" + }, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + }, + }, + { + "identifiers": [ + "action_network:d86538c1-e8f7-46e1-8320-552da81bd48d" + ], + "created_date": "2014-03-27T17:40:56Z", + "modified_date": "2014-03-27T17:41:11Z", + "type": "email", + "subject": "Don't do it!", + "message": "Please vote no on this bill!", + "targets": [ + { + "title": "Representative", + "given_name": "Liam", + "family_name": "Hoover", + "ocdid": "ocd-division/country:us/state:ca/sldl:110", + } + ], + "action_network:person_id": "fake_id", + "action_network:advocacy_campaign_id": "fake_id", + "_links": { + "self": { + "href": "advocacy_campaigns/fake_id/outreaches/fake_id" + }, + "osdi:advocacy_campaign": { + "href": f"{self.api_url}/advocacy_campaigns/fake_id" + }, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + }, + }, + ] + }, + } + self.fake_outreach = { + "identifiers": ["action_network:f1119c4e-b8ca-44ff-bfa7-f78f7ca3ec16"], + "created_date": "2014-03-27T17:42:21Z", + "modified_date": "2014-03-27T17:42:24Z", + "type": "email", + "subject": "Please vote no!", + "message": "Please vote no on bill 12345.", + "targets": [ + { + "title": "Representative", + "given_name": "Jill", + "family_name": "Black", + "ocdid": "ocd-division/country:us/state:ny/cd:18", + } + ], + "action_network:person_id": "fake_id", + "action_network:advocacy_campaign_id": "fake_id", + "_links": { + "self": { + "href": f"{self.api_url}/fundraising_page/fake_id/outreaches/fake_id" + }, + "osdi:advocacy_campaign": { + "href": f"{self.api_url}/advocacy_campaigns/fake_id" + }, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + + # People + self.fake_people = { + "per_page": 25, + "page": 1, + "_links": { + "next": {"href": f"{self.api_url}/people?page=2"}, + "osdi:people": [ + {"href": f"{self.api_url}/people/fake_id"}, + {"href": f"{self.api_url}/people/fake_id"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + "self": {"href": f"{self.api_url}/people"}, + }, + "_embedded": { + "osdi:people": [ + { + "given_name": "John", + "family_name": "Smith", + "identifiers": [ + "action_network:fake_id", + "foreign_system:1", + ], + "created_date": "2014-03-20T21:04:31Z", + "modified_date": "2014-03-20T21:04:31Z", + "email_addresses": [ + { + "primary": True, + "address": "johnsmith@mail.com", + "status": "subscribed", + } + ], + "phone_numbers": [ + { + "primary": True, + "number": "12024444444", + "number_type": "Mobile", + "status": "subscribed", + } + ], + "postal_addresses": [ + { + "primary": True, + "address_lines": ["1900 Pennsylvania Ave"], + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US", + "language": "en", + "location": { + "latitude": 38.919, + "longitude": -77.0379, + "accuracy": "Approximate", + }, + } + ], + "languages_spoken": ["en"], + "custom_fields": { + "phone": "310.753.8209", + "I am a parent": "1", + }, + "_links": { + "self": {"href": f"{self.api_url}/people/fake_id"}, + "osdi:attendances": { + "href": f"{self.api_url}/people/fake_id/attendances" + }, + "osdi:signatures": { + "href": f"{self.api_url}/people/fake_id/signatures" + }, + "osdi:submissions": { + "href": f"{self.api_url}/people/fake_id/submissions" + }, + "osdi:donations": { + "href": f"{self.api_url}/people/fake_id/donations" + }, + "osdi:outreaches": { + "href": f"{self.api_url}/people/fake_id/outreaches" + }, + "osdi:taggings": { + "href": f"{self.api_url}/people/fake_id/taggings" + }, + }, + }, + { + "given_name": "Jane", + "family_name": "Doe", + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2014-03-20T20:44:13Z", + "modified_date": "2014-03-20T20:44:13Z", + "email_addresses": [ + { + "primary": True, + "address": "janedoe@mail.com", + "status": "unsubscribed", + } + ], + "phone_numbers": [ + { + "primary": True, + "number_type": "Mobile", + "status": "unsubscribed", + } + ], + "postal_addresses": [ + { + "primary": True, + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US", + "language": "en", + "location": { + "latitude": 38.919, + "longitude": -77.0379, + "accuracy": "Approximate", + }, + } + ], + "languages_spoken": ["en"], + "_links": { + "self": {"href": f"{self.api_url}/people/fake_id"}, + "osdi:attendances": { + "href": f"{self.api_url}/people/fake_id/attendances" + }, + "osdi:signatures": { + "href": f"{self.api_url}/people/fake_id/signatures" + }, + "osdi:submissions": { + "href": f"{self.api_url}/people/fake_id/submissions" + }, + "osdi:donations": { + "href": f"{self.api_url}/people/fake_id/donations" + }, + "osdi:outreaches": { + "href": f"{self.api_url}/people/fake_id/outreaches" + }, + "osdi:taggings": { + "href": f"{self.api_url}/people/fake_id/taggings" + }, + }, + }, + ] + }, + } + + # Petitions + self.fake_petitions = { + "total_pages": 7, + "per_page": 25, + "page": 1, + "total_records": 162, + "_links": { + "next": {"href": f"{self.api_url}/petitions?page=2"}, + "self": {"href": f"{self.api_url}/petitions"}, + "osdi:petitions": [ + {"href": f"{self.api_url}/petitions/fake_id"}, + {"href": f"{self.api_url}/petitions/fake_id"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:petitions": [ + { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "title": "Stop doing the bad thing", + "description": "The mayor should stop doing the bad.
", + "petition_text": "Mayor, stop doing the bad thing", + "browser_url": "fake_url", + "featured_image_url": "fake_url", + "total_signatures": 2354, + "target": [{"name": "The Mayor"}], + "action_network:hidden": False, + "_embedded": { + "osdi:creator": { + "given_name": "John", + "family_name": "Doe", + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "email_addresses": [ + { + "primary": True, + "address": "jdoe@mail.com", + "status": "subscribed", + } + ], + "phone_numbers": [ + { + "primary": True, + "number": "12021234444", + "number_type": "Mobile", + "status": "subscribed", + } + ], + "postal_addresses": [ + { + "primary": True, + "address_lines": ["1600 Pennsylvania Ave."], + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US", + "language": "en", + "location": { + "latitude": 35.919, + "longitude": -72.0379, + "accuracy": "Approximate", + }, + } + ], + "languages_spoken": ["en"], + "_links": { + "self": {"href": f"{self.api_url}/people/fake_id"}, + "osdi:attendances": { + "href": f"{self.api_url}/people/fake_id/attendances" + }, + "osdi:signatures": { + "href": f"{self.api_url}/people/fake_id/signatures" + }, + "osdi:submissions": { + "href": f"{self.api_url}/people/fake_id/submissions" + }, + "osdi:donations": { + "href": f"{self.api_url}/people/fake_id/donations" + }, + "osdi:outreaches": { + "href": f"{self.api_url}/people/fake_id/outreaches" + }, + "osdi:taggings": { + "href": f"{self.api_url}/people/fake_id/taggings" + }, + }, + } + }, + "_links": { + "self": {"href": f"{self.api_url}/petitions/fake_id"}, + "osdi:signatures": { + "href": f"{self.api_url}/petitions/fake_id/signatures" + }, + "osdi:record_signature_helper": { + "href": f"{self.api_url}/petitions/fake_id/signatures" + }, + "osdi:creator": {"href": f"{self.api_url}/people/fake_id"}, + "action_network:embed": { + "href": f"{self.api_url}/petitions/fake_id/embed" + }, + }, + }, + { + "identifiers": [ + "action_network:fake_id", + "foreign_system:1", + ], + "origin_system": "Another System", + "created_date": "2014-03-14T15:21:05Z", + "modified_date": "2014-03-17T19:56:11Z", + "title": "We need to do this now!", + "total_signatures": 123, + "action_network:hidden": False, + "_embedded": { + "osdi:creator": { + "given_name": "John", + "family_name": "Doe", + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "email_addresses": [ + { + "primary": True, + "address": "jdoe@mail.com", + "status": "subscribed", + } + ], + "phone_numbers": [ + { + "primary": True, + "number": "12021234444", + "number_type": "Mobile", + "status": "subscribed", + } + ], + "postal_addresses": [ + { + "primary": True, + "address_lines": ["1600 Pennsylvania Ave."], + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US", + "language": "en", + "location": { + "latitude": 35.919, + "longitude": -72.0379, + "accuracy": "Approximate", + }, + } + ], + "languages_spoken": ["en"], + "_links": { + "self": {"href": f"{self.api_url}/people/fake_id"}, + "osdi:attendances": { + "href": f"{self.api_url}/people/fake_id/attendances" + }, + "osdi:signatures": { + "href": f"{self.api_url}/people/fake_id/signatures" + }, + "osdi:submissions": { + "href": f"{self.api_url}/people/fake_id/submissions" + }, + "osdi:donations": { + "href": f"{self.api_url}/people/fake_id/donations" + }, + "osdi:outreaches": { + "href": f"{self.api_url}/people/fake_id/outreaches" + }, + "osdi:taggings": { + "href": f"{self.api_url}/people/fake_id/taggings" + }, + }, + } + }, + "action_network:sponsor": { + "title": "Progressive Action Now", + "url": "https://actionnetwork.org/groups/progressive-action-now", + }, + "_links": { + "self": {"href": f"{self.api_url}/petitions/fake_id"}, + "osdi:signatures": { + "href": f"{self.api_url}/petitions/fake_id/signatures" + }, + "osdi:record_signature_helper": { + "href": f"{self.api_url}/petitions/fake_id/signatures" + }, + "osdi:creator": {"href": f"{self.api_url}/people/fake_id"}, + "action_network:embed": { + "href": f"{self.api_url}/petitions/fake_id/embed" + }, + }, + }, + ] + }, + } + self.fake_petition = { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "title": "Stop doing the bad thing", + "description": "The mayor should stop doing the bad.
", + "petition_text": "Mayor, stop doing the bad thing", + "browser_url": "https://actionnetwork.org/petitions/stop-doing-the-bad-thing", + "featured_image_url": "https://actionnetwork.org/images/stop-doing-the-bad-thing.jpg", + "total_signatures": 2354, + "target": [{"name": "The Mayor"}], + "action_network:hidden": False, + "_embedded": { + "osdi:creator": { + "given_name": "John", + "family_name": "Doe", + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "email_addresses": [ + { + "primary": True, + "address": "jdoe@mail.com", + "status": "subscribed", + } + ], + "phone_numbers": [ + { + "primary": True, + "number": "12021234444", + "number_type": "Mobile", + "status": "subscribed", + } + ], + "postal_addresses": [ + { + "primary": True, + "address_lines": ["1600 Pennsylvania Ave."], + "locality": "Washington", + "region": "DC", + "postal_code": "20009", + "country": "US", + "language": "en", + "location": { + "latitude": 35.919, + "longitude": -72.0379, + "accuracy": "Approximate", + }, + } + ], + "languages_spoken": ["en"], + "_links": { + "self": {"href": f"{self.api_url}/people/fake_id"}, + "osdi:attendances": { + "href": f"{self.api_url}/people/fake_id/attendances" + }, + "osdi:signatures": { + "href": f"{self.api_url}/people/fake_id/signatures" + }, + "osdi:submissions": { + "href": f"{self.api_url}/people/fake_id/submissions" + }, + "osdi:donations": { + "href": f"{self.api_url}/people/fake_id/donations" + }, + "osdi:outreaches": { + "href": f"{self.api_url}/people/fake_id/outreaches" + }, + "osdi:taggings": { + "href": f"{self.api_url}/people/fake_id/taggings" + }, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + }, + "_links": { + "self": {"href": f"{self.api_url}/petitions/fake_id"}, + "osdi:signatures": { + "href": f"{self.api_url}/petitions/fake_id/signatures" + }, + "osdi:record_signature_helper": { + "href": f"{self.api_url}/petitions/fake_id/signatures" + }, + "osdi:creator": {"href": f"{self.api_url}/people/fake_id"}, + "action_network:embed": { + "href": f"{self.api_url}/petitions/fake_id/embed" + }, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + + # Queries + self.fake_queries = { + "total_pages": 7, + "per_page": 25, + "page": 1, + "total_records": 162, + "_links": { + "next": {"href": f"{self.api_url}/queries?page=2"}, + "self": {"href": f"{self.api_url}/queries"}, + "osdi:queries": [ + {"href": f"{self.api_url}/queries/fake_id"}, + {"href": f"{self.api_url}/queries/fake_id"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:queries": [ + { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "name": "All donors", + "browser_url": "https://actionnetwork.org/queries/1/edit", + "_links": {"self": {"href": f"{self.api_url}/queries/fake_id"}}, + }, + { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2014-03-14T15:21:05Z", + "modified_date": "2014-03-17T19:56:11Z", + "name": "Volunteer prospects", + "browser_url": "https://actionnetwork.org/queries/2/edit", + "_links": {"self": {"href": f"{self.api_url}/queries/fake_id"}}, + }, + ] + }, + } + self.fake_query = { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "name": "All donors", + "browser_url": "https://actionnetwork.org/queries/1/edit", + "_links": { + "self": {"href": f"{self.api_url}/queries/fake_id"}, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + + # Signatures + self.fake_signatures = { + "total_pages": 100, + "per_page": 25, + "page": 1, + "total_records": 2500, + "_links": { + "self": {"href": f"{self.api_url}/petitions/fake_id/signatures"}, + "osdi:signatures": [ + {"href": f"{self.api_url}/petitions/fake_id/signatures/fake_id"}, + {"href": f"{self.api_url}/petitions/fake_id/signatures/fake_id`"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:signatures": [ + { + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-26T18:04:00Z", + "modified_date": "2014-03-26T18:04:00Z", + "action_network:person_id": "699da712-929f-11e3-a2e9-12313d316c29", + "action_network:petition_id": "fake_id", + "_links": { + "self": { + "href": f"{self.api_url}/petitions/fake_id/signatures/fake_id" + }, + "osdi:petition": { + "href": f"{self.api_url}/petitions/fake_id" + }, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + }, + }, + { + "identifiers": [ + "action_network:71497ab2-b3e7-4896-af46-126ac7287dab" + ], + "created_date": "2014-03-26T16:07:10Z", + "modified_date": "2014-03-26T16:07:10Z", + "comments": "Stop doing the thing", + "action_network:person_id": "fake_id", + "action_network:petition_id": "fake_id", + "_links": { + "self": { + "href": f"{self.api_url}/petitions/fake_id/signatures/fake_id" + }, + "osdi:petition": { + "href": f"{self.api_url}/petitions/fake_id" + }, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + }, + }, + ] + }, + } + self.fake_signature = { + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-26T18:04:00Z", + "modified_date": "2014-03-26T18:04:00Z", + "action_network:person_id": "699da712-929f-11e3-a2e9-12313d316c29", + "action_network:petition_id": "fake_id", + "_links": { + "self": { + "href": f"{self.api_url}/petitions/fake_id/signatures/fake_id" + }, + "osdi:petition": {"href": f"{self.api_url}/petitions/fake_id"}, + "osdi:person": { + "href": f"{self.api_url}/people/699da712-929f-11e3-a2e9-12313d316c29" + }, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + + # Submissions + self.fake_submissions = { + "total_pages": 1, + "per_page": 25, + "page": 1, + "total_records": 4, + "_links": { + "self": {"href": f"{self.api_url}/forms/fake_id/submissions"}, + "osdi:submissions": [ + {"href": f"{self.api_url}/forms/fake_id/submissions/fake_id"}, + {"href": f"{self.api_url}/forms/fake_id/submissions/fake_id"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:submissions": [ + { + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-25T15:26:45Z", + "modified_date": "2014-03-25T15:26:46Z", + "action:person_id": "fake_id", + "action_network:form_id": "fake_id", + "_links": { + "self": { + "href": f"{self.api_url}/forms/fake_id/submissions/fake_id" + }, + "osdi:form": {"href": f"{self.api_url}/forms/fake_id"}, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + }, + }, + { + "identifiers": [ + "action_network:fake_id", + "free_forms:1", + ], + "created_date": "2014-03-24T17:00:42Z", + "modified_date": "2014-03-24T17:00:42Z", + "action:person_id": "fake_id", + "action_network:form_id": "fake_id", + "_links": { + "self": { + "href": f"{self.api_url}/forms/fake_id/submissions/fake_id" + }, + "osdi:form": {"href": f"{self.api_url}/forms/fake_id"}, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + }, + }, + ] + }, + } + self.fake_submission = { + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-25T15:26:45Z", + "modified_date": "2014-03-25T15:26:46Z", + "action:person_id": "fake_id", + "action_network:form_id": "fake_id", + "_links": { + "self": {"href": f"{self.api_url}/forms/fake_id/submissions/fake_id"}, + "osdi:form": {"href": f"{self.api_url}/forms/fake_id"}, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + } + + # Tags + self.fake_tags = { + "total_pages": 10, + "per_page": 25, + "page": 1, + "total_records": 243, + "_links": { + "next": {"href": f"{self.api_url}/tags?page=2"}, + "self": {"href": f"{self.api_url}/tags"}, + "osdi:tags": [ + {"href": f"{self.api_url}/tags/fake_id"}, + {"href": f"{self.api_url}/tags/fake_id"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:tags": [ + { + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-25T17:11:33Z", + "modified_date": "2014-03-25T17:13:33Z", + "name": "Volunteers", + "_links": { + "self": {"href": f"{self.api_url}/tags/fake_id"}, + "osdi:taggings": { + "href": f"{self.api_url}/tags/fake_id/taggings" + }, + }, + }, + { + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-24T18:26:42Z", + "modified_date": "2014-03-24T18:27:17Z", + "name": "Economic Justice", + "_links": { + "self": {"href": f"{self.api_url}/tags/fake_id"}, + "osdi:taggings": { + "href": f"{self.api_url}/tags/fake_id/taggings" + }, + }, + }, + ] + }, + } + + # Taggings + self.fake_taggings = { + "total_pages": 5, + "per_page": 25, + "page": 1, + "total_records": 123, + "_links": { + "next": {"href": f"{self.api_url}/tags/fake_id/taggings?page=2"}, + "self": {"href": f"{self.api_url}/tags/fake_id/taggings"}, + "osdi:taggings": [ + {"href": f"{self.api_url}/tags/fake_id/taggings/fake_id"}, + {"href": f"{self.api_url}/tags/fake_id/taggings/fake_id"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:taggings": [ + { + "_links": { + "self": { + "href": f"{self.api_url}/tags/fake_id/taggings/fake_id" + }, + "osdi:tag": {"href": f"{self.api_url}/tags/fake_id"}, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + }, + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-18T22:25:31Z", + "modified_date": "2014-03-18T22:25:38Z", + "item_type": "osdi:person", + }, + { + "_links": { + "self": { + "href": f"{self.api_url}/tags/fake_id/taggings/fake_id" + }, + "osdi:tag": {"href": f"{self.api_url}/tags/fake_id"}, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + }, + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-18T22:24:24Z", + "modified_date": "2014-03-18T22:24:24Z", + "item_type": "osdi:person", + }, + ] + }, + } + self.fake_tagging = { + "_links": { + "self": {"href": f"{self.api_url}/tags/fake_id/taggings/fake_id"}, + "osdi:tag": {"href": f"{self.api_url}/tags/fake_id"}, + "osdi:person": {"href": f"{self.api_url}/people/fake_id"}, + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "identifiers": ["action_network:fake_id"], + "created_date": "2014-03-18T22:25:31Z", + "modified_date": "2014-03-18T22:25:38Z", + "item_type": "osdi:person", + } + + # Wrappers + self.fake_wrappers = { + "total_pages": 7, + "per_page": 25, + "page": 1, + "total_records": 162, + "_links": { + "next": {"href": f"{self.api_url}/wrappers?page=2"}, + "self": {"href": f"{self.api_url}/wrappers"}, + "osdi:wrappers": [ + {"href": f"{self.api_url}/wrappers/fake_id"}, + {"href": f"{self.api_url}/wrappers/fake_id"}, + ], + "curies": [ + { + "name": "osdi", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + { + "name": "action_network", + "href": "https://actionnetwork.org/docs/v2/{rel}", + "templated": True, + }, + ], + }, + "_embedded": { + "osdi:wrappers": [ + { + "identifiers": ["action_network:fake_id"], + "origin_system": "Action Network", + "created_date": "2014-03-24T18:03:45Z", + "modified_date": "2014-03-25T15:00:22Z", + "name": "Default wrapper -- logo only", + "administrative_url": "https://actionnetwork.org/wrappers/1/edit", + "header": '\r\n
| \r\n "
+ "
\r\n '
+ '
| \r\n "
+ "
\r\n '
+ '
| \r\n "
+ "