From 33be9e1762976f9db30f959d84f6ce1f3aff0e52 Mon Sep 17 00:00:00 2001 From: alexey Date: Wed, 9 Oct 2024 14:21:12 +0300 Subject: [PATCH] Codegen: Crm Objects Leads --- hubspot/crm/objects/leads/__init__.py | 69 ++ hubspot/crm/objects/leads/api/__init__.py | 8 + hubspot/crm/objects/leads/api/basic_api.py | 735 ++++++++++++++++++ hubspot/crm/objects/leads/api/batch_api.py | 674 ++++++++++++++++ hubspot/crm/objects/leads/api/search_api.py | 160 ++++ hubspot/crm/objects/leads/api_client.py | 664 ++++++++++++++++ hubspot/crm/objects/leads/configuration.py | 439 +++++++++++ hubspot/crm/objects/leads/exceptions.py | 155 ++++ hubspot/crm/objects/leads/models/__init__.py | 51 ++ .../crm/objects/leads/models/associated_id.py | 147 ++++ .../objects/leads/models/association_spec.py | 150 ++++ ..._input_simple_public_object_batch_input.py | 122 +++ ...simple_public_object_batch_input_upsert.py | 122 +++ .../batch_input_simple_public_object_id.py | 122 +++ ...t_simple_public_object_input_for_create.py | 122 +++ ...atch_read_input_simple_public_object_id.py | 196 +++++ .../batch_response_simple_public_object.py | 248 ++++++ ...sponse_simple_public_object_with_errors.py | 314 ++++++++ ...ch_response_simple_public_upsert_object.py | 248 ++++++ ...simple_public_upsert_object_with_errors.py | 314 ++++++++ .../collection_response_associated_id.py | 146 ++++ ...object_with_associations_forward_paging.py | 146 ++++ ...tal_simple_public_object_forward_paging.py | 171 ++++ hubspot/crm/objects/leads/models/error.py | 282 +++++++ .../crm/objects/leads/models/error_detail.py | 228 ++++++ hubspot/crm/objects/leads/models/filter.py | 224 ++++++ .../crm/objects/leads/models/filter_group.py | 122 +++ .../objects/leads/models/forward_paging.py | 121 +++ hubspot/crm/objects/leads/models/next_page.py | 146 ++++ hubspot/crm/objects/leads/models/paging.py | 145 ++++ .../crm/objects/leads/models/previous_page.py | 146 ++++ .../models/public_associations_for_object.py | 147 ++++ .../objects/leads/models/public_object_id.py | 122 +++ .../models/public_object_search_request.py | 241 ++++++ .../leads/models/simple_public_object.py | 285 +++++++ .../simple_public_object_batch_input.py | 195 +++++ ...simple_public_object_batch_input_upsert.py | 195 +++++ .../leads/models/simple_public_object_id.py | 122 +++ .../models/simple_public_object_input.py | 146 ++++ .../simple_public_object_input_for_create.py | 171 ++++ .../simple_public_object_with_associations.py | 313 ++++++++ .../models/simple_public_upsert_object.py | 314 ++++++++ .../objects/leads/models/standard_error.py | 304 ++++++++ .../leads/models/value_with_timestamp.py | 244 ++++++ hubspot/crm/objects/leads/rest.py | 213 +++++ 45 files changed, 9949 insertions(+) create mode 100644 hubspot/crm/objects/leads/__init__.py create mode 100644 hubspot/crm/objects/leads/api/__init__.py create mode 100644 hubspot/crm/objects/leads/api/basic_api.py create mode 100644 hubspot/crm/objects/leads/api/batch_api.py create mode 100644 hubspot/crm/objects/leads/api/search_api.py create mode 100644 hubspot/crm/objects/leads/api_client.py create mode 100644 hubspot/crm/objects/leads/configuration.py create mode 100644 hubspot/crm/objects/leads/exceptions.py create mode 100644 hubspot/crm/objects/leads/models/__init__.py create mode 100644 hubspot/crm/objects/leads/models/associated_id.py create mode 100644 hubspot/crm/objects/leads/models/association_spec.py create mode 100644 hubspot/crm/objects/leads/models/batch_input_simple_public_object_batch_input.py create mode 100644 hubspot/crm/objects/leads/models/batch_input_simple_public_object_batch_input_upsert.py create mode 100644 hubspot/crm/objects/leads/models/batch_input_simple_public_object_id.py create mode 100644 hubspot/crm/objects/leads/models/batch_input_simple_public_object_input_for_create.py create mode 100644 hubspot/crm/objects/leads/models/batch_read_input_simple_public_object_id.py create mode 100644 hubspot/crm/objects/leads/models/batch_response_simple_public_object.py create mode 100644 hubspot/crm/objects/leads/models/batch_response_simple_public_object_with_errors.py create mode 100644 hubspot/crm/objects/leads/models/batch_response_simple_public_upsert_object.py create mode 100644 hubspot/crm/objects/leads/models/batch_response_simple_public_upsert_object_with_errors.py create mode 100644 hubspot/crm/objects/leads/models/collection_response_associated_id.py create mode 100644 hubspot/crm/objects/leads/models/collection_response_simple_public_object_with_associations_forward_paging.py create mode 100644 hubspot/crm/objects/leads/models/collection_response_with_total_simple_public_object_forward_paging.py create mode 100644 hubspot/crm/objects/leads/models/error.py create mode 100644 hubspot/crm/objects/leads/models/error_detail.py create mode 100644 hubspot/crm/objects/leads/models/filter.py create mode 100644 hubspot/crm/objects/leads/models/filter_group.py create mode 100644 hubspot/crm/objects/leads/models/forward_paging.py create mode 100644 hubspot/crm/objects/leads/models/next_page.py create mode 100644 hubspot/crm/objects/leads/models/paging.py create mode 100644 hubspot/crm/objects/leads/models/previous_page.py create mode 100644 hubspot/crm/objects/leads/models/public_associations_for_object.py create mode 100644 hubspot/crm/objects/leads/models/public_object_id.py create mode 100644 hubspot/crm/objects/leads/models/public_object_search_request.py create mode 100644 hubspot/crm/objects/leads/models/simple_public_object.py create mode 100644 hubspot/crm/objects/leads/models/simple_public_object_batch_input.py create mode 100644 hubspot/crm/objects/leads/models/simple_public_object_batch_input_upsert.py create mode 100644 hubspot/crm/objects/leads/models/simple_public_object_id.py create mode 100644 hubspot/crm/objects/leads/models/simple_public_object_input.py create mode 100644 hubspot/crm/objects/leads/models/simple_public_object_input_for_create.py create mode 100644 hubspot/crm/objects/leads/models/simple_public_object_with_associations.py create mode 100644 hubspot/crm/objects/leads/models/simple_public_upsert_object.py create mode 100644 hubspot/crm/objects/leads/models/standard_error.py create mode 100644 hubspot/crm/objects/leads/models/value_with_timestamp.py create mode 100644 hubspot/crm/objects/leads/rest.py diff --git a/hubspot/crm/objects/leads/__init__.py b/hubspot/crm/objects/leads/__init__.py new file mode 100644 index 00000000..6f000be5 --- /dev/null +++ b/hubspot/crm/objects/leads/__init__.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Leads + + 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 + +__version__ = "1.0.0" + +# import apis into sdk package +from hubspot.crm.objects.leads.api.basic_api import BasicApi +from hubspot.crm.objects.leads.api.batch_api import BatchApi +from hubspot.crm.objects.leads.api.search_api import SearchApi + +# import ApiClient +from hubspot.crm.objects.leads.api_client import ApiClient +from hubspot.crm.objects.leads.configuration import Configuration +from hubspot.crm.objects.leads.exceptions import OpenApiException +from hubspot.crm.objects.leads.exceptions import ApiTypeError +from hubspot.crm.objects.leads.exceptions import ApiValueError +from hubspot.crm.objects.leads.exceptions import ApiKeyError +from hubspot.crm.objects.leads.exceptions import ApiAttributeError +from hubspot.crm.objects.leads.exceptions import ApiException + +# import models into sdk package +from hubspot.crm.objects.leads.models.associated_id import AssociatedId +from hubspot.crm.objects.leads.models.association_spec import AssociationSpec +from hubspot.crm.objects.leads.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.leads.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert +from hubspot.crm.objects.leads.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId +from hubspot.crm.objects.leads.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate +from hubspot.crm.objects.leads.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId +from hubspot.crm.objects.leads.models.batch_response_simple_public_object import BatchResponseSimplePublicObject +from hubspot.crm.objects.leads.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors +from hubspot.crm.objects.leads.models.batch_response_simple_public_upsert_object import BatchResponseSimplePublicUpsertObject +from hubspot.crm.objects.leads.models.batch_response_simple_public_upsert_object_with_errors import BatchResponseSimplePublicUpsertObjectWithErrors +from hubspot.crm.objects.leads.models.collection_response_associated_id import CollectionResponseAssociatedId +from hubspot.crm.objects.leads.models.collection_response_simple_public_object_with_associations_forward_paging import CollectionResponseSimplePublicObjectWithAssociationsForwardPaging +from hubspot.crm.objects.leads.models.collection_response_with_total_simple_public_object_forward_paging import CollectionResponseWithTotalSimplePublicObjectForwardPaging +from hubspot.crm.objects.leads.models.error import Error +from hubspot.crm.objects.leads.models.error_detail import ErrorDetail +from hubspot.crm.objects.leads.models.filter import Filter +from hubspot.crm.objects.leads.models.filter_group import FilterGroup +from hubspot.crm.objects.leads.models.forward_paging import ForwardPaging +from hubspot.crm.objects.leads.models.next_page import NextPage +from hubspot.crm.objects.leads.models.paging import Paging +from hubspot.crm.objects.leads.models.previous_page import PreviousPage +from hubspot.crm.objects.leads.models.public_associations_for_object import PublicAssociationsForObject +from hubspot.crm.objects.leads.models.public_object_id import PublicObjectId +from hubspot.crm.objects.leads.models.public_object_search_request import PublicObjectSearchRequest +from hubspot.crm.objects.leads.models.simple_public_object import SimplePublicObject +from hubspot.crm.objects.leads.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.leads.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert +from hubspot.crm.objects.leads.models.simple_public_object_id import SimplePublicObjectId +from hubspot.crm.objects.leads.models.simple_public_object_input import SimplePublicObjectInput +from hubspot.crm.objects.leads.models.simple_public_object_input_for_create import SimplePublicObjectInputForCreate +from hubspot.crm.objects.leads.models.simple_public_object_with_associations import SimplePublicObjectWithAssociations +from hubspot.crm.objects.leads.models.simple_public_upsert_object import SimplePublicUpsertObject +from hubspot.crm.objects.leads.models.standard_error import StandardError +from hubspot.crm.objects.leads.models.value_with_timestamp import ValueWithTimestamp diff --git a/hubspot/crm/objects/leads/api/__init__.py b/hubspot/crm/objects/leads/api/__init__.py new file mode 100644 index 00000000..e1599eb7 --- /dev/null +++ b/hubspot/crm/objects/leads/api/__init__.py @@ -0,0 +1,8 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from hubspot.crm.objects.leads.api.basic_api import BasicApi +from hubspot.crm.objects.leads.api.batch_api import BatchApi +from hubspot.crm.objects.leads.api.search_api import SearchApi diff --git a/hubspot/crm/objects/leads/api/basic_api.py b/hubspot/crm/objects/leads/api/basic_api.py new file mode 100644 index 00000000..241f9056 --- /dev/null +++ b/hubspot/crm/objects/leads/api/basic_api.py @@ -0,0 +1,735 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.api_client import ApiClient +from hubspot.crm.objects.leads.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class BasicApi(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 archive(self, leads_id, **kwargs): # noqa: E501 + """Archive # noqa: E501 + + Move an Object identified by `{leadsId}` to the recycling bin. # 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(leads_id, async_req=True) + >>> result = thread.get() + + :param leads_id: (required) + :type leads_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.archive_with_http_info(leads_id, **kwargs) # noqa: E501 + + def archive_with_http_info(self, leads_id, **kwargs): # noqa: E501 + """Archive # noqa: E501 + + Move an Object identified by `{leadsId}` to the recycling bin. # 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(leads_id, async_req=True) + >>> result = thread.get() + + :param leads_id: (required) + :type leads_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 = ["leads_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 archive" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'leads_id' is set + if self.api_client.client_side_validation and local_var_params.get("leads_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `leads_id` when calling `archive`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "leads_id" in local_var_params: + path_params["leadsId"] = local_var_params["leads_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( + "/crm/v3/objects/leads/{leadsId}", + "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 create(self, simple_public_object_input_for_create, **kwargs): # noqa: E501 + """Create # noqa: E501 + + Create a lead with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard leads is provided. # 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(simple_public_object_input_for_create, async_req=True) + >>> result = thread.get() + + :param simple_public_object_input_for_create: (required) + :type simple_public_object_input_for_create: SimplePublicObjectInputForCreate + :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: SimplePublicObject + """ + kwargs["_return_http_data_only"] = True + return self.create_with_http_info(simple_public_object_input_for_create, **kwargs) # noqa: E501 + + def create_with_http_info(self, simple_public_object_input_for_create, **kwargs): # noqa: E501 + """Create # noqa: E501 + + Create a lead with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard leads is provided. # 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(simple_public_object_input_for_create, async_req=True) + >>> result = thread.get() + + :param simple_public_object_input_for_create: (required) + :type simple_public_object_input_for_create: SimplePublicObjectInputForCreate + :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(SimplePublicObject, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["simple_public_object_input_for_create"] + 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) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'simple_public_object_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("simple_public_object_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `simple_public_object_input_for_create` when calling `create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "simple_public_object_input_for_create" in local_var_params: + body_params = local_var_params["simple_public_object_input_for_create"] + # 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: "SimplePublicObject", + } + + return self.api_client.call_api( + "/crm/v3/objects/leads", + "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_by_id(self, leads_id, **kwargs): # noqa: E501 + """Read # noqa: E501 + + Read an Object identified by `{leadsId}`. `{leadsId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param. # 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_by_id(leads_id, async_req=True) + >>> result = thread.get() + + :param leads_id: (required) + :type leads_id: str + :param properties: A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. + :type properties: list[str] + :param properties_with_history: A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. + :type properties_with_history: list[str] + :param associations: A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. + :type associations: list[str] + :param archived: Whether to return only results that have been archived. + :type archived: bool + :param id_property: The name of a property whose values are unique for this object + :type id_property: 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: SimplePublicObjectWithAssociations + """ + kwargs["_return_http_data_only"] = True + return self.get_by_id_with_http_info(leads_id, **kwargs) # noqa: E501 + + def get_by_id_with_http_info(self, leads_id, **kwargs): # noqa: E501 + """Read # noqa: E501 + + Read an Object identified by `{leadsId}`. `{leadsId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param. # 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_by_id_with_http_info(leads_id, async_req=True) + >>> result = thread.get() + + :param leads_id: (required) + :type leads_id: str + :param properties: A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. + :type properties: list[str] + :param properties_with_history: A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. + :type properties_with_history: list[str] + :param associations: A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. + :type associations: list[str] + :param archived: Whether to return only results that have been archived. + :type archived: bool + :param id_property: The name of a property whose values are unique for this object + :type id_property: 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(SimplePublicObjectWithAssociations, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["leads_id", "properties", "properties_with_history", "associations", "archived", "id_property"] + 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_by_id" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'leads_id' is set + if self.api_client.client_side_validation and local_var_params.get("leads_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `leads_id` when calling `get_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "leads_id" in local_var_params: + path_params["leadsId"] = local_var_params["leads_id"] # noqa: E501 + + query_params = [] + if local_var_params.get("properties") is not None: # noqa: E501 + query_params.append(("properties", local_var_params["properties"])) # noqa: E501 + collection_formats["properties"] = "multi" # noqa: E501 + if local_var_params.get("properties_with_history") is not None: # noqa: E501 + query_params.append(("propertiesWithHistory", local_var_params["properties_with_history"])) # noqa: E501 + collection_formats["propertiesWithHistory"] = "multi" # noqa: E501 + if local_var_params.get("associations") is not None: # noqa: E501 + query_params.append(("associations", local_var_params["associations"])) # noqa: E501 + collection_formats["associations"] = "multi" # noqa: E501 + if local_var_params.get("archived") is not None: # noqa: E501 + query_params.append(("archived", local_var_params["archived"])) # noqa: E501 + if local_var_params.get("id_property") is not None: # noqa: E501 + query_params.append(("idProperty", local_var_params["id_property"])) # noqa: E501 + + 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: "SimplePublicObjectWithAssociations", + } + + return self.api_client.call_api( + "/crm/v3/objects/leads/{leadsId}", + "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_page(self, **kwargs): # noqa: E501 + """List # noqa: E501 + + Read a page of leads. Control what is returned via the `properties` query param. # 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_page(async_req=True) + >>> result = thread.get() + + :param limit: The maximum number of results to display per page. + :type limit: int + :param after: The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. + :type after: str + :param properties: A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. + :type properties: list[str] + :param properties_with_history: A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. + :type properties_with_history: list[str] + :param associations: A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. + :type associations: list[str] + :param archived: Whether to return only results that have been archived. + :type archived: bool + :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: CollectionResponseSimplePublicObjectWithAssociationsForwardPaging + """ + kwargs["_return_http_data_only"] = True + return self.get_page_with_http_info(**kwargs) # noqa: E501 + + def get_page_with_http_info(self, **kwargs): # noqa: E501 + """List # noqa: E501 + + Read a page of leads. Control what is returned via the `properties` query param. # 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_page_with_http_info(async_req=True) + >>> result = thread.get() + + :param limit: The maximum number of results to display per page. + :type limit: int + :param after: The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. + :type after: str + :param properties: A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. + :type properties: list[str] + :param properties_with_history: A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. + :type properties_with_history: list[str] + :param associations: A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. + :type associations: list[str] + :param archived: Whether to return only results that have been archived. + :type archived: bool + :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(CollectionResponseSimplePublicObjectWithAssociationsForwardPaging, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["limit", "after", "properties", "properties_with_history", "associations", "archived"] + 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_page" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get("limit") is not None: # noqa: E501 + query_params.append(("limit", local_var_params["limit"])) # noqa: E501 + if local_var_params.get("after") is not None: # noqa: E501 + query_params.append(("after", local_var_params["after"])) # noqa: E501 + if local_var_params.get("properties") is not None: # noqa: E501 + query_params.append(("properties", local_var_params["properties"])) # noqa: E501 + collection_formats["properties"] = "multi" # noqa: E501 + if local_var_params.get("properties_with_history") is not None: # noqa: E501 + query_params.append(("propertiesWithHistory", local_var_params["properties_with_history"])) # noqa: E501 + collection_formats["propertiesWithHistory"] = "multi" # noqa: E501 + if local_var_params.get("associations") is not None: # noqa: E501 + query_params.append(("associations", local_var_params["associations"])) # noqa: E501 + collection_formats["associations"] = "multi" # noqa: E501 + if local_var_params.get("archived") is not None: # noqa: E501 + query_params.append(("archived", local_var_params["archived"])) # noqa: E501 + + 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: "CollectionResponseSimplePublicObjectWithAssociationsForwardPaging", + } + + return self.api_client.call_api( + "/crm/v3/objects/leads", + "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 update(self, leads_id, simple_public_object_input, **kwargs): # noqa: E501 + """Update # noqa: E501 + + Perform a partial update of an Object identified by `{leadsId}`or optionally a unique property value as specified by the `idProperty` query param. `{leadsId}` refers to the internal object ID by default, and the `idProperty` query param refers to a property whose values are unique for the object. Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update(leads_id, simple_public_object_input, async_req=True) + >>> result = thread.get() + + :param leads_id: (required) + :type leads_id: str + :param simple_public_object_input: (required) + :type simple_public_object_input: SimplePublicObjectInput + :param id_property: The name of a property whose values are unique for this object + :type id_property: 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: SimplePublicObject + """ + kwargs["_return_http_data_only"] = True + return self.update_with_http_info(leads_id, simple_public_object_input, **kwargs) # noqa: E501 + + def update_with_http_info(self, leads_id, simple_public_object_input, **kwargs): # noqa: E501 + """Update # noqa: E501 + + Perform a partial update of an Object identified by `{leadsId}`or optionally a unique property value as specified by the `idProperty` query param. `{leadsId}` refers to the internal object ID by default, and the `idProperty` query param refers to a property whose values are unique for the object. Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_with_http_info(leads_id, simple_public_object_input, async_req=True) + >>> result = thread.get() + + :param leads_id: (required) + :type leads_id: str + :param simple_public_object_input: (required) + :type simple_public_object_input: SimplePublicObjectInput + :param id_property: The name of a property whose values are unique for this object + :type id_property: 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(SimplePublicObject, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["leads_id", "simple_public_object_input", "id_property"] + 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 update" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'leads_id' is set + if self.api_client.client_side_validation and local_var_params.get("leads_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `leads_id` when calling `update`") # noqa: E501 + # verify the required parameter 'simple_public_object_input' is set + if self.api_client.client_side_validation and local_var_params.get("simple_public_object_input") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `simple_public_object_input` when calling `update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "leads_id" in local_var_params: + path_params["leadsId"] = local_var_params["leads_id"] # noqa: E501 + + query_params = [] + if local_var_params.get("id_property") is not None: # noqa: E501 + query_params.append(("idProperty", local_var_params["id_property"])) # noqa: E501 + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "simple_public_object_input" in local_var_params: + body_params = local_var_params["simple_public_object_input"] + # 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"], "PATCH", 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: "SimplePublicObject", + } + + return self.api_client.call_api( + "/crm/v3/objects/leads/{leadsId}", + "PATCH", + 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/objects/leads/api/batch_api.py b/hubspot/crm/objects/leads/api/batch_api.py new file mode 100644 index 00000000..40035273 --- /dev/null +++ b/hubspot/crm/objects/leads/api/batch_api.py @@ -0,0 +1,674 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.api_client import ApiClient +from hubspot.crm.objects.leads.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class BatchApi(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 archive(self, batch_input_simple_public_object_id, **kwargs): # noqa: E501 + """Archive a batch of leads by 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.archive(batch_input_simple_public_object_id, async_req=True) + >>> result = thread.get() + + :param batch_input_simple_public_object_id: (required) + :type batch_input_simple_public_object_id: BatchInputSimplePublicObjectId + :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.archive_with_http_info(batch_input_simple_public_object_id, **kwargs) # noqa: E501 + + def archive_with_http_info(self, batch_input_simple_public_object_id, **kwargs): # noqa: E501 + """Archive a batch of leads by 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.archive_with_http_info(batch_input_simple_public_object_id, async_req=True) + >>> result = thread.get() + + :param batch_input_simple_public_object_id: (required) + :type batch_input_simple_public_object_id: BatchInputSimplePublicObjectId + :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 = ["batch_input_simple_public_object_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 archive" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'batch_input_simple_public_object_id' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_id` when calling `archive`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "batch_input_simple_public_object_id" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_id"] + # 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/v3/objects/leads/batch/archive", + "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 create(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + """Create a batch of leads # 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(batch_input_simple_public_object_input_for_create, async_req=True) + >>> result = thread.get() + + :param batch_input_simple_public_object_input_for_create: (required) + :type batch_input_simple_public_object_input_for_create: BatchInputSimplePublicObjectInputForCreate + :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: BatchResponseSimplePublicObject + """ + kwargs["_return_http_data_only"] = True + return self.create_with_http_info(batch_input_simple_public_object_input_for_create, **kwargs) # noqa: E501 + + def create_with_http_info(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + """Create a batch of leads # 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(batch_input_simple_public_object_input_for_create, async_req=True) + >>> result = thread.get() + + :param batch_input_simple_public_object_input_for_create: (required) + :type batch_input_simple_public_object_input_for_create: BatchInputSimplePublicObjectInputForCreate + :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(BatchResponseSimplePublicObject, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["batch_input_simple_public_object_input_for_create"] + 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) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'batch_input_simple_public_object_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_input_for_create` when calling `create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "batch_input_simple_public_object_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_input_for_create"] + # 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: "BatchResponseSimplePublicObject", + 207: "BatchResponseSimplePublicObjectWithErrors", + } + + return self.api_client.call_api( + "/crm/v3/objects/leads/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 read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 + """Read a batch of leads by internal ID, or unique property values # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read(batch_read_input_simple_public_object_id, async_req=True) + >>> result = thread.get() + + :param batch_read_input_simple_public_object_id: (required) + :type batch_read_input_simple_public_object_id: BatchReadInputSimplePublicObjectId + :param archived: Whether to return only results that have been archived. + :type archived: bool + :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: BatchResponseSimplePublicObject + """ + kwargs["_return_http_data_only"] = True + return self.read_with_http_info(batch_read_input_simple_public_object_id, **kwargs) # noqa: E501 + + def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 + """Read a batch of leads by internal ID, or unique property values # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_with_http_info(batch_read_input_simple_public_object_id, async_req=True) + >>> result = thread.get() + + :param batch_read_input_simple_public_object_id: (required) + :type batch_read_input_simple_public_object_id: BatchReadInputSimplePublicObjectId + :param archived: Whether to return only results that have been archived. + :type archived: bool + :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(BatchResponseSimplePublicObject, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["batch_read_input_simple_public_object_id", "archived"] + 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 read" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'batch_read_input_simple_public_object_id' is set + if self.api_client.client_side_validation and local_var_params.get("batch_read_input_simple_public_object_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_read_input_simple_public_object_id` when calling `read`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get("archived") is not None: # noqa: E501 + query_params.append(("archived", local_var_params["archived"])) # noqa: E501 + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "batch_read_input_simple_public_object_id" in local_var_params: + body_params = local_var_params["batch_read_input_simple_public_object_id"] + # 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: "BatchResponseSimplePublicObject", + 207: "BatchResponseSimplePublicObjectWithErrors", + } + + return self.api_client.call_api( + "/crm/v3/objects/leads/batch/read", + "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 update(self, batch_input_simple_public_object_batch_input, **kwargs): # noqa: E501 + """Update a batch of leads by internal ID, or unique property values # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update(batch_input_simple_public_object_batch_input, async_req=True) + >>> result = thread.get() + + :param batch_input_simple_public_object_batch_input: (required) + :type batch_input_simple_public_object_batch_input: BatchInputSimplePublicObjectBatchInput + :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: BatchResponseSimplePublicObject + """ + kwargs["_return_http_data_only"] = True + return self.update_with_http_info(batch_input_simple_public_object_batch_input, **kwargs) # noqa: E501 + + def update_with_http_info(self, batch_input_simple_public_object_batch_input, **kwargs): # noqa: E501 + """Update a batch of leads by internal ID, or unique property values # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_with_http_info(batch_input_simple_public_object_batch_input, async_req=True) + >>> result = thread.get() + + :param batch_input_simple_public_object_batch_input: (required) + :type batch_input_simple_public_object_batch_input: BatchInputSimplePublicObjectBatchInput + :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(BatchResponseSimplePublicObject, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["batch_input_simple_public_object_batch_input"] + 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 update" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'batch_input_simple_public_object_batch_input' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input` when calling `update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "batch_input_simple_public_object_batch_input" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input"] + # 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: "BatchResponseSimplePublicObject", + 207: "BatchResponseSimplePublicObjectWithErrors", + } + + return self.api_client.call_api( + "/crm/v3/objects/leads/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 upsert(self, batch_input_simple_public_object_batch_input_upsert, **kwargs): # noqa: E501 + """Create or update a batch of leads by unique property values # noqa: E501 + + Create or update records identified by `{leadsId}` or optionally a unique property value as specified by the `idProperty` query param. `{leadsId}` refers to the internal object ID by default, and the `idProperty` query param refers to a property whose values are unique for the object. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upsert(batch_input_simple_public_object_batch_input_upsert, async_req=True) + >>> result = thread.get() + + :param batch_input_simple_public_object_batch_input_upsert: (required) + :type batch_input_simple_public_object_batch_input_upsert: BatchInputSimplePublicObjectBatchInputUpsert + :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: BatchResponseSimplePublicUpsertObject + """ + kwargs["_return_http_data_only"] = True + return self.upsert_with_http_info(batch_input_simple_public_object_batch_input_upsert, **kwargs) # noqa: E501 + + def upsert_with_http_info(self, batch_input_simple_public_object_batch_input_upsert, **kwargs): # noqa: E501 + """Create or update a batch of leads by unique property values # noqa: E501 + + Create or update records identified by `{leadsId}` or optionally a unique property value as specified by the `idProperty` query param. `{leadsId}` refers to the internal object ID by default, and the `idProperty` query param refers to a property whose values are unique for the object. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upsert_with_http_info(batch_input_simple_public_object_batch_input_upsert, async_req=True) + >>> result = thread.get() + + :param batch_input_simple_public_object_batch_input_upsert: (required) + :type batch_input_simple_public_object_batch_input_upsert: BatchInputSimplePublicObjectBatchInputUpsert + :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(BatchResponseSimplePublicUpsertObject, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["batch_input_simple_public_object_batch_input_upsert"] + 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 upsert" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'batch_input_simple_public_object_batch_input_upsert' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_upsert") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_upsert` when calling `upsert`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "batch_input_simple_public_object_batch_input_upsert" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_upsert"] + # 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: "BatchResponseSimplePublicUpsertObject", + 207: "BatchResponseSimplePublicUpsertObjectWithErrors", + } + + return self.api_client.call_api( + "/crm/v3/objects/leads/batch/upsert", + "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/objects/leads/api/search_api.py b/hubspot/crm/objects/leads/api/search_api.py new file mode 100644 index 00000000..b3e0589f --- /dev/null +++ b/hubspot/crm/objects/leads/api/search_api.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.api_client import ApiClient +from hubspot.crm.objects.leads.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class SearchApi(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 do_search(self, public_object_search_request, **kwargs): # noqa: E501 + """do_search # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.do_search(public_object_search_request, async_req=True) + >>> result = thread.get() + + :param public_object_search_request: (required) + :type public_object_search_request: PublicObjectSearchRequest + :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: CollectionResponseWithTotalSimplePublicObjectForwardPaging + """ + kwargs["_return_http_data_only"] = True + return self.do_search_with_http_info(public_object_search_request, **kwargs) # noqa: E501 + + def do_search_with_http_info(self, public_object_search_request, **kwargs): # noqa: E501 + """do_search # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.do_search_with_http_info(public_object_search_request, async_req=True) + >>> result = thread.get() + + :param public_object_search_request: (required) + :type public_object_search_request: PublicObjectSearchRequest + :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(CollectionResponseWithTotalSimplePublicObjectForwardPaging, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["public_object_search_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 do_search" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'public_object_search_request' is set + if self.api_client.client_side_validation and local_var_params.get("public_object_search_request") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `public_object_search_request` when calling `do_search`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "public_object_search_request" in local_var_params: + body_params = local_var_params["public_object_search_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: "CollectionResponseWithTotalSimplePublicObjectForwardPaging", + } + + return self.api_client.call_api( + "/crm/v3/objects/leads/search", + "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/objects/leads/api_client.py b/hubspot/crm/objects/leads/api_client.py new file mode 100644 index 00000000..c31988c3 --- /dev/null +++ b/hubspot/crm/objects/leads/api_client.py @@ -0,0 +1,664 @@ +# coding: utf-8 +""" + Leads + + 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 atexit +import datetime +from dateutil.parser import parse +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from hubspot.crm.objects.leads.configuration import Configuration +import hubspot.crm.objects.leads.models +from hubspot.crm.objects.leads import rest +from hubspot.crm.objects.leads.exceptions import ApiValueError, ApiException + + +class ApiClient(object): + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + "int": int, + "long": int if six.PY3 else long, # noqa: F821 + "float": float, + "str": str, + "bool": bool, + "date": datetime.date, + "datetime": datetime.datetime, + "object": object, + } + _pool = None + + def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1): + if configuration is None: + configuration = Configuration.get_default_copy() + self.configuration = configuration + self.pool_threads = pool_threads + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = "OpenAPI-Generator/1.0.0/python" + self.client_side_validation = configuration.client_side_validation + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + if hasattr(atexit, "unregister"): + atexit.unregister(self.close) + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + atexit.register(self.close) + self._pool = ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers["User-Agent"] + + @user_agent.setter + def user_agent(self, value): + self.default_headers["User-Agent"] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, + resource_path, + method, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + response_types_map=None, + auth_settings=None, + _return_http_data_only=None, + collection_formats=None, + _preload_content=True, + _request_timeout=None, + _host=None, + _request_auth=None, + ): + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params["Cookie"] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace("{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param)) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, collection_formats) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, collection_formats) + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings, request_auth=_request_auth) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + try: + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, post_params=post_params, body=body, _preload_content=_preload_content, _request_timeout=_request_timeout + ) + except ApiException as e: + e.body = e.body.decode("utf-8") if six.PY3 else e.body + raise e + + self.last_response = response_data + + return_data = response_data + + if not _preload_content: + return return_data + + response_type = response_types_map.get(response_data.status, None) + + if six.PY3 and response_type not in ["file", "bytes"]: + match = None + content_type = response_data.getheader("content-type") + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_data.data = response_data.data.decode(encoding) + + # deserialize response data + + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return return_data + else: + return (return_data, response_data.status, response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) for attr, _ in six.iteritems(obj.openapi_types) if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith("list["): + sub_kls = re.match(r"list\[(.*)\]", klass).group(1) + return [self.__deserialize(sub_data, sub_kls) for sub_data in data] + + if klass.startswith("dict["): + sub_kls = re.match(r"dict\[([^,]*), (.*)\]", klass).group(2) + return {k: self.__deserialize(v, sub_kls) for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(hubspot.crm.objects.leads.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api( + self, + resource_path, + method, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + response_types_map=None, + auth_settings=None, + async_req=None, + _return_http_data_only=None, + collection_formats=None, + _preload_content=True, + _request_timeout=None, + _host=None, + _request_auth=None, + ): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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_token: dict, optional + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api( + resource_path, + method, + path_params, + query_params, + header_params, + body, + post_params, + files, + response_types_map, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, + _request_auth, + ) + + return self.pool.apply_async( + self.__call_api, + ( + resource_path, + method, + path_params, + query_params, + header_params, + body, + post_params, + files, + response_types_map, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, + _request_auth, + ), + ) + + def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, query_params=query_params, _preload_content=_preload_content, _request_timeout=_request_timeout, headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, query_params=query_params, _preload_content=_preload_content, _request_timeout=_request_timeout, headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, query_params=query_params, headers=headers, _preload_content=_preload_content, _request_timeout=_request_timeout) + elif method == "POST": + return self.rest_client.POST(url, query_params=query_params, headers=headers, post_params=post_params, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) + elif method == "PUT": + return self.rest_client.PUT(url, query_params=query_params, headers=headers, post_params=post_params, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, query_params=query_params, headers=headers, post_params=post_params, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, query_params=query_params, headers=headers, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) + else: + raise ApiValueError("http method must be `GET`, `HEAD`, `OPTIONS`," " `POST`, `PATCH`, `PUT` or `DELETE`.") + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == "multi": + new_params.extend((k, value) for value in v) + else: + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" + else: # csv is the default + delimiter = "," + new_params.append((k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def files_parameters(self, files=None): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, "rb") as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" + params.append(tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if "application/json" in accepts: + return "application/json" + else: + return ", ".join(accepts) + + def select_header_content_type(self, content_types, method=None, body=None): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + content_types = [x.lower() for x in content_types] + + if method == "PATCH" and "application/json-patch+json" in content_types and isinstance(body, list): + return "application/json-patch+json" + + if "application/json" in content_types or "*/*" in content_types: + return "application/json" + else: + return content_types[0] + + def update_params_for_auth(self, headers, queries, auth_settings, request_auth=None): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params(headers, queries, request_auth) + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params(headers, queries, auth_setting) + + def _apply_auth_params(self, headers, queries, auth_setting): + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_setting: auth settings for the endpoint + """ + if auth_setting["in"] == "cookie": + headers["Cookie"] = auth_setting["value"] + elif auth_setting["in"] == "header": + headers[auth_setting["key"]] = auth_setting["value"] + elif auth_setting["in"] == "query": + queries.append((auth_setting["key"], auth_setting["value"])) + else: + raise ApiValueError("Authentication token must be in `query` or `header`") + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException(status=0, reason="Failed to parse `{0}` as date object".format(string)) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException(status=0, reason=("Failed to parse `{0}` as datetime object".format(string))) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + has_discriminator = False + if hasattr(klass, "get_real_child_model") and klass.discriminator_value_class_map: + has_discriminator = True + + if not klass.openapi_types and has_discriminator is False: + return data + + kwargs = {} + if data is not None and klass.openapi_types is not None and isinstance(data, (list, dict)): + for attr, attr_type in six.iteritems(klass.openapi_types): + if klass.attribute_map[attr] in data: + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + kwargs["local_vars_configuration"] = self.configuration + instance = klass(**kwargs) + + if has_discriminator: + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/hubspot/crm/objects/leads/configuration.py b/hubspot/crm/objects/leads/configuration.py new file mode 100644 index 00000000..f09d3e98 --- /dev/null +++ b/hubspot/crm/objects/leads/configuration.py @@ -0,0 +1,439 @@ +# coding: utf-8 + +""" + Leads + + 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 copy +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib +from hubspot.crm.objects.leads.exceptions import ApiValueError + + +JSON_SCHEMA_VALIDATION_KEYWORDS = {"multipleOf", "maximum", "exclusiveMaximum", "minimum", "exclusiveMinimum", "maxLength", "minLength", "pattern", "maxItems", "minItems"} + + +class Configuration(object): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + :param discard_unknown_keys: Boolean value indicating whether to discard + unknown properties. A server may send a response that includes additional + properties that are not known by the client in the following scenarios: + 1. The OpenAPI document is incomplete, i.e. it does not match the server + implementation. + 2. The client was generated using an older version of the OpenAPI document + and the server has been upgraded since then. + If a schema in the OpenAPI document defines the additionalProperties attribute, + then all undeclared properties received by the server are injected into the + additional properties map. In that case, there are undeclared properties, and + nothing to discard. + :param disabled_client_side_validations (string): Comma-separated list of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_client_side_validations is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format + + :Example: + """ + + _default = None + + def __init__( + self, + host=None, + api_key=None, + api_key_prefix=None, + username=None, + password=None, + discard_unknown_keys=False, + disabled_client_side_validations="", + server_index=None, + server_variables=None, + server_operation_index=None, + server_operation_variables=None, + ssl_ca_cert=None, + ): + """Constructor""" + self._base_path = "https://api.hubapi.com" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.discard_unknown_keys = discard_unknown_keys + self.disabled_client_side_validations = disabled_client_side_validations + self.access_token = None + """access token for OAuth/Bearer + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("hubspot.crm.objects.leads") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = "%(asctime)s %(levelname)s %(message)s" + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = "" + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = False + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ("logger", "logger_file_handler"): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + if name == "disabled_client_side_validations": + s = set(filter(None, value.split(","))) + for v in s: + if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: + raise ApiValueError("Invalid keyword: '{0}''".format(v)) + self._disabled_client_side_validations = s + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = copy.deepcopy(default) + + @classmethod + def get_default_copy(cls): + """Return new instance of configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration passed by the set_default method. + + :return: The configuration object. + """ + if cls._default is not None: + return copy.deepcopy(cls._default) + return Configuration() + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers(basic_auth=username + ":" + password).get("authorization") + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if self.access_token is not None: + auth["oauth2"] = {"type": "oauth2", "in": "header", "key": "Authorization", "value": "Bearer " + self.access_token} + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n" "OS: {env}\n" "Python Version: {pyversion}\n" "Version of the API: v3\n" "SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + "url": "https://api.hubapi.com", + "description": "No description provided", + } + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError("Invalid index {0} when selecting the host settings. " "Must be less than {1}".format(index, len(servers))) + + url = server["url"] + + # go through variables and replace placeholders + for variable_name, variable in server.get("variables", {}).items(): + used_value = variables.get(variable_name, variable["default_value"]) + + if "enum_values" in variable and used_value not in variable["enum_values"]: + raise ValueError("The variable `{0}` in the host URL has invalid value " "{1}. Must be {2}.".format(variable_name, variables[variable_name], variable["enum_values"])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/hubspot/crm/objects/leads/exceptions.py b/hubspot/crm/objects/leads/exceptions.py new file mode 100644 index 00000000..a6bda681 --- /dev/null +++ b/hubspot/crm/objects/leads/exceptions.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Leads + + 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 +""" + + +import six + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None): + """Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None): + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format(self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +class NotFoundException(ApiException): + def __init__(self, status=None, reason=None, http_resp=None): + super(NotFoundException, self).__init__(status, reason, http_resp) + + +class UnauthorizedException(ApiException): + def __init__(self, status=None, reason=None, http_resp=None): + super(UnauthorizedException, self).__init__(status, reason, http_resp) + + +class ForbiddenException(ApiException): + def __init__(self, status=None, reason=None, http_resp=None): + super(ForbiddenException, self).__init__(status, reason, http_resp) + + +class ServiceException(ApiException): + def __init__(self, status=None, reason=None, http_resp=None): + super(ServiceException, self).__init__(status, reason, http_resp) + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, six.integer_types): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/hubspot/crm/objects/leads/models/__init__.py b/hubspot/crm/objects/leads/models/__init__.py new file mode 100644 index 00000000..0f9f5281 --- /dev/null +++ b/hubspot/crm/objects/leads/models/__init__.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +# flake8: noqa +""" + Leads + + 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 models into model package +from hubspot.crm.objects.leads.models.associated_id import AssociatedId +from hubspot.crm.objects.leads.models.association_spec import AssociationSpec +from hubspot.crm.objects.leads.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.leads.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert +from hubspot.crm.objects.leads.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId +from hubspot.crm.objects.leads.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate +from hubspot.crm.objects.leads.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId +from hubspot.crm.objects.leads.models.batch_response_simple_public_object import BatchResponseSimplePublicObject +from hubspot.crm.objects.leads.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors +from hubspot.crm.objects.leads.models.batch_response_simple_public_upsert_object import BatchResponseSimplePublicUpsertObject +from hubspot.crm.objects.leads.models.batch_response_simple_public_upsert_object_with_errors import BatchResponseSimplePublicUpsertObjectWithErrors +from hubspot.crm.objects.leads.models.collection_response_associated_id import CollectionResponseAssociatedId +from hubspot.crm.objects.leads.models.collection_response_simple_public_object_with_associations_forward_paging import CollectionResponseSimplePublicObjectWithAssociationsForwardPaging +from hubspot.crm.objects.leads.models.collection_response_with_total_simple_public_object_forward_paging import CollectionResponseWithTotalSimplePublicObjectForwardPaging +from hubspot.crm.objects.leads.models.error import Error +from hubspot.crm.objects.leads.models.error_detail import ErrorDetail +from hubspot.crm.objects.leads.models.filter import Filter +from hubspot.crm.objects.leads.models.filter_group import FilterGroup +from hubspot.crm.objects.leads.models.forward_paging import ForwardPaging +from hubspot.crm.objects.leads.models.next_page import NextPage +from hubspot.crm.objects.leads.models.paging import Paging +from hubspot.crm.objects.leads.models.previous_page import PreviousPage +from hubspot.crm.objects.leads.models.public_associations_for_object import PublicAssociationsForObject +from hubspot.crm.objects.leads.models.public_object_id import PublicObjectId +from hubspot.crm.objects.leads.models.public_object_search_request import PublicObjectSearchRequest +from hubspot.crm.objects.leads.models.simple_public_object import SimplePublicObject +from hubspot.crm.objects.leads.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.leads.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert +from hubspot.crm.objects.leads.models.simple_public_object_id import SimplePublicObjectId +from hubspot.crm.objects.leads.models.simple_public_object_input import SimplePublicObjectInput +from hubspot.crm.objects.leads.models.simple_public_object_input_for_create import SimplePublicObjectInputForCreate +from hubspot.crm.objects.leads.models.simple_public_object_with_associations import SimplePublicObjectWithAssociations +from hubspot.crm.objects.leads.models.simple_public_upsert_object import SimplePublicUpsertObject +from hubspot.crm.objects.leads.models.standard_error import StandardError +from hubspot.crm.objects.leads.models.value_with_timestamp import ValueWithTimestamp diff --git a/hubspot/crm/objects/leads/models/associated_id.py b/hubspot/crm/objects/leads/models/associated_id.py new file mode 100644 index 00000000..3c6f349f --- /dev/null +++ b/hubspot/crm/objects/leads/models/associated_id.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class AssociatedId(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 = {"id": "str", "type": "str"} + + attribute_map = {"id": "id", "type": "type"} + + def __init__(self, id=None, type=None, local_vars_configuration=None): # noqa: E501 + """AssociatedId - 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._id = None + self._type = None + self.discriminator = None + + self.id = id + self.type = type + + @property + def id(self): + """Gets the id of this AssociatedId. # noqa: E501 + + + :return: The id of this AssociatedId. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AssociatedId. + + + :param id: The id of this AssociatedId. # noqa: E501 + :type id: str + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def type(self): + """Gets the type of this AssociatedId. # noqa: E501 + + + :return: The type of this AssociatedId. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this AssociatedId. + + + :param type: The type of this AssociatedId. # noqa: E501 + :type type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + 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, AssociatedId): + 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, AssociatedId): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/association_spec.py b/hubspot/crm/objects/leads/models/association_spec.py new file mode 100644 index 00000000..c6c11d67 --- /dev/null +++ b/hubspot/crm/objects/leads/models/association_spec.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class AssociationSpec(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 = {"association_category": "str", "association_type_id": "int"} + + attribute_map = {"association_category": "associationCategory", "association_type_id": "associationTypeId"} + + def __init__(self, association_category=None, association_type_id=None, local_vars_configuration=None): # noqa: E501 + """AssociationSpec - 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._association_category = None + self._association_type_id = None + self.discriminator = None + + self.association_category = association_category + self.association_type_id = association_type_id + + @property + def association_category(self): + """Gets the association_category of this AssociationSpec. # noqa: E501 + + + :return: The association_category of this AssociationSpec. # noqa: E501 + :rtype: str + """ + return self._association_category + + @association_category.setter + def association_category(self, association_category): + """Sets the association_category of this AssociationSpec. + + + :param association_category: The association_category of this AssociationSpec. # noqa: E501 + :type association_category: str + """ + if self.local_vars_configuration.client_side_validation and association_category is None: # noqa: E501 + raise ValueError("Invalid value for `association_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 association_category not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `association_category` ({0}), must be one of {1}".format(association_category, allowed_values)) # noqa: E501 + + self._association_category = association_category + + @property + def association_type_id(self): + """Gets the association_type_id of this AssociationSpec. # noqa: E501 + + + :return: The association_type_id of this AssociationSpec. # noqa: E501 + :rtype: int + """ + return self._association_type_id + + @association_type_id.setter + def association_type_id(self, association_type_id): + """Sets the association_type_id of this AssociationSpec. + + + :param association_type_id: The association_type_id of this AssociationSpec. # noqa: E501 + :type association_type_id: int + """ + if self.local_vars_configuration.client_side_validation and association_type_id is None: # noqa: E501 + raise ValueError("Invalid value for `association_type_id`, must not be `None`") # noqa: E501 + + self._association_type_id = association_type_id + + 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, AssociationSpec): + 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, AssociationSpec): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/batch_input_simple_public_object_batch_input.py b/hubspot/crm/objects/leads/models/batch_input_simple_public_object_batch_input.py new file mode 100644 index 00000000..df0bb708 --- /dev/null +++ b/hubspot/crm/objects/leads/models/batch_input_simple_public_object_batch_input.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class BatchInputSimplePublicObjectBatchInput(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[SimplePublicObjectBatchInput]"} + + attribute_map = {"inputs": "inputs"} + + def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 + """BatchInputSimplePublicObjectBatchInput - 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 BatchInputSimplePublicObjectBatchInput. # noqa: E501 + + + :return: The inputs of this BatchInputSimplePublicObjectBatchInput. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInput] + """ + return self._inputs + + @inputs.setter + def inputs(self, inputs): + """Sets the inputs of this BatchInputSimplePublicObjectBatchInput. + + + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInput. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInput] + """ + 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, BatchInputSimplePublicObjectBatchInput): + 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, BatchInputSimplePublicObjectBatchInput): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/batch_input_simple_public_object_batch_input_upsert.py b/hubspot/crm/objects/leads/models/batch_input_simple_public_object_batch_input_upsert.py new file mode 100644 index 00000000..69f77306 --- /dev/null +++ b/hubspot/crm/objects/leads/models/batch_input_simple_public_object_batch_input_upsert.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class BatchInputSimplePublicObjectBatchInputUpsert(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[SimplePublicObjectBatchInputUpsert]"} + + attribute_map = {"inputs": "inputs"} + + def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 + """BatchInputSimplePublicObjectBatchInputUpsert - 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 BatchInputSimplePublicObjectBatchInputUpsert. # noqa: E501 + + + :return: The inputs of this BatchInputSimplePublicObjectBatchInputUpsert. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputUpsert] + """ + return self._inputs + + @inputs.setter + def inputs(self, inputs): + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputUpsert. + + + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputUpsert. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputUpsert] + """ + 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, BatchInputSimplePublicObjectBatchInputUpsert): + 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, BatchInputSimplePublicObjectBatchInputUpsert): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/batch_input_simple_public_object_id.py b/hubspot/crm/objects/leads/models/batch_input_simple_public_object_id.py new file mode 100644 index 00000000..95271fb5 --- /dev/null +++ b/hubspot/crm/objects/leads/models/batch_input_simple_public_object_id.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class BatchInputSimplePublicObjectId(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[SimplePublicObjectId]"} + + attribute_map = {"inputs": "inputs"} + + def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 + """BatchInputSimplePublicObjectId - 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 BatchInputSimplePublicObjectId. # noqa: E501 + + + :return: The inputs of this BatchInputSimplePublicObjectId. # noqa: E501 + :rtype: list[SimplePublicObjectId] + """ + return self._inputs + + @inputs.setter + def inputs(self, inputs): + """Sets the inputs of this BatchInputSimplePublicObjectId. + + + :param inputs: The inputs of this BatchInputSimplePublicObjectId. # noqa: E501 + :type inputs: list[SimplePublicObjectId] + """ + 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, BatchInputSimplePublicObjectId): + 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, BatchInputSimplePublicObjectId): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/objects/leads/models/batch_input_simple_public_object_input_for_create.py new file mode 100644 index 00000000..588789bb --- /dev/null +++ b/hubspot/crm/objects/leads/models/batch_input_simple_public_object_input_for_create.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class BatchInputSimplePublicObjectInputForCreate(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[SimplePublicObjectInputForCreate]"} + + attribute_map = {"inputs": "inputs"} + + def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 + """BatchInputSimplePublicObjectInputForCreate - 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 BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + + + :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectInputForCreate] + """ + return self._inputs + + @inputs.setter + def inputs(self, inputs): + """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + + + :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectInputForCreate] + """ + 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, BatchInputSimplePublicObjectInputForCreate): + 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, BatchInputSimplePublicObjectInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/objects/leads/models/batch_read_input_simple_public_object_id.py new file mode 100644 index 00000000..f0db907e --- /dev/null +++ b/hubspot/crm/objects/leads/models/batch_read_input_simple_public_object_id.py @@ -0,0 +1,196 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class BatchReadInputSimplePublicObjectId(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 = {"properties_with_history": "list[str]", "id_property": "str", "inputs": "list[SimplePublicObjectId]", "properties": "list[str]"} + + attribute_map = {"properties_with_history": "propertiesWithHistory", "id_property": "idProperty", "inputs": "inputs", "properties": "properties"} + + def __init__(self, properties_with_history=None, id_property=None, inputs=None, properties=None, local_vars_configuration=None): # noqa: E501 + """BatchReadInputSimplePublicObjectId - 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._properties_with_history = None + self._id_property = None + self._inputs = None + self._properties = None + self.discriminator = None + + self.properties_with_history = properties_with_history + if id_property is not None: + self.id_property = id_property + self.inputs = inputs + self.properties = properties + + @property + def properties_with_history(self): + """Gets the properties_with_history of this BatchReadInputSimplePublicObjectId. # noqa: E501 + + + :return: The properties_with_history of this BatchReadInputSimplePublicObjectId. # noqa: E501 + :rtype: list[str] + """ + return self._properties_with_history + + @properties_with_history.setter + def properties_with_history(self, properties_with_history): + """Sets the properties_with_history of this BatchReadInputSimplePublicObjectId. + + + :param properties_with_history: The properties_with_history of this BatchReadInputSimplePublicObjectId. # noqa: E501 + :type properties_with_history: list[str] + """ + if self.local_vars_configuration.client_side_validation and properties_with_history is None: # noqa: E501 + raise ValueError("Invalid value for `properties_with_history`, must not be `None`") # noqa: E501 + + self._properties_with_history = properties_with_history + + @property + def id_property(self): + """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 + + + :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 + :rtype: str + """ + return self._id_property + + @id_property.setter + def id_property(self, id_property): + """Sets the id_property of this BatchReadInputSimplePublicObjectId. + + + :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 + :type id_property: str + """ + + self._id_property = id_property + + @property + def inputs(self): + """Gets the inputs of this BatchReadInputSimplePublicObjectId. # noqa: E501 + + + :return: The inputs of this BatchReadInputSimplePublicObjectId. # noqa: E501 + :rtype: list[SimplePublicObjectId] + """ + return self._inputs + + @inputs.setter + def inputs(self, inputs): + """Sets the inputs of this BatchReadInputSimplePublicObjectId. + + + :param inputs: The inputs of this BatchReadInputSimplePublicObjectId. # noqa: E501 + :type inputs: list[SimplePublicObjectId] + """ + 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 + + @property + def properties(self): + """Gets the properties of this BatchReadInputSimplePublicObjectId. # noqa: E501 + + + :return: The properties of this BatchReadInputSimplePublicObjectId. # noqa: E501 + :rtype: list[str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this BatchReadInputSimplePublicObjectId. + + + :param properties: The properties of this BatchReadInputSimplePublicObjectId. # noqa: E501 + :type properties: list[str] + """ + if self.local_vars_configuration.client_side_validation and properties is None: # noqa: E501 + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 + + self._properties = properties + + 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, BatchReadInputSimplePublicObjectId): + 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, BatchReadInputSimplePublicObjectId): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/batch_response_simple_public_object.py b/hubspot/crm/objects/leads/models/batch_response_simple_public_object.py new file mode 100644 index 00000000..b698f6ba --- /dev/null +++ b/hubspot/crm/objects/leads/models/batch_response_simple_public_object.py @@ -0,0 +1,248 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class BatchResponseSimplePublicObject(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[SimplePublicObject]", "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 + """BatchResponseSimplePublicObject - 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 BatchResponseSimplePublicObject. # noqa: E501 + + + :return: The completed_at of this BatchResponseSimplePublicObject. # noqa: E501 + :rtype: datetime + """ + return self._completed_at + + @completed_at.setter + def completed_at(self, completed_at): + """Sets the completed_at of this BatchResponseSimplePublicObject. + + + :param completed_at: The completed_at of this BatchResponseSimplePublicObject. # 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 BatchResponseSimplePublicObject. # noqa: E501 + + + :return: The requested_at of this BatchResponseSimplePublicObject. # noqa: E501 + :rtype: datetime + """ + return self._requested_at + + @requested_at.setter + def requested_at(self, requested_at): + """Sets the requested_at of this BatchResponseSimplePublicObject. + + + :param requested_at: The requested_at of this BatchResponseSimplePublicObject. # noqa: E501 + :type requested_at: datetime + """ + + self._requested_at = requested_at + + @property + def started_at(self): + """Gets the started_at of this BatchResponseSimplePublicObject. # noqa: E501 + + + :return: The started_at of this BatchResponseSimplePublicObject. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this BatchResponseSimplePublicObject. + + + :param started_at: The started_at of this BatchResponseSimplePublicObject. # 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 BatchResponseSimplePublicObject. # noqa: E501 + + + :return: The links of this BatchResponseSimplePublicObject. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this BatchResponseSimplePublicObject. + + + :param links: The links of this BatchResponseSimplePublicObject. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def results(self): + """Gets the results of this BatchResponseSimplePublicObject. # noqa: E501 + + + :return: The results of this BatchResponseSimplePublicObject. # noqa: E501 + :rtype: list[SimplePublicObject] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this BatchResponseSimplePublicObject. + + + :param results: The results of this BatchResponseSimplePublicObject. # noqa: E501 + :type results: list[SimplePublicObject] + """ + 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 BatchResponseSimplePublicObject. # noqa: E501 + + + :return: The status of this BatchResponseSimplePublicObject. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this BatchResponseSimplePublicObject. + + + :param status: The status of this BatchResponseSimplePublicObject. # 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, BatchResponseSimplePublicObject): + 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, BatchResponseSimplePublicObject): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/batch_response_simple_public_object_with_errors.py b/hubspot/crm/objects/leads/models/batch_response_simple_public_object_with_errors.py new file mode 100644 index 00000000..0d196c3b --- /dev/null +++ b/hubspot/crm/objects/leads/models/batch_response_simple_public_object_with_errors.py @@ -0,0 +1,314 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class BatchResponseSimplePublicObjectWithErrors(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[SimplePublicObject]", + "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 + """BatchResponseSimplePublicObjectWithErrors - 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 BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + + + :return: The completed_at of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._completed_at + + @completed_at.setter + def completed_at(self, completed_at): + """Sets the completed_at of this BatchResponseSimplePublicObjectWithErrors. + + + :param completed_at: The completed_at of this BatchResponseSimplePublicObjectWithErrors. # 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 BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + + + :return: The num_errors of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + :rtype: int + """ + return self._num_errors + + @num_errors.setter + def num_errors(self, num_errors): + """Sets the num_errors of this BatchResponseSimplePublicObjectWithErrors. + + + :param num_errors: The num_errors of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + :type num_errors: int + """ + + self._num_errors = num_errors + + @property + def requested_at(self): + """Gets the requested_at of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + + + :return: The requested_at of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._requested_at + + @requested_at.setter + def requested_at(self, requested_at): + """Sets the requested_at of this BatchResponseSimplePublicObjectWithErrors. + + + :param requested_at: The requested_at of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + :type requested_at: datetime + """ + + self._requested_at = requested_at + + @property + def started_at(self): + """Gets the started_at of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + + + :return: The started_at of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this BatchResponseSimplePublicObjectWithErrors. + + + :param started_at: The started_at of this BatchResponseSimplePublicObjectWithErrors. # 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 BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + + + :return: The links of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this BatchResponseSimplePublicObjectWithErrors. + + + :param links: The links of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def results(self): + """Gets the results of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + + + :return: The results of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + :rtype: list[SimplePublicObject] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this BatchResponseSimplePublicObjectWithErrors. + + + :param results: The results of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + :type results: list[SimplePublicObject] + """ + 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 BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + + + :return: The errors of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + :rtype: list[StandardError] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this BatchResponseSimplePublicObjectWithErrors. + + + :param errors: The errors of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + :type errors: list[StandardError] + """ + + self._errors = errors + + @property + def status(self): + """Gets the status of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + + + :return: The status of this BatchResponseSimplePublicObjectWithErrors. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this BatchResponseSimplePublicObjectWithErrors. + + + :param status: The status of this BatchResponseSimplePublicObjectWithErrors. # 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, BatchResponseSimplePublicObjectWithErrors): + 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, BatchResponseSimplePublicObjectWithErrors): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/batch_response_simple_public_upsert_object.py b/hubspot/crm/objects/leads/models/batch_response_simple_public_upsert_object.py new file mode 100644 index 00000000..61cc28a6 --- /dev/null +++ b/hubspot/crm/objects/leads/models/batch_response_simple_public_upsert_object.py @@ -0,0 +1,248 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class BatchResponseSimplePublicUpsertObject(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[SimplePublicUpsertObject]", "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 + """BatchResponseSimplePublicUpsertObject - 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 BatchResponseSimplePublicUpsertObject. # noqa: E501 + + + :return: The completed_at of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :rtype: datetime + """ + return self._completed_at + + @completed_at.setter + def completed_at(self, completed_at): + """Sets the completed_at of this BatchResponseSimplePublicUpsertObject. + + + :param completed_at: The completed_at of this BatchResponseSimplePublicUpsertObject. # 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 BatchResponseSimplePublicUpsertObject. # noqa: E501 + + + :return: The requested_at of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :rtype: datetime + """ + return self._requested_at + + @requested_at.setter + def requested_at(self, requested_at): + """Sets the requested_at of this BatchResponseSimplePublicUpsertObject. + + + :param requested_at: The requested_at of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :type requested_at: datetime + """ + + self._requested_at = requested_at + + @property + def started_at(self): + """Gets the started_at of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + + + :return: The started_at of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this BatchResponseSimplePublicUpsertObject. + + + :param started_at: The started_at of this BatchResponseSimplePublicUpsertObject. # 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 BatchResponseSimplePublicUpsertObject. # noqa: E501 + + + :return: The links of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this BatchResponseSimplePublicUpsertObject. + + + :param links: The links of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def results(self): + """Gets the results of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + + + :return: The results of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :rtype: list[SimplePublicUpsertObject] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this BatchResponseSimplePublicUpsertObject. + + + :param results: The results of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :type results: list[SimplePublicUpsertObject] + """ + 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 BatchResponseSimplePublicUpsertObject. # noqa: E501 + + + :return: The status of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this BatchResponseSimplePublicUpsertObject. + + + :param status: The status of this BatchResponseSimplePublicUpsertObject. # 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, BatchResponseSimplePublicUpsertObject): + 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, BatchResponseSimplePublicUpsertObject): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/batch_response_simple_public_upsert_object_with_errors.py b/hubspot/crm/objects/leads/models/batch_response_simple_public_upsert_object_with_errors.py new file mode 100644 index 00000000..9dbed5a5 --- /dev/null +++ b/hubspot/crm/objects/leads/models/batch_response_simple_public_upsert_object_with_errors.py @@ -0,0 +1,314 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class BatchResponseSimplePublicUpsertObjectWithErrors(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[SimplePublicUpsertObject]", + "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 + """BatchResponseSimplePublicUpsertObjectWithErrors - 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 BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The completed_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._completed_at + + @completed_at.setter + def completed_at(self, completed_at): + """Sets the completed_at of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param completed_at: The completed_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # 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 BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The num_errors of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: int + """ + return self._num_errors + + @num_errors.setter + def num_errors(self, num_errors): + """Sets the num_errors of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param num_errors: The num_errors of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :type num_errors: int + """ + + self._num_errors = num_errors + + @property + def requested_at(self): + """Gets the requested_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The requested_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._requested_at + + @requested_at.setter + def requested_at(self, requested_at): + """Sets the requested_at of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param requested_at: The requested_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :type requested_at: datetime + """ + + self._requested_at = requested_at + + @property + def started_at(self): + """Gets the started_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The started_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param started_at: The started_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # 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 BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The links of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param links: The links of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def results(self): + """Gets the results of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The results of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: list[SimplePublicUpsertObject] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param results: The results of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :type results: list[SimplePublicUpsertObject] + """ + 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 BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The errors of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: list[StandardError] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param errors: The errors of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :type errors: list[StandardError] + """ + + self._errors = errors + + @property + def status(self): + """Gets the status of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The status of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param status: The status of this BatchResponseSimplePublicUpsertObjectWithErrors. # 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, BatchResponseSimplePublicUpsertObjectWithErrors): + 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, BatchResponseSimplePublicUpsertObjectWithErrors): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/collection_response_associated_id.py b/hubspot/crm/objects/leads/models/collection_response_associated_id.py new file mode 100644 index 00000000..a688b761 --- /dev/null +++ b/hubspot/crm/objects/leads/models/collection_response_associated_id.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class CollectionResponseAssociatedId(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 = {"paging": "Paging", "results": "list[AssociatedId]"} + + attribute_map = {"paging": "paging", "results": "results"} + + def __init__(self, paging=None, results=None, local_vars_configuration=None): # noqa: E501 + """CollectionResponseAssociatedId - 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._paging = None + self._results = None + self.discriminator = None + + if paging is not None: + self.paging = paging + self.results = results + + @property + def paging(self): + """Gets the paging of this CollectionResponseAssociatedId. # noqa: E501 + + + :return: The paging of this CollectionResponseAssociatedId. # noqa: E501 + :rtype: Paging + """ + return self._paging + + @paging.setter + def paging(self, paging): + """Sets the paging of this CollectionResponseAssociatedId. + + + :param paging: The paging of this CollectionResponseAssociatedId. # noqa: E501 + :type paging: Paging + """ + + self._paging = paging + + @property + def results(self): + """Gets the results of this CollectionResponseAssociatedId. # noqa: E501 + + + :return: The results of this CollectionResponseAssociatedId. # noqa: E501 + :rtype: list[AssociatedId] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this CollectionResponseAssociatedId. + + + :param results: The results of this CollectionResponseAssociatedId. # noqa: E501 + :type results: list[AssociatedId] + """ + 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, CollectionResponseAssociatedId): + 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, CollectionResponseAssociatedId): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/collection_response_simple_public_object_with_associations_forward_paging.py b/hubspot/crm/objects/leads/models/collection_response_simple_public_object_with_associations_forward_paging.py new file mode 100644 index 00000000..cf508d7c --- /dev/null +++ b/hubspot/crm/objects/leads/models/collection_response_simple_public_object_with_associations_forward_paging.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class CollectionResponseSimplePublicObjectWithAssociationsForwardPaging(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 = {"paging": "ForwardPaging", "results": "list[SimplePublicObjectWithAssociations]"} + + attribute_map = {"paging": "paging", "results": "results"} + + def __init__(self, paging=None, results=None, local_vars_configuration=None): # noqa: E501 + """CollectionResponseSimplePublicObjectWithAssociationsForwardPaging - 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._paging = None + self._results = None + self.discriminator = None + + if paging is not None: + self.paging = paging + self.results = results + + @property + def paging(self): + """Gets the paging of this CollectionResponseSimplePublicObjectWithAssociationsForwardPaging. # noqa: E501 + + + :return: The paging of this CollectionResponseSimplePublicObjectWithAssociationsForwardPaging. # noqa: E501 + :rtype: ForwardPaging + """ + return self._paging + + @paging.setter + def paging(self, paging): + """Sets the paging of this CollectionResponseSimplePublicObjectWithAssociationsForwardPaging. + + + :param paging: The paging of this CollectionResponseSimplePublicObjectWithAssociationsForwardPaging. # noqa: E501 + :type paging: ForwardPaging + """ + + self._paging = paging + + @property + def results(self): + """Gets the results of this CollectionResponseSimplePublicObjectWithAssociationsForwardPaging. # noqa: E501 + + + :return: The results of this CollectionResponseSimplePublicObjectWithAssociationsForwardPaging. # noqa: E501 + :rtype: list[SimplePublicObjectWithAssociations] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this CollectionResponseSimplePublicObjectWithAssociationsForwardPaging. + + + :param results: The results of this CollectionResponseSimplePublicObjectWithAssociationsForwardPaging. # noqa: E501 + :type results: list[SimplePublicObjectWithAssociations] + """ + 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, CollectionResponseSimplePublicObjectWithAssociationsForwardPaging): + 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, CollectionResponseSimplePublicObjectWithAssociationsForwardPaging): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/collection_response_with_total_simple_public_object_forward_paging.py b/hubspot/crm/objects/leads/models/collection_response_with_total_simple_public_object_forward_paging.py new file mode 100644 index 00000000..8716388e --- /dev/null +++ b/hubspot/crm/objects/leads/models/collection_response_with_total_simple_public_object_forward_paging.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class CollectionResponseWithTotalSimplePublicObjectForwardPaging(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", "paging": "ForwardPaging", "results": "list[SimplePublicObject]"} + + attribute_map = {"total": "total", "paging": "paging", "results": "results"} + + def __init__(self, total=None, paging=None, results=None, local_vars_configuration=None): # noqa: E501 + """CollectionResponseWithTotalSimplePublicObjectForwardPaging - 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._paging = None + self._results = None + self.discriminator = None + + self.total = total + if paging is not None: + self.paging = paging + self.results = results + + @property + def total(self): + """Gets the total of this CollectionResponseWithTotalSimplePublicObjectForwardPaging. # noqa: E501 + + + :return: The total of this CollectionResponseWithTotalSimplePublicObjectForwardPaging. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this CollectionResponseWithTotalSimplePublicObjectForwardPaging. + + + :param total: The total of this CollectionResponseWithTotalSimplePublicObjectForwardPaging. # 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 paging(self): + """Gets the paging of this CollectionResponseWithTotalSimplePublicObjectForwardPaging. # noqa: E501 + + + :return: The paging of this CollectionResponseWithTotalSimplePublicObjectForwardPaging. # noqa: E501 + :rtype: ForwardPaging + """ + return self._paging + + @paging.setter + def paging(self, paging): + """Sets the paging of this CollectionResponseWithTotalSimplePublicObjectForwardPaging. + + + :param paging: The paging of this CollectionResponseWithTotalSimplePublicObjectForwardPaging. # noqa: E501 + :type paging: ForwardPaging + """ + + self._paging = paging + + @property + def results(self): + """Gets the results of this CollectionResponseWithTotalSimplePublicObjectForwardPaging. # noqa: E501 + + + :return: The results of this CollectionResponseWithTotalSimplePublicObjectForwardPaging. # noqa: E501 + :rtype: list[SimplePublicObject] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this CollectionResponseWithTotalSimplePublicObjectForwardPaging. + + + :param results: The results of this CollectionResponseWithTotalSimplePublicObjectForwardPaging. # noqa: E501 + :type results: list[SimplePublicObject] + """ + 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, CollectionResponseWithTotalSimplePublicObjectForwardPaging): + 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, CollectionResponseWithTotalSimplePublicObjectForwardPaging): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/error.py b/hubspot/crm/objects/leads/models/error.py new file mode 100644 index 00000000..c5814475 --- /dev/null +++ b/hubspot/crm/objects/leads/models/error.py @@ -0,0 +1,282 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class Error(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": "str", "context": "dict[str, list[str]]", "correlation_id": "str", "links": "dict[str, str]", "message": "str", "category": "str", "errors": "list[ErrorDetail]"} + + attribute_map = {"sub_category": "subCategory", "context": "context", "correlation_id": "correlationId", "links": "links", "message": "message", "category": "category", "errors": "errors"} + + def __init__(self, sub_category=None, context=None, correlation_id=None, links=None, message=None, category=None, errors=None, local_vars_configuration=None): # noqa: E501 + """Error - 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._correlation_id = None + self._links = None + self._message = None + self._category = None + self._errors = None + self.discriminator = None + + if sub_category is not None: + self.sub_category = sub_category + if context is not None: + self.context = context + self.correlation_id = correlation_id + if links is not None: + self.links = links + self.message = message + self.category = category + if errors is not None: + self.errors = errors + + @property + def sub_category(self): + """Gets the sub_category of this Error. # noqa: E501 + + A specific category that contains more specific detail about the error # noqa: E501 + + :return: The sub_category of this Error. # noqa: E501 + :rtype: str + """ + return self._sub_category + + @sub_category.setter + def sub_category(self, sub_category): + """Sets the sub_category of this Error. + + A specific category that contains more specific detail about the error # noqa: E501 + + :param sub_category: The sub_category of this Error. # noqa: E501 + :type sub_category: str + """ + + self._sub_category = sub_category + + @property + def context(self): + """Gets the context of this Error. # noqa: E501 + + Context about the error condition # noqa: E501 + + :return: The context of this Error. # noqa: E501 + :rtype: dict[str, list[str]] + """ + return self._context + + @context.setter + def context(self, context): + """Sets the context of this Error. + + Context about the error condition # noqa: E501 + + :param context: The context of this Error. # noqa: E501 + :type context: dict[str, list[str]] + """ + + self._context = context + + @property + def correlation_id(self): + """Gets the correlation_id of this Error. # noqa: E501 + + A unique identifier for the request. Include this value with any error reports or support tickets # noqa: E501 + + :return: The correlation_id of this Error. # noqa: E501 + :rtype: str + """ + return self._correlation_id + + @correlation_id.setter + def correlation_id(self, correlation_id): + """Sets the correlation_id of this Error. + + A unique identifier for the request. Include this value with any error reports or support tickets # noqa: E501 + + :param correlation_id: The correlation_id of this Error. # noqa: E501 + :type correlation_id: str + """ + if self.local_vars_configuration.client_side_validation and correlation_id is None: # noqa: E501 + raise ValueError("Invalid value for `correlation_id`, must not be `None`") # noqa: E501 + + self._correlation_id = correlation_id + + @property + def links(self): + """Gets the links of this Error. # noqa: E501 + + A map of link names to associated URIs containing documentation about the error or recommended remediation steps # noqa: E501 + + :return: The links of this Error. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this Error. + + A map of link names to associated URIs containing documentation about the error or recommended remediation steps # noqa: E501 + + :param links: The links of this Error. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def message(self): + """Gets the message of this Error. # noqa: E501 + + A human readable message describing the error along with remediation steps where appropriate # noqa: E501 + + :return: The message of this Error. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this Error. + + A human readable message describing the error along with remediation steps where appropriate # noqa: E501 + + :param message: The message of this Error. # 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 category(self): + """Gets the category of this Error. # noqa: E501 + + The error category # noqa: E501 + + :return: The category of this Error. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this Error. + + The error category # noqa: E501 + + :param category: The category of this Error. # 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 errors(self): + """Gets the errors of this Error. # noqa: E501 + + further information about the error # noqa: E501 + + :return: The errors of this Error. # noqa: E501 + :rtype: list[ErrorDetail] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this Error. + + further information about the error # noqa: E501 + + :param errors: The errors of this Error. # noqa: E501 + :type errors: list[ErrorDetail] + """ + + self._errors = errors + + 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, Error): + 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, Error): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/error_detail.py b/hubspot/crm/objects/leads/models/error_detail.py new file mode 100644 index 00000000..ffb5bfd4 --- /dev/null +++ b/hubspot/crm/objects/leads/models/error_detail.py @@ -0,0 +1,228 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class ErrorDetail(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": "str", "code": "str", "_in": "str", "context": "dict[str, list[str]]", "message": "str"} + + attribute_map = {"sub_category": "subCategory", "code": "code", "_in": "in", "context": "context", "message": "message"} + + def __init__(self, sub_category=None, code=None, _in=None, context=None, message=None, local_vars_configuration=None): # noqa: E501 + """ErrorDetail - 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._code = None + self.__in = None + self._context = None + self._message = None + self.discriminator = None + + if sub_category is not None: + self.sub_category = sub_category + if code is not None: + self.code = code + if _in is not None: + self._in = _in + if context is not None: + self.context = context + self.message = message + + @property + def sub_category(self): + """Gets the sub_category of this ErrorDetail. # noqa: E501 + + A specific category that contains more specific detail about the error # noqa: E501 + + :return: The sub_category of this ErrorDetail. # noqa: E501 + :rtype: str + """ + return self._sub_category + + @sub_category.setter + def sub_category(self, sub_category): + """Sets the sub_category of this ErrorDetail. + + A specific category that contains more specific detail about the error # noqa: E501 + + :param sub_category: The sub_category of this ErrorDetail. # noqa: E501 + :type sub_category: str + """ + + self._sub_category = sub_category + + @property + def code(self): + """Gets the code of this ErrorDetail. # noqa: E501 + + The status code associated with the error detail # noqa: E501 + + :return: The code of this ErrorDetail. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ErrorDetail. + + The status code associated with the error detail # noqa: E501 + + :param code: The code of this ErrorDetail. # noqa: E501 + :type code: str + """ + + self._code = code + + @property + def _in(self): + """Gets the _in of this ErrorDetail. # noqa: E501 + + The name of the field or parameter in which the error was found. # noqa: E501 + + :return: The _in of this ErrorDetail. # noqa: E501 + :rtype: str + """ + return self.__in + + @_in.setter + def _in(self, _in): + """Sets the _in of this ErrorDetail. + + The name of the field or parameter in which the error was found. # noqa: E501 + + :param _in: The _in of this ErrorDetail. # noqa: E501 + :type _in: str + """ + + self.__in = _in + + @property + def context(self): + """Gets the context of this ErrorDetail. # noqa: E501 + + Context about the error condition # noqa: E501 + + :return: The context of this ErrorDetail. # noqa: E501 + :rtype: dict[str, list[str]] + """ + return self._context + + @context.setter + def context(self, context): + """Sets the context of this ErrorDetail. + + Context about the error condition # noqa: E501 + + :param context: The context of this ErrorDetail. # noqa: E501 + :type context: dict[str, list[str]] + """ + + self._context = context + + @property + def message(self): + """Gets the message of this ErrorDetail. # noqa: E501 + + A human readable message describing the error along with remediation steps where appropriate # noqa: E501 + + :return: The message of this ErrorDetail. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ErrorDetail. + + A human readable message describing the error along with remediation steps where appropriate # noqa: E501 + + :param message: The message of this ErrorDetail. # 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 + + 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, ErrorDetail): + 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, ErrorDetail): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/filter.py b/hubspot/crm/objects/leads/models/filter.py new file mode 100644 index 00000000..c352d20e --- /dev/null +++ b/hubspot/crm/objects/leads/models/filter.py @@ -0,0 +1,224 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class Filter(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 = {"high_value": "str", "property_name": "str", "values": "list[str]", "value": "str", "operator": "str"} + + attribute_map = {"high_value": "highValue", "property_name": "propertyName", "values": "values", "value": "value", "operator": "operator"} + + def __init__(self, high_value=None, property_name=None, values=None, value=None, operator=None, local_vars_configuration=None): # noqa: E501 + """Filter - 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._high_value = None + self._property_name = None + self._values = None + self._value = None + self._operator = None + self.discriminator = None + + if high_value is not None: + self.high_value = high_value + self.property_name = property_name + if values is not None: + self.values = values + if value is not None: + self.value = value + self.operator = operator + + @property + def high_value(self): + """Gets the high_value of this Filter. # noqa: E501 + + + :return: The high_value of this Filter. # noqa: E501 + :rtype: str + """ + return self._high_value + + @high_value.setter + def high_value(self, high_value): + """Sets the high_value of this Filter. + + + :param high_value: The high_value of this Filter. # noqa: E501 + :type high_value: str + """ + + self._high_value = high_value + + @property + def property_name(self): + """Gets the property_name of this Filter. # noqa: E501 + + + :return: The property_name of this Filter. # noqa: E501 + :rtype: str + """ + return self._property_name + + @property_name.setter + def property_name(self, property_name): + """Sets the property_name of this Filter. + + + :param property_name: The property_name of this Filter. # noqa: E501 + :type property_name: str + """ + if self.local_vars_configuration.client_side_validation and property_name is None: # noqa: E501 + raise ValueError("Invalid value for `property_name`, must not be `None`") # noqa: E501 + + self._property_name = property_name + + @property + def values(self): + """Gets the values of this Filter. # noqa: E501 + + + :return: The values of this Filter. # noqa: E501 + :rtype: list[str] + """ + return self._values + + @values.setter + def values(self, values): + """Sets the values of this Filter. + + + :param values: The values of this Filter. # noqa: E501 + :type values: list[str] + """ + + self._values = values + + @property + def value(self): + """Gets the value of this Filter. # noqa: E501 + + + :return: The value of this Filter. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this Filter. + + + :param value: The value of this Filter. # noqa: E501 + :type value: str + """ + + self._value = value + + @property + def operator(self): + """Gets the operator of this Filter. # noqa: E501 + + null # noqa: E501 + + :return: The operator of this Filter. # noqa: E501 + :rtype: str + """ + return self._operator + + @operator.setter + def operator(self, operator): + """Sets the operator of this Filter. + + null # noqa: E501 + + :param operator: The operator of this Filter. # noqa: E501 + :type operator: str + """ + if self.local_vars_configuration.client_side_validation and operator is None: # noqa: E501 + raise ValueError("Invalid value for `operator`, must not be `None`") # noqa: E501 + allowed_values = ["EQ", "NEQ", "LT", "LTE", "GT", "GTE", "BETWEEN", "IN", "NOT_IN", "HAS_PROPERTY", "NOT_HAS_PROPERTY", "CONTAINS_TOKEN", "NOT_CONTAINS_TOKEN"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and operator not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `operator` ({0}), must be one of {1}".format(operator, allowed_values)) # noqa: E501 + + self._operator = operator + + 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, Filter): + 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, Filter): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/filter_group.py b/hubspot/crm/objects/leads/models/filter_group.py new file mode 100644 index 00000000..14aac7a7 --- /dev/null +++ b/hubspot/crm/objects/leads/models/filter_group.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class FilterGroup(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 = {"filters": "list[Filter]"} + + attribute_map = {"filters": "filters"} + + def __init__(self, filters=None, local_vars_configuration=None): # noqa: E501 + """FilterGroup - 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._filters = None + self.discriminator = None + + self.filters = filters + + @property + def filters(self): + """Gets the filters of this FilterGroup. # noqa: E501 + + + :return: The filters of this FilterGroup. # noqa: E501 + :rtype: list[Filter] + """ + return self._filters + + @filters.setter + def filters(self, filters): + """Sets the filters of this FilterGroup. + + + :param filters: The filters of this FilterGroup. # noqa: E501 + :type filters: list[Filter] + """ + if self.local_vars_configuration.client_side_validation and filters is None: # noqa: E501 + raise ValueError("Invalid value for `filters`, must not be `None`") # noqa: E501 + + self._filters = filters + + 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, FilterGroup): + 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, FilterGroup): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/forward_paging.py b/hubspot/crm/objects/leads/models/forward_paging.py new file mode 100644 index 00000000..badab2e2 --- /dev/null +++ b/hubspot/crm/objects/leads/models/forward_paging.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class ForwardPaging(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 = {"next": "NextPage"} + + attribute_map = {"next": "next"} + + def __init__(self, next=None, local_vars_configuration=None): # noqa: E501 + """ForwardPaging - 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._next = None + self.discriminator = None + + if next is not None: + self.next = next + + @property + def next(self): + """Gets the next of this ForwardPaging. # noqa: E501 + + + :return: The next of this ForwardPaging. # noqa: E501 + :rtype: NextPage + """ + return self._next + + @next.setter + def next(self, next): + """Sets the next of this ForwardPaging. + + + :param next: The next of this ForwardPaging. # noqa: E501 + :type next: NextPage + """ + + self._next = next + + 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, ForwardPaging): + 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, ForwardPaging): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/next_page.py b/hubspot/crm/objects/leads/models/next_page.py new file mode 100644 index 00000000..b52515b0 --- /dev/null +++ b/hubspot/crm/objects/leads/models/next_page.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class NextPage(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 = {"link": "str", "after": "str"} + + attribute_map = {"link": "link", "after": "after"} + + def __init__(self, link=None, after=None, local_vars_configuration=None): # noqa: E501 + """NextPage - 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._link = None + self._after = None + self.discriminator = None + + if link is not None: + self.link = link + self.after = after + + @property + def link(self): + """Gets the link of this NextPage. # noqa: E501 + + + :return: The link of this NextPage. # noqa: E501 + :rtype: str + """ + return self._link + + @link.setter + def link(self, link): + """Sets the link of this NextPage. + + + :param link: The link of this NextPage. # noqa: E501 + :type link: str + """ + + self._link = link + + @property + def after(self): + """Gets the after of this NextPage. # noqa: E501 + + + :return: The after of this NextPage. # noqa: E501 + :rtype: str + """ + return self._after + + @after.setter + def after(self, after): + """Sets the after of this NextPage. + + + :param after: The after of this NextPage. # noqa: E501 + :type after: str + """ + if self.local_vars_configuration.client_side_validation and after is None: # noqa: E501 + raise ValueError("Invalid value for `after`, must not be `None`") # noqa: E501 + + self._after = after + + 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, NextPage): + 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, NextPage): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/paging.py b/hubspot/crm/objects/leads/models/paging.py new file mode 100644 index 00000000..06e71320 --- /dev/null +++ b/hubspot/crm/objects/leads/models/paging.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class Paging(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 = {"next": "NextPage", "prev": "PreviousPage"} + + attribute_map = {"next": "next", "prev": "prev"} + + def __init__(self, next=None, prev=None, local_vars_configuration=None): # noqa: E501 + """Paging - 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._next = None + self._prev = None + self.discriminator = None + + if next is not None: + self.next = next + if prev is not None: + self.prev = prev + + @property + def next(self): + """Gets the next of this Paging. # noqa: E501 + + + :return: The next of this Paging. # noqa: E501 + :rtype: NextPage + """ + return self._next + + @next.setter + def next(self, next): + """Sets the next of this Paging. + + + :param next: The next of this Paging. # noqa: E501 + :type next: NextPage + """ + + self._next = next + + @property + def prev(self): + """Gets the prev of this Paging. # noqa: E501 + + + :return: The prev of this Paging. # noqa: E501 + :rtype: PreviousPage + """ + return self._prev + + @prev.setter + def prev(self, prev): + """Sets the prev of this Paging. + + + :param prev: The prev of this Paging. # noqa: E501 + :type prev: PreviousPage + """ + + self._prev = prev + + 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, Paging): + 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, Paging): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/previous_page.py b/hubspot/crm/objects/leads/models/previous_page.py new file mode 100644 index 00000000..ce381e81 --- /dev/null +++ b/hubspot/crm/objects/leads/models/previous_page.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class PreviousPage(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 = {"before": "str", "link": "str"} + + attribute_map = {"before": "before", "link": "link"} + + def __init__(self, before=None, link=None, local_vars_configuration=None): # noqa: E501 + """PreviousPage - 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._before = None + self._link = None + self.discriminator = None + + self.before = before + if link is not None: + self.link = link + + @property + def before(self): + """Gets the before of this PreviousPage. # noqa: E501 + + + :return: The before of this PreviousPage. # noqa: E501 + :rtype: str + """ + return self._before + + @before.setter + def before(self, before): + """Sets the before of this PreviousPage. + + + :param before: The before of this PreviousPage. # noqa: E501 + :type before: str + """ + if self.local_vars_configuration.client_side_validation and before is None: # noqa: E501 + raise ValueError("Invalid value for `before`, must not be `None`") # noqa: E501 + + self._before = before + + @property + def link(self): + """Gets the link of this PreviousPage. # noqa: E501 + + + :return: The link of this PreviousPage. # noqa: E501 + :rtype: str + """ + return self._link + + @link.setter + def link(self, link): + """Sets the link of this PreviousPage. + + + :param link: The link of this PreviousPage. # noqa: E501 + :type link: str + """ + + self._link = link + + 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, PreviousPage): + 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, PreviousPage): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/public_associations_for_object.py b/hubspot/crm/objects/leads/models/public_associations_for_object.py new file mode 100644 index 00000000..93cd433d --- /dev/null +++ b/hubspot/crm/objects/leads/models/public_associations_for_object.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class PublicAssociationsForObject(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 = {"types": "list[AssociationSpec]", "to": "PublicObjectId"} + + attribute_map = {"types": "types", "to": "to"} + + def __init__(self, types=None, to=None, local_vars_configuration=None): # noqa: E501 + """PublicAssociationsForObject - 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._types = None + self._to = None + self.discriminator = None + + self.types = types + self.to = to + + @property + def types(self): + """Gets the types of this PublicAssociationsForObject. # noqa: E501 + + + :return: The types of this PublicAssociationsForObject. # noqa: E501 + :rtype: list[AssociationSpec] + """ + return self._types + + @types.setter + def types(self, types): + """Sets the types of this PublicAssociationsForObject. + + + :param types: The types of this PublicAssociationsForObject. # noqa: E501 + :type types: list[AssociationSpec] + """ + if self.local_vars_configuration.client_side_validation and types is None: # noqa: E501 + raise ValueError("Invalid value for `types`, must not be `None`") # noqa: E501 + + self._types = types + + @property + def to(self): + """Gets the to of this PublicAssociationsForObject. # noqa: E501 + + + :return: The to of this PublicAssociationsForObject. # noqa: E501 + :rtype: PublicObjectId + """ + return self._to + + @to.setter + def to(self, to): + """Sets the to of this PublicAssociationsForObject. + + + :param to: The to of this PublicAssociationsForObject. # noqa: E501 + :type to: PublicObjectId + """ + if self.local_vars_configuration.client_side_validation and to is None: # noqa: E501 + raise ValueError("Invalid value for `to`, must not be `None`") # noqa: E501 + + self._to = to + + 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, PublicAssociationsForObject): + 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, PublicAssociationsForObject): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/public_object_id.py b/hubspot/crm/objects/leads/models/public_object_id.py new file mode 100644 index 00000000..47f1074d --- /dev/null +++ b/hubspot/crm/objects/leads/models/public_object_id.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class PublicObjectId(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 = {"id": "str"} + + attribute_map = {"id": "id"} + + def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 + """PublicObjectId - 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._id = None + self.discriminator = None + + self.id = id + + @property + def id(self): + """Gets the id of this PublicObjectId. # noqa: E501 + + + :return: The id of this PublicObjectId. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this PublicObjectId. + + + :param id: The id of this PublicObjectId. # noqa: E501 + :type id: str + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + 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, PublicObjectId): + 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, PublicObjectId): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/public_object_search_request.py b/hubspot/crm/objects/leads/models/public_object_search_request.py new file mode 100644 index 00000000..6c31526c --- /dev/null +++ b/hubspot/crm/objects/leads/models/public_object_search_request.py @@ -0,0 +1,241 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class PublicObjectSearchRequest(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 = {"query": "str", "limit": "int", "after": "str", "sorts": "list[str]", "properties": "list[str]", "filter_groups": "list[FilterGroup]"} + + attribute_map = {"query": "query", "limit": "limit", "after": "after", "sorts": "sorts", "properties": "properties", "filter_groups": "filterGroups"} + + def __init__(self, query=None, limit=None, after=None, sorts=None, properties=None, filter_groups=None, local_vars_configuration=None): # noqa: E501 + """PublicObjectSearchRequest - 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._query = None + self._limit = None + self._after = None + self._sorts = None + self._properties = None + self._filter_groups = None + self.discriminator = None + + if query is not None: + self.query = query + if limit is not None: + self.limit = limit + if after is not None: + self.after = after + if sorts is not None: + self.sorts = sorts + if properties is not None: + self.properties = properties + if filter_groups is not None: + self.filter_groups = filter_groups + + @property + def query(self): + """Gets the query of this PublicObjectSearchRequest. # noqa: E501 + + + :return: The query of this PublicObjectSearchRequest. # noqa: E501 + :rtype: str + """ + return self._query + + @query.setter + def query(self, query): + """Sets the query of this PublicObjectSearchRequest. + + + :param query: The query of this PublicObjectSearchRequest. # noqa: E501 + :type query: str + """ + + self._query = query + + @property + def limit(self): + """Gets the limit of this PublicObjectSearchRequest. # noqa: E501 + + + :return: The limit of this PublicObjectSearchRequest. # noqa: E501 + :rtype: int + """ + return self._limit + + @limit.setter + def limit(self, limit): + """Sets the limit of this PublicObjectSearchRequest. + + + :param limit: The limit of this PublicObjectSearchRequest. # noqa: E501 + :type limit: int + """ + + self._limit = limit + + @property + def after(self): + """Gets the after of this PublicObjectSearchRequest. # noqa: E501 + + + :return: The after of this PublicObjectSearchRequest. # noqa: E501 + :rtype: str + """ + return self._after + + @after.setter + def after(self, after): + """Sets the after of this PublicObjectSearchRequest. + + + :param after: The after of this PublicObjectSearchRequest. # noqa: E501 + :type after: str + """ + + self._after = after + + @property + def sorts(self): + """Gets the sorts of this PublicObjectSearchRequest. # noqa: E501 + + + :return: The sorts of this PublicObjectSearchRequest. # noqa: E501 + :rtype: list[str] + """ + return self._sorts + + @sorts.setter + def sorts(self, sorts): + """Sets the sorts of this PublicObjectSearchRequest. + + + :param sorts: The sorts of this PublicObjectSearchRequest. # noqa: E501 + :type sorts: list[str] + """ + + self._sorts = sorts + + @property + def properties(self): + """Gets the properties of this PublicObjectSearchRequest. # noqa: E501 + + + :return: The properties of this PublicObjectSearchRequest. # noqa: E501 + :rtype: list[str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this PublicObjectSearchRequest. + + + :param properties: The properties of this PublicObjectSearchRequest. # noqa: E501 + :type properties: list[str] + """ + + self._properties = properties + + @property + def filter_groups(self): + """Gets the filter_groups of this PublicObjectSearchRequest. # noqa: E501 + + + :return: The filter_groups of this PublicObjectSearchRequest. # noqa: E501 + :rtype: list[FilterGroup] + """ + return self._filter_groups + + @filter_groups.setter + def filter_groups(self, filter_groups): + """Sets the filter_groups of this PublicObjectSearchRequest. + + + :param filter_groups: The filter_groups of this PublicObjectSearchRequest. # noqa: E501 + :type filter_groups: list[FilterGroup] + """ + + self._filter_groups = filter_groups + + 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, PublicObjectSearchRequest): + 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, PublicObjectSearchRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/simple_public_object.py b/hubspot/crm/objects/leads/models/simple_public_object.py new file mode 100644 index 00000000..fb97f92f --- /dev/null +++ b/hubspot/crm/objects/leads/models/simple_public_object.py @@ -0,0 +1,285 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class SimplePublicObject(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 = { + "created_at": "datetime", + "archived": "bool", + "archived_at": "datetime", + "properties_with_history": "dict[str, list[ValueWithTimestamp]]", + "id": "str", + "properties": "dict[str, str]", + "updated_at": "datetime", + } + + attribute_map = { + "created_at": "createdAt", + "archived": "archived", + "archived_at": "archivedAt", + "properties_with_history": "propertiesWithHistory", + "id": "id", + "properties": "properties", + "updated_at": "updatedAt", + } + + def __init__(self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, properties=None, updated_at=None, local_vars_configuration=None): # noqa: E501 + """SimplePublicObject - 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._created_at = None + self._archived = None + self._archived_at = None + self._properties_with_history = None + self._id = None + self._properties = None + self._updated_at = None + self.discriminator = None + + self.created_at = created_at + if archived is not None: + self.archived = archived + if archived_at is not None: + self.archived_at = archived_at + if properties_with_history is not None: + self.properties_with_history = properties_with_history + self.id = id + self.properties = properties + self.updated_at = updated_at + + @property + def created_at(self): + """Gets the created_at of this SimplePublicObject. # noqa: E501 + + + :return: The created_at of this SimplePublicObject. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this SimplePublicObject. + + + :param created_at: The created_at of this SimplePublicObject. # noqa: E501 + :type created_at: datetime + """ + if self.local_vars_configuration.client_side_validation and created_at is None: # noqa: E501 + raise ValueError("Invalid value for `created_at`, must not be `None`") # noqa: E501 + + self._created_at = created_at + + @property + def archived(self): + """Gets the archived of this SimplePublicObject. # noqa: E501 + + + :return: The archived of this SimplePublicObject. # noqa: E501 + :rtype: bool + """ + return self._archived + + @archived.setter + def archived(self, archived): + """Sets the archived of this SimplePublicObject. + + + :param archived: The archived of this SimplePublicObject. # noqa: E501 + :type archived: bool + """ + + self._archived = archived + + @property + def archived_at(self): + """Gets the archived_at of this SimplePublicObject. # noqa: E501 + + + :return: The archived_at of this SimplePublicObject. # noqa: E501 + :rtype: datetime + """ + return self._archived_at + + @archived_at.setter + def archived_at(self, archived_at): + """Sets the archived_at of this SimplePublicObject. + + + :param archived_at: The archived_at of this SimplePublicObject. # noqa: E501 + :type archived_at: datetime + """ + + self._archived_at = archived_at + + @property + def properties_with_history(self): + """Gets the properties_with_history of this SimplePublicObject. # noqa: E501 + + + :return: The properties_with_history of this SimplePublicObject. # noqa: E501 + :rtype: dict[str, list[ValueWithTimestamp]] + """ + return self._properties_with_history + + @properties_with_history.setter + def properties_with_history(self, properties_with_history): + """Sets the properties_with_history of this SimplePublicObject. + + + :param properties_with_history: The properties_with_history of this SimplePublicObject. # noqa: E501 + :type properties_with_history: dict[str, list[ValueWithTimestamp]] + """ + + self._properties_with_history = properties_with_history + + @property + def id(self): + """Gets the id of this SimplePublicObject. # noqa: E501 + + + :return: The id of this SimplePublicObject. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SimplePublicObject. + + + :param id: The id of this SimplePublicObject. # noqa: E501 + :type id: str + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def properties(self): + """Gets the properties of this SimplePublicObject. # noqa: E501 + + + :return: The properties of this SimplePublicObject. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObject. + + + :param properties: The properties of this SimplePublicObject. # noqa: E501 + :type properties: dict[str, str] + """ + if self.local_vars_configuration.client_side_validation and properties is None: # noqa: E501 + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 + + self._properties = properties + + @property + def updated_at(self): + """Gets the updated_at of this SimplePublicObject. # noqa: E501 + + + :return: The updated_at of this SimplePublicObject. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this SimplePublicObject. + + + :param updated_at: The updated_at of this SimplePublicObject. # noqa: E501 + :type updated_at: datetime + """ + if self.local_vars_configuration.client_side_validation and updated_at is None: # noqa: E501 + raise ValueError("Invalid value for `updated_at`, must not be `None`") # noqa: E501 + + 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, SimplePublicObject): + 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, SimplePublicObject): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/simple_public_object_batch_input.py b/hubspot/crm/objects/leads/models/simple_public_object_batch_input.py new file mode 100644 index 00000000..80e5d708 --- /dev/null +++ b/hubspot/crm/objects/leads/models/simple_public_object_batch_input.py @@ -0,0 +1,195 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class SimplePublicObjectBatchInput(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 = {"id_property": "str", "object_write_trace_id": "str", "id": "str", "properties": "dict[str, str]"} + + attribute_map = {"id_property": "idProperty", "object_write_trace_id": "objectWriteTraceId", "id": "id", "properties": "properties"} + + def __init__(self, id_property=None, object_write_trace_id=None, id=None, properties=None, local_vars_configuration=None): # noqa: E501 + """SimplePublicObjectBatchInput - 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._id_property = None + self._object_write_trace_id = None + self._id = None + self._properties = None + self.discriminator = None + + if id_property is not None: + self.id_property = id_property + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id + self.id = id + self.properties = properties + + @property + def id_property(self): + """Gets the id_property of this SimplePublicObjectBatchInput. # noqa: E501 + + + :return: The id_property of this SimplePublicObjectBatchInput. # noqa: E501 + :rtype: str + """ + return self._id_property + + @id_property.setter + def id_property(self, id_property): + """Sets the id_property of this SimplePublicObjectBatchInput. + + + :param id_property: The id_property of this SimplePublicObjectBatchInput. # noqa: E501 + :type id_property: str + """ + + self._id_property = id_property + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInput. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInput. # noqa: E501 + :rtype: str + """ + return self._object_write_trace_id + + @object_write_trace_id.setter + def object_write_trace_id(self, object_write_trace_id): + """Sets the object_write_trace_id of this SimplePublicObjectBatchInput. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInput. # noqa: E501 + :type object_write_trace_id: str + """ + + self._object_write_trace_id = object_write_trace_id + + @property + def id(self): + """Gets the id of this SimplePublicObjectBatchInput. # noqa: E501 + + + :return: The id of this SimplePublicObjectBatchInput. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SimplePublicObjectBatchInput. + + + :param id: The id of this SimplePublicObjectBatchInput. # noqa: E501 + :type id: str + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def properties(self): + """Gets the properties of this SimplePublicObjectBatchInput. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInput. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInput. + + + :param properties: The properties of this SimplePublicObjectBatchInput. # noqa: E501 + :type properties: dict[str, str] + """ + if self.local_vars_configuration.client_side_validation and properties is None: # noqa: E501 + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 + + self._properties = properties + + 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, SimplePublicObjectBatchInput): + 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, SimplePublicObjectBatchInput): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/simple_public_object_batch_input_upsert.py b/hubspot/crm/objects/leads/models/simple_public_object_batch_input_upsert.py new file mode 100644 index 00000000..738cb695 --- /dev/null +++ b/hubspot/crm/objects/leads/models/simple_public_object_batch_input_upsert.py @@ -0,0 +1,195 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class SimplePublicObjectBatchInputUpsert(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 = {"id_property": "str", "object_write_trace_id": "str", "id": "str", "properties": "dict[str, str]"} + + attribute_map = {"id_property": "idProperty", "object_write_trace_id": "objectWriteTraceId", "id": "id", "properties": "properties"} + + def __init__(self, id_property=None, object_write_trace_id=None, id=None, properties=None, local_vars_configuration=None): # noqa: E501 + """SimplePublicObjectBatchInputUpsert - 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._id_property = None + self._object_write_trace_id = None + self._id = None + self._properties = None + self.discriminator = None + + if id_property is not None: + self.id_property = id_property + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id + self.id = id + self.properties = properties + + @property + def id_property(self): + """Gets the id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + + + :return: The id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + :rtype: str + """ + return self._id_property + + @id_property.setter + def id_property(self, id_property): + """Sets the id_property of this SimplePublicObjectBatchInputUpsert. + + + :param id_property: The id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + :type id_property: str + """ + + self._id_property = id_property + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + :rtype: str + """ + return self._object_write_trace_id + + @object_write_trace_id.setter + def object_write_trace_id(self, object_write_trace_id): + """Sets the object_write_trace_id of this SimplePublicObjectBatchInputUpsert. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + :type object_write_trace_id: str + """ + + self._object_write_trace_id = object_write_trace_id + + @property + def id(self): + """Gets the id of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + + + :return: The id of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SimplePublicObjectBatchInputUpsert. + + + :param id: The id of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + :type id: str + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def properties(self): + """Gets the properties of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputUpsert. + + + :param properties: The properties of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + :type properties: dict[str, str] + """ + if self.local_vars_configuration.client_side_validation and properties is None: # noqa: E501 + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 + + self._properties = properties + + 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, SimplePublicObjectBatchInputUpsert): + 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, SimplePublicObjectBatchInputUpsert): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/simple_public_object_id.py b/hubspot/crm/objects/leads/models/simple_public_object_id.py new file mode 100644 index 00000000..6f652894 --- /dev/null +++ b/hubspot/crm/objects/leads/models/simple_public_object_id.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class SimplePublicObjectId(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 = {"id": "str"} + + attribute_map = {"id": "id"} + + def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 + """SimplePublicObjectId - 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._id = None + self.discriminator = None + + self.id = id + + @property + def id(self): + """Gets the id of this SimplePublicObjectId. # noqa: E501 + + + :return: The id of this SimplePublicObjectId. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SimplePublicObjectId. + + + :param id: The id of this SimplePublicObjectId. # noqa: E501 + :type id: str + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + 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, SimplePublicObjectId): + 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, SimplePublicObjectId): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/simple_public_object_input.py b/hubspot/crm/objects/leads/models/simple_public_object_input.py new file mode 100644 index 00000000..4b0ed4d3 --- /dev/null +++ b/hubspot/crm/objects/leads/models/simple_public_object_input.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class SimplePublicObjectInput(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 = {"object_write_trace_id": "str", "properties": "dict[str, str]"} + + attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + + def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + """SimplePublicObjectInput - 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._object_write_trace_id = None + self._properties = None + self.discriminator = None + + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id + self.properties = properties + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectInput. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectInput. # noqa: E501 + :rtype: str + """ + return self._object_write_trace_id + + @object_write_trace_id.setter + def object_write_trace_id(self, object_write_trace_id): + """Sets the object_write_trace_id of this SimplePublicObjectInput. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectInput. # noqa: E501 + :type object_write_trace_id: str + """ + + self._object_write_trace_id = object_write_trace_id + + @property + def properties(self): + """Gets the properties of this SimplePublicObjectInput. # noqa: E501 + + + :return: The properties of this SimplePublicObjectInput. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectInput. + + + :param properties: The properties of this SimplePublicObjectInput. # noqa: E501 + :type properties: dict[str, str] + """ + if self.local_vars_configuration.client_side_validation and properties is None: # noqa: E501 + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 + + self._properties = properties + + 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, SimplePublicObjectInput): + 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, SimplePublicObjectInput): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/simple_public_object_input_for_create.py b/hubspot/crm/objects/leads/models/simple_public_object_input_for_create.py new file mode 100644 index 00000000..48aff550 --- /dev/null +++ b/hubspot/crm/objects/leads/models/simple_public_object_input_for_create.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class SimplePublicObjectInputForCreate(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 = {"associations": "list[PublicAssociationsForObject]", "object_write_trace_id": "str", "properties": "dict[str, str]"} + + attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + + def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + """SimplePublicObjectInputForCreate - 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._associations = None + self._object_write_trace_id = None + self._properties = None + self.discriminator = None + + self.associations = associations + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id + self.properties = properties + + @property + def associations(self): + """Gets the associations of this SimplePublicObjectInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectInputForCreate. + + + :param associations: The associations of this SimplePublicObjectInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + if self.local_vars_configuration.client_side_validation and associations is None: # noqa: E501 + raise ValueError("Invalid value for `associations`, must not be `None`") # noqa: E501 + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectInputForCreate. # noqa: E501 + :rtype: str + """ + return self._object_write_trace_id + + @object_write_trace_id.setter + def object_write_trace_id(self, object_write_trace_id): + """Sets the object_write_trace_id of this SimplePublicObjectInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectInputForCreate. # noqa: E501 + :type object_write_trace_id: str + """ + + self._object_write_trace_id = object_write_trace_id + + @property + def properties(self): + """Gets the properties of this SimplePublicObjectInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectInputForCreate. + + + :param properties: The properties of this SimplePublicObjectInputForCreate. # noqa: E501 + :type properties: dict[str, str] + """ + if self.local_vars_configuration.client_side_validation and properties is None: # noqa: E501 + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 + + self._properties = properties + + 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, SimplePublicObjectInputForCreate): + 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, SimplePublicObjectInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/simple_public_object_with_associations.py b/hubspot/crm/objects/leads/models/simple_public_object_with_associations.py new file mode 100644 index 00000000..69f01cdc --- /dev/null +++ b/hubspot/crm/objects/leads/models/simple_public_object_with_associations.py @@ -0,0 +1,313 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class SimplePublicObjectWithAssociations(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 = { + "associations": "dict[str, CollectionResponseAssociatedId]", + "created_at": "datetime", + "archived": "bool", + "archived_at": "datetime", + "properties_with_history": "dict[str, list[ValueWithTimestamp]]", + "id": "str", + "properties": "dict[str, str]", + "updated_at": "datetime", + } + + attribute_map = { + "associations": "associations", + "created_at": "createdAt", + "archived": "archived", + "archived_at": "archivedAt", + "properties_with_history": "propertiesWithHistory", + "id": "id", + "properties": "properties", + "updated_at": "updatedAt", + } + + def __init__( + self, associations=None, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, properties=None, updated_at=None, local_vars_configuration=None + ): # noqa: E501 + """SimplePublicObjectWithAssociations - 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._associations = None + self._created_at = None + self._archived = None + self._archived_at = None + self._properties_with_history = None + self._id = None + self._properties = None + self._updated_at = None + self.discriminator = None + + if associations is not None: + self.associations = associations + self.created_at = created_at + if archived is not None: + self.archived = archived + if archived_at is not None: + self.archived_at = archived_at + if properties_with_history is not None: + self.properties_with_history = properties_with_history + self.id = id + self.properties = properties + self.updated_at = updated_at + + @property + def associations(self): + """Gets the associations of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The associations of this SimplePublicObjectWithAssociations. # noqa: E501 + :rtype: dict[str, CollectionResponseAssociatedId] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectWithAssociations. + + + :param associations: The associations of this SimplePublicObjectWithAssociations. # noqa: E501 + :type associations: dict[str, CollectionResponseAssociatedId] + """ + + self._associations = associations + + @property + def created_at(self): + """Gets the created_at of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The created_at of this SimplePublicObjectWithAssociations. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this SimplePublicObjectWithAssociations. + + + :param created_at: The created_at of this SimplePublicObjectWithAssociations. # noqa: E501 + :type created_at: datetime + """ + if self.local_vars_configuration.client_side_validation and created_at is None: # noqa: E501 + raise ValueError("Invalid value for `created_at`, must not be `None`") # noqa: E501 + + self._created_at = created_at + + @property + def archived(self): + """Gets the archived of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The archived of this SimplePublicObjectWithAssociations. # noqa: E501 + :rtype: bool + """ + return self._archived + + @archived.setter + def archived(self, archived): + """Sets the archived of this SimplePublicObjectWithAssociations. + + + :param archived: The archived of this SimplePublicObjectWithAssociations. # noqa: E501 + :type archived: bool + """ + + self._archived = archived + + @property + def archived_at(self): + """Gets the archived_at of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The archived_at of this SimplePublicObjectWithAssociations. # noqa: E501 + :rtype: datetime + """ + return self._archived_at + + @archived_at.setter + def archived_at(self, archived_at): + """Sets the archived_at of this SimplePublicObjectWithAssociations. + + + :param archived_at: The archived_at of this SimplePublicObjectWithAssociations. # noqa: E501 + :type archived_at: datetime + """ + + self._archived_at = archived_at + + @property + def properties_with_history(self): + """Gets the properties_with_history of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The properties_with_history of this SimplePublicObjectWithAssociations. # noqa: E501 + :rtype: dict[str, list[ValueWithTimestamp]] + """ + return self._properties_with_history + + @properties_with_history.setter + def properties_with_history(self, properties_with_history): + """Sets the properties_with_history of this SimplePublicObjectWithAssociations. + + + :param properties_with_history: The properties_with_history of this SimplePublicObjectWithAssociations. # noqa: E501 + :type properties_with_history: dict[str, list[ValueWithTimestamp]] + """ + + self._properties_with_history = properties_with_history + + @property + def id(self): + """Gets the id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The id of this SimplePublicObjectWithAssociations. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SimplePublicObjectWithAssociations. + + + :param id: The id of this SimplePublicObjectWithAssociations. # noqa: E501 + :type id: str + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def properties(self): + """Gets the properties of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The properties of this SimplePublicObjectWithAssociations. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectWithAssociations. + + + :param properties: The properties of this SimplePublicObjectWithAssociations. # noqa: E501 + :type properties: dict[str, str] + """ + if self.local_vars_configuration.client_side_validation and properties is None: # noqa: E501 + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 + + self._properties = properties + + @property + def updated_at(self): + """Gets the updated_at of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The updated_at of this SimplePublicObjectWithAssociations. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this SimplePublicObjectWithAssociations. + + + :param updated_at: The updated_at of this SimplePublicObjectWithAssociations. # noqa: E501 + :type updated_at: datetime + """ + if self.local_vars_configuration.client_side_validation and updated_at is None: # noqa: E501 + raise ValueError("Invalid value for `updated_at`, must not be `None`") # noqa: E501 + + 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, SimplePublicObjectWithAssociations): + 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, SimplePublicObjectWithAssociations): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/simple_public_upsert_object.py b/hubspot/crm/objects/leads/models/simple_public_upsert_object.py new file mode 100644 index 00000000..63f44043 --- /dev/null +++ b/hubspot/crm/objects/leads/models/simple_public_upsert_object.py @@ -0,0 +1,314 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class SimplePublicUpsertObject(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 = { + "created_at": "datetime", + "archived": "bool", + "archived_at": "datetime", + "new": "bool", + "properties_with_history": "dict[str, list[ValueWithTimestamp]]", + "id": "str", + "properties": "dict[str, str]", + "updated_at": "datetime", + } + + attribute_map = { + "created_at": "createdAt", + "archived": "archived", + "archived_at": "archivedAt", + "new": "new", + "properties_with_history": "propertiesWithHistory", + "id": "id", + "properties": "properties", + "updated_at": "updatedAt", + } + + def __init__( + self, created_at=None, archived=None, archived_at=None, new=None, properties_with_history=None, id=None, properties=None, updated_at=None, local_vars_configuration=None + ): # noqa: E501 + """SimplePublicUpsertObject - 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._created_at = None + self._archived = None + self._archived_at = None + self._new = None + self._properties_with_history = None + self._id = None + self._properties = None + self._updated_at = None + self.discriminator = None + + self.created_at = created_at + if archived is not None: + self.archived = archived + if archived_at is not None: + self.archived_at = archived_at + self.new = new + if properties_with_history is not None: + self.properties_with_history = properties_with_history + self.id = id + self.properties = properties + self.updated_at = updated_at + + @property + def created_at(self): + """Gets the created_at of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The created_at of this SimplePublicUpsertObject. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this SimplePublicUpsertObject. + + + :param created_at: The created_at of this SimplePublicUpsertObject. # noqa: E501 + :type created_at: datetime + """ + if self.local_vars_configuration.client_side_validation and created_at is None: # noqa: E501 + raise ValueError("Invalid value for `created_at`, must not be `None`") # noqa: E501 + + self._created_at = created_at + + @property + def archived(self): + """Gets the archived of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The archived of this SimplePublicUpsertObject. # noqa: E501 + :rtype: bool + """ + return self._archived + + @archived.setter + def archived(self, archived): + """Sets the archived of this SimplePublicUpsertObject. + + + :param archived: The archived of this SimplePublicUpsertObject. # noqa: E501 + :type archived: bool + """ + + self._archived = archived + + @property + def archived_at(self): + """Gets the archived_at of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The archived_at of this SimplePublicUpsertObject. # noqa: E501 + :rtype: datetime + """ + return self._archived_at + + @archived_at.setter + def archived_at(self, archived_at): + """Sets the archived_at of this SimplePublicUpsertObject. + + + :param archived_at: The archived_at of this SimplePublicUpsertObject. # noqa: E501 + :type archived_at: datetime + """ + + self._archived_at = archived_at + + @property + def new(self): + """Gets the new of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The new of this SimplePublicUpsertObject. # noqa: E501 + :rtype: bool + """ + return self._new + + @new.setter + def new(self, new): + """Sets the new of this SimplePublicUpsertObject. + + + :param new: The new of this SimplePublicUpsertObject. # noqa: E501 + :type new: bool + """ + if self.local_vars_configuration.client_side_validation and new is None: # noqa: E501 + raise ValueError("Invalid value for `new`, must not be `None`") # noqa: E501 + + self._new = new + + @property + def properties_with_history(self): + """Gets the properties_with_history of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The properties_with_history of this SimplePublicUpsertObject. # noqa: E501 + :rtype: dict[str, list[ValueWithTimestamp]] + """ + return self._properties_with_history + + @properties_with_history.setter + def properties_with_history(self, properties_with_history): + """Sets the properties_with_history of this SimplePublicUpsertObject. + + + :param properties_with_history: The properties_with_history of this SimplePublicUpsertObject. # noqa: E501 + :type properties_with_history: dict[str, list[ValueWithTimestamp]] + """ + + self._properties_with_history = properties_with_history + + @property + def id(self): + """Gets the id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The id of this SimplePublicUpsertObject. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SimplePublicUpsertObject. + + + :param id: The id of this SimplePublicUpsertObject. # noqa: E501 + :type id: str + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def properties(self): + """Gets the properties of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The properties of this SimplePublicUpsertObject. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicUpsertObject. + + + :param properties: The properties of this SimplePublicUpsertObject. # noqa: E501 + :type properties: dict[str, str] + """ + if self.local_vars_configuration.client_side_validation and properties is None: # noqa: E501 + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 + + self._properties = properties + + @property + def updated_at(self): + """Gets the updated_at of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The updated_at of this SimplePublicUpsertObject. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this SimplePublicUpsertObject. + + + :param updated_at: The updated_at of this SimplePublicUpsertObject. # noqa: E501 + :type updated_at: datetime + """ + if self.local_vars_configuration.client_side_validation and updated_at is None: # noqa: E501 + raise ValueError("Invalid value for `updated_at`, must not be `None`") # noqa: E501 + + 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, SimplePublicUpsertObject): + 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, SimplePublicUpsertObject): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/models/standard_error.py b/hubspot/crm/objects/leads/models/standard_error.py new file mode 100644 index 00000000..869c7afd --- /dev/null +++ b/hubspot/crm/objects/leads/models/standard_error.py @@ -0,0 +1,304 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.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() diff --git a/hubspot/crm/objects/leads/models/value_with_timestamp.py b/hubspot/crm/objects/leads/models/value_with_timestamp.py new file mode 100644 index 00000000..fbb0aea9 --- /dev/null +++ b/hubspot/crm/objects/leads/models/value_with_timestamp.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Leads + + 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.crm.objects.leads.configuration import Configuration + + +class ValueWithTimestamp(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 = {"source_id": "str", "source_type": "str", "source_label": "str", "updated_by_user_id": "int", "value": "str", "timestamp": "datetime"} + + attribute_map = {"source_id": "sourceId", "source_type": "sourceType", "source_label": "sourceLabel", "updated_by_user_id": "updatedByUserId", "value": "value", "timestamp": "timestamp"} + + def __init__(self, source_id=None, source_type=None, source_label=None, updated_by_user_id=None, value=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + """ValueWithTimestamp - 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._source_id = None + self._source_type = None + self._source_label = None + self._updated_by_user_id = None + self._value = None + self._timestamp = None + self.discriminator = None + + if source_id is not None: + self.source_id = source_id + self.source_type = source_type + if source_label is not None: + self.source_label = source_label + if updated_by_user_id is not None: + self.updated_by_user_id = updated_by_user_id + self.value = value + self.timestamp = timestamp + + @property + def source_id(self): + """Gets the source_id of this ValueWithTimestamp. # noqa: E501 + + + :return: The source_id of this ValueWithTimestamp. # noqa: E501 + :rtype: str + """ + return self._source_id + + @source_id.setter + def source_id(self, source_id): + """Sets the source_id of this ValueWithTimestamp. + + + :param source_id: The source_id of this ValueWithTimestamp. # noqa: E501 + :type source_id: str + """ + + self._source_id = source_id + + @property + def source_type(self): + """Gets the source_type of this ValueWithTimestamp. # noqa: E501 + + + :return: The source_type of this ValueWithTimestamp. # noqa: E501 + :rtype: str + """ + return self._source_type + + @source_type.setter + def source_type(self, source_type): + """Sets the source_type of this ValueWithTimestamp. + + + :param source_type: The source_type of this ValueWithTimestamp. # noqa: E501 + :type source_type: str + """ + if self.local_vars_configuration.client_side_validation and source_type is None: # noqa: E501 + raise ValueError("Invalid value for `source_type`, must not be `None`") # noqa: E501 + + self._source_type = source_type + + @property + def source_label(self): + """Gets the source_label of this ValueWithTimestamp. # noqa: E501 + + + :return: The source_label of this ValueWithTimestamp. # noqa: E501 + :rtype: str + """ + return self._source_label + + @source_label.setter + def source_label(self, source_label): + """Sets the source_label of this ValueWithTimestamp. + + + :param source_label: The source_label of this ValueWithTimestamp. # noqa: E501 + :type source_label: str + """ + + self._source_label = source_label + + @property + def updated_by_user_id(self): + """Gets the updated_by_user_id of this ValueWithTimestamp. # noqa: E501 + + + :return: The updated_by_user_id of this ValueWithTimestamp. # noqa: E501 + :rtype: int + """ + return self._updated_by_user_id + + @updated_by_user_id.setter + def updated_by_user_id(self, updated_by_user_id): + """Sets the updated_by_user_id of this ValueWithTimestamp. + + + :param updated_by_user_id: The updated_by_user_id of this ValueWithTimestamp. # noqa: E501 + :type updated_by_user_id: int + """ + + self._updated_by_user_id = updated_by_user_id + + @property + def value(self): + """Gets the value of this ValueWithTimestamp. # noqa: E501 + + + :return: The value of this ValueWithTimestamp. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this ValueWithTimestamp. + + + :param value: The value of this ValueWithTimestamp. # noqa: E501 + :type value: str + """ + 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 + + @property + def timestamp(self): + """Gets the timestamp of this ValueWithTimestamp. # noqa: E501 + + + :return: The timestamp of this ValueWithTimestamp. # noqa: E501 + :rtype: datetime + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ValueWithTimestamp. + + + :param timestamp: The timestamp of this ValueWithTimestamp. # noqa: E501 + :type timestamp: datetime + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + 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, ValueWithTimestamp): + 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, ValueWithTimestamp): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/leads/rest.py b/hubspot/crm/objects/leads/rest.py new file mode 100644 index 00000000..b438ccef --- /dev/null +++ b/hubspot/crm/objects/leads/rest.py @@ -0,0 +1,213 @@ +# coding: utf-8 + +""" + Leads + + 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 io +import json +import logging +import re +import ssl + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode +import urllib3 + +from hubspot.crm.objects.leads.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args["assert_hostname"] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args["retries"] = configuration.retries + + if configuration.socket_options is not None: + addition_pool_args["socket_options"] = configuration.socket_options + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=configuration.ssl_ca_cert, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, maxsize=maxsize, cert_reqs=cert_reqs, ca_certs=configuration.ssl_ca_cert, cert_file=configuration.cert_file, key_file=configuration.key_file, **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, body=None, post_params=None, _preload_content=True, _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + """ + method = method.upper() + assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] + + if post_params and body: + raise ApiValueError("body parameter cannot be used with post_params parameter.") + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, six.integer_types + (float,)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: + timeout = urllib3.Timeout(connect=_request_timeout[0], read=_request_timeout[1]) + + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: + if query_params: + url += "?" + urlencode(query_params) + if re.search("json", headers["Content-Type"], re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request(method, url, body=request_body, preload_content=_preload_content, timeout=timeout, headers=headers) + elif headers["Content-Type"] == "application/x-www-form-urlencoded": # noqa: E501 + r = self.pool_manager.request(method, url, fields=post_params, encode_multipart=False, preload_content=_preload_content, timeout=timeout, headers=headers) + elif headers["Content-Type"] == "multipart/form-data": + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers["Content-Type"] + r = self.pool_manager.request(method, url, fields=post_params, encode_multipart=True, preload_content=_preload_content, timeout=timeout, headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request(method, url, body=request_body, preload_content=_preload_content, timeout=timeout, headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, fields=query_params, preload_content=_preload_content, timeout=timeout, headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + if r.status == 401: + raise UnauthorizedException(http_resp=r) + + if r.status == 403: + raise ForbiddenException(http_resp=r) + + if r.status == 404: + raise NotFoundException(http_resp=r) + + if 500 <= r.status <= 599: + raise ServiceException(http_resp=r) + + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): + return self.request("GET", url, headers=headers, _preload_content=_preload_content, _request_timeout=_request_timeout, query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): + return self.request("HEAD", url, headers=headers, _preload_content=_preload_content, _request_timeout=_request_timeout, query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, headers=headers, query_params=query_params, post_params=post_params, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, headers=headers, query_params=query_params, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, headers=headers, query_params=query_params, post_params=post_params, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, headers=headers, query_params=query_params, post_params=post_params, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, headers=headers, query_params=query_params, post_params=post_params, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body)