From a78ea840b42ff3055e7601a996d08850c365c3f7 Mon Sep 17 00:00:00 2001 From: Eric Nielsen <4120606+ericbn@users.noreply.github.com> Date: Fri, 22 Mar 2024 18:25:12 -0500 Subject: [PATCH 01/15] Update required Python version in README.md Support for Python versions lower than 3.7 was dropped in version 6.0.0 of the package. See 83047c5bce13b1ec60e8a3bc76465adc841f8892 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c225e85..1bbd4ba1 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ pip install --upgrade hubspot-api-client ### Requirements -Make sure you have [Python 3.5+](https://docs.python.org/3/) and [pip](https://pypi.org/project/pip/) installed. +Make sure you have [Python 3.7+](https://docs.python.org/3/) and [pip](https://pypi.org/project/pip/) installed. ## Quickstart From 46a2709df57b9be0dc9fab85ef59bff4c5b68488 Mon Sep 17 00:00:00 2001 From: alexey Date: Wed, 16 Oct 2024 14:58:30 +0300 Subject: [PATCH 02/15] Codegen: Marketing Events --- hubspot/marketing/events/__init__.py | 3 + hubspot/marketing/events/api/__init__.py | 1 + ...attendance_subscriber_state_changes_api.py | 36 +- .../events/api/list_associations_api.py | 827 ++++++++++++++++++ hubspot/marketing/events/models/__init__.py | 2 + ...sponse_with_total_public_list_no_paging.py | 147 ++++ .../marketing_event_update_request_params.py | 54 -- .../marketing/events/models/public_list.py | 459 ++++++++++ 8 files changed, 1457 insertions(+), 72 deletions(-) create mode 100644 hubspot/marketing/events/api/list_associations_api.py create mode 100644 hubspot/marketing/events/models/collection_response_with_total_public_list_no_paging.py create mode 100644 hubspot/marketing/events/models/public_list.py diff --git a/hubspot/marketing/events/__init__.py b/hubspot/marketing/events/__init__.py index e0bcb04d..7a87e818 100644 --- a/hubspot/marketing/events/__init__.py +++ b/hubspot/marketing/events/__init__.py @@ -19,6 +19,7 @@ # import apis into sdk package from hubspot.marketing.events.api.attendance_subscriber_state_changes_api import AttendanceSubscriberStateChangesApi from hubspot.marketing.events.api.basic_api import BasicApi +from hubspot.marketing.events.api.list_associations_api import ListAssociationsApi from hubspot.marketing.events.api.participant_state_api import ParticipantStateApi from hubspot.marketing.events.api.settings_api import SettingsApi from hubspot.marketing.events.api.subscriber_state_changes_api import SubscriberStateChangesApi @@ -44,6 +45,7 @@ from hubspot.marketing.events.models.batch_response_subscriber_vid_response import BatchResponseSubscriberVidResponse from hubspot.marketing.events.models.collection_response_marketing_event_external_unique_identifier_no_paging import CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging from hubspot.marketing.events.models.collection_response_with_total_participation_breakdown_forward_paging import CollectionResponseWithTotalParticipationBreakdownForwardPaging +from hubspot.marketing.events.models.collection_response_with_total_public_list_no_paging import CollectionResponseWithTotalPublicListNoPaging from hubspot.marketing.events.models.contact_association import ContactAssociation from hubspot.marketing.events.models.error import Error from hubspot.marketing.events.models.error_detail import ErrorDetail @@ -65,6 +67,7 @@ from hubspot.marketing.events.models.participation_breakdown import ParticipationBreakdown from hubspot.marketing.events.models.participation_properties import ParticipationProperties from hubspot.marketing.events.models.property_value import PropertyValue +from hubspot.marketing.events.models.public_list import PublicList from hubspot.marketing.events.models.standard_error import StandardError from hubspot.marketing.events.models.subscriber_email_response import SubscriberEmailResponse from hubspot.marketing.events.models.subscriber_vid_response import SubscriberVidResponse diff --git a/hubspot/marketing/events/api/__init__.py b/hubspot/marketing/events/api/__init__.py index e0c65aa5..262c723e 100644 --- a/hubspot/marketing/events/api/__init__.py +++ b/hubspot/marketing/events/api/__init__.py @@ -5,6 +5,7 @@ # import apis into api package from hubspot.marketing.events.api.attendance_subscriber_state_changes_api import AttendanceSubscriberStateChangesApi from hubspot.marketing.events.api.basic_api import BasicApi +from hubspot.marketing.events.api.list_associations_api import ListAssociationsApi from hubspot.marketing.events.api.participant_state_api import ParticipantStateApi from hubspot.marketing.events.api.settings_api import SettingsApi from hubspot.marketing.events.api.subscriber_state_changes_api import SubscriberStateChangesApi diff --git a/hubspot/marketing/events/api/attendance_subscriber_state_changes_api.py b/hubspot/marketing/events/api/attendance_subscriber_state_changes_api.py index 6a011d1e..5ff81508 100644 --- a/hubspot/marketing/events/api/attendance_subscriber_state_changes_api.py +++ b/hubspot/marketing/events/api/attendance_subscriber_state_changes_api.py @@ -33,14 +33,14 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_by_contact_email(self, external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, **kwargs): # noqa: E501 + def record_by_contact_emails(self, external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, **kwargs): # noqa: E501 """Record a subscriber state by contact email # noqa: E501 Record a subscriber state between multiple HubSpot contacts and a marketing event, using contact email addresses. If contact is not present it will be automatically created. The contactProperties field is used only when creating a new contact. These properties will not update existing contacts. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_by_contact_email(external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, async_req=True) + >>> thread = api.record_by_contact_emails(external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, async_req=True) >>> result = thread.get() :param external_event_id: The id of the marketing event (required) @@ -67,16 +67,16 @@ def create_by_contact_email(self, external_event_id, subscriber_state, batch_inp :rtype: BatchResponseSubscriberEmailResponse """ kwargs["_return_http_data_only"] = True - return self.create_by_contact_email_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, **kwargs) # noqa: E501 + return self.record_by_contact_emails_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, **kwargs) # noqa: E501 - def create_by_contact_email_with_http_info(self, external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, **kwargs): # noqa: E501 + def record_by_contact_emails_with_http_info(self, external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, **kwargs): # noqa: E501 """Record a subscriber state by contact email # noqa: E501 Record a subscriber state between multiple HubSpot contacts and a marketing event, using contact email addresses. If contact is not present it will be automatically created. The contactProperties field is used only when creating a new contact. These properties will not update existing contacts. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_by_contact_email_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, async_req=True) + >>> thread = api.record_by_contact_emails_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, async_req=True) >>> result = thread.get() :param external_event_id: The id of the marketing event (required) @@ -118,18 +118,18 @@ def create_by_contact_email_with_http_info(self, external_event_id, subscriber_s for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: - raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method create_by_contact_email" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method record_by_contact_emails" % key) local_var_params[key] = val del local_var_params["kwargs"] # verify the required parameter 'external_event_id' is set if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `external_event_id` when calling `create_by_contact_email`") # noqa: E501 + raise ApiValueError("Missing the required parameter `external_event_id` when calling `record_by_contact_emails`") # noqa: E501 # verify the required parameter 'subscriber_state' is set if self.api_client.client_side_validation and local_var_params.get("subscriber_state") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `subscriber_state` when calling `create_by_contact_email`") # noqa: E501 + raise ApiValueError("Missing the required parameter `subscriber_state` when calling `record_by_contact_emails`") # noqa: E501 # verify the required parameter 'batch_input_marketing_event_email_subscriber' is set if self.api_client.client_side_validation and local_var_params.get("batch_input_marketing_event_email_subscriber") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `batch_input_marketing_event_email_subscriber` when calling `create_by_contact_email`") # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_marketing_event_email_subscriber` when calling `record_by_contact_emails`") # noqa: E501 collection_formats = {} @@ -185,14 +185,14 @@ def create_by_contact_email_with_http_info(self, external_event_id, subscriber_s _request_auth=local_var_params.get("_request_auth"), ) - def create_by_contact_id(self, external_event_id, subscriber_state, batch_input_marketing_event_subscriber, **kwargs): # noqa: E501 + def record_by_contact_ids(self, external_event_id, subscriber_state, batch_input_marketing_event_subscriber, **kwargs): # noqa: E501 """Record a subscriber state by contact ids # noqa: E501 Record a subscriber state between multiple HubSpot contacts and a marketing event, using HubSpot contact ids. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_by_contact_id(external_event_id, subscriber_state, batch_input_marketing_event_subscriber, async_req=True) + >>> thread = api.record_by_contact_ids(external_event_id, subscriber_state, batch_input_marketing_event_subscriber, async_req=True) >>> result = thread.get() :param external_event_id: The id of the marketing event (required) @@ -219,16 +219,16 @@ def create_by_contact_id(self, external_event_id, subscriber_state, batch_input_ :rtype: BatchResponseSubscriberVidResponse """ kwargs["_return_http_data_only"] = True - return self.create_by_contact_id_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_subscriber, **kwargs) # noqa: E501 + return self.record_by_contact_ids_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_subscriber, **kwargs) # noqa: E501 - def create_by_contact_id_with_http_info(self, external_event_id, subscriber_state, batch_input_marketing_event_subscriber, **kwargs): # noqa: E501 + def record_by_contact_ids_with_http_info(self, external_event_id, subscriber_state, batch_input_marketing_event_subscriber, **kwargs): # noqa: E501 """Record a subscriber state by contact ids # noqa: E501 Record a subscriber state between multiple HubSpot contacts and a marketing event, using HubSpot contact ids. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_by_contact_id_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_subscriber, async_req=True) + >>> thread = api.record_by_contact_ids_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_subscriber, async_req=True) >>> result = thread.get() :param external_event_id: The id of the marketing event (required) @@ -270,18 +270,18 @@ def create_by_contact_id_with_http_info(self, external_event_id, subscriber_stat for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: - raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method create_by_contact_id" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method record_by_contact_ids" % key) local_var_params[key] = val del local_var_params["kwargs"] # verify the required parameter 'external_event_id' is set if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `external_event_id` when calling `create_by_contact_id`") # noqa: E501 + raise ApiValueError("Missing the required parameter `external_event_id` when calling `record_by_contact_ids`") # noqa: E501 # verify the required parameter 'subscriber_state' is set if self.api_client.client_side_validation and local_var_params.get("subscriber_state") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `subscriber_state` when calling `create_by_contact_id`") # noqa: E501 + raise ApiValueError("Missing the required parameter `subscriber_state` when calling `record_by_contact_ids`") # noqa: E501 # verify the required parameter 'batch_input_marketing_event_subscriber' is set if self.api_client.client_side_validation and local_var_params.get("batch_input_marketing_event_subscriber") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `batch_input_marketing_event_subscriber` when calling `create_by_contact_id`") # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_marketing_event_subscriber` when calling `record_by_contact_ids`") # noqa: E501 collection_formats = {} diff --git a/hubspot/marketing/events/api/list_associations_api.py b/hubspot/marketing/events/api/list_associations_api.py new file mode 100644 index 00000000..5108c078 --- /dev/null +++ b/hubspot/marketing/events/api/list_associations_api.py @@ -0,0 +1,827 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from hubspot.marketing.events.api_client import ApiClient +from hubspot.marketing.events.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class ListAssociationsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def associate_by_external_account_and_event_ids(self, external_account_id, external_event_id, list_id, **kwargs): # noqa: E501 + """Associate a list with a marketing event # noqa: E501 + + Associates a list with a marketing event by external account id, external event id, and ILS list id # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.associate_by_external_account_and_event_ids(external_account_id, external_event_id, list_id, async_req=True) + >>> result = thread.get() + + :param external_account_id: The accountId that is associated with this marketing event in the external event application. (required) + :type external_account_id: str + :param external_event_id: The id of the marketing event in the external event application. (required) + :type external_event_id: str + :param list_id: The ILS ID of the list. (required) + :type list_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + return self.associate_by_external_account_and_event_ids_with_http_info(external_account_id, external_event_id, list_id, **kwargs) # noqa: E501 + + def associate_by_external_account_and_event_ids_with_http_info(self, external_account_id, external_event_id, list_id, **kwargs): # noqa: E501 + """Associate a list with a marketing event # noqa: E501 + + Associates a list with a marketing event by external account id, external event id, and ILS list id # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.associate_by_external_account_and_event_ids_with_http_info(external_account_id, external_event_id, list_id, async_req=True) + >>> result = thread.get() + + :param external_account_id: The accountId that is associated with this marketing event in the external event application. (required) + :type external_account_id: str + :param external_event_id: The id of the marketing event in the external event application. (required) + :type external_event_id: str + :param list_id: The ILS ID of the list. (required) + :type list_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + local_var_params = locals() + + all_params = ["external_account_id", "external_event_id", "list_id"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method associate_by_external_account_and_event_ids" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'external_account_id' is set + if self.api_client.client_side_validation and local_var_params.get("external_account_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `external_account_id` when calling `associate_by_external_account_and_event_ids`") # noqa: E501 + # verify the required parameter 'external_event_id' is set + if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `external_event_id` when calling `associate_by_external_account_and_event_ids`") # noqa: E501 + # verify the required parameter 'list_id' is set + if self.api_client.client_side_validation and local_var_params.get("list_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `list_id` when calling `associate_by_external_account_and_event_ids`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "external_account_id" in local_var_params: + path_params["externalAccountId"] = local_var_params["external_account_id"] # noqa: E501 + if "external_event_id" in local_var_params: + path_params["externalEventId"] = local_var_params["external_event_id"] # noqa: E501 + if "list_id" in local_var_params: + path_params["listId"] = local_var_params["list_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = {} + + return self.api_client.call_api( + "/marketing/v3/marketing-events/associations/{externalAccountId}/{externalEventId}/lists/{listId}", + "PUT", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) + + def associate_by_marketing_event_id(self, marketing_event_id, list_id, **kwargs): # noqa: E501 + """Associate a list with a marketing event # noqa: E501 + + Associates a list with a marketing event by marketing event id and ILS list id # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.associate_by_marketing_event_id(marketing_event_id, list_id, async_req=True) + >>> result = thread.get() + + :param marketing_event_id: The internal id of the marketing event in HubSpot. (required) + :type marketing_event_id: str + :param list_id: The ILS ID of the list. (required) + :type list_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + return self.associate_by_marketing_event_id_with_http_info(marketing_event_id, list_id, **kwargs) # noqa: E501 + + def associate_by_marketing_event_id_with_http_info(self, marketing_event_id, list_id, **kwargs): # noqa: E501 + """Associate a list with a marketing event # noqa: E501 + + Associates a list with a marketing event by marketing event id and ILS list id # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.associate_by_marketing_event_id_with_http_info(marketing_event_id, list_id, async_req=True) + >>> result = thread.get() + + :param marketing_event_id: The internal id of the marketing event in HubSpot. (required) + :type marketing_event_id: str + :param list_id: The ILS ID of the list. (required) + :type list_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + local_var_params = locals() + + all_params = ["marketing_event_id", "list_id"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method associate_by_marketing_event_id" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'marketing_event_id' is set + if self.api_client.client_side_validation and local_var_params.get("marketing_event_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `marketing_event_id` when calling `associate_by_marketing_event_id`") # noqa: E501 + # verify the required parameter 'list_id' is set + if self.api_client.client_side_validation and local_var_params.get("list_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `list_id` when calling `associate_by_marketing_event_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "marketing_event_id" in local_var_params: + path_params["marketingEventId"] = local_var_params["marketing_event_id"] # noqa: E501 + if "list_id" in local_var_params: + path_params["listId"] = local_var_params["list_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = {} + + return self.api_client.call_api( + "/marketing/v3/marketing-events/associations/{marketingEventId}/lists/{listId}", + "PUT", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) + + def disassociate_by_external_account_and_event_ids(self, external_account_id, external_event_id, list_id, **kwargs): # noqa: E501 + """Disassociate a list from a marketing event # noqa: E501 + + Disassociates a list from a marketing event by external account id, external event id, and ILS list id # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.disassociate_by_external_account_and_event_ids(external_account_id, external_event_id, list_id, async_req=True) + >>> result = thread.get() + + :param external_account_id: The accountId that is associated with this marketing event in the external event application. (required) + :type external_account_id: str + :param external_event_id: The id of the marketing event in the external event application. (required) + :type external_event_id: str + :param list_id: The ILS ID of the list. (required) + :type list_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + return self.disassociate_by_external_account_and_event_ids_with_http_info(external_account_id, external_event_id, list_id, **kwargs) # noqa: E501 + + def disassociate_by_external_account_and_event_ids_with_http_info(self, external_account_id, external_event_id, list_id, **kwargs): # noqa: E501 + """Disassociate a list from a marketing event # noqa: E501 + + Disassociates a list from a marketing event by external account id, external event id, and ILS list id # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.disassociate_by_external_account_and_event_ids_with_http_info(external_account_id, external_event_id, list_id, async_req=True) + >>> result = thread.get() + + :param external_account_id: The accountId that is associated with this marketing event in the external event application. (required) + :type external_account_id: str + :param external_event_id: The id of the marketing event in the external event application. (required) + :type external_event_id: str + :param list_id: The ILS ID of the list. (required) + :type list_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + local_var_params = locals() + + all_params = ["external_account_id", "external_event_id", "list_id"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method disassociate_by_external_account_and_event_ids" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'external_account_id' is set + if self.api_client.client_side_validation and local_var_params.get("external_account_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `external_account_id` when calling `disassociate_by_external_account_and_event_ids`") # noqa: E501 + # verify the required parameter 'external_event_id' is set + if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `external_event_id` when calling `disassociate_by_external_account_and_event_ids`") # noqa: E501 + # verify the required parameter 'list_id' is set + if self.api_client.client_side_validation and local_var_params.get("list_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `list_id` when calling `disassociate_by_external_account_and_event_ids`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "external_account_id" in local_var_params: + path_params["externalAccountId"] = local_var_params["external_account_id"] # noqa: E501 + if "external_event_id" in local_var_params: + path_params["externalEventId"] = local_var_params["external_event_id"] # noqa: E501 + if "list_id" in local_var_params: + path_params["listId"] = local_var_params["list_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = {} + + return self.api_client.call_api( + "/marketing/v3/marketing-events/associations/{externalAccountId}/{externalEventId}/lists/{listId}", + "DELETE", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) + + def disassociate_by_marketing_event_id(self, marketing_event_id, list_id, **kwargs): # noqa: E501 + """Disassociate a list from a marketing event # noqa: E501 + + Disassociates a list from a marketing event by marketing event id and ILS list id # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.disassociate_by_marketing_event_id(marketing_event_id, list_id, async_req=True) + >>> result = thread.get() + + :param marketing_event_id: The internal id of the marketing event in HubSpot. (required) + :type marketing_event_id: str + :param list_id: The ILS ID of the list. (required) + :type list_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + return self.disassociate_by_marketing_event_id_with_http_info(marketing_event_id, list_id, **kwargs) # noqa: E501 + + def disassociate_by_marketing_event_id_with_http_info(self, marketing_event_id, list_id, **kwargs): # noqa: E501 + """Disassociate a list from a marketing event # noqa: E501 + + Disassociates a list from a marketing event by marketing event id and ILS list id # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.disassociate_by_marketing_event_id_with_http_info(marketing_event_id, list_id, async_req=True) + >>> result = thread.get() + + :param marketing_event_id: The internal id of the marketing event in HubSpot. (required) + :type marketing_event_id: str + :param list_id: The ILS ID of the list. (required) + :type list_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + local_var_params = locals() + + all_params = ["marketing_event_id", "list_id"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method disassociate_by_marketing_event_id" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'marketing_event_id' is set + if self.api_client.client_side_validation and local_var_params.get("marketing_event_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `marketing_event_id` when calling `disassociate_by_marketing_event_id`") # noqa: E501 + # verify the required parameter 'list_id' is set + if self.api_client.client_side_validation and local_var_params.get("list_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `list_id` when calling `disassociate_by_marketing_event_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "marketing_event_id" in local_var_params: + path_params["marketingEventId"] = local_var_params["marketing_event_id"] # noqa: E501 + if "list_id" in local_var_params: + path_params["listId"] = local_var_params["list_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = {} + + return self.api_client.call_api( + "/marketing/v3/marketing-events/associations/{marketingEventId}/lists/{listId}", + "DELETE", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) + + def get_all_by_external_account_and_event_ids(self, external_account_id, external_event_id, **kwargs): # noqa: E501 + """Get lists associated with a marketing event # noqa: E501 + + Gets lists associated with a marketing event by external account id and external event id # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_all_by_external_account_and_event_ids(external_account_id, external_event_id, async_req=True) + >>> result = thread.get() + + :param external_account_id: The accountId that is associated with this marketing event in the external event application. (required) + :type external_account_id: str + :param external_event_id: The id of the marketing event in the external event application. (required) + :type external_event_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CollectionResponseWithTotalPublicListNoPaging + """ + kwargs["_return_http_data_only"] = True + return self.get_all_by_external_account_and_event_ids_with_http_info(external_account_id, external_event_id, **kwargs) # noqa: E501 + + def get_all_by_external_account_and_event_ids_with_http_info(self, external_account_id, external_event_id, **kwargs): # noqa: E501 + """Get lists associated with a marketing event # noqa: E501 + + Gets lists associated with a marketing event by external account id and external event id # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_all_by_external_account_and_event_ids_with_http_info(external_account_id, external_event_id, async_req=True) + >>> result = thread.get() + + :param external_account_id: The accountId that is associated with this marketing event in the external event application. (required) + :type external_account_id: str + :param external_event_id: The id of the marketing event in the external event application. (required) + :type external_event_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CollectionResponseWithTotalPublicListNoPaging, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["external_account_id", "external_event_id"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_all_by_external_account_and_event_ids" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'external_account_id' is set + if self.api_client.client_side_validation and local_var_params.get("external_account_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `external_account_id` when calling `get_all_by_external_account_and_event_ids`") # noqa: E501 + # verify the required parameter 'external_event_id' is set + if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `external_event_id` when calling `get_all_by_external_account_and_event_ids`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "external_account_id" in local_var_params: + path_params["externalAccountId"] = local_var_params["external_account_id"] # noqa: E501 + if "external_event_id" in local_var_params: + path_params["externalEventId"] = local_var_params["external_event_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 200: "CollectionResponseWithTotalPublicListNoPaging", + } + + return self.api_client.call_api( + "/marketing/v3/marketing-events/associations/{externalAccountId}/{externalEventId}/lists", + "GET", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) + + def get_all_by_marketing_event_id(self, marketing_event_id, **kwargs): # noqa: E501 + """Get lists associated with a marketing event # noqa: E501 + + Gets lists associated with a marketing event by marketing event id # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_all_by_marketing_event_id(marketing_event_id, async_req=True) + >>> result = thread.get() + + :param marketing_event_id: The internal id of the marketing event in HubSpot. (required) + :type marketing_event_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CollectionResponseWithTotalPublicListNoPaging + """ + kwargs["_return_http_data_only"] = True + return self.get_all_by_marketing_event_id_with_http_info(marketing_event_id, **kwargs) # noqa: E501 + + def get_all_by_marketing_event_id_with_http_info(self, marketing_event_id, **kwargs): # noqa: E501 + """Get lists associated with a marketing event # noqa: E501 + + Gets lists associated with a marketing event by marketing event id # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_all_by_marketing_event_id_with_http_info(marketing_event_id, async_req=True) + >>> result = thread.get() + + :param marketing_event_id: The internal id of the marketing event in HubSpot. (required) + :type marketing_event_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CollectionResponseWithTotalPublicListNoPaging, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["marketing_event_id"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_all_by_marketing_event_id" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'marketing_event_id' is set + if self.api_client.client_side_validation and local_var_params.get("marketing_event_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `marketing_event_id` when calling `get_all_by_marketing_event_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "marketing_event_id" in local_var_params: + path_params["marketingEventId"] = local_var_params["marketing_event_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 200: "CollectionResponseWithTotalPublicListNoPaging", + } + + return self.api_client.call_api( + "/marketing/v3/marketing-events/associations/{marketingEventId}/lists", + "GET", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) diff --git a/hubspot/marketing/events/models/__init__.py b/hubspot/marketing/events/models/__init__.py index 7ab6eaae..cb5f5173 100644 --- a/hubspot/marketing/events/models/__init__.py +++ b/hubspot/marketing/events/models/__init__.py @@ -24,6 +24,7 @@ from hubspot.marketing.events.models.batch_response_subscriber_vid_response import BatchResponseSubscriberVidResponse from hubspot.marketing.events.models.collection_response_marketing_event_external_unique_identifier_no_paging import CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging from hubspot.marketing.events.models.collection_response_with_total_participation_breakdown_forward_paging import CollectionResponseWithTotalParticipationBreakdownForwardPaging +from hubspot.marketing.events.models.collection_response_with_total_public_list_no_paging import CollectionResponseWithTotalPublicListNoPaging from hubspot.marketing.events.models.contact_association import ContactAssociation from hubspot.marketing.events.models.error import Error from hubspot.marketing.events.models.error_detail import ErrorDetail @@ -45,6 +46,7 @@ from hubspot.marketing.events.models.participation_breakdown import ParticipationBreakdown from hubspot.marketing.events.models.participation_properties import ParticipationProperties from hubspot.marketing.events.models.property_value import PropertyValue +from hubspot.marketing.events.models.public_list import PublicList from hubspot.marketing.events.models.standard_error import StandardError from hubspot.marketing.events.models.subscriber_email_response import SubscriberEmailResponse from hubspot.marketing.events.models.subscriber_vid_response import SubscriberVidResponse diff --git a/hubspot/marketing/events/models/collection_response_with_total_public_list_no_paging.py b/hubspot/marketing/events/models/collection_response_with_total_public_list_no_paging.py new file mode 100644 index 00000000..31df1c58 --- /dev/null +++ b/hubspot/marketing/events/models/collection_response_with_total_public_list_no_paging.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class CollectionResponseWithTotalPublicListNoPaging(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"total": "int", "results": "list[PublicList]"} + + attribute_map = {"total": "total", "results": "results"} + + def __init__(self, total=None, results=None, local_vars_configuration=None): # noqa: E501 + """CollectionResponseWithTotalPublicListNoPaging - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._total = None + self._results = None + self.discriminator = None + + self.total = total + self.results = results + + @property + def total(self): + """Gets the total of this CollectionResponseWithTotalPublicListNoPaging. # noqa: E501 + + + :return: The total of this CollectionResponseWithTotalPublicListNoPaging. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this CollectionResponseWithTotalPublicListNoPaging. + + + :param total: The total of this CollectionResponseWithTotalPublicListNoPaging. # noqa: E501 + :type total: int + """ + if self.local_vars_configuration.client_side_validation and total is None: # noqa: E501 + raise ValueError("Invalid value for `total`, must not be `None`") # noqa: E501 + + self._total = total + + @property + def results(self): + """Gets the results of this CollectionResponseWithTotalPublicListNoPaging. # noqa: E501 + + + :return: The results of this CollectionResponseWithTotalPublicListNoPaging. # noqa: E501 + :rtype: list[PublicList] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this CollectionResponseWithTotalPublicListNoPaging. + + + :param results: The results of this CollectionResponseWithTotalPublicListNoPaging. # noqa: E501 + :type results: list[PublicList] + """ + if self.local_vars_configuration.client_side_validation and results is None: # noqa: E501 + raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 + + self._results = results + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CollectionResponseWithTotalPublicListNoPaging): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CollectionResponseWithTotalPublicListNoPaging): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/marketing_event_update_request_params.py b/hubspot/marketing/events/models/marketing_event_update_request_params.py index 667cede6..fa8ef54a 100644 --- a/hubspot/marketing/events/models/marketing_event_update_request_params.py +++ b/hubspot/marketing/events/models/marketing_event_update_request_params.py @@ -36,7 +36,6 @@ class MarketingEventUpdateRequestParams(object): and the value is json key in definition. """ openapi_types = { - "import_status": "str", "start_date_time": "datetime", "custom_properties": "list[PropertyValue]", "event_cancelled": "bool", @@ -47,11 +46,9 @@ class MarketingEventUpdateRequestParams(object): "event_type": "str", "event_completed": "bool", "end_date_time": "datetime", - "attendance_state_calculation_timestamp": "datetime", } attribute_map = { - "import_status": "importStatus", "start_date_time": "startDateTime", "custom_properties": "customProperties", "event_cancelled": "eventCancelled", @@ -62,12 +59,10 @@ class MarketingEventUpdateRequestParams(object): "event_type": "eventType", "event_completed": "eventCompleted", "end_date_time": "endDateTime", - "attendance_state_calculation_timestamp": "attendanceStateCalculationTimestamp", } def __init__( self, - import_status=None, start_date_time=None, custom_properties=None, event_cancelled=None, @@ -78,7 +73,6 @@ def __init__( event_type=None, event_completed=None, end_date_time=None, - attendance_state_calculation_timestamp=None, local_vars_configuration=None, ): # noqa: E501 """MarketingEventUpdateRequestParams - a model defined in OpenAPI""" # noqa: E501 @@ -86,7 +80,6 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._import_status = None self._start_date_time = None self._custom_properties = None self._event_cancelled = None @@ -97,11 +90,8 @@ def __init__( self._event_type = None self._event_completed = None self._end_date_time = None - self._attendance_state_calculation_timestamp = None self.discriminator = None - if import_status is not None: - self.import_status = import_status if start_date_time is not None: self.start_date_time = start_date_time if custom_properties is not None: @@ -122,29 +112,6 @@ def __init__( self.event_completed = event_completed if end_date_time is not None: self.end_date_time = end_date_time - if attendance_state_calculation_timestamp is not None: - self.attendance_state_calculation_timestamp = attendance_state_calculation_timestamp - - @property - def import_status(self): - """Gets the import_status of this MarketingEventUpdateRequestParams. # noqa: E501 - - - :return: The import_status of this MarketingEventUpdateRequestParams. # noqa: E501 - :rtype: str - """ - return self._import_status - - @import_status.setter - def import_status(self, import_status): - """Sets the import_status of this MarketingEventUpdateRequestParams. - - - :param import_status: The import_status of this MarketingEventUpdateRequestParams. # noqa: E501 - :type import_status: str - """ - - self._import_status = import_status @property def start_date_time(self): @@ -374,27 +341,6 @@ def end_date_time(self, end_date_time): self._end_date_time = end_date_time - @property - def attendance_state_calculation_timestamp(self): - """Gets the attendance_state_calculation_timestamp of this MarketingEventUpdateRequestParams. # noqa: E501 - - - :return: The attendance_state_calculation_timestamp of this MarketingEventUpdateRequestParams. # noqa: E501 - :rtype: datetime - """ - return self._attendance_state_calculation_timestamp - - @attendance_state_calculation_timestamp.setter - def attendance_state_calculation_timestamp(self, attendance_state_calculation_timestamp): - """Sets the attendance_state_calculation_timestamp of this MarketingEventUpdateRequestParams. - - - :param attendance_state_calculation_timestamp: The attendance_state_calculation_timestamp of this MarketingEventUpdateRequestParams. # noqa: E501 - :type attendance_state_calculation_timestamp: datetime - """ - - self._attendance_state_calculation_timestamp = attendance_state_calculation_timestamp - def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} diff --git a/hubspot/marketing/events/models/public_list.py b/hubspot/marketing/events/models/public_list.py new file mode 100644 index 00000000..121d56ff --- /dev/null +++ b/hubspot/marketing/events/models/public_list.py @@ -0,0 +1,459 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class PublicList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + "processing_type": "str", + "object_type_id": "str", + "updated_by_id": "str", + "filters_updated_at": "datetime", + "list_id": "str", + "created_at": "datetime", + "processing_status": "str", + "deleted_at": "datetime", + "list_version": "int", + "size": "int", + "name": "str", + "created_by_id": "str", + "updated_at": "datetime", + } + + attribute_map = { + "processing_type": "processingType", + "object_type_id": "objectTypeId", + "updated_by_id": "updatedById", + "filters_updated_at": "filtersUpdatedAt", + "list_id": "listId", + "created_at": "createdAt", + "processing_status": "processingStatus", + "deleted_at": "deletedAt", + "list_version": "listVersion", + "size": "size", + "name": "name", + "created_by_id": "createdById", + "updated_at": "updatedAt", + } + + def __init__( + self, + processing_type=None, + object_type_id=None, + updated_by_id=None, + filters_updated_at=None, + list_id=None, + created_at=None, + processing_status=None, + deleted_at=None, + list_version=None, + size=None, + name=None, + created_by_id=None, + updated_at=None, + local_vars_configuration=None, + ): # noqa: E501 + """PublicList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._processing_type = None + self._object_type_id = None + self._updated_by_id = None + self._filters_updated_at = None + self._list_id = None + self._created_at = None + self._processing_status = None + self._deleted_at = None + self._list_version = None + self._size = None + self._name = None + self._created_by_id = None + self._updated_at = None + self.discriminator = None + + self.processing_type = processing_type + self.object_type_id = object_type_id + if updated_by_id is not None: + self.updated_by_id = updated_by_id + if filters_updated_at is not None: + self.filters_updated_at = filters_updated_at + self.list_id = list_id + if created_at is not None: + self.created_at = created_at + self.processing_status = processing_status + if deleted_at is not None: + self.deleted_at = deleted_at + self.list_version = list_version + if size is not None: + self.size = size + self.name = name + if created_by_id is not None: + self.created_by_id = created_by_id + if updated_at is not None: + self.updated_at = updated_at + + @property + def processing_type(self): + """Gets the processing_type of this PublicList. # noqa: E501 + + + :return: The processing_type of this PublicList. # noqa: E501 + :rtype: str + """ + return self._processing_type + + @processing_type.setter + def processing_type(self, processing_type): + """Sets the processing_type of this PublicList. + + + :param processing_type: The processing_type of this PublicList. # noqa: E501 + :type processing_type: str + """ + if self.local_vars_configuration.client_side_validation and processing_type is None: # noqa: E501 + raise ValueError("Invalid value for `processing_type`, must not be `None`") # noqa: E501 + + self._processing_type = processing_type + + @property + def object_type_id(self): + """Gets the object_type_id of this PublicList. # noqa: E501 + + + :return: The object_type_id of this PublicList. # noqa: E501 + :rtype: str + """ + return self._object_type_id + + @object_type_id.setter + def object_type_id(self, object_type_id): + """Sets the object_type_id of this PublicList. + + + :param object_type_id: The object_type_id of this PublicList. # noqa: E501 + :type object_type_id: str + """ + if self.local_vars_configuration.client_side_validation and object_type_id is None: # noqa: E501 + raise ValueError("Invalid value for `object_type_id`, must not be `None`") # noqa: E501 + + self._object_type_id = object_type_id + + @property + def updated_by_id(self): + """Gets the updated_by_id of this PublicList. # noqa: E501 + + + :return: The updated_by_id of this PublicList. # noqa: E501 + :rtype: str + """ + return self._updated_by_id + + @updated_by_id.setter + def updated_by_id(self, updated_by_id): + """Sets the updated_by_id of this PublicList. + + + :param updated_by_id: The updated_by_id of this PublicList. # noqa: E501 + :type updated_by_id: str + """ + + self._updated_by_id = updated_by_id + + @property + def filters_updated_at(self): + """Gets the filters_updated_at of this PublicList. # noqa: E501 + + + :return: The filters_updated_at of this PublicList. # noqa: E501 + :rtype: datetime + """ + return self._filters_updated_at + + @filters_updated_at.setter + def filters_updated_at(self, filters_updated_at): + """Sets the filters_updated_at of this PublicList. + + + :param filters_updated_at: The filters_updated_at of this PublicList. # noqa: E501 + :type filters_updated_at: datetime + """ + + self._filters_updated_at = filters_updated_at + + @property + def list_id(self): + """Gets the list_id of this PublicList. # noqa: E501 + + + :return: The list_id of this PublicList. # noqa: E501 + :rtype: str + """ + return self._list_id + + @list_id.setter + def list_id(self, list_id): + """Sets the list_id of this PublicList. + + + :param list_id: The list_id of this PublicList. # noqa: E501 + :type list_id: str + """ + if self.local_vars_configuration.client_side_validation and list_id is None: # noqa: E501 + raise ValueError("Invalid value for `list_id`, must not be `None`") # noqa: E501 + + self._list_id = list_id + + @property + def created_at(self): + """Gets the created_at of this PublicList. # noqa: E501 + + + :return: The created_at of this PublicList. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this PublicList. + + + :param created_at: The created_at of this PublicList. # noqa: E501 + :type created_at: datetime + """ + + self._created_at = created_at + + @property + def processing_status(self): + """Gets the processing_status of this PublicList. # noqa: E501 + + + :return: The processing_status of this PublicList. # noqa: E501 + :rtype: str + """ + return self._processing_status + + @processing_status.setter + def processing_status(self, processing_status): + """Sets the processing_status of this PublicList. + + + :param processing_status: The processing_status of this PublicList. # noqa: E501 + :type processing_status: str + """ + if self.local_vars_configuration.client_side_validation and processing_status is None: # noqa: E501 + raise ValueError("Invalid value for `processing_status`, must not be `None`") # noqa: E501 + + self._processing_status = processing_status + + @property + def deleted_at(self): + """Gets the deleted_at of this PublicList. # noqa: E501 + + + :return: The deleted_at of this PublicList. # noqa: E501 + :rtype: datetime + """ + return self._deleted_at + + @deleted_at.setter + def deleted_at(self, deleted_at): + """Sets the deleted_at of this PublicList. + + + :param deleted_at: The deleted_at of this PublicList. # noqa: E501 + :type deleted_at: datetime + """ + + self._deleted_at = deleted_at + + @property + def list_version(self): + """Gets the list_version of this PublicList. # noqa: E501 + + + :return: The list_version of this PublicList. # noqa: E501 + :rtype: int + """ + return self._list_version + + @list_version.setter + def list_version(self, list_version): + """Sets the list_version of this PublicList. + + + :param list_version: The list_version of this PublicList. # noqa: E501 + :type list_version: int + """ + if self.local_vars_configuration.client_side_validation and list_version is None: # noqa: E501 + raise ValueError("Invalid value for `list_version`, must not be `None`") # noqa: E501 + + self._list_version = list_version + + @property + def size(self): + """Gets the size of this PublicList. # noqa: E501 + + + :return: The size of this PublicList. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this PublicList. + + + :param size: The size of this PublicList. # noqa: E501 + :type size: int + """ + + self._size = size + + @property + def name(self): + """Gets the name of this PublicList. # noqa: E501 + + + :return: The name of this PublicList. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this PublicList. + + + :param name: The name of this PublicList. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def created_by_id(self): + """Gets the created_by_id of this PublicList. # noqa: E501 + + + :return: The created_by_id of this PublicList. # noqa: E501 + :rtype: str + """ + return self._created_by_id + + @created_by_id.setter + def created_by_id(self, created_by_id): + """Sets the created_by_id of this PublicList. + + + :param created_by_id: The created_by_id of this PublicList. # noqa: E501 + :type created_by_id: str + """ + + self._created_by_id = created_by_id + + @property + def updated_at(self): + """Gets the updated_at of this PublicList. # noqa: E501 + + + :return: The updated_at of this PublicList. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this PublicList. + + + :param updated_at: The updated_at of this PublicList. # noqa: E501 + :type updated_at: datetime + """ + + self._updated_at = updated_at + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PublicList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PublicList): + return True + + return self.to_dict() != other.to_dict() From ef27cc9e33d17592b912c64e158c5d4272485811 Mon Sep 17 00:00:00 2001 From: alexey Date: Thu, 17 Oct 2024 16:26:55 +0300 Subject: [PATCH 03/15] Enhance DiscoveryBase --- hubspot/discovery/discovery_base.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/hubspot/discovery/discovery_base.py b/hubspot/discovery/discovery_base.py index be842765..d904478d 100644 --- a/hubspot/discovery/discovery_base.py +++ b/hubspot/discovery/discovery_base.py @@ -10,23 +10,21 @@ def __init__(self, config): def _configure_api_client(self, api_client_package, api_name): api_factory = self.config.get("api_factory") or self._default_api_factory - config = {k: v for k, v in self.config.items() if k != "api_factory" and v} + config = {k: v for k, v in self.config.items() if k != "api_factory" and v is not None} return api_factory(api_client_package, api_name, config) @staticmethod def _default_api_factory(api_client_package, api_name, config): configuration = api_client_package.Configuration() - if "api_key" in config: - configuration.api_key["developer_hapikey"] = config["api_key"] - if "access_token" in config: - configuration.access_token = config["access_token"] - if "retry" in config: - configuration.retries = config["retry"] - if "verify_ssl" in config: - configuration.verify_ssl = config["verify_ssl"] + for key in config: + if key == "api_key": + configuration.api_key["developer_hapikey"] = config["api_key"] + elif key == "retry": + configuration.retries = config["retry"] + else: + setattr(configuration, key, config[key]) api_client = api_client_package.ApiClient(configuration=configuration) - package_version = metadata.version("hubspot-api-client") api_client.user_agent = "hubspot-api-client-python; {0}".format(package_version) From 103ae7c174ea1bbba44921f0d2ae9f1bb8a645da Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 22 Oct 2024 12:36:48 +0300 Subject: [PATCH 04/15] add Request class --- hubspot/utils/requests/__init__.py | 0 hubspot/utils/requests/http_auth.py | 32 ++++ .../utils/requests/http_request_builder.py | 92 ++++++++++ setup.py | 9 +- tests/spec/utils/requests/test_auth.py | 41 +++++ .../utils/requests/test_request_builder.py | 158 ++++++++++++++++++ 6 files changed, 328 insertions(+), 4 deletions(-) create mode 100644 hubspot/utils/requests/__init__.py create mode 100644 hubspot/utils/requests/http_auth.py create mode 100644 hubspot/utils/requests/http_request_builder.py create mode 100644 tests/spec/utils/requests/test_auth.py create mode 100644 tests/spec/utils/requests/test_request_builder.py diff --git a/hubspot/utils/requests/__init__.py b/hubspot/utils/requests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/hubspot/utils/requests/http_auth.py b/hubspot/utils/requests/http_auth.py new file mode 100644 index 00000000..3cbdc5d1 --- /dev/null +++ b/hubspot/utils/requests/http_auth.py @@ -0,0 +1,32 @@ +class Auth: + @staticmethod + def get_auth_types() -> list: + return ["accessToken", "developerApiKey", "hapikey"] + + @staticmethod + def _has_auth_value(source: dict) -> bool: + return bool(source.get("auth_value")) + + @staticmethod + def choose_auth(options: dict, config: dict) -> dict: + auth_types = Auth.get_auth_types() + auth_type = options.get("auth_type") + + if auth_type in auth_types and Auth._has_auth_value(options): + return { + "auth_type": auth_type, + "auth_value": options["auth_value"] + } + + config_auth_type = config.get("auth_type") + if config_auth_type in auth_types and Auth._has_auth_value(config): + return { + "auth_type": config_auth_type, + "auth_value": config["auth_value"] + } + + return { + "auth_type": None, + "auth_value": None + } + diff --git a/hubspot/utils/requests/http_request_builder.py b/hubspot/utils/requests/http_request_builder.py new file mode 100644 index 00000000..4c37488a --- /dev/null +++ b/hubspot/utils/requests/http_request_builder.py @@ -0,0 +1,92 @@ +import requests +import json +from urllib.parse import urlencode + +from hubspot.utils.requests.http_auth import Auth + + +class Request: + def __init__(self, config: dict, options: dict = None): + self.base_url = config.get("base_url", "https://api.hubapi.com") + self.headers = {} + self.body = None + self.default_json = options.get("default_json", True) if options else True + self.options = options or {} + self.method = self.options.get("method", "GET").upper() + self.config = config + + self.init_headers() + self.apply_auth() + self.url = self.generate_url() + self.set_body() + + def get_url(self) -> str: + return self.url + + def get_method(self) -> str: + return self.method + + def get_options_for_sending(self) -> dict: + options = {} + if self.headers: + options["headers"] = self.headers + if self.body: + options["data"] = self.body + return options + + def apply_auth(self): + auth = Auth.choose_auth(self.options, self.config) + + if auth["auth_type"]: + if auth["auth_type"] == "hapikey": + self.options["qs"] = self.options.get("qs", {}) + self.options["qs"]["hapikey"] = auth["auth_value"] + + if auth["auth_type"] == "developerApiKey": + self.options["qs"] = self.options.get("qs", {}) + self.options["qs"]["hapikey"] = auth["auth_value"] + + if auth["auth_type"] == "accessToken": + self.headers["Authorization"] = f"Bearer {auth['auth_value']}" + + def init_headers(self): + if self.default_json: + self.headers["Content-Type"] = "application/json" + self.headers.update(self.get_default_headers()) + if "headers" in self.options: + self.headers.update(self.options["headers"]) + + def get_default_headers(self) -> dict: + headers = { + "User-Agent": self.config.get("user_agent", "custom-python-client/1.0") + } + if self.default_json: + headers["Accept"] = "application/json, */*;q=0.8" + return headers + + def generate_url(self) -> str: + url = self.options.get("base_url", self.base_url) + path = self.options.get("path", "") + url = f"{url}{path}" + + qs = self.options.get("qs") + if qs: + query_string = urlencode(qs) + url += f"?{query_string}" + + return url + + def set_body(self): + if "body" in self.options: + self.body = self.options["body"] + if self.default_json and isinstance(self.body, (dict, list)): + self.body = json.dumps(self.body) + + def send(self) -> requests.Response: + try: + method_func = getattr(requests, self.method.lower(), requests.get) + response = method_func(self.get_url(), **self.get_options_for_sending()) + return response + except requests.exceptions.RequestException as e: + print(f"HTTP error occurred: {e}") + raise diff --git a/setup.py b/setup.py index 454a95bc..3551f2c4 100644 --- a/setup.py +++ b/setup.py @@ -24,10 +24,11 @@ # http://pypi.python.org/pypi/setuptools REQUIRES = [ - "urllib3 >= 1.15", - "six >= 1.10", - "certifi", - "python-dateutil", + "requests >= 2.31.0", + "urllib3 >= 1.15, < 2.0", + "six >= 1.10, < 2.0", + "certifi >= 2023.1.1", + "python-dateutil >= 2.8.2", "importlib-metadata<5; python_version<'3.8'" ] DEV_REQUIRES = ["pytest", "black"] diff --git a/tests/spec/utils/requests/test_auth.py b/tests/spec/utils/requests/test_auth.py new file mode 100644 index 00000000..ae08d7a5 --- /dev/null +++ b/tests/spec/utils/requests/test_auth.py @@ -0,0 +1,41 @@ +import pytest + +from hubspot.utils.requests.http_auth import Auth + + +@pytest.mark.parametrize( + "source,expected", [ + ({"auth_value": "test_value"}, True), + ({}, False) + ] +) +def test_has_auth_value(source, expected): + assert Auth._has_auth_value(source) is expected + + +@pytest.mark.parametrize( + "options, config, expected", [ + # Valid data in options + ({"auth_type": "accessToken", "auth_value": "test_token"}, + {"auth_type": "hapikey", "auth_value": "test_apikey"}, + {"auth_type": "accessToken", "auth_value": "test_token"}), + + # Valid data in config, options is invalid + ({"auth_type": "invalidType", "auth_value": None}, + {"auth_type": "hapikey", "auth_value": "test_apikey"}, + {"auth_type": "hapikey", "auth_value": "test_apikey"}), + + # Invalid data in both options and config + ({"auth_type": "invalidType", "auth_value": None}, + {"auth_type": "invalidType", "auth_value": None}, + {"auth_type": None, "auth_value": None}), + + # auth_value missing in options, config is also not valid + ({"auth_type": "accessToken"}, + {"auth_type": "hapikey", "auth_value": None}, + {"auth_type": None, "auth_value": None}), + ] +) +def test_choose_auth(options, config, expected): + result = Auth.choose_auth(options, config) + assert result == expected diff --git a/tests/spec/utils/requests/test_request_builder.py b/tests/spec/utils/requests/test_request_builder.py new file mode 100644 index 00000000..0a4db212 --- /dev/null +++ b/tests/spec/utils/requests/test_request_builder.py @@ -0,0 +1,158 @@ +import pytest +import json +from unittest.mock import patch +import requests + +from hubspot.utils.requests.http_request_builder import Request + +BASE_PATH = "/contacts/v1/contact" + +COMMON_HEADERS = { + "Content-Type": "application/json", + "User-Agent": "custom-python-client/1.0", + "Accept": "application/json, */*;q=0.8" +} + + +@pytest.fixture +def config(): + return { + "user_agent": "custom-python-client/1.0" + } + + +@pytest.fixture +def options(): + return { + "method": "POST", + "path": BASE_PATH, + "qs": {"param1": "value1"}, + "body": {"key": "value"} + } + + +@pytest.mark.parametrize( + "options, config, expected_url, expected_headers", + [ + ( + { + "path": BASE_PATH, + "auth_type": "developerApiKey", + "auth_value": "test_value_from_options" + }, + { + "auth_type": "accessToken", + "auth_value": "test_value_from_config" + }, + f"https://api.hubapi.com{BASE_PATH}?hapikey=test_value_from_options", + COMMON_HEADERS + ), + ( + { + "path": BASE_PATH, + "auth_type": "hapikey", + "auth_value": "test_value_from_options" + }, + { + "auth_type": "accessToken", + "auth_value": "test_value_from_config" + }, + f"https://api.hubapi.com{BASE_PATH}?hapikey=test_value_from_options", + COMMON_HEADERS + ), + ( + { + "path": BASE_PATH, + "auth_type": "accessToken", + "auth_value": "test_value_from_options" + }, + { + "auth_type": "developerApiKey", + "auth_value": "test_value_from_config" + }, + f"https://api.hubapi.com{BASE_PATH}", + { + **COMMON_HEADERS, + "Authorization": "Bearer test_value_from_options" + } + ), + ( + { + "path": BASE_PATH, + }, + { + "auth_type": "accessToken", + "auth_value": "test_value_from_config" + }, + f"https://api.hubapi.com{BASE_PATH}", + { + **COMMON_HEADERS, + "Authorization": "Bearer test_value_from_config" + } + ) + ] +) +def test_generate_url(options, config, expected_url, expected_headers): + req = Request(config, options) + assert req.get_url() == expected_url + assert req.headers == expected_headers + + +@pytest.mark.parametrize("method", ["GET", "POST", "PUT", "DELETE"]) +def test_http_methods(config, method): + options = { + "method": method, + "path": BASE_PATH + } + req = Request(config, options) + assert req.method == method + + +def test_body_serialization_dict(config): + options = { + "body": {"key": "value"} + } + req = Request(config, options) + expected_body = json.dumps({"key": "value"}) + assert req.body == expected_body + + +def test_body_serialization_list(config): + options = { + "body": [{"key": "value"}] + } + req = Request(config, options) + expected_body = json.dumps([{"key": "value"}]) + assert req.body == expected_body + + +def test_body_string(config): + options = { + "body": "raw_string_data" + } + req = Request(config, options) + assert req.body == "raw_string_data" + + +def test_empty_body(config): + options = { + "body": {} + } + req = Request(config, options) + assert req.body == "{}" + + +@patch("requests.post") +def test_request_exception_handling(mock_post, config, options): + mock_post.side_effect = requests.exceptions.RequestException("Test exception") + + req = Request(config, options) + + with pytest.raises(requests.exceptions.RequestException): + req.send() + + +def test_headers_initialization(config, options): + req = Request(config, options) + assert req.headers["Content-Type"] == "application/json" + assert req.headers["User-Agent"] == "custom-python-client/1.0" From 12ffb462e9133949a816cba7d1b9fcd835c47991 Mon Sep 17 00:00:00 2001 From: alexey Date: Wed, 23 Oct 2024 11:15:13 +0300 Subject: [PATCH 05/15] Enhance method --- hubspot/utils/objects.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/hubspot/utils/objects.py b/hubspot/utils/objects.py index 7808a504..b68c6976 100644 --- a/hubspot/utils/objects.py +++ b/hubspot/utils/objects.py @@ -1,17 +1,28 @@ PAGE_MAX_SIZE = 100 +PROPERTY_HISTORY_MAX_SIZE = 50 def fetch_all(get_page_api_client, **kwargs): results = [] after = None - if not kwargs.get("limit"): - kwargs["limit"] = PAGE_MAX_SIZE + + max_page_size = PROPERTY_HISTORY_MAX_SIZE if "properties_with_history" in kwargs else PAGE_MAX_SIZE + limit = kwargs.pop("limit", None) + total_fetched = 0 while True: - page = get_page_api_client.get_page(after=after, **kwargs) + limit_for_current_page = min(max_page_size, limit - total_fetched) if limit else max_page_size + page = get_page_api_client.get_page(after=after, limit=limit_for_current_page, **kwargs) + results.extend(page.results) - if page.paging is None: + total_fetched += len(page.results) + + if limit and total_fetched >= limit: break + + if page.paging is None or page.paging.next is None: + break + after = page.paging.next.after return results From 2e1a281b2e64dd73977fa678fcbb1a8a4fcb65df Mon Sep 17 00:00:00 2001 From: alexey Date: Thu, 24 Oct 2024 13:28:49 +0300 Subject: [PATCH 06/15] add request_api --- hubspot/client.py | 6 +++ hubspot/utils/requests/http_auth.py | 30 +++++------- .../utils/requests/http_request_builder.py | 14 ++---- tests/spec/utils/requests/test_auth.py | 40 ++++++++-------- .../utils/requests/test_request_builder.py | 47 ++++--------------- 5 files changed, 51 insertions(+), 86 deletions(-) diff --git a/hubspot/client.py b/hubspot/client.py index d61bbbf4..9956aa40 100644 --- a/hubspot/client.py +++ b/hubspot/client.py @@ -1,5 +1,6 @@ from urllib3.util.retry import Retry + class Client: def __init__( self, @@ -86,3 +87,8 @@ def settings(self): def webhooks(self): from .discovery.webhooks.discovery import Discovery as WebhooksDiscovery return WebhooksDiscovery(self.config) + + def api_request(self, options): + from .utils.requests.http_request_builder import Request + request = Request(self.config, options) + return request.send() diff --git a/hubspot/utils/requests/http_auth.py b/hubspot/utils/requests/http_auth.py index 3cbdc5d1..1c0f17a5 100644 --- a/hubspot/utils/requests/http_auth.py +++ b/hubspot/utils/requests/http_auth.py @@ -1,32 +1,24 @@ class Auth: @staticmethod def get_auth_types() -> list: - return ["accessToken", "developerApiKey", "hapikey"] + return ["access_token", "api_key"] @staticmethod - def _has_auth_value(source: dict) -> bool: - return bool(source.get("auth_value")) + def _has_auth_value(source: dict, key: str) -> bool: + return bool(source.get(key)) @staticmethod - def choose_auth(options: dict, config: dict) -> dict: + def choose_auth(config: dict, options: dict) -> dict: auth_types = Auth.get_auth_types() auth_type = options.get("auth_type") - if auth_type in auth_types and Auth._has_auth_value(options): - return { - "auth_type": auth_type, - "auth_value": options["auth_value"] - } + if auth_type in auth_types and Auth._has_auth_value(config, auth_type): + return {"auth_type": auth_type} - config_auth_type = config.get("auth_type") - if config_auth_type in auth_types and Auth._has_auth_value(config): - return { - "auth_type": config_auth_type, - "auth_value": config["auth_value"] - } + else: + for key in auth_types: + if key in config and Auth._has_auth_value(config, key): + return {"auth_type": key} - return { - "auth_type": None, - "auth_value": None - } + return {"auth_type": None} diff --git a/hubspot/utils/requests/http_request_builder.py b/hubspot/utils/requests/http_request_builder.py index 4c37488a..047674bc 100644 --- a/hubspot/utils/requests/http_request_builder.py +++ b/hubspot/utils/requests/http_request_builder.py @@ -35,19 +35,15 @@ def get_options_for_sending(self) -> dict: return options def apply_auth(self): - auth = Auth.choose_auth(self.options, self.config) + auth = Auth.choose_auth(self.config, self.options) if auth["auth_type"]: - if auth["auth_type"] == "hapikey": + if auth["auth_type"] == "api_key": self.options["qs"] = self.options.get("qs", {}) - self.options["qs"]["hapikey"] = auth["auth_value"] + self.options["qs"]["hapikey"] = self.config.get(auth["auth_type"]) - if auth["auth_type"] == "developerApiKey": - self.options["qs"] = self.options.get("qs", {}) - self.options["qs"]["hapikey"] = auth["auth_value"] - - if auth["auth_type"] == "accessToken": - self.headers["Authorization"] = f"Bearer {auth['auth_value']}" + if auth["auth_type"] == "access_token": + self.headers["Authorization"] = f"Bearer {self.config.get(auth['auth_type'])}" def init_headers(self): if self.default_json: diff --git a/tests/spec/utils/requests/test_auth.py b/tests/spec/utils/requests/test_auth.py index ae08d7a5..157112a6 100644 --- a/tests/spec/utils/requests/test_auth.py +++ b/tests/spec/utils/requests/test_auth.py @@ -4,38 +4,38 @@ @pytest.mark.parametrize( - "source,expected", [ - ({"auth_value": "test_value"}, True), - ({}, False) + "source,key,expected", [ + ({"auth_value": "test_value"}, "auth_value", True), + ({}, "key", False) ] ) -def test_has_auth_value(source, expected): - assert Auth._has_auth_value(source) is expected +def test_has_auth_value(source, key, expected): + assert Auth._has_auth_value(source, key) is expected @pytest.mark.parametrize( - "options, config, expected", [ + "config, options, expected", [ # Valid data in options - ({"auth_type": "accessToken", "auth_value": "test_token"}, - {"auth_type": "hapikey", "auth_value": "test_apikey"}, - {"auth_type": "accessToken", "auth_value": "test_token"}), + ({"access_token": "test_api_key"}, + {"auth_type": "access_token"}, + {"auth_type": "access_token"}), # Valid data in config, options is invalid - ({"auth_type": "invalidType", "auth_value": None}, - {"auth_type": "hapikey", "auth_value": "test_apikey"}, - {"auth_type": "hapikey", "auth_value": "test_apikey"}), + ({"api_key": "test_api_key"}, + {"auth_type": "access_token"}, + {"auth_type": "api_key"}), # Invalid data in both options and config - ({"auth_type": "invalidType", "auth_value": None}, - {"auth_type": "invalidType", "auth_value": None}, - {"auth_type": None, "auth_value": None}), + ({"invalid_type": None}, + {"auth_type": "invalid_type"}, + {"auth_type": None}), # auth_value missing in options, config is also not valid - ({"auth_type": "accessToken"}, - {"auth_type": "hapikey", "auth_value": None}, - {"auth_type": None, "auth_value": None}), + ({"api_key": None}, + {"auth_type": "access_token"}, + {"auth_type": None}), ] ) -def test_choose_auth(options, config, expected): - result = Auth.choose_auth(options, config) +def test_choose_auth(config, options, expected): + result = Auth.choose_auth(config, options) assert result == expected diff --git a/tests/spec/utils/requests/test_request_builder.py b/tests/spec/utils/requests/test_request_builder.py index 0a4db212..16f5e16b 100644 --- a/tests/spec/utils/requests/test_request_builder.py +++ b/tests/spec/utils/requests/test_request_builder.py @@ -17,7 +17,8 @@ @pytest.fixture def config(): return { - "user_agent": "custom-python-client/1.0" + "access_token": "test_access_token", + "api_key": "test_api_key" } @@ -37,59 +38,29 @@ def options(): ( { "path": BASE_PATH, - "auth_type": "developerApiKey", - "auth_value": "test_value_from_options" + "auth_type": "api_key", }, { - "auth_type": "accessToken", - "auth_value": "test_value_from_config" + "api_key": "test_api_key", }, - f"https://api.hubapi.com{BASE_PATH}?hapikey=test_value_from_options", + f"https://api.hubapi.com{BASE_PATH}?hapikey=test_api_key", COMMON_HEADERS ), ( { "path": BASE_PATH, - "auth_type": "hapikey", - "auth_value": "test_value_from_options" + "auth_type": "access_token", }, { - "auth_type": "accessToken", - "auth_value": "test_value_from_config" - }, - f"https://api.hubapi.com{BASE_PATH}?hapikey=test_value_from_options", - COMMON_HEADERS - ), - ( - { - "path": BASE_PATH, - "auth_type": "accessToken", - "auth_value": "test_value_from_options" - }, - { - "auth_type": "developerApiKey", - "auth_value": "test_value_from_config" + "access_token": "test_access_token", + "api_key": "test_api_key" }, f"https://api.hubapi.com{BASE_PATH}", { **COMMON_HEADERS, - "Authorization": "Bearer test_value_from_options" + "Authorization": "Bearer test_access_token" } ), - ( - { - "path": BASE_PATH, - }, - { - "auth_type": "accessToken", - "auth_value": "test_value_from_config" - }, - f"https://api.hubapi.com{BASE_PATH}", - { - **COMMON_HEADERS, - "Authorization": "Bearer test_value_from_config" - } - ) ] ) def test_generate_url(options, config, expected_url, expected_headers): From 76f321d59329fdd73b06ef1c2e23795d8397ce74 Mon Sep 17 00:00:00 2001 From: alexey Date: Thu, 24 Oct 2024 15:43:03 +0300 Subject: [PATCH 07/15] Update Readme --- README.md | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3d5d5531..240b9e6a 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,66 @@ try: except ApiException as e: print("Exception when calling cards_api->create: %s\n" % e) ``` +## Not wrapped endpoint(s) +It is possible to access the hubspot request method directly, +it could be handy if client doesn't have implementation for some endpoint yet. +Exposed request method benefits by having all configured client params. + +```python +client.api_request({ + "method": "PUT", + "path": "/some/api/not/wrapped/yet", + "body": {"key": "value"} +}) +``` + +### Get contacts + +```python +import hubspot +from pprint import pprint +from hubspot.crm.contacts import ApiException + +client = hubspot.Client.create(access_token="your_access_token") + +try: + response = client.api_request( + {"path": "/crm/v3/objects/contacts"} + ) + pprint(response) +except ApiException as e: + print(e) +``` + +### Create contact + +```python +import hubspot +from pprint import pprint +from hubspot.crm.contacts import ApiException + +client = hubspot.Client.create(access_token="your_access_token") + +try: + response = client.api_request( + { + "path": "/crm/v3/objects/contacts", + "method": "POST", + "body": { + "properties": + { + "email": "some_email@some.com", + "lastname": "some_last_name" + }, + } + } + + ) + pprint(response.json()) +except ApiException as e: + print(e) +``` ### Using utils #### Get OAuth url: @@ -183,8 +242,6 @@ auth_url = get_auth_url( ```python import os - -from datetime import datetime from flask import request from hubspot.utils.signature import Signature @@ -194,7 +251,7 @@ Signature.is_valid( request_body=request.data.decode("utf-8"), http_uri=request.base_url, signature_version=request.headers["X-HubSpot-Signature-Version"], - timestamp=datetime.now().timestamp() + timestamp=request.headers["X-HubSpot-Request-Timestamp"] ) ``` From 9f981babe82b9f5f63bf726f73c3a5033e74f588 Mon Sep 17 00:00:00 2001 From: alexey Date: Thu, 24 Oct 2024 16:05:50 +0300 Subject: [PATCH 08/15] Clean up --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 240b9e6a..daa73af2 100644 --- a/README.md +++ b/README.md @@ -176,7 +176,7 @@ client.api_request({ }) ``` -### Get contacts +### {Example} for `GET` request ```python import hubspot @@ -194,7 +194,7 @@ except ApiException as e: print(e) ``` -### Create contact +### {Example} for `POST` request ```python import hubspot From 7a6e25cfdb62332c432366aa93df01c8f97bebd2 Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 28 Oct 2024 09:03:47 +0300 Subject: [PATCH 09/15] Fix tickets discovery --- hubspot/discovery/crm/tickets/discovery.py | 12 ++++++++---- tests/spec/crm/test_tickets.py | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hubspot/discovery/crm/tickets/discovery.py b/hubspot/discovery/crm/tickets/discovery.py index 66cb6695..2af56323 100644 --- a/hubspot/discovery/crm/tickets/discovery.py +++ b/hubspot/discovery/crm/tickets/discovery.py @@ -8,13 +8,17 @@ class Discovery(DiscoveryBase): def basic_api(self) -> api_client.BasicApi: return self._configure_api_client(api_client, "BasicApi") - @property - def search_api(self) -> api_client.SearchApi: - return self._configure_api_client(api_client, "SearchApi") - @property def batch_api(self) -> api_client.BatchApi: return self._configure_api_client(api_client, "BatchApi") + @property + def merge_api(self) -> api_client.MergeApi: + return self._configure_api_client(api_client, "MergeApi") + + @property + def search_api(self) -> api_client.SearchApi: + return self._configure_api_client(api_client, "SearchApi") + def get_all(self, **kwargs): return fetch_all(self.basic_api, **kwargs) diff --git a/tests/spec/crm/test_tickets.py b/tests/spec/crm/test_tickets.py index e57b00d0..888ea1a8 100644 --- a/tests/spec/crm/test_tickets.py +++ b/tests/spec/crm/test_tickets.py @@ -1,10 +1,11 @@ from hubspot import HubSpot -from hubspot.crm.tickets import BasicApi, BatchApi, SearchApi +from hubspot.crm.tickets import BasicApi, BatchApi, MergeApi, SearchApi def test_is_discoverable(): apis = HubSpot().crm.tickets assert isinstance(apis.basic_api, BasicApi) assert isinstance(apis.batch_api, BatchApi) + assert isinstance(apis.merge_api, MergeApi) assert isinstance(apis.search_api, SearchApi) assert hasattr(apis, "get_all") From 2c3241f8f7d741f6fbb8c5145d1bfd8413515f1b Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 18 Nov 2024 10:07:04 +0300 Subject: [PATCH 10/15] Codegen: Crm Associations --- hubspot/crm/associations/__init__.py | 48 -- hubspot/crm/associations/api/batch_api.py | 2 +- hubspot/crm/associations/api_client.py | 2 +- hubspot/crm/associations/configuration.py | 2 +- hubspot/crm/associations/exceptions.py | 2 +- hubspot/crm/associations/models/__init__.py | 2 +- .../crm/associations/models/associated_id.py | 2 +- .../models/batch_input_public_association.py | 2 +- .../models/batch_input_public_object_id.py | 2 +- .../batch_response_public_association.py | 2 +- ...batch_response_public_association_multi.py | 2 +- ...se_public_association_multi_with_errors.py | 2 +- ...response_public_association_with_errors.py | 2 +- hubspot/crm/associations/models/error.py | 2 +- .../crm/associations/models/error_detail.py | 2 +- hubspot/crm/associations/models/next_page.py | 2 +- hubspot/crm/associations/models/paging.py | 2 +- .../crm/associations/models/previous_page.py | 2 +- .../associations/models/public_association.py | 2 +- .../models/public_association_multi.py | 2 +- .../associations/models/public_object_id.py | 2 +- .../crm/associations/models/standard_error.py | 2 +- hubspot/crm/associations/rest.py | 2 +- hubspot/crm/associations/schema/__init__.py | 2 +- .../crm/associations/schema/api/types_api.py | 2 +- hubspot/crm/associations/schema/api_client.py | 2 +- .../crm/associations/schema/configuration.py | 2 +- hubspot/crm/associations/schema/exceptions.py | 2 +- .../associations/schema/models/__init__.py | 2 +- ...public_association_definition_no_paging.py | 2 +- .../crm/associations/schema/models/error.py | 2 +- .../schema/models/error_detail.py | 2 +- .../models/public_association_definition.py | 2 +- hubspot/crm/associations/schema/rest.py | 2 +- hubspot/crm/associations/v4/__init__.py | 3 + hubspot/crm/associations/v4/api/__init__.py | 1 + hubspot/crm/associations/v4/api/batch_api.py | 4 +- hubspot/crm/associations/v4/api/report_api.py | 157 ++++ .../crm/associations/v4/models/__init__.py | 2 + .../crm/associations/v4/models/date_time.py | 172 +++++ .../v4/models/report_creation_response.py | 172 +++++ .../crm/associations/v4/schema/__init__.py | 19 + .../associations/v4/schema/api/__init__.py | 1 + .../api/definition_configurations_api.py | 718 ++++++++++++++++++ .../v4/schema/api/definitions_api.py | 154 ++-- .../associations/v4/schema/models/__init__.py | 18 + ...definition_configuration_create_request.py | 122 +++ ...definition_configuration_update_request.py | 122 +++ .../batch_input_public_association_spec.py | 122 +++ ..._definition_configuration_update_result.py | 255 +++++++ ...configuration_update_result_with_errors.py | 314 ++++++++ ...sociation_definition_user_configuration.py | 255 +++++++ ...finition_user_configuration_with_errors.py | 314 ++++++++ ...definition_user_configuration_no_paging.py | 122 +++ ...definition_configuration_create_request.py | 175 +++++ ...definition_configuration_update_request.py | 175 +++++ ..._definition_configuration_update_result.py | 174 +++++ ...sociation_definition_user_configuration.py | 198 +++++ .../schema/models/public_association_spec.py | 147 ++++ .../v4/schema/models/standard_error.py | 304 ++++++++ 60 files changed, 4174 insertions(+), 160 deletions(-) create mode 100644 hubspot/crm/associations/v4/api/report_api.py create mode 100644 hubspot/crm/associations/v4/models/date_time.py create mode 100644 hubspot/crm/associations/v4/models/report_creation_response.py create mode 100644 hubspot/crm/associations/v4/schema/api/definition_configurations_api.py create mode 100644 hubspot/crm/associations/v4/schema/models/batch_input_public_association_definition_configuration_create_request.py create mode 100644 hubspot/crm/associations/v4/schema/models/batch_input_public_association_definition_configuration_update_request.py create mode 100644 hubspot/crm/associations/v4/schema/models/batch_input_public_association_spec.py create mode 100644 hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_configuration_update_result.py create mode 100644 hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_configuration_update_result_with_errors.py create mode 100644 hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_user_configuration.py create mode 100644 hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_user_configuration_with_errors.py create mode 100644 hubspot/crm/associations/v4/schema/models/collection_response_public_association_definition_user_configuration_no_paging.py create mode 100644 hubspot/crm/associations/v4/schema/models/public_association_definition_configuration_create_request.py create mode 100644 hubspot/crm/associations/v4/schema/models/public_association_definition_configuration_update_request.py create mode 100644 hubspot/crm/associations/v4/schema/models/public_association_definition_configuration_update_result.py create mode 100644 hubspot/crm/associations/v4/schema/models/public_association_definition_user_configuration.py create mode 100644 hubspot/crm/associations/v4/schema/models/public_association_spec.py create mode 100644 hubspot/crm/associations/v4/schema/models/standard_error.py diff --git a/hubspot/crm/associations/__init__.py b/hubspot/crm/associations/__init__.py index c7128ea2..e69de29b 100644 --- a/hubspot/crm/associations/__init__.py +++ b/hubspot/crm/associations/__init__.py @@ -1,48 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" - CRM Associations - - Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 - - The version of the OpenAPI document: v3 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -__version__ = "1.0.0" - -# import apis into sdk package -from hubspot.crm.associations.api.batch_api import BatchApi - -# import ApiClient -from hubspot.crm.associations.api_client import ApiClient -from hubspot.crm.associations.configuration import Configuration -from hubspot.crm.associations.exceptions import OpenApiException -from hubspot.crm.associations.exceptions import ApiTypeError -from hubspot.crm.associations.exceptions import ApiValueError -from hubspot.crm.associations.exceptions import ApiKeyError -from hubspot.crm.associations.exceptions import ApiAttributeError -from hubspot.crm.associations.exceptions import ApiException - -# import models into sdk package -from hubspot.crm.associations.models.associated_id import AssociatedId -from hubspot.crm.associations.models.batch_input_public_association import BatchInputPublicAssociation -from hubspot.crm.associations.models.batch_input_public_object_id import BatchInputPublicObjectId -from hubspot.crm.associations.models.batch_response_public_association import BatchResponsePublicAssociation -from hubspot.crm.associations.models.batch_response_public_association_multi import BatchResponsePublicAssociationMulti -from hubspot.crm.associations.models.batch_response_public_association_multi_with_errors import BatchResponsePublicAssociationMultiWithErrors -from hubspot.crm.associations.models.batch_response_public_association_with_errors import BatchResponsePublicAssociationWithErrors -from hubspot.crm.associations.models.error import Error -from hubspot.crm.associations.models.error_detail import ErrorDetail -from hubspot.crm.associations.models.next_page import NextPage -from hubspot.crm.associations.models.paging import Paging -from hubspot.crm.associations.models.previous_page import PreviousPage -from hubspot.crm.associations.models.public_association import PublicAssociation -from hubspot.crm.associations.models.public_association_multi import PublicAssociationMulti -from hubspot.crm.associations.models.public_object_id import PublicObjectId -from hubspot.crm.associations.models.standard_error import StandardError diff --git a/hubspot/crm/associations/api/batch_api.py b/hubspot/crm/associations/api/batch_api.py index 39113a57..8a6c247a 100644 --- a/hubspot/crm/associations/api/batch_api.py +++ b/hubspot/crm/associations/api/batch_api.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/api_client.py b/hubspot/crm/associations/api_client.py index 10d236e7..5bb24f6c 100644 --- a/hubspot/crm/associations/api_client.py +++ b/hubspot/crm/associations/api_client.py @@ -1,6 +1,6 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/configuration.py b/hubspot/crm/associations/configuration.py index 519c8998..9482b534 100644 --- a/hubspot/crm/associations/configuration.py +++ b/hubspot/crm/associations/configuration.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/exceptions.py b/hubspot/crm/associations/exceptions.py index 6e639fb6..4453b66e 100644 --- a/hubspot/crm/associations/exceptions.py +++ b/hubspot/crm/associations/exceptions.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/__init__.py b/hubspot/crm/associations/models/__init__.py index b3fb888b..d5d72a7e 100644 --- a/hubspot/crm/associations/models/__init__.py +++ b/hubspot/crm/associations/models/__init__.py @@ -2,7 +2,7 @@ # flake8: noqa """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/associated_id.py b/hubspot/crm/associations/models/associated_id.py index f4cc7a8a..231768fa 100644 --- a/hubspot/crm/associations/models/associated_id.py +++ b/hubspot/crm/associations/models/associated_id.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/batch_input_public_association.py b/hubspot/crm/associations/models/batch_input_public_association.py index 4d6e638b..329642ac 100644 --- a/hubspot/crm/associations/models/batch_input_public_association.py +++ b/hubspot/crm/associations/models/batch_input_public_association.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/batch_input_public_object_id.py b/hubspot/crm/associations/models/batch_input_public_object_id.py index 24b71604..e6dbe03d 100644 --- a/hubspot/crm/associations/models/batch_input_public_object_id.py +++ b/hubspot/crm/associations/models/batch_input_public_object_id.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/batch_response_public_association.py b/hubspot/crm/associations/models/batch_response_public_association.py index f5426ae6..cc7d6308 100644 --- a/hubspot/crm/associations/models/batch_response_public_association.py +++ b/hubspot/crm/associations/models/batch_response_public_association.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/batch_response_public_association_multi.py b/hubspot/crm/associations/models/batch_response_public_association_multi.py index 18b6d60e..ded97dcf 100644 --- a/hubspot/crm/associations/models/batch_response_public_association_multi.py +++ b/hubspot/crm/associations/models/batch_response_public_association_multi.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/batch_response_public_association_multi_with_errors.py b/hubspot/crm/associations/models/batch_response_public_association_multi_with_errors.py index befaf2f8..09869e66 100644 --- a/hubspot/crm/associations/models/batch_response_public_association_multi_with_errors.py +++ b/hubspot/crm/associations/models/batch_response_public_association_multi_with_errors.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/batch_response_public_association_with_errors.py b/hubspot/crm/associations/models/batch_response_public_association_with_errors.py index be96a748..0696db92 100644 --- a/hubspot/crm/associations/models/batch_response_public_association_with_errors.py +++ b/hubspot/crm/associations/models/batch_response_public_association_with_errors.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/error.py b/hubspot/crm/associations/models/error.py index 6c16b19a..9ab5bb9c 100644 --- a/hubspot/crm/associations/models/error.py +++ b/hubspot/crm/associations/models/error.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/error_detail.py b/hubspot/crm/associations/models/error_detail.py index e75e79b8..27a128c4 100644 --- a/hubspot/crm/associations/models/error_detail.py +++ b/hubspot/crm/associations/models/error_detail.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/next_page.py b/hubspot/crm/associations/models/next_page.py index 12297d50..dd914a3f 100644 --- a/hubspot/crm/associations/models/next_page.py +++ b/hubspot/crm/associations/models/next_page.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/paging.py b/hubspot/crm/associations/models/paging.py index c11ca6a8..c94339ce 100644 --- a/hubspot/crm/associations/models/paging.py +++ b/hubspot/crm/associations/models/paging.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/previous_page.py b/hubspot/crm/associations/models/previous_page.py index 6ba8eabe..72b57400 100644 --- a/hubspot/crm/associations/models/previous_page.py +++ b/hubspot/crm/associations/models/previous_page.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/public_association.py b/hubspot/crm/associations/models/public_association.py index a3f48f51..7d5b5251 100644 --- a/hubspot/crm/associations/models/public_association.py +++ b/hubspot/crm/associations/models/public_association.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/public_association_multi.py b/hubspot/crm/associations/models/public_association_multi.py index 194d5cba..0d7ed3b4 100644 --- a/hubspot/crm/associations/models/public_association_multi.py +++ b/hubspot/crm/associations/models/public_association_multi.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/public_object_id.py b/hubspot/crm/associations/models/public_object_id.py index 30870d5f..52f8b739 100644 --- a/hubspot/crm/associations/models/public_object_id.py +++ b/hubspot/crm/associations/models/public_object_id.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/models/standard_error.py b/hubspot/crm/associations/models/standard_error.py index 577f0bf2..ecb10e02 100644 --- a/hubspot/crm/associations/models/standard_error.py +++ b/hubspot/crm/associations/models/standard_error.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/rest.py b/hubspot/crm/associations/rest.py index 42114f4b..0c8dca39 100644 --- a/hubspot/crm/associations/rest.py +++ b/hubspot/crm/associations/rest.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations + Associations Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/schema/__init__.py b/hubspot/crm/associations/schema/__init__.py index f684ceb0..e5c3f84f 100644 --- a/hubspot/crm/associations/schema/__init__.py +++ b/hubspot/crm/associations/schema/__init__.py @@ -3,7 +3,7 @@ # flake8: noqa """ - CRM Associations Schema + Associations Schema Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/schema/api/types_api.py b/hubspot/crm/associations/schema/api/types_api.py index aeeddc24..b1d0d81a 100644 --- a/hubspot/crm/associations/schema/api/types_api.py +++ b/hubspot/crm/associations/schema/api/types_api.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations Schema + Associations Schema Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/schema/api_client.py b/hubspot/crm/associations/schema/api_client.py index eba1f84d..9e8d1373 100644 --- a/hubspot/crm/associations/schema/api_client.py +++ b/hubspot/crm/associations/schema/api_client.py @@ -1,6 +1,6 @@ # coding: utf-8 """ - CRM Associations Schema + Associations Schema Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/schema/configuration.py b/hubspot/crm/associations/schema/configuration.py index 90f8cca8..68136605 100644 --- a/hubspot/crm/associations/schema/configuration.py +++ b/hubspot/crm/associations/schema/configuration.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations Schema + Associations Schema Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/schema/exceptions.py b/hubspot/crm/associations/schema/exceptions.py index d763ab17..3b56d3e6 100644 --- a/hubspot/crm/associations/schema/exceptions.py +++ b/hubspot/crm/associations/schema/exceptions.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations Schema + Associations Schema Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/schema/models/__init__.py b/hubspot/crm/associations/schema/models/__init__.py index c7589f0e..25ed2bf9 100644 --- a/hubspot/crm/associations/schema/models/__init__.py +++ b/hubspot/crm/associations/schema/models/__init__.py @@ -2,7 +2,7 @@ # flake8: noqa """ - CRM Associations Schema + Associations Schema Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/schema/models/collection_response_public_association_definition_no_paging.py b/hubspot/crm/associations/schema/models/collection_response_public_association_definition_no_paging.py index bbd5fda1..4310237f 100644 --- a/hubspot/crm/associations/schema/models/collection_response_public_association_definition_no_paging.py +++ b/hubspot/crm/associations/schema/models/collection_response_public_association_definition_no_paging.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations Schema + Associations Schema Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/schema/models/error.py b/hubspot/crm/associations/schema/models/error.py index 8fe9911b..6b42e775 100644 --- a/hubspot/crm/associations/schema/models/error.py +++ b/hubspot/crm/associations/schema/models/error.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations Schema + Associations Schema Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/schema/models/error_detail.py b/hubspot/crm/associations/schema/models/error_detail.py index 4ddad501..d3581bad 100644 --- a/hubspot/crm/associations/schema/models/error_detail.py +++ b/hubspot/crm/associations/schema/models/error_detail.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations Schema + Associations Schema Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/schema/models/public_association_definition.py b/hubspot/crm/associations/schema/models/public_association_definition.py index 50ff5cad..7a981a75 100644 --- a/hubspot/crm/associations/schema/models/public_association_definition.py +++ b/hubspot/crm/associations/schema/models/public_association_definition.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations Schema + Associations Schema Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/schema/rest.py b/hubspot/crm/associations/schema/rest.py index 005f6800..2e16fa01 100644 --- a/hubspot/crm/associations/schema/rest.py +++ b/hubspot/crm/associations/schema/rest.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CRM Associations Schema + Associations Schema Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 diff --git a/hubspot/crm/associations/v4/__init__.py b/hubspot/crm/associations/v4/__init__.py index 9b782ea4..57dd8198 100644 --- a/hubspot/crm/associations/v4/__init__.py +++ b/hubspot/crm/associations/v4/__init__.py @@ -19,6 +19,7 @@ # import apis into sdk package from hubspot.crm.associations.v4.api.basic_api import BasicApi from hubspot.crm.associations.v4.api.batch_api import BatchApi +from hubspot.crm.associations.v4.api.report_api import ReportApi # import ApiClient from hubspot.crm.associations.v4.api_client import ApiClient @@ -43,6 +44,7 @@ from hubspot.crm.associations.v4.models.batch_response_public_association_multi_with_label_with_errors import BatchResponsePublicAssociationMultiWithLabelWithErrors from hubspot.crm.associations.v4.models.batch_response_public_default_association import BatchResponsePublicDefaultAssociation from hubspot.crm.associations.v4.models.collection_response_multi_associated_object_with_label_forward_paging import CollectionResponseMultiAssociatedObjectWithLabelForwardPaging +from hubspot.crm.associations.v4.models.date_time import DateTime from hubspot.crm.associations.v4.models.error import Error from hubspot.crm.associations.v4.models.error_detail import ErrorDetail from hubspot.crm.associations.v4.models.forward_paging import ForwardPaging @@ -58,4 +60,5 @@ from hubspot.crm.associations.v4.models.public_default_association_multi_post import PublicDefaultAssociationMultiPost from hubspot.crm.associations.v4.models.public_fetch_associations_batch_request import PublicFetchAssociationsBatchRequest from hubspot.crm.associations.v4.models.public_object_id import PublicObjectId +from hubspot.crm.associations.v4.models.report_creation_response import ReportCreationResponse from hubspot.crm.associations.v4.models.standard_error import StandardError diff --git a/hubspot/crm/associations/v4/api/__init__.py b/hubspot/crm/associations/v4/api/__init__.py index 27b5b81e..439b4351 100644 --- a/hubspot/crm/associations/v4/api/__init__.py +++ b/hubspot/crm/associations/v4/api/__init__.py @@ -5,3 +5,4 @@ # import apis into api package from hubspot.crm.associations.v4.api.basic_api import BasicApi from hubspot.crm.associations.v4.api.batch_api import BatchApi +from hubspot.crm.associations.v4.api.report_api import ReportApi diff --git a/hubspot/crm/associations/v4/api/batch_api.py b/hubspot/crm/associations/v4/api/batch_api.py index 2c2d8562..602a3049 100644 --- a/hubspot/crm/associations/v4/api/batch_api.py +++ b/hubspot/crm/associations/v4/api/batch_api.py @@ -617,7 +617,7 @@ def create_default_with_http_info(self, from_object_type, to_object_type, batch_ def get_page(self, from_object_type, to_object_type, batch_input_public_fetch_associations_batch_request, **kwargs): # noqa: E501 """Read # noqa: E501 - Batch read associations for objects to specific object type. The 'after' field in a returned paging object can be added alongside the 'id' to retrieve the next page of associations from that objectId. The 'link' field is deprecated and should be ignored. # noqa: E501 + Batch read associations for objects to specific object type. The 'after' field in a returned paging object can be added alongside the 'id' to retrieve the next page of associations from that objectId. The 'link' field is deprecated and should be ignored. Note: The 'paging' field will only be present if there are more pages and absent otherwise. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -651,7 +651,7 @@ def get_page(self, from_object_type, to_object_type, batch_input_public_fetch_as def get_page_with_http_info(self, from_object_type, to_object_type, batch_input_public_fetch_associations_batch_request, **kwargs): # noqa: E501 """Read # noqa: E501 - Batch read associations for objects to specific object type. The 'after' field in a returned paging object can be added alongside the 'id' to retrieve the next page of associations from that objectId. The 'link' field is deprecated and should be ignored. # noqa: E501 + Batch read associations for objects to specific object type. The 'after' field in a returned paging object can be added alongside the 'id' to retrieve the next page of associations from that objectId. The 'link' field is deprecated and should be ignored. Note: The 'paging' field will only be present if there are more pages and absent otherwise. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/associations/v4/api/report_api.py b/hubspot/crm/associations/v4/api/report_api.py new file mode 100644 index 00000000..87ec744b --- /dev/null +++ b/hubspot/crm/associations/v4/api/report_api.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + CRM Associations + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from hubspot.crm.associations.v4.api_client import ApiClient +from hubspot.crm.associations.v4.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class ReportApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def request(self, user_id, **kwargs): # noqa: E501 + """Report # noqa: E501 + + Requests a report of all objects in the portal which have a high usage of associations # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.request(user_id, async_req=True) + >>> result = thread.get() + + :param user_id: (required) + :type user_id: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ReportCreationResponse + """ + kwargs["_return_http_data_only"] = True + return self.request_with_http_info(user_id, **kwargs) # noqa: E501 + + def request_with_http_info(self, user_id, **kwargs): # noqa: E501 + """Report # noqa: E501 + + Requests a report of all objects in the portal which have a high usage of associations # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.request_with_http_info(user_id, async_req=True) + >>> result = thread.get() + + :param user_id: (required) + :type user_id: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ReportCreationResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["user_id"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method request" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'user_id' is set + if self.api_client.client_side_validation and local_var_params.get("user_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `user_id` when calling `request`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "user_id" in local_var_params: + path_params["userId"] = local_var_params["user_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 200: "ReportCreationResponse", + } + + return self.api_client.call_api( + "/crm/v4/associations/usage/high-usage-report/{userId}", + "POST", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) diff --git a/hubspot/crm/associations/v4/models/__init__.py b/hubspot/crm/associations/v4/models/__init__.py index 17216a35..16ec9c20 100644 --- a/hubspot/crm/associations/v4/models/__init__.py +++ b/hubspot/crm/associations/v4/models/__init__.py @@ -26,6 +26,7 @@ from hubspot.crm.associations.v4.models.batch_response_public_association_multi_with_label_with_errors import BatchResponsePublicAssociationMultiWithLabelWithErrors from hubspot.crm.associations.v4.models.batch_response_public_default_association import BatchResponsePublicDefaultAssociation from hubspot.crm.associations.v4.models.collection_response_multi_associated_object_with_label_forward_paging import CollectionResponseMultiAssociatedObjectWithLabelForwardPaging +from hubspot.crm.associations.v4.models.date_time import DateTime from hubspot.crm.associations.v4.models.error import Error from hubspot.crm.associations.v4.models.error_detail import ErrorDetail from hubspot.crm.associations.v4.models.forward_paging import ForwardPaging @@ -41,4 +42,5 @@ from hubspot.crm.associations.v4.models.public_default_association_multi_post import PublicDefaultAssociationMultiPost from hubspot.crm.associations.v4.models.public_fetch_associations_batch_request import PublicFetchAssociationsBatchRequest from hubspot.crm.associations.v4.models.public_object_id import PublicObjectId +from hubspot.crm.associations.v4.models.report_creation_response import ReportCreationResponse from hubspot.crm.associations.v4.models.standard_error import StandardError diff --git a/hubspot/crm/associations/v4/models/date_time.py b/hubspot/crm/associations/v4/models/date_time.py new file mode 100644 index 00000000..98f7d3e9 --- /dev/null +++ b/hubspot/crm/associations/v4/models/date_time.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + CRM Associations + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.configuration import Configuration + + +class DateTime(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"date_only": "bool", "time_zone_shift": "int", "value": "int"} + + attribute_map = {"date_only": "dateOnly", "time_zone_shift": "timeZoneShift", "value": "value"} + + def __init__(self, date_only=None, time_zone_shift=None, value=None, local_vars_configuration=None): # noqa: E501 + """DateTime - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._date_only = None + self._time_zone_shift = None + self._value = None + self.discriminator = None + + self.date_only = date_only + self.time_zone_shift = time_zone_shift + self.value = value + + @property + def date_only(self): + """Gets the date_only of this DateTime. # noqa: E501 + + + :return: The date_only of this DateTime. # noqa: E501 + :rtype: bool + """ + return self._date_only + + @date_only.setter + def date_only(self, date_only): + """Sets the date_only of this DateTime. + + + :param date_only: The date_only of this DateTime. # noqa: E501 + :type date_only: bool + """ + if self.local_vars_configuration.client_side_validation and date_only is None: # noqa: E501 + raise ValueError("Invalid value for `date_only`, must not be `None`") # noqa: E501 + + self._date_only = date_only + + @property + def time_zone_shift(self): + """Gets the time_zone_shift of this DateTime. # noqa: E501 + + + :return: The time_zone_shift of this DateTime. # noqa: E501 + :rtype: int + """ + return self._time_zone_shift + + @time_zone_shift.setter + def time_zone_shift(self, time_zone_shift): + """Sets the time_zone_shift of this DateTime. + + + :param time_zone_shift: The time_zone_shift of this DateTime. # noqa: E501 + :type time_zone_shift: int + """ + if self.local_vars_configuration.client_side_validation and time_zone_shift is None: # noqa: E501 + raise ValueError("Invalid value for `time_zone_shift`, must not be `None`") # noqa: E501 + + self._time_zone_shift = time_zone_shift + + @property + def value(self): + """Gets the value of this DateTime. # noqa: E501 + + + :return: The value of this DateTime. # noqa: E501 + :rtype: int + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this DateTime. + + + :param value: The value of this DateTime. # noqa: E501 + :type value: int + """ + if self.local_vars_configuration.client_side_validation and value is None: # noqa: E501 + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DateTime): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DateTime): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/associations/v4/models/report_creation_response.py b/hubspot/crm/associations/v4/models/report_creation_response.py new file mode 100644 index 00000000..2dfdd97f --- /dev/null +++ b/hubspot/crm/associations/v4/models/report_creation_response.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + CRM Associations + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.configuration import Configuration + + +class ReportCreationResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"user_email": "str", "user_id": "int", "enqueue_time": "datetime"} + + attribute_map = {"user_email": "userEmail", "user_id": "userId", "enqueue_time": "enqueueTime"} + + def __init__(self, user_email=None, user_id=None, enqueue_time=None, local_vars_configuration=None): # noqa: E501 + """ReportCreationResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._user_email = None + self._user_id = None + self._enqueue_time = None + self.discriminator = None + + self.user_email = user_email + self.user_id = user_id + self.enqueue_time = enqueue_time + + @property + def user_email(self): + """Gets the user_email of this ReportCreationResponse. # noqa: E501 + + + :return: The user_email of this ReportCreationResponse. # noqa: E501 + :rtype: str + """ + return self._user_email + + @user_email.setter + def user_email(self, user_email): + """Sets the user_email of this ReportCreationResponse. + + + :param user_email: The user_email of this ReportCreationResponse. # noqa: E501 + :type user_email: str + """ + if self.local_vars_configuration.client_side_validation and user_email is None: # noqa: E501 + raise ValueError("Invalid value for `user_email`, must not be `None`") # noqa: E501 + + self._user_email = user_email + + @property + def user_id(self): + """Gets the user_id of this ReportCreationResponse. # noqa: E501 + + + :return: The user_id of this ReportCreationResponse. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this ReportCreationResponse. + + + :param user_id: The user_id of this ReportCreationResponse. # noqa: E501 + :type user_id: int + """ + if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + @property + def enqueue_time(self): + """Gets the enqueue_time of this ReportCreationResponse. # noqa: E501 + + + :return: The enqueue_time of this ReportCreationResponse. # noqa: E501 + :rtype: datetime + """ + return self._enqueue_time + + @enqueue_time.setter + def enqueue_time(self, enqueue_time): + """Sets the enqueue_time of this ReportCreationResponse. + + + :param enqueue_time: The enqueue_time of this ReportCreationResponse. # noqa: E501 + :type enqueue_time: datetime + """ + if self.local_vars_configuration.client_side_validation and enqueue_time is None: # noqa: E501 + raise ValueError("Invalid value for `enqueue_time`, must not be `None`") # noqa: E501 + + self._enqueue_time = enqueue_time + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ReportCreationResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ReportCreationResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/associations/v4/schema/__init__.py b/hubspot/crm/associations/v4/schema/__init__.py index 4b786fe8..c80ecd46 100644 --- a/hubspot/crm/associations/v4/schema/__init__.py +++ b/hubspot/crm/associations/v4/schema/__init__.py @@ -17,6 +17,7 @@ __version__ = "1.0.0" # import apis into sdk package +from hubspot.crm.associations.v4.schema.api.definition_configurations_api import DefinitionConfigurationsApi from hubspot.crm.associations.v4.schema.api.definitions_api import DefinitionsApi # import ApiClient @@ -31,8 +32,26 @@ # import models into sdk package from hubspot.crm.associations.v4.schema.models.association_spec_with_label import AssociationSpecWithLabel +from hubspot.crm.associations.v4.schema.models.batch_input_public_association_definition_configuration_create_request import BatchInputPublicAssociationDefinitionConfigurationCreateRequest +from hubspot.crm.associations.v4.schema.models.batch_input_public_association_definition_configuration_update_request import BatchInputPublicAssociationDefinitionConfigurationUpdateRequest +from hubspot.crm.associations.v4.schema.models.batch_input_public_association_spec import BatchInputPublicAssociationSpec +from hubspot.crm.associations.v4.schema.models.batch_response_public_association_definition_configuration_update_result import BatchResponsePublicAssociationDefinitionConfigurationUpdateResult +from hubspot.crm.associations.v4.schema.models.batch_response_public_association_definition_configuration_update_result_with_errors import ( + BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors, +) +from hubspot.crm.associations.v4.schema.models.batch_response_public_association_definition_user_configuration import BatchResponsePublicAssociationDefinitionUserConfiguration +from hubspot.crm.associations.v4.schema.models.batch_response_public_association_definition_user_configuration_with_errors import BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors from hubspot.crm.associations.v4.schema.models.collection_response_association_spec_with_label_no_paging import CollectionResponseAssociationSpecWithLabelNoPaging +from hubspot.crm.associations.v4.schema.models.collection_response_public_association_definition_user_configuration_no_paging import ( + CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging, +) from hubspot.crm.associations.v4.schema.models.error import Error from hubspot.crm.associations.v4.schema.models.error_detail import ErrorDetail +from hubspot.crm.associations.v4.schema.models.public_association_definition_configuration_create_request import PublicAssociationDefinitionConfigurationCreateRequest +from hubspot.crm.associations.v4.schema.models.public_association_definition_configuration_update_request import PublicAssociationDefinitionConfigurationUpdateRequest +from hubspot.crm.associations.v4.schema.models.public_association_definition_configuration_update_result import PublicAssociationDefinitionConfigurationUpdateResult from hubspot.crm.associations.v4.schema.models.public_association_definition_create_request import PublicAssociationDefinitionCreateRequest from hubspot.crm.associations.v4.schema.models.public_association_definition_update_request import PublicAssociationDefinitionUpdateRequest +from hubspot.crm.associations.v4.schema.models.public_association_definition_user_configuration import PublicAssociationDefinitionUserConfiguration +from hubspot.crm.associations.v4.schema.models.public_association_spec import PublicAssociationSpec +from hubspot.crm.associations.v4.schema.models.standard_error import StandardError diff --git a/hubspot/crm/associations/v4/schema/api/__init__.py b/hubspot/crm/associations/v4/schema/api/__init__.py index 6fe052fd..958e4df2 100644 --- a/hubspot/crm/associations/v4/schema/api/__init__.py +++ b/hubspot/crm/associations/v4/schema/api/__init__.py @@ -3,4 +3,5 @@ # flake8: noqa # import apis into api package +from hubspot.crm.associations.v4.schema.api.definition_configurations_api import DefinitionConfigurationsApi from hubspot.crm.associations.v4.schema.api.definitions_api import DefinitionsApi diff --git a/hubspot/crm/associations/v4/schema/api/definition_configurations_api.py b/hubspot/crm/associations/v4/schema/api/definition_configurations_api.py new file mode 100644 index 00000000..2beef19a --- /dev/null +++ b/hubspot/crm/associations/v4/schema/api/definition_configurations_api.py @@ -0,0 +1,718 @@ +# coding: utf-8 + +""" + CRM Associations Schema + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from hubspot.crm.associations.v4.schema.api_client import ApiClient +from hubspot.crm.associations.v4.schema.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class DefinitionConfigurationsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def batch_create(self, from_object_type, to_object_type, batch_input_public_association_definition_configuration_create_request, **kwargs): # noqa: E501 + """Create # noqa: E501 + + Batch create user configurations between two object types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.batch_create(from_object_type, to_object_type, batch_input_public_association_definition_configuration_create_request, async_req=True) + >>> result = thread.get() + + :param from_object_type: (required) + :type from_object_type: str + :param to_object_type: (required) + :type to_object_type: str + :param batch_input_public_association_definition_configuration_create_request: (required) + :type batch_input_public_association_definition_configuration_create_request: BatchInputPublicAssociationDefinitionConfigurationCreateRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: BatchResponsePublicAssociationDefinitionUserConfiguration + """ + kwargs["_return_http_data_only"] = True + return self.batch_create_with_http_info(from_object_type, to_object_type, batch_input_public_association_definition_configuration_create_request, **kwargs) # noqa: E501 + + def batch_create_with_http_info(self, from_object_type, to_object_type, batch_input_public_association_definition_configuration_create_request, **kwargs): # noqa: E501 + """Create # noqa: E501 + + Batch create user configurations between two object types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.batch_create_with_http_info(from_object_type, to_object_type, batch_input_public_association_definition_configuration_create_request, async_req=True) + >>> result = thread.get() + + :param from_object_type: (required) + :type from_object_type: str + :param to_object_type: (required) + :type to_object_type: str + :param batch_input_public_association_definition_configuration_create_request: (required) + :type batch_input_public_association_definition_configuration_create_request: BatchInputPublicAssociationDefinitionConfigurationCreateRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BatchResponsePublicAssociationDefinitionUserConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["from_object_type", "to_object_type", "batch_input_public_association_definition_configuration_create_request"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method batch_create" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'from_object_type' is set + if self.api_client.client_side_validation and local_var_params.get("from_object_type") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `from_object_type` when calling `batch_create`") # noqa: E501 + # verify the required parameter 'to_object_type' is set + if self.api_client.client_side_validation and local_var_params.get("to_object_type") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `to_object_type` when calling `batch_create`") # noqa: E501 + # verify the required parameter 'batch_input_public_association_definition_configuration_create_request' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_public_association_definition_configuration_create_request") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_public_association_definition_configuration_create_request` when calling `batch_create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "from_object_type" in local_var_params: + path_params["fromObjectType"] = local_var_params["from_object_type"] # noqa: E501 + if "to_object_type" in local_var_params: + path_params["toObjectType"] = local_var_params["to_object_type"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "batch_input_public_association_definition_configuration_create_request" in local_var_params: + body_params = local_var_params["batch_input_public_association_definition_configuration_create_request"] + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "POST", body_params)) # noqa: E501 + if content_types_list: + header_params["Content-Type"] = content_types_list + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 201: "BatchResponsePublicAssociationDefinitionUserConfiguration", + 207: "BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors", + } + + return self.api_client.call_api( + "/crm/v4/associations/definitions/configurations/{fromObjectType}/{toObjectType}/batch/create", + "POST", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) + + def batch_remove(self, from_object_type, to_object_type, batch_input_public_association_spec, **kwargs): # noqa: E501 + """Delete # noqa: E501 + + Batch delete user configurations between two object types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.batch_remove(from_object_type, to_object_type, batch_input_public_association_spec, async_req=True) + >>> result = thread.get() + + :param from_object_type: (required) + :type from_object_type: str + :param to_object_type: (required) + :type to_object_type: str + :param batch_input_public_association_spec: (required) + :type batch_input_public_association_spec: BatchInputPublicAssociationSpec + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + return self.batch_remove_with_http_info(from_object_type, to_object_type, batch_input_public_association_spec, **kwargs) # noqa: E501 + + def batch_remove_with_http_info(self, from_object_type, to_object_type, batch_input_public_association_spec, **kwargs): # noqa: E501 + """Delete # noqa: E501 + + Batch delete user configurations between two object types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.batch_remove_with_http_info(from_object_type, to_object_type, batch_input_public_association_spec, async_req=True) + >>> result = thread.get() + + :param from_object_type: (required) + :type from_object_type: str + :param to_object_type: (required) + :type to_object_type: str + :param batch_input_public_association_spec: (required) + :type batch_input_public_association_spec: BatchInputPublicAssociationSpec + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + local_var_params = locals() + + all_params = ["from_object_type", "to_object_type", "batch_input_public_association_spec"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method batch_remove" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'from_object_type' is set + if self.api_client.client_side_validation and local_var_params.get("from_object_type") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `from_object_type` when calling `batch_remove`") # noqa: E501 + # verify the required parameter 'to_object_type' is set + if self.api_client.client_side_validation and local_var_params.get("to_object_type") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `to_object_type` when calling `batch_remove`") # noqa: E501 + # verify the required parameter 'batch_input_public_association_spec' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_public_association_spec") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_public_association_spec` when calling `batch_remove`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "from_object_type" in local_var_params: + path_params["fromObjectType"] = local_var_params["from_object_type"] # noqa: E501 + if "to_object_type" in local_var_params: + path_params["toObjectType"] = local_var_params["to_object_type"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "batch_input_public_association_spec" in local_var_params: + body_params = local_var_params["batch_input_public_association_spec"] + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "POST", body_params)) # noqa: E501 + if content_types_list: + header_params["Content-Type"] = content_types_list + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = {} + + return self.api_client.call_api( + "/crm/v4/associations/definitions/configurations/{fromObjectType}/{toObjectType}/batch/purge", + "POST", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) + + def batch_update(self, from_object_type, to_object_type, batch_input_public_association_definition_configuration_update_request, **kwargs): # noqa: E501 + """Update # noqa: E501 + + Batch update user configurations between two object types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.batch_update(from_object_type, to_object_type, batch_input_public_association_definition_configuration_update_request, async_req=True) + >>> result = thread.get() + + :param from_object_type: (required) + :type from_object_type: str + :param to_object_type: (required) + :type to_object_type: str + :param batch_input_public_association_definition_configuration_update_request: (required) + :type batch_input_public_association_definition_configuration_update_request: BatchInputPublicAssociationDefinitionConfigurationUpdateRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: BatchResponsePublicAssociationDefinitionConfigurationUpdateResult + """ + kwargs["_return_http_data_only"] = True + return self.batch_update_with_http_info(from_object_type, to_object_type, batch_input_public_association_definition_configuration_update_request, **kwargs) # noqa: E501 + + def batch_update_with_http_info(self, from_object_type, to_object_type, batch_input_public_association_definition_configuration_update_request, **kwargs): # noqa: E501 + """Update # noqa: E501 + + Batch update user configurations between two object types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.batch_update_with_http_info(from_object_type, to_object_type, batch_input_public_association_definition_configuration_update_request, async_req=True) + >>> result = thread.get() + + :param from_object_type: (required) + :type from_object_type: str + :param to_object_type: (required) + :type to_object_type: str + :param batch_input_public_association_definition_configuration_update_request: (required) + :type batch_input_public_association_definition_configuration_update_request: BatchInputPublicAssociationDefinitionConfigurationUpdateRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BatchResponsePublicAssociationDefinitionConfigurationUpdateResult, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["from_object_type", "to_object_type", "batch_input_public_association_definition_configuration_update_request"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method batch_update" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'from_object_type' is set + if self.api_client.client_side_validation and local_var_params.get("from_object_type") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `from_object_type` when calling `batch_update`") # noqa: E501 + # verify the required parameter 'to_object_type' is set + if self.api_client.client_side_validation and local_var_params.get("to_object_type") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `to_object_type` when calling `batch_update`") # noqa: E501 + # verify the required parameter 'batch_input_public_association_definition_configuration_update_request' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_public_association_definition_configuration_update_request") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_public_association_definition_configuration_update_request` when calling `batch_update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "from_object_type" in local_var_params: + path_params["fromObjectType"] = local_var_params["from_object_type"] # noqa: E501 + if "to_object_type" in local_var_params: + path_params["toObjectType"] = local_var_params["to_object_type"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "batch_input_public_association_definition_configuration_update_request" in local_var_params: + body_params = local_var_params["batch_input_public_association_definition_configuration_update_request"] + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "POST", body_params)) # noqa: E501 + if content_types_list: + header_params["Content-Type"] = content_types_list + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 200: "BatchResponsePublicAssociationDefinitionConfigurationUpdateResult", + 207: "BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors", + } + + return self.api_client.call_api( + "/crm/v4/associations/definitions/configurations/{fromObjectType}/{toObjectType}/batch/update", + "POST", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) + + def get_all(self, **kwargs): # noqa: E501 + """Read All # noqa: E501 + + Returns all user configurations available on a given portal # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_all(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging + """ + kwargs["_return_http_data_only"] = True + return self.get_all_with_http_info(**kwargs) # noqa: E501 + + def get_all_with_http_info(self, **kwargs): # noqa: E501 + """Read All # noqa: E501 + + Returns all user configurations available on a given portal # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_all_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_all" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 200: "CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging", + } + + return self.api_client.call_api( + "/crm/v4/associations/definitions/configurations/all", + "GET", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) + + def get_all_between_two_object_types(self, from_object_type, to_object_type, **kwargs): # noqa: E501 + """Read # noqa: E501 + + Returns user configurations on all association definitions between two object types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_all_between_two_object_types(from_object_type, to_object_type, async_req=True) + >>> result = thread.get() + + :param from_object_type: (required) + :type from_object_type: str + :param to_object_type: (required) + :type to_object_type: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging + """ + kwargs["_return_http_data_only"] = True + return self.get_all_between_two_object_types_with_http_info(from_object_type, to_object_type, **kwargs) # noqa: E501 + + def get_all_between_two_object_types_with_http_info(self, from_object_type, to_object_type, **kwargs): # noqa: E501 + """Read # noqa: E501 + + Returns user configurations on all association definitions between two object types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_all_between_two_object_types_with_http_info(from_object_type, to_object_type, async_req=True) + >>> result = thread.get() + + :param from_object_type: (required) + :type from_object_type: str + :param to_object_type: (required) + :type to_object_type: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["from_object_type", "to_object_type"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_all_between_two_object_types" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'from_object_type' is set + if self.api_client.client_side_validation and local_var_params.get("from_object_type") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `from_object_type` when calling `get_all_between_two_object_types`") # noqa: E501 + # verify the required parameter 'to_object_type' is set + if self.api_client.client_side_validation and local_var_params.get("to_object_type") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `to_object_type` when calling `get_all_between_two_object_types`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "from_object_type" in local_var_params: + path_params["fromObjectType"] = local_var_params["from_object_type"] # noqa: E501 + if "to_object_type" in local_var_params: + path_params["toObjectType"] = local_var_params["to_object_type"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 200: "CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging", + } + + return self.api_client.call_api( + "/crm/v4/associations/definitions/configurations/{fromObjectType}/{toObjectType}", + "GET", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) diff --git a/hubspot/crm/associations/v4/schema/api/definitions_api.py b/hubspot/crm/associations/v4/schema/api/definitions_api.py index 0e5587b2..00f59dc7 100644 --- a/hubspot/crm/associations/v4/schema/api/definitions_api.py +++ b/hubspot/crm/associations/v4/schema/api/definitions_api.py @@ -33,22 +33,22 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def archive(self, from_object_type, to_object_type, association_type_id, **kwargs): # noqa: E501 - """Delete # noqa: E501 + def create(self, from_object_type, to_object_type, public_association_definition_create_request, **kwargs): # noqa: E501 + """Create # noqa: E501 - Deletes an association definition # noqa: E501 + Create a user defined association definition # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.archive(from_object_type, to_object_type, association_type_id, async_req=True) + >>> thread = api.create(from_object_type, to_object_type, public_association_definition_create_request, async_req=True) >>> result = thread.get() :param from_object_type: (required) :type from_object_type: str :param to_object_type: (required) :type to_object_type: str - :param association_type_id: (required) - :type association_type_id: int + :param public_association_definition_create_request: (required) + :type public_association_definition_create_request: PublicAssociationDefinitionCreateRequest :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -62,27 +62,27 @@ def archive(self, from_object_type, to_object_type, association_type_id, **kwarg :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: CollectionResponseAssociationSpecWithLabelNoPaging """ kwargs["_return_http_data_only"] = True - return self.archive_with_http_info(from_object_type, to_object_type, association_type_id, **kwargs) # noqa: E501 + return self.create_with_http_info(from_object_type, to_object_type, public_association_definition_create_request, **kwargs) # noqa: E501 - def archive_with_http_info(self, from_object_type, to_object_type, association_type_id, **kwargs): # noqa: E501 - """Delete # noqa: E501 + def create_with_http_info(self, from_object_type, to_object_type, public_association_definition_create_request, **kwargs): # noqa: E501 + """Create # noqa: E501 - Deletes an association definition # noqa: E501 + Create a user defined association definition # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.archive_with_http_info(from_object_type, to_object_type, association_type_id, async_req=True) + >>> thread = api.create_with_http_info(from_object_type, to_object_type, public_association_definition_create_request, async_req=True) >>> result = thread.get() :param from_object_type: (required) :type from_object_type: str :param to_object_type: (required) :type to_object_type: str - :param association_type_id: (required) - :type association_type_id: int + :param public_association_definition_create_request: (required) + :type public_association_definition_create_request: PublicAssociationDefinitionCreateRequest :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -104,28 +104,28 @@ def archive_with_http_info(self, from_object_type, to_object_type, association_t :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: tuple(CollectionResponseAssociationSpecWithLabelNoPaging, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["from_object_type", "to_object_type", "association_type_id"] + all_params = ["from_object_type", "to_object_type", "public_association_definition_create_request"] all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: - raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method archive" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method create" % key) local_var_params[key] = val del local_var_params["kwargs"] # verify the required parameter 'from_object_type' is set if self.api_client.client_side_validation and local_var_params.get("from_object_type") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `from_object_type` when calling `archive`") # noqa: E501 + raise ApiValueError("Missing the required parameter `from_object_type` when calling `create`") # noqa: E501 # verify the required parameter 'to_object_type' is set if self.api_client.client_side_validation and local_var_params.get("to_object_type") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `to_object_type` when calling `archive`") # noqa: E501 - # verify the required parameter 'association_type_id' is set - if self.api_client.client_side_validation and local_var_params.get("association_type_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `association_type_id` when calling `archive`") # noqa: E501 + raise ApiValueError("Missing the required parameter `to_object_type` when calling `create`") # noqa: E501 + # verify the required parameter 'public_association_definition_create_request' is set + if self.api_client.client_side_validation and local_var_params.get("public_association_definition_create_request") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `public_association_definition_create_request` when calling `create`") # noqa: E501 collection_formats = {} @@ -134,8 +134,6 @@ def archive_with_http_info(self, from_object_type, to_object_type, association_t path_params["fromObjectType"] = local_var_params["from_object_type"] # noqa: E501 if "to_object_type" in local_var_params: path_params["toObjectType"] = local_var_params["to_object_type"] # noqa: E501 - if "association_type_id" in local_var_params: - path_params["associationTypeId"] = local_var_params["association_type_id"] # noqa: E501 query_params = [] @@ -145,17 +143,26 @@ def archive_with_http_info(self, from_object_type, to_object_type, association_t local_var_files = {} body_params = None + if "public_association_definition_create_request" in local_var_params: + body_params = local_var_params["public_association_definition_create_request"] # HTTP header `Accept` - header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "POST", body_params)) # noqa: E501 + if content_types_list: + header_params["Content-Type"] = content_types_list # Authentication setting auth_settings = ["oauth2"] # noqa: E501 - response_types_map = {} + response_types_map = { + 200: "CollectionResponseAssociationSpecWithLabelNoPaging", + } return self.api_client.call_api( - "/crm/v4/associations/{fromObjectType}/{toObjectType}/labels/{associationTypeId}", - "DELETE", + "/crm/v4/associations/{fromObjectType}/{toObjectType}/labels", + "POST", path_params, query_params, header_params, @@ -172,22 +179,20 @@ def archive_with_http_info(self, from_object_type, to_object_type, association_t _request_auth=local_var_params.get("_request_auth"), ) - def create(self, from_object_type, to_object_type, public_association_definition_create_request, **kwargs): # noqa: E501 - """Create # noqa: E501 + def get_all(self, from_object_type, to_object_type, **kwargs): # noqa: E501 + """Read # noqa: E501 - Create a user defined association definition # noqa: E501 + Returns all association types between two object types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create(from_object_type, to_object_type, public_association_definition_create_request, async_req=True) + >>> thread = api.get_all(from_object_type, to_object_type, async_req=True) >>> result = thread.get() :param from_object_type: (required) :type from_object_type: str :param to_object_type: (required) :type to_object_type: str - :param public_association_definition_create_request: (required) - :type public_association_definition_create_request: PublicAssociationDefinitionCreateRequest :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -204,24 +209,22 @@ def create(self, from_object_type, to_object_type, public_association_definition :rtype: CollectionResponseAssociationSpecWithLabelNoPaging """ kwargs["_return_http_data_only"] = True - return self.create_with_http_info(from_object_type, to_object_type, public_association_definition_create_request, **kwargs) # noqa: E501 + return self.get_all_with_http_info(from_object_type, to_object_type, **kwargs) # noqa: E501 - def create_with_http_info(self, from_object_type, to_object_type, public_association_definition_create_request, **kwargs): # noqa: E501 - """Create # noqa: E501 + def get_all_with_http_info(self, from_object_type, to_object_type, **kwargs): # noqa: E501 + """Read # noqa: E501 - Create a user defined association definition # noqa: E501 + Returns all association types between two object types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_with_http_info(from_object_type, to_object_type, public_association_definition_create_request, async_req=True) + >>> thread = api.get_all_with_http_info(from_object_type, to_object_type, async_req=True) >>> result = thread.get() :param from_object_type: (required) :type from_object_type: str :param to_object_type: (required) :type to_object_type: str - :param public_association_definition_create_request: (required) - :type public_association_definition_create_request: PublicAssociationDefinitionCreateRequest :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -248,23 +251,20 @@ def create_with_http_info(self, from_object_type, to_object_type, public_associa local_var_params = locals() - all_params = ["from_object_type", "to_object_type", "public_association_definition_create_request"] + all_params = ["from_object_type", "to_object_type"] all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: - raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method create" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_all" % key) local_var_params[key] = val del local_var_params["kwargs"] # verify the required parameter 'from_object_type' is set if self.api_client.client_side_validation and local_var_params.get("from_object_type") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `from_object_type` when calling `create`") # noqa: E501 + raise ApiValueError("Missing the required parameter `from_object_type` when calling `get_all`") # noqa: E501 # verify the required parameter 'to_object_type' is set if self.api_client.client_side_validation and local_var_params.get("to_object_type") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `to_object_type` when calling `create`") # noqa: E501 - # verify the required parameter 'public_association_definition_create_request' is set - if self.api_client.client_side_validation and local_var_params.get("public_association_definition_create_request") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `public_association_definition_create_request` when calling `create`") # noqa: E501 + raise ApiValueError("Missing the required parameter `to_object_type` when calling `get_all`") # noqa: E501 collection_formats = {} @@ -282,16 +282,9 @@ def create_with_http_info(self, from_object_type, to_object_type, public_associa local_var_files = {} body_params = None - if "public_association_definition_create_request" in local_var_params: - body_params = local_var_params["public_association_definition_create_request"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 - # HTTP header `Content-Type` - content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "POST", body_params)) # noqa: E501 - if content_types_list: - header_params["Content-Type"] = content_types_list - # Authentication setting auth_settings = ["oauth2"] # noqa: E501 @@ -301,7 +294,7 @@ def create_with_http_info(self, from_object_type, to_object_type, public_associa return self.api_client.call_api( "/crm/v4/associations/{fromObjectType}/{toObjectType}/labels", - "POST", + "GET", path_params, query_params, header_params, @@ -318,20 +311,22 @@ def create_with_http_info(self, from_object_type, to_object_type, public_associa _request_auth=local_var_params.get("_request_auth"), ) - def get_all(self, from_object_type, to_object_type, **kwargs): # noqa: E501 - """Read # noqa: E501 + def remove(self, from_object_type, to_object_type, association_type_id, **kwargs): # noqa: E501 + """Delete # noqa: E501 - Returns all association types between two object types # noqa: E501 + Deletes an association definition # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_all(from_object_type, to_object_type, async_req=True) + >>> thread = api.remove(from_object_type, to_object_type, association_type_id, async_req=True) >>> result = thread.get() :param from_object_type: (required) :type from_object_type: str :param to_object_type: (required) :type to_object_type: str + :param association_type_id: (required) + :type association_type_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -345,25 +340,27 @@ def get_all(self, from_object_type, to_object_type, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: CollectionResponseAssociationSpecWithLabelNoPaging + :rtype: None """ kwargs["_return_http_data_only"] = True - return self.get_all_with_http_info(from_object_type, to_object_type, **kwargs) # noqa: E501 + return self.remove_with_http_info(from_object_type, to_object_type, association_type_id, **kwargs) # noqa: E501 - def get_all_with_http_info(self, from_object_type, to_object_type, **kwargs): # noqa: E501 - """Read # noqa: E501 + def remove_with_http_info(self, from_object_type, to_object_type, association_type_id, **kwargs): # noqa: E501 + """Delete # noqa: E501 - Returns all association types between two object types # noqa: E501 + Deletes an association definition # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_all_with_http_info(from_object_type, to_object_type, async_req=True) + >>> thread = api.remove_with_http_info(from_object_type, to_object_type, association_type_id, async_req=True) >>> result = thread.get() :param from_object_type: (required) :type from_object_type: str :param to_object_type: (required) :type to_object_type: str + :param association_type_id: (required) + :type association_type_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -385,25 +382,28 @@ def get_all_with_http_info(self, from_object_type, to_object_type, **kwargs): # :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(CollectionResponseAssociationSpecWithLabelNoPaging, status_code(int), headers(HTTPHeaderDict)) + :rtype: None """ local_var_params = locals() - all_params = ["from_object_type", "to_object_type"] + all_params = ["from_object_type", "to_object_type", "association_type_id"] all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: - raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_all" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method remove" % key) local_var_params[key] = val del local_var_params["kwargs"] # verify the required parameter 'from_object_type' is set if self.api_client.client_side_validation and local_var_params.get("from_object_type") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `from_object_type` when calling `get_all`") # noqa: E501 + raise ApiValueError("Missing the required parameter `from_object_type` when calling `remove`") # noqa: E501 # verify the required parameter 'to_object_type' is set if self.api_client.client_side_validation and local_var_params.get("to_object_type") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `to_object_type` when calling `get_all`") # noqa: E501 + raise ApiValueError("Missing the required parameter `to_object_type` when calling `remove`") # noqa: E501 + # verify the required parameter 'association_type_id' is set + if self.api_client.client_side_validation and local_var_params.get("association_type_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `association_type_id` when calling `remove`") # noqa: E501 collection_formats = {} @@ -412,6 +412,8 @@ def get_all_with_http_info(self, from_object_type, to_object_type, **kwargs): # path_params["fromObjectType"] = local_var_params["from_object_type"] # noqa: E501 if "to_object_type" in local_var_params: path_params["toObjectType"] = local_var_params["to_object_type"] # noqa: E501 + if "association_type_id" in local_var_params: + path_params["associationTypeId"] = local_var_params["association_type_id"] # noqa: E501 query_params = [] @@ -422,18 +424,16 @@ def get_all_with_http_info(self, from_object_type, to_object_type, **kwargs): # body_params = None # HTTP header `Accept` - header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 # Authentication setting auth_settings = ["oauth2"] # noqa: E501 - response_types_map = { - 200: "CollectionResponseAssociationSpecWithLabelNoPaging", - } + response_types_map = {} return self.api_client.call_api( - "/crm/v4/associations/{fromObjectType}/{toObjectType}/labels", - "GET", + "/crm/v4/associations/{fromObjectType}/{toObjectType}/labels/{associationTypeId}", + "DELETE", path_params, query_params, header_params, diff --git a/hubspot/crm/associations/v4/schema/models/__init__.py b/hubspot/crm/associations/v4/schema/models/__init__.py index 0ccc5274..6655747d 100644 --- a/hubspot/crm/associations/v4/schema/models/__init__.py +++ b/hubspot/crm/associations/v4/schema/models/__init__.py @@ -15,8 +15,26 @@ # import models into model package from hubspot.crm.associations.v4.schema.models.association_spec_with_label import AssociationSpecWithLabel +from hubspot.crm.associations.v4.schema.models.batch_input_public_association_definition_configuration_create_request import BatchInputPublicAssociationDefinitionConfigurationCreateRequest +from hubspot.crm.associations.v4.schema.models.batch_input_public_association_definition_configuration_update_request import BatchInputPublicAssociationDefinitionConfigurationUpdateRequest +from hubspot.crm.associations.v4.schema.models.batch_input_public_association_spec import BatchInputPublicAssociationSpec +from hubspot.crm.associations.v4.schema.models.batch_response_public_association_definition_configuration_update_result import BatchResponsePublicAssociationDefinitionConfigurationUpdateResult +from hubspot.crm.associations.v4.schema.models.batch_response_public_association_definition_configuration_update_result_with_errors import ( + BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors, +) +from hubspot.crm.associations.v4.schema.models.batch_response_public_association_definition_user_configuration import BatchResponsePublicAssociationDefinitionUserConfiguration +from hubspot.crm.associations.v4.schema.models.batch_response_public_association_definition_user_configuration_with_errors import BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors from hubspot.crm.associations.v4.schema.models.collection_response_association_spec_with_label_no_paging import CollectionResponseAssociationSpecWithLabelNoPaging +from hubspot.crm.associations.v4.schema.models.collection_response_public_association_definition_user_configuration_no_paging import ( + CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging, +) from hubspot.crm.associations.v4.schema.models.error import Error from hubspot.crm.associations.v4.schema.models.error_detail import ErrorDetail +from hubspot.crm.associations.v4.schema.models.public_association_definition_configuration_create_request import PublicAssociationDefinitionConfigurationCreateRequest +from hubspot.crm.associations.v4.schema.models.public_association_definition_configuration_update_request import PublicAssociationDefinitionConfigurationUpdateRequest +from hubspot.crm.associations.v4.schema.models.public_association_definition_configuration_update_result import PublicAssociationDefinitionConfigurationUpdateResult from hubspot.crm.associations.v4.schema.models.public_association_definition_create_request import PublicAssociationDefinitionCreateRequest from hubspot.crm.associations.v4.schema.models.public_association_definition_update_request import PublicAssociationDefinitionUpdateRequest +from hubspot.crm.associations.v4.schema.models.public_association_definition_user_configuration import PublicAssociationDefinitionUserConfiguration +from hubspot.crm.associations.v4.schema.models.public_association_spec import PublicAssociationSpec +from hubspot.crm.associations.v4.schema.models.standard_error import StandardError diff --git a/hubspot/crm/associations/v4/schema/models/batch_input_public_association_definition_configuration_create_request.py b/hubspot/crm/associations/v4/schema/models/batch_input_public_association_definition_configuration_create_request.py new file mode 100644 index 00000000..47adf25d --- /dev/null +++ b/hubspot/crm/associations/v4/schema/models/batch_input_public_association_definition_configuration_create_request.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + CRM Associations Schema + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.schema.configuration import Configuration + + +class BatchInputPublicAssociationDefinitionConfigurationCreateRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"inputs": "list[PublicAssociationDefinitionConfigurationCreateRequest]"} + + attribute_map = {"inputs": "inputs"} + + def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 + """BatchInputPublicAssociationDefinitionConfigurationCreateRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._inputs = None + self.discriminator = None + + self.inputs = inputs + + @property + def inputs(self): + """Gets the inputs of this BatchInputPublicAssociationDefinitionConfigurationCreateRequest. # noqa: E501 + + + :return: The inputs of this BatchInputPublicAssociationDefinitionConfigurationCreateRequest. # noqa: E501 + :rtype: list[PublicAssociationDefinitionConfigurationCreateRequest] + """ + return self._inputs + + @inputs.setter + def inputs(self, inputs): + """Sets the inputs of this BatchInputPublicAssociationDefinitionConfigurationCreateRequest. + + + :param inputs: The inputs of this BatchInputPublicAssociationDefinitionConfigurationCreateRequest. # noqa: E501 + :type inputs: list[PublicAssociationDefinitionConfigurationCreateRequest] + """ + if self.local_vars_configuration.client_side_validation and inputs is None: # noqa: E501 + raise ValueError("Invalid value for `inputs`, must not be `None`") # noqa: E501 + + self._inputs = inputs + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchInputPublicAssociationDefinitionConfigurationCreateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BatchInputPublicAssociationDefinitionConfigurationCreateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/associations/v4/schema/models/batch_input_public_association_definition_configuration_update_request.py b/hubspot/crm/associations/v4/schema/models/batch_input_public_association_definition_configuration_update_request.py new file mode 100644 index 00000000..426e3666 --- /dev/null +++ b/hubspot/crm/associations/v4/schema/models/batch_input_public_association_definition_configuration_update_request.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + CRM Associations Schema + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.schema.configuration import Configuration + + +class BatchInputPublicAssociationDefinitionConfigurationUpdateRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"inputs": "list[PublicAssociationDefinitionConfigurationUpdateRequest]"} + + attribute_map = {"inputs": "inputs"} + + def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 + """BatchInputPublicAssociationDefinitionConfigurationUpdateRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._inputs = None + self.discriminator = None + + self.inputs = inputs + + @property + def inputs(self): + """Gets the inputs of this BatchInputPublicAssociationDefinitionConfigurationUpdateRequest. # noqa: E501 + + + :return: The inputs of this BatchInputPublicAssociationDefinitionConfigurationUpdateRequest. # noqa: E501 + :rtype: list[PublicAssociationDefinitionConfigurationUpdateRequest] + """ + return self._inputs + + @inputs.setter + def inputs(self, inputs): + """Sets the inputs of this BatchInputPublicAssociationDefinitionConfigurationUpdateRequest. + + + :param inputs: The inputs of this BatchInputPublicAssociationDefinitionConfigurationUpdateRequest. # noqa: E501 + :type inputs: list[PublicAssociationDefinitionConfigurationUpdateRequest] + """ + if self.local_vars_configuration.client_side_validation and inputs is None: # noqa: E501 + raise ValueError("Invalid value for `inputs`, must not be `None`") # noqa: E501 + + self._inputs = inputs + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchInputPublicAssociationDefinitionConfigurationUpdateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BatchInputPublicAssociationDefinitionConfigurationUpdateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/associations/v4/schema/models/batch_input_public_association_spec.py b/hubspot/crm/associations/v4/schema/models/batch_input_public_association_spec.py new file mode 100644 index 00000000..8d7aa4f8 --- /dev/null +++ b/hubspot/crm/associations/v4/schema/models/batch_input_public_association_spec.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + CRM Associations Schema + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.schema.configuration import Configuration + + +class BatchInputPublicAssociationSpec(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"inputs": "list[PublicAssociationSpec]"} + + attribute_map = {"inputs": "inputs"} + + def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 + """BatchInputPublicAssociationSpec - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._inputs = None + self.discriminator = None + + self.inputs = inputs + + @property + def inputs(self): + """Gets the inputs of this BatchInputPublicAssociationSpec. # noqa: E501 + + + :return: The inputs of this BatchInputPublicAssociationSpec. # noqa: E501 + :rtype: list[PublicAssociationSpec] + """ + return self._inputs + + @inputs.setter + def inputs(self, inputs): + """Sets the inputs of this BatchInputPublicAssociationSpec. + + + :param inputs: The inputs of this BatchInputPublicAssociationSpec. # noqa: E501 + :type inputs: list[PublicAssociationSpec] + """ + if self.local_vars_configuration.client_side_validation and inputs is None: # noqa: E501 + raise ValueError("Invalid value for `inputs`, must not be `None`") # noqa: E501 + + self._inputs = inputs + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchInputPublicAssociationSpec): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BatchInputPublicAssociationSpec): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_configuration_update_result.py b/hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_configuration_update_result.py new file mode 100644 index 00000000..bc85ad80 --- /dev/null +++ b/hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_configuration_update_result.py @@ -0,0 +1,255 @@ +# coding: utf-8 + +""" + CRM Associations Schema + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.schema.configuration import Configuration + + +class BatchResponsePublicAssociationDefinitionConfigurationUpdateResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + "completed_at": "datetime", + "requested_at": "datetime", + "started_at": "datetime", + "links": "dict[str, str]", + "results": "list[PublicAssociationDefinitionConfigurationUpdateResult]", + "status": "str", + } + + attribute_map = {"completed_at": "completedAt", "requested_at": "requestedAt", "started_at": "startedAt", "links": "links", "results": "results", "status": "status"} + + def __init__(self, completed_at=None, requested_at=None, started_at=None, links=None, results=None, status=None, local_vars_configuration=None): # noqa: E501 + """BatchResponsePublicAssociationDefinitionConfigurationUpdateResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._completed_at = None + self._requested_at = None + self._started_at = None + self._links = None + self._results = None + self._status = None + self.discriminator = None + + self.completed_at = completed_at + if requested_at is not None: + self.requested_at = requested_at + self.started_at = started_at + if links is not None: + self.links = links + self.results = results + self.status = status + + @property + def completed_at(self): + """Gets the completed_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + + + :return: The completed_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :rtype: datetime + """ + return self._completed_at + + @completed_at.setter + def completed_at(self, completed_at): + """Sets the completed_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. + + + :param completed_at: The completed_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :type completed_at: datetime + """ + if self.local_vars_configuration.client_side_validation and completed_at is None: # noqa: E501 + raise ValueError("Invalid value for `completed_at`, must not be `None`") # noqa: E501 + + self._completed_at = completed_at + + @property + def requested_at(self): + """Gets the requested_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + + + :return: The requested_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :rtype: datetime + """ + return self._requested_at + + @requested_at.setter + def requested_at(self, requested_at): + """Sets the requested_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. + + + :param requested_at: The requested_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :type requested_at: datetime + """ + + self._requested_at = requested_at + + @property + def started_at(self): + """Gets the started_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + + + :return: The started_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. + + + :param started_at: The started_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :type started_at: datetime + """ + if self.local_vars_configuration.client_side_validation and started_at is None: # noqa: E501 + raise ValueError("Invalid value for `started_at`, must not be `None`") # noqa: E501 + + self._started_at = started_at + + @property + def links(self): + """Gets the links of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + + + :return: The links of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. + + + :param links: The links of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def results(self): + """Gets the results of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + + + :return: The results of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :rtype: list[PublicAssociationDefinitionConfigurationUpdateResult] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. + + + :param results: The results of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :type results: list[PublicAssociationDefinitionConfigurationUpdateResult] + """ + if self.local_vars_configuration.client_side_validation and results is None: # noqa: E501 + raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 + + self._results = results + + @property + def status(self): + """Gets the status of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + + + :return: The status of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. + + + :param status: The status of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :type status: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = ["PENDING", "PROCESSING", "CANCELED", "COMPLETE"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `status` ({0}), must be one of {1}".format(status, allowed_values)) # noqa: E501 + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchResponsePublicAssociationDefinitionConfigurationUpdateResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BatchResponsePublicAssociationDefinitionConfigurationUpdateResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_configuration_update_result_with_errors.py b/hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_configuration_update_result_with_errors.py new file mode 100644 index 00000000..7d6447a0 --- /dev/null +++ b/hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_configuration_update_result_with_errors.py @@ -0,0 +1,314 @@ +# coding: utf-8 + +""" + CRM Associations Schema + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.schema.configuration import Configuration + + +class BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + "completed_at": "datetime", + "num_errors": "int", + "requested_at": "datetime", + "started_at": "datetime", + "links": "dict[str, str]", + "results": "list[PublicAssociationDefinitionConfigurationUpdateResult]", + "errors": "list[StandardError]", + "status": "str", + } + + attribute_map = { + "completed_at": "completedAt", + "num_errors": "numErrors", + "requested_at": "requestedAt", + "started_at": "startedAt", + "links": "links", + "results": "results", + "errors": "errors", + "status": "status", + } + + def __init__(self, completed_at=None, num_errors=None, requested_at=None, started_at=None, links=None, results=None, errors=None, status=None, local_vars_configuration=None): # noqa: E501 + """BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._completed_at = None + self._num_errors = None + self._requested_at = None + self._started_at = None + self._links = None + self._results = None + self._errors = None + self._status = None + self.discriminator = None + + self.completed_at = completed_at + if num_errors is not None: + self.num_errors = num_errors + if requested_at is not None: + self.requested_at = requested_at + self.started_at = started_at + if links is not None: + self.links = links + self.results = results + if errors is not None: + self.errors = errors + self.status = status + + @property + def completed_at(self): + """Gets the completed_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + + + :return: The completed_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._completed_at + + @completed_at.setter + def completed_at(self, completed_at): + """Sets the completed_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. + + + :param completed_at: The completed_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :type completed_at: datetime + """ + if self.local_vars_configuration.client_side_validation and completed_at is None: # noqa: E501 + raise ValueError("Invalid value for `completed_at`, must not be `None`") # noqa: E501 + + self._completed_at = completed_at + + @property + def num_errors(self): + """Gets the num_errors of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + + + :return: The num_errors of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :rtype: int + """ + return self._num_errors + + @num_errors.setter + def num_errors(self, num_errors): + """Sets the num_errors of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. + + + :param num_errors: The num_errors of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :type num_errors: int + """ + + self._num_errors = num_errors + + @property + def requested_at(self): + """Gets the requested_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + + + :return: The requested_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._requested_at + + @requested_at.setter + def requested_at(self, requested_at): + """Sets the requested_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. + + + :param requested_at: The requested_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :type requested_at: datetime + """ + + self._requested_at = requested_at + + @property + def started_at(self): + """Gets the started_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + + + :return: The started_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. + + + :param started_at: The started_at of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :type started_at: datetime + """ + if self.local_vars_configuration.client_side_validation and started_at is None: # noqa: E501 + raise ValueError("Invalid value for `started_at`, must not be `None`") # noqa: E501 + + self._started_at = started_at + + @property + def links(self): + """Gets the links of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + + + :return: The links of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. + + + :param links: The links of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def results(self): + """Gets the results of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + + + :return: The results of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :rtype: list[PublicAssociationDefinitionConfigurationUpdateResult] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. + + + :param results: The results of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :type results: list[PublicAssociationDefinitionConfigurationUpdateResult] + """ + if self.local_vars_configuration.client_side_validation and results is None: # noqa: E501 + raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 + + self._results = results + + @property + def errors(self): + """Gets the errors of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + + + :return: The errors of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :rtype: list[StandardError] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. + + + :param errors: The errors of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :type errors: list[StandardError] + """ + + self._errors = errors + + @property + def status(self): + """Gets the status of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + + + :return: The status of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. + + + :param status: The status of this BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors. # noqa: E501 + :type status: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = ["PENDING", "PROCESSING", "CANCELED", "COMPLETE"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `status` ({0}), must be one of {1}".format(status, allowed_values)) # noqa: E501 + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_user_configuration.py b/hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_user_configuration.py new file mode 100644 index 00000000..92c04943 --- /dev/null +++ b/hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_user_configuration.py @@ -0,0 +1,255 @@ +# coding: utf-8 + +""" + CRM Associations Schema + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.schema.configuration import Configuration + + +class BatchResponsePublicAssociationDefinitionUserConfiguration(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + "completed_at": "datetime", + "requested_at": "datetime", + "started_at": "datetime", + "links": "dict[str, str]", + "results": "list[PublicAssociationDefinitionUserConfiguration]", + "status": "str", + } + + attribute_map = {"completed_at": "completedAt", "requested_at": "requestedAt", "started_at": "startedAt", "links": "links", "results": "results", "status": "status"} + + def __init__(self, completed_at=None, requested_at=None, started_at=None, links=None, results=None, status=None, local_vars_configuration=None): # noqa: E501 + """BatchResponsePublicAssociationDefinitionUserConfiguration - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._completed_at = None + self._requested_at = None + self._started_at = None + self._links = None + self._results = None + self._status = None + self.discriminator = None + + self.completed_at = completed_at + if requested_at is not None: + self.requested_at = requested_at + self.started_at = started_at + if links is not None: + self.links = links + self.results = results + self.status = status + + @property + def completed_at(self): + """Gets the completed_at of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + + + :return: The completed_at of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + :rtype: datetime + """ + return self._completed_at + + @completed_at.setter + def completed_at(self, completed_at): + """Sets the completed_at of this BatchResponsePublicAssociationDefinitionUserConfiguration. + + + :param completed_at: The completed_at of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + :type completed_at: datetime + """ + if self.local_vars_configuration.client_side_validation and completed_at is None: # noqa: E501 + raise ValueError("Invalid value for `completed_at`, must not be `None`") # noqa: E501 + + self._completed_at = completed_at + + @property + def requested_at(self): + """Gets the requested_at of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + + + :return: The requested_at of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + :rtype: datetime + """ + return self._requested_at + + @requested_at.setter + def requested_at(self, requested_at): + """Sets the requested_at of this BatchResponsePublicAssociationDefinitionUserConfiguration. + + + :param requested_at: The requested_at of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + :type requested_at: datetime + """ + + self._requested_at = requested_at + + @property + def started_at(self): + """Gets the started_at of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + + + :return: The started_at of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this BatchResponsePublicAssociationDefinitionUserConfiguration. + + + :param started_at: The started_at of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + :type started_at: datetime + """ + if self.local_vars_configuration.client_side_validation and started_at is None: # noqa: E501 + raise ValueError("Invalid value for `started_at`, must not be `None`") # noqa: E501 + + self._started_at = started_at + + @property + def links(self): + """Gets the links of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + + + :return: The links of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this BatchResponsePublicAssociationDefinitionUserConfiguration. + + + :param links: The links of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def results(self): + """Gets the results of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + + + :return: The results of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + :rtype: list[PublicAssociationDefinitionUserConfiguration] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this BatchResponsePublicAssociationDefinitionUserConfiguration. + + + :param results: The results of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + :type results: list[PublicAssociationDefinitionUserConfiguration] + """ + if self.local_vars_configuration.client_side_validation and results is None: # noqa: E501 + raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 + + self._results = results + + @property + def status(self): + """Gets the status of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + + + :return: The status of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this BatchResponsePublicAssociationDefinitionUserConfiguration. + + + :param status: The status of this BatchResponsePublicAssociationDefinitionUserConfiguration. # noqa: E501 + :type status: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = ["PENDING", "PROCESSING", "CANCELED", "COMPLETE"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `status` ({0}), must be one of {1}".format(status, allowed_values)) # noqa: E501 + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchResponsePublicAssociationDefinitionUserConfiguration): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BatchResponsePublicAssociationDefinitionUserConfiguration): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_user_configuration_with_errors.py b/hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_user_configuration_with_errors.py new file mode 100644 index 00000000..811c66b2 --- /dev/null +++ b/hubspot/crm/associations/v4/schema/models/batch_response_public_association_definition_user_configuration_with_errors.py @@ -0,0 +1,314 @@ +# coding: utf-8 + +""" + CRM Associations Schema + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.schema.configuration import Configuration + + +class BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + "completed_at": "datetime", + "num_errors": "int", + "requested_at": "datetime", + "started_at": "datetime", + "links": "dict[str, str]", + "results": "list[PublicAssociationDefinitionUserConfiguration]", + "errors": "list[StandardError]", + "status": "str", + } + + attribute_map = { + "completed_at": "completedAt", + "num_errors": "numErrors", + "requested_at": "requestedAt", + "started_at": "startedAt", + "links": "links", + "results": "results", + "errors": "errors", + "status": "status", + } + + def __init__(self, completed_at=None, num_errors=None, requested_at=None, started_at=None, links=None, results=None, errors=None, status=None, local_vars_configuration=None): # noqa: E501 + """BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._completed_at = None + self._num_errors = None + self._requested_at = None + self._started_at = None + self._links = None + self._results = None + self._errors = None + self._status = None + self.discriminator = None + + self.completed_at = completed_at + if num_errors is not None: + self.num_errors = num_errors + if requested_at is not None: + self.requested_at = requested_at + self.started_at = started_at + if links is not None: + self.links = links + self.results = results + if errors is not None: + self.errors = errors + self.status = status + + @property + def completed_at(self): + """Gets the completed_at of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + + + :return: The completed_at of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._completed_at + + @completed_at.setter + def completed_at(self, completed_at): + """Sets the completed_at of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. + + + :param completed_at: The completed_at of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :type completed_at: datetime + """ + if self.local_vars_configuration.client_side_validation and completed_at is None: # noqa: E501 + raise ValueError("Invalid value for `completed_at`, must not be `None`") # noqa: E501 + + self._completed_at = completed_at + + @property + def num_errors(self): + """Gets the num_errors of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + + + :return: The num_errors of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :rtype: int + """ + return self._num_errors + + @num_errors.setter + def num_errors(self, num_errors): + """Sets the num_errors of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. + + + :param num_errors: The num_errors of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :type num_errors: int + """ + + self._num_errors = num_errors + + @property + def requested_at(self): + """Gets the requested_at of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + + + :return: The requested_at of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._requested_at + + @requested_at.setter + def requested_at(self, requested_at): + """Sets the requested_at of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. + + + :param requested_at: The requested_at of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :type requested_at: datetime + """ + + self._requested_at = requested_at + + @property + def started_at(self): + """Gets the started_at of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + + + :return: The started_at of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. + + + :param started_at: The started_at of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :type started_at: datetime + """ + if self.local_vars_configuration.client_side_validation and started_at is None: # noqa: E501 + raise ValueError("Invalid value for `started_at`, must not be `None`") # noqa: E501 + + self._started_at = started_at + + @property + def links(self): + """Gets the links of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + + + :return: The links of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. + + + :param links: The links of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def results(self): + """Gets the results of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + + + :return: The results of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :rtype: list[PublicAssociationDefinitionUserConfiguration] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. + + + :param results: The results of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :type results: list[PublicAssociationDefinitionUserConfiguration] + """ + if self.local_vars_configuration.client_side_validation and results is None: # noqa: E501 + raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 + + self._results = results + + @property + def errors(self): + """Gets the errors of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + + + :return: The errors of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :rtype: list[StandardError] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. + + + :param errors: The errors of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :type errors: list[StandardError] + """ + + self._errors = errors + + @property + def status(self): + """Gets the status of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + + + :return: The status of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. + + + :param status: The status of this BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors. # noqa: E501 + :type status: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = ["PENDING", "PROCESSING", "CANCELED", "COMPLETE"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `status` ({0}), must be one of {1}".format(status, allowed_values)) # noqa: E501 + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/associations/v4/schema/models/collection_response_public_association_definition_user_configuration_no_paging.py b/hubspot/crm/associations/v4/schema/models/collection_response_public_association_definition_user_configuration_no_paging.py new file mode 100644 index 00000000..94e1ab45 --- /dev/null +++ b/hubspot/crm/associations/v4/schema/models/collection_response_public_association_definition_user_configuration_no_paging.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + CRM Associations Schema + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.schema.configuration import Configuration + + +class CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"results": "list[PublicAssociationDefinitionUserConfiguration]"} + + attribute_map = {"results": "results"} + + def __init__(self, results=None, local_vars_configuration=None): # noqa: E501 + """CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._results = None + self.discriminator = None + + self.results = results + + @property + def results(self): + """Gets the results of this CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging. # noqa: E501 + + + :return: The results of this CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging. # noqa: E501 + :rtype: list[PublicAssociationDefinitionUserConfiguration] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging. + + + :param results: The results of this CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging. # noqa: E501 + :type results: list[PublicAssociationDefinitionUserConfiguration] + """ + if self.local_vars_configuration.client_side_validation and results is None: # noqa: E501 + raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 + + self._results = results + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/associations/v4/schema/models/public_association_definition_configuration_create_request.py b/hubspot/crm/associations/v4/schema/models/public_association_definition_configuration_create_request.py new file mode 100644 index 00000000..05c440e5 --- /dev/null +++ b/hubspot/crm/associations/v4/schema/models/public_association_definition_configuration_create_request.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + CRM Associations Schema + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.schema.configuration import Configuration + + +class PublicAssociationDefinitionConfigurationCreateRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"type_id": "int", "category": "str", "max_to_object_ids": "int"} + + attribute_map = {"type_id": "typeId", "category": "category", "max_to_object_ids": "maxToObjectIds"} + + def __init__(self, type_id=None, category=None, max_to_object_ids=None, local_vars_configuration=None): # noqa: E501 + """PublicAssociationDefinitionConfigurationCreateRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._type_id = None + self._category = None + self._max_to_object_ids = None + self.discriminator = None + + self.type_id = type_id + self.category = category + self.max_to_object_ids = max_to_object_ids + + @property + def type_id(self): + """Gets the type_id of this PublicAssociationDefinitionConfigurationCreateRequest. # noqa: E501 + + + :return: The type_id of this PublicAssociationDefinitionConfigurationCreateRequest. # noqa: E501 + :rtype: int + """ + return self._type_id + + @type_id.setter + def type_id(self, type_id): + """Sets the type_id of this PublicAssociationDefinitionConfigurationCreateRequest. + + + :param type_id: The type_id of this PublicAssociationDefinitionConfigurationCreateRequest. # noqa: E501 + :type type_id: int + """ + if self.local_vars_configuration.client_side_validation and type_id is None: # noqa: E501 + raise ValueError("Invalid value for `type_id`, must not be `None`") # noqa: E501 + + self._type_id = type_id + + @property + def category(self): + """Gets the category of this PublicAssociationDefinitionConfigurationCreateRequest. # noqa: E501 + + + :return: The category of this PublicAssociationDefinitionConfigurationCreateRequest. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this PublicAssociationDefinitionConfigurationCreateRequest. + + + :param category: The category of this PublicAssociationDefinitionConfigurationCreateRequest. # noqa: E501 + :type category: str + """ + if self.local_vars_configuration.client_side_validation and category is None: # noqa: E501 + raise ValueError("Invalid value for `category`, must not be `None`") # noqa: E501 + allowed_values = ["HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and category not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `category` ({0}), must be one of {1}".format(category, allowed_values)) # noqa: E501 + + self._category = category + + @property + def max_to_object_ids(self): + """Gets the max_to_object_ids of this PublicAssociationDefinitionConfigurationCreateRequest. # noqa: E501 + + + :return: The max_to_object_ids of this PublicAssociationDefinitionConfigurationCreateRequest. # noqa: E501 + :rtype: int + """ + return self._max_to_object_ids + + @max_to_object_ids.setter + def max_to_object_ids(self, max_to_object_ids): + """Sets the max_to_object_ids of this PublicAssociationDefinitionConfigurationCreateRequest. + + + :param max_to_object_ids: The max_to_object_ids of this PublicAssociationDefinitionConfigurationCreateRequest. # noqa: E501 + :type max_to_object_ids: int + """ + if self.local_vars_configuration.client_side_validation and max_to_object_ids is None: # noqa: E501 + raise ValueError("Invalid value for `max_to_object_ids`, must not be `None`") # noqa: E501 + + self._max_to_object_ids = max_to_object_ids + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PublicAssociationDefinitionConfigurationCreateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PublicAssociationDefinitionConfigurationCreateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/associations/v4/schema/models/public_association_definition_configuration_update_request.py b/hubspot/crm/associations/v4/schema/models/public_association_definition_configuration_update_request.py new file mode 100644 index 00000000..5a6cd004 --- /dev/null +++ b/hubspot/crm/associations/v4/schema/models/public_association_definition_configuration_update_request.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + CRM Associations Schema + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.schema.configuration import Configuration + + +class PublicAssociationDefinitionConfigurationUpdateRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"type_id": "int", "category": "str", "max_to_object_ids": "int"} + + attribute_map = {"type_id": "typeId", "category": "category", "max_to_object_ids": "maxToObjectIds"} + + def __init__(self, type_id=None, category=None, max_to_object_ids=None, local_vars_configuration=None): # noqa: E501 + """PublicAssociationDefinitionConfigurationUpdateRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._type_id = None + self._category = None + self._max_to_object_ids = None + self.discriminator = None + + self.type_id = type_id + self.category = category + self.max_to_object_ids = max_to_object_ids + + @property + def type_id(self): + """Gets the type_id of this PublicAssociationDefinitionConfigurationUpdateRequest. # noqa: E501 + + + :return: The type_id of this PublicAssociationDefinitionConfigurationUpdateRequest. # noqa: E501 + :rtype: int + """ + return self._type_id + + @type_id.setter + def type_id(self, type_id): + """Sets the type_id of this PublicAssociationDefinitionConfigurationUpdateRequest. + + + :param type_id: The type_id of this PublicAssociationDefinitionConfigurationUpdateRequest. # noqa: E501 + :type type_id: int + """ + if self.local_vars_configuration.client_side_validation and type_id is None: # noqa: E501 + raise ValueError("Invalid value for `type_id`, must not be `None`") # noqa: E501 + + self._type_id = type_id + + @property + def category(self): + """Gets the category of this PublicAssociationDefinitionConfigurationUpdateRequest. # noqa: E501 + + + :return: The category of this PublicAssociationDefinitionConfigurationUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this PublicAssociationDefinitionConfigurationUpdateRequest. + + + :param category: The category of this PublicAssociationDefinitionConfigurationUpdateRequest. # noqa: E501 + :type category: str + """ + if self.local_vars_configuration.client_side_validation and category is None: # noqa: E501 + raise ValueError("Invalid value for `category`, must not be `None`") # noqa: E501 + allowed_values = ["HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and category not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `category` ({0}), must be one of {1}".format(category, allowed_values)) # noqa: E501 + + self._category = category + + @property + def max_to_object_ids(self): + """Gets the max_to_object_ids of this PublicAssociationDefinitionConfigurationUpdateRequest. # noqa: E501 + + + :return: The max_to_object_ids of this PublicAssociationDefinitionConfigurationUpdateRequest. # noqa: E501 + :rtype: int + """ + return self._max_to_object_ids + + @max_to_object_ids.setter + def max_to_object_ids(self, max_to_object_ids): + """Sets the max_to_object_ids of this PublicAssociationDefinitionConfigurationUpdateRequest. + + + :param max_to_object_ids: The max_to_object_ids of this PublicAssociationDefinitionConfigurationUpdateRequest. # noqa: E501 + :type max_to_object_ids: int + """ + if self.local_vars_configuration.client_side_validation and max_to_object_ids is None: # noqa: E501 + raise ValueError("Invalid value for `max_to_object_ids`, must not be `None`") # noqa: E501 + + self._max_to_object_ids = max_to_object_ids + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PublicAssociationDefinitionConfigurationUpdateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PublicAssociationDefinitionConfigurationUpdateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/associations/v4/schema/models/public_association_definition_configuration_update_result.py b/hubspot/crm/associations/v4/schema/models/public_association_definition_configuration_update_result.py new file mode 100644 index 00000000..ba3743ae --- /dev/null +++ b/hubspot/crm/associations/v4/schema/models/public_association_definition_configuration_update_result.py @@ -0,0 +1,174 @@ +# coding: utf-8 + +""" + CRM Associations Schema + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.schema.configuration import Configuration + + +class PublicAssociationDefinitionConfigurationUpdateResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"user_enforced_max_to_object_ids": "int", "type_id": "int", "category": "str"} + + attribute_map = {"user_enforced_max_to_object_ids": "userEnforcedMaxToObjectIds", "type_id": "typeId", "category": "category"} + + def __init__(self, user_enforced_max_to_object_ids=None, type_id=None, category=None, local_vars_configuration=None): # noqa: E501 + """PublicAssociationDefinitionConfigurationUpdateResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._user_enforced_max_to_object_ids = None + self._type_id = None + self._category = None + self.discriminator = None + + if user_enforced_max_to_object_ids is not None: + self.user_enforced_max_to_object_ids = user_enforced_max_to_object_ids + self.type_id = type_id + self.category = category + + @property + def user_enforced_max_to_object_ids(self): + """Gets the user_enforced_max_to_object_ids of this PublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + + + :return: The user_enforced_max_to_object_ids of this PublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :rtype: int + """ + return self._user_enforced_max_to_object_ids + + @user_enforced_max_to_object_ids.setter + def user_enforced_max_to_object_ids(self, user_enforced_max_to_object_ids): + """Sets the user_enforced_max_to_object_ids of this PublicAssociationDefinitionConfigurationUpdateResult. + + + :param user_enforced_max_to_object_ids: The user_enforced_max_to_object_ids of this PublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :type user_enforced_max_to_object_ids: int + """ + + self._user_enforced_max_to_object_ids = user_enforced_max_to_object_ids + + @property + def type_id(self): + """Gets the type_id of this PublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + + + :return: The type_id of this PublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :rtype: int + """ + return self._type_id + + @type_id.setter + def type_id(self, type_id): + """Sets the type_id of this PublicAssociationDefinitionConfigurationUpdateResult. + + + :param type_id: The type_id of this PublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :type type_id: int + """ + if self.local_vars_configuration.client_side_validation and type_id is None: # noqa: E501 + raise ValueError("Invalid value for `type_id`, must not be `None`") # noqa: E501 + + self._type_id = type_id + + @property + def category(self): + """Gets the category of this PublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + + + :return: The category of this PublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this PublicAssociationDefinitionConfigurationUpdateResult. + + + :param category: The category of this PublicAssociationDefinitionConfigurationUpdateResult. # noqa: E501 + :type category: str + """ + if self.local_vars_configuration.client_side_validation and category is None: # noqa: E501 + raise ValueError("Invalid value for `category`, must not be `None`") # noqa: E501 + allowed_values = ["HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and category not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `category` ({0}), must be one of {1}".format(category, allowed_values)) # noqa: E501 + + self._category = category + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PublicAssociationDefinitionConfigurationUpdateResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PublicAssociationDefinitionConfigurationUpdateResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/associations/v4/schema/models/public_association_definition_user_configuration.py b/hubspot/crm/associations/v4/schema/models/public_association_definition_user_configuration.py new file mode 100644 index 00000000..27e26d0e --- /dev/null +++ b/hubspot/crm/associations/v4/schema/models/public_association_definition_user_configuration.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + CRM Associations Schema + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.schema.configuration import Configuration + + +class PublicAssociationDefinitionUserConfiguration(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"user_enforced_max_to_object_ids": "int", "type_id": "int", "label": "str", "category": "str"} + + attribute_map = {"user_enforced_max_to_object_ids": "userEnforcedMaxToObjectIds", "type_id": "typeId", "label": "label", "category": "category"} + + def __init__(self, user_enforced_max_to_object_ids=None, type_id=None, label=None, category=None, local_vars_configuration=None): # noqa: E501 + """PublicAssociationDefinitionUserConfiguration - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._user_enforced_max_to_object_ids = None + self._type_id = None + self._label = None + self._category = None + self.discriminator = None + + if user_enforced_max_to_object_ids is not None: + self.user_enforced_max_to_object_ids = user_enforced_max_to_object_ids + self.type_id = type_id + if label is not None: + self.label = label + self.category = category + + @property + def user_enforced_max_to_object_ids(self): + """Gets the user_enforced_max_to_object_ids of this PublicAssociationDefinitionUserConfiguration. # noqa: E501 + + + :return: The user_enforced_max_to_object_ids of this PublicAssociationDefinitionUserConfiguration. # noqa: E501 + :rtype: int + """ + return self._user_enforced_max_to_object_ids + + @user_enforced_max_to_object_ids.setter + def user_enforced_max_to_object_ids(self, user_enforced_max_to_object_ids): + """Sets the user_enforced_max_to_object_ids of this PublicAssociationDefinitionUserConfiguration. + + + :param user_enforced_max_to_object_ids: The user_enforced_max_to_object_ids of this PublicAssociationDefinitionUserConfiguration. # noqa: E501 + :type user_enforced_max_to_object_ids: int + """ + + self._user_enforced_max_to_object_ids = user_enforced_max_to_object_ids + + @property + def type_id(self): + """Gets the type_id of this PublicAssociationDefinitionUserConfiguration. # noqa: E501 + + + :return: The type_id of this PublicAssociationDefinitionUserConfiguration. # noqa: E501 + :rtype: int + """ + return self._type_id + + @type_id.setter + def type_id(self, type_id): + """Sets the type_id of this PublicAssociationDefinitionUserConfiguration. + + + :param type_id: The type_id of this PublicAssociationDefinitionUserConfiguration. # noqa: E501 + :type type_id: int + """ + if self.local_vars_configuration.client_side_validation and type_id is None: # noqa: E501 + raise ValueError("Invalid value for `type_id`, must not be `None`") # noqa: E501 + + self._type_id = type_id + + @property + def label(self): + """Gets the label of this PublicAssociationDefinitionUserConfiguration. # noqa: E501 + + + :return: The label of this PublicAssociationDefinitionUserConfiguration. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this PublicAssociationDefinitionUserConfiguration. + + + :param label: The label of this PublicAssociationDefinitionUserConfiguration. # noqa: E501 + :type label: str + """ + + self._label = label + + @property + def category(self): + """Gets the category of this PublicAssociationDefinitionUserConfiguration. # noqa: E501 + + + :return: The category of this PublicAssociationDefinitionUserConfiguration. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this PublicAssociationDefinitionUserConfiguration. + + + :param category: The category of this PublicAssociationDefinitionUserConfiguration. # noqa: E501 + :type category: str + """ + if self.local_vars_configuration.client_side_validation and category is None: # noqa: E501 + raise ValueError("Invalid value for `category`, must not be `None`") # noqa: E501 + allowed_values = ["HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and category not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `category` ({0}), must be one of {1}".format(category, allowed_values)) # noqa: E501 + + self._category = category + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PublicAssociationDefinitionUserConfiguration): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PublicAssociationDefinitionUserConfiguration): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/associations/v4/schema/models/public_association_spec.py b/hubspot/crm/associations/v4/schema/models/public_association_spec.py new file mode 100644 index 00000000..98500745 --- /dev/null +++ b/hubspot/crm/associations/v4/schema/models/public_association_spec.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + CRM Associations Schema + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.schema.configuration import Configuration + + +class PublicAssociationSpec(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"type_id": "int", "category": "str"} + + attribute_map = {"type_id": "typeId", "category": "category"} + + def __init__(self, type_id=None, category=None, local_vars_configuration=None): # noqa: E501 + """PublicAssociationSpec - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._type_id = None + self._category = None + self.discriminator = None + + self.type_id = type_id + self.category = category + + @property + def type_id(self): + """Gets the type_id of this PublicAssociationSpec. # noqa: E501 + + + :return: The type_id of this PublicAssociationSpec. # noqa: E501 + :rtype: int + """ + return self._type_id + + @type_id.setter + def type_id(self, type_id): + """Sets the type_id of this PublicAssociationSpec. + + + :param type_id: The type_id of this PublicAssociationSpec. # noqa: E501 + :type type_id: int + """ + if self.local_vars_configuration.client_side_validation and type_id is None: # noqa: E501 + raise ValueError("Invalid value for `type_id`, must not be `None`") # noqa: E501 + + self._type_id = type_id + + @property + def category(self): + """Gets the category of this PublicAssociationSpec. # noqa: E501 + + + :return: The category of this PublicAssociationSpec. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this PublicAssociationSpec. + + + :param category: The category of this PublicAssociationSpec. # noqa: E501 + :type category: str + """ + if self.local_vars_configuration.client_side_validation and category is None: # noqa: E501 + raise ValueError("Invalid value for `category`, must not be `None`") # noqa: E501 + + self._category = category + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PublicAssociationSpec): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PublicAssociationSpec): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/associations/v4/schema/models/standard_error.py b/hubspot/crm/associations/v4/schema/models/standard_error.py new file mode 100644 index 00000000..73c5fd21 --- /dev/null +++ b/hubspot/crm/associations/v4/schema/models/standard_error.py @@ -0,0 +1,304 @@ +# coding: utf-8 + +""" + CRM Associations Schema + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v4 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.crm.associations.v4.schema.configuration import Configuration + + +class StandardError(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + "sub_category": "object", + "context": "dict[str, list[str]]", + "links": "dict[str, str]", + "id": "str", + "category": "str", + "message": "str", + "errors": "list[ErrorDetail]", + "status": "str", + } + + attribute_map = {"sub_category": "subCategory", "context": "context", "links": "links", "id": "id", "category": "category", "message": "message", "errors": "errors", "status": "status"} + + def __init__(self, sub_category=None, context=None, links=None, id=None, category=None, message=None, errors=None, status=None, local_vars_configuration=None): # noqa: E501 + """StandardError - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._sub_category = None + self._context = None + self._links = None + self._id = None + self._category = None + self._message = None + self._errors = None + self._status = None + self.discriminator = None + + if sub_category is not None: + self.sub_category = sub_category + self.context = context + self.links = links + if id is not None: + self.id = id + self.category = category + self.message = message + self.errors = errors + self.status = status + + @property + def sub_category(self): + """Gets the sub_category of this StandardError. # noqa: E501 + + + :return: The sub_category of this StandardError. # noqa: E501 + :rtype: object + """ + return self._sub_category + + @sub_category.setter + def sub_category(self, sub_category): + """Sets the sub_category of this StandardError. + + + :param sub_category: The sub_category of this StandardError. # noqa: E501 + :type sub_category: object + """ + + self._sub_category = sub_category + + @property + def context(self): + """Gets the context of this StandardError. # noqa: E501 + + + :return: The context of this StandardError. # noqa: E501 + :rtype: dict[str, list[str]] + """ + return self._context + + @context.setter + def context(self, context): + """Sets the context of this StandardError. + + + :param context: The context of this StandardError. # noqa: E501 + :type context: dict[str, list[str]] + """ + if self.local_vars_configuration.client_side_validation and context is None: # noqa: E501 + raise ValueError("Invalid value for `context`, must not be `None`") # noqa: E501 + + self._context = context + + @property + def links(self): + """Gets the links of this StandardError. # noqa: E501 + + + :return: The links of this StandardError. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this StandardError. + + + :param links: The links of this StandardError. # noqa: E501 + :type links: dict[str, str] + """ + if self.local_vars_configuration.client_side_validation and links is None: # noqa: E501 + raise ValueError("Invalid value for `links`, must not be `None`") # noqa: E501 + + self._links = links + + @property + def id(self): + """Gets the id of this StandardError. # noqa: E501 + + + :return: The id of this StandardError. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this StandardError. + + + :param id: The id of this StandardError. # noqa: E501 + :type id: str + """ + + self._id = id + + @property + def category(self): + """Gets the category of this StandardError. # noqa: E501 + + + :return: The category of this StandardError. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this StandardError. + + + :param category: The category of this StandardError. # noqa: E501 + :type category: str + """ + if self.local_vars_configuration.client_side_validation and category is None: # noqa: E501 + raise ValueError("Invalid value for `category`, must not be `None`") # noqa: E501 + + self._category = category + + @property + def message(self): + """Gets the message of this StandardError. # noqa: E501 + + + :return: The message of this StandardError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this StandardError. + + + :param message: The message of this StandardError. # noqa: E501 + :type message: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def errors(self): + """Gets the errors of this StandardError. # noqa: E501 + + + :return: The errors of this StandardError. # noqa: E501 + :rtype: list[ErrorDetail] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this StandardError. + + + :param errors: The errors of this StandardError. # noqa: E501 + :type errors: list[ErrorDetail] + """ + if self.local_vars_configuration.client_side_validation and errors is None: # noqa: E501 + raise ValueError("Invalid value for `errors`, must not be `None`") # noqa: E501 + + self._errors = errors + + @property + def status(self): + """Gets the status of this StandardError. # noqa: E501 + + + :return: The status of this StandardError. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this StandardError. + + + :param status: The status of this StandardError. # noqa: E501 + :type status: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StandardError): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StandardError): + return True + + return self.to_dict() != other.to_dict() From ba0d48d3905d68463ced241fbe239e202ceb2070 Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 18 Nov 2024 10:28:13 +0300 Subject: [PATCH 11/15] regen missing file --- hubspot/crm/associations/__init__.py | 48 ++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/hubspot/crm/associations/__init__.py b/hubspot/crm/associations/__init__.py index e69de29b..77ef3f80 100644 --- a/hubspot/crm/associations/__init__.py +++ b/hubspot/crm/associations/__init__.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Associations + + Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +__version__ = "1.0.0" + +# import apis into sdk package +from hubspot.crm.associations.api.batch_api import BatchApi + +# import ApiClient +from hubspot.crm.associations.api_client import ApiClient +from hubspot.crm.associations.configuration import Configuration +from hubspot.crm.associations.exceptions import OpenApiException +from hubspot.crm.associations.exceptions import ApiTypeError +from hubspot.crm.associations.exceptions import ApiValueError +from hubspot.crm.associations.exceptions import ApiKeyError +from hubspot.crm.associations.exceptions import ApiAttributeError +from hubspot.crm.associations.exceptions import ApiException + +# import models into sdk package +from hubspot.crm.associations.models.associated_id import AssociatedId +from hubspot.crm.associations.models.batch_input_public_association import BatchInputPublicAssociation +from hubspot.crm.associations.models.batch_input_public_object_id import BatchInputPublicObjectId +from hubspot.crm.associations.models.batch_response_public_association import BatchResponsePublicAssociation +from hubspot.crm.associations.models.batch_response_public_association_multi import BatchResponsePublicAssociationMulti +from hubspot.crm.associations.models.batch_response_public_association_multi_with_errors import BatchResponsePublicAssociationMultiWithErrors +from hubspot.crm.associations.models.batch_response_public_association_with_errors import BatchResponsePublicAssociationWithErrors +from hubspot.crm.associations.models.error import Error +from hubspot.crm.associations.models.error_detail import ErrorDetail +from hubspot.crm.associations.models.next_page import NextPage +from hubspot.crm.associations.models.paging import Paging +from hubspot.crm.associations.models.previous_page import PreviousPage +from hubspot.crm.associations.models.public_association import PublicAssociation +from hubspot.crm.associations.models.public_association_multi import PublicAssociationMulti +from hubspot.crm.associations.models.public_object_id import PublicObjectId +from hubspot.crm.associations.models.standard_error import StandardError From bd1dc42ea611f0eac9989cf219b8cef1c6418b8f Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 18 Nov 2024 12:58:27 +0300 Subject: [PATCH 12/15] update Makefile --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 7894b579..f663250c 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ -VENV_NAME?=venv +VENV_NAME ?= venv venv: $(VENV_NAME)/bin/activate $(VENV_NAME)/bin/activate: setup.py - pip3 install --upgrade pip virtualenv - @test -d $(VENV_NAME) || python3 -m virtualenv --clear $(VENV_NAME) - ${VENV_NAME}/bin/python -m pip install -e .[dev] + @test -d $(VENV_NAME) || python3 -m venv $(VENV_NAME) + @${VENV_NAME}/bin/python -m pip install --upgrade pip + @${VENV_NAME}/bin/python -m pip install -e .[dev] @touch $(VENV_NAME)/bin/activate test: venv From 19e81ad10039d219a07d7e9ff0a30e9d3ab57cfc Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 18 Nov 2024 14:25:31 +0300 Subject: [PATCH 13/15] Update discoveries, Clean up --- .../discovery/crm/associations/v4/discovery.py | 4 ++++ .../crm/associations/v4/schema/discovery.py | 3 +++ .../discovery/crm/extensions/calling/discovery.py | 7 ++++--- hubspot/discovery/crm/objects/discovery.py | 8 ++++---- hubspot/discovery/crm/pipelines/discovery.py | 15 ++++++++------- hubspot/discovery/marketing/events/discovery.py | 4 ++++ 6 files changed, 27 insertions(+), 14 deletions(-) diff --git a/hubspot/discovery/crm/associations/v4/discovery.py b/hubspot/discovery/crm/associations/v4/discovery.py index 3c959e67..26165033 100644 --- a/hubspot/discovery/crm/associations/v4/discovery.py +++ b/hubspot/discovery/crm/associations/v4/discovery.py @@ -11,6 +11,10 @@ def basic_api(self) -> api_client.BasicApi: def batch_api(self) -> api_client.BatchApi: return self._configure_api_client(api_client, "BatchApi") + @property + def report_api(self) -> api_client.ReportApi: + return self._configure_api_client(api_client, "ReportApi") + @property def schema(self): from .schema.discovery import Discovery as schemaDiscovery diff --git a/hubspot/discovery/crm/associations/v4/schema/discovery.py b/hubspot/discovery/crm/associations/v4/schema/discovery.py index afd822e6..3849d71d 100644 --- a/hubspot/discovery/crm/associations/v4/schema/discovery.py +++ b/hubspot/discovery/crm/associations/v4/schema/discovery.py @@ -8,3 +8,6 @@ class Discovery(DiscoveryBase): def definitions_api(self) -> api_client.DefinitionsApi: return self._configure_api_client(api_client, "DefinitionsApi") + @property + def definition_configurations_api(self) -> api_client.DefinitionConfigurationsApi: + return self._configure_api_client(api_client, "DefinitionConfigurationsApi") diff --git a/hubspot/discovery/crm/extensions/calling/discovery.py b/hubspot/discovery/crm/extensions/calling/discovery.py index d941298e..84a985ba 100644 --- a/hubspot/discovery/crm/extensions/calling/discovery.py +++ b/hubspot/discovery/crm/extensions/calling/discovery.py @@ -3,10 +3,11 @@ class Discovery(DiscoveryBase): - @property - def settings_api(self) -> api_client.SettingsApi: - return self._configure_api_client(api_client, "SettingsApi") @property def recording_settings_api(self) -> api_client.RecordingSettingsApi: return self._configure_api_client(api_client, "RecordingSettingsApi") + + @property + def settings_api(self) -> api_client.SettingsApi: + return self._configure_api_client(api_client, "SettingsApi") diff --git a/hubspot/discovery/crm/objects/discovery.py b/hubspot/discovery/crm/objects/discovery.py index f690d213..4075788e 100644 --- a/hubspot/discovery/crm/objects/discovery.py +++ b/hubspot/discovery/crm/objects/discovery.py @@ -7,14 +7,14 @@ class Discovery(DiscoveryBase): def basic_api(self) -> api_client.BasicApi: return self._configure_api_client(api_client, "BasicApi") - @property - def search_api(self) -> api_client.SearchApi: - return self._configure_api_client(api_client, "SearchApi") - @property def batch_api(self) -> api_client.BatchApi: return self._configure_api_client(api_client, "BatchApi") + @property + def search_api(self) -> api_client.SearchApi: + return self._configure_api_client(api_client, "SearchApi") + @property def calls(self): from .calls.discovery import Discovery as CallsDiscovery diff --git a/hubspot/discovery/crm/pipelines/discovery.py b/hubspot/discovery/crm/pipelines/discovery.py index a553062e..c2390af2 100644 --- a/hubspot/discovery/crm/pipelines/discovery.py +++ b/hubspot/discovery/crm/pipelines/discovery.py @@ -3,13 +3,6 @@ class Discovery(DiscoveryBase): - @property - def pipeline_stages_api(self) -> api_client.PipelineStagesApi: - return self._configure_api_client(api_client, "PipelineStagesApi") - - @property - def pipelines_api(self) -> api_client.PipelinesApi: - return self._configure_api_client(api_client, "PipelinesApi") @property def pipeline_audits_api(self) -> api_client.PipelineAuditsApi: @@ -18,3 +11,11 @@ def pipeline_audits_api(self) -> api_client.PipelineAuditsApi: @property def pipeline_stage_audits_api(self) -> api_client.PipelineStageAuditsApi: return self._configure_api_client(api_client, "PipelineStageAuditsApi") + + @property + def pipeline_stages_api(self) -> api_client.PipelineStagesApi: + return self._configure_api_client(api_client, "PipelineStagesApi") + + @property + def pipelines_api(self) -> api_client.PipelinesApi: + return self._configure_api_client(api_client, "PipelinesApi") diff --git a/hubspot/discovery/marketing/events/discovery.py b/hubspot/discovery/marketing/events/discovery.py index b3b5396e..0b12020d 100644 --- a/hubspot/discovery/marketing/events/discovery.py +++ b/hubspot/discovery/marketing/events/discovery.py @@ -11,6 +11,10 @@ def attendance_subscriber_state_changes_api(self) -> api_client.AttendanceSubscr def basic_api(self) -> api_client.BasicApi: return self._configure_api_client(api_client, "BasicApi") + @property + def list_associations_api(self) -> api_client.ListAssociationsApi: + return self._configure_api_client(api_client, "ListAssociationsApi") + @property def participant_state_api(self) -> api_client.ParticipantStateApi: return self._configure_api_client(api_client, "ParticipantStateApi") From 7dda5bdd717bb6f60589b5cb5ada0431fada60ba Mon Sep 17 00:00:00 2001 From: alexey Date: Wed, 27 Nov 2024 12:23:59 +0300 Subject: [PATCH 14/15] Update changelog and version --- CHANGELOG.md | 26 +++++++++++++++++++++++++- VERSION | 2 +- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f50a7cb..c5b5858f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,31 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/HubSpot/hubspot-api-python/compare/v10.0.0...HEAD) +## [Unreleased](https://github.com/HubSpot/hubspot-api-python/compare/v11.0.0...HEAD) + +## [11.0.0](https://github.com/HubSpot/hubspot-api-python/compare/v10.0.0...v11.0.0) - 2024-11-27 + +## Associations + +- Added `assiciations.v4.report_api` Api. +- Added `assiciations.v4.schema.definition_configurations_api` Api. + +## Marketing Events + +- Added `marketing.events.list_associations_api` Api. +- Renamed method `create_by_contact_email` to `record_by_contact_emails` in `marketing.events.attendance_subscriber_state_changes_api`. +- Renamed method `create_by_contact_id` to `record_by_contact_ids` in `marketing.events.attendance_subscriber_state_changes_api`. +- Remove parameters `attendance_state_calculation_timestamp` and `import_status` to `marketing.events.models.marketing_event_update_request_params`. + +## Other changes + +- Added `api_request` Api(for requests by curl). +- Enhance `get_all` method. +- Added possibility change all configuration params("proxy", "proxy_headers" and ect.). +- Fix call `crm.tickets.merge_api`. +- Update README. +- Update requires. +- Update Makefile. ## [10.0.0](https://github.com/HubSpot/hubspot-api-python/compare/v9.0.0...v10.0.0) - 2024-10-10 diff --git a/VERSION b/VERSION index a13e7b9c..275283a1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.0.0 +11.0.0 From 2c2a1a6df451b1350cdaf8234602387803b929e1 Mon Sep 17 00:00:00 2001 From: alexey Date: Wed, 27 Nov 2024 12:41:38 +0300 Subject: [PATCH 15/15] update discovery tests --- tests/spec/crm/v4/schema/test_v4_associations_schema.py | 3 ++- tests/spec/crm/v4/test_v4_associations.py | 3 ++- tests/spec/marketing/test_marketing_events.py | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/spec/crm/v4/schema/test_v4_associations_schema.py b/tests/spec/crm/v4/schema/test_v4_associations_schema.py index 8314113b..fe9308c9 100644 --- a/tests/spec/crm/v4/schema/test_v4_associations_schema.py +++ b/tests/spec/crm/v4/schema/test_v4_associations_schema.py @@ -1,7 +1,8 @@ from hubspot import HubSpot -from hubspot.crm.associations.v4.schema import DefinitionsApi +from hubspot.crm.associations.v4.schema import DefinitionsApi, DefinitionConfigurationsApi def test_is_discoverable(): apis = HubSpot().crm.associations.v4.schema assert isinstance(apis.definitions_api, DefinitionsApi) + assert isinstance(apis.definition_configurations_api, DefinitionConfigurationsApi) diff --git a/tests/spec/crm/v4/test_v4_associations.py b/tests/spec/crm/v4/test_v4_associations.py index c7bbd693..28ffc633 100644 --- a/tests/spec/crm/v4/test_v4_associations.py +++ b/tests/spec/crm/v4/test_v4_associations.py @@ -1,9 +1,10 @@ from hubspot import HubSpot -from hubspot.crm.associations.v4 import BatchApi, BasicApi +from hubspot.crm.associations.v4 import BatchApi, BasicApi, ReportApi def test_is_discoverable(): apis = HubSpot().crm.associations.v4 assert isinstance(apis.batch_api, BatchApi) assert isinstance(apis.basic_api, BasicApi) + assert isinstance(apis.report_api, ReportApi) assert hasattr(apis, "schema") diff --git a/tests/spec/marketing/test_marketing_events.py b/tests/spec/marketing/test_marketing_events.py index d6963baf..6934f7a9 100644 --- a/tests/spec/marketing/test_marketing_events.py +++ b/tests/spec/marketing/test_marketing_events.py @@ -2,6 +2,7 @@ from hubspot.marketing.events import ( AttendanceSubscriberStateChangesApi, BasicApi, + ListAssociationsApi, ParticipantStateApi, SettingsApi, SubscriberStateChangesApi @@ -12,6 +13,7 @@ def test_is_discoverable(): apis = HubSpot().marketing.events assert isinstance(apis.attendance_subscriber_state_changes_api, AttendanceSubscriberStateChangesApi) assert isinstance(apis.basic_api, BasicApi) + assert isinstance(apis.list_associations_api, ListAssociationsApi) assert isinstance(apis.participant_state_api, ParticipantStateApi) assert isinstance(apis.settings_api, SettingsApi) assert isinstance(apis.subscriber_state_changes_api, SubscriberStateChangesApi)