From 9f401c63cbff3772a5f59a21f86435e0c135b31d Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 1 Apr 2025 11:34:58 +0300 Subject: [PATCH 01/49] Codegen Cms Blogs BlogPosts --- hubspot/cms/blogs/blog_posts/__init__.py | 4 +- hubspot/cms/blogs/blog_posts/api/__init__.py | 4 +- .../api/{blog_posts_api.py => basic_api.py} | 2083 ++++------------- hubspot/cms/blogs/blog_posts/api/batch_api.py | 559 +++++ .../blog_posts/api/multi_language_api.py | 666 ++++++ .../cms/blogs/blog_posts/models/blog_post.py | 72 +- 6 files changed, 1730 insertions(+), 1658 deletions(-) rename hubspot/cms/blogs/blog_posts/api/{blog_posts_api.py => basic_api.py} (58%) create mode 100644 hubspot/cms/blogs/blog_posts/api/batch_api.py create mode 100644 hubspot/cms/blogs/blog_posts/api/multi_language_api.py diff --git a/hubspot/cms/blogs/blog_posts/__init__.py b/hubspot/cms/blogs/blog_posts/__init__.py index 4cb412b8..180067d0 100644 --- a/hubspot/cms/blogs/blog_posts/__init__.py +++ b/hubspot/cms/blogs/blog_posts/__init__.py @@ -17,7 +17,9 @@ __version__ = "1.0.0" # import apis into sdk package -from hubspot.cms.blogs.blog_posts.api.blog_posts_api import BlogPostsApi +from hubspot.cms.blogs.blog_posts.api.basic_api import BasicApi +from hubspot.cms.blogs.blog_posts.api.batch_api import BatchApi +from hubspot.cms.blogs.blog_posts.api.multi_language_api import MultiLanguageApi # import ApiClient from hubspot.cms.blogs.blog_posts.api_client import ApiClient diff --git a/hubspot/cms/blogs/blog_posts/api/__init__.py b/hubspot/cms/blogs/blog_posts/api/__init__.py index beb869b6..7056af2d 100644 --- a/hubspot/cms/blogs/blog_posts/api/__init__.py +++ b/hubspot/cms/blogs/blog_posts/api/__init__.py @@ -3,4 +3,6 @@ # flake8: noqa # import apis into api package -from hubspot.cms.blogs.blog_posts.api.blog_posts_api import BlogPostsApi +from hubspot.cms.blogs.blog_posts.api.basic_api import BasicApi +from hubspot.cms.blogs.blog_posts.api.batch_api import BatchApi +from hubspot.cms.blogs.blog_posts.api.multi_language_api import MultiLanguageApi diff --git a/hubspot/cms/blogs/blog_posts/api/blog_posts_api.py b/hubspot/cms/blogs/blog_posts/api/basic_api.py similarity index 58% rename from hubspot/cms/blogs/blog_posts/api/blog_posts_api.py rename to hubspot/cms/blogs/blog_posts/api/basic_api.py index b8cd0cdb..f4a99eaf 100644 --- a/hubspot/cms/blogs/blog_posts/api/blog_posts_api.py +++ b/hubspot/cms/blogs/blog_posts/api/basic_api.py @@ -21,7 +21,7 @@ from hubspot.cms.blogs.blog_posts.exceptions import ApiTypeError, ApiValueError # noqa: F401 -class BlogPostsApi(object): +class BasicApi(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -34,18 +34,18 @@ def __init__(self, api_client=None): self.api_client = api_client def archive(self, object_id, **kwargs): # noqa: E501 - """Delete a Blog Post # noqa: E501 + """Delete a blog post # noqa: E501 - Delete the Blog Post object identified by the id in the path. # noqa: E501 + Delete a blog post 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(object_id, async_req=True) >>> result = thread.get() - :param object_id: The Blog Post id. (required) + :param object_id: The ID of the blog post to delete. (required) :type object_id: str - :param archived: Whether to return only results that have been archived. + :param archived: Whether to return only results that have been deleted. :type archived: bool :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -66,18 +66,18 @@ def archive(self, object_id, **kwargs): # noqa: E501 return self.archive_with_http_info(object_id, **kwargs) # noqa: E501 def archive_with_http_info(self, object_id, **kwargs): # noqa: E501 - """Delete a Blog Post # noqa: E501 + """Delete a blog post # noqa: E501 - Delete the Blog Post object identified by the id in the path. # noqa: E501 + Delete a blog post 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(object_id, async_req=True) >>> result = thread.get() - :param object_id: The Blog Post id. (required) + :param object_id: The ID of the blog post to delete. (required) :type object_id: str - :param archived: Whether to return only results that have been archived. + :param archived: Whether to return only results that have been deleted. :type archived: bool :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -160,18 +160,18 @@ def archive_with_http_info(self, object_id, **kwargs): # noqa: E501 _request_auth=local_var_params.get("_request_auth"), ) - def archive_batch(self, batch_input_string, **kwargs): # noqa: E501 - """Delete a batch of Blog Posts # noqa: E501 + def clone(self, content_clone_request_v_next, **kwargs): # noqa: E501 + """Clone a blog post # noqa: E501 - Delete the Blog Post objects identified in the request body. Note: This is not the same as the in-app `archive` function. To perform a dashboard `archive` send an normal update with the `archivedInDashboard` field set to true. # noqa: E501 + Clone a blog post, making a copy of it in a new blog post. # 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(batch_input_string, async_req=True) + >>> thread = api.clone(content_clone_request_v_next, async_req=True) >>> result = thread.get() - :param batch_input_string: The JSON array of Blog Post ids. (required) - :type batch_input_string: BatchInputString + :param content_clone_request_v_next: The JSON representation of the ContentCloneRequest object. (required) + :type content_clone_request_v_next: ContentCloneRequestVNext :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -185,23 +185,23 @@ def archive_batch(self, batch_input_string, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: BlogPost """ kwargs["_return_http_data_only"] = True - return self.archive_batch_with_http_info(batch_input_string, **kwargs) # noqa: E501 + return self.clone_with_http_info(content_clone_request_v_next, **kwargs) # noqa: E501 - def archive_batch_with_http_info(self, batch_input_string, **kwargs): # noqa: E501 - """Delete a batch of Blog Posts # noqa: E501 + def clone_with_http_info(self, content_clone_request_v_next, **kwargs): # noqa: E501 + """Clone a blog post # noqa: E501 - Delete the Blog Post objects identified in the request body. Note: This is not the same as the in-app `archive` function. To perform a dashboard `archive` send an normal update with the `archivedInDashboard` field set to true. # noqa: E501 + Clone a blog post, making a copy of it in a new blog post. # 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_with_http_info(batch_input_string, async_req=True) + >>> thread = api.clone_with_http_info(content_clone_request_v_next, async_req=True) >>> result = thread.get() - :param batch_input_string: The JSON array of Blog Post ids. (required) - :type batch_input_string: BatchInputString + :param content_clone_request_v_next: The JSON representation of the ContentCloneRequest object. (required) + :type content_clone_request_v_next: ContentCloneRequestVNext :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 @@ -223,22 +223,22 @@ def archive_batch_with_http_info(self, batch_input_string, **kwargs): # noqa: E :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: tuple(BlogPost, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["batch_input_string"] + all_params = ["content_clone_request_v_next"] 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_batch" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method clone" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'batch_input_string' is set - if self.api_client.client_side_validation and local_var_params.get("batch_input_string") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `batch_input_string` when calling `archive_batch`") # noqa: E501 + # verify the required parameter 'content_clone_request_v_next' is set + if self.api_client.client_side_validation and local_var_params.get("content_clone_request_v_next") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `content_clone_request_v_next` when calling `clone`") # noqa: E501 collection_formats = {} @@ -252,10 +252,10 @@ def archive_batch_with_http_info(self, batch_input_string, **kwargs): # noqa: E local_var_files = {} body_params = None - if "batch_input_string" in local_var_params: - body_params = local_var_params["batch_input_string"] + if "content_clone_request_v_next" in local_var_params: + body_params = local_var_params["content_clone_request_v_next"] # HTTP header `Accept` - header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 # HTTP header `Content-Type` content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "POST", body_params)) # noqa: E501 @@ -265,10 +265,12 @@ def archive_batch_with_http_info(self, batch_input_string, **kwargs): # noqa: E # Authentication setting auth_settings = ["oauth2"] # noqa: E501 - response_types_map = {} + response_types_map = { + 200: "BlogPost", + } return self.api_client.call_api( - "/cms/v3/blogs/posts/batch/archive", + "/cms/v3/blogs/posts/clone", "POST", path_params, query_params, @@ -286,18 +288,18 @@ def archive_batch_with_http_info(self, batch_input_string, **kwargs): # noqa: E _request_auth=local_var_params.get("_request_auth"), ) - def attach_to_lang_group(self, attach_to_lang_primary_request_v_next, **kwargs): # noqa: E501 - """Attach a Blog Post to a multi-language group # noqa: E501 + def create(self, blog_post, **kwargs): # noqa: E501 + """Create a new post # noqa: E501 - Attach a Blog Post to a multi-language group. # noqa: E501 + Create a new blog post, specifying its content in the request body. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.attach_to_lang_group(attach_to_lang_primary_request_v_next, async_req=True) + >>> thread = api.create(blog_post, async_req=True) >>> result = thread.get() - :param attach_to_lang_primary_request_v_next: The JSON representation of the AttachToLangPrimaryRequest object. (required) - :type attach_to_lang_primary_request_v_next: AttachToLangPrimaryRequestVNext + :param blog_post: The JSON representation of a new Blog Post. (required) + :type blog_post: BlogPost :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -311,23 +313,23 @@ def attach_to_lang_group(self, attach_to_lang_primary_request_v_next, **kwargs): :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: BlogPost """ kwargs["_return_http_data_only"] = True - return self.attach_to_lang_group_with_http_info(attach_to_lang_primary_request_v_next, **kwargs) # noqa: E501 + return self.create_with_http_info(blog_post, **kwargs) # noqa: E501 - def attach_to_lang_group_with_http_info(self, attach_to_lang_primary_request_v_next, **kwargs): # noqa: E501 - """Attach a Blog Post to a multi-language group # noqa: E501 + def create_with_http_info(self, blog_post, **kwargs): # noqa: E501 + """Create a new post # noqa: E501 - Attach a Blog Post to a multi-language group. # noqa: E501 + Create a new blog post, specifying its content in the request body. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.attach_to_lang_group_with_http_info(attach_to_lang_primary_request_v_next, async_req=True) + >>> thread = api.create_with_http_info(blog_post, async_req=True) >>> result = thread.get() - :param attach_to_lang_primary_request_v_next: The JSON representation of the AttachToLangPrimaryRequest object. (required) - :type attach_to_lang_primary_request_v_next: AttachToLangPrimaryRequestVNext + :param blog_post: The JSON representation of a new Blog Post. (required) + :type blog_post: BlogPost :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 @@ -349,22 +351,22 @@ def attach_to_lang_group_with_http_info(self, attach_to_lang_primary_request_v_n :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: tuple(BlogPost, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["attach_to_lang_primary_request_v_next"] + all_params = ["blog_post"] 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 attach_to_lang_group" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method create" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'attach_to_lang_primary_request_v_next' is set - if self.api_client.client_side_validation and local_var_params.get("attach_to_lang_primary_request_v_next") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `attach_to_lang_primary_request_v_next` when calling `attach_to_lang_group`") # noqa: E501 + # verify the required parameter 'blog_post' is set + if self.api_client.client_side_validation and local_var_params.get("blog_post") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `blog_post` when calling `create`") # noqa: E501 collection_formats = {} @@ -378,10 +380,10 @@ def attach_to_lang_group_with_http_info(self, attach_to_lang_primary_request_v_n local_var_files = {} body_params = None - if "attach_to_lang_primary_request_v_next" in local_var_params: - body_params = local_var_params["attach_to_lang_primary_request_v_next"] + if "blog_post" in local_var_params: + body_params = local_var_params["blog_post"] # HTTP header `Accept` - header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 # HTTP header `Content-Type` content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "POST", body_params)) # noqa: E501 @@ -391,10 +393,12 @@ def attach_to_lang_group_with_http_info(self, attach_to_lang_primary_request_v_n # Authentication setting auth_settings = ["oauth2"] # noqa: E501 - response_types_map = {} + response_types_map = { + 201: "BlogPost", + } return self.api_client.call_api( - "/cms/v3/blogs/posts/multi-language/attach-to-lang-group", + "/cms/v3/blogs/posts", "POST", path_params, query_params, @@ -412,18 +416,22 @@ def attach_to_lang_group_with_http_info(self, attach_to_lang_primary_request_v_n _request_auth=local_var_params.get("_request_auth"), ) - def clone(self, content_clone_request_v_next, **kwargs): # noqa: E501 - """Clone a Blog Post # noqa: E501 + def get_by_id(self, object_id, **kwargs): # noqa: E501 + """Retrieve a blog post # noqa: E501 - Clone a Blog Post. # noqa: E501 + Retrieve a blog post by the post 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.clone(content_clone_request_v_next, async_req=True) + >>> thread = api.get_by_id(object_id, async_req=True) >>> result = thread.get() - :param content_clone_request_v_next: The JSON representation of the ContentCloneRequest object. (required) - :type content_clone_request_v_next: ContentCloneRequestVNext + :param object_id: The ID of the blog post to retrieve. (required) + :type object_id: str + :param archived: Specifies whether to return deleted blog posts. Defaults to `false`. + :type archived: bool + :param _property: Specific properties to return. + :type _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 @@ -440,20 +448,24 @@ def clone(self, content_clone_request_v_next, **kwargs): # noqa: E501 :rtype: BlogPost """ kwargs["_return_http_data_only"] = True - return self.clone_with_http_info(content_clone_request_v_next, **kwargs) # noqa: E501 + return self.get_by_id_with_http_info(object_id, **kwargs) # noqa: E501 - def clone_with_http_info(self, content_clone_request_v_next, **kwargs): # noqa: E501 - """Clone a Blog Post # noqa: E501 + def get_by_id_with_http_info(self, object_id, **kwargs): # noqa: E501 + """Retrieve a blog post # noqa: E501 - Clone a Blog Post. # noqa: E501 + Retrieve a blog post by the post 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.clone_with_http_info(content_clone_request_v_next, async_req=True) + >>> thread = api.get_by_id_with_http_info(object_id, async_req=True) >>> result = thread.get() - :param content_clone_request_v_next: The JSON representation of the ContentCloneRequest object. (required) - :type content_clone_request_v_next: ContentCloneRequestVNext + :param object_id: The ID of the blog post to retrieve. (required) + :type object_id: str + :param archived: Specifies whether to return deleted blog posts. Defaults to `false`. + :type archived: bool + :param _property: Specific properties to return. + :type _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 @@ -480,23 +492,29 @@ def clone_with_http_info(self, content_clone_request_v_next, **kwargs): # noqa: local_var_params = locals() - all_params = ["content_clone_request_v_next"] + all_params = ["object_id", "archived", "_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 clone" % key) + 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 'content_clone_request_v_next' is set - if self.api_client.client_side_validation and local_var_params.get("content_clone_request_v_next") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `content_clone_request_v_next` when calling `clone`") # noqa: E501 + # verify the required parameter 'object_id' is set + if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `object_id` when calling `get_by_id`") # noqa: E501 collection_formats = {} path_params = {} + if "object_id" in local_var_params: + path_params["objectId"] = local_var_params["object_id"] # noqa: E501 query_params = [] + 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("_property") is not None: # noqa: E501 + query_params.append(("property", local_var_params["_property"])) # noqa: E501 header_params = dict(local_var_params.get("_headers", {})) @@ -504,16 +522,9 @@ def clone_with_http_info(self, content_clone_request_v_next, **kwargs): # noqa: local_var_files = {} body_params = None - if "content_clone_request_v_next" in local_var_params: - body_params = local_var_params["content_clone_request_v_next"] # 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 @@ -522,8 +533,8 @@ def clone_with_http_info(self, content_clone_request_v_next, **kwargs): # noqa: } return self.api_client.call_api( - "/cms/v3/blogs/posts/clone", - "POST", + "/cms/v3/blogs/posts/{objectId}", + "GET", path_params, query_params, header_params, @@ -540,18 +551,18 @@ def clone_with_http_info(self, content_clone_request_v_next, **kwargs): # noqa: _request_auth=local_var_params.get("_request_auth"), ) - def create(self, blog_post, **kwargs): # noqa: E501 - """Create a new Blog Post # noqa: E501 + def get_draft_by_id(self, object_id, **kwargs): # noqa: E501 + """Retrieve the full draft version of the Blog Post # noqa: E501 - Create a new Blog Post. # noqa: E501 + Retrieve the full draft version of a blog post. # 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(blog_post, async_req=True) + >>> thread = api.get_draft_by_id(object_id, async_req=True) >>> result = thread.get() - :param blog_post: The JSON representation of a new Blog Post. (required) - :type blog_post: BlogPost + :param object_id: The ID of the blog post to retrieve the draft of. (required) + :type object_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 @@ -568,20 +579,20 @@ def create(self, blog_post, **kwargs): # noqa: E501 :rtype: BlogPost """ kwargs["_return_http_data_only"] = True - return self.create_with_http_info(blog_post, **kwargs) # noqa: E501 + return self.get_draft_by_id_with_http_info(object_id, **kwargs) # noqa: E501 - def create_with_http_info(self, blog_post, **kwargs): # noqa: E501 - """Create a new Blog Post # noqa: E501 + def get_draft_by_id_with_http_info(self, object_id, **kwargs): # noqa: E501 + """Retrieve the full draft version of the Blog Post # noqa: E501 - Create a new Blog Post. # noqa: E501 + Retrieve the full draft version of a blog post. # 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(blog_post, async_req=True) + >>> thread = api.get_draft_by_id_with_http_info(object_id, async_req=True) >>> result = thread.get() - :param blog_post: The JSON representation of a new Blog Post. (required) - :type blog_post: BlogPost + :param object_id: The ID of the blog post to retrieve the draft of. (required) + :type object_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 @@ -608,21 +619,23 @@ def create_with_http_info(self, blog_post, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ["blog_post"] + all_params = ["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 create" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_draft_by_id" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'blog_post' is set - if self.api_client.client_side_validation and local_var_params.get("blog_post") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `blog_post` when calling `create`") # noqa: E501 + # verify the required parameter 'object_id' is set + if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `object_id` when calling `get_draft_by_id`") # noqa: E501 collection_formats = {} path_params = {} + if "object_id" in local_var_params: + path_params["objectId"] = local_var_params["object_id"] # noqa: E501 query_params = [] @@ -632,26 +645,19 @@ def create_with_http_info(self, blog_post, **kwargs): # noqa: E501 local_var_files = {} body_params = None - if "blog_post" in local_var_params: - body_params = local_var_params["blog_post"] # 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: "BlogPost", + 200: "BlogPost", } return self.api_client.call_api( - "/cms/v3/blogs/posts", - "POST", + "/cms/v3/blogs/posts/{objectId}/draft", + "GET", path_params, query_params, header_params, @@ -668,18 +674,38 @@ def create_with_http_info(self, blog_post, **kwargs): # noqa: E501 _request_auth=local_var_params.get("_request_auth"), ) - def create_batch(self, batch_input_blog_post, **kwargs): # noqa: E501 - """Create a batch of Blog Posts # noqa: E501 + def get_page(self, **kwargs): # noqa: E501 + """Get all posts # noqa: E501 - Create the Blog Post objects detailed in the request body. # noqa: E501 + Retrieve all blog posts, with paging and filtering options. This method would be useful for an integration that ingests posts and suggests edits. # 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(batch_input_blog_post, async_req=True) + >>> thread = api.get_page(async_req=True) >>> result = thread.get() - :param batch_input_blog_post: The JSON array of new Blog Posts to create. (required) - :type batch_input_blog_post: BatchInputBlogPost + :param created_at: Only return blog posts created at exactly the specified time. + :type created_at: datetime + :param created_after: Only return blog posts created after the specified time. + :type created_after: datetime + :param created_before: Only return blog posts created before the specified time. + :type created_before: datetime + :param updated_at: Only return blog posts last updated at exactly the specified time. + :type updated_at: datetime + :param updated_after: Only return blog posts last updated after the specified time. + :type updated_after: datetime + :param updated_before: Only return blog posts last updated before the specified time. + :type updated_before: datetime + :param sort: Specifies which fields to use for sorting results. Valid fields are `createdAt` (default), `name`, `updatedAt`, `createdBy`, `updatedBy`. + :type sort: list[str] + :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. + :type after: str + :param limit: The maximum number of results to return. Default is 20. + :type limit: int + :param archived: Specifies whether to return deleted blog posts. Defaults to `false`. + :type archived: bool + :param _property: + :type _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 @@ -693,23 +719,43 @@ def create_batch(self, batch_input_blog_post, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: BatchResponseBlogPost + :rtype: CollectionResponseWithTotalBlogPostForwardPaging """ kwargs["_return_http_data_only"] = True - return self.create_batch_with_http_info(batch_input_blog_post, **kwargs) # noqa: E501 + return self.get_page_with_http_info(**kwargs) # noqa: E501 - def create_batch_with_http_info(self, batch_input_blog_post, **kwargs): # noqa: E501 - """Create a batch of Blog Posts # noqa: E501 + def get_page_with_http_info(self, **kwargs): # noqa: E501 + """Get all posts # noqa: E501 - Create the Blog Post objects detailed in the request body. # noqa: E501 + Retrieve all blog posts, with paging and filtering options. This method would be useful for an integration that ingests posts and suggests edits. # 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_with_http_info(batch_input_blog_post, async_req=True) + >>> thread = api.get_page_with_http_info(async_req=True) >>> result = thread.get() - :param batch_input_blog_post: The JSON array of new Blog Posts to create. (required) - :type batch_input_blog_post: BatchInputBlogPost + :param created_at: Only return blog posts created at exactly the specified time. + :type created_at: datetime + :param created_after: Only return blog posts created after the specified time. + :type created_after: datetime + :param created_before: Only return blog posts created before the specified time. + :type created_before: datetime + :param updated_at: Only return blog posts last updated at exactly the specified time. + :type updated_at: datetime + :param updated_after: Only return blog posts last updated after the specified time. + :type updated_after: datetime + :param updated_before: Only return blog posts last updated before the specified time. + :type updated_before: datetime + :param sort: Specifies which fields to use for sorting results. Valid fields are `createdAt` (default), `name`, `updatedAt`, `createdBy`, `updatedBy`. + :type sort: list[str] + :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. + :type after: str + :param limit: The maximum number of results to return. Default is 20. + :type limit: int + :param archived: Specifies whether to return deleted blog posts. Defaults to `false`. + :type archived: bool + :param _property: + :type _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 @@ -731,28 +777,48 @@ def create_batch_with_http_info(self, batch_input_blog_post, **kwargs): # noqa: :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(BatchResponseBlogPost, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(CollectionResponseWithTotalBlogPostForwardPaging, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["batch_input_blog_post"] + all_params = ["created_at", "created_after", "created_before", "updated_at", "updated_after", "updated_before", "sort", "after", "limit", "archived", "_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 create_batch" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_page" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'batch_input_blog_post' is set - if self.api_client.client_side_validation and local_var_params.get("batch_input_blog_post") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `batch_input_blog_post` when calling `create_batch`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] + if local_var_params.get("created_at") is not None: # noqa: E501 + query_params.append(("createdAt", local_var_params["created_at"])) # noqa: E501 + if local_var_params.get("created_after") is not None: # noqa: E501 + query_params.append(("createdAfter", local_var_params["created_after"])) # noqa: E501 + if local_var_params.get("created_before") is not None: # noqa: E501 + query_params.append(("createdBefore", local_var_params["created_before"])) # noqa: E501 + if local_var_params.get("updated_at") is not None: # noqa: E501 + query_params.append(("updatedAt", local_var_params["updated_at"])) # noqa: E501 + if local_var_params.get("updated_after") is not None: # noqa: E501 + query_params.append(("updatedAfter", local_var_params["updated_after"])) # noqa: E501 + if local_var_params.get("updated_before") is not None: # noqa: E501 + query_params.append(("updatedBefore", local_var_params["updated_before"])) # noqa: E501 + if local_var_params.get("sort") is not None: # noqa: E501 + query_params.append(("sort", local_var_params["sort"])) # noqa: E501 + collection_formats["sort"] = "multi" # 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("limit") is not None: # noqa: E501 + query_params.append(("limit", local_var_params["limit"])) # 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("_property") is not None: # noqa: E501 + query_params.append(("property", local_var_params["_property"])) # noqa: E501 header_params = dict(local_var_params.get("_headers", {})) @@ -760,27 +826,19 @@ def create_batch_with_http_info(self, batch_input_blog_post, **kwargs): # noqa: local_var_files = {} body_params = None - if "batch_input_blog_post" in local_var_params: - body_params = local_var_params["batch_input_blog_post"] # 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: "BatchResponseBlogPost", - 207: "BatchResponseBlogPostWithErrors", + 200: "CollectionResponseWithTotalBlogPostForwardPaging", } return self.api_client.call_api( - "/cms/v3/blogs/posts/batch/create", - "POST", + "/cms/v3/blogs/posts", + "GET", path_params, query_params, header_params, @@ -797,18 +855,20 @@ def create_batch_with_http_info(self, batch_input_blog_post, **kwargs): # noqa: _request_auth=local_var_params.get("_request_auth"), ) - def create_lang_variation(self, blog_post_language_clone_request_v_next, **kwargs): # noqa: E501 - """Create a new language variation # noqa: E501 + def get_previous_version(self, object_id, revision_id, **kwargs): # noqa: E501 + """Retrieve a previous version of a blog post # noqa: E501 - Create a new language variation from an existing Blog Post # noqa: E501 + Retrieve a previous version of a blog post. # 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_lang_variation(blog_post_language_clone_request_v_next, async_req=True) + >>> thread = api.get_previous_version(object_id, revision_id, async_req=True) >>> result = thread.get() - :param blog_post_language_clone_request_v_next: The JSON representation of the BlogPostLanguageCloneRequestVNext object. (required) - :type blog_post_language_clone_request_v_next: BlogPostLanguageCloneRequestVNext + :param object_id: The ID of the blog post. (required) + :type object_id: str + :param revision_id: The ID of the version to retrieve. (required) + :type revision_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 @@ -822,23 +882,25 @@ def create_lang_variation(self, blog_post_language_clone_request_v_next, **kwarg :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: BlogPost + :rtype: VersionBlogPost """ kwargs["_return_http_data_only"] = True - return self.create_lang_variation_with_http_info(blog_post_language_clone_request_v_next, **kwargs) # noqa: E501 + return self.get_previous_version_with_http_info(object_id, revision_id, **kwargs) # noqa: E501 - def create_lang_variation_with_http_info(self, blog_post_language_clone_request_v_next, **kwargs): # noqa: E501 - """Create a new language variation # noqa: E501 + def get_previous_version_with_http_info(self, object_id, revision_id, **kwargs): # noqa: E501 + """Retrieve a previous version of a blog post # noqa: E501 - Create a new language variation from an existing Blog Post # noqa: E501 + Retrieve a previous version of a blog post. # 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_lang_variation_with_http_info(blog_post_language_clone_request_v_next, async_req=True) + >>> thread = api.get_previous_version_with_http_info(object_id, revision_id, async_req=True) >>> result = thread.get() - :param blog_post_language_clone_request_v_next: The JSON representation of the BlogPostLanguageCloneRequestVNext object. (required) - :type blog_post_language_clone_request_v_next: BlogPostLanguageCloneRequestVNext + :param object_id: The ID of the blog post. (required) + :type object_id: str + :param revision_id: The ID of the version to retrieve. (required) + :type revision_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 @@ -860,26 +922,33 @@ def create_lang_variation_with_http_info(self, blog_post_language_clone_request_ :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(BlogPost, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(VersionBlogPost, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["blog_post_language_clone_request_v_next"] + all_params = ["object_id", "revision_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 create_lang_variation" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_previous_version" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'blog_post_language_clone_request_v_next' is set - if self.api_client.client_side_validation and local_var_params.get("blog_post_language_clone_request_v_next") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `blog_post_language_clone_request_v_next` when calling `create_lang_variation`") # noqa: E501 + # verify the required parameter 'object_id' is set + if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `object_id` when calling `get_previous_version`") # noqa: E501 + # verify the required parameter 'revision_id' is set + if self.api_client.client_side_validation and local_var_params.get("revision_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `revision_id` when calling `get_previous_version`") # noqa: E501 collection_formats = {} path_params = {} + if "object_id" in local_var_params: + path_params["objectId"] = local_var_params["object_id"] # noqa: E501 + if "revision_id" in local_var_params: + path_params["revisionId"] = local_var_params["revision_id"] # noqa: E501 query_params = [] @@ -889,26 +958,19 @@ def create_lang_variation_with_http_info(self, blog_post_language_clone_request_ local_var_files = {} body_params = None - if "blog_post_language_clone_request_v_next" in local_var_params: - body_params = local_var_params["blog_post_language_clone_request_v_next"] # 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: "BlogPost", + 200: "VersionBlogPost", } return self.api_client.call_api( - "/cms/v3/blogs/posts/multi-language/create-language-variation", - "POST", + "/cms/v3/blogs/posts/{objectId}/revisions/{revisionId}", + "GET", path_params, query_params, header_params, @@ -925,1235 +987,24 @@ def create_lang_variation_with_http_info(self, blog_post_language_clone_request_ _request_auth=local_var_params.get("_request_auth"), ) - def detach_from_lang_group(self, detach_from_lang_group_request_v_next, **kwargs): # noqa: E501 - """Detach a Blog Post from a multi-language group # noqa: E501 + def get_previous_versions(self, object_id, **kwargs): # noqa: E501 + """Retrieves all previous versions of a post # noqa: E501 - Detach a Blog Post from a multi-language group. # noqa: E501 + Retrieve all the previous versions of a blog post. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.detach_from_lang_group(detach_from_lang_group_request_v_next, async_req=True) + >>> thread = api.get_previous_versions(object_id, async_req=True) >>> result = thread.get() - :param detach_from_lang_group_request_v_next: The JSON representation of the DetachFromLangGroupRequest object. (required) - :type detach_from_lang_group_request_v_next: DetachFromLangGroupRequestVNext - :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.detach_from_lang_group_with_http_info(detach_from_lang_group_request_v_next, **kwargs) # noqa: E501 - - def detach_from_lang_group_with_http_info(self, detach_from_lang_group_request_v_next, **kwargs): # noqa: E501 - """Detach a Blog Post from a multi-language group # noqa: E501 - - Detach a Blog Post from a multi-language group. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.detach_from_lang_group_with_http_info(detach_from_lang_group_request_v_next, async_req=True) - >>> result = thread.get() - - :param detach_from_lang_group_request_v_next: The JSON representation of the DetachFromLangGroupRequest object. (required) - :type detach_from_lang_group_request_v_next: DetachFromLangGroupRequestVNext - :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 = ["detach_from_lang_group_request_v_next"] - 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 detach_from_lang_group" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'detach_from_lang_group_request_v_next' is set - if self.api_client.client_side_validation and local_var_params.get("detach_from_lang_group_request_v_next") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `detach_from_lang_group_request_v_next` when calling `detach_from_lang_group`") # 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 "detach_from_lang_group_request_v_next" in local_var_params: - body_params = local_var_params["detach_from_lang_group_request_v_next"] - # 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( - "/cms/v3/blogs/posts/multi-language/detach-from-lang-group", - "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, object_id, **kwargs): # noqa: E501 - """Retrieve a Blog Post # noqa: E501 - - Retrieve the Blog Post object identified by the id in the path. # 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(object_id, async_req=True) - >>> result = thread.get() - - :param object_id: The Blog Post id. (required) - :type object_id: str - :param archived: Specifies whether to return deleted Blog Posts. Defaults to `false`. - :type archived: bool - :param _property: - :type _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: BlogPost - """ - kwargs["_return_http_data_only"] = True - return self.get_by_id_with_http_info(object_id, **kwargs) # noqa: E501 - - def get_by_id_with_http_info(self, object_id, **kwargs): # noqa: E501 - """Retrieve a Blog Post # noqa: E501 - - Retrieve the Blog Post object identified by the id in the path. # 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(object_id, async_req=True) - >>> result = thread.get() - - :param object_id: The Blog Post id. (required) - :type object_id: str - :param archived: Specifies whether to return deleted Blog Posts. Defaults to `false`. - :type archived: bool - :param _property: - :type _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(BlogPost, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = ["object_id", "archived", "_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 'object_id' is set - if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `object_id` when calling `get_by_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if "object_id" in local_var_params: - path_params["objectId"] = local_var_params["object_id"] # noqa: E501 - - query_params = [] - 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("_property") is not None: # noqa: E501 - query_params.append(("property", local_var_params["_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: "BlogPost", - } - - return self.api_client.call_api( - "/cms/v3/blogs/posts/{objectId}", - "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_draft_by_id(self, object_id, **kwargs): # noqa: E501 - """Retrieve the full draft version of the Blog Post # noqa: E501 - - Retrieve the full draft version of the Blog Post. # 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_draft_by_id(object_id, async_req=True) - >>> result = thread.get() - - :param object_id: The Blog Post id. (required) - :type object_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: BlogPost - """ - kwargs["_return_http_data_only"] = True - return self.get_draft_by_id_with_http_info(object_id, **kwargs) # noqa: E501 - - def get_draft_by_id_with_http_info(self, object_id, **kwargs): # noqa: E501 - """Retrieve the full draft version of the Blog Post # noqa: E501 - - Retrieve the full draft version of the Blog Post. # 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_draft_by_id_with_http_info(object_id, async_req=True) - >>> result = thread.get() - - :param object_id: The Blog Post id. (required) - :type object_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(BlogPost, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = ["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 get_draft_by_id" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'object_id' is set - if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `object_id` when calling `get_draft_by_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if "object_id" in local_var_params: - path_params["objectId"] = local_var_params["object_id"] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get("_headers", {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 - - # Authentication setting - auth_settings = ["oauth2"] # noqa: E501 - - response_types_map = { - 200: "BlogPost", - } - - return self.api_client.call_api( - "/cms/v3/blogs/posts/{objectId}/draft", - "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 - """Get all Blog Posts # noqa: E501 - - Get the list of blog posts. Supports paging and filtering. This method would be useful for an integration that examined these models and used an external service to suggest edits. # 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 created_at: Only return Blog Posts created at exactly the specified time. - :type created_at: datetime - :param created_after: Only return Blog Posts created after the specified time. - :type created_after: datetime - :param created_before: Only return Blog Posts created before the specified time. - :type created_before: datetime - :param updated_at: Only return Blog Posts last updated at exactly the specified time. - :type updated_at: datetime - :param updated_after: Only return Blog Posts last updated after the specified time. - :type updated_after: datetime - :param updated_before: Only return Blog Posts last updated before the specified time. - :type updated_before: datetime - :param sort: Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default. - :type sort: list[str] - :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. - :type after: str - :param limit: The maximum number of results to return. Default is 20. - :type limit: int - :param archived: Specifies whether to return deleted Blog Posts. Defaults to `false`. - :type archived: bool - :param _property: - :type _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: CollectionResponseWithTotalBlogPostForwardPaging - """ - 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 - """Get all Blog Posts # noqa: E501 - - Get the list of blog posts. Supports paging and filtering. This method would be useful for an integration that examined these models and used an external service to suggest edits. # 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 created_at: Only return Blog Posts created at exactly the specified time. - :type created_at: datetime - :param created_after: Only return Blog Posts created after the specified time. - :type created_after: datetime - :param created_before: Only return Blog Posts created before the specified time. - :type created_before: datetime - :param updated_at: Only return Blog Posts last updated at exactly the specified time. - :type updated_at: datetime - :param updated_after: Only return Blog Posts last updated after the specified time. - :type updated_after: datetime - :param updated_before: Only return Blog Posts last updated before the specified time. - :type updated_before: datetime - :param sort: Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default. - :type sort: list[str] - :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. - :type after: str - :param limit: The maximum number of results to return. Default is 20. - :type limit: int - :param archived: Specifies whether to return deleted Blog Posts. Defaults to `false`. - :type archived: bool - :param _property: - :type _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(CollectionResponseWithTotalBlogPostForwardPaging, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = ["created_at", "created_after", "created_before", "updated_at", "updated_after", "updated_before", "sort", "after", "limit", "archived", "_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_page" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get("created_at") is not None: # noqa: E501 - query_params.append(("createdAt", local_var_params["created_at"])) # noqa: E501 - if local_var_params.get("created_after") is not None: # noqa: E501 - query_params.append(("createdAfter", local_var_params["created_after"])) # noqa: E501 - if local_var_params.get("created_before") is not None: # noqa: E501 - query_params.append(("createdBefore", local_var_params["created_before"])) # noqa: E501 - if local_var_params.get("updated_at") is not None: # noqa: E501 - query_params.append(("updatedAt", local_var_params["updated_at"])) # noqa: E501 - if local_var_params.get("updated_after") is not None: # noqa: E501 - query_params.append(("updatedAfter", local_var_params["updated_after"])) # noqa: E501 - if local_var_params.get("updated_before") is not None: # noqa: E501 - query_params.append(("updatedBefore", local_var_params["updated_before"])) # noqa: E501 - if local_var_params.get("sort") is not None: # noqa: E501 - query_params.append(("sort", local_var_params["sort"])) # noqa: E501 - collection_formats["sort"] = "multi" # 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("limit") is not None: # noqa: E501 - query_params.append(("limit", local_var_params["limit"])) # 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("_property") is not None: # noqa: E501 - query_params.append(("property", local_var_params["_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: "CollectionResponseWithTotalBlogPostForwardPaging", - } - - return self.api_client.call_api( - "/cms/v3/blogs/posts", - "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_previous_version(self, object_id, revision_id, **kwargs): # noqa: E501 - """Retrieves a previous version of a blog post # noqa: E501 - - Retrieves a previous version of a blog post. # 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_previous_version(object_id, revision_id, async_req=True) - >>> result = thread.get() - - :param object_id: The Blog Post id. (required) - :type object_id: str - :param revision_id: The Blog Post version id. (required) - :type revision_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: VersionBlogPost - """ - kwargs["_return_http_data_only"] = True - return self.get_previous_version_with_http_info(object_id, revision_id, **kwargs) # noqa: E501 - - def get_previous_version_with_http_info(self, object_id, revision_id, **kwargs): # noqa: E501 - """Retrieves a previous version of a blog post # noqa: E501 - - Retrieves a previous version of a blog post. # 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_previous_version_with_http_info(object_id, revision_id, async_req=True) - >>> result = thread.get() - - :param object_id: The Blog Post id. (required) - :type object_id: str - :param revision_id: The Blog Post version id. (required) - :type revision_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(VersionBlogPost, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = ["object_id", "revision_id"] - all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) - - for key, val in six.iteritems(local_var_params["kwargs"]): - if key not in all_params: - raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_previous_version" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'object_id' is set - if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `object_id` when calling `get_previous_version`") # noqa: E501 - # verify the required parameter 'revision_id' is set - if self.api_client.client_side_validation and local_var_params.get("revision_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `revision_id` when calling `get_previous_version`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if "object_id" in local_var_params: - path_params["objectId"] = local_var_params["object_id"] # noqa: E501 - if "revision_id" in local_var_params: - path_params["revisionId"] = local_var_params["revision_id"] # noqa: E501 - - query_params = [] - - header_params = dict(local_var_params.get("_headers", {})) - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 - - # Authentication setting - auth_settings = ["oauth2"] # noqa: E501 - - response_types_map = { - 200: "VersionBlogPost", - } - - return self.api_client.call_api( - "/cms/v3/blogs/posts/{objectId}/revisions/{revisionId}", - "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_previous_versions(self, object_id, **kwargs): # noqa: E501 - """Retrieves all the previous versions of a blog post # noqa: E501 - - Retrieves all the previous versions of a blog post. # 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_previous_versions(object_id, async_req=True) - >>> result = thread.get() - - :param object_id: The Blog Post id. (required) - :type object_id: str - :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. - :type after: str - :param before: - :type before: str - :param limit: The maximum number of results to return. Default is 100. - :type limit: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: CollectionResponseWithTotalVersionBlogPost - """ - kwargs["_return_http_data_only"] = True - return self.get_previous_versions_with_http_info(object_id, **kwargs) # noqa: E501 - - def get_previous_versions_with_http_info(self, object_id, **kwargs): # noqa: E501 - """Retrieves all the previous versions of a blog post # noqa: E501 - - Retrieves all the previous versions of a blog post. # 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_previous_versions_with_http_info(object_id, async_req=True) - >>> result = thread.get() - - :param object_id: The Blog Post id. (required) - :type object_id: str - :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. - :type after: str - :param before: - :type before: str - :param limit: The maximum number of results to return. Default is 100. - :type limit: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(CollectionResponseWithTotalVersionBlogPost, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = ["object_id", "after", "before", "limit"] - 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_previous_versions" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'object_id' is set - if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `object_id` when calling `get_previous_versions`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if "object_id" in local_var_params: - path_params["objectId"] = local_var_params["object_id"] # noqa: E501 - - query_params = [] - 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("before") is not None: # noqa: E501 - query_params.append(("before", local_var_params["before"])) # noqa: E501 - if local_var_params.get("limit") is not None: # noqa: E501 - query_params.append(("limit", local_var_params["limit"])) # 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: "CollectionResponseWithTotalVersionBlogPost", - } - - return self.api_client.call_api( - "/cms/v3/blogs/posts/{objectId}/revisions", - "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 push_live(self, object_id, **kwargs): # noqa: E501 - """Push Blog Post draft edits live # noqa: E501 - - Take any changes from the draft version of the Blog Post and apply them to the live version. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.push_live(object_id, async_req=True) - >>> result = thread.get() - - :param object_id: The id of the Blog Post for which it's draft will be pushed live. (required) - :type object_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.push_live_with_http_info(object_id, **kwargs) # noqa: E501 - - def push_live_with_http_info(self, object_id, **kwargs): # noqa: E501 - """Push Blog Post draft edits live # noqa: E501 - - Take any changes from the draft version of the Blog Post and apply them to the live version. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.push_live_with_http_info(object_id, async_req=True) - >>> result = thread.get() - - :param object_id: The id of the Blog Post for which it's draft will be pushed live. (required) - :type object_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 = ["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 push_live" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'object_id' is set - if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `object_id` when calling `push_live`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if "object_id" in local_var_params: - path_params["objectId"] = local_var_params["object_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( - "/cms/v3/blogs/posts/{objectId}/draft/push-live", - "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_batch(self, batch_input_string, **kwargs): # noqa: E501 - """Retrieve a batch of Blog Posts # noqa: E501 - - Retrieve the Blog Post objects identified in the request body. # 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(batch_input_string, async_req=True) - >>> result = thread.get() - - :param batch_input_string: The JSON array of Blog Post ids. (required) - :type batch_input_string: BatchInputString - :param archived: Specifies whether to return deleted Blog Posts. Defaults to `false`. - :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: BatchResponseBlogPost - """ - kwargs["_return_http_data_only"] = True - return self.read_batch_with_http_info(batch_input_string, **kwargs) # noqa: E501 - - def read_batch_with_http_info(self, batch_input_string, **kwargs): # noqa: E501 - """Retrieve a batch of Blog Posts # noqa: E501 - - Retrieve the Blog Post objects identified in the request body. # 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_with_http_info(batch_input_string, async_req=True) - >>> result = thread.get() - - :param batch_input_string: The JSON array of Blog Post ids. (required) - :type batch_input_string: BatchInputString - :param archived: Specifies whether to return deleted Blog Posts. Defaults to `false`. - :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(BatchResponseBlogPost, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = ["batch_input_string", "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_batch" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'batch_input_string' is set - if self.api_client.client_side_validation and local_var_params.get("batch_input_string") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `batch_input_string` when calling `read_batch`") # 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_input_string" in local_var_params: - body_params = local_var_params["batch_input_string"] - # 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: "BatchResponseBlogPost", - 207: "BatchResponseBlogPostWithErrors", - } - - return self.api_client.call_api( - "/cms/v3/blogs/posts/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 reset_draft(self, object_id, **kwargs): # noqa: E501 - """Reset the Blog Post draft to the live version # noqa: E501 - - Discards any edits and resets the draft to the live version. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.reset_draft(object_id, async_req=True) - >>> result = thread.get() - - :param object_id: The id of the Blog Post for which it's draft will be reset. (required) - :type object_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.reset_draft_with_http_info(object_id, **kwargs) # noqa: E501 - - def reset_draft_with_http_info(self, object_id, **kwargs): # noqa: E501 - """Reset the Blog Post draft to the live version # noqa: E501 - - Discards any edits and resets the draft to the live version. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.reset_draft_with_http_info(object_id, async_req=True) - >>> result = thread.get() - - :param object_id: The id of the Blog Post for which it's draft will be reset. (required) - :type object_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 = ["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 reset_draft" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'object_id' is set - if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `object_id` when calling `reset_draft`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if "object_id" in local_var_params: - path_params["objectId"] = local_var_params["object_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( - "/cms/v3/blogs/posts/{objectId}/draft/reset", - "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 restore_previous_version(self, object_id, revision_id, **kwargs): # noqa: E501 - """Restore a previous version of a blog post # noqa: E501 - - Takes a specified version of a blog post and restores it. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.restore_previous_version(object_id, revision_id, async_req=True) - >>> result = thread.get() - - :param object_id: The Blog Post id. (required) + :param object_id: The ID of the blog post to retrieve previous versions of. (required) :type object_id: str - :param revision_id: The Blog Post version id to restore. (required) - :type revision_id: str + :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. + :type after: str + :param before: + :type before: str + :param limit: The maximum number of results to return. Default is 100. + :type limit: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2167,25 +1018,29 @@ def restore_previous_version(self, object_id, revision_id, **kwargs): # noqa: E :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: BlogPost + :rtype: CollectionResponseWithTotalVersionBlogPost """ kwargs["_return_http_data_only"] = True - return self.restore_previous_version_with_http_info(object_id, revision_id, **kwargs) # noqa: E501 + return self.get_previous_versions_with_http_info(object_id, **kwargs) # noqa: E501 - def restore_previous_version_with_http_info(self, object_id, revision_id, **kwargs): # noqa: E501 - """Restore a previous version of a blog post # noqa: E501 + def get_previous_versions_with_http_info(self, object_id, **kwargs): # noqa: E501 + """Retrieves all previous versions of a post # noqa: E501 - Takes a specified version of a blog post and restores it. # noqa: E501 + Retrieve all the previous versions of a blog post. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.restore_previous_version_with_http_info(object_id, revision_id, async_req=True) + >>> thread = api.get_previous_versions_with_http_info(object_id, async_req=True) >>> result = thread.get() - :param object_id: The Blog Post id. (required) + :param object_id: The ID of the blog post to retrieve previous versions of. (required) :type object_id: str - :param revision_id: The Blog Post version id to restore. (required) - :type revision_id: str + :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. + :type after: str + :param before: + :type before: str + :param limit: The maximum number of results to return. Default is 100. + :type limit: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -2207,35 +1062,36 @@ def restore_previous_version_with_http_info(self, object_id, revision_id, **kwar :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(BlogPost, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(CollectionResponseWithTotalVersionBlogPost, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["object_id", "revision_id"] + all_params = ["object_id", "after", "before", "limit"] 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 restore_previous_version" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_previous_versions" % key) local_var_params[key] = val del local_var_params["kwargs"] # verify the required parameter 'object_id' is set if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `object_id` when calling `restore_previous_version`") # noqa: E501 - # verify the required parameter 'revision_id' is set - if self.api_client.client_side_validation and local_var_params.get("revision_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `revision_id` when calling `restore_previous_version`") # noqa: E501 + raise ApiValueError("Missing the required parameter `object_id` when calling `get_previous_versions`") # noqa: E501 collection_formats = {} path_params = {} if "object_id" in local_var_params: path_params["objectId"] = local_var_params["object_id"] # noqa: E501 - if "revision_id" in local_var_params: - path_params["revisionId"] = local_var_params["revision_id"] # noqa: E501 query_params = [] + 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("before") is not None: # noqa: E501 + query_params.append(("before", local_var_params["before"])) # noqa: E501 + if local_var_params.get("limit") is not None: # noqa: E501 + query_params.append(("limit", local_var_params["limit"])) # noqa: E501 header_params = dict(local_var_params.get("_headers", {})) @@ -2250,12 +1106,12 @@ def restore_previous_version_with_http_info(self, object_id, revision_id, **kwar auth_settings = ["oauth2"] # noqa: E501 response_types_map = { - 200: "BlogPost", + 200: "CollectionResponseWithTotalVersionBlogPost", } return self.api_client.call_api( - "/cms/v3/blogs/posts/{objectId}/revisions/{revisionId}/restore", - "POST", + "/cms/v3/blogs/posts/{objectId}/revisions", + "GET", path_params, query_params, header_params, @@ -2272,20 +1128,18 @@ def restore_previous_version_with_http_info(self, object_id, revision_id, **kwar _request_auth=local_var_params.get("_request_auth"), ) - def restore_previous_version_to_draft(self, object_id, revision_id, **kwargs): # noqa: E501 - """Restore a previous version of a blog post, to the draft version of the blog post # noqa: E501 + def push_live(self, object_id, **kwargs): # noqa: E501 + """Publish blog post draft # noqa: E501 - Takes a specified version of a blog post, sets it as the new draft version of the blog post. # noqa: E501 + Publish the draft version of the blog post, sending its content to the live page. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.restore_previous_version_to_draft(object_id, revision_id, async_req=True) + >>> thread = api.push_live(object_id, async_req=True) >>> result = thread.get() - :param object_id: The Blog Post id. (required) + :param object_id: The ID of the post to publish. (required) :type object_id: str - :param revision_id: The Blog Post version id to restore. (required) - :type revision_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2299,25 +1153,23 @@ def restore_previous_version_to_draft(self, object_id, revision_id, **kwargs): :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: BlogPost + :rtype: None """ kwargs["_return_http_data_only"] = True - return self.restore_previous_version_to_draft_with_http_info(object_id, revision_id, **kwargs) # noqa: E501 + return self.push_live_with_http_info(object_id, **kwargs) # noqa: E501 - def restore_previous_version_to_draft_with_http_info(self, object_id, revision_id, **kwargs): # noqa: E501 - """Restore a previous version of a blog post, to the draft version of the blog post # noqa: E501 + def push_live_with_http_info(self, object_id, **kwargs): # noqa: E501 + """Publish blog post draft # noqa: E501 - Takes a specified version of a blog post, sets it as the new draft version of the blog post. # noqa: E501 + Publish the draft version of the blog post, sending its content to the live page. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.restore_previous_version_to_draft_with_http_info(object_id, revision_id, async_req=True) + >>> thread = api.push_live_with_http_info(object_id, async_req=True) >>> result = thread.get() - :param object_id: The Blog Post id. (required) + :param object_id: The ID of the post to publish. (required) :type object_id: str - :param revision_id: The Blog Post version id to restore. (required) - :type revision_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -2339,33 +1191,28 @@ def restore_previous_version_to_draft_with_http_info(self, object_id, revision_i :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(BlogPost, status_code(int), headers(HTTPHeaderDict)) + :rtype: None """ local_var_params = locals() - all_params = ["object_id", "revision_id"] + all_params = ["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 restore_previous_version_to_draft" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method push_live" % key) local_var_params[key] = val del local_var_params["kwargs"] # verify the required parameter 'object_id' is set if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `object_id` when calling `restore_previous_version_to_draft`") # noqa: E501 - # verify the required parameter 'revision_id' is set - if self.api_client.client_side_validation and local_var_params.get("revision_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `revision_id` when calling `restore_previous_version_to_draft`") # noqa: E501 + raise ApiValueError("Missing the required parameter `object_id` when calling `push_live`") # noqa: E501 collection_formats = {} path_params = {} if "object_id" in local_var_params: path_params["objectId"] = local_var_params["object_id"] # noqa: E501 - if "revision_id" in local_var_params: - path_params["revisionId"] = local_var_params["revision_id"] # noqa: E501 query_params = [] @@ -2376,17 +1223,15 @@ def restore_previous_version_to_draft_with_http_info(self, object_id, revision_i body_params = None # HTTP header `Accept` - header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 # Authentication setting auth_settings = ["oauth2"] # noqa: E501 - response_types_map = { - 200: "BlogPost", - } + response_types_map = {} return self.api_client.call_api( - "/cms/v3/blogs/posts/{objectId}/revisions/{revisionId}/restore-to-draft", + "/cms/v3/blogs/posts/{objectId}/draft/push-live", "POST", path_params, query_params, @@ -2404,18 +1249,18 @@ def restore_previous_version_to_draft_with_http_info(self, object_id, revision_i _request_auth=local_var_params.get("_request_auth"), ) - def schedule(self, content_schedule_request_v_next, **kwargs): # noqa: E501 - """Schedule a Blog Post to be Published # noqa: E501 + def reset_draft(self, object_id, **kwargs): # noqa: E501 + """Reset post draft to the live version # noqa: E501 - Schedule a Blog Post to be Published. # noqa: E501 + Discard all drafted content, resetting the draft to contain the content in the currently published version. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.schedule(content_schedule_request_v_next, async_req=True) + >>> thread = api.reset_draft(object_id, async_req=True) >>> result = thread.get() - :param content_schedule_request_v_next: The JSON representation of the ContentScheduleRequestVNext object. (required) - :type content_schedule_request_v_next: ContentScheduleRequestVNext + :param object_id: The ID of the blog post to reset. (required) + :type object_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 @@ -2432,20 +1277,20 @@ def schedule(self, content_schedule_request_v_next, **kwargs): # noqa: E501 :rtype: None """ kwargs["_return_http_data_only"] = True - return self.schedule_with_http_info(content_schedule_request_v_next, **kwargs) # noqa: E501 + return self.reset_draft_with_http_info(object_id, **kwargs) # noqa: E501 - def schedule_with_http_info(self, content_schedule_request_v_next, **kwargs): # noqa: E501 - """Schedule a Blog Post to be Published # noqa: E501 + def reset_draft_with_http_info(self, object_id, **kwargs): # noqa: E501 + """Reset post draft to the live version # noqa: E501 - Schedule a Blog Post to be Published. # noqa: E501 + Discard all drafted content, resetting the draft to contain the content in the currently published version. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.schedule_with_http_info(content_schedule_request_v_next, async_req=True) + >>> thread = api.reset_draft_with_http_info(object_id, async_req=True) >>> result = thread.get() - :param content_schedule_request_v_next: The JSON representation of the ContentScheduleRequestVNext object. (required) - :type content_schedule_request_v_next: ContentScheduleRequestVNext + :param object_id: The ID of the blog post to reset. (required) + :type object_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 @@ -2472,21 +1317,23 @@ def schedule_with_http_info(self, content_schedule_request_v_next, **kwargs): # local_var_params = locals() - all_params = ["content_schedule_request_v_next"] + all_params = ["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 schedule" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method reset_draft" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'content_schedule_request_v_next' is set - if self.api_client.client_side_validation and local_var_params.get("content_schedule_request_v_next") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `content_schedule_request_v_next` when calling `schedule`") # noqa: E501 + # verify the required parameter 'object_id' is set + if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `object_id` when calling `reset_draft`") # noqa: E501 collection_formats = {} path_params = {} + if "object_id" in local_var_params: + path_params["objectId"] = local_var_params["object_id"] # noqa: E501 query_params = [] @@ -2496,23 +1343,16 @@ def schedule_with_http_info(self, content_schedule_request_v_next, **kwargs): # local_var_files = {} body_params = None - if "content_schedule_request_v_next" in local_var_params: - body_params = local_var_params["content_schedule_request_v_next"] # 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( - "/cms/v3/blogs/posts/schedule", + "/cms/v3/blogs/posts/{objectId}/draft/reset", "POST", path_params, query_params, @@ -2530,18 +1370,20 @@ def schedule_with_http_info(self, content_schedule_request_v_next, **kwargs): # _request_auth=local_var_params.get("_request_auth"), ) - def set_lang_primary(self, set_new_language_primary_request_v_next, **kwargs): # noqa: E501 - """Set a new primary language # noqa: E501 + def restore_previous_version(self, object_id, revision_id, **kwargs): # noqa: E501 + """Restore a previous version # noqa: E501 - Set the primary language of a multi-language group to the language of the provided post (specified as an id in the request body) # noqa: E501 + Restores a blog post to one of its previous versions. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.set_lang_primary(set_new_language_primary_request_v_next, async_req=True) + >>> thread = api.restore_previous_version(object_id, revision_id, async_req=True) >>> result = thread.get() - :param set_new_language_primary_request_v_next: The JSON representation of the SetNewLanguagePrimaryRequest object. (required) - :type set_new_language_primary_request_v_next: SetNewLanguagePrimaryRequestVNext + :param object_id: The ID of the blog post. (required) + :type object_id: str + :param revision_id: The ID of the version to restore the blog post to. (required) + :type revision_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 @@ -2555,23 +1397,25 @@ def set_lang_primary(self, set_new_language_primary_request_v_next, **kwargs): :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: BlogPost """ kwargs["_return_http_data_only"] = True - return self.set_lang_primary_with_http_info(set_new_language_primary_request_v_next, **kwargs) # noqa: E501 + return self.restore_previous_version_with_http_info(object_id, revision_id, **kwargs) # noqa: E501 - def set_lang_primary_with_http_info(self, set_new_language_primary_request_v_next, **kwargs): # noqa: E501 - """Set a new primary language # noqa: E501 + def restore_previous_version_with_http_info(self, object_id, revision_id, **kwargs): # noqa: E501 + """Restore a previous version # noqa: E501 - Set the primary language of a multi-language group to the language of the provided post (specified as an id in the request body) # noqa: E501 + Restores a blog post to one of its previous versions. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.set_lang_primary_with_http_info(set_new_language_primary_request_v_next, async_req=True) + >>> thread = api.restore_previous_version_with_http_info(object_id, revision_id, async_req=True) >>> result = thread.get() - :param set_new_language_primary_request_v_next: The JSON representation of the SetNewLanguagePrimaryRequest object. (required) - :type set_new_language_primary_request_v_next: SetNewLanguagePrimaryRequestVNext + :param object_id: The ID of the blog post. (required) + :type object_id: str + :param revision_id: The ID of the version to restore the blog post to. (required) + :type revision_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 @@ -2593,26 +1437,33 @@ def set_lang_primary_with_http_info(self, set_new_language_primary_request_v_nex :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: tuple(BlogPost, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["set_new_language_primary_request_v_next"] + all_params = ["object_id", "revision_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 set_lang_primary" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method restore_previous_version" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'set_new_language_primary_request_v_next' is set - if self.api_client.client_side_validation and local_var_params.get("set_new_language_primary_request_v_next") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `set_new_language_primary_request_v_next` when calling `set_lang_primary`") # noqa: E501 + # verify the required parameter 'object_id' is set + if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `object_id` when calling `restore_previous_version`") # noqa: E501 + # verify the required parameter 'revision_id' is set + if self.api_client.client_side_validation and local_var_params.get("revision_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `revision_id` when calling `restore_previous_version`") # noqa: E501 collection_formats = {} path_params = {} + if "object_id" in local_var_params: + path_params["objectId"] = local_var_params["object_id"] # noqa: E501 + if "revision_id" in local_var_params: + path_params["revisionId"] = local_var_params["revision_id"] # noqa: E501 query_params = [] @@ -2622,24 +1473,19 @@ def set_lang_primary_with_http_info(self, set_new_language_primary_request_v_nex local_var_files = {} body_params = None - if "set_new_language_primary_request_v_next" in local_var_params: - body_params = local_var_params["set_new_language_primary_request_v_next"] # 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"], "PUT", body_params)) # noqa: E501 - if content_types_list: - header_params["Content-Type"] = content_types_list + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 # Authentication setting auth_settings = ["oauth2"] # noqa: E501 - response_types_map = {} + response_types_map = { + 200: "BlogPost", + } return self.api_client.call_api( - "/cms/v3/blogs/posts/multi-language/set-new-lang-primary", - "PUT", + "/cms/v3/blogs/posts/{objectId}/revisions/{revisionId}/restore", + "POST", path_params, query_params, header_params, @@ -2656,22 +1502,20 @@ def set_lang_primary_with_http_info(self, set_new_language_primary_request_v_nex _request_auth=local_var_params.get("_request_auth"), ) - def update(self, object_id, blog_post, **kwargs): # noqa: E501 - """Update a Blog Post # noqa: E501 + def restore_previous_version_to_draft(self, object_id, revision_id, **kwargs): # noqa: E501 + """Restore a draft to a previous version # noqa: E501 - Sparse updates a single Blog Post object identified by the id in the path. All the column values need not be specified. Only the that need to be modified can be specified. # noqa: E501 + Takes a specified version of a blog post, sets it as the new draft version of the blog post. # 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(object_id, blog_post, async_req=True) + >>> thread = api.restore_previous_version_to_draft(object_id, revision_id, async_req=True) >>> result = thread.get() - :param object_id: The Blog Post id. (required) + :param object_id: The ID of the blog post. (required) :type object_id: str - :param blog_post: The JSON representation of the updated Blog Post. (required) - :type blog_post: BlogPost - :param archived: Specifies whether to update deleted Blog Posts. Defaults to `false`. - :type archived: bool + :param revision_id: The ID of the version to restore the blog post to. (required) + :type revision_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2688,24 +1532,22 @@ def update(self, object_id, blog_post, **kwargs): # noqa: E501 :rtype: BlogPost """ kwargs["_return_http_data_only"] = True - return self.update_with_http_info(object_id, blog_post, **kwargs) # noqa: E501 + return self.restore_previous_version_to_draft_with_http_info(object_id, revision_id, **kwargs) # noqa: E501 - def update_with_http_info(self, object_id, blog_post, **kwargs): # noqa: E501 - """Update a Blog Post # noqa: E501 + def restore_previous_version_to_draft_with_http_info(self, object_id, revision_id, **kwargs): # noqa: E501 + """Restore a draft to a previous version # noqa: E501 - Sparse updates a single Blog Post object identified by the id in the path. All the column values need not be specified. Only the that need to be modified can be specified. # noqa: E501 + Takes a specified version of a blog post, sets it as the new draft version of the blog post. # 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(object_id, blog_post, async_req=True) + >>> thread = api.restore_previous_version_to_draft_with_http_info(object_id, revision_id, async_req=True) >>> result = thread.get() - :param object_id: The Blog Post id. (required) + :param object_id: The ID of the blog post. (required) :type object_id: str - :param blog_post: The JSON representation of the updated Blog Post. (required) - :type blog_post: BlogPost - :param archived: Specifies whether to update deleted Blog Posts. Defaults to `false`. - :type archived: bool + :param revision_id: The ID of the version to restore the blog post to. (required) + :type revision_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -2732,30 +1574,30 @@ def update_with_http_info(self, object_id, blog_post, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ["object_id", "blog_post", "archived"] + all_params = ["object_id", "revision_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 update" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method restore_previous_version_to_draft" % key) local_var_params[key] = val del local_var_params["kwargs"] # verify the required parameter 'object_id' is set if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `object_id` when calling `update`") # noqa: E501 - # verify the required parameter 'blog_post' is set - if self.api_client.client_side_validation and local_var_params.get("blog_post") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `blog_post` when calling `update`") # noqa: E501 + raise ApiValueError("Missing the required parameter `object_id` when calling `restore_previous_version_to_draft`") # noqa: E501 + # verify the required parameter 'revision_id' is set + if self.api_client.client_side_validation and local_var_params.get("revision_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `revision_id` when calling `restore_previous_version_to_draft`") # noqa: E501 collection_formats = {} path_params = {} if "object_id" in local_var_params: path_params["objectId"] = local_var_params["object_id"] # noqa: E501 + if "revision_id" in local_var_params: + path_params["revisionId"] = local_var_params["revision_id"] # noqa: E501 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", {})) @@ -2763,16 +1605,9 @@ def update_with_http_info(self, object_id, blog_post, **kwargs): # noqa: E501 local_var_files = {} body_params = None - if "blog_post" in local_var_params: - body_params = local_var_params["blog_post"] # 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 @@ -2781,8 +1616,8 @@ def update_with_http_info(self, object_id, blog_post, **kwargs): # noqa: E501 } return self.api_client.call_api( - "/cms/v3/blogs/posts/{objectId}", - "PATCH", + "/cms/v3/blogs/posts/{objectId}/revisions/{revisionId}/restore-to-draft", + "POST", path_params, query_params, header_params, @@ -2799,20 +1634,18 @@ def update_with_http_info(self, object_id, blog_post, **kwargs): # noqa: E501 _request_auth=local_var_params.get("_request_auth"), ) - def update_batch(self, batch_input_json_node, **kwargs): # noqa: E501 - """Update a batch of Blog Posts # noqa: E501 + def schedule(self, content_schedule_request_v_next, **kwargs): # noqa: E501 + """Schedule a post to be published # noqa: E501 - Update the Blog Post objects identified in the request body. # noqa: E501 + Schedule a blog post to be published at a specified time. # 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(batch_input_json_node, async_req=True) + >>> thread = api.schedule(content_schedule_request_v_next, async_req=True) >>> result = thread.get() - :param batch_input_json_node: A JSON array of the JSON representations of the updated Blog Posts. (required) - :type batch_input_json_node: BatchInputJsonNode - :param archived: Specifies whether to update deleted Blog Posts. Defaults to `false`. - :type archived: bool + :param content_schedule_request_v_next: The JSON representation of the ContentScheduleRequestVNext object. (required) + :type content_schedule_request_v_next: ContentScheduleRequestVNext :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2826,25 +1659,23 @@ def update_batch(self, batch_input_json_node, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: BatchResponseBlogPost + :rtype: None """ kwargs["_return_http_data_only"] = True - return self.update_batch_with_http_info(batch_input_json_node, **kwargs) # noqa: E501 + return self.schedule_with_http_info(content_schedule_request_v_next, **kwargs) # noqa: E501 - def update_batch_with_http_info(self, batch_input_json_node, **kwargs): # noqa: E501 - """Update a batch of Blog Posts # noqa: E501 + def schedule_with_http_info(self, content_schedule_request_v_next, **kwargs): # noqa: E501 + """Schedule a post to be published # noqa: E501 - Update the Blog Post objects identified in the request body. # noqa: E501 + Schedule a blog post to be published at a specified time. # 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_with_http_info(batch_input_json_node, async_req=True) + >>> thread = api.schedule_with_http_info(content_schedule_request_v_next, async_req=True) >>> result = thread.get() - :param batch_input_json_node: A JSON array of the JSON representations of the updated Blog Posts. (required) - :type batch_input_json_node: BatchInputJsonNode - :param archived: Specifies whether to update deleted Blog Posts. Defaults to `false`. - :type archived: bool + :param content_schedule_request_v_next: The JSON representation of the ContentScheduleRequestVNext object. (required) + :type content_schedule_request_v_next: ContentScheduleRequestVNext :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 @@ -2866,30 +1697,28 @@ def update_batch_with_http_info(self, batch_input_json_node, **kwargs): # noqa: :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(BatchResponseBlogPost, status_code(int), headers(HTTPHeaderDict)) + :rtype: None """ local_var_params = locals() - all_params = ["batch_input_json_node", "archived"] + all_params = ["content_schedule_request_v_next"] 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_batch" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method schedule" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'batch_input_json_node' is set - if self.api_client.client_side_validation and local_var_params.get("batch_input_json_node") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `batch_input_json_node` when calling `update_batch`") # noqa: E501 + # verify the required parameter 'content_schedule_request_v_next' is set + if self.api_client.client_side_validation and local_var_params.get("content_schedule_request_v_next") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `content_schedule_request_v_next` when calling `schedule`") # 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", {})) @@ -2897,10 +1726,10 @@ def update_batch_with_http_info(self, batch_input_json_node, **kwargs): # noqa: local_var_files = {} body_params = None - if "batch_input_json_node" in local_var_params: - body_params = local_var_params["batch_input_json_node"] + if "content_schedule_request_v_next" in local_var_params: + body_params = local_var_params["content_schedule_request_v_next"] # HTTP header `Accept` - header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 # 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 @@ -2910,13 +1739,10 @@ def update_batch_with_http_info(self, batch_input_json_node, **kwargs): # noqa: # Authentication setting auth_settings = ["oauth2"] # noqa: E501 - response_types_map = { - 200: "BatchResponseBlogPost", - 207: "BatchResponseBlogPostWithErrors", - } + response_types_map = {} return self.api_client.call_api( - "/cms/v3/blogs/posts/batch/update", + "/cms/v3/blogs/posts/schedule", "POST", path_params, query_params, @@ -2934,20 +1760,22 @@ def update_batch_with_http_info(self, batch_input_json_node, **kwargs): # noqa: _request_auth=local_var_params.get("_request_auth"), ) - def update_draft(self, object_id, blog_post, **kwargs): # noqa: E501 - """Update a Blog Post draft # noqa: E501 + def update(self, object_id, blog_post, **kwargs): # noqa: E501 + """Update a post # noqa: E501 - Sparse updates the draft version of a single Blog Post object identified by the id in the path. All the column values need not be specified. Only the that need to be modified can be specified. # noqa: E501 + Partially updates a single blog post by ID. You only need to specify the values that you want to update. # 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_draft(object_id, blog_post, async_req=True) + >>> thread = api.update(object_id, blog_post, async_req=True) >>> result = thread.get() - :param object_id: The Blog Post id. (required) + :param object_id: The ID of the blog post to update. (required) :type object_id: str - :param blog_post: The JSON representation of the updated Blog Post to be applied to the draft. (required) + :param blog_post: The JSON representation of the updated Blog Post. (required) :type blog_post: BlogPost + :param archived: Specifies whether to update deleted blog posts. Defaults to `false`. + :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 @@ -2964,22 +1792,24 @@ def update_draft(self, object_id, blog_post, **kwargs): # noqa: E501 :rtype: BlogPost """ kwargs["_return_http_data_only"] = True - return self.update_draft_with_http_info(object_id, blog_post, **kwargs) # noqa: E501 + return self.update_with_http_info(object_id, blog_post, **kwargs) # noqa: E501 - def update_draft_with_http_info(self, object_id, blog_post, **kwargs): # noqa: E501 - """Update a Blog Post draft # noqa: E501 + def update_with_http_info(self, object_id, blog_post, **kwargs): # noqa: E501 + """Update a post # noqa: E501 - Sparse updates the draft version of a single Blog Post object identified by the id in the path. All the column values need not be specified. Only the that need to be modified can be specified. # noqa: E501 + Partially updates a single blog post by ID. You only need to specify the values that you want to update. # 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_draft_with_http_info(object_id, blog_post, async_req=True) + >>> thread = api.update_with_http_info(object_id, blog_post, async_req=True) >>> result = thread.get() - :param object_id: The Blog Post id. (required) + :param object_id: The ID of the blog post to update. (required) :type object_id: str - :param blog_post: The JSON representation of the updated Blog Post to be applied to the draft. (required) + :param blog_post: The JSON representation of the updated Blog Post. (required) :type blog_post: BlogPost + :param archived: Specifies whether to update deleted blog posts. Defaults to `false`. + :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 @@ -3006,20 +1836,20 @@ def update_draft_with_http_info(self, object_id, blog_post, **kwargs): # noqa: local_var_params = locals() - all_params = ["object_id", "blog_post"] + all_params = ["object_id", "blog_post", "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 update_draft" % key) + 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 'object_id' is set if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `object_id` when calling `update_draft`") # noqa: E501 + raise ApiValueError("Missing the required parameter `object_id` when calling `update`") # noqa: E501 # verify the required parameter 'blog_post' is set if self.api_client.client_side_validation and local_var_params.get("blog_post") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `blog_post` when calling `update_draft`") # noqa: E501 + raise ApiValueError("Missing the required parameter `blog_post` when calling `update`") # noqa: E501 collection_formats = {} @@ -3028,6 +1858,8 @@ def update_draft_with_http_info(self, object_id, blog_post, **kwargs): # noqa: path_params["objectId"] = local_var_params["object_id"] # noqa: E501 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", {})) @@ -3053,7 +1885,7 @@ def update_draft_with_http_info(self, object_id, blog_post, **kwargs): # noqa: } return self.api_client.call_api( - "/cms/v3/blogs/posts/{objectId}/draft", + "/cms/v3/blogs/posts/{objectId}", "PATCH", path_params, query_params, @@ -3071,18 +1903,20 @@ def update_draft_with_http_info(self, object_id, blog_post, **kwargs): # noqa: _request_auth=local_var_params.get("_request_auth"), ) - def update_langs(self, update_languages_request_v_next, **kwargs): # noqa: E501 - """Update languages of multi-language group # noqa: E501 + def update_draft(self, object_id, blog_post, **kwargs): # noqa: E501 + """Update the draft of a post # noqa: E501 - Explicitly set new languages for each Blog Post in a multi-language group. # noqa: E501 + Partially updates the draft version of a single blog post by ID. You only need to specify the values that you want to update. # 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_langs(update_languages_request_v_next, async_req=True) + >>> thread = api.update_draft(object_id, blog_post, async_req=True) >>> result = thread.get() - :param update_languages_request_v_next: The JSON representation of the SetNewLanguagePrimaryRequest object. (required) - :type update_languages_request_v_next: UpdateLanguagesRequestVNext + :param object_id: The ID of the blog post to update the draft of. (required) + :type object_id: str + :param blog_post: The JSON representation of the updated Blog Post to be applied to the draft. (required) + :type blog_post: BlogPost :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -3096,23 +1930,25 @@ def update_langs(self, update_languages_request_v_next, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: BlogPost """ kwargs["_return_http_data_only"] = True - return self.update_langs_with_http_info(update_languages_request_v_next, **kwargs) # noqa: E501 + return self.update_draft_with_http_info(object_id, blog_post, **kwargs) # noqa: E501 - def update_langs_with_http_info(self, update_languages_request_v_next, **kwargs): # noqa: E501 - """Update languages of multi-language group # noqa: E501 + def update_draft_with_http_info(self, object_id, blog_post, **kwargs): # noqa: E501 + """Update the draft of a post # noqa: E501 - Explicitly set new languages for each Blog Post in a multi-language group. # noqa: E501 + Partially updates the draft version of a single blog post by ID. You only need to specify the values that you want to update. # 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_langs_with_http_info(update_languages_request_v_next, async_req=True) + >>> thread = api.update_draft_with_http_info(object_id, blog_post, async_req=True) >>> result = thread.get() - :param update_languages_request_v_next: The JSON representation of the SetNewLanguagePrimaryRequest object. (required) - :type update_languages_request_v_next: UpdateLanguagesRequestVNext + :param object_id: The ID of the blog post to update the draft of. (required) + :type object_id: str + :param blog_post: The JSON representation of the updated Blog Post to be applied to the draft. (required) + :type blog_post: BlogPost :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 @@ -3134,26 +1970,31 @@ def update_langs_with_http_info(self, update_languages_request_v_next, **kwargs) :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: tuple(BlogPost, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["update_languages_request_v_next"] + all_params = ["object_id", "blog_post"] 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_langs" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method update_draft" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'update_languages_request_v_next' is set - if self.api_client.client_side_validation and local_var_params.get("update_languages_request_v_next") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `update_languages_request_v_next` when calling `update_langs`") # noqa: E501 + # verify the required parameter 'object_id' is set + if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `object_id` when calling `update_draft`") # noqa: E501 + # verify the required parameter 'blog_post' is set + if self.api_client.client_side_validation and local_var_params.get("blog_post") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `blog_post` when calling `update_draft`") # noqa: E501 collection_formats = {} path_params = {} + if "object_id" in local_var_params: + path_params["objectId"] = local_var_params["object_id"] # noqa: E501 query_params = [] @@ -3163,24 +2004,26 @@ def update_langs_with_http_info(self, update_languages_request_v_next, **kwargs) local_var_files = {} body_params = None - if "update_languages_request_v_next" in local_var_params: - body_params = local_var_params["update_languages_request_v_next"] + if "blog_post" in local_var_params: + body_params = local_var_params["blog_post"] # HTTP header `Accept` - header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 # HTTP header `Content-Type` - content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "POST", body_params)) # noqa: E501 + 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 = {} + response_types_map = { + 200: "BlogPost", + } return self.api_client.call_api( - "/cms/v3/blogs/posts/multi-language/update-languages", - "POST", + "/cms/v3/blogs/posts/{objectId}/draft", + "PATCH", path_params, query_params, header_params, diff --git a/hubspot/cms/blogs/blog_posts/api/batch_api.py b/hubspot/cms/blogs/blog_posts/api/batch_api.py new file mode 100644 index 00000000..f086d7f8 --- /dev/null +++ b/hubspot/cms/blogs/blog_posts/api/batch_api.py @@ -0,0 +1,559 @@ +# coding: utf-8 + +""" + Posts + + Use these endpoints for interacting with Blog Posts, Blog Authors, and Blog Tags # 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.cms.blogs.blog_posts.api_client import ApiClient +from hubspot.cms.blogs.blog_posts.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_string, **kwargs): # noqa: E501 + """Delete a batch of blog posts # noqa: E501 + + Delete a blog post by ID. Note: This is not the same as the in-app `archive` function. To perform a dashboard `archive` send an normal update with the `archivedInDashboard` field set to `true`. # 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_string, async_req=True) + >>> result = thread.get() + + :param batch_input_string: The JSON array of Blog Post ids. (required) + :type batch_input_string: BatchInputString + :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_string, **kwargs) # noqa: E501 + + def archive_with_http_info(self, batch_input_string, **kwargs): # noqa: E501 + """Delete a batch of blog posts # noqa: E501 + + Delete a blog post by ID. Note: This is not the same as the in-app `archive` function. To perform a dashboard `archive` send an normal update with the `archivedInDashboard` field set to `true`. # 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_string, async_req=True) + >>> result = thread.get() + + :param batch_input_string: The JSON array of Blog Post ids. (required) + :type batch_input_string: BatchInputString + :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_string"] + 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_string' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_string") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_string` 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_string" in local_var_params: + body_params = local_var_params["batch_input_string"] + # 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( + "/cms/v3/blogs/posts/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_blog_post, **kwargs): # noqa: E501 + """Create a batch of blog posts # noqa: E501 + + Create a batch of blog posts, specifying their content in the request body. # 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_blog_post, async_req=True) + >>> result = thread.get() + + :param batch_input_blog_post: The JSON array of new Blog Posts to create. (required) + :type batch_input_blog_post: BatchInputBlogPost + :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: BatchResponseBlogPost + """ + kwargs["_return_http_data_only"] = True + return self.create_with_http_info(batch_input_blog_post, **kwargs) # noqa: E501 + + def create_with_http_info(self, batch_input_blog_post, **kwargs): # noqa: E501 + """Create a batch of blog posts # noqa: E501 + + Create a batch of blog posts, specifying their content in the request body. # 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_blog_post, async_req=True) + >>> result = thread.get() + + :param batch_input_blog_post: The JSON array of new Blog Posts to create. (required) + :type batch_input_blog_post: BatchInputBlogPost + :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(BatchResponseBlogPost, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["batch_input_blog_post"] + 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_blog_post' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_blog_post") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_blog_post` 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_blog_post" in local_var_params: + body_params = local_var_params["batch_input_blog_post"] + # 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: "BatchResponseBlogPost", + 207: "BatchResponseBlogPostWithErrors", + } + + return self.api_client.call_api( + "/cms/v3/blogs/posts/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_input_string, **kwargs): # noqa: E501 + """Retrieve a batch of Blog Posts # noqa: E501 + + Retrieve a batch of blog posts by ID. identified in the request body. # 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_input_string, async_req=True) + >>> result = thread.get() + + :param batch_input_string: The JSON array of Blog Post ids. (required) + :type batch_input_string: BatchInputString + :param archived: Specifies whether to return deleted blog posts Defaults to `false`. + :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: BatchResponseBlogPost + """ + kwargs["_return_http_data_only"] = True + return self.read_with_http_info(batch_input_string, **kwargs) # noqa: E501 + + def read_with_http_info(self, batch_input_string, **kwargs): # noqa: E501 + """Retrieve a batch of Blog Posts # noqa: E501 + + Retrieve a batch of blog posts by ID. identified in the request body. # 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_input_string, async_req=True) + >>> result = thread.get() + + :param batch_input_string: The JSON array of Blog Post ids. (required) + :type batch_input_string: BatchInputString + :param archived: Specifies whether to return deleted blog posts Defaults to `false`. + :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(BatchResponseBlogPost, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["batch_input_string", "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_input_string' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_string") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_string` 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_input_string" in local_var_params: + body_params = local_var_params["batch_input_string"] + # 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: "BatchResponseBlogPost", + 207: "BatchResponseBlogPostWithErrors", + } + + return self.api_client.call_api( + "/cms/v3/blogs/posts/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_json_node, **kwargs): # noqa: E501 + """Update a batch of Blog Posts # noqa: E501 + + Update a batch of blog posts. # 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_json_node, async_req=True) + >>> result = thread.get() + + :param batch_input_json_node: A JSON array of the JSON representations of the updated Blog Posts. (required) + :type batch_input_json_node: BatchInputJsonNode + :param archived: Specifies whether to update deleted Blog Posts. Defaults to `false`. + :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: BatchResponseBlogPost + """ + kwargs["_return_http_data_only"] = True + return self.update_with_http_info(batch_input_json_node, **kwargs) # noqa: E501 + + def update_with_http_info(self, batch_input_json_node, **kwargs): # noqa: E501 + """Update a batch of Blog Posts # noqa: E501 + + Update a batch of blog posts. # 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_json_node, async_req=True) + >>> result = thread.get() + + :param batch_input_json_node: A JSON array of the JSON representations of the updated Blog Posts. (required) + :type batch_input_json_node: BatchInputJsonNode + :param archived: Specifies whether to update deleted Blog Posts. Defaults to `false`. + :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(BatchResponseBlogPost, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["batch_input_json_node", "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 update" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'batch_input_json_node' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_json_node") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_json_node` when calling `update`") # 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_input_json_node" in local_var_params: + body_params = local_var_params["batch_input_json_node"] + # 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: "BatchResponseBlogPost", + 207: "BatchResponseBlogPostWithErrors", + } + + return self.api_client.call_api( + "/cms/v3/blogs/posts/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"), + ) diff --git a/hubspot/cms/blogs/blog_posts/api/multi_language_api.py b/hubspot/cms/blogs/blog_posts/api/multi_language_api.py new file mode 100644 index 00000000..abf7ebb7 --- /dev/null +++ b/hubspot/cms/blogs/blog_posts/api/multi_language_api.py @@ -0,0 +1,666 @@ +# coding: utf-8 + +""" + Posts + + Use these endpoints for interacting with Blog Posts, Blog Authors, and Blog Tags # 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.cms.blogs.blog_posts.api_client import ApiClient +from hubspot.cms.blogs.blog_posts.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class MultiLanguageApi(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 attach_to_lang_group(self, attach_to_lang_primary_request_v_next, **kwargs): # noqa: E501 + """Attach post to a multi-language group # noqa: E501 + + Attach a blog post to a [multi-language group](https://developers.hubspot.com/docs/guides/cms/content/multi-language-content). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.attach_to_lang_group(attach_to_lang_primary_request_v_next, async_req=True) + >>> result = thread.get() + + :param attach_to_lang_primary_request_v_next: The JSON representation of the AttachToLangPrimaryRequest object. (required) + :type attach_to_lang_primary_request_v_next: AttachToLangPrimaryRequestVNext + :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.attach_to_lang_group_with_http_info(attach_to_lang_primary_request_v_next, **kwargs) # noqa: E501 + + def attach_to_lang_group_with_http_info(self, attach_to_lang_primary_request_v_next, **kwargs): # noqa: E501 + """Attach post to a multi-language group # noqa: E501 + + Attach a blog post to a [multi-language group](https://developers.hubspot.com/docs/guides/cms/content/multi-language-content). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.attach_to_lang_group_with_http_info(attach_to_lang_primary_request_v_next, async_req=True) + >>> result = thread.get() + + :param attach_to_lang_primary_request_v_next: The JSON representation of the AttachToLangPrimaryRequest object. (required) + :type attach_to_lang_primary_request_v_next: AttachToLangPrimaryRequestVNext + :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 = ["attach_to_lang_primary_request_v_next"] + 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 attach_to_lang_group" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'attach_to_lang_primary_request_v_next' is set + if self.api_client.client_side_validation and local_var_params.get("attach_to_lang_primary_request_v_next") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `attach_to_lang_primary_request_v_next` when calling `attach_to_lang_group`") # 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 "attach_to_lang_primary_request_v_next" in local_var_params: + body_params = local_var_params["attach_to_lang_primary_request_v_next"] + # 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( + "/cms/v3/blogs/posts/multi-language/attach-to-lang-group", + "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_lang_variation(self, blog_post_language_clone_request_v_next, **kwargs): # noqa: E501 + """Create a language variation # noqa: E501 + + Create a new language variation from an existing blog post # 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_lang_variation(blog_post_language_clone_request_v_next, async_req=True) + >>> result = thread.get() + + :param blog_post_language_clone_request_v_next: The JSON representation of the BlogPostLanguageCloneRequestVNext object. (required) + :type blog_post_language_clone_request_v_next: BlogPostLanguageCloneRequestVNext + :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: BlogPost + """ + kwargs["_return_http_data_only"] = True + return self.create_lang_variation_with_http_info(blog_post_language_clone_request_v_next, **kwargs) # noqa: E501 + + def create_lang_variation_with_http_info(self, blog_post_language_clone_request_v_next, **kwargs): # noqa: E501 + """Create a language variation # noqa: E501 + + Create a new language variation from an existing blog post # 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_lang_variation_with_http_info(blog_post_language_clone_request_v_next, async_req=True) + >>> result = thread.get() + + :param blog_post_language_clone_request_v_next: The JSON representation of the BlogPostLanguageCloneRequestVNext object. (required) + :type blog_post_language_clone_request_v_next: BlogPostLanguageCloneRequestVNext + :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(BlogPost, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["blog_post_language_clone_request_v_next"] + 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_lang_variation" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'blog_post_language_clone_request_v_next' is set + if self.api_client.client_side_validation and local_var_params.get("blog_post_language_clone_request_v_next") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `blog_post_language_clone_request_v_next` when calling `create_lang_variation`") # 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 "blog_post_language_clone_request_v_next" in local_var_params: + body_params = local_var_params["blog_post_language_clone_request_v_next"] + # 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: "BlogPost", + } + + return self.api_client.call_api( + "/cms/v3/blogs/posts/multi-language/create-language-variation", + "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 detach_from_lang_group(self, detach_from_lang_group_request_v_next, **kwargs): # noqa: E501 + """Detach post from a multi-language group # noqa: E501 + + Detach a blog post from a [multi-language group](https://developers.hubspot.com/docs/guides/cms/content/multi-language-content). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.detach_from_lang_group(detach_from_lang_group_request_v_next, async_req=True) + >>> result = thread.get() + + :param detach_from_lang_group_request_v_next: The JSON representation of the DetachFromLangGroupRequest object. (required) + :type detach_from_lang_group_request_v_next: DetachFromLangGroupRequestVNext + :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.detach_from_lang_group_with_http_info(detach_from_lang_group_request_v_next, **kwargs) # noqa: E501 + + def detach_from_lang_group_with_http_info(self, detach_from_lang_group_request_v_next, **kwargs): # noqa: E501 + """Detach post from a multi-language group # noqa: E501 + + Detach a blog post from a [multi-language group](https://developers.hubspot.com/docs/guides/cms/content/multi-language-content). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.detach_from_lang_group_with_http_info(detach_from_lang_group_request_v_next, async_req=True) + >>> result = thread.get() + + :param detach_from_lang_group_request_v_next: The JSON representation of the DetachFromLangGroupRequest object. (required) + :type detach_from_lang_group_request_v_next: DetachFromLangGroupRequestVNext + :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 = ["detach_from_lang_group_request_v_next"] + 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 detach_from_lang_group" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'detach_from_lang_group_request_v_next' is set + if self.api_client.client_side_validation and local_var_params.get("detach_from_lang_group_request_v_next") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `detach_from_lang_group_request_v_next` when calling `detach_from_lang_group`") # 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 "detach_from_lang_group_request_v_next" in local_var_params: + body_params = local_var_params["detach_from_lang_group_request_v_next"] + # 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( + "/cms/v3/blogs/posts/multi-language/detach-from-lang-group", + "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 set_lang_primary(self, set_new_language_primary_request_v_next, **kwargs): # noqa: E501 + """Set a new primary language # noqa: E501 + + Set the primary language of a [multi-language group](https://developers.hubspot.com/docs/guides/cms/content/multi-language-content) to the language of the provided post (specified as an ID in the request body) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.set_lang_primary(set_new_language_primary_request_v_next, async_req=True) + >>> result = thread.get() + + :param set_new_language_primary_request_v_next: The JSON representation of the SetNewLanguagePrimaryRequest object. (required) + :type set_new_language_primary_request_v_next: SetNewLanguagePrimaryRequestVNext + :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.set_lang_primary_with_http_info(set_new_language_primary_request_v_next, **kwargs) # noqa: E501 + + def set_lang_primary_with_http_info(self, set_new_language_primary_request_v_next, **kwargs): # noqa: E501 + """Set a new primary language # noqa: E501 + + Set the primary language of a [multi-language group](https://developers.hubspot.com/docs/guides/cms/content/multi-language-content) to the language of the provided post (specified as an ID in the request body) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.set_lang_primary_with_http_info(set_new_language_primary_request_v_next, async_req=True) + >>> result = thread.get() + + :param set_new_language_primary_request_v_next: The JSON representation of the SetNewLanguagePrimaryRequest object. (required) + :type set_new_language_primary_request_v_next: SetNewLanguagePrimaryRequestVNext + :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 = ["set_new_language_primary_request_v_next"] + 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 set_lang_primary" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'set_new_language_primary_request_v_next' is set + if self.api_client.client_side_validation and local_var_params.get("set_new_language_primary_request_v_next") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `set_new_language_primary_request_v_next` when calling `set_lang_primary`") # 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 "set_new_language_primary_request_v_next" in local_var_params: + body_params = local_var_params["set_new_language_primary_request_v_next"] + # 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"], "PUT", 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( + "/cms/v3/blogs/posts/multi-language/set-new-lang-primary", + "PUT", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) + + def update_langs(self, update_languages_request_v_next, **kwargs): # noqa: E501 + """Update languages of multi-language group # noqa: E501 + + Explicitly set new languages for each post in a [multi-language group](https://developers.hubspot.com/docs/guides/cms/content/multi-language-content). # 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_langs(update_languages_request_v_next, async_req=True) + >>> result = thread.get() + + :param update_languages_request_v_next: The JSON representation of the SetNewLanguagePrimaryRequest object. (required) + :type update_languages_request_v_next: UpdateLanguagesRequestVNext + :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.update_langs_with_http_info(update_languages_request_v_next, **kwargs) # noqa: E501 + + def update_langs_with_http_info(self, update_languages_request_v_next, **kwargs): # noqa: E501 + """Update languages of multi-language group # noqa: E501 + + Explicitly set new languages for each post in a [multi-language group](https://developers.hubspot.com/docs/guides/cms/content/multi-language-content). # 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_langs_with_http_info(update_languages_request_v_next, async_req=True) + >>> result = thread.get() + + :param update_languages_request_v_next: The JSON representation of the SetNewLanguagePrimaryRequest object. (required) + :type update_languages_request_v_next: UpdateLanguagesRequestVNext + :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 = ["update_languages_request_v_next"] + 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_langs" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'update_languages_request_v_next' is set + if self.api_client.client_side_validation and local_var_params.get("update_languages_request_v_next") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `update_languages_request_v_next` when calling `update_langs`") # 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 "update_languages_request_v_next" in local_var_params: + body_params = local_var_params["update_languages_request_v_next"] + # 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( + "/cms/v3/blogs/posts/multi-language/update-languages", + "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/cms/blogs/blog_posts/models/blog_post.py b/hubspot/cms/blogs/blog_posts/models/blog_post.py index cb79aa24..2c341fb9 100644 --- a/hubspot/cms/blogs/blog_posts/models/blog_post.py +++ b/hubspot/cms/blogs/blog_posts/models/blog_post.py @@ -387,7 +387,7 @@ def publish_date(self, publish_date): def language(self): """Gets the language of this BlogPost. # noqa: E501 - The explicitly defined ISO 639 language code of the Blog Post. If null, the Blog Post will default to the language of the ParentBlog. # noqa: E501 + The explicitly defined ISO 639 language code of the post. If null, the post will default to the language of the parent blog. # noqa: E501 :return: The language of this BlogPost. # noqa: E501 :rtype: str @@ -398,7 +398,7 @@ def language(self): def language(self, language): """Sets the language of this BlogPost. - The explicitly defined ISO 639 language code of the Blog Post. If null, the Blog Post will default to the language of the ParentBlog. # noqa: E501 + The explicitly defined ISO 639 language code of the post. If null, the post will default to the language of the parent blog. # noqa: E501 :param language: The language of this BlogPost. # noqa: E501 :type language: str @@ -1272,7 +1272,7 @@ def password(self, password): def html_title(self): """Gets the html_title of this BlogPost. # noqa: E501 - The html title of this Blog Post. # noqa: E501 + The HTML title of the post. # noqa: E501 :return: The html_title of this BlogPost. # noqa: E501 :rtype: str @@ -1283,7 +1283,7 @@ def html_title(self): def html_title(self, html_title): """Sets the html_title of this BlogPost. - The html title of this Blog Post. # noqa: E501 + The HTML title of the post. # noqa: E501 :param html_title: The html_title of this BlogPost. # noqa: E501 :type html_title: str @@ -1345,7 +1345,7 @@ def translations(self, translations): def id(self): """Gets the id of this BlogPost. # noqa: E501 - The unique ID of the Blog Post. # noqa: E501 + The unique ID of the blog post. # noqa: E501 :return: The id of this BlogPost. # noqa: E501 :rtype: str @@ -1356,7 +1356,7 @@ def id(self): def id(self, id): """Sets the id of this BlogPost. - The unique ID of the Blog Post. # noqa: E501 + The unique ID of the blog post. # noqa: E501 :param id: The id of this BlogPost. # noqa: E501 :type id: str @@ -1370,7 +1370,7 @@ def id(self, id): def state(self): """Gets the state of this BlogPost. # noqa: E501 - An ENUM descibing the current state of this Blog Post. # noqa: E501 + An enumeration describing the current publish state of the post. # noqa: E501 :return: The state of this BlogPost. # noqa: E501 :rtype: str @@ -1381,7 +1381,7 @@ def state(self): def state(self, state): """Sets the state of this BlogPost. - An ENUM descibing the current state of this Blog Post. # noqa: E501 + An enumeration describing the current publish state of the post. # noqa: E501 :param state: The state of this BlogPost. # noqa: E501 :type state: str @@ -1397,7 +1397,7 @@ def state(self, state): def slug(self): """Gets the slug of this BlogPost. # noqa: E501 - The path of the this blog post. This field is appended to the domain to construct the url of this post. # noqa: E501 + The URL slug of the blog post. This field is appended to the domain to construct the url of this post. # noqa: E501 :return: The slug of this BlogPost. # noqa: E501 :rtype: str @@ -1408,7 +1408,7 @@ def slug(self): def slug(self, slug): """Sets the slug of this BlogPost. - The path of the this blog post. This field is appended to the domain to construct the url of this post. # noqa: E501 + The URL slug of the blog post. This field is appended to the domain to construct the url of this post. # noqa: E501 :param slug: The slug of this BlogPost. # noqa: E501 :type slug: str @@ -1422,7 +1422,7 @@ def slug(self, slug): def created_by_id(self): """Gets the created_by_id of this BlogPost. # noqa: E501 - The ID of the user that created this Blog Post. # noqa: E501 + The ID of the user that created the post. # noqa: E501 :return: The created_by_id of this BlogPost. # noqa: E501 :rtype: str @@ -1433,7 +1433,7 @@ def created_by_id(self): def created_by_id(self, created_by_id): """Sets the created_by_id of this BlogPost. - The ID of the user that created this Blog Post. # noqa: E501 + The ID of the user that created the post. # noqa: E501 :param created_by_id: The created_by_id of this BlogPost. # noqa: E501 :type created_by_id: str @@ -1596,7 +1596,7 @@ def mab_experiment_id(self, mab_experiment_id): def updated_by_id(self): """Gets the updated_by_id of this BlogPost. # noqa: E501 - The ID of the user that updated this Blog Post. # noqa: E501 + The ID of the user that updated the post. # noqa: E501 :return: The updated_by_id of this BlogPost. # noqa: E501 :rtype: str @@ -1607,7 +1607,7 @@ def updated_by_id(self): def updated_by_id(self, updated_by_id): """Sets the updated_by_id of this BlogPost. - The ID of the user that updated this Blog Post. # noqa: E501 + The ID of the user that updated the post. # noqa: E501 :param updated_by_id: The updated_by_id of this BlogPost. # noqa: E501 :type updated_by_id: str @@ -1621,7 +1621,7 @@ def updated_by_id(self, updated_by_id): def translated_from_id(self): """Gets the translated_from_id of this BlogPost. # noqa: E501 - ID of the primary blog post this object was translated from. # noqa: E501 + ID of the primary blog post that this post was translated from. # noqa: E501 :return: The translated_from_id of this BlogPost. # noqa: E501 :rtype: str @@ -1632,7 +1632,7 @@ def translated_from_id(self): def translated_from_id(self, translated_from_id): """Sets the translated_from_id of this BlogPost. - ID of the primary blog post this object was translated from. # noqa: E501 + ID of the primary blog post that this post was translated from. # noqa: E501 :param translated_from_id: The translated_from_id of this BlogPost. # noqa: E501 :type translated_from_id: str @@ -1769,7 +1769,7 @@ def featured_image(self, featured_image): def author_name(self): """Gets the author_name of this BlogPost. # noqa: E501 - The name of the user that updated this Blog Post. # noqa: E501 + The name of the blog author associated with the post. # noqa: E501 :return: The author_name of this BlogPost. # noqa: E501 :rtype: str @@ -1780,7 +1780,7 @@ def author_name(self): def author_name(self, author_name): """Sets the author_name of this BlogPost. - The name of the user that updated this Blog Post. # noqa: E501 + The name of the blog author associated with the post. # noqa: E501 :param author_name: The author_name of this BlogPost. # noqa: E501 :type author_name: str @@ -1794,7 +1794,7 @@ def author_name(self, author_name): def domain(self): """Gets the domain of this BlogPost. # noqa: E501 - The domain this Blog Post will resolve to. If null, the Blog Post will default to the domain of the ParentBlog. # noqa: E501 + The domain that the post lives on. If null, the post will default to the domain of the parent blog. # noqa: E501 :return: The domain of this BlogPost. # noqa: E501 :rtype: str @@ -1805,7 +1805,7 @@ def domain(self): def domain(self, domain): """Sets the domain of this BlogPost. - The domain this Blog Post will resolve to. If null, the Blog Post will default to the domain of the ParentBlog. # noqa: E501 + The domain that the post lives on. If null, the post will default to the domain of the parent blog. # noqa: E501 :param domain: The domain of this BlogPost. # noqa: E501 :type domain: str @@ -1819,7 +1819,7 @@ def domain(self, domain): def name(self): """Gets the name of this BlogPost. # noqa: E501 - The internal name of the Blog Post. # noqa: E501 + The internal name of the post. # noqa: E501 :return: The name of this BlogPost. # noqa: E501 :rtype: str @@ -1830,7 +1830,7 @@ def name(self): def name(self, name): """Sets the name of this BlogPost. - The internal name of the Blog Post. # noqa: E501 + The internal name of the post. # noqa: E501 :param name: The name of this BlogPost. # noqa: E501 :type name: str @@ -1844,7 +1844,7 @@ def name(self, name): def dynamic_page_hub_db_table_id(self): """Gets the dynamic_page_hub_db_table_id of this BlogPost. # noqa: E501 - The ID of the HubDB table this Blog Post references, if applicable # noqa: E501 + For dynamic HubDB pages, the ID of the HubDB table this post references. # noqa: E501 :return: The dynamic_page_hub_db_table_id of this BlogPost. # noqa: E501 :rtype: str @@ -1855,7 +1855,7 @@ def dynamic_page_hub_db_table_id(self): def dynamic_page_hub_db_table_id(self, dynamic_page_hub_db_table_id): """Sets the dynamic_page_hub_db_table_id of this BlogPost. - The ID of the HubDB table this Blog Post references, if applicable # noqa: E501 + For dynamic HubDB pages, the ID of the HubDB table this post references. # noqa: E501 :param dynamic_page_hub_db_table_id: The dynamic_page_hub_db_table_id of this BlogPost. # noqa: E501 :type dynamic_page_hub_db_table_id: str @@ -1869,7 +1869,7 @@ def dynamic_page_hub_db_table_id(self, dynamic_page_hub_db_table_id): def campaign(self): """Gets the campaign of this BlogPost. # noqa: E501 - The GUID of the marketing campaign this Blog Post is a part of. # noqa: E501 + The GUID of the marketing campaign the post is associated with. # noqa: E501 :return: The campaign of this BlogPost. # noqa: E501 :rtype: str @@ -1880,7 +1880,7 @@ def campaign(self): def campaign(self, campaign): """Sets the campaign of this BlogPost. - The GUID of the marketing campaign this Blog Post is a part of. # noqa: E501 + The GUID of the marketing campaign the post is associated with. # noqa: E501 :param campaign: The campaign of this BlogPost. # noqa: E501 :type campaign: str @@ -2040,7 +2040,7 @@ def footer_html(self, footer_html): def tag_ids(self): """Gets the tag_ids of this BlogPost. # noqa: E501 - List of IDs for the tags associated with this Blog Post. # noqa: E501 + The IDs of the tags associated with this post. # noqa: E501 :return: The tag_ids of this BlogPost. # noqa: E501 :rtype: list[int] @@ -2051,7 +2051,7 @@ def tag_ids(self): def tag_ids(self, tag_ids): """Sets the tag_ids of this BlogPost. - List of IDs for the tags associated with this Blog Post. # noqa: E501 + The IDs of the tags associated with this post. # noqa: E501 :param tag_ids: The tag_ids of this BlogPost. # noqa: E501 :type tag_ids: list[int] @@ -2193,7 +2193,7 @@ def ab_status(self, ab_status): def use_featured_image(self): """Gets the use_featured_image of this BlogPost. # noqa: E501 - Boolean to determine if this post should use a featuredImage. # noqa: E501 + Boolean to determine if this post should use a featured image. # noqa: E501 :return: The use_featured_image of this BlogPost. # noqa: E501 :rtype: bool @@ -2204,7 +2204,7 @@ def use_featured_image(self): def use_featured_image(self, use_featured_image): """Sets the use_featured_image of this BlogPost. - Boolean to determine if this post should use a featuredImage. # noqa: E501 + Boolean to determine if this post should use a featured image. # noqa: E501 :param use_featured_image: The use_featured_image of this BlogPost. # noqa: E501 :type use_featured_image: bool @@ -2268,7 +2268,7 @@ def featured_image_alt_text(self, featured_image_alt_text): def blog_author_id(self): """Gets the blog_author_id of this BlogPost. # noqa: E501 - The ID of the Blog Author associated with this Blog Post. # noqa: E501 + The ID of the blog author associated with this post. # noqa: E501 :return: The blog_author_id of this BlogPost. # noqa: E501 :rtype: str @@ -2279,7 +2279,7 @@ def blog_author_id(self): def blog_author_id(self, blog_author_id): """Sets the blog_author_id of this BlogPost. - The ID of the Blog Author associated with this Blog Post. # noqa: E501 + The ID of the blog author associated with this post. # noqa: E501 :param blog_author_id: The blog_author_id of this BlogPost. # noqa: E501 :type blog_author_id: str @@ -2293,7 +2293,7 @@ def blog_author_id(self, blog_author_id): def content_group_id(self): """Gets the content_group_id of this BlogPost. # noqa: E501 - The ID of the parent Blog this Blog Post is associated with. # noqa: E501 + The ID of the post's parent blog. # noqa: E501 :return: The content_group_id of this BlogPost. # noqa: E501 :rtype: str @@ -2304,7 +2304,7 @@ def content_group_id(self): def content_group_id(self, content_group_id): """Sets the content_group_id of this BlogPost. - The ID of the parent Blog this Blog Post is associated with. # noqa: E501 + The ID of the post's parent blog. # noqa: E501 :param content_group_id: The content_group_id of this BlogPost. # noqa: E501 :type content_group_id: str @@ -2628,7 +2628,7 @@ def current_state(self, current_state): def category_id(self): """Gets the category_id of this BlogPost. # noqa: E501 - ID of the type of object this is. # noqa: E501 + ID of the object type. # noqa: E501 :return: The category_id of this BlogPost. # noqa: E501 :rtype: int @@ -2639,7 +2639,7 @@ def category_id(self): def category_id(self, category_id): """Sets the category_id of this BlogPost. - ID of the type of object this is. # noqa: E501 + ID of the object type. # noqa: E501 :param category_id: The category_id of this BlogPost. # noqa: E501 :type category_id: int From 67fb5a4c599225fcceff373cf0306bcd3db5de50 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 1 Apr 2025 12:16:06 +0300 Subject: [PATCH 02/49] Codegen Webhooks --- hubspot/webhooks/api/settings_api.py | 30 ++++---- hubspot/webhooks/api/subscriptions_api.py | 72 +++++++++++-------- .../models/subscription_create_request.py | 36 +++++++++- .../webhooks/models/subscription_response.py | 36 +++++++++- .../webhooks/models/throttling_settings.py | 36 +--------- 5 files changed, 129 insertions(+), 81 deletions(-) diff --git a/hubspot/webhooks/api/settings_api.py b/hubspot/webhooks/api/settings_api.py index 11759a9f..a82ba77a 100644 --- a/hubspot/webhooks/api/settings_api.py +++ b/hubspot/webhooks/api/settings_api.py @@ -34,15 +34,16 @@ def __init__(self, api_client=None): self.api_client = api_client def clear(self, app_id, **kwargs): # noqa: E501 - """clear # noqa: E501 + """Delete webhook settings # noqa: E501 + Delete the webhook settings for the specified app. Event subscriptions will not be deleted, but will be paused until another webhook is created. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.clear(app_id, async_req=True) >>> result = thread.get() - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -63,15 +64,16 @@ def clear(self, app_id, **kwargs): # noqa: E501 return self.clear_with_http_info(app_id, **kwargs) # noqa: E501 def clear_with_http_info(self, app_id, **kwargs): # noqa: E501 - """clear # noqa: E501 + """Delete webhook settings # noqa: E501 + Delete the webhook settings for the specified app. Event subscriptions will not be deleted, but will be paused until another webhook is created. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.clear_with_http_info(app_id, async_req=True) >>> result = thread.get() - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -153,15 +155,16 @@ def clear_with_http_info(self, app_id, **kwargs): # noqa: E501 ) def configure(self, app_id, settings_change_request, **kwargs): # noqa: E501 - """configure # noqa: E501 + """Update webhook settings # noqa: E501 + Update webhook settings for the specified app. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.configure(app_id, settings_change_request, async_req=True) >>> result = thread.get() - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param settings_change_request: (required) :type settings_change_request: SettingsChangeRequest @@ -184,15 +187,16 @@ def configure(self, app_id, settings_change_request, **kwargs): # noqa: E501 return self.configure_with_http_info(app_id, settings_change_request, **kwargs) # noqa: E501 def configure_with_http_info(self, app_id, settings_change_request, **kwargs): # noqa: E501 - """configure # noqa: E501 + """Update webhook settings # noqa: E501 + Update webhook settings for the specified app. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.configure_with_http_info(app_id, settings_change_request, async_req=True) >>> result = thread.get() - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param settings_change_request: (required) :type settings_change_request: SettingsChangeRequest @@ -288,15 +292,16 @@ def configure_with_http_info(self, app_id, settings_change_request, **kwargs): ) def get_all(self, app_id, **kwargs): # noqa: E501 - """get_all # noqa: E501 + """Read webhook settings # noqa: E501 + Retrieve the webhook settings for the specified app, including the webhook’s target URL, throttle configuration, and create/update date. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_all(app_id, async_req=True) >>> result = thread.get() - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -317,15 +322,16 @@ def get_all(self, app_id, **kwargs): # noqa: E501 return self.get_all_with_http_info(app_id, **kwargs) # noqa: E501 def get_all_with_http_info(self, app_id, **kwargs): # noqa: E501 - """get_all # noqa: E501 + """Read webhook settings # noqa: E501 + Retrieve the webhook settings for the specified app, including the webhook’s target URL, throttle configuration, and create/update date. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_all_with_http_info(app_id, async_req=True) >>> result = thread.get() - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional diff --git a/hubspot/webhooks/api/subscriptions_api.py b/hubspot/webhooks/api/subscriptions_api.py index dc80feb5..22de413f 100644 --- a/hubspot/webhooks/api/subscriptions_api.py +++ b/hubspot/webhooks/api/subscriptions_api.py @@ -34,17 +34,18 @@ def __init__(self, api_client=None): self.api_client = api_client def archive(self, subscription_id, app_id, **kwargs): # noqa: E501 - """archive # noqa: E501 + """Delete event subscription # noqa: E501 + Delete an existing event subscription 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(subscription_id, app_id, async_req=True) >>> result = thread.get() - :param subscription_id: (required) + :param subscription_id: The ID of the event subscription. (required) :type subscription_id: int - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -65,17 +66,18 @@ def archive(self, subscription_id, app_id, **kwargs): # noqa: E501 return self.archive_with_http_info(subscription_id, app_id, **kwargs) # noqa: E501 def archive_with_http_info(self, subscription_id, app_id, **kwargs): # noqa: E501 - """archive # noqa: E501 + """Delete event subscription # noqa: E501 + Delete an existing event subscription 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(subscription_id, app_id, async_req=True) >>> result = thread.get() - :param subscription_id: (required) + :param subscription_id: The ID of the event subscription. (required) :type subscription_id: int - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -162,15 +164,16 @@ def archive_with_http_info(self, subscription_id, app_id, **kwargs): # noqa: E5 ) def create(self, app_id, subscription_create_request, **kwargs): # noqa: E501 - """create # noqa: E501 + """Create an event subscription # noqa: E501 + Create new event subscription for the specified app. # 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(app_id, subscription_create_request, async_req=True) >>> result = thread.get() - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param subscription_create_request: (required) :type subscription_create_request: SubscriptionCreateRequest @@ -193,15 +196,16 @@ def create(self, app_id, subscription_create_request, **kwargs): # noqa: E501 return self.create_with_http_info(app_id, subscription_create_request, **kwargs) # noqa: E501 def create_with_http_info(self, app_id, subscription_create_request, **kwargs): # noqa: E501 - """create # noqa: E501 + """Create an event subscription # noqa: E501 + Create new event subscription for the specified app. # 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(app_id, subscription_create_request, async_req=True) >>> result = thread.get() - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param subscription_create_request: (required) :type subscription_create_request: SubscriptionCreateRequest @@ -297,15 +301,16 @@ def create_with_http_info(self, app_id, subscription_create_request, **kwargs): ) def get_all(self, app_id, **kwargs): # noqa: E501 - """get_all # noqa: E501 + """Read event subscriptions # noqa: E501 + Retrieve event subscriptions for the specified app. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_all(app_id, async_req=True) >>> result = thread.get() - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -326,15 +331,16 @@ def get_all(self, app_id, **kwargs): # noqa: E501 return self.get_all_with_http_info(app_id, **kwargs) # noqa: E501 def get_all_with_http_info(self, app_id, **kwargs): # noqa: E501 - """get_all # noqa: E501 + """Read event subscriptions # noqa: E501 + Retrieve event subscriptions for the specified app. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_all_with_http_info(app_id, async_req=True) >>> result = thread.get() - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -418,17 +424,18 @@ def get_all_with_http_info(self, app_id, **kwargs): # noqa: E501 ) def get_by_id(self, subscription_id, app_id, **kwargs): # noqa: E501 - """get_by_id # noqa: E501 + """Read an event subscription # noqa: E501 + Retrieve a specific event subscription 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.get_by_id(subscription_id, app_id, async_req=True) >>> result = thread.get() - :param subscription_id: (required) + :param subscription_id: The ID of the event subscription. (required) :type subscription_id: int - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -449,17 +456,18 @@ def get_by_id(self, subscription_id, app_id, **kwargs): # noqa: E501 return self.get_by_id_with_http_info(subscription_id, app_id, **kwargs) # noqa: E501 def get_by_id_with_http_info(self, subscription_id, app_id, **kwargs): # noqa: E501 - """get_by_id # noqa: E501 + """Read an event subscription # noqa: E501 + Retrieve a specific event subscription 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.get_by_id_with_http_info(subscription_id, app_id, async_req=True) >>> result = thread.get() - :param subscription_id: (required) + :param subscription_id: The ID of the event subscription. (required) :type subscription_id: int - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -548,17 +556,18 @@ def get_by_id_with_http_info(self, subscription_id, app_id, **kwargs): # noqa: ) def update(self, subscription_id, app_id, subscription_patch_request, **kwargs): # noqa: E501 - """update # noqa: E501 + """Update an event subscription # noqa: E501 + Update an existing event subscription 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.update(subscription_id, app_id, subscription_patch_request, async_req=True) >>> result = thread.get() - :param subscription_id: (required) + :param subscription_id: The ID of the event subscription. (required) :type subscription_id: int - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param subscription_patch_request: (required) :type subscription_patch_request: SubscriptionPatchRequest @@ -581,17 +590,18 @@ def update(self, subscription_id, app_id, subscription_patch_request, **kwargs): return self.update_with_http_info(subscription_id, app_id, subscription_patch_request, **kwargs) # noqa: E501 def update_with_http_info(self, subscription_id, app_id, subscription_patch_request, **kwargs): # noqa: E501 - """update # noqa: E501 + """Update an event subscription # noqa: E501 + Update an existing event subscription 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.update_with_http_info(subscription_id, app_id, subscription_patch_request, async_req=True) >>> result = thread.get() - :param subscription_id: (required) + :param subscription_id: The ID of the event subscription. (required) :type subscription_id: int - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param subscription_patch_request: (required) :type subscription_patch_request: SubscriptionPatchRequest @@ -692,15 +702,16 @@ def update_with_http_info(self, subscription_id, app_id, subscription_patch_requ ) def update_batch(self, app_id, batch_input_subscription_batch_update_request, **kwargs): # noqa: E501 - """update_batch # noqa: E501 + """Batch create event subscriptions # noqa: E501 + Batch create event subscriptions for the specified app. # 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(app_id, batch_input_subscription_batch_update_request, async_req=True) >>> result = thread.get() - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param batch_input_subscription_batch_update_request: (required) :type batch_input_subscription_batch_update_request: BatchInputSubscriptionBatchUpdateRequest @@ -723,15 +734,16 @@ def update_batch(self, app_id, batch_input_subscription_batch_update_request, ** return self.update_batch_with_http_info(app_id, batch_input_subscription_batch_update_request, **kwargs) # noqa: E501 def update_batch_with_http_info(self, app_id, batch_input_subscription_batch_update_request, **kwargs): # noqa: E501 - """update_batch # noqa: E501 + """Batch create event subscriptions # noqa: E501 + Batch create event subscriptions for the specified app. # 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_with_http_info(app_id, batch_input_subscription_batch_update_request, async_req=True) >>> result = thread.get() - :param app_id: (required) + :param app_id: The ID of the app. (required) :type app_id: int :param batch_input_subscription_batch_update_request: (required) :type batch_input_subscription_batch_update_request: BatchInputSubscriptionBatchUpdateRequest diff --git a/hubspot/webhooks/models/subscription_create_request.py b/hubspot/webhooks/models/subscription_create_request.py index 49ad67ce..8bfefcbb 100644 --- a/hubspot/webhooks/models/subscription_create_request.py +++ b/hubspot/webhooks/models/subscription_create_request.py @@ -35,27 +35,51 @@ class SubscriptionCreateRequest(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"property_name": "str", "active": "bool", "event_type": "str"} + openapi_types = {"object_type_id": "str", "property_name": "str", "active": "bool", "event_type": "str"} - attribute_map = {"property_name": "propertyName", "active": "active", "event_type": "eventType"} + attribute_map = {"object_type_id": "objectTypeId", "property_name": "propertyName", "active": "active", "event_type": "eventType"} - def __init__(self, property_name=None, active=None, event_type=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, object_type_id=None, property_name=None, active=None, event_type=None, local_vars_configuration=None): # noqa: E501 """SubscriptionCreateRequest - 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_type_id = None self._property_name = None self._active = None self._event_type = None self.discriminator = None + if object_type_id is not None: + self.object_type_id = object_type_id if property_name is not None: self.property_name = property_name if active is not None: self.active = active self.event_type = event_type + @property + def object_type_id(self): + """Gets the object_type_id of this SubscriptionCreateRequest. # noqa: E501 + + + :return: The object_type_id of this SubscriptionCreateRequest. # noqa: E501 + :rtype: str + """ + return self._object_type_id + + @object_type_id.setter + def object_type_id(self, object_type_id): + """Sets the object_type_id of this SubscriptionCreateRequest. + + + :param object_type_id: The object_type_id of this SubscriptionCreateRequest. # noqa: E501 + :type object_type_id: str + """ + + self._object_type_id = object_type_id + @property def property_name(self): """Gets the property_name of this SubscriptionCreateRequest. # noqa: E501 @@ -166,6 +190,12 @@ def event_type(self, event_type): "deal.associationChange", "ticket.associationChange", "line_item.associationChange", + "object.propertyChange", + "object.creation", + "object.deletion", + "object.merge", + "object.restore", + "object.associationChange", ] # noqa: E501 if self.local_vars_configuration.client_side_validation and event_type not in allowed_values: # noqa: E501 raise ValueError("Invalid value for `event_type` ({0}), must be one of {1}".format(event_type, allowed_values)) # noqa: E501 diff --git a/hubspot/webhooks/models/subscription_response.py b/hubspot/webhooks/models/subscription_response.py index 25ecefb0..e8817f35 100644 --- a/hubspot/webhooks/models/subscription_response.py +++ b/hubspot/webhooks/models/subscription_response.py @@ -35,17 +35,18 @@ class SubscriptionResponse(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"created_at": "datetime", "property_name": "str", "active": "bool", "event_type": "str", "id": "str", "updated_at": "datetime"} + openapi_types = {"created_at": "datetime", "object_type_id": "str", "property_name": "str", "active": "bool", "event_type": "str", "id": "str", "updated_at": "datetime"} - attribute_map = {"created_at": "createdAt", "property_name": "propertyName", "active": "active", "event_type": "eventType", "id": "id", "updated_at": "updatedAt"} + attribute_map = {"created_at": "createdAt", "object_type_id": "objectTypeId", "property_name": "propertyName", "active": "active", "event_type": "eventType", "id": "id", "updated_at": "updatedAt"} - def __init__(self, created_at=None, property_name=None, active=None, event_type=None, id=None, updated_at=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, created_at=None, object_type_id=None, property_name=None, active=None, event_type=None, id=None, updated_at=None, local_vars_configuration=None): # noqa: E501 """SubscriptionResponse - 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._object_type_id = None self._property_name = None self._active = None self._event_type = None @@ -54,6 +55,8 @@ def __init__(self, created_at=None, property_name=None, active=None, event_type= self.discriminator = None self.created_at = created_at + if object_type_id is not None: + self.object_type_id = object_type_id if property_name is not None: self.property_name = property_name self.active = active @@ -87,6 +90,27 @@ def created_at(self, created_at): self._created_at = created_at + @property + def object_type_id(self): + """Gets the object_type_id of this SubscriptionResponse. # noqa: E501 + + + :return: The object_type_id of this SubscriptionResponse. # noqa: E501 + :rtype: str + """ + return self._object_type_id + + @object_type_id.setter + def object_type_id(self, object_type_id): + """Sets the object_type_id of this SubscriptionResponse. + + + :param object_type_id: The object_type_id of this SubscriptionResponse. # noqa: E501 + :type object_type_id: str + """ + + self._object_type_id = object_type_id + @property def property_name(self): """Gets the property_name of this SubscriptionResponse. # noqa: E501 @@ -199,6 +223,12 @@ def event_type(self, event_type): "deal.associationChange", "ticket.associationChange", "line_item.associationChange", + "object.propertyChange", + "object.creation", + "object.deletion", + "object.merge", + "object.restore", + "object.associationChange", ] # noqa: E501 if self.local_vars_configuration.client_side_validation and event_type not in allowed_values: # noqa: E501 raise ValueError("Invalid value for `event_type` ({0}), must be one of {1}".format(event_type, allowed_values)) # noqa: E501 diff --git a/hubspot/webhooks/models/throttling_settings.py b/hubspot/webhooks/models/throttling_settings.py index 7f2fcc53..e327bf4f 100644 --- a/hubspot/webhooks/models/throttling_settings.py +++ b/hubspot/webhooks/models/throttling_settings.py @@ -35,51 +35,21 @@ class ThrottlingSettings(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"period": "str", "max_concurrent_requests": "int"} + openapi_types = {"max_concurrent_requests": "int"} - attribute_map = {"period": "period", "max_concurrent_requests": "maxConcurrentRequests"} + attribute_map = {"max_concurrent_requests": "maxConcurrentRequests"} - def __init__(self, period=None, max_concurrent_requests=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, max_concurrent_requests=None, local_vars_configuration=None): # noqa: E501 """ThrottlingSettings - 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._period = None self._max_concurrent_requests = None self.discriminator = None - self.period = period self.max_concurrent_requests = max_concurrent_requests - @property - def period(self): - """Gets the period of this ThrottlingSettings. # noqa: E501 - - Time scale for this setting. Can be either `SECONDLY` (per second) or `ROLLING_MINUTE` (per minute). # noqa: E501 - - :return: The period of this ThrottlingSettings. # noqa: E501 - :rtype: str - """ - return self._period - - @period.setter - def period(self, period): - """Sets the period of this ThrottlingSettings. - - Time scale for this setting. Can be either `SECONDLY` (per second) or `ROLLING_MINUTE` (per minute). # noqa: E501 - - :param period: The period of this ThrottlingSettings. # noqa: E501 - :type period: str - """ - if self.local_vars_configuration.client_side_validation and period is None: # noqa: E501 - raise ValueError("Invalid value for `period`, must not be `None`") # noqa: E501 - allowed_values = ["SECONDLY", "ROLLING_MINUTE"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and period not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `period` ({0}), must be one of {1}".format(period, allowed_values)) # noqa: E501 - - self._period = period - @property def max_concurrent_requests(self): """Gets the max_concurrent_requests of this ThrottlingSettings. # noqa: E501 From 306180075c0ffbb90ab048dbba8a36bfa8e4767d Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 1 Apr 2025 12:20:37 +0300 Subject: [PATCH 03/49] Codegen Marketing Emails --- hubspot/marketing/emails/__init__.py | 65 + hubspot/marketing/emails/api/__init__.py | 7 + .../emails/api/marketing_emails_api.py | 2350 +++++++++++++++++ .../marketing/emails/api/statistics_api.py | 312 +++ hubspot/marketing/emails/api_client.py | 664 +++++ hubspot/marketing/emails/configuration.py | 439 +++ hubspot/marketing/emails/exceptions.py | 155 ++ hubspot/marketing/emails/models/__init__.py | 48 + .../models/ab_test_create_request_v_next.py | 149 ++ .../models/aggregate_email_statistics.py | 173 ++ ...otal_email_statistic_interval_no_paging.py | 151 ++ ..._with_total_public_email_forward_paging.py | 175 ++ ...esponse_with_total_version_public_email.py | 175 ++ .../models/content_clone_request_v_next.py | 150 ++ .../emails/models/email_create_request.py | 1561 +++++++++++ .../emails/models/email_statistic_interval.py | 145 + .../emails/models/email_statistics_data.py | 205 ++ .../emails/models/email_update_request.py | 1531 +++++++++++ hubspot/marketing/emails/models/error.py | 282 ++ .../marketing/emails/models/error_detail.py | 228 ++ .../marketing/emails/models/forward_paging.py | 121 + hubspot/marketing/emails/models/interval.py | 147 ++ hubspot/marketing/emails/models/next_page.py | 150 ++ hubspot/marketing/emails/models/paging.py | 146 + .../marketing/emails/models/previous_page.py | 150 ++ .../models/public_button_style_settings.py | 169 ++ .../models/public_divider_style_settings.py | 169 ++ .../marketing/emails/models/public_email.py | 1956 ++++++++++++++ .../emails/models/public_email_content.py | 332 +++ .../models/public_email_from_details.py | 175 ++ .../emails/models/public_email_recipients.py | 149 ++ .../models/public_email_style_settings.py | 912 +++++++ .../public_email_subscription_details.py | 175 ++ .../models/public_email_testing_details.py | 309 +++ .../emails/models/public_email_to_details.py | 233 ++ .../emails/models/public_font_style.py | 241 ++ .../emails/models/public_rss_email_details.py | 363 +++ .../models/public_webversion_details.py | 386 +++ .../emails/models/version_public_email.py | 199 ++ .../marketing/emails/models/version_user.py | 178 ++ hubspot/marketing/emails/rest.py | 213 ++ 41 files changed, 15838 insertions(+) create mode 100644 hubspot/marketing/emails/__init__.py create mode 100644 hubspot/marketing/emails/api/__init__.py create mode 100644 hubspot/marketing/emails/api/marketing_emails_api.py create mode 100644 hubspot/marketing/emails/api/statistics_api.py create mode 100644 hubspot/marketing/emails/api_client.py create mode 100644 hubspot/marketing/emails/configuration.py create mode 100644 hubspot/marketing/emails/exceptions.py create mode 100644 hubspot/marketing/emails/models/__init__.py create mode 100644 hubspot/marketing/emails/models/ab_test_create_request_v_next.py create mode 100644 hubspot/marketing/emails/models/aggregate_email_statistics.py create mode 100644 hubspot/marketing/emails/models/collection_response_with_total_email_statistic_interval_no_paging.py create mode 100644 hubspot/marketing/emails/models/collection_response_with_total_public_email_forward_paging.py create mode 100644 hubspot/marketing/emails/models/collection_response_with_total_version_public_email.py create mode 100644 hubspot/marketing/emails/models/content_clone_request_v_next.py create mode 100644 hubspot/marketing/emails/models/email_create_request.py create mode 100644 hubspot/marketing/emails/models/email_statistic_interval.py create mode 100644 hubspot/marketing/emails/models/email_statistics_data.py create mode 100644 hubspot/marketing/emails/models/email_update_request.py create mode 100644 hubspot/marketing/emails/models/error.py create mode 100644 hubspot/marketing/emails/models/error_detail.py create mode 100644 hubspot/marketing/emails/models/forward_paging.py create mode 100644 hubspot/marketing/emails/models/interval.py create mode 100644 hubspot/marketing/emails/models/next_page.py create mode 100644 hubspot/marketing/emails/models/paging.py create mode 100644 hubspot/marketing/emails/models/previous_page.py create mode 100644 hubspot/marketing/emails/models/public_button_style_settings.py create mode 100644 hubspot/marketing/emails/models/public_divider_style_settings.py create mode 100644 hubspot/marketing/emails/models/public_email.py create mode 100644 hubspot/marketing/emails/models/public_email_content.py create mode 100644 hubspot/marketing/emails/models/public_email_from_details.py create mode 100644 hubspot/marketing/emails/models/public_email_recipients.py create mode 100644 hubspot/marketing/emails/models/public_email_style_settings.py create mode 100644 hubspot/marketing/emails/models/public_email_subscription_details.py create mode 100644 hubspot/marketing/emails/models/public_email_testing_details.py create mode 100644 hubspot/marketing/emails/models/public_email_to_details.py create mode 100644 hubspot/marketing/emails/models/public_font_style.py create mode 100644 hubspot/marketing/emails/models/public_rss_email_details.py create mode 100644 hubspot/marketing/emails/models/public_webversion_details.py create mode 100644 hubspot/marketing/emails/models/version_public_email.py create mode 100644 hubspot/marketing/emails/models/version_user.py create mode 100644 hubspot/marketing/emails/rest.py diff --git a/hubspot/marketing/emails/__init__.py b/hubspot/marketing/emails/__init__.py new file mode 100644 index 00000000..5d0d9462 --- /dev/null +++ b/hubspot/marketing/emails/__init__.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Marketing Emails + + 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.marketing.emails.api.marketing_emails_api import MarketingEmailsApi +from hubspot.marketing.emails.api.statistics_api import StatisticsApi + +# import ApiClient +from hubspot.marketing.emails.api_client import ApiClient +from hubspot.marketing.emails.configuration import Configuration +from hubspot.marketing.emails.exceptions import OpenApiException +from hubspot.marketing.emails.exceptions import ApiTypeError +from hubspot.marketing.emails.exceptions import ApiValueError +from hubspot.marketing.emails.exceptions import ApiKeyError +from hubspot.marketing.emails.exceptions import ApiAttributeError +from hubspot.marketing.emails.exceptions import ApiException + +# import models into sdk package +from hubspot.marketing.emails.models.ab_test_create_request_v_next import AbTestCreateRequestVNext +from hubspot.marketing.emails.models.aggregate_email_statistics import AggregateEmailStatistics +from hubspot.marketing.emails.models.collection_response_with_total_email_statistic_interval_no_paging import CollectionResponseWithTotalEmailStatisticIntervalNoPaging +from hubspot.marketing.emails.models.collection_response_with_total_public_email_forward_paging import CollectionResponseWithTotalPublicEmailForwardPaging +from hubspot.marketing.emails.models.collection_response_with_total_version_public_email import CollectionResponseWithTotalVersionPublicEmail +from hubspot.marketing.emails.models.content_clone_request_v_next import ContentCloneRequestVNext +from hubspot.marketing.emails.models.email_create_request import EmailCreateRequest +from hubspot.marketing.emails.models.email_statistic_interval import EmailStatisticInterval +from hubspot.marketing.emails.models.email_statistics_data import EmailStatisticsData +from hubspot.marketing.emails.models.email_update_request import EmailUpdateRequest +from hubspot.marketing.emails.models.error import Error +from hubspot.marketing.emails.models.error_detail import ErrorDetail +from hubspot.marketing.emails.models.forward_paging import ForwardPaging +from hubspot.marketing.emails.models.interval import Interval +from hubspot.marketing.emails.models.next_page import NextPage +from hubspot.marketing.emails.models.paging import Paging +from hubspot.marketing.emails.models.previous_page import PreviousPage +from hubspot.marketing.emails.models.public_button_style_settings import PublicButtonStyleSettings +from hubspot.marketing.emails.models.public_divider_style_settings import PublicDividerStyleSettings +from hubspot.marketing.emails.models.public_email import PublicEmail +from hubspot.marketing.emails.models.public_email_content import PublicEmailContent +from hubspot.marketing.emails.models.public_email_from_details import PublicEmailFromDetails +from hubspot.marketing.emails.models.public_email_recipients import PublicEmailRecipients +from hubspot.marketing.emails.models.public_email_style_settings import PublicEmailStyleSettings +from hubspot.marketing.emails.models.public_email_subscription_details import PublicEmailSubscriptionDetails +from hubspot.marketing.emails.models.public_email_testing_details import PublicEmailTestingDetails +from hubspot.marketing.emails.models.public_email_to_details import PublicEmailToDetails +from hubspot.marketing.emails.models.public_font_style import PublicFontStyle +from hubspot.marketing.emails.models.public_rss_email_details import PublicRssEmailDetails +from hubspot.marketing.emails.models.public_webversion_details import PublicWebversionDetails +from hubspot.marketing.emails.models.version_public_email import VersionPublicEmail +from hubspot.marketing.emails.models.version_user import VersionUser diff --git a/hubspot/marketing/emails/api/__init__.py b/hubspot/marketing/emails/api/__init__.py new file mode 100644 index 00000000..22a9b60f --- /dev/null +++ b/hubspot/marketing/emails/api/__init__.py @@ -0,0 +1,7 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from hubspot.marketing.emails.api.marketing_emails_api import MarketingEmailsApi +from hubspot.marketing.emails.api.statistics_api import StatisticsApi diff --git a/hubspot/marketing/emails/api/marketing_emails_api.py b/hubspot/marketing/emails/api/marketing_emails_api.py new file mode 100644 index 00000000..cc67792b --- /dev/null +++ b/hubspot/marketing/emails/api/marketing_emails_api.py @@ -0,0 +1,2350 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from hubspot.marketing.emails.api_client import ApiClient +from hubspot.marketing.emails.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class MarketingEmailsApi(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, email_id, **kwargs): # noqa: E501 + """Delete a marketing email. # 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(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: The ID of the marketing email to delete. (required) + :type email_id: 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: None + """ + kwargs["_return_http_data_only"] = True + return self.archive_with_http_info(email_id, **kwargs) # noqa: E501 + + def archive_with_http_info(self, email_id, **kwargs): # noqa: E501 + """Delete a marketing email. # 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(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: The ID of the marketing email to delete. (required) + :type email_id: 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: None + """ + + local_var_params = locals() + + all_params = ["email_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 archive" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'email_id' is set + if self.api_client.client_side_validation and local_var_params.get("email_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_id` when calling `archive`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "email_id" in local_var_params: + path_params["emailId"] = local_var_params["email_id"] # noqa: E501 + + 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 + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = {} + + return self.api_client.call_api( + "/marketing/v3/emails/{emailId}", + "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 clone(self, content_clone_request_v_next, **kwargs): # noqa: E501 + """Clone a marketing email. # noqa: E501 + + This will create a duplicate email with the same properties as the original, with the exception of a unique 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.clone(content_clone_request_v_next, async_req=True) + >>> result = thread.get() + + :param content_clone_request_v_next: (required) + :type content_clone_request_v_next: ContentCloneRequestVNext + :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: PublicEmail + """ + kwargs["_return_http_data_only"] = True + return self.clone_with_http_info(content_clone_request_v_next, **kwargs) # noqa: E501 + + def clone_with_http_info(self, content_clone_request_v_next, **kwargs): # noqa: E501 + """Clone a marketing email. # noqa: E501 + + This will create a duplicate email with the same properties as the original, with the exception of a unique 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.clone_with_http_info(content_clone_request_v_next, async_req=True) + >>> result = thread.get() + + :param content_clone_request_v_next: (required) + :type content_clone_request_v_next: ContentCloneRequestVNext + :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(PublicEmail, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["content_clone_request_v_next"] + 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 clone" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'content_clone_request_v_next' is set + if self.api_client.client_side_validation and local_var_params.get("content_clone_request_v_next") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `content_clone_request_v_next` when calling `clone`") # 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 "content_clone_request_v_next" in local_var_params: + body_params = local_var_params["content_clone_request_v_next"] + # 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: "PublicEmail", + } + + return self.api_client.call_api( + "/marketing/v3/emails/clone", + "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, email_create_request, **kwargs): # noqa: E501 + """Create a new marketing email. # noqa: E501 + + Use this endpoint to create a new marketing email. # 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(email_create_request, async_req=True) + >>> result = thread.get() + + :param email_create_request: (required) + :type email_create_request: EmailCreateRequest + :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: PublicEmail + """ + kwargs["_return_http_data_only"] = True + return self.create_with_http_info(email_create_request, **kwargs) # noqa: E501 + + def create_with_http_info(self, email_create_request, **kwargs): # noqa: E501 + """Create a new marketing email. # noqa: E501 + + Use this endpoint to create a new marketing email. # 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(email_create_request, async_req=True) + >>> result = thread.get() + + :param email_create_request: (required) + :type email_create_request: EmailCreateRequest + :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(PublicEmail, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["email_create_request"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method create" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'email_create_request' is set + if self.api_client.client_side_validation and local_var_params.get("email_create_request") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_create_request` 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 "email_create_request" in local_var_params: + body_params = local_var_params["email_create_request"] + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "POST", body_params)) # noqa: E501 + if content_types_list: + header_params["Content-Type"] = content_types_list + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 201: "PublicEmail", + } + + return self.api_client.call_api( + "/marketing/v3/emails/", + "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_ab_test_variation(self, ab_test_create_request_v_next, **kwargs): # noqa: E501 + """Create an A/B test variation of a marketing email. # noqa: E501 + + Create a variation of a marketing email for an A/B test. The new variation will be created as a draft. If an active variation already exists, a new one won't be created. # 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_ab_test_variation(ab_test_create_request_v_next, async_req=True) + >>> result = thread.get() + + :param ab_test_create_request_v_next: (required) + :type ab_test_create_request_v_next: AbTestCreateRequestVNext + :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: PublicEmail + """ + kwargs["_return_http_data_only"] = True + return self.create_ab_test_variation_with_http_info(ab_test_create_request_v_next, **kwargs) # noqa: E501 + + def create_ab_test_variation_with_http_info(self, ab_test_create_request_v_next, **kwargs): # noqa: E501 + """Create an A/B test variation of a marketing email. # noqa: E501 + + Create a variation of a marketing email for an A/B test. The new variation will be created as a draft. If an active variation already exists, a new one won't be created. # 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_ab_test_variation_with_http_info(ab_test_create_request_v_next, async_req=True) + >>> result = thread.get() + + :param ab_test_create_request_v_next: (required) + :type ab_test_create_request_v_next: AbTestCreateRequestVNext + :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(PublicEmail, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["ab_test_create_request_v_next"] + 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_ab_test_variation" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'ab_test_create_request_v_next' is set + if self.api_client.client_side_validation and local_var_params.get("ab_test_create_request_v_next") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `ab_test_create_request_v_next` when calling `create_ab_test_variation`") # 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 "ab_test_create_request_v_next" in local_var_params: + body_params = local_var_params["ab_test_create_request_v_next"] + # 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: "PublicEmail", + } + + return self.api_client.call_api( + "/marketing/v3/emails/ab-test/create-variation", + "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_ab_test_variation(self, email_id, **kwargs): # noqa: E501 + """Get the variation of a an A/B marketing email # noqa: E501 + + This endpoint lets you obtain the variation of an A/B marketing email. If the email is variation A (master) it will return variation B (variant) and vice versa. # 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_ab_test_variation(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: The ID of an A/B marketing email. (required) + :type email_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: PublicEmail + """ + kwargs["_return_http_data_only"] = True + return self.get_ab_test_variation_with_http_info(email_id, **kwargs) # noqa: E501 + + def get_ab_test_variation_with_http_info(self, email_id, **kwargs): # noqa: E501 + """Get the variation of a an A/B marketing email # noqa: E501 + + This endpoint lets you obtain the variation of an A/B marketing email. If the email is variation A (master) it will return variation B (variant) and vice versa. # 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_ab_test_variation_with_http_info(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: The ID of an A/B marketing email. (required) + :type email_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(PublicEmail, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["email_id"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_ab_test_variation" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'email_id' is set + if self.api_client.client_side_validation and local_var_params.get("email_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_id` when calling `get_ab_test_variation`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "email_id" in local_var_params: + path_params["emailId"] = local_var_params["email_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 200: "PublicEmail", + } + + return self.api_client.call_api( + "/marketing/v3/emails/{emailId}/ab-test/get-variation", + "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_by_id(self, email_id, **kwargs): # noqa: E501 + """Get the details of a specified marketing email. # noqa: E501 + + Get the details for a marketing email. # 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(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_id: str + :param include_stats: Include statistics with email + :type include_stats: bool + :param marketing_campaign_names: + :type marketing_campaign_names: bool + :param workflow_names: + :type workflow_names: bool + :param included_properties: + :type included_properties: 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: PublicEmail + """ + kwargs["_return_http_data_only"] = True + return self.get_by_id_with_http_info(email_id, **kwargs) # noqa: E501 + + def get_by_id_with_http_info(self, email_id, **kwargs): # noqa: E501 + """Get the details of a specified marketing email. # noqa: E501 + + Get the details for a marketing email. # 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(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_id: str + :param include_stats: Include statistics with email + :type include_stats: bool + :param marketing_campaign_names: + :type marketing_campaign_names: bool + :param workflow_names: + :type workflow_names: bool + :param included_properties: + :type included_properties: 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(PublicEmail, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["email_id", "include_stats", "marketing_campaign_names", "workflow_names", "included_properties", "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_by_id" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'email_id' is set + if self.api_client.client_side_validation and local_var_params.get("email_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_id` when calling `get_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "email_id" in local_var_params: + path_params["emailId"] = local_var_params["email_id"] # noqa: E501 + + query_params = [] + if local_var_params.get("include_stats") is not None: # noqa: E501 + query_params.append(("includeStats", local_var_params["include_stats"])) # noqa: E501 + if local_var_params.get("marketing_campaign_names") is not None: # noqa: E501 + query_params.append(("marketingCampaignNames", local_var_params["marketing_campaign_names"])) # noqa: E501 + if local_var_params.get("workflow_names") is not None: # noqa: E501 + query_params.append(("workflowNames", local_var_params["workflow_names"])) # noqa: E501 + if local_var_params.get("included_properties") is not None: # noqa: E501 + query_params.append(("includedProperties", local_var_params["included_properties"])) # noqa: E501 + collection_formats["includedProperties"] = "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: "PublicEmail", + } + + return self.api_client.call_api( + "/marketing/v3/emails/{emailId}", + "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_draft(self, email_id, **kwargs): # noqa: E501 + """Get draft version of a marketing email # noqa: E501 + + Get the draft version of an email (if it exists). If no draft version exists, the published email is returned. # 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_draft(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_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: PublicEmail + """ + kwargs["_return_http_data_only"] = True + return self.get_draft_with_http_info(email_id, **kwargs) # noqa: E501 + + def get_draft_with_http_info(self, email_id, **kwargs): # noqa: E501 + """Get draft version of a marketing email # noqa: E501 + + Get the draft version of an email (if it exists). If no draft version exists, the published email is returned. # 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_draft_with_http_info(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(PublicEmail, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["email_id"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_draft" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'email_id' is set + if self.api_client.client_side_validation and local_var_params.get("email_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_id` when calling `get_draft`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "email_id" in local_var_params: + path_params["emailId"] = local_var_params["email_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 200: "PublicEmail", + } + + return self.api_client.call_api( + "/marketing/v3/emails/{emailId}/draft", + "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 + """Get all marketing emails for a HubSpot account. # noqa: E501 + + The results can be filtered, allowing you to find a specific set of emails. See the table below for a full list of filtering options. # 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 created_at: Only return emails created at exactly the specified time. + :type created_at: datetime + :param created_after: Only return emails created after the specified time. + :type created_after: datetime + :param created_before: Only return emails created before the specified time. + :type created_before: datetime + :param updated_at: Only return emails last updated at exactly the specified time. + :type updated_at: datetime + :param updated_after: Only return emails last updated after the specified time. + :type updated_after: datetime + :param updated_before: Only return emails last updated before the specified time. + :type updated_before: datetime + :param sort: Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default. + :type sort: list[str] + :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. + :type after: str + :param limit: The maximum number of results to return. Default is 100. + :type limit: int + :param include_stats: Include statistics with emails. + :type include_stats: bool + :param marketing_campaign_names: + :type marketing_campaign_names: bool + :param workflow_names: + :type workflow_names: bool + :param type: Email types to be filtered by. Multiple types can be included. All emails will be returned if not present. + :type type: str + :param is_published: Filter by published/draft emails. All emails will be returned if not present. + :type is_published: bool + :param included_properties: + :type included_properties: list[str] + :param archived: Specifies whether to return archived emails. Defaults to `false`. + :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: CollectionResponseWithTotalPublicEmailForwardPaging + """ + 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 + """Get all marketing emails for a HubSpot account. # noqa: E501 + + The results can be filtered, allowing you to find a specific set of emails. See the table below for a full list of filtering options. # 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 created_at: Only return emails created at exactly the specified time. + :type created_at: datetime + :param created_after: Only return emails created after the specified time. + :type created_after: datetime + :param created_before: Only return emails created before the specified time. + :type created_before: datetime + :param updated_at: Only return emails last updated at exactly the specified time. + :type updated_at: datetime + :param updated_after: Only return emails last updated after the specified time. + :type updated_after: datetime + :param updated_before: Only return emails last updated before the specified time. + :type updated_before: datetime + :param sort: Specifies which fields to use for sorting results. Valid fields are `name`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy`. `createdAt` will be used by default. + :type sort: list[str] + :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. + :type after: str + :param limit: The maximum number of results to return. Default is 100. + :type limit: int + :param include_stats: Include statistics with emails. + :type include_stats: bool + :param marketing_campaign_names: + :type marketing_campaign_names: bool + :param workflow_names: + :type workflow_names: bool + :param type: Email types to be filtered by. Multiple types can be included. All emails will be returned if not present. + :type type: str + :param is_published: Filter by published/draft emails. All emails will be returned if not present. + :type is_published: bool + :param included_properties: + :type included_properties: list[str] + :param archived: Specifies whether to return archived emails. Defaults to `false`. + :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(CollectionResponseWithTotalPublicEmailForwardPaging, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + "created_at", + "created_after", + "created_before", + "updated_at", + "updated_after", + "updated_before", + "sort", + "after", + "limit", + "include_stats", + "marketing_campaign_names", + "workflow_names", + "type", + "is_published", + "included_properties", + "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("created_at") is not None: # noqa: E501 + query_params.append(("createdAt", local_var_params["created_at"])) # noqa: E501 + if local_var_params.get("created_after") is not None: # noqa: E501 + query_params.append(("createdAfter", local_var_params["created_after"])) # noqa: E501 + if local_var_params.get("created_before") is not None: # noqa: E501 + query_params.append(("createdBefore", local_var_params["created_before"])) # noqa: E501 + if local_var_params.get("updated_at") is not None: # noqa: E501 + query_params.append(("updatedAt", local_var_params["updated_at"])) # noqa: E501 + if local_var_params.get("updated_after") is not None: # noqa: E501 + query_params.append(("updatedAfter", local_var_params["updated_after"])) # noqa: E501 + if local_var_params.get("updated_before") is not None: # noqa: E501 + query_params.append(("updatedBefore", local_var_params["updated_before"])) # noqa: E501 + if local_var_params.get("sort") is not None: # noqa: E501 + query_params.append(("sort", local_var_params["sort"])) # noqa: E501 + collection_formats["sort"] = "multi" # 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("limit") is not None: # noqa: E501 + query_params.append(("limit", local_var_params["limit"])) # noqa: E501 + if local_var_params.get("include_stats") is not None: # noqa: E501 + query_params.append(("includeStats", local_var_params["include_stats"])) # noqa: E501 + if local_var_params.get("marketing_campaign_names") is not None: # noqa: E501 + query_params.append(("marketingCampaignNames", local_var_params["marketing_campaign_names"])) # noqa: E501 + if local_var_params.get("workflow_names") is not None: # noqa: E501 + query_params.append(("workflowNames", local_var_params["workflow_names"])) # noqa: E501 + if local_var_params.get("type") is not None: # noqa: E501 + query_params.append(("type", local_var_params["type"])) # noqa: E501 + if local_var_params.get("is_published") is not None: # noqa: E501 + query_params.append(("isPublished", local_var_params["is_published"])) # noqa: E501 + if local_var_params.get("included_properties") is not None: # noqa: E501 + query_params.append(("includedProperties", local_var_params["included_properties"])) # noqa: E501 + collection_formats["includedProperties"] = "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: "CollectionResponseWithTotalPublicEmailForwardPaging", + } + + return self.api_client.call_api( + "/marketing/v3/emails/", + "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_revision_by_id(self, email_id, revision_id, **kwargs): # noqa: E501 + """Get a revision of a marketing email. # noqa: E501 + + Get a specific revision of a marketing email. # 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_revision_by_id(email_id, revision_id, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_id: str + :param revision_id: The ID of a revision. (required) + :type revision_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: VersionPublicEmail + """ + kwargs["_return_http_data_only"] = True + return self.get_revision_by_id_with_http_info(email_id, revision_id, **kwargs) # noqa: E501 + + def get_revision_by_id_with_http_info(self, email_id, revision_id, **kwargs): # noqa: E501 + """Get a revision of a marketing email. # noqa: E501 + + Get a specific revision of a marketing email. # 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_revision_by_id_with_http_info(email_id, revision_id, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_id: str + :param revision_id: The ID of a revision. (required) + :type revision_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(VersionPublicEmail, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["email_id", "revision_id"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_revision_by_id" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'email_id' is set + if self.api_client.client_side_validation and local_var_params.get("email_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_id` when calling `get_revision_by_id`") # noqa: E501 + # verify the required parameter 'revision_id' is set + if self.api_client.client_side_validation and local_var_params.get("revision_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `revision_id` when calling `get_revision_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "email_id" in local_var_params: + path_params["emailId"] = local_var_params["email_id"] # noqa: E501 + if "revision_id" in local_var_params: + path_params["revisionId"] = local_var_params["revision_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 200: "VersionPublicEmail", + } + + return self.api_client.call_api( + "/marketing/v3/emails/{emailId}/revisions/{revisionId}", + "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_revisions(self, email_id, **kwargs): # noqa: E501 + """Get revisions of a marketing email # noqa: E501 + + Get a list of all versions of a marketing email, with each entry including the full state of that particular version. The current revision has the ID -1. # 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_revisions(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_id: str + :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. + :type after: str + :param before: The cursor token value to get the previous set of results. You can get this from the `paging.prev.before` JSON property of a paged response containing more results. + :type before: str + :param limit: The maximum number of results to return. Default is 100. + :type limit: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CollectionResponseWithTotalVersionPublicEmail + """ + kwargs["_return_http_data_only"] = True + return self.get_revisions_with_http_info(email_id, **kwargs) # noqa: E501 + + def get_revisions_with_http_info(self, email_id, **kwargs): # noqa: E501 + """Get revisions of a marketing email # noqa: E501 + + Get a list of all versions of a marketing email, with each entry including the full state of that particular version. The current revision has the ID -1. # 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_revisions_with_http_info(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_id: str + :param after: The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. + :type after: str + :param before: The cursor token value to get the previous set of results. You can get this from the `paging.prev.before` JSON property of a paged response containing more results. + :type before: str + :param limit: The maximum number of results to return. Default is 100. + :type limit: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CollectionResponseWithTotalVersionPublicEmail, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["email_id", "after", "before", "limit"] + 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_revisions" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'email_id' is set + if self.api_client.client_side_validation and local_var_params.get("email_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_id` when calling `get_revisions`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "email_id" in local_var_params: + path_params["emailId"] = local_var_params["email_id"] # noqa: E501 + + query_params = [] + 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("before") is not None: # noqa: E501 + query_params.append(("before", local_var_params["before"])) # noqa: E501 + if local_var_params.get("limit") is not None: # noqa: E501 + query_params.append(("limit", local_var_params["limit"])) # 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: "CollectionResponseWithTotalVersionPublicEmail", + } + + return self.api_client.call_api( + "/marketing/v3/emails/{emailId}/revisions", + "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 publish_or_send(self, email_id, **kwargs): # noqa: E501 + """Publish or send a marketing email. # noqa: E501 + + If you have a Marketing Hub Enterprise account or the transactional email add-on, you can use this endpoint to publish an automated email or send/schedule a regular email. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.publish_or_send(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: (required) + :type email_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.publish_or_send_with_http_info(email_id, **kwargs) # noqa: E501 + + def publish_or_send_with_http_info(self, email_id, **kwargs): # noqa: E501 + """Publish or send a marketing email. # noqa: E501 + + If you have a Marketing Hub Enterprise account or the transactional email add-on, you can use this endpoint to publish an automated email or send/schedule a regular email. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.publish_or_send_with_http_info(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: (required) + :type email_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 = ["email_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 publish_or_send" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'email_id' is set + if self.api_client.client_side_validation and local_var_params.get("email_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_id` when calling `publish_or_send`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "email_id" in local_var_params: + path_params["emailId"] = local_var_params["email_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = {} + + return self.api_client.call_api( + "/marketing/v3/emails/{emailId}/publish", + "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 reset_draft(self, email_id, **kwargs): # noqa: E501 + """Reset Draft # noqa: E501 + + Resets the draft back to a copy of the live 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.reset_draft(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_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.reset_draft_with_http_info(email_id, **kwargs) # noqa: E501 + + def reset_draft_with_http_info(self, email_id, **kwargs): # noqa: E501 + """Reset Draft # noqa: E501 + + Resets the draft back to a copy of the live 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.reset_draft_with_http_info(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_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 = ["email_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 reset_draft" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'email_id' is set + if self.api_client.client_side_validation and local_var_params.get("email_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_id` when calling `reset_draft`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "email_id" in local_var_params: + path_params["emailId"] = local_var_params["email_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = {} + + return self.api_client.call_api( + "/marketing/v3/emails/{emailId}/draft/reset", + "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 restore_draft_revision(self, email_id, revision_id, **kwargs): # noqa: E501 + """Restore a revision of a marketing email to DRAFT state # noqa: E501 + + Restores a previous revision of a marketing email to DRAFT state. If there is currently something in the draft for that object, it is overwritten. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.restore_draft_revision(email_id, revision_id, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_id: str + :param revision_id: The ID of a revision. (required) + :type revision_id: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: PublicEmail + """ + kwargs["_return_http_data_only"] = True + return self.restore_draft_revision_with_http_info(email_id, revision_id, **kwargs) # noqa: E501 + + def restore_draft_revision_with_http_info(self, email_id, revision_id, **kwargs): # noqa: E501 + """Restore a revision of a marketing email to DRAFT state # noqa: E501 + + Restores a previous revision of a marketing email to DRAFT state. If there is currently something in the draft for that object, it is overwritten. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.restore_draft_revision_with_http_info(email_id, revision_id, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_id: str + :param revision_id: The ID of a revision. (required) + :type revision_id: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(PublicEmail, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["email_id", "revision_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 restore_draft_revision" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'email_id' is set + if self.api_client.client_side_validation and local_var_params.get("email_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_id` when calling `restore_draft_revision`") # noqa: E501 + # verify the required parameter 'revision_id' is set + if self.api_client.client_side_validation and local_var_params.get("revision_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `revision_id` when calling `restore_draft_revision`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "email_id" in local_var_params: + path_params["emailId"] = local_var_params["email_id"] # noqa: E501 + if "revision_id" in local_var_params: + path_params["revisionId"] = local_var_params["revision_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 200: "PublicEmail", + } + + return self.api_client.call_api( + "/marketing/v3/emails/{emailId}/revisions/{revisionId}/restore-to-draft", + "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 restore_revision(self, email_id, revision_id, **kwargs): # noqa: E501 + """Restore a revision of a marketing email # noqa: E501 + + Restores a previous revision of a marketing email. The current revision becomes old, and the restored revision is given a new version number. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.restore_revision(email_id, revision_id, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_id: str + :param revision_id: The ID of a revision. (required) + :type revision_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.restore_revision_with_http_info(email_id, revision_id, **kwargs) # noqa: E501 + + def restore_revision_with_http_info(self, email_id, revision_id, **kwargs): # noqa: E501 + """Restore a revision of a marketing email # noqa: E501 + + Restores a previous revision of a marketing email. The current revision becomes old, and the restored revision is given a new version number. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.restore_revision_with_http_info(email_id, revision_id, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_id: str + :param revision_id: The ID of a revision. (required) + :type revision_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 = ["email_id", "revision_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 restore_revision" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'email_id' is set + if self.api_client.client_side_validation and local_var_params.get("email_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_id` when calling `restore_revision`") # noqa: E501 + # verify the required parameter 'revision_id' is set + if self.api_client.client_side_validation and local_var_params.get("revision_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `revision_id` when calling `restore_revision`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "email_id" in local_var_params: + path_params["emailId"] = local_var_params["email_id"] # noqa: E501 + if "revision_id" in local_var_params: + path_params["revisionId"] = local_var_params["revision_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = {} + + return self.api_client.call_api( + "/marketing/v3/emails/{emailId}/revisions/{revisionId}/restore", + "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 unpublish_or_cancel(self, email_id, **kwargs): # noqa: E501 + """Unpublish or cancel a marketing email. # noqa: E501 + + If you have a Marketing Hub Enterprise account or the transactional email add-on, you can use this endpoint to unpublish an automated email or cancel a regular email. If the email is already in the process of being sent, canceling might not be possible. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.unpublish_or_cancel(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: (required) + :type email_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.unpublish_or_cancel_with_http_info(email_id, **kwargs) # noqa: E501 + + def unpublish_or_cancel_with_http_info(self, email_id, **kwargs): # noqa: E501 + """Unpublish or cancel a marketing email. # noqa: E501 + + If you have a Marketing Hub Enterprise account or the transactional email add-on, you can use this endpoint to unpublish an automated email or cancel a regular email. If the email is already in the process of being sent, canceling might not be possible. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.unpublish_or_cancel_with_http_info(email_id, async_req=True) + >>> result = thread.get() + + :param email_id: (required) + :type email_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 = ["email_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 unpublish_or_cancel" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'email_id' is set + if self.api_client.client_side_validation and local_var_params.get("email_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_id` when calling `unpublish_or_cancel`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "email_id" in local_var_params: + path_params["emailId"] = local_var_params["email_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = {} + + return self.api_client.call_api( + "/marketing/v3/emails/{emailId}/unpublish", + "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, email_id, email_update_request, **kwargs): # noqa: E501 + """Update a marketing email. # noqa: E501 + + Change properties of a marketing email. # 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(email_id, email_update_request, async_req=True) + >>> result = thread.get() + + :param email_id: The ID of the marketing email that should get updated (required) + :type email_id: str + :param email_update_request: A marketing email object with properties that should overwrite the corresponding properties of the marketing email. (required) + :type email_update_request: EmailUpdateRequest + :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: PublicEmail + """ + kwargs["_return_http_data_only"] = True + return self.update_with_http_info(email_id, email_update_request, **kwargs) # noqa: E501 + + def update_with_http_info(self, email_id, email_update_request, **kwargs): # noqa: E501 + """Update a marketing email. # noqa: E501 + + Change properties of a marketing email. # 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(email_id, email_update_request, async_req=True) + >>> result = thread.get() + + :param email_id: The ID of the marketing email that should get updated (required) + :type email_id: str + :param email_update_request: A marketing email object with properties that should overwrite the corresponding properties of the marketing email. (required) + :type email_update_request: EmailUpdateRequest + :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(PublicEmail, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["email_id", "email_update_request", "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 update" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'email_id' is set + if self.api_client.client_side_validation and local_var_params.get("email_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_id` when calling `update`") # noqa: E501 + # verify the required parameter 'email_update_request' is set + if self.api_client.client_side_validation and local_var_params.get("email_update_request") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_update_request` when calling `update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "email_id" in local_var_params: + path_params["emailId"] = local_var_params["email_id"] # noqa: E501 + + 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 "email_update_request" in local_var_params: + body_params = local_var_params["email_update_request"] + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "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: "PublicEmail", + } + + return self.api_client.call_api( + "/marketing/v3/emails/{emailId}", + "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"), + ) + + def upsert_draft(self, email_id, email_update_request, **kwargs): # noqa: E501 + """Create or update draft version # noqa: E501 + + Create or update the draft version of a marketing email. If no draft exists, the system creates a draft from the current “live” email then applies the request body to that draft. The draft version only lives on the buffer—the email is not cloned. # 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_draft(email_id, email_update_request, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_id: str + :param email_update_request: A marketing email object with properties that should overwrite the corresponding properties in the email's current draft. (required) + :type email_update_request: EmailUpdateRequest + :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: PublicEmail + """ + kwargs["_return_http_data_only"] = True + return self.upsert_draft_with_http_info(email_id, email_update_request, **kwargs) # noqa: E501 + + def upsert_draft_with_http_info(self, email_id, email_update_request, **kwargs): # noqa: E501 + """Create or update draft version # noqa: E501 + + Create or update the draft version of a marketing email. If no draft exists, the system creates a draft from the current “live” email then applies the request body to that draft. The draft version only lives on the buffer—the email is not cloned. # 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_draft_with_http_info(email_id, email_update_request, async_req=True) + >>> result = thread.get() + + :param email_id: The marketing email ID. (required) + :type email_id: str + :param email_update_request: A marketing email object with properties that should overwrite the corresponding properties in the email's current draft. (required) + :type email_update_request: EmailUpdateRequest + :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(PublicEmail, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["email_id", "email_update_request"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method upsert_draft" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'email_id' is set + if self.api_client.client_side_validation and local_var_params.get("email_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_id` when calling `upsert_draft`") # noqa: E501 + # verify the required parameter 'email_update_request' is set + if self.api_client.client_side_validation and local_var_params.get("email_update_request") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `email_update_request` when calling `upsert_draft`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "email_id" in local_var_params: + path_params["emailId"] = local_var_params["email_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "email_update_request" in local_var_params: + body_params = local_var_params["email_update_request"] + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "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: "PublicEmail", + } + + return self.api_client.call_api( + "/marketing/v3/emails/{emailId}/draft", + "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/marketing/emails/api/statistics_api.py b/hubspot/marketing/emails/api/statistics_api.py new file mode 100644 index 00000000..fd2bef92 --- /dev/null +++ b/hubspot/marketing/emails/api/statistics_api.py @@ -0,0 +1,312 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from hubspot.marketing.emails.api_client import ApiClient +from hubspot.marketing.emails.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class StatisticsApi(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 get_emails_list(self, **kwargs): # noqa: E501 + """Get aggregated statistics. # noqa: E501 + + Use this endpoint to get aggregated statistics of emails sent in a specified time span. It also returns the list of emails that were sent during the time span. # 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_emails_list(async_req=True) + >>> result = thread.get() + + :param start_timestamp: The start timestamp of the time span, in ISO8601 representation. + :type start_timestamp: str + :param end_timestamp: The end timestamp of the time span, in ISO8601 representation. + :type end_timestamp: str + :param email_ids: Filter by email IDs. Only include statistics of emails with these IDs. + :type email_ids: list[int] + :param _property: Specifies which email properties should be returned. All properties will be returned by default. + :type _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: AggregateEmailStatistics + """ + kwargs["_return_http_data_only"] = True + return self.get_emails_list_with_http_info(**kwargs) # noqa: E501 + + def get_emails_list_with_http_info(self, **kwargs): # noqa: E501 + """Get aggregated statistics. # noqa: E501 + + Use this endpoint to get aggregated statistics of emails sent in a specified time span. It also returns the list of emails that were sent during the time span. # 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_emails_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param start_timestamp: The start timestamp of the time span, in ISO8601 representation. + :type start_timestamp: str + :param end_timestamp: The end timestamp of the time span, in ISO8601 representation. + :type end_timestamp: str + :param email_ids: Filter by email IDs. Only include statistics of emails with these IDs. + :type email_ids: list[int] + :param _property: Specifies which email properties should be returned. All properties will be returned by default. + :type _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(AggregateEmailStatistics, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["start_timestamp", "end_timestamp", "email_ids", "_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_emails_list" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get("start_timestamp") is not None: # noqa: E501 + query_params.append(("startTimestamp", local_var_params["start_timestamp"])) # noqa: E501 + if local_var_params.get("end_timestamp") is not None: # noqa: E501 + query_params.append(("endTimestamp", local_var_params["end_timestamp"])) # noqa: E501 + if local_var_params.get("email_ids") is not None: # noqa: E501 + query_params.append(("emailIds", local_var_params["email_ids"])) # noqa: E501 + collection_formats["emailIds"] = "multi" # noqa: E501 + if local_var_params.get("_property") is not None: # noqa: E501 + query_params.append(("property", local_var_params["_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: "AggregateEmailStatistics", + } + + return self.api_client.call_api( + "/marketing/v3/emails/statistics/list", + "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_histogram(self, **kwargs): # noqa: E501 + """Get aggregated statistic intervals. # noqa: E501 + + Get aggregated statistics in intervals for a specified time span. Each interval contains aggregated statistics of the emails that were sent in that time. # 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_histogram(async_req=True) + >>> result = thread.get() + + :param interval: The interval to aggregate statistics for. + :type interval: str + :param start_timestamp: The start timestamp of the time span, in ISO8601 representation. + :type start_timestamp: str + :param end_timestamp: The end timestamp of the time span, in ISO8601 representation. + :type end_timestamp: str + :param email_ids: Filter by email IDs. Only include statistics of emails with these IDs. + :type email_ids: list[int] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CollectionResponseWithTotalEmailStatisticIntervalNoPaging + """ + kwargs["_return_http_data_only"] = True + return self.get_histogram_with_http_info(**kwargs) # noqa: E501 + + def get_histogram_with_http_info(self, **kwargs): # noqa: E501 + """Get aggregated statistic intervals. # noqa: E501 + + Get aggregated statistics in intervals for a specified time span. Each interval contains aggregated statistics of the emails that were sent in that time. # 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_histogram_with_http_info(async_req=True) + >>> result = thread.get() + + :param interval: The interval to aggregate statistics for. + :type interval: str + :param start_timestamp: The start timestamp of the time span, in ISO8601 representation. + :type start_timestamp: str + :param end_timestamp: The end timestamp of the time span, in ISO8601 representation. + :type end_timestamp: str + :param email_ids: Filter by email IDs. Only include statistics of emails with these IDs. + :type email_ids: list[int] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CollectionResponseWithTotalEmailStatisticIntervalNoPaging, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["interval", "start_timestamp", "end_timestamp", "email_ids"] + 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_histogram" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get("interval") is not None: # noqa: E501 + query_params.append(("interval", local_var_params["interval"])) # noqa: E501 + if local_var_params.get("start_timestamp") is not None: # noqa: E501 + query_params.append(("startTimestamp", local_var_params["start_timestamp"])) # noqa: E501 + if local_var_params.get("end_timestamp") is not None: # noqa: E501 + query_params.append(("endTimestamp", local_var_params["end_timestamp"])) # noqa: E501 + if local_var_params.get("email_ids") is not None: # noqa: E501 + query_params.append(("emailIds", local_var_params["email_ids"])) # noqa: E501 + collection_formats["emailIds"] = "multi" # 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: "CollectionResponseWithTotalEmailStatisticIntervalNoPaging", + } + + return self.api_client.call_api( + "/marketing/v3/emails/statistics/histogram", + "GET", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) diff --git a/hubspot/marketing/emails/api_client.py b/hubspot/marketing/emails/api_client.py new file mode 100644 index 00000000..6dbefd48 --- /dev/null +++ b/hubspot/marketing/emails/api_client.py @@ -0,0 +1,664 @@ +# coding: utf-8 +""" + Marketing Emails + + 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.marketing.emails.configuration import Configuration +import hubspot.marketing.emails.models +from hubspot.marketing.emails import rest +from hubspot.marketing.emails.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.marketing.emails.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/marketing/emails/configuration.py b/hubspot/marketing/emails/configuration.py new file mode 100644 index 00000000..574bb826 --- /dev/null +++ b/hubspot/marketing/emails/configuration.py @@ -0,0 +1,439 @@ +# coding: utf-8 + +""" + Marketing Emails + + 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.marketing.emails.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.marketing.emails") + 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/marketing/emails/exceptions.py b/hubspot/marketing/emails/exceptions.py new file mode 100644 index 00000000..48ed6204 --- /dev/null +++ b/hubspot/marketing/emails/exceptions.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Marketing Emails + + 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/marketing/emails/models/__init__.py b/hubspot/marketing/emails/models/__init__.py new file mode 100644 index 00000000..bc926e5a --- /dev/null +++ b/hubspot/marketing/emails/models/__init__.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +# flake8: noqa +""" + Marketing Emails + + 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.marketing.emails.models.ab_test_create_request_v_next import AbTestCreateRequestVNext +from hubspot.marketing.emails.models.aggregate_email_statistics import AggregateEmailStatistics +from hubspot.marketing.emails.models.collection_response_with_total_email_statistic_interval_no_paging import CollectionResponseWithTotalEmailStatisticIntervalNoPaging +from hubspot.marketing.emails.models.collection_response_with_total_public_email_forward_paging import CollectionResponseWithTotalPublicEmailForwardPaging +from hubspot.marketing.emails.models.collection_response_with_total_version_public_email import CollectionResponseWithTotalVersionPublicEmail +from hubspot.marketing.emails.models.content_clone_request_v_next import ContentCloneRequestVNext +from hubspot.marketing.emails.models.email_create_request import EmailCreateRequest +from hubspot.marketing.emails.models.email_statistic_interval import EmailStatisticInterval +from hubspot.marketing.emails.models.email_statistics_data import EmailStatisticsData +from hubspot.marketing.emails.models.email_update_request import EmailUpdateRequest +from hubspot.marketing.emails.models.error import Error +from hubspot.marketing.emails.models.error_detail import ErrorDetail +from hubspot.marketing.emails.models.forward_paging import ForwardPaging +from hubspot.marketing.emails.models.interval import Interval +from hubspot.marketing.emails.models.next_page import NextPage +from hubspot.marketing.emails.models.paging import Paging +from hubspot.marketing.emails.models.previous_page import PreviousPage +from hubspot.marketing.emails.models.public_button_style_settings import PublicButtonStyleSettings +from hubspot.marketing.emails.models.public_divider_style_settings import PublicDividerStyleSettings +from hubspot.marketing.emails.models.public_email import PublicEmail +from hubspot.marketing.emails.models.public_email_content import PublicEmailContent +from hubspot.marketing.emails.models.public_email_from_details import PublicEmailFromDetails +from hubspot.marketing.emails.models.public_email_recipients import PublicEmailRecipients +from hubspot.marketing.emails.models.public_email_style_settings import PublicEmailStyleSettings +from hubspot.marketing.emails.models.public_email_subscription_details import PublicEmailSubscriptionDetails +from hubspot.marketing.emails.models.public_email_testing_details import PublicEmailTestingDetails +from hubspot.marketing.emails.models.public_email_to_details import PublicEmailToDetails +from hubspot.marketing.emails.models.public_font_style import PublicFontStyle +from hubspot.marketing.emails.models.public_rss_email_details import PublicRssEmailDetails +from hubspot.marketing.emails.models.public_webversion_details import PublicWebversionDetails +from hubspot.marketing.emails.models.version_public_email import VersionPublicEmail +from hubspot.marketing.emails.models.version_user import VersionUser diff --git a/hubspot/marketing/emails/models/ab_test_create_request_v_next.py b/hubspot/marketing/emails/models/ab_test_create_request_v_next.py new file mode 100644 index 00000000..c13072b1 --- /dev/null +++ b/hubspot/marketing/emails/models/ab_test_create_request_v_next.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class AbTestCreateRequestVNext(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 = {"variation_name": "str", "content_id": "str"} + + attribute_map = {"variation_name": "variationName", "content_id": "contentId"} + + def __init__(self, variation_name=None, content_id=None, local_vars_configuration=None): # noqa: E501 + """AbTestCreateRequestVNext - 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._variation_name = None + self._content_id = None + self.discriminator = None + + self.variation_name = variation_name + self.content_id = content_id + + @property + def variation_name(self): + """Gets the variation_name of this AbTestCreateRequestVNext. # noqa: E501 + + + :return: The variation_name of this AbTestCreateRequestVNext. # noqa: E501 + :rtype: str + """ + return self._variation_name + + @variation_name.setter + def variation_name(self, variation_name): + """Sets the variation_name of this AbTestCreateRequestVNext. + + + :param variation_name: The variation_name of this AbTestCreateRequestVNext. # noqa: E501 + :type variation_name: str + """ + if self.local_vars_configuration.client_side_validation and variation_name is None: # noqa: E501 + raise ValueError("Invalid value for `variation_name`, must not be `None`") # noqa: E501 + + self._variation_name = variation_name + + @property + def content_id(self): + """Gets the content_id of this AbTestCreateRequestVNext. # noqa: E501 + + ID of the object to test. # noqa: E501 + + :return: The content_id of this AbTestCreateRequestVNext. # noqa: E501 + :rtype: str + """ + return self._content_id + + @content_id.setter + def content_id(self, content_id): + """Sets the content_id of this AbTestCreateRequestVNext. + + ID of the object to test. # noqa: E501 + + :param content_id: The content_id of this AbTestCreateRequestVNext. # noqa: E501 + :type content_id: str + """ + if self.local_vars_configuration.client_side_validation and content_id is None: # noqa: E501 + raise ValueError("Invalid value for `content_id`, must not be `None`") # noqa: E501 + + self._content_id = content_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, AbTestCreateRequestVNext): + 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, AbTestCreateRequestVNext): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/aggregate_email_statistics.py b/hubspot/marketing/emails/models/aggregate_email_statistics.py new file mode 100644 index 00000000..a20c0578 --- /dev/null +++ b/hubspot/marketing/emails/models/aggregate_email_statistics.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class AggregateEmailStatistics(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 = {"emails": "list[int]", "campaign_aggregations": "dict[str, EmailStatisticsData]", "aggregate": "EmailStatisticsData"} + + attribute_map = {"emails": "emails", "campaign_aggregations": "campaignAggregations", "aggregate": "aggregate"} + + def __init__(self, emails=None, campaign_aggregations=None, aggregate=None, local_vars_configuration=None): # noqa: E501 + """AggregateEmailStatistics - 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._emails = None + self._campaign_aggregations = None + self._aggregate = None + self.discriminator = None + + if emails is not None: + self.emails = emails + if campaign_aggregations is not None: + self.campaign_aggregations = campaign_aggregations + if aggregate is not None: + self.aggregate = aggregate + + @property + def emails(self): + """Gets the emails of this AggregateEmailStatistics. # noqa: E501 + + List of email IDs that were sent during the time span. # noqa: E501 + + :return: The emails of this AggregateEmailStatistics. # noqa: E501 + :rtype: list[int] + """ + return self._emails + + @emails.setter + def emails(self, emails): + """Sets the emails of this AggregateEmailStatistics. + + List of email IDs that were sent during the time span. # noqa: E501 + + :param emails: The emails of this AggregateEmailStatistics. # noqa: E501 + :type emails: list[int] + """ + + self._emails = emails + + @property + def campaign_aggregations(self): + """Gets the campaign_aggregations of this AggregateEmailStatistics. # noqa: E501 + + The aggregated statistics per campaign. # noqa: E501 + + :return: The campaign_aggregations of this AggregateEmailStatistics. # noqa: E501 + :rtype: dict[str, EmailStatisticsData] + """ + return self._campaign_aggregations + + @campaign_aggregations.setter + def campaign_aggregations(self, campaign_aggregations): + """Sets the campaign_aggregations of this AggregateEmailStatistics. + + The aggregated statistics per campaign. # noqa: E501 + + :param campaign_aggregations: The campaign_aggregations of this AggregateEmailStatistics. # noqa: E501 + :type campaign_aggregations: dict[str, EmailStatisticsData] + """ + + self._campaign_aggregations = campaign_aggregations + + @property + def aggregate(self): + """Gets the aggregate of this AggregateEmailStatistics. # noqa: E501 + + + :return: The aggregate of this AggregateEmailStatistics. # noqa: E501 + :rtype: EmailStatisticsData + """ + return self._aggregate + + @aggregate.setter + def aggregate(self, aggregate): + """Sets the aggregate of this AggregateEmailStatistics. + + + :param aggregate: The aggregate of this AggregateEmailStatistics. # noqa: E501 + :type aggregate: EmailStatisticsData + """ + + self._aggregate = aggregate + + 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, AggregateEmailStatistics): + 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, AggregateEmailStatistics): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/collection_response_with_total_email_statistic_interval_no_paging.py b/hubspot/marketing/emails/models/collection_response_with_total_email_statistic_interval_no_paging.py new file mode 100644 index 00000000..8a58dc3f --- /dev/null +++ b/hubspot/marketing/emails/models/collection_response_with_total_email_statistic_interval_no_paging.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class CollectionResponseWithTotalEmailStatisticIntervalNoPaging(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"total": "int", "results": "list[EmailStatisticInterval]"} + + attribute_map = {"total": "total", "results": "results"} + + def __init__(self, total=None, results=None, local_vars_configuration=None): # noqa: E501 + """CollectionResponseWithTotalEmailStatisticIntervalNoPaging - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._total = None + self._results = None + self.discriminator = None + + self.total = total + self.results = results + + @property + def total(self): + """Gets the total of this CollectionResponseWithTotalEmailStatisticIntervalNoPaging. # noqa: E501 + + Total number of objects. # noqa: E501 + + :return: The total of this CollectionResponseWithTotalEmailStatisticIntervalNoPaging. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this CollectionResponseWithTotalEmailStatisticIntervalNoPaging. + + Total number of objects. # noqa: E501 + + :param total: The total of this CollectionResponseWithTotalEmailStatisticIntervalNoPaging. # noqa: E501 + :type total: int + """ + if self.local_vars_configuration.client_side_validation and total is None: # noqa: E501 + raise ValueError("Invalid value for `total`, must not be `None`") # noqa: E501 + + self._total = total + + @property + def results(self): + """Gets the results of this CollectionResponseWithTotalEmailStatisticIntervalNoPaging. # noqa: E501 + + Collection of objects. # noqa: E501 + + :return: The results of this CollectionResponseWithTotalEmailStatisticIntervalNoPaging. # noqa: E501 + :rtype: list[EmailStatisticInterval] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this CollectionResponseWithTotalEmailStatisticIntervalNoPaging. + + Collection of objects. # noqa: E501 + + :param results: The results of this CollectionResponseWithTotalEmailStatisticIntervalNoPaging. # noqa: E501 + :type results: list[EmailStatisticInterval] + """ + 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, CollectionResponseWithTotalEmailStatisticIntervalNoPaging): + 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, CollectionResponseWithTotalEmailStatisticIntervalNoPaging): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/collection_response_with_total_public_email_forward_paging.py b/hubspot/marketing/emails/models/collection_response_with_total_public_email_forward_paging.py new file mode 100644 index 00000000..7a606b19 --- /dev/null +++ b/hubspot/marketing/emails/models/collection_response_with_total_public_email_forward_paging.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class CollectionResponseWithTotalPublicEmailForwardPaging(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[PublicEmail]"} + + attribute_map = {"total": "total", "paging": "paging", "results": "results"} + + def __init__(self, total=None, paging=None, results=None, local_vars_configuration=None): # noqa: E501 + """CollectionResponseWithTotalPublicEmailForwardPaging - 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 CollectionResponseWithTotalPublicEmailForwardPaging. # noqa: E501 + + Total number of content emails. # noqa: E501 + + :return: The total of this CollectionResponseWithTotalPublicEmailForwardPaging. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this CollectionResponseWithTotalPublicEmailForwardPaging. + + Total number of content emails. # noqa: E501 + + :param total: The total of this CollectionResponseWithTotalPublicEmailForwardPaging. # 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 CollectionResponseWithTotalPublicEmailForwardPaging. # noqa: E501 + + + :return: The paging of this CollectionResponseWithTotalPublicEmailForwardPaging. # noqa: E501 + :rtype: ForwardPaging + """ + return self._paging + + @paging.setter + def paging(self, paging): + """Sets the paging of this CollectionResponseWithTotalPublicEmailForwardPaging. + + + :param paging: The paging of this CollectionResponseWithTotalPublicEmailForwardPaging. # noqa: E501 + :type paging: ForwardPaging + """ + + self._paging = paging + + @property + def results(self): + """Gets the results of this CollectionResponseWithTotalPublicEmailForwardPaging. # noqa: E501 + + Collection of emails. # noqa: E501 + + :return: The results of this CollectionResponseWithTotalPublicEmailForwardPaging. # noqa: E501 + :rtype: list[PublicEmail] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this CollectionResponseWithTotalPublicEmailForwardPaging. + + Collection of emails. # noqa: E501 + + :param results: The results of this CollectionResponseWithTotalPublicEmailForwardPaging. # noqa: E501 + :type results: list[PublicEmail] + """ + 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, CollectionResponseWithTotalPublicEmailForwardPaging): + 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, CollectionResponseWithTotalPublicEmailForwardPaging): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/collection_response_with_total_version_public_email.py b/hubspot/marketing/emails/models/collection_response_with_total_version_public_email.py new file mode 100644 index 00000000..3b3d2427 --- /dev/null +++ b/hubspot/marketing/emails/models/collection_response_with_total_version_public_email.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class CollectionResponseWithTotalVersionPublicEmail(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": "Paging", "results": "list[VersionPublicEmail]"} + + attribute_map = {"total": "total", "paging": "paging", "results": "results"} + + def __init__(self, total=None, paging=None, results=None, local_vars_configuration=None): # noqa: E501 + """CollectionResponseWithTotalVersionPublicEmail - 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 CollectionResponseWithTotalVersionPublicEmail. # noqa: E501 + + Total number of content emails. # noqa: E501 + + :return: The total of this CollectionResponseWithTotalVersionPublicEmail. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this CollectionResponseWithTotalVersionPublicEmail. + + Total number of content emails. # noqa: E501 + + :param total: The total of this CollectionResponseWithTotalVersionPublicEmail. # 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 CollectionResponseWithTotalVersionPublicEmail. # noqa: E501 + + + :return: The paging of this CollectionResponseWithTotalVersionPublicEmail. # noqa: E501 + :rtype: Paging + """ + return self._paging + + @paging.setter + def paging(self, paging): + """Sets the paging of this CollectionResponseWithTotalVersionPublicEmail. + + + :param paging: The paging of this CollectionResponseWithTotalVersionPublicEmail. # noqa: E501 + :type paging: Paging + """ + + self._paging = paging + + @property + def results(self): + """Gets the results of this CollectionResponseWithTotalVersionPublicEmail. # noqa: E501 + + Collection of emails. # noqa: E501 + + :return: The results of this CollectionResponseWithTotalVersionPublicEmail. # noqa: E501 + :rtype: list[VersionPublicEmail] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this CollectionResponseWithTotalVersionPublicEmail. + + Collection of emails. # noqa: E501 + + :param results: The results of this CollectionResponseWithTotalVersionPublicEmail. # noqa: E501 + :type results: list[VersionPublicEmail] + """ + 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, CollectionResponseWithTotalVersionPublicEmail): + 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, CollectionResponseWithTotalVersionPublicEmail): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/content_clone_request_v_next.py b/hubspot/marketing/emails/models/content_clone_request_v_next.py new file mode 100644 index 00000000..1b39775f --- /dev/null +++ b/hubspot/marketing/emails/models/content_clone_request_v_next.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class ContentCloneRequestVNext(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 = {"clone_name": "str", "id": "str"} + + attribute_map = {"clone_name": "cloneName", "id": "id"} + + def __init__(self, clone_name=None, id=None, local_vars_configuration=None): # noqa: E501 + """ContentCloneRequestVNext - 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._clone_name = None + self._id = None + self.discriminator = None + + if clone_name is not None: + self.clone_name = clone_name + self.id = id + + @property + def clone_name(self): + """Gets the clone_name of this ContentCloneRequestVNext. # noqa: E501 + + Name of the cloned email. # noqa: E501 + + :return: The clone_name of this ContentCloneRequestVNext. # noqa: E501 + :rtype: str + """ + return self._clone_name + + @clone_name.setter + def clone_name(self, clone_name): + """Sets the clone_name of this ContentCloneRequestVNext. + + Name of the cloned email. # noqa: E501 + + :param clone_name: The clone_name of this ContentCloneRequestVNext. # noqa: E501 + :type clone_name: str + """ + + self._clone_name = clone_name + + @property + def id(self): + """Gets the id of this ContentCloneRequestVNext. # noqa: E501 + + ID of the email to be cloned. # noqa: E501 + + :return: The id of this ContentCloneRequestVNext. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ContentCloneRequestVNext. + + ID of the email to be cloned. # noqa: E501 + + :param id: The id of this ContentCloneRequestVNext. # 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, ContentCloneRequestVNext): + 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, ContentCloneRequestVNext): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/email_create_request.py b/hubspot/marketing/emails/models/email_create_request.py new file mode 100644 index 00000000..d1c4a46e --- /dev/null +++ b/hubspot/marketing/emails/models/email_create_request.py @@ -0,0 +1,1561 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class EmailCreateRequest(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 = { + "feedback_survey_id": "str", + "rss_data": "PublicRssEmailDetails", + "subject": "str", + "testing": "PublicEmailTestingDetails", + "publish_date": "datetime", + "language": "str", + "business_unit_id": "int", + "content": "PublicEmailContent", + "webversion": "PublicWebversionDetails", + "archived": "bool", + "subscription_details": "PublicEmailSubscriptionDetails", + "active_domain": "str", + "name": "str", + "campaign": "str", + "_from": "PublicEmailFromDetails", + "jitter_send_time": "bool", + "state": "str", + "to": "PublicEmailToDetails", + "subcategory": "str", + "send_on_publish": "bool", + } + + attribute_map = { + "feedback_survey_id": "feedbackSurveyId", + "rss_data": "rssData", + "subject": "subject", + "testing": "testing", + "publish_date": "publishDate", + "language": "language", + "business_unit_id": "businessUnitId", + "content": "content", + "webversion": "webversion", + "archived": "archived", + "subscription_details": "subscriptionDetails", + "active_domain": "activeDomain", + "name": "name", + "campaign": "campaign", + "_from": "from", + "jitter_send_time": "jitterSendTime", + "state": "state", + "to": "to", + "subcategory": "subcategory", + "send_on_publish": "sendOnPublish", + } + + def __init__( + self, + feedback_survey_id=None, + rss_data=None, + subject=None, + testing=None, + publish_date=None, + language=None, + business_unit_id=None, + content=None, + webversion=None, + archived=None, + subscription_details=None, + active_domain=None, + name=None, + campaign=None, + _from=None, + jitter_send_time=None, + state=None, + to=None, + subcategory=None, + send_on_publish=None, + local_vars_configuration=None, + ): # noqa: E501 + """EmailCreateRequest - 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._feedback_survey_id = None + self._rss_data = None + self._subject = None + self._testing = None + self._publish_date = None + self._language = None + self._business_unit_id = None + self._content = None + self._webversion = None + self._archived = None + self._subscription_details = None + self._active_domain = None + self._name = None + self._campaign = None + self.__from = None + self._jitter_send_time = None + self._state = None + self._to = None + self._subcategory = None + self._send_on_publish = None + self.discriminator = None + + if feedback_survey_id is not None: + self.feedback_survey_id = feedback_survey_id + if rss_data is not None: + self.rss_data = rss_data + if subject is not None: + self.subject = subject + if testing is not None: + self.testing = testing + if publish_date is not None: + self.publish_date = publish_date + if language is not None: + self.language = language + if business_unit_id is not None: + self.business_unit_id = business_unit_id + if content is not None: + self.content = content + if webversion is not None: + self.webversion = webversion + if archived is not None: + self.archived = archived + if subscription_details is not None: + self.subscription_details = subscription_details + if active_domain is not None: + self.active_domain = active_domain + self.name = name + if campaign is not None: + self.campaign = campaign + if _from is not None: + self._from = _from + if jitter_send_time is not None: + self.jitter_send_time = jitter_send_time + if state is not None: + self.state = state + if to is not None: + self.to = to + if subcategory is not None: + self.subcategory = subcategory + if send_on_publish is not None: + self.send_on_publish = send_on_publish + + @property + def feedback_survey_id(self): + """Gets the feedback_survey_id of this EmailCreateRequest. # noqa: E501 + + The ID of the feedback survey linked to the email. # noqa: E501 + + :return: The feedback_survey_id of this EmailCreateRequest. # noqa: E501 + :rtype: str + """ + return self._feedback_survey_id + + @feedback_survey_id.setter + def feedback_survey_id(self, feedback_survey_id): + """Sets the feedback_survey_id of this EmailCreateRequest. + + The ID of the feedback survey linked to the email. # noqa: E501 + + :param feedback_survey_id: The feedback_survey_id of this EmailCreateRequest. # noqa: E501 + :type feedback_survey_id: str + """ + + self._feedback_survey_id = feedback_survey_id + + @property + def rss_data(self): + """Gets the rss_data of this EmailCreateRequest. # noqa: E501 + + + :return: The rss_data of this EmailCreateRequest. # noqa: E501 + :rtype: PublicRssEmailDetails + """ + return self._rss_data + + @rss_data.setter + def rss_data(self, rss_data): + """Sets the rss_data of this EmailCreateRequest. + + + :param rss_data: The rss_data of this EmailCreateRequest. # noqa: E501 + :type rss_data: PublicRssEmailDetails + """ + + self._rss_data = rss_data + + @property + def subject(self): + """Gets the subject of this EmailCreateRequest. # noqa: E501 + + The subject of the email. # noqa: E501 + + :return: The subject of this EmailCreateRequest. # noqa: E501 + :rtype: str + """ + return self._subject + + @subject.setter + def subject(self, subject): + """Sets the subject of this EmailCreateRequest. + + The subject of the email. # noqa: E501 + + :param subject: The subject of this EmailCreateRequest. # noqa: E501 + :type subject: str + """ + + self._subject = subject + + @property + def testing(self): + """Gets the testing of this EmailCreateRequest. # noqa: E501 + + + :return: The testing of this EmailCreateRequest. # noqa: E501 + :rtype: PublicEmailTestingDetails + """ + return self._testing + + @testing.setter + def testing(self, testing): + """Sets the testing of this EmailCreateRequest. + + + :param testing: The testing of this EmailCreateRequest. # noqa: E501 + :type testing: PublicEmailTestingDetails + """ + + self._testing = testing + + @property + def publish_date(self): + """Gets the publish_date of this EmailCreateRequest. # noqa: E501 + + The date and time the email is scheduled for, in ISO8601 representation. This is only used in local time or scheduled emails. # noqa: E501 + + :return: The publish_date of this EmailCreateRequest. # noqa: E501 + :rtype: datetime + """ + return self._publish_date + + @publish_date.setter + def publish_date(self, publish_date): + """Sets the publish_date of this EmailCreateRequest. + + The date and time the email is scheduled for, in ISO8601 representation. This is only used in local time or scheduled emails. # noqa: E501 + + :param publish_date: The publish_date of this EmailCreateRequest. # noqa: E501 + :type publish_date: datetime + """ + + self._publish_date = publish_date + + @property + def language(self): + """Gets the language of this EmailCreateRequest. # noqa: E501 + + + :return: The language of this EmailCreateRequest. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this EmailCreateRequest. + + + :param language: The language of this EmailCreateRequest. # noqa: E501 + :type language: str + """ + allowed_values = [ + "af", + "af-na", + "af-za", + "agq", + "agq-cm", + "ak", + "ak-gh", + "am", + "am-et", + "ann", + "ann-ng", + "ar", + "ar-001", + "ar-ae", + "ar-bh", + "ar-dj", + "ar-dz", + "ar-eg", + "ar-eh", + "ar-er", + "ar-il", + "ar-iq", + "ar-jo", + "ar-km", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-mr", + "ar-om", + "ar-ps", + "ar-qa", + "ar-sa", + "ar-sd", + "ar-so", + "ar-ss", + "ar-sy", + "ar-td", + "ar-tn", + "ar-ye", + "as", + "asa", + "asa-tz", + "ast", + "ast-es", + "as-in", + "az", + "az-az", + "bas", + "bas-cm", + "be", + "bem", + "bem-zm", + "bez", + "bez-tz", + "be-by", + "bg", + "bgc", + "bgc-in", + "bg-bg", + "bho", + "bho-in", + "bm", + "bm-ml", + "bn", + "bn-bd", + "bn-in", + "bo", + "bo-cn", + "bo-in", + "br", + "brx", + "brx-in", + "br-fr", + "bs", + "bs-ba", + "ca", + "ca-ad", + "ca-es", + "ca-fr", + "ca-it", + "ccp", + "ccp-bd", + "ccp-in", + "ce", + "ceb", + "ceb-ph", + "ce-ru", + "cgg", + "cgg-ug", + "chr", + "chr-us", + "ckb", + "ckb-iq", + "ckb-ir", + "cs", + "cs-cz", + "cu", + "cu-ru", + "cv", + "cv-ru", + "cy", + "cy-gb", + "da", + "dav", + "dav-ke", + "da-dk", + "da-gl", + "de", + "de-at", + "de-be", + "de-ch", + "de-de", + "de-gr", + "de-it", + "de-li", + "de-lu", + "dje", + "dje-ne", + "doi", + "doi-in", + "dsb", + "dsb-de", + "dua", + "dua-cm", + "dyo", + "dyo-sn", + "dz", + "dz-bt", + "ebu", + "ebu-ke", + "ee", + "ee-gh", + "ee-tg", + "el", + "el-cy", + "el-gr", + "en", + "en-001", + "en-150", + "en-ae", + "en-ag", + "en-ai", + "en-as", + "en-at", + "en-au", + "en-bb", + "en-be", + "en-bi", + "en-bm", + "en-bs", + "en-bw", + "en-bz", + "en-ca", + "en-cc", + "en-ch", + "en-ck", + "en-cm", + "en-cn", + "en-cx", + "en-cy", + "en-de", + "en-dg", + "en-dk", + "en-dm", + "en-ee", + "en-er", + "en-fi", + "en-fj", + "en-fk", + "en-fm", + "en-fr", + "en-gb", + "en-gd", + "en-gg", + "en-gh", + "en-gi", + "en-gm", + "en-gu", + "en-gy", + "en-hk", + "en-ie", + "en-il", + "en-im", + "en-in", + "en-io", + "en-je", + "en-jm", + "en-ke", + "en-ki", + "en-kn", + "en-ky", + "en-lc", + "en-lr", + "en-ls", + "en-lu", + "en-mg", + "en-mh", + "en-mo", + "en-mp", + "en-ms", + "en-mt", + "en-mu", + "en-mv", + "en-mw", + "en-mx", + "en-my", + "en-na", + "en-nf", + "en-ng", + "en-nl", + "en-nr", + "en-nu", + "en-nz", + "en-pg", + "en-ph", + "en-pk", + "en-pn", + "en-pr", + "en-pw", + "en-rw", + "en-sb", + "en-sc", + "en-sd", + "en-se", + "en-sg", + "en-sh", + "en-si", + "en-sl", + "en-ss", + "en-sx", + "en-sz", + "en-tc", + "en-tk", + "en-to", + "en-tt", + "en-tv", + "en-tz", + "en-ug", + "en-um", + "en-us", + "en-vc", + "en-vg", + "en-vi", + "en-vu", + "en-ws", + "en-za", + "en-zm", + "en-zw", + "eo", + "eo-001", + "es", + "es-419", + "es-ar", + "es-bo", + "es-br", + "es-bz", + "es-cl", + "es-co", + "es-cr", + "es-cu", + "es-do", + "es-ea", + "es-ec", + "es-es", + "es-gq", + "es-gt", + "es-hn", + "es-ic", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-ph", + "es-pr", + "es-py", + "es-sv", + "es-us", + "es-uy", + "es-ve", + "et", + "et-ee", + "eu", + "eu-es", + "ewo", + "ewo-cm", + "fa", + "fa-af", + "fa-ir", + "ff", + "ff-bf", + "ff-cm", + "ff-gh", + "ff-gm", + "ff-gn", + "ff-gw", + "ff-lr", + "ff-mr", + "ff-ne", + "ff-ng", + "ff-sl", + "ff-sn", + "fi", + "fil", + "fil-ph", + "fi-fi", + "fo", + "fo-dk", + "fo-fo", + "fr", + "frr", + "frr-de", + "fr-be", + "fr-bf", + "fr-bi", + "fr-bj", + "fr-bl", + "fr-ca", + "fr-cd", + "fr-cf", + "fr-cg", + "fr-ch", + "fr-ci", + "fr-cm", + "fr-dj", + "fr-dz", + "fr-fr", + "fr-ga", + "fr-gf", + "fr-gn", + "fr-gp", + "fr-gq", + "fr-ht", + "fr-km", + "fr-lu", + "fr-ma", + "fr-mc", + "fr-mf", + "fr-mg", + "fr-ml", + "fr-mq", + "fr-mr", + "fr-mu", + "fr-nc", + "fr-ne", + "fr-pf", + "fr-pm", + "fr-re", + "fr-rw", + "fr-sc", + "fr-sn", + "fr-sy", + "fr-td", + "fr-tg", + "fr-tn", + "fr-vu", + "fr-wf", + "fr-yt", + "fur", + "fur-it", + "fy", + "fy-nl", + "ga", + "ga-gb", + "ga-ie", + "gd", + "gd-gb", + "gl", + "gl-es", + "gsw", + "gsw-ch", + "gsw-fr", + "gsw-li", + "gu", + "guz", + "guz-ke", + "gu-in", + "gv", + "gv-im", + "ha", + "haw", + "haw-us", + "ha-gh", + "ha-ne", + "ha-ng", + "he", + "hi", + "hi-in", + "hr", + "hr-ba", + "hr-hr", + "hsb", + "hsb-de", + "hu", + "hu-hu", + "hy", + "hy-am", + "ia", + "ia-001", + "id", + "ig", + "ig-ng", + "ii", + "ii-cn", + "id-id", + "is", + "is-is", + "it", + "it-ch", + "it-it", + "it-sm", + "it-va", + "he-il", + "ja", + "ja-jp", + "jgo", + "jgo-cm", + "yi", + "yi-001", + "jmc", + "jmc-tz", + "jv", + "jv-id", + "ka", + "kab", + "kab-dz", + "kam", + "kam-ke", + "ka-ge", + "kde", + "kde-tz", + "kea", + "kea-cv", + "kgp", + "kgp-br", + "khq", + "khq-ml", + "ki", + "ki-ke", + "kk", + "kkj", + "kkj-cm", + "kk-kz", + "kl", + "kln", + "kln-ke", + "kl-gl", + "km", + "km-kh", + "kn", + "kn-in", + "ko", + "kok", + "kok-in", + "ko-kp", + "ko-kr", + "ks", + "ksb", + "ksb-tz", + "ksf", + "ksf-cm", + "ksh", + "ksh-de", + "ks-in", + "ku", + "ku-tr", + "kw", + "kw-gb", + "ky", + "ky-kg", + "lag", + "lag-tz", + "lb", + "lb-lu", + "lg", + "lg-ug", + "lkt", + "lkt-us", + "ln", + "ln-ao", + "ln-cd", + "ln-cf", + "ln-cg", + "lo", + "lo-la", + "lrc", + "lrc-iq", + "lrc-ir", + "lt", + "lt-lt", + "lu", + "luo", + "luo-ke", + "luy", + "luy-ke", + "lu-cd", + "lv", + "lv-lv", + "mai", + "mai-in", + "mas", + "mas-ke", + "mas-tz", + "mdf", + "mdf-ru", + "mer", + "mer-ke", + "mfe", + "mfe-mu", + "mg", + "mgh", + "mgh-mz", + "mgo", + "mgo-cm", + "mg-mg", + "mi", + "mi-nz", + "mk", + "mk-mk", + "ml", + "ml-in", + "mn", + "mni", + "mni-in", + "mn-mn", + "mr", + "mr-in", + "ms", + "ms-bn", + "ms-id", + "ms-my", + "ms-sg", + "mt", + "mt-mt", + "mua", + "mua-cm", + "my", + "my-mm", + "mzn", + "mzn-ir", + "naq", + "naq-na", + "nb", + "nb-no", + "nb-sj", + "nd", + "nds", + "nds-de", + "nds-nl", + "nd-zw", + "ne", + "ne-in", + "ne-np", + "nl", + "nl-aw", + "nl-be", + "nl-bq", + "nl-ch", + "nl-cw", + "nl-lu", + "nl-nl", + "nl-sr", + "nl-sx", + "nmg", + "nmg-cm", + "nn", + "nnh", + "nnh-cm", + "nn-no", + "no", + "no-no", + "nus", + "nus-ss", + "nyn", + "nyn-ug", + "oc", + "oc-es", + "oc-fr", + "om", + "om-et", + "om-ke", + "or", + "or-in", + "os", + "os-ge", + "os-ru", + "pa", + "pa-in", + "pa-pk", + "pcm", + "pcm-ng", + "pis", + "pis-sb", + "pl", + "pl-pl", + "prg", + "prg-001", + "ps", + "ps-af", + "ps-pk", + "pt", + "pt-ao", + "pt-br", + "pt-ch", + "pt-cv", + "pt-gq", + "pt-gw", + "pt-lu", + "pt-mo", + "pt-mz", + "pt-pt", + "pt-st", + "pt-tl", + "qu", + "qu-bo", + "qu-ec", + "qu-pe", + "raj", + "raj-in", + "rm", + "rm-ch", + "rn", + "rn-bi", + "ro", + "rof", + "rof-tz", + "ro-md", + "ro-ro", + "ru", + "ru-by", + "ru-kg", + "ru-kz", + "ru-md", + "ru-ru", + "ru-ua", + "rw", + "rwk", + "rwk-tz", + "rw-rw", + "sa", + "sah", + "sah-ru", + "saq", + "saq-ke", + "sat", + "sat-in", + "sa-in", + "sbp", + "sbp-tz", + "sc", + "sc-it", + "sd", + "sd-in", + "sd-pk", + "se", + "seh", + "seh-mz", + "ses", + "ses-ml", + "se-fi", + "se-no", + "se-se", + "sg", + "sg-cf", + "shi", + "shi-ma", + "si", + "si-lk", + "sk", + "sk-sk", + "sl", + "sl-si", + "smn", + "smn-fi", + "sms", + "sms-fi", + "sn", + "sn-zw", + "so", + "so-dj", + "so-et", + "so-ke", + "so-so", + "sq", + "sq-al", + "sq-mk", + "sq-xk", + "sr", + "sr-ba", + "sr-cs", + "sr-me", + "sr-rs", + "sr-xk", + "su", + "su-id", + "sv", + "sv-ax", + "sv-fi", + "sv-se", + "sw", + "sw-cd", + "sw-ke", + "sw-tz", + "sw-ug", + "sy", + "ta", + "ta-in", + "ta-lk", + "ta-my", + "ta-sg", + "te", + "teo", + "teo-ke", + "teo-ug", + "te-in", + "tg", + "tg-tj", + "th", + "th-th", + "ti", + "ti-er", + "ti-et", + "tk", + "tk-tm", + "tl", + "to", + "tok", + "tok-001", + "to-to", + "tr", + "tr-cy", + "tr-tr", + "tt", + "tt-ru", + "twq", + "twq-ne", + "tzm", + "tzm-ma", + "ug", + "ug-cn", + "uk", + "uk-ua", + "ur", + "ur-in", + "ur-pk", + "uz", + "uz-af", + "uz-uz", + "vai", + "vai-lr", + "vi", + "vi-vn", + "vo", + "vo-001", + "vun", + "vun-tz", + "wae", + "wae-ch", + "wo", + "wo-sn", + "xh", + "xh-za", + "xog", + "xog-ug", + "yav", + "yav-cm", + "yo", + "yo-bj", + "yo-ng", + "yrl", + "yrl-br", + "yrl-co", + "yrl-ve", + "yue", + "yue-cn", + "yue-hk", + "zgh", + "zgh-ma", + "zh", + "zh-cn", + "zh-hans", + "zh-hant", + "zh-hk", + "zh-mo", + "zh-sg", + "zh-tw", + "zu", + "zu-za", + ] # noqa: E501 + if self.local_vars_configuration.client_side_validation and language not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `language` ({0}), must be one of {1}".format(language, allowed_values)) # noqa: E501 + + self._language = language + + @property + def business_unit_id(self): + """Gets the business_unit_id of this EmailCreateRequest. # noqa: E501 + + + :return: The business_unit_id of this EmailCreateRequest. # noqa: E501 + :rtype: int + """ + return self._business_unit_id + + @business_unit_id.setter + def business_unit_id(self, business_unit_id): + """Sets the business_unit_id of this EmailCreateRequest. + + + :param business_unit_id: The business_unit_id of this EmailCreateRequest. # noqa: E501 + :type business_unit_id: int + """ + + self._business_unit_id = business_unit_id + + @property + def content(self): + """Gets the content of this EmailCreateRequest. # noqa: E501 + + + :return: The content of this EmailCreateRequest. # noqa: E501 + :rtype: PublicEmailContent + """ + return self._content + + @content.setter + def content(self, content): + """Sets the content of this EmailCreateRequest. + + + :param content: The content of this EmailCreateRequest. # noqa: E501 + :type content: PublicEmailContent + """ + + self._content = content + + @property + def webversion(self): + """Gets the webversion of this EmailCreateRequest. # noqa: E501 + + + :return: The webversion of this EmailCreateRequest. # noqa: E501 + :rtype: PublicWebversionDetails + """ + return self._webversion + + @webversion.setter + def webversion(self, webversion): + """Sets the webversion of this EmailCreateRequest. + + + :param webversion: The webversion of this EmailCreateRequest. # noqa: E501 + :type webversion: PublicWebversionDetails + """ + + self._webversion = webversion + + @property + def archived(self): + """Gets the archived of this EmailCreateRequest. # noqa: E501 + + Determines if the email is archived or not. # noqa: E501 + + :return: The archived of this EmailCreateRequest. # noqa: E501 + :rtype: bool + """ + return self._archived + + @archived.setter + def archived(self, archived): + """Sets the archived of this EmailCreateRequest. + + Determines if the email is archived or not. # noqa: E501 + + :param archived: The archived of this EmailCreateRequest. # noqa: E501 + :type archived: bool + """ + + self._archived = archived + + @property + def subscription_details(self): + """Gets the subscription_details of this EmailCreateRequest. # noqa: E501 + + + :return: The subscription_details of this EmailCreateRequest. # noqa: E501 + :rtype: PublicEmailSubscriptionDetails + """ + return self._subscription_details + + @subscription_details.setter + def subscription_details(self, subscription_details): + """Sets the subscription_details of this EmailCreateRequest. + + + :param subscription_details: The subscription_details of this EmailCreateRequest. # noqa: E501 + :type subscription_details: PublicEmailSubscriptionDetails + """ + + self._subscription_details = subscription_details + + @property + def active_domain(self): + """Gets the active_domain of this EmailCreateRequest. # noqa: E501 + + The active domain of the email. # noqa: E501 + + :return: The active_domain of this EmailCreateRequest. # noqa: E501 + :rtype: str + """ + return self._active_domain + + @active_domain.setter + def active_domain(self, active_domain): + """Sets the active_domain of this EmailCreateRequest. + + The active domain of the email. # noqa: E501 + + :param active_domain: The active_domain of this EmailCreateRequest. # noqa: E501 + :type active_domain: str + """ + + self._active_domain = active_domain + + @property + def name(self): + """Gets the name of this EmailCreateRequest. # noqa: E501 + + The name of the email, as displayed on the email dashboard. # noqa: E501 + + :return: The name of this EmailCreateRequest. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this EmailCreateRequest. + + The name of the email, as displayed on the email dashboard. # noqa: E501 + + :param name: The name of this EmailCreateRequest. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def campaign(self): + """Gets the campaign of this EmailCreateRequest. # noqa: E501 + + The ID of the campaign this email is associated to. # noqa: E501 + + :return: The campaign of this EmailCreateRequest. # noqa: E501 + :rtype: str + """ + return self._campaign + + @campaign.setter + def campaign(self, campaign): + """Sets the campaign of this EmailCreateRequest. + + The ID of the campaign this email is associated to. # noqa: E501 + + :param campaign: The campaign of this EmailCreateRequest. # noqa: E501 + :type campaign: str + """ + + self._campaign = campaign + + @property + def _from(self): + """Gets the _from of this EmailCreateRequest. # noqa: E501 + + + :return: The _from of this EmailCreateRequest. # noqa: E501 + :rtype: PublicEmailFromDetails + """ + return self.__from + + @_from.setter + def _from(self, _from): + """Sets the _from of this EmailCreateRequest. + + + :param _from: The _from of this EmailCreateRequest. # noqa: E501 + :type _from: PublicEmailFromDetails + """ + + self.__from = _from + + @property + def jitter_send_time(self): + """Gets the jitter_send_time of this EmailCreateRequest. # noqa: E501 + + + :return: The jitter_send_time of this EmailCreateRequest. # noqa: E501 + :rtype: bool + """ + return self._jitter_send_time + + @jitter_send_time.setter + def jitter_send_time(self, jitter_send_time): + """Sets the jitter_send_time of this EmailCreateRequest. + + + :param jitter_send_time: The jitter_send_time of this EmailCreateRequest. # noqa: E501 + :type jitter_send_time: bool + """ + + self._jitter_send_time = jitter_send_time + + @property + def state(self): + """Gets the state of this EmailCreateRequest. # noqa: E501 + + The email state. # noqa: E501 + + :return: The state of this EmailCreateRequest. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this EmailCreateRequest. + + The email state. # noqa: E501 + + :param state: The state of this EmailCreateRequest. # noqa: E501 + :type state: str + """ + allowed_values = [ + "AUTOMATED", + "AUTOMATED_DRAFT", + "AUTOMATED_SENDING", + "AUTOMATED_FOR_FORM", + "AUTOMATED_FOR_FORM_BUFFER", + "AUTOMATED_FOR_FORM_DRAFT", + "AUTOMATED_FOR_FORM_LEGACY", + "BLOG_EMAIL_DRAFT", + "BLOG_EMAIL_PUBLISHED", + "DRAFT", + "DRAFT_AB", + "DRAFT_AB_VARIANT", + "ERROR", + "LOSER_AB_VARIANT", + "PAGE_STUB", + "PRE_PROCESSING", + "PROCESSING", + "PUBLISHED", + "PUBLISHED_AB", + "PUBLISHED_AB_VARIANT", + "PUBLISHED_OR_SCHEDULED", + "RSS_TO_EMAIL_DRAFT", + "RSS_TO_EMAIL_PUBLISHED", + "SCHEDULED", + "SCHEDULED_AB", + "SCHEDULED_OR_PUBLISHED", + "AUTOMATED_AB", + "AUTOMATED_AB_VARIANT", + "AUTOMATED_DRAFT_AB", + "AUTOMATED_DRAFT_ABVARIANT", + "AUTOMATED_LOSER_ABVARIANT", + ] # noqa: E501 + if self.local_vars_configuration.client_side_validation and state not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `state` ({0}), must be one of {1}".format(state, allowed_values)) # noqa: E501 + + self._state = state + + @property + def to(self): + """Gets the to of this EmailCreateRequest. # noqa: E501 + + + :return: The to of this EmailCreateRequest. # noqa: E501 + :rtype: PublicEmailToDetails + """ + return self._to + + @to.setter + def to(self, to): + """Sets the to of this EmailCreateRequest. + + + :param to: The to of this EmailCreateRequest. # noqa: E501 + :type to: PublicEmailToDetails + """ + + self._to = to + + @property + def subcategory(self): + """Gets the subcategory of this EmailCreateRequest. # noqa: E501 + + The email subcategory. # noqa: E501 + + :return: The subcategory of this EmailCreateRequest. # noqa: E501 + :rtype: str + """ + return self._subcategory + + @subcategory.setter + def subcategory(self, subcategory): + """Sets the subcategory of this EmailCreateRequest. + + The email subcategory. # noqa: E501 + + :param subcategory: The subcategory of this EmailCreateRequest. # noqa: E501 + :type subcategory: str + """ + allowed_values = [ + "ab_master", + "ab_variant", + "ab_loser_variant", + "page_stub", + "landing_page", + "site_page", + "legacy_page", + "ab_master_site_page", + "ab_variant_site_page", + "ab_loser_variant_site_page", + "performable_landing_page", + "performable_landing_page_cutover", + "staged_page", + "automated", + "automated_for_deal", + "automated_for_form", + "automated_for_form_legacy", + "automated_for_form_buffer", + "automated_for_form_draft", + "rss_to_email", + "rss_to_email_child", + "blog_email", + "blog_email_child", + "optin_email", + "optin_followup_email", + "batch", + "resubscribe_email", + "unsubscribe_confirmation_email", + "resubscribe_confirmation_email", + "single_send_api", + "marketing_single_send_api", + "smtp_token", + "localtime", + "automated_for_ticket", + "automated_for_leadflow", + "automated_for_feedback_ces", + "automated_for_feedback_nps", + "automated_for_feedback_custom", + "membership_registration", + "membership_password_saved", + "membership_password_reset", + "membership_otp_login", + "membership_passwordless_auth", + "membership_email_verification", + "membership_registration_follow_up", + "membership_verification", + "membership_follow_up", + "ticket_closed_kickback_email", + "ticket_opened_kickback_email", + "automated_for_custom_survey", + "discardable_stub", + "normal_blog_post", + "legacy_blog_post", + "imported_blog_post", + "automated_ab_master", + "automated_ab_variant", + "web_interactive", + "portal_content", + "page_instance_layout", + "kb_article_instance_layout", + "kb_listing", + "kb_search_results", + "kb_support_form", + "case_study", + "case_study_listing", + "case_study_instance_layout", + "UNKNOWN", + ] # noqa: E501 + if self.local_vars_configuration.client_side_validation and subcategory not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `subcategory` ({0}), must be one of {1}".format(subcategory, allowed_values)) # noqa: E501 + + self._subcategory = subcategory + + @property + def send_on_publish(self): + """Gets the send_on_publish of this EmailCreateRequest. # noqa: E501 + + Determines whether the email will be sent immediately on publish. # noqa: E501 + + :return: The send_on_publish of this EmailCreateRequest. # noqa: E501 + :rtype: bool + """ + return self._send_on_publish + + @send_on_publish.setter + def send_on_publish(self, send_on_publish): + """Sets the send_on_publish of this EmailCreateRequest. + + Determines whether the email will be sent immediately on publish. # noqa: E501 + + :param send_on_publish: The send_on_publish of this EmailCreateRequest. # noqa: E501 + :type send_on_publish: bool + """ + + self._send_on_publish = send_on_publish + + 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, EmailCreateRequest): + 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, EmailCreateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/email_statistic_interval.py b/hubspot/marketing/emails/models/email_statistic_interval.py new file mode 100644 index 00000000..c75ed88c --- /dev/null +++ b/hubspot/marketing/emails/models/email_statistic_interval.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class EmailStatisticInterval(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 = {"interval": "Interval", "aggregations": "EmailStatisticsData"} + + attribute_map = {"interval": "interval", "aggregations": "aggregations"} + + def __init__(self, interval=None, aggregations=None, local_vars_configuration=None): # noqa: E501 + """EmailStatisticInterval - 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._interval = None + self._aggregations = None + self.discriminator = None + + if interval is not None: + self.interval = interval + if aggregations is not None: + self.aggregations = aggregations + + @property + def interval(self): + """Gets the interval of this EmailStatisticInterval. # noqa: E501 + + + :return: The interval of this EmailStatisticInterval. # noqa: E501 + :rtype: Interval + """ + return self._interval + + @interval.setter + def interval(self, interval): + """Sets the interval of this EmailStatisticInterval. + + + :param interval: The interval of this EmailStatisticInterval. # noqa: E501 + :type interval: Interval + """ + + self._interval = interval + + @property + def aggregations(self): + """Gets the aggregations of this EmailStatisticInterval. # noqa: E501 + + + :return: The aggregations of this EmailStatisticInterval. # noqa: E501 + :rtype: EmailStatisticsData + """ + return self._aggregations + + @aggregations.setter + def aggregations(self, aggregations): + """Sets the aggregations of this EmailStatisticInterval. + + + :param aggregations: The aggregations of this EmailStatisticInterval. # noqa: E501 + :type aggregations: EmailStatisticsData + """ + + self._aggregations = aggregations + + 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, EmailStatisticInterval): + 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, EmailStatisticInterval): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/email_statistics_data.py b/hubspot/marketing/emails/models/email_statistics_data.py new file mode 100644 index 00000000..783f560b --- /dev/null +++ b/hubspot/marketing/emails/models/email_statistics_data.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class EmailStatisticsData(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 = {"device_breakdown": "dict[str, dict[str, int]]", "qualifier_stats": "dict[str, dict[str, int]]", "counters": "dict[str, int]", "ratios": "dict[str, float]"} + + attribute_map = {"device_breakdown": "deviceBreakdown", "qualifier_stats": "qualifierStats", "counters": "counters", "ratios": "ratios"} + + def __init__(self, device_breakdown=None, qualifier_stats=None, counters=None, ratios=None, local_vars_configuration=None): # noqa: E501 + """EmailStatisticsData - 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._device_breakdown = None + self._qualifier_stats = None + self._counters = None + self._ratios = None + self.discriminator = None + + self.device_breakdown = device_breakdown + self.qualifier_stats = qualifier_stats + self.counters = counters + self.ratios = ratios + + @property + def device_breakdown(self): + """Gets the device_breakdown of this EmailStatisticsData. # noqa: E501 + + Statistics by device. # noqa: E501 + + :return: The device_breakdown of this EmailStatisticsData. # noqa: E501 + :rtype: dict[str, dict[str, int]] + """ + return self._device_breakdown + + @device_breakdown.setter + def device_breakdown(self, device_breakdown): + """Sets the device_breakdown of this EmailStatisticsData. + + Statistics by device. # noqa: E501 + + :param device_breakdown: The device_breakdown of this EmailStatisticsData. # noqa: E501 + :type device_breakdown: dict[str, dict[str, int]] + """ + if self.local_vars_configuration.client_side_validation and device_breakdown is None: # noqa: E501 + raise ValueError("Invalid value for `device_breakdown`, must not be `None`") # noqa: E501 + + self._device_breakdown = device_breakdown + + @property + def qualifier_stats(self): + """Gets the qualifier_stats of this EmailStatisticsData. # noqa: E501 + + Number of emails that were dropped and bounced. # noqa: E501 + + :return: The qualifier_stats of this EmailStatisticsData. # noqa: E501 + :rtype: dict[str, dict[str, int]] + """ + return self._qualifier_stats + + @qualifier_stats.setter + def qualifier_stats(self, qualifier_stats): + """Sets the qualifier_stats of this EmailStatisticsData. + + Number of emails that were dropped and bounced. # noqa: E501 + + :param qualifier_stats: The qualifier_stats of this EmailStatisticsData. # noqa: E501 + :type qualifier_stats: dict[str, dict[str, int]] + """ + if self.local_vars_configuration.client_side_validation and qualifier_stats is None: # noqa: E501 + raise ValueError("Invalid value for `qualifier_stats`, must not be `None`") # noqa: E501 + + self._qualifier_stats = qualifier_stats + + @property + def counters(self): + """Gets the counters of this EmailStatisticsData. # noqa: E501 + + Counters like number of `sent`, `open` or `delivered`. # noqa: E501 + + :return: The counters of this EmailStatisticsData. # noqa: E501 + :rtype: dict[str, int] + """ + return self._counters + + @counters.setter + def counters(self, counters): + """Sets the counters of this EmailStatisticsData. + + Counters like number of `sent`, `open` or `delivered`. # noqa: E501 + + :param counters: The counters of this EmailStatisticsData. # noqa: E501 + :type counters: dict[str, int] + """ + if self.local_vars_configuration.client_side_validation and counters is None: # noqa: E501 + raise ValueError("Invalid value for `counters`, must not be `None`") # noqa: E501 + + self._counters = counters + + @property + def ratios(self): + """Gets the ratios of this EmailStatisticsData. # noqa: E501 + + Ratios like `openratio` or `clickratio` # noqa: E501 + + :return: The ratios of this EmailStatisticsData. # noqa: E501 + :rtype: dict[str, float] + """ + return self._ratios + + @ratios.setter + def ratios(self, ratios): + """Sets the ratios of this EmailStatisticsData. + + Ratios like `openratio` or `clickratio` # noqa: E501 + + :param ratios: The ratios of this EmailStatisticsData. # noqa: E501 + :type ratios: dict[str, float] + """ + if self.local_vars_configuration.client_side_validation and ratios is None: # noqa: E501 + raise ValueError("Invalid value for `ratios`, must not be `None`") # noqa: E501 + + self._ratios = ratios + + 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, EmailStatisticsData): + 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, EmailStatisticsData): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/email_update_request.py b/hubspot/marketing/emails/models/email_update_request.py new file mode 100644 index 00000000..0892d5a0 --- /dev/null +++ b/hubspot/marketing/emails/models/email_update_request.py @@ -0,0 +1,1531 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class EmailUpdateRequest(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 = { + "rss_data": "PublicRssEmailDetails", + "subject": "str", + "testing": "PublicEmailTestingDetails", + "publish_date": "datetime", + "language": "str", + "business_unit_id": "int", + "content": "PublicEmailContent", + "webversion": "PublicWebversionDetails", + "archived": "bool", + "subscription_details": "PublicEmailSubscriptionDetails", + "active_domain": "str", + "name": "str", + "campaign": "str", + "_from": "PublicEmailFromDetails", + "jitter_send_time": "bool", + "state": "str", + "to": "PublicEmailToDetails", + "subcategory": "str", + "send_on_publish": "bool", + } + + attribute_map = { + "rss_data": "rssData", + "subject": "subject", + "testing": "testing", + "publish_date": "publishDate", + "language": "language", + "business_unit_id": "businessUnitId", + "content": "content", + "webversion": "webversion", + "archived": "archived", + "subscription_details": "subscriptionDetails", + "active_domain": "activeDomain", + "name": "name", + "campaign": "campaign", + "_from": "from", + "jitter_send_time": "jitterSendTime", + "state": "state", + "to": "to", + "subcategory": "subcategory", + "send_on_publish": "sendOnPublish", + } + + def __init__( + self, + rss_data=None, + subject=None, + testing=None, + publish_date=None, + language=None, + business_unit_id=None, + content=None, + webversion=None, + archived=None, + subscription_details=None, + active_domain=None, + name=None, + campaign=None, + _from=None, + jitter_send_time=None, + state=None, + to=None, + subcategory=None, + send_on_publish=None, + local_vars_configuration=None, + ): # noqa: E501 + """EmailUpdateRequest - 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._rss_data = None + self._subject = None + self._testing = None + self._publish_date = None + self._language = None + self._business_unit_id = None + self._content = None + self._webversion = None + self._archived = None + self._subscription_details = None + self._active_domain = None + self._name = None + self._campaign = None + self.__from = None + self._jitter_send_time = None + self._state = None + self._to = None + self._subcategory = None + self._send_on_publish = None + self.discriminator = None + + if rss_data is not None: + self.rss_data = rss_data + if subject is not None: + self.subject = subject + if testing is not None: + self.testing = testing + if publish_date is not None: + self.publish_date = publish_date + if language is not None: + self.language = language + if business_unit_id is not None: + self.business_unit_id = business_unit_id + if content is not None: + self.content = content + if webversion is not None: + self.webversion = webversion + if archived is not None: + self.archived = archived + if subscription_details is not None: + self.subscription_details = subscription_details + if active_domain is not None: + self.active_domain = active_domain + if name is not None: + self.name = name + if campaign is not None: + self.campaign = campaign + if _from is not None: + self._from = _from + if jitter_send_time is not None: + self.jitter_send_time = jitter_send_time + if state is not None: + self.state = state + if to is not None: + self.to = to + if subcategory is not None: + self.subcategory = subcategory + if send_on_publish is not None: + self.send_on_publish = send_on_publish + + @property + def rss_data(self): + """Gets the rss_data of this EmailUpdateRequest. # noqa: E501 + + + :return: The rss_data of this EmailUpdateRequest. # noqa: E501 + :rtype: PublicRssEmailDetails + """ + return self._rss_data + + @rss_data.setter + def rss_data(self, rss_data): + """Sets the rss_data of this EmailUpdateRequest. + + + :param rss_data: The rss_data of this EmailUpdateRequest. # noqa: E501 + :type rss_data: PublicRssEmailDetails + """ + + self._rss_data = rss_data + + @property + def subject(self): + """Gets the subject of this EmailUpdateRequest. # noqa: E501 + + The subject of the email. # noqa: E501 + + :return: The subject of this EmailUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._subject + + @subject.setter + def subject(self, subject): + """Sets the subject of this EmailUpdateRequest. + + The subject of the email. # noqa: E501 + + :param subject: The subject of this EmailUpdateRequest. # noqa: E501 + :type subject: str + """ + + self._subject = subject + + @property + def testing(self): + """Gets the testing of this EmailUpdateRequest. # noqa: E501 + + + :return: The testing of this EmailUpdateRequest. # noqa: E501 + :rtype: PublicEmailTestingDetails + """ + return self._testing + + @testing.setter + def testing(self, testing): + """Sets the testing of this EmailUpdateRequest. + + + :param testing: The testing of this EmailUpdateRequest. # noqa: E501 + :type testing: PublicEmailTestingDetails + """ + + self._testing = testing + + @property + def publish_date(self): + """Gets the publish_date of this EmailUpdateRequest. # noqa: E501 + + The date and time the email is scheduled for, in ISO8601 representation. This is only used in local time or scheduled emails. # noqa: E501 + + :return: The publish_date of this EmailUpdateRequest. # noqa: E501 + :rtype: datetime + """ + return self._publish_date + + @publish_date.setter + def publish_date(self, publish_date): + """Sets the publish_date of this EmailUpdateRequest. + + The date and time the email is scheduled for, in ISO8601 representation. This is only used in local time or scheduled emails. # noqa: E501 + + :param publish_date: The publish_date of this EmailUpdateRequest. # noqa: E501 + :type publish_date: datetime + """ + + self._publish_date = publish_date + + @property + def language(self): + """Gets the language of this EmailUpdateRequest. # noqa: E501 + + + :return: The language of this EmailUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this EmailUpdateRequest. + + + :param language: The language of this EmailUpdateRequest. # noqa: E501 + :type language: str + """ + allowed_values = [ + "af", + "af-na", + "af-za", + "agq", + "agq-cm", + "ak", + "ak-gh", + "am", + "am-et", + "ann", + "ann-ng", + "ar", + "ar-001", + "ar-ae", + "ar-bh", + "ar-dj", + "ar-dz", + "ar-eg", + "ar-eh", + "ar-er", + "ar-il", + "ar-iq", + "ar-jo", + "ar-km", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-mr", + "ar-om", + "ar-ps", + "ar-qa", + "ar-sa", + "ar-sd", + "ar-so", + "ar-ss", + "ar-sy", + "ar-td", + "ar-tn", + "ar-ye", + "as", + "asa", + "asa-tz", + "ast", + "ast-es", + "as-in", + "az", + "az-az", + "bas", + "bas-cm", + "be", + "bem", + "bem-zm", + "bez", + "bez-tz", + "be-by", + "bg", + "bgc", + "bgc-in", + "bg-bg", + "bho", + "bho-in", + "bm", + "bm-ml", + "bn", + "bn-bd", + "bn-in", + "bo", + "bo-cn", + "bo-in", + "br", + "brx", + "brx-in", + "br-fr", + "bs", + "bs-ba", + "ca", + "ca-ad", + "ca-es", + "ca-fr", + "ca-it", + "ccp", + "ccp-bd", + "ccp-in", + "ce", + "ceb", + "ceb-ph", + "ce-ru", + "cgg", + "cgg-ug", + "chr", + "chr-us", + "ckb", + "ckb-iq", + "ckb-ir", + "cs", + "cs-cz", + "cu", + "cu-ru", + "cv", + "cv-ru", + "cy", + "cy-gb", + "da", + "dav", + "dav-ke", + "da-dk", + "da-gl", + "de", + "de-at", + "de-be", + "de-ch", + "de-de", + "de-gr", + "de-it", + "de-li", + "de-lu", + "dje", + "dje-ne", + "doi", + "doi-in", + "dsb", + "dsb-de", + "dua", + "dua-cm", + "dyo", + "dyo-sn", + "dz", + "dz-bt", + "ebu", + "ebu-ke", + "ee", + "ee-gh", + "ee-tg", + "el", + "el-cy", + "el-gr", + "en", + "en-001", + "en-150", + "en-ae", + "en-ag", + "en-ai", + "en-as", + "en-at", + "en-au", + "en-bb", + "en-be", + "en-bi", + "en-bm", + "en-bs", + "en-bw", + "en-bz", + "en-ca", + "en-cc", + "en-ch", + "en-ck", + "en-cm", + "en-cn", + "en-cx", + "en-cy", + "en-de", + "en-dg", + "en-dk", + "en-dm", + "en-ee", + "en-er", + "en-fi", + "en-fj", + "en-fk", + "en-fm", + "en-fr", + "en-gb", + "en-gd", + "en-gg", + "en-gh", + "en-gi", + "en-gm", + "en-gu", + "en-gy", + "en-hk", + "en-ie", + "en-il", + "en-im", + "en-in", + "en-io", + "en-je", + "en-jm", + "en-ke", + "en-ki", + "en-kn", + "en-ky", + "en-lc", + "en-lr", + "en-ls", + "en-lu", + "en-mg", + "en-mh", + "en-mo", + "en-mp", + "en-ms", + "en-mt", + "en-mu", + "en-mv", + "en-mw", + "en-mx", + "en-my", + "en-na", + "en-nf", + "en-ng", + "en-nl", + "en-nr", + "en-nu", + "en-nz", + "en-pg", + "en-ph", + "en-pk", + "en-pn", + "en-pr", + "en-pw", + "en-rw", + "en-sb", + "en-sc", + "en-sd", + "en-se", + "en-sg", + "en-sh", + "en-si", + "en-sl", + "en-ss", + "en-sx", + "en-sz", + "en-tc", + "en-tk", + "en-to", + "en-tt", + "en-tv", + "en-tz", + "en-ug", + "en-um", + "en-us", + "en-vc", + "en-vg", + "en-vi", + "en-vu", + "en-ws", + "en-za", + "en-zm", + "en-zw", + "eo", + "eo-001", + "es", + "es-419", + "es-ar", + "es-bo", + "es-br", + "es-bz", + "es-cl", + "es-co", + "es-cr", + "es-cu", + "es-do", + "es-ea", + "es-ec", + "es-es", + "es-gq", + "es-gt", + "es-hn", + "es-ic", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-ph", + "es-pr", + "es-py", + "es-sv", + "es-us", + "es-uy", + "es-ve", + "et", + "et-ee", + "eu", + "eu-es", + "ewo", + "ewo-cm", + "fa", + "fa-af", + "fa-ir", + "ff", + "ff-bf", + "ff-cm", + "ff-gh", + "ff-gm", + "ff-gn", + "ff-gw", + "ff-lr", + "ff-mr", + "ff-ne", + "ff-ng", + "ff-sl", + "ff-sn", + "fi", + "fil", + "fil-ph", + "fi-fi", + "fo", + "fo-dk", + "fo-fo", + "fr", + "frr", + "frr-de", + "fr-be", + "fr-bf", + "fr-bi", + "fr-bj", + "fr-bl", + "fr-ca", + "fr-cd", + "fr-cf", + "fr-cg", + "fr-ch", + "fr-ci", + "fr-cm", + "fr-dj", + "fr-dz", + "fr-fr", + "fr-ga", + "fr-gf", + "fr-gn", + "fr-gp", + "fr-gq", + "fr-ht", + "fr-km", + "fr-lu", + "fr-ma", + "fr-mc", + "fr-mf", + "fr-mg", + "fr-ml", + "fr-mq", + "fr-mr", + "fr-mu", + "fr-nc", + "fr-ne", + "fr-pf", + "fr-pm", + "fr-re", + "fr-rw", + "fr-sc", + "fr-sn", + "fr-sy", + "fr-td", + "fr-tg", + "fr-tn", + "fr-vu", + "fr-wf", + "fr-yt", + "fur", + "fur-it", + "fy", + "fy-nl", + "ga", + "ga-gb", + "ga-ie", + "gd", + "gd-gb", + "gl", + "gl-es", + "gsw", + "gsw-ch", + "gsw-fr", + "gsw-li", + "gu", + "guz", + "guz-ke", + "gu-in", + "gv", + "gv-im", + "ha", + "haw", + "haw-us", + "ha-gh", + "ha-ne", + "ha-ng", + "he", + "hi", + "hi-in", + "hr", + "hr-ba", + "hr-hr", + "hsb", + "hsb-de", + "hu", + "hu-hu", + "hy", + "hy-am", + "ia", + "ia-001", + "id", + "ig", + "ig-ng", + "ii", + "ii-cn", + "id-id", + "is", + "is-is", + "it", + "it-ch", + "it-it", + "it-sm", + "it-va", + "he-il", + "ja", + "ja-jp", + "jgo", + "jgo-cm", + "yi", + "yi-001", + "jmc", + "jmc-tz", + "jv", + "jv-id", + "ka", + "kab", + "kab-dz", + "kam", + "kam-ke", + "ka-ge", + "kde", + "kde-tz", + "kea", + "kea-cv", + "kgp", + "kgp-br", + "khq", + "khq-ml", + "ki", + "ki-ke", + "kk", + "kkj", + "kkj-cm", + "kk-kz", + "kl", + "kln", + "kln-ke", + "kl-gl", + "km", + "km-kh", + "kn", + "kn-in", + "ko", + "kok", + "kok-in", + "ko-kp", + "ko-kr", + "ks", + "ksb", + "ksb-tz", + "ksf", + "ksf-cm", + "ksh", + "ksh-de", + "ks-in", + "ku", + "ku-tr", + "kw", + "kw-gb", + "ky", + "ky-kg", + "lag", + "lag-tz", + "lb", + "lb-lu", + "lg", + "lg-ug", + "lkt", + "lkt-us", + "ln", + "ln-ao", + "ln-cd", + "ln-cf", + "ln-cg", + "lo", + "lo-la", + "lrc", + "lrc-iq", + "lrc-ir", + "lt", + "lt-lt", + "lu", + "luo", + "luo-ke", + "luy", + "luy-ke", + "lu-cd", + "lv", + "lv-lv", + "mai", + "mai-in", + "mas", + "mas-ke", + "mas-tz", + "mdf", + "mdf-ru", + "mer", + "mer-ke", + "mfe", + "mfe-mu", + "mg", + "mgh", + "mgh-mz", + "mgo", + "mgo-cm", + "mg-mg", + "mi", + "mi-nz", + "mk", + "mk-mk", + "ml", + "ml-in", + "mn", + "mni", + "mni-in", + "mn-mn", + "mr", + "mr-in", + "ms", + "ms-bn", + "ms-id", + "ms-my", + "ms-sg", + "mt", + "mt-mt", + "mua", + "mua-cm", + "my", + "my-mm", + "mzn", + "mzn-ir", + "naq", + "naq-na", + "nb", + "nb-no", + "nb-sj", + "nd", + "nds", + "nds-de", + "nds-nl", + "nd-zw", + "ne", + "ne-in", + "ne-np", + "nl", + "nl-aw", + "nl-be", + "nl-bq", + "nl-ch", + "nl-cw", + "nl-lu", + "nl-nl", + "nl-sr", + "nl-sx", + "nmg", + "nmg-cm", + "nn", + "nnh", + "nnh-cm", + "nn-no", + "no", + "no-no", + "nus", + "nus-ss", + "nyn", + "nyn-ug", + "oc", + "oc-es", + "oc-fr", + "om", + "om-et", + "om-ke", + "or", + "or-in", + "os", + "os-ge", + "os-ru", + "pa", + "pa-in", + "pa-pk", + "pcm", + "pcm-ng", + "pis", + "pis-sb", + "pl", + "pl-pl", + "prg", + "prg-001", + "ps", + "ps-af", + "ps-pk", + "pt", + "pt-ao", + "pt-br", + "pt-ch", + "pt-cv", + "pt-gq", + "pt-gw", + "pt-lu", + "pt-mo", + "pt-mz", + "pt-pt", + "pt-st", + "pt-tl", + "qu", + "qu-bo", + "qu-ec", + "qu-pe", + "raj", + "raj-in", + "rm", + "rm-ch", + "rn", + "rn-bi", + "ro", + "rof", + "rof-tz", + "ro-md", + "ro-ro", + "ru", + "ru-by", + "ru-kg", + "ru-kz", + "ru-md", + "ru-ru", + "ru-ua", + "rw", + "rwk", + "rwk-tz", + "rw-rw", + "sa", + "sah", + "sah-ru", + "saq", + "saq-ke", + "sat", + "sat-in", + "sa-in", + "sbp", + "sbp-tz", + "sc", + "sc-it", + "sd", + "sd-in", + "sd-pk", + "se", + "seh", + "seh-mz", + "ses", + "ses-ml", + "se-fi", + "se-no", + "se-se", + "sg", + "sg-cf", + "shi", + "shi-ma", + "si", + "si-lk", + "sk", + "sk-sk", + "sl", + "sl-si", + "smn", + "smn-fi", + "sms", + "sms-fi", + "sn", + "sn-zw", + "so", + "so-dj", + "so-et", + "so-ke", + "so-so", + "sq", + "sq-al", + "sq-mk", + "sq-xk", + "sr", + "sr-ba", + "sr-cs", + "sr-me", + "sr-rs", + "sr-xk", + "su", + "su-id", + "sv", + "sv-ax", + "sv-fi", + "sv-se", + "sw", + "sw-cd", + "sw-ke", + "sw-tz", + "sw-ug", + "sy", + "ta", + "ta-in", + "ta-lk", + "ta-my", + "ta-sg", + "te", + "teo", + "teo-ke", + "teo-ug", + "te-in", + "tg", + "tg-tj", + "th", + "th-th", + "ti", + "ti-er", + "ti-et", + "tk", + "tk-tm", + "tl", + "to", + "tok", + "tok-001", + "to-to", + "tr", + "tr-cy", + "tr-tr", + "tt", + "tt-ru", + "twq", + "twq-ne", + "tzm", + "tzm-ma", + "ug", + "ug-cn", + "uk", + "uk-ua", + "ur", + "ur-in", + "ur-pk", + "uz", + "uz-af", + "uz-uz", + "vai", + "vai-lr", + "vi", + "vi-vn", + "vo", + "vo-001", + "vun", + "vun-tz", + "wae", + "wae-ch", + "wo", + "wo-sn", + "xh", + "xh-za", + "xog", + "xog-ug", + "yav", + "yav-cm", + "yo", + "yo-bj", + "yo-ng", + "yrl", + "yrl-br", + "yrl-co", + "yrl-ve", + "yue", + "yue-cn", + "yue-hk", + "zgh", + "zgh-ma", + "zh", + "zh-cn", + "zh-hans", + "zh-hant", + "zh-hk", + "zh-mo", + "zh-sg", + "zh-tw", + "zu", + "zu-za", + ] # noqa: E501 + if self.local_vars_configuration.client_side_validation and language not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `language` ({0}), must be one of {1}".format(language, allowed_values)) # noqa: E501 + + self._language = language + + @property + def business_unit_id(self): + """Gets the business_unit_id of this EmailUpdateRequest. # noqa: E501 + + + :return: The business_unit_id of this EmailUpdateRequest. # noqa: E501 + :rtype: int + """ + return self._business_unit_id + + @business_unit_id.setter + def business_unit_id(self, business_unit_id): + """Sets the business_unit_id of this EmailUpdateRequest. + + + :param business_unit_id: The business_unit_id of this EmailUpdateRequest. # noqa: E501 + :type business_unit_id: int + """ + + self._business_unit_id = business_unit_id + + @property + def content(self): + """Gets the content of this EmailUpdateRequest. # noqa: E501 + + + :return: The content of this EmailUpdateRequest. # noqa: E501 + :rtype: PublicEmailContent + """ + return self._content + + @content.setter + def content(self, content): + """Sets the content of this EmailUpdateRequest. + + + :param content: The content of this EmailUpdateRequest. # noqa: E501 + :type content: PublicEmailContent + """ + + self._content = content + + @property + def webversion(self): + """Gets the webversion of this EmailUpdateRequest. # noqa: E501 + + + :return: The webversion of this EmailUpdateRequest. # noqa: E501 + :rtype: PublicWebversionDetails + """ + return self._webversion + + @webversion.setter + def webversion(self, webversion): + """Sets the webversion of this EmailUpdateRequest. + + + :param webversion: The webversion of this EmailUpdateRequest. # noqa: E501 + :type webversion: PublicWebversionDetails + """ + + self._webversion = webversion + + @property + def archived(self): + """Gets the archived of this EmailUpdateRequest. # noqa: E501 + + Determines if the email is archived or not. # noqa: E501 + + :return: The archived of this EmailUpdateRequest. # noqa: E501 + :rtype: bool + """ + return self._archived + + @archived.setter + def archived(self, archived): + """Sets the archived of this EmailUpdateRequest. + + Determines if the email is archived or not. # noqa: E501 + + :param archived: The archived of this EmailUpdateRequest. # noqa: E501 + :type archived: bool + """ + + self._archived = archived + + @property + def subscription_details(self): + """Gets the subscription_details of this EmailUpdateRequest. # noqa: E501 + + + :return: The subscription_details of this EmailUpdateRequest. # noqa: E501 + :rtype: PublicEmailSubscriptionDetails + """ + return self._subscription_details + + @subscription_details.setter + def subscription_details(self, subscription_details): + """Sets the subscription_details of this EmailUpdateRequest. + + + :param subscription_details: The subscription_details of this EmailUpdateRequest. # noqa: E501 + :type subscription_details: PublicEmailSubscriptionDetails + """ + + self._subscription_details = subscription_details + + @property + def active_domain(self): + """Gets the active_domain of this EmailUpdateRequest. # noqa: E501 + + The active domain of the email. # noqa: E501 + + :return: The active_domain of this EmailUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._active_domain + + @active_domain.setter + def active_domain(self, active_domain): + """Sets the active_domain of this EmailUpdateRequest. + + The active domain of the email. # noqa: E501 + + :param active_domain: The active_domain of this EmailUpdateRequest. # noqa: E501 + :type active_domain: str + """ + + self._active_domain = active_domain + + @property + def name(self): + """Gets the name of this EmailUpdateRequest. # noqa: E501 + + The name of the email, as displayed on the email dashboard. # noqa: E501 + + :return: The name of this EmailUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this EmailUpdateRequest. + + The name of the email, as displayed on the email dashboard. # noqa: E501 + + :param name: The name of this EmailUpdateRequest. # noqa: E501 + :type name: str + """ + + self._name = name + + @property + def campaign(self): + """Gets the campaign of this EmailUpdateRequest. # noqa: E501 + + The ID of the campaign this email is associated to. # noqa: E501 + + :return: The campaign of this EmailUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._campaign + + @campaign.setter + def campaign(self, campaign): + """Sets the campaign of this EmailUpdateRequest. + + The ID of the campaign this email is associated to. # noqa: E501 + + :param campaign: The campaign of this EmailUpdateRequest. # noqa: E501 + :type campaign: str + """ + + self._campaign = campaign + + @property + def _from(self): + """Gets the _from of this EmailUpdateRequest. # noqa: E501 + + + :return: The _from of this EmailUpdateRequest. # noqa: E501 + :rtype: PublicEmailFromDetails + """ + return self.__from + + @_from.setter + def _from(self, _from): + """Sets the _from of this EmailUpdateRequest. + + + :param _from: The _from of this EmailUpdateRequest. # noqa: E501 + :type _from: PublicEmailFromDetails + """ + + self.__from = _from + + @property + def jitter_send_time(self): + """Gets the jitter_send_time of this EmailUpdateRequest. # noqa: E501 + + + :return: The jitter_send_time of this EmailUpdateRequest. # noqa: E501 + :rtype: bool + """ + return self._jitter_send_time + + @jitter_send_time.setter + def jitter_send_time(self, jitter_send_time): + """Sets the jitter_send_time of this EmailUpdateRequest. + + + :param jitter_send_time: The jitter_send_time of this EmailUpdateRequest. # noqa: E501 + :type jitter_send_time: bool + """ + + self._jitter_send_time = jitter_send_time + + @property + def state(self): + """Gets the state of this EmailUpdateRequest. # noqa: E501 + + The email state. # noqa: E501 + + :return: The state of this EmailUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this EmailUpdateRequest. + + The email state. # noqa: E501 + + :param state: The state of this EmailUpdateRequest. # noqa: E501 + :type state: str + """ + allowed_values = [ + "AUTOMATED", + "AUTOMATED_DRAFT", + "AUTOMATED_SENDING", + "AUTOMATED_FOR_FORM", + "AUTOMATED_FOR_FORM_BUFFER", + "AUTOMATED_FOR_FORM_DRAFT", + "AUTOMATED_FOR_FORM_LEGACY", + "BLOG_EMAIL_DRAFT", + "BLOG_EMAIL_PUBLISHED", + "DRAFT", + "DRAFT_AB", + "DRAFT_AB_VARIANT", + "ERROR", + "LOSER_AB_VARIANT", + "PAGE_STUB", + "PRE_PROCESSING", + "PROCESSING", + "PUBLISHED", + "PUBLISHED_AB", + "PUBLISHED_AB_VARIANT", + "PUBLISHED_OR_SCHEDULED", + "RSS_TO_EMAIL_DRAFT", + "RSS_TO_EMAIL_PUBLISHED", + "SCHEDULED", + "SCHEDULED_AB", + "SCHEDULED_OR_PUBLISHED", + "AUTOMATED_AB", + "AUTOMATED_AB_VARIANT", + "AUTOMATED_DRAFT_AB", + "AUTOMATED_DRAFT_ABVARIANT", + "AUTOMATED_LOSER_ABVARIANT", + ] # noqa: E501 + if self.local_vars_configuration.client_side_validation and state not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `state` ({0}), must be one of {1}".format(state, allowed_values)) # noqa: E501 + + self._state = state + + @property + def to(self): + """Gets the to of this EmailUpdateRequest. # noqa: E501 + + + :return: The to of this EmailUpdateRequest. # noqa: E501 + :rtype: PublicEmailToDetails + """ + return self._to + + @to.setter + def to(self, to): + """Sets the to of this EmailUpdateRequest. + + + :param to: The to of this EmailUpdateRequest. # noqa: E501 + :type to: PublicEmailToDetails + """ + + self._to = to + + @property + def subcategory(self): + """Gets the subcategory of this EmailUpdateRequest. # noqa: E501 + + The email subcategory. # noqa: E501 + + :return: The subcategory of this EmailUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._subcategory + + @subcategory.setter + def subcategory(self, subcategory): + """Sets the subcategory of this EmailUpdateRequest. + + The email subcategory. # noqa: E501 + + :param subcategory: The subcategory of this EmailUpdateRequest. # noqa: E501 + :type subcategory: str + """ + allowed_values = [ + "ab_master", + "ab_variant", + "ab_loser_variant", + "page_stub", + "landing_page", + "site_page", + "legacy_page", + "ab_master_site_page", + "ab_variant_site_page", + "ab_loser_variant_site_page", + "performable_landing_page", + "performable_landing_page_cutover", + "staged_page", + "automated", + "automated_for_deal", + "automated_for_form", + "automated_for_form_legacy", + "automated_for_form_buffer", + "automated_for_form_draft", + "rss_to_email", + "rss_to_email_child", + "blog_email", + "blog_email_child", + "optin_email", + "optin_followup_email", + "batch", + "resubscribe_email", + "unsubscribe_confirmation_email", + "resubscribe_confirmation_email", + "single_send_api", + "marketing_single_send_api", + "smtp_token", + "localtime", + "automated_for_ticket", + "automated_for_leadflow", + "automated_for_feedback_ces", + "automated_for_feedback_nps", + "automated_for_feedback_custom", + "membership_registration", + "membership_password_saved", + "membership_password_reset", + "membership_otp_login", + "membership_passwordless_auth", + "membership_email_verification", + "membership_registration_follow_up", + "membership_verification", + "membership_follow_up", + "ticket_closed_kickback_email", + "ticket_opened_kickback_email", + "automated_for_custom_survey", + "discardable_stub", + "normal_blog_post", + "legacy_blog_post", + "imported_blog_post", + "automated_ab_master", + "automated_ab_variant", + "web_interactive", + "portal_content", + "page_instance_layout", + "kb_article_instance_layout", + "kb_listing", + "kb_search_results", + "kb_support_form", + "case_study", + "case_study_listing", + "case_study_instance_layout", + "UNKNOWN", + ] # noqa: E501 + if self.local_vars_configuration.client_side_validation and subcategory not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `subcategory` ({0}), must be one of {1}".format(subcategory, allowed_values)) # noqa: E501 + + self._subcategory = subcategory + + @property + def send_on_publish(self): + """Gets the send_on_publish of this EmailUpdateRequest. # noqa: E501 + + Determines whether the email will be sent immediately on publish. # noqa: E501 + + :return: The send_on_publish of this EmailUpdateRequest. # noqa: E501 + :rtype: bool + """ + return self._send_on_publish + + @send_on_publish.setter + def send_on_publish(self, send_on_publish): + """Sets the send_on_publish of this EmailUpdateRequest. + + Determines whether the email will be sent immediately on publish. # noqa: E501 + + :param send_on_publish: The send_on_publish of this EmailUpdateRequest. # noqa: E501 + :type send_on_publish: bool + """ + + self._send_on_publish = send_on_publish + + 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, EmailUpdateRequest): + 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, EmailUpdateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/error.py b/hubspot/marketing/emails/models/error.py new file mode 100644 index 00000000..34dda8d1 --- /dev/null +++ b/hubspot/marketing/emails/models/error.py @@ -0,0 +1,282 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.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/marketing/emails/models/error_detail.py b/hubspot/marketing/emails/models/error_detail.py new file mode 100644 index 00000000..4536339e --- /dev/null +++ b/hubspot/marketing/emails/models/error_detail.py @@ -0,0 +1,228 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.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/marketing/emails/models/forward_paging.py b/hubspot/marketing/emails/models/forward_paging.py new file mode 100644 index 00000000..9415ee67 --- /dev/null +++ b/hubspot/marketing/emails/models/forward_paging.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.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/marketing/emails/models/interval.py b/hubspot/marketing/emails/models/interval.py new file mode 100644 index 00000000..aa604275 --- /dev/null +++ b/hubspot/marketing/emails/models/interval.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class Interval(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 = {"start": "datetime", "end": "datetime"} + + attribute_map = {"start": "start", "end": "end"} + + def __init__(self, start=None, end=None, local_vars_configuration=None): # noqa: E501 + """Interval - 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._start = None + self._end = None + self.discriminator = None + + self.start = start + self.end = end + + @property + def start(self): + """Gets the start of this Interval. # noqa: E501 + + + :return: The start of this Interval. # noqa: E501 + :rtype: datetime + """ + return self._start + + @start.setter + def start(self, start): + """Sets the start of this Interval. + + + :param start: The start of this Interval. # noqa: E501 + :type start: datetime + """ + if self.local_vars_configuration.client_side_validation and start is None: # noqa: E501 + raise ValueError("Invalid value for `start`, must not be `None`") # noqa: E501 + + self._start = start + + @property + def end(self): + """Gets the end of this Interval. # noqa: E501 + + + :return: The end of this Interval. # noqa: E501 + :rtype: datetime + """ + return self._end + + @end.setter + def end(self, end): + """Sets the end of this Interval. + + + :param end: The end of this Interval. # noqa: E501 + :type end: datetime + """ + if self.local_vars_configuration.client_side_validation and end is None: # noqa: E501 + raise ValueError("Invalid value for `end`, must not be `None`") # noqa: E501 + + self._end = end + + 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, Interval): + 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, Interval): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/next_page.py b/hubspot/marketing/emails/models/next_page.py new file mode 100644 index 00000000..4c14aeeb --- /dev/null +++ b/hubspot/marketing/emails/models/next_page.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.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 + + The link to the next page. # 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. + + The link to the next page. # noqa: E501 + + :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 + + The cursor token value to get the next set of results. Use this value as query parameter (&after=...) to obtain the next page. # 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. + + The cursor token value to get the next set of results. Use this value as query parameter (&after=...) to obtain the next page. # noqa: E501 + + :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/marketing/emails/models/paging.py b/hubspot/marketing/emails/models/paging.py new file mode 100644 index 00000000..1095e160 --- /dev/null +++ b/hubspot/marketing/emails/models/paging.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.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 + + 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 + """ + if self.local_vars_configuration.client_side_validation and next is None: # noqa: E501 + raise ValueError("Invalid value for `next`, must not be `None`") # noqa: E501 + + 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/marketing/emails/models/previous_page.py b/hubspot/marketing/emails/models/previous_page.py new file mode 100644 index 00000000..3d61a09d --- /dev/null +++ b/hubspot/marketing/emails/models/previous_page.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.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 + + The cursor token value to get the previous set of results. Use this value as query parameter (&before=...) to obtain the previous page. # 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. + + The cursor token value to get the previous set of results. Use this value as query parameter (&before=...) to obtain the previous page. # noqa: E501 + + :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 + + The link to the previous page. # 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. + + The link to the previous page. # noqa: E501 + + :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/marketing/emails/models/public_button_style_settings.py b/hubspot/marketing/emails/models/public_button_style_settings.py new file mode 100644 index 00000000..e9edec81 --- /dev/null +++ b/hubspot/marketing/emails/models/public_button_style_settings.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class PublicButtonStyleSettings(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 = {"background_color": "object", "font_style": "PublicFontStyle", "corner_radius": "int"} + + attribute_map = {"background_color": "backgroundColor", "font_style": "fontStyle", "corner_radius": "cornerRadius"} + + def __init__(self, background_color=None, font_style=None, corner_radius=None, local_vars_configuration=None): # noqa: E501 + """PublicButtonStyleSettings - 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._background_color = None + self._font_style = None + self._corner_radius = None + self.discriminator = None + + if background_color is not None: + self.background_color = background_color + if font_style is not None: + self.font_style = font_style + if corner_radius is not None: + self.corner_radius = corner_radius + + @property + def background_color(self): + """Gets the background_color of this PublicButtonStyleSettings. # noqa: E501 + + + :return: The background_color of this PublicButtonStyleSettings. # noqa: E501 + :rtype: object + """ + return self._background_color + + @background_color.setter + def background_color(self, background_color): + """Sets the background_color of this PublicButtonStyleSettings. + + + :param background_color: The background_color of this PublicButtonStyleSettings. # noqa: E501 + :type background_color: object + """ + + self._background_color = background_color + + @property + def font_style(self): + """Gets the font_style of this PublicButtonStyleSettings. # noqa: E501 + + + :return: The font_style of this PublicButtonStyleSettings. # noqa: E501 + :rtype: PublicFontStyle + """ + return self._font_style + + @font_style.setter + def font_style(self, font_style): + """Sets the font_style of this PublicButtonStyleSettings. + + + :param font_style: The font_style of this PublicButtonStyleSettings. # noqa: E501 + :type font_style: PublicFontStyle + """ + + self._font_style = font_style + + @property + def corner_radius(self): + """Gets the corner_radius of this PublicButtonStyleSettings. # noqa: E501 + + + :return: The corner_radius of this PublicButtonStyleSettings. # noqa: E501 + :rtype: int + """ + return self._corner_radius + + @corner_radius.setter + def corner_radius(self, corner_radius): + """Sets the corner_radius of this PublicButtonStyleSettings. + + + :param corner_radius: The corner_radius of this PublicButtonStyleSettings. # noqa: E501 + :type corner_radius: int + """ + + self._corner_radius = corner_radius + + 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, PublicButtonStyleSettings): + 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, PublicButtonStyleSettings): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/public_divider_style_settings.py b/hubspot/marketing/emails/models/public_divider_style_settings.py new file mode 100644 index 00000000..2ec9573d --- /dev/null +++ b/hubspot/marketing/emails/models/public_divider_style_settings.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class PublicDividerStyleSettings(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 = {"color": "object", "line_type": "str", "height": "int"} + + attribute_map = {"color": "color", "line_type": "lineType", "height": "height"} + + def __init__(self, color=None, line_type=None, height=None, local_vars_configuration=None): # noqa: E501 + """PublicDividerStyleSettings - 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._color = None + self._line_type = None + self._height = None + self.discriminator = None + + if color is not None: + self.color = color + if line_type is not None: + self.line_type = line_type + if height is not None: + self.height = height + + @property + def color(self): + """Gets the color of this PublicDividerStyleSettings. # noqa: E501 + + + :return: The color of this PublicDividerStyleSettings. # noqa: E501 + :rtype: object + """ + return self._color + + @color.setter + def color(self, color): + """Sets the color of this PublicDividerStyleSettings. + + + :param color: The color of this PublicDividerStyleSettings. # noqa: E501 + :type color: object + """ + + self._color = color + + @property + def line_type(self): + """Gets the line_type of this PublicDividerStyleSettings. # noqa: E501 + + + :return: The line_type of this PublicDividerStyleSettings. # noqa: E501 + :rtype: str + """ + return self._line_type + + @line_type.setter + def line_type(self, line_type): + """Sets the line_type of this PublicDividerStyleSettings. + + + :param line_type: The line_type of this PublicDividerStyleSettings. # noqa: E501 + :type line_type: str + """ + + self._line_type = line_type + + @property + def height(self): + """Gets the height of this PublicDividerStyleSettings. # noqa: E501 + + + :return: The height of this PublicDividerStyleSettings. # noqa: E501 + :rtype: int + """ + return self._height + + @height.setter + def height(self, height): + """Sets the height of this PublicDividerStyleSettings. + + + :param height: The height of this PublicDividerStyleSettings. # noqa: E501 + :type height: int + """ + + self._height = height + + 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, PublicDividerStyleSettings): + 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, PublicDividerStyleSettings): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/public_email.py b/hubspot/marketing/emails/models/public_email.py new file mode 100644 index 00000000..b47c50c2 --- /dev/null +++ b/hubspot/marketing/emails/models/public_email.py @@ -0,0 +1,1956 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class PublicEmail(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 = { + "feedback_survey_id": "str", + "subject": "str", + "publish_date": "datetime", + "is_transactional": "bool", + "language": "str", + "type": "str", + "content": "PublicEmailContent", + "business_unit_id": "str", + "webversion": "PublicWebversionDetails", + "workflow_names": "list[str]", + "archived": "bool", + "created_at": "datetime", + "stats": "EmailStatisticsData", + "jitter_send_time": "bool", + "_from": "PublicEmailFromDetails", + "id": "str", + "state": "str", + "created_by_id": "str", + "updated_at": "datetime", + "rss_data": "PublicRssEmailDetails", + "published_at": "datetime", + "published_by_id": "str", + "is_published": "bool", + "testing": "PublicEmailTestingDetails", + "updated_by_id": "str", + "folder_id": "int", + "subscription_details": "PublicEmailSubscriptionDetails", + "deleted_at": "datetime", + "name": "str", + "active_domain": "str", + "campaign": "str", + "to": "PublicEmailToDetails", + "subcategory": "str", + "campaign_name": "str", + "send_on_publish": "bool", + } + + attribute_map = { + "feedback_survey_id": "feedbackSurveyId", + "subject": "subject", + "publish_date": "publishDate", + "is_transactional": "isTransactional", + "language": "language", + "type": "type", + "content": "content", + "business_unit_id": "businessUnitId", + "webversion": "webversion", + "workflow_names": "workflowNames", + "archived": "archived", + "created_at": "createdAt", + "stats": "stats", + "jitter_send_time": "jitterSendTime", + "_from": "from", + "id": "id", + "state": "state", + "created_by_id": "createdById", + "updated_at": "updatedAt", + "rss_data": "rssData", + "published_at": "publishedAt", + "published_by_id": "publishedById", + "is_published": "isPublished", + "testing": "testing", + "updated_by_id": "updatedById", + "folder_id": "folderId", + "subscription_details": "subscriptionDetails", + "deleted_at": "deletedAt", + "name": "name", + "active_domain": "activeDomain", + "campaign": "campaign", + "to": "to", + "subcategory": "subcategory", + "campaign_name": "campaignName", + "send_on_publish": "sendOnPublish", + } + + def __init__( + self, + feedback_survey_id=None, + subject=None, + publish_date=None, + is_transactional=None, + language=None, + type=None, + content=None, + business_unit_id=None, + webversion=None, + workflow_names=None, + archived=None, + created_at=None, + stats=None, + jitter_send_time=None, + _from=None, + id=None, + state=None, + created_by_id=None, + updated_at=None, + rss_data=None, + published_at=None, + published_by_id=None, + is_published=None, + testing=None, + updated_by_id=None, + folder_id=None, + subscription_details=None, + deleted_at=None, + name=None, + active_domain=None, + campaign=None, + to=None, + subcategory=None, + campaign_name=None, + send_on_publish=None, + local_vars_configuration=None, + ): # noqa: E501 + """PublicEmail - 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._feedback_survey_id = None + self._subject = None + self._publish_date = None + self._is_transactional = None + self._language = None + self._type = None + self._content = None + self._business_unit_id = None + self._webversion = None + self._workflow_names = None + self._archived = None + self._created_at = None + self._stats = None + self._jitter_send_time = None + self.__from = None + self._id = None + self._state = None + self._created_by_id = None + self._updated_at = None + self._rss_data = None + self._published_at = None + self._published_by_id = None + self._is_published = None + self._testing = None + self._updated_by_id = None + self._folder_id = None + self._subscription_details = None + self._deleted_at = None + self._name = None + self._active_domain = None + self._campaign = None + self._to = None + self._subcategory = None + self._campaign_name = None + self._send_on_publish = None + self.discriminator = None + + if feedback_survey_id is not None: + self.feedback_survey_id = feedback_survey_id + self.subject = subject + if publish_date is not None: + self.publish_date = publish_date + if is_transactional is not None: + self.is_transactional = is_transactional + if language is not None: + self.language = language + if type is not None: + self.type = type + self.content = content + if business_unit_id is not None: + self.business_unit_id = business_unit_id + if webversion is not None: + self.webversion = webversion + if workflow_names is not None: + self.workflow_names = workflow_names + if archived is not None: + self.archived = archived + if created_at is not None: + self.created_at = created_at + if stats is not None: + self.stats = stats + if jitter_send_time is not None: + self.jitter_send_time = jitter_send_time + self._from = _from + self.id = id + self.state = state + if created_by_id is not None: + self.created_by_id = created_by_id + if updated_at is not None: + self.updated_at = updated_at + if rss_data is not None: + self.rss_data = rss_data + if published_at is not None: + self.published_at = published_at + if published_by_id is not None: + self.published_by_id = published_by_id + if is_published is not None: + self.is_published = is_published + if testing is not None: + self.testing = testing + if updated_by_id is not None: + self.updated_by_id = updated_by_id + if folder_id is not None: + self.folder_id = folder_id + if subscription_details is not None: + self.subscription_details = subscription_details + if deleted_at is not None: + self.deleted_at = deleted_at + self.name = name + if active_domain is not None: + self.active_domain = active_domain + if campaign is not None: + self.campaign = campaign + self.to = to + self.subcategory = subcategory + if campaign_name is not None: + self.campaign_name = campaign_name + self.send_on_publish = send_on_publish + + @property + def feedback_survey_id(self): + """Gets the feedback_survey_id of this PublicEmail. # noqa: E501 + + The ID of the feedback survey linked to the email. # noqa: E501 + + :return: The feedback_survey_id of this PublicEmail. # noqa: E501 + :rtype: str + """ + return self._feedback_survey_id + + @feedback_survey_id.setter + def feedback_survey_id(self, feedback_survey_id): + """Sets the feedback_survey_id of this PublicEmail. + + The ID of the feedback survey linked to the email. # noqa: E501 + + :param feedback_survey_id: The feedback_survey_id of this PublicEmail. # noqa: E501 + :type feedback_survey_id: str + """ + + self._feedback_survey_id = feedback_survey_id + + @property + def subject(self): + """Gets the subject of this PublicEmail. # noqa: E501 + + The subject of the email. # noqa: E501 + + :return: The subject of this PublicEmail. # noqa: E501 + :rtype: str + """ + return self._subject + + @subject.setter + def subject(self, subject): + """Sets the subject of this PublicEmail. + + The subject of the email. # noqa: E501 + + :param subject: The subject of this PublicEmail. # noqa: E501 + :type subject: str + """ + if self.local_vars_configuration.client_side_validation and subject is None: # noqa: E501 + raise ValueError("Invalid value for `subject`, must not be `None`") # noqa: E501 + + self._subject = subject + + @property + def publish_date(self): + """Gets the publish_date of this PublicEmail. # noqa: E501 + + The date and time the email is scheduled for, in ISO8601 representation. This is only used in local time or scheduled emails. # noqa: E501 + + :return: The publish_date of this PublicEmail. # noqa: E501 + :rtype: datetime + """ + return self._publish_date + + @publish_date.setter + def publish_date(self, publish_date): + """Sets the publish_date of this PublicEmail. + + The date and time the email is scheduled for, in ISO8601 representation. This is only used in local time or scheduled emails. # noqa: E501 + + :param publish_date: The publish_date of this PublicEmail. # noqa: E501 + :type publish_date: datetime + """ + + self._publish_date = publish_date + + @property + def is_transactional(self): + """Gets the is_transactional of this PublicEmail. # noqa: E501 + + Returns whether the email is a transactional email or not. This is read only. # noqa: E501 + + :return: The is_transactional of this PublicEmail. # noqa: E501 + :rtype: bool + """ + return self._is_transactional + + @is_transactional.setter + def is_transactional(self, is_transactional): + """Sets the is_transactional of this PublicEmail. + + Returns whether the email is a transactional email or not. This is read only. # noqa: E501 + + :param is_transactional: The is_transactional of this PublicEmail. # noqa: E501 + :type is_transactional: bool + """ + + self._is_transactional = is_transactional + + @property + def language(self): + """Gets the language of this PublicEmail. # noqa: E501 + + + :return: The language of this PublicEmail. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this PublicEmail. + + + :param language: The language of this PublicEmail. # noqa: E501 + :type language: str + """ + allowed_values = [ + "af", + "af-na", + "af-za", + "agq", + "agq-cm", + "ak", + "ak-gh", + "am", + "am-et", + "ann", + "ann-ng", + "ar", + "ar-001", + "ar-ae", + "ar-bh", + "ar-dj", + "ar-dz", + "ar-eg", + "ar-eh", + "ar-er", + "ar-il", + "ar-iq", + "ar-jo", + "ar-km", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-mr", + "ar-om", + "ar-ps", + "ar-qa", + "ar-sa", + "ar-sd", + "ar-so", + "ar-ss", + "ar-sy", + "ar-td", + "ar-tn", + "ar-ye", + "as", + "asa", + "asa-tz", + "ast", + "ast-es", + "as-in", + "az", + "az-az", + "bas", + "bas-cm", + "be", + "bem", + "bem-zm", + "bez", + "bez-tz", + "be-by", + "bg", + "bgc", + "bgc-in", + "bg-bg", + "bho", + "bho-in", + "bm", + "bm-ml", + "bn", + "bn-bd", + "bn-in", + "bo", + "bo-cn", + "bo-in", + "br", + "brx", + "brx-in", + "br-fr", + "bs", + "bs-ba", + "ca", + "ca-ad", + "ca-es", + "ca-fr", + "ca-it", + "ccp", + "ccp-bd", + "ccp-in", + "ce", + "ceb", + "ceb-ph", + "ce-ru", + "cgg", + "cgg-ug", + "chr", + "chr-us", + "ckb", + "ckb-iq", + "ckb-ir", + "cs", + "cs-cz", + "cu", + "cu-ru", + "cv", + "cv-ru", + "cy", + "cy-gb", + "da", + "dav", + "dav-ke", + "da-dk", + "da-gl", + "de", + "de-at", + "de-be", + "de-ch", + "de-de", + "de-gr", + "de-it", + "de-li", + "de-lu", + "dje", + "dje-ne", + "doi", + "doi-in", + "dsb", + "dsb-de", + "dua", + "dua-cm", + "dyo", + "dyo-sn", + "dz", + "dz-bt", + "ebu", + "ebu-ke", + "ee", + "ee-gh", + "ee-tg", + "el", + "el-cy", + "el-gr", + "en", + "en-001", + "en-150", + "en-ae", + "en-ag", + "en-ai", + "en-as", + "en-at", + "en-au", + "en-bb", + "en-be", + "en-bi", + "en-bm", + "en-bs", + "en-bw", + "en-bz", + "en-ca", + "en-cc", + "en-ch", + "en-ck", + "en-cm", + "en-cn", + "en-cx", + "en-cy", + "en-de", + "en-dg", + "en-dk", + "en-dm", + "en-ee", + "en-er", + "en-fi", + "en-fj", + "en-fk", + "en-fm", + "en-fr", + "en-gb", + "en-gd", + "en-gg", + "en-gh", + "en-gi", + "en-gm", + "en-gu", + "en-gy", + "en-hk", + "en-ie", + "en-il", + "en-im", + "en-in", + "en-io", + "en-je", + "en-jm", + "en-ke", + "en-ki", + "en-kn", + "en-ky", + "en-lc", + "en-lr", + "en-ls", + "en-lu", + "en-mg", + "en-mh", + "en-mo", + "en-mp", + "en-ms", + "en-mt", + "en-mu", + "en-mv", + "en-mw", + "en-mx", + "en-my", + "en-na", + "en-nf", + "en-ng", + "en-nl", + "en-nr", + "en-nu", + "en-nz", + "en-pg", + "en-ph", + "en-pk", + "en-pn", + "en-pr", + "en-pw", + "en-rw", + "en-sb", + "en-sc", + "en-sd", + "en-se", + "en-sg", + "en-sh", + "en-si", + "en-sl", + "en-ss", + "en-sx", + "en-sz", + "en-tc", + "en-tk", + "en-to", + "en-tt", + "en-tv", + "en-tz", + "en-ug", + "en-um", + "en-us", + "en-vc", + "en-vg", + "en-vi", + "en-vu", + "en-ws", + "en-za", + "en-zm", + "en-zw", + "eo", + "eo-001", + "es", + "es-419", + "es-ar", + "es-bo", + "es-br", + "es-bz", + "es-cl", + "es-co", + "es-cr", + "es-cu", + "es-do", + "es-ea", + "es-ec", + "es-es", + "es-gq", + "es-gt", + "es-hn", + "es-ic", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-ph", + "es-pr", + "es-py", + "es-sv", + "es-us", + "es-uy", + "es-ve", + "et", + "et-ee", + "eu", + "eu-es", + "ewo", + "ewo-cm", + "fa", + "fa-af", + "fa-ir", + "ff", + "ff-bf", + "ff-cm", + "ff-gh", + "ff-gm", + "ff-gn", + "ff-gw", + "ff-lr", + "ff-mr", + "ff-ne", + "ff-ng", + "ff-sl", + "ff-sn", + "fi", + "fil", + "fil-ph", + "fi-fi", + "fo", + "fo-dk", + "fo-fo", + "fr", + "frr", + "frr-de", + "fr-be", + "fr-bf", + "fr-bi", + "fr-bj", + "fr-bl", + "fr-ca", + "fr-cd", + "fr-cf", + "fr-cg", + "fr-ch", + "fr-ci", + "fr-cm", + "fr-dj", + "fr-dz", + "fr-fr", + "fr-ga", + "fr-gf", + "fr-gn", + "fr-gp", + "fr-gq", + "fr-ht", + "fr-km", + "fr-lu", + "fr-ma", + "fr-mc", + "fr-mf", + "fr-mg", + "fr-ml", + "fr-mq", + "fr-mr", + "fr-mu", + "fr-nc", + "fr-ne", + "fr-pf", + "fr-pm", + "fr-re", + "fr-rw", + "fr-sc", + "fr-sn", + "fr-sy", + "fr-td", + "fr-tg", + "fr-tn", + "fr-vu", + "fr-wf", + "fr-yt", + "fur", + "fur-it", + "fy", + "fy-nl", + "ga", + "ga-gb", + "ga-ie", + "gd", + "gd-gb", + "gl", + "gl-es", + "gsw", + "gsw-ch", + "gsw-fr", + "gsw-li", + "gu", + "guz", + "guz-ke", + "gu-in", + "gv", + "gv-im", + "ha", + "haw", + "haw-us", + "ha-gh", + "ha-ne", + "ha-ng", + "he", + "hi", + "hi-in", + "hr", + "hr-ba", + "hr-hr", + "hsb", + "hsb-de", + "hu", + "hu-hu", + "hy", + "hy-am", + "ia", + "ia-001", + "id", + "ig", + "ig-ng", + "ii", + "ii-cn", + "id-id", + "is", + "is-is", + "it", + "it-ch", + "it-it", + "it-sm", + "it-va", + "he-il", + "ja", + "ja-jp", + "jgo", + "jgo-cm", + "yi", + "yi-001", + "jmc", + "jmc-tz", + "jv", + "jv-id", + "ka", + "kab", + "kab-dz", + "kam", + "kam-ke", + "ka-ge", + "kde", + "kde-tz", + "kea", + "kea-cv", + "kgp", + "kgp-br", + "khq", + "khq-ml", + "ki", + "ki-ke", + "kk", + "kkj", + "kkj-cm", + "kk-kz", + "kl", + "kln", + "kln-ke", + "kl-gl", + "km", + "km-kh", + "kn", + "kn-in", + "ko", + "kok", + "kok-in", + "ko-kp", + "ko-kr", + "ks", + "ksb", + "ksb-tz", + "ksf", + "ksf-cm", + "ksh", + "ksh-de", + "ks-in", + "ku", + "ku-tr", + "kw", + "kw-gb", + "ky", + "ky-kg", + "lag", + "lag-tz", + "lb", + "lb-lu", + "lg", + "lg-ug", + "lkt", + "lkt-us", + "ln", + "ln-ao", + "ln-cd", + "ln-cf", + "ln-cg", + "lo", + "lo-la", + "lrc", + "lrc-iq", + "lrc-ir", + "lt", + "lt-lt", + "lu", + "luo", + "luo-ke", + "luy", + "luy-ke", + "lu-cd", + "lv", + "lv-lv", + "mai", + "mai-in", + "mas", + "mas-ke", + "mas-tz", + "mdf", + "mdf-ru", + "mer", + "mer-ke", + "mfe", + "mfe-mu", + "mg", + "mgh", + "mgh-mz", + "mgo", + "mgo-cm", + "mg-mg", + "mi", + "mi-nz", + "mk", + "mk-mk", + "ml", + "ml-in", + "mn", + "mni", + "mni-in", + "mn-mn", + "mr", + "mr-in", + "ms", + "ms-bn", + "ms-id", + "ms-my", + "ms-sg", + "mt", + "mt-mt", + "mua", + "mua-cm", + "my", + "my-mm", + "mzn", + "mzn-ir", + "naq", + "naq-na", + "nb", + "nb-no", + "nb-sj", + "nd", + "nds", + "nds-de", + "nds-nl", + "nd-zw", + "ne", + "ne-in", + "ne-np", + "nl", + "nl-aw", + "nl-be", + "nl-bq", + "nl-ch", + "nl-cw", + "nl-lu", + "nl-nl", + "nl-sr", + "nl-sx", + "nmg", + "nmg-cm", + "nn", + "nnh", + "nnh-cm", + "nn-no", + "no", + "no-no", + "nus", + "nus-ss", + "nyn", + "nyn-ug", + "oc", + "oc-es", + "oc-fr", + "om", + "om-et", + "om-ke", + "or", + "or-in", + "os", + "os-ge", + "os-ru", + "pa", + "pa-in", + "pa-pk", + "pcm", + "pcm-ng", + "pis", + "pis-sb", + "pl", + "pl-pl", + "prg", + "prg-001", + "ps", + "ps-af", + "ps-pk", + "pt", + "pt-ao", + "pt-br", + "pt-ch", + "pt-cv", + "pt-gq", + "pt-gw", + "pt-lu", + "pt-mo", + "pt-mz", + "pt-pt", + "pt-st", + "pt-tl", + "qu", + "qu-bo", + "qu-ec", + "qu-pe", + "raj", + "raj-in", + "rm", + "rm-ch", + "rn", + "rn-bi", + "ro", + "rof", + "rof-tz", + "ro-md", + "ro-ro", + "ru", + "ru-by", + "ru-kg", + "ru-kz", + "ru-md", + "ru-ru", + "ru-ua", + "rw", + "rwk", + "rwk-tz", + "rw-rw", + "sa", + "sah", + "sah-ru", + "saq", + "saq-ke", + "sat", + "sat-in", + "sa-in", + "sbp", + "sbp-tz", + "sc", + "sc-it", + "sd", + "sd-in", + "sd-pk", + "se", + "seh", + "seh-mz", + "ses", + "ses-ml", + "se-fi", + "se-no", + "se-se", + "sg", + "sg-cf", + "shi", + "shi-ma", + "si", + "si-lk", + "sk", + "sk-sk", + "sl", + "sl-si", + "smn", + "smn-fi", + "sms", + "sms-fi", + "sn", + "sn-zw", + "so", + "so-dj", + "so-et", + "so-ke", + "so-so", + "sq", + "sq-al", + "sq-mk", + "sq-xk", + "sr", + "sr-ba", + "sr-cs", + "sr-me", + "sr-rs", + "sr-xk", + "su", + "su-id", + "sv", + "sv-ax", + "sv-fi", + "sv-se", + "sw", + "sw-cd", + "sw-ke", + "sw-tz", + "sw-ug", + "sy", + "ta", + "ta-in", + "ta-lk", + "ta-my", + "ta-sg", + "te", + "teo", + "teo-ke", + "teo-ug", + "te-in", + "tg", + "tg-tj", + "th", + "th-th", + "ti", + "ti-er", + "ti-et", + "tk", + "tk-tm", + "tl", + "to", + "tok", + "tok-001", + "to-to", + "tr", + "tr-cy", + "tr-tr", + "tt", + "tt-ru", + "twq", + "twq-ne", + "tzm", + "tzm-ma", + "ug", + "ug-cn", + "uk", + "uk-ua", + "ur", + "ur-in", + "ur-pk", + "uz", + "uz-af", + "uz-uz", + "vai", + "vai-lr", + "vi", + "vi-vn", + "vo", + "vo-001", + "vun", + "vun-tz", + "wae", + "wae-ch", + "wo", + "wo-sn", + "xh", + "xh-za", + "xog", + "xog-ug", + "yav", + "yav-cm", + "yo", + "yo-bj", + "yo-ng", + "yrl", + "yrl-br", + "yrl-co", + "yrl-ve", + "yue", + "yue-cn", + "yue-hk", + "zgh", + "zgh-ma", + "zh", + "zh-cn", + "zh-hans", + "zh-hant", + "zh-hk", + "zh-mo", + "zh-sg", + "zh-tw", + "zu", + "zu-za", + ] # noqa: E501 + if self.local_vars_configuration.client_side_validation and language not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `language` ({0}), must be one of {1}".format(language, allowed_values)) # noqa: E501 + + self._language = language + + @property + def type(self): + """Gets the type of this PublicEmail. # noqa: E501 + + The email type, this is derived from other properties on the email such as subcategory. # noqa: E501 + + :return: The type of this PublicEmail. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this PublicEmail. + + The email type, this is derived from other properties on the email such as subcategory. # noqa: E501 + + :param type: The type of this PublicEmail. # noqa: E501 + :type type: str + """ + allowed_values = [ + "AB_EMAIL", + "BATCH_EMAIL", + "LOCALTIME_EMAIL", + "AUTOMATED_AB_EMAIL", + "BLOG_EMAIL", + "BLOG_EMAIL_CHILD", + "RSS_EMAIL", + "RSS_EMAIL_CHILD", + "RESUBSCRIBE_EMAIL", + "OPTIN_EMAIL", + "OPTIN_FOLLOWUP_EMAIL", + "AUTOMATED_EMAIL", + "FEEDBACK_CES_EMAIL", + "FEEDBACK_CUSTOM_EMAIL", + "FEEDBACK_CUSTOM_SURVEY_EMAIL", + "FEEDBACK_NPS_EMAIL", + "FOLLOWUP_EMAIL", + "LEADFLOW_EMAIL", + "SINGLE_SEND_API", + "MARKETING_SINGLE_SEND_API", + "SMTP_TOKEN", + "TICKET_EMAIL", + "MEMBERSHIP_REGISTRATION_EMAIL", + "MEMBERSHIP_PASSWORD_SAVED_EMAIL", + "MEMBERSHIP_PASSWORD_RESET_EMAIL", + "MEMBERSHIP_EMAIL_VERIFICATION_EMAIL", + "MEMBERSHIP_PASSWORDLESS_AUTH_EMAIL", + "MEMBERSHIP_REGISTRATION_FOLLOW_UP_EMAIL", + "MEMBERSHIP_OTP_LOGIN_EMAIL", + "MEMBERSHIP_FOLLOW_UP_EMAIL", + "MEMBERSHIP_VERIFICATION_EMAIL", + ] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `type` ({0}), must be one of {1}".format(type, allowed_values)) # noqa: E501 + + self._type = type + + @property + def content(self): + """Gets the content of this PublicEmail. # noqa: E501 + + + :return: The content of this PublicEmail. # noqa: E501 + :rtype: PublicEmailContent + """ + return self._content + + @content.setter + def content(self, content): + """Sets the content of this PublicEmail. + + + :param content: The content of this PublicEmail. # noqa: E501 + :type content: PublicEmailContent + """ + if self.local_vars_configuration.client_side_validation and content is None: # noqa: E501 + raise ValueError("Invalid value for `content`, must not be `None`") # noqa: E501 + + self._content = content + + @property + def business_unit_id(self): + """Gets the business_unit_id of this PublicEmail. # noqa: E501 + + + :return: The business_unit_id of this PublicEmail. # noqa: E501 + :rtype: str + """ + return self._business_unit_id + + @business_unit_id.setter + def business_unit_id(self, business_unit_id): + """Sets the business_unit_id of this PublicEmail. + + + :param business_unit_id: The business_unit_id of this PublicEmail. # noqa: E501 + :type business_unit_id: str + """ + + self._business_unit_id = business_unit_id + + @property + def webversion(self): + """Gets the webversion of this PublicEmail. # noqa: E501 + + + :return: The webversion of this PublicEmail. # noqa: E501 + :rtype: PublicWebversionDetails + """ + return self._webversion + + @webversion.setter + def webversion(self, webversion): + """Sets the webversion of this PublicEmail. + + + :param webversion: The webversion of this PublicEmail. # noqa: E501 + :type webversion: PublicWebversionDetails + """ + + self._webversion = webversion + + @property + def workflow_names(self): + """Gets the workflow_names of this PublicEmail. # noqa: E501 + + + :return: The workflow_names of this PublicEmail. # noqa: E501 + :rtype: list[str] + """ + return self._workflow_names + + @workflow_names.setter + def workflow_names(self, workflow_names): + """Sets the workflow_names of this PublicEmail. + + + :param workflow_names: The workflow_names of this PublicEmail. # noqa: E501 + :type workflow_names: list[str] + """ + + self._workflow_names = workflow_names + + @property + def archived(self): + """Gets the archived of this PublicEmail. # noqa: E501 + + Determines if the email is archived or not. # noqa: E501 + + :return: The archived of this PublicEmail. # noqa: E501 + :rtype: bool + """ + return self._archived + + @archived.setter + def archived(self, archived): + """Sets the archived of this PublicEmail. + + Determines if the email is archived or not. # noqa: E501 + + :param archived: The archived of this PublicEmail. # noqa: E501 + :type archived: bool + """ + + self._archived = archived + + @property + def created_at(self): + """Gets the created_at of this PublicEmail. # noqa: E501 + + The date and time of the email's creation, in ISO8601 representation. # noqa: E501 + + :return: The created_at of this PublicEmail. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this PublicEmail. + + The date and time of the email's creation, in ISO8601 representation. # noqa: E501 + + :param created_at: The created_at of this PublicEmail. # noqa: E501 + :type created_at: datetime + """ + + self._created_at = created_at + + @property + def stats(self): + """Gets the stats of this PublicEmail. # noqa: E501 + + + :return: The stats of this PublicEmail. # noqa: E501 + :rtype: EmailStatisticsData + """ + return self._stats + + @stats.setter + def stats(self, stats): + """Sets the stats of this PublicEmail. + + + :param stats: The stats of this PublicEmail. # noqa: E501 + :type stats: EmailStatisticsData + """ + + self._stats = stats + + @property + def jitter_send_time(self): + """Gets the jitter_send_time of this PublicEmail. # noqa: E501 + + + :return: The jitter_send_time of this PublicEmail. # noqa: E501 + :rtype: bool + """ + return self._jitter_send_time + + @jitter_send_time.setter + def jitter_send_time(self, jitter_send_time): + """Sets the jitter_send_time of this PublicEmail. + + + :param jitter_send_time: The jitter_send_time of this PublicEmail. # noqa: E501 + :type jitter_send_time: bool + """ + + self._jitter_send_time = jitter_send_time + + @property + def _from(self): + """Gets the _from of this PublicEmail. # noqa: E501 + + + :return: The _from of this PublicEmail. # noqa: E501 + :rtype: PublicEmailFromDetails + """ + return self.__from + + @_from.setter + def _from(self, _from): + """Sets the _from of this PublicEmail. + + + :param _from: The _from of this PublicEmail. # noqa: E501 + :type _from: PublicEmailFromDetails + """ + if self.local_vars_configuration.client_side_validation and _from is None: # noqa: E501 + raise ValueError("Invalid value for `_from`, must not be `None`") # noqa: E501 + + self.__from = _from + + @property + def id(self): + """Gets the id of this PublicEmail. # noqa: E501 + + The email ID. # noqa: E501 + + :return: The id of this PublicEmail. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this PublicEmail. + + The email ID. # noqa: E501 + + :param id: The id of this PublicEmail. # 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 state(self): + """Gets the state of this PublicEmail. # noqa: E501 + + The email state. # noqa: E501 + + :return: The state of this PublicEmail. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this PublicEmail. + + The email state. # noqa: E501 + + :param state: The state of this PublicEmail. # noqa: E501 + :type state: str + """ + if self.local_vars_configuration.client_side_validation and state is None: # noqa: E501 + raise ValueError("Invalid value for `state`, must not be `None`") # noqa: E501 + allowed_values = [ + "AUTOMATED", + "AUTOMATED_DRAFT", + "AUTOMATED_SENDING", + "AUTOMATED_FOR_FORM", + "AUTOMATED_FOR_FORM_BUFFER", + "AUTOMATED_FOR_FORM_DRAFT", + "AUTOMATED_FOR_FORM_LEGACY", + "BLOG_EMAIL_DRAFT", + "BLOG_EMAIL_PUBLISHED", + "DRAFT", + "DRAFT_AB", + "DRAFT_AB_VARIANT", + "ERROR", + "LOSER_AB_VARIANT", + "PAGE_STUB", + "PRE_PROCESSING", + "PROCESSING", + "PUBLISHED", + "PUBLISHED_AB", + "PUBLISHED_AB_VARIANT", + "PUBLISHED_OR_SCHEDULED", + "RSS_TO_EMAIL_DRAFT", + "RSS_TO_EMAIL_PUBLISHED", + "SCHEDULED", + "SCHEDULED_AB", + "SCHEDULED_OR_PUBLISHED", + "AUTOMATED_AB", + "AUTOMATED_AB_VARIANT", + "AUTOMATED_DRAFT_AB", + "AUTOMATED_DRAFT_ABVARIANT", + "AUTOMATED_LOSER_ABVARIANT", + ] # noqa: E501 + if self.local_vars_configuration.client_side_validation and state not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `state` ({0}), must be one of {1}".format(state, allowed_values)) # noqa: E501 + + self._state = state + + @property + def created_by_id(self): + """Gets the created_by_id of this PublicEmail. # noqa: E501 + + The id of the user who created the email. # noqa: E501 + + :return: The created_by_id of this PublicEmail. # noqa: E501 + :rtype: str + """ + return self._created_by_id + + @created_by_id.setter + def created_by_id(self, created_by_id): + """Sets the created_by_id of this PublicEmail. + + The id of the user who created the email. # noqa: E501 + + :param created_by_id: The created_by_id of this PublicEmail. # noqa: E501 + :type created_by_id: str + """ + + self._created_by_id = created_by_id + + @property + def updated_at(self): + """Gets the updated_at of this PublicEmail. # noqa: E501 + + The date and time of the last update to the email, in ISO8601 representation. # noqa: E501 + + :return: The updated_at of this PublicEmail. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this PublicEmail. + + The date and time of the last update to the email, in ISO8601 representation. # noqa: E501 + + :param updated_at: The updated_at of this PublicEmail. # noqa: E501 + :type updated_at: datetime + """ + + self._updated_at = updated_at + + @property + def rss_data(self): + """Gets the rss_data of this PublicEmail. # noqa: E501 + + + :return: The rss_data of this PublicEmail. # noqa: E501 + :rtype: PublicRssEmailDetails + """ + return self._rss_data + + @rss_data.setter + def rss_data(self, rss_data): + """Sets the rss_data of this PublicEmail. + + + :param rss_data: The rss_data of this PublicEmail. # noqa: E501 + :type rss_data: PublicRssEmailDetails + """ + + self._rss_data = rss_data + + @property + def published_at(self): + """Gets the published_at of this PublicEmail. # noqa: E501 + + The date and time the email was published at, in ISO8601 representation. # noqa: E501 + + :return: The published_at of this PublicEmail. # noqa: E501 + :rtype: datetime + """ + return self._published_at + + @published_at.setter + def published_at(self, published_at): + """Sets the published_at of this PublicEmail. + + The date and time the email was published at, in ISO8601 representation. # noqa: E501 + + :param published_at: The published_at of this PublicEmail. # noqa: E501 + :type published_at: datetime + """ + + self._published_at = published_at + + @property + def published_by_id(self): + """Gets the published_by_id of this PublicEmail. # noqa: E501 + + + :return: The published_by_id of this PublicEmail. # noqa: E501 + :rtype: str + """ + return self._published_by_id + + @published_by_id.setter + def published_by_id(self, published_by_id): + """Sets the published_by_id of this PublicEmail. + + + :param published_by_id: The published_by_id of this PublicEmail. # noqa: E501 + :type published_by_id: str + """ + + self._published_by_id = published_by_id + + @property + def is_published(self): + """Gets the is_published of this PublicEmail. # noqa: E501 + + Returns the published status of the email. This is read only. # noqa: E501 + + :return: The is_published of this PublicEmail. # noqa: E501 + :rtype: bool + """ + return self._is_published + + @is_published.setter + def is_published(self, is_published): + """Sets the is_published of this PublicEmail. + + Returns the published status of the email. This is read only. # noqa: E501 + + :param is_published: The is_published of this PublicEmail. # noqa: E501 + :type is_published: bool + """ + + self._is_published = is_published + + @property + def testing(self): + """Gets the testing of this PublicEmail. # noqa: E501 + + + :return: The testing of this PublicEmail. # noqa: E501 + :rtype: PublicEmailTestingDetails + """ + return self._testing + + @testing.setter + def testing(self, testing): + """Sets the testing of this PublicEmail. + + + :param testing: The testing of this PublicEmail. # noqa: E501 + :type testing: PublicEmailTestingDetails + """ + + self._testing = testing + + @property + def updated_by_id(self): + """Gets the updated_by_id of this PublicEmail. # noqa: E501 + + The id of the user who last updated the email. # noqa: E501 + + :return: The updated_by_id of this PublicEmail. # noqa: E501 + :rtype: str + """ + return self._updated_by_id + + @updated_by_id.setter + def updated_by_id(self, updated_by_id): + """Sets the updated_by_id of this PublicEmail. + + The id of the user who last updated the email. # noqa: E501 + + :param updated_by_id: The updated_by_id of this PublicEmail. # noqa: E501 + :type updated_by_id: str + """ + + self._updated_by_id = updated_by_id + + @property + def folder_id(self): + """Gets the folder_id of this PublicEmail. # noqa: E501 + + + :return: The folder_id of this PublicEmail. # noqa: E501 + :rtype: int + """ + return self._folder_id + + @folder_id.setter + def folder_id(self, folder_id): + """Sets the folder_id of this PublicEmail. + + + :param folder_id: The folder_id of this PublicEmail. # noqa: E501 + :type folder_id: int + """ + + self._folder_id = folder_id + + @property + def subscription_details(self): + """Gets the subscription_details of this PublicEmail. # noqa: E501 + + + :return: The subscription_details of this PublicEmail. # noqa: E501 + :rtype: PublicEmailSubscriptionDetails + """ + return self._subscription_details + + @subscription_details.setter + def subscription_details(self, subscription_details): + """Sets the subscription_details of this PublicEmail. + + + :param subscription_details: The subscription_details of this PublicEmail. # noqa: E501 + :type subscription_details: PublicEmailSubscriptionDetails + """ + + self._subscription_details = subscription_details + + @property + def deleted_at(self): + """Gets the deleted_at of this PublicEmail. # noqa: E501 + + + :return: The deleted_at of this PublicEmail. # noqa: E501 + :rtype: datetime + """ + return self._deleted_at + + @deleted_at.setter + def deleted_at(self, deleted_at): + """Sets the deleted_at of this PublicEmail. + + + :param deleted_at: The deleted_at of this PublicEmail. # noqa: E501 + :type deleted_at: datetime + """ + + self._deleted_at = deleted_at + + @property + def name(self): + """Gets the name of this PublicEmail. # noqa: E501 + + The name of the email, as displayed on the email dashboard. # noqa: E501 + + :return: The name of this PublicEmail. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this PublicEmail. + + The name of the email, as displayed on the email dashboard. # noqa: E501 + + :param name: The name of this PublicEmail. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def active_domain(self): + """Gets the active_domain of this PublicEmail. # noqa: E501 + + The active domain of the email. # noqa: E501 + + :return: The active_domain of this PublicEmail. # noqa: E501 + :rtype: str + """ + return self._active_domain + + @active_domain.setter + def active_domain(self, active_domain): + """Sets the active_domain of this PublicEmail. + + The active domain of the email. # noqa: E501 + + :param active_domain: The active_domain of this PublicEmail. # noqa: E501 + :type active_domain: str + """ + + self._active_domain = active_domain + + @property + def campaign(self): + """Gets the campaign of this PublicEmail. # noqa: E501 + + The campaign id on the email. # noqa: E501 + + :return: The campaign of this PublicEmail. # noqa: E501 + :rtype: str + """ + return self._campaign + + @campaign.setter + def campaign(self, campaign): + """Sets the campaign of this PublicEmail. + + The campaign id on the email. # noqa: E501 + + :param campaign: The campaign of this PublicEmail. # noqa: E501 + :type campaign: str + """ + + self._campaign = campaign + + @property + def to(self): + """Gets the to of this PublicEmail. # noqa: E501 + + + :return: The to of this PublicEmail. # noqa: E501 + :rtype: PublicEmailToDetails + """ + return self._to + + @to.setter + def to(self, to): + """Sets the to of this PublicEmail. + + + :param to: The to of this PublicEmail. # noqa: E501 + :type to: PublicEmailToDetails + """ + 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 + + @property + def subcategory(self): + """Gets the subcategory of this PublicEmail. # noqa: E501 + + The email subcategory. # noqa: E501 + + :return: The subcategory of this PublicEmail. # noqa: E501 + :rtype: str + """ + return self._subcategory + + @subcategory.setter + def subcategory(self, subcategory): + """Sets the subcategory of this PublicEmail. + + The email subcategory. # noqa: E501 + + :param subcategory: The subcategory of this PublicEmail. # noqa: E501 + :type subcategory: str + """ + if self.local_vars_configuration.client_side_validation and subcategory is None: # noqa: E501 + raise ValueError("Invalid value for `subcategory`, must not be `None`") # noqa: E501 + + self._subcategory = subcategory + + @property + def campaign_name(self): + """Gets the campaign_name of this PublicEmail. # noqa: E501 + + + :return: The campaign_name of this PublicEmail. # noqa: E501 + :rtype: str + """ + return self._campaign_name + + @campaign_name.setter + def campaign_name(self, campaign_name): + """Sets the campaign_name of this PublicEmail. + + + :param campaign_name: The campaign_name of this PublicEmail. # noqa: E501 + :type campaign_name: str + """ + + self._campaign_name = campaign_name + + @property + def send_on_publish(self): + """Gets the send_on_publish of this PublicEmail. # noqa: E501 + + Determines whether the email will be sent immediately on publish. # noqa: E501 + + :return: The send_on_publish of this PublicEmail. # noqa: E501 + :rtype: bool + """ + return self._send_on_publish + + @send_on_publish.setter + def send_on_publish(self, send_on_publish): + """Sets the send_on_publish of this PublicEmail. + + Determines whether the email will be sent immediately on publish. # noqa: E501 + + :param send_on_publish: The send_on_publish of this PublicEmail. # noqa: E501 + :type send_on_publish: bool + """ + if self.local_vars_configuration.client_side_validation and send_on_publish is None: # noqa: E501 + raise ValueError("Invalid value for `send_on_publish`, must not be `None`") # noqa: E501 + + self._send_on_publish = send_on_publish + + 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, PublicEmail): + 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, PublicEmail): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/public_email_content.py b/hubspot/marketing/emails/models/public_email_content.py new file mode 100644 index 00000000..a3b1ad04 --- /dev/null +++ b/hubspot/marketing/emails/models/public_email_content.py @@ -0,0 +1,332 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class PublicEmailContent(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 = { + "smart_fields": "dict[str, object]", + "theme_settings_values": "dict[str, object]", + "flex_areas": "dict[str, object]", + "widgets": "dict[str, object]", + "plain_text_version": "str", + "template_path": "str", + "widget_containers": "dict[str, object]", + "style_settings": "PublicEmailStyleSettings", + } + + attribute_map = { + "smart_fields": "smartFields", + "theme_settings_values": "themeSettingsValues", + "flex_areas": "flexAreas", + "widgets": "widgets", + "plain_text_version": "plainTextVersion", + "template_path": "templatePath", + "widget_containers": "widgetContainers", + "style_settings": "styleSettings", + } + + def __init__( + self, + smart_fields=None, + theme_settings_values=None, + flex_areas=None, + widgets=None, + plain_text_version=None, + template_path=None, + widget_containers=None, + style_settings=None, + local_vars_configuration=None, + ): # noqa: E501 + """PublicEmailContent - 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._smart_fields = None + self._theme_settings_values = None + self._flex_areas = None + self._widgets = None + self._plain_text_version = None + self._template_path = None + self._widget_containers = None + self._style_settings = None + self.discriminator = None + + if smart_fields is not None: + self.smart_fields = smart_fields + if theme_settings_values is not None: + self.theme_settings_values = theme_settings_values + if flex_areas is not None: + self.flex_areas = flex_areas + if widgets is not None: + self.widgets = widgets + if plain_text_version is not None: + self.plain_text_version = plain_text_version + if template_path is not None: + self.template_path = template_path + if widget_containers is not None: + self.widget_containers = widget_containers + if style_settings is not None: + self.style_settings = style_settings + + @property + def smart_fields(self): + """Gets the smart_fields of this PublicEmailContent. # noqa: E501 + + # noqa: E501 + + :return: The smart_fields of this PublicEmailContent. # noqa: E501 + :rtype: dict[str, object] + """ + return self._smart_fields + + @smart_fields.setter + def smart_fields(self, smart_fields): + """Sets the smart_fields of this PublicEmailContent. + + # noqa: E501 + + :param smart_fields: The smart_fields of this PublicEmailContent. # noqa: E501 + :type smart_fields: dict[str, object] + """ + + self._smart_fields = smart_fields + + @property + def theme_settings_values(self): + """Gets the theme_settings_values of this PublicEmailContent. # noqa: E501 + + # noqa: E501 + + :return: The theme_settings_values of this PublicEmailContent. # noqa: E501 + :rtype: dict[str, object] + """ + return self._theme_settings_values + + @theme_settings_values.setter + def theme_settings_values(self, theme_settings_values): + """Sets the theme_settings_values of this PublicEmailContent. + + # noqa: E501 + + :param theme_settings_values: The theme_settings_values of this PublicEmailContent. # noqa: E501 + :type theme_settings_values: dict[str, object] + """ + + self._theme_settings_values = theme_settings_values + + @property + def flex_areas(self): + """Gets the flex_areas of this PublicEmailContent. # noqa: E501 + + # noqa: E501 + + :return: The flex_areas of this PublicEmailContent. # noqa: E501 + :rtype: dict[str, object] + """ + return self._flex_areas + + @flex_areas.setter + def flex_areas(self, flex_areas): + """Sets the flex_areas of this PublicEmailContent. + + # noqa: E501 + + :param flex_areas: The flex_areas of this PublicEmailContent. # noqa: E501 + :type flex_areas: dict[str, object] + """ + + self._flex_areas = flex_areas + + @property + def widgets(self): + """Gets the widgets of this PublicEmailContent. # noqa: E501 + + # noqa: E501 + + :return: The widgets of this PublicEmailContent. # noqa: E501 + :rtype: dict[str, object] + """ + return self._widgets + + @widgets.setter + def widgets(self, widgets): + """Sets the widgets of this PublicEmailContent. + + # noqa: E501 + + :param widgets: The widgets of this PublicEmailContent. # noqa: E501 + :type widgets: dict[str, object] + """ + + self._widgets = widgets + + @property + def plain_text_version(self): + """Gets the plain_text_version of this PublicEmailContent. # noqa: E501 + + # noqa: E501 + + :return: The plain_text_version of this PublicEmailContent. # noqa: E501 + :rtype: str + """ + return self._plain_text_version + + @plain_text_version.setter + def plain_text_version(self, plain_text_version): + """Sets the plain_text_version of this PublicEmailContent. + + # noqa: E501 + + :param plain_text_version: The plain_text_version of this PublicEmailContent. # noqa: E501 + :type plain_text_version: str + """ + + self._plain_text_version = plain_text_version + + @property + def template_path(self): + """Gets the template_path of this PublicEmailContent. # noqa: E501 + + # noqa: E501 + + :return: The template_path of this PublicEmailContent. # noqa: E501 + :rtype: str + """ + return self._template_path + + @template_path.setter + def template_path(self, template_path): + """Sets the template_path of this PublicEmailContent. + + # noqa: E501 + + :param template_path: The template_path of this PublicEmailContent. # noqa: E501 + :type template_path: str + """ + + self._template_path = template_path + + @property + def widget_containers(self): + """Gets the widget_containers of this PublicEmailContent. # noqa: E501 + + # noqa: E501 + + :return: The widget_containers of this PublicEmailContent. # noqa: E501 + :rtype: dict[str, object] + """ + return self._widget_containers + + @widget_containers.setter + def widget_containers(self, widget_containers): + """Sets the widget_containers of this PublicEmailContent. + + # noqa: E501 + + :param widget_containers: The widget_containers of this PublicEmailContent. # noqa: E501 + :type widget_containers: dict[str, object] + """ + + self._widget_containers = widget_containers + + @property + def style_settings(self): + """Gets the style_settings of this PublicEmailContent. # noqa: E501 + + + :return: The style_settings of this PublicEmailContent. # noqa: E501 + :rtype: PublicEmailStyleSettings + """ + return self._style_settings + + @style_settings.setter + def style_settings(self, style_settings): + """Sets the style_settings of this PublicEmailContent. + + + :param style_settings: The style_settings of this PublicEmailContent. # noqa: E501 + :type style_settings: PublicEmailStyleSettings + """ + + self._style_settings = style_settings + + 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, PublicEmailContent): + 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, PublicEmailContent): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/public_email_from_details.py b/hubspot/marketing/emails/models/public_email_from_details.py new file mode 100644 index 00000000..1efc2bf2 --- /dev/null +++ b/hubspot/marketing/emails/models/public_email_from_details.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class PublicEmailFromDetails(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 = {"custom_reply_to": "str", "from_name": "str", "reply_to": "str"} + + attribute_map = {"custom_reply_to": "customReplyTo", "from_name": "fromName", "reply_to": "replyTo"} + + def __init__(self, custom_reply_to=None, from_name=None, reply_to=None, local_vars_configuration=None): # noqa: E501 + """PublicEmailFromDetails - 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._custom_reply_to = None + self._from_name = None + self._reply_to = None + self.discriminator = None + + if custom_reply_to is not None: + self.custom_reply_to = custom_reply_to + if from_name is not None: + self.from_name = from_name + if reply_to is not None: + self.reply_to = reply_to + + @property + def custom_reply_to(self): + """Gets the custom_reply_to of this PublicEmailFromDetails. # noqa: E501 + + The reply to recipients will see. # noqa: E501 + + :return: The custom_reply_to of this PublicEmailFromDetails. # noqa: E501 + :rtype: str + """ + return self._custom_reply_to + + @custom_reply_to.setter + def custom_reply_to(self, custom_reply_to): + """Sets the custom_reply_to of this PublicEmailFromDetails. + + The reply to recipients will see. # noqa: E501 + + :param custom_reply_to: The custom_reply_to of this PublicEmailFromDetails. # noqa: E501 + :type custom_reply_to: str + """ + + self._custom_reply_to = custom_reply_to + + @property + def from_name(self): + """Gets the from_name of this PublicEmailFromDetails. # noqa: E501 + + The name recipients will see. # noqa: E501 + + :return: The from_name of this PublicEmailFromDetails. # noqa: E501 + :rtype: str + """ + return self._from_name + + @from_name.setter + def from_name(self, from_name): + """Sets the from_name of this PublicEmailFromDetails. + + The name recipients will see. # noqa: E501 + + :param from_name: The from_name of this PublicEmailFromDetails. # noqa: E501 + :type from_name: str + """ + + self._from_name = from_name + + @property + def reply_to(self): + """Gets the reply_to of this PublicEmailFromDetails. # noqa: E501 + + The from address and reply to email address (if no customReplyTo defined) recipients will see. # noqa: E501 + + :return: The reply_to of this PublicEmailFromDetails. # noqa: E501 + :rtype: str + """ + return self._reply_to + + @reply_to.setter + def reply_to(self, reply_to): + """Sets the reply_to of this PublicEmailFromDetails. + + The from address and reply to email address (if no customReplyTo defined) recipients will see. # noqa: E501 + + :param reply_to: The reply_to of this PublicEmailFromDetails. # noqa: E501 + :type reply_to: str + """ + + self._reply_to = reply_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, PublicEmailFromDetails): + 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, PublicEmailFromDetails): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/public_email_recipients.py b/hubspot/marketing/emails/models/public_email_recipients.py new file mode 100644 index 00000000..6e258365 --- /dev/null +++ b/hubspot/marketing/emails/models/public_email_recipients.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class PublicEmailRecipients(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 = {"include": "list[str]", "exclude": "list[str]"} + + attribute_map = {"include": "include", "exclude": "exclude"} + + def __init__(self, include=None, exclude=None, local_vars_configuration=None): # noqa: E501 + """PublicEmailRecipients - 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._include = None + self._exclude = None + self.discriminator = None + + if include is not None: + self.include = include + if exclude is not None: + self.exclude = exclude + + @property + def include(self): + """Gets the include of this PublicEmailRecipients. # noqa: E501 + + Included IDs. # noqa: E501 + + :return: The include of this PublicEmailRecipients. # noqa: E501 + :rtype: list[str] + """ + return self._include + + @include.setter + def include(self, include): + """Sets the include of this PublicEmailRecipients. + + Included IDs. # noqa: E501 + + :param include: The include of this PublicEmailRecipients. # noqa: E501 + :type include: list[str] + """ + + self._include = include + + @property + def exclude(self): + """Gets the exclude of this PublicEmailRecipients. # noqa: E501 + + Excluded IDs. # noqa: E501 + + :return: The exclude of this PublicEmailRecipients. # noqa: E501 + :rtype: list[str] + """ + return self._exclude + + @exclude.setter + def exclude(self, exclude): + """Sets the exclude of this PublicEmailRecipients. + + Excluded IDs. # noqa: E501 + + :param exclude: The exclude of this PublicEmailRecipients. # noqa: E501 + :type exclude: list[str] + """ + + self._exclude = exclude + + 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, PublicEmailRecipients): + 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, PublicEmailRecipients): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/public_email_style_settings.py b/hubspot/marketing/emails/models/public_email_style_settings.py new file mode 100644 index 00000000..143758b2 --- /dev/null +++ b/hubspot/marketing/emails/models/public_email_style_settings.py @@ -0,0 +1,912 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class PublicEmailStyleSettings(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 = { + "email_body_padding": "str", + "color_picker_favorite5": "str", + "body_color": "str", + "color_picker_favorite6": "str", + "background_image": "str", + "email_body_width": "str", + "secondary_font": "str", + "primary_accent_color": "str", + "color_picker_favorite3": "str", + "primary_font_line_height": "str", + "color_picker_favorite4": "str", + "secondary_font_color": "str", + "color_picker_favorite1": "str", + "color_picker_favorite2": "str", + "body_border_color": "str", + "body_border_width": "int", + "links_font": "PublicFontStyle", + "background_color": "str", + "background_image_type": "str", + "divider_style_settings": "PublicDividerStyleSettings", + "secondary_accent_color": "str", + "secondary_font_line_height": "str", + "primary_font_size": "int", + "secondary_font_size": "int", + "primary_font_color": "str", + "heading_one_font": "PublicFontStyle", + "primary_font": "str", + "heading_two_font": "PublicFontStyle", + "button_style_settings": "PublicButtonStyleSettings", + "body_border_color_choice": "str", + } + + attribute_map = { + "email_body_padding": "emailBodyPadding", + "color_picker_favorite5": "colorPickerFavorite5", + "body_color": "bodyColor", + "color_picker_favorite6": "colorPickerFavorite6", + "background_image": "backgroundImage", + "email_body_width": "emailBodyWidth", + "secondary_font": "secondaryFont", + "primary_accent_color": "primaryAccentColor", + "color_picker_favorite3": "colorPickerFavorite3", + "primary_font_line_height": "primaryFontLineHeight", + "color_picker_favorite4": "colorPickerFavorite4", + "secondary_font_color": "secondaryFontColor", + "color_picker_favorite1": "colorPickerFavorite1", + "color_picker_favorite2": "colorPickerFavorite2", + "body_border_color": "bodyBorderColor", + "body_border_width": "bodyBorderWidth", + "links_font": "linksFont", + "background_color": "backgroundColor", + "background_image_type": "backgroundImageType", + "divider_style_settings": "dividerStyleSettings", + "secondary_accent_color": "secondaryAccentColor", + "secondary_font_line_height": "secondaryFontLineHeight", + "primary_font_size": "primaryFontSize", + "secondary_font_size": "secondaryFontSize", + "primary_font_color": "primaryFontColor", + "heading_one_font": "headingOneFont", + "primary_font": "primaryFont", + "heading_two_font": "headingTwoFont", + "button_style_settings": "buttonStyleSettings", + "body_border_color_choice": "bodyBorderColorChoice", + } + + def __init__( + self, + email_body_padding=None, + color_picker_favorite5=None, + body_color=None, + color_picker_favorite6=None, + background_image=None, + email_body_width=None, + secondary_font=None, + primary_accent_color=None, + color_picker_favorite3=None, + primary_font_line_height=None, + color_picker_favorite4=None, + secondary_font_color=None, + color_picker_favorite1=None, + color_picker_favorite2=None, + body_border_color=None, + body_border_width=None, + links_font=None, + background_color=None, + background_image_type=None, + divider_style_settings=None, + secondary_accent_color=None, + secondary_font_line_height=None, + primary_font_size=None, + secondary_font_size=None, + primary_font_color=None, + heading_one_font=None, + primary_font=None, + heading_two_font=None, + button_style_settings=None, + body_border_color_choice=None, + local_vars_configuration=None, + ): # noqa: E501 + """PublicEmailStyleSettings - 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._email_body_padding = None + self._color_picker_favorite5 = None + self._body_color = None + self._color_picker_favorite6 = None + self._background_image = None + self._email_body_width = None + self._secondary_font = None + self._primary_accent_color = None + self._color_picker_favorite3 = None + self._primary_font_line_height = None + self._color_picker_favorite4 = None + self._secondary_font_color = None + self._color_picker_favorite1 = None + self._color_picker_favorite2 = None + self._body_border_color = None + self._body_border_width = None + self._links_font = None + self._background_color = None + self._background_image_type = None + self._divider_style_settings = None + self._secondary_accent_color = None + self._secondary_font_line_height = None + self._primary_font_size = None + self._secondary_font_size = None + self._primary_font_color = None + self._heading_one_font = None + self._primary_font = None + self._heading_two_font = None + self._button_style_settings = None + self._body_border_color_choice = None + self.discriminator = None + + if email_body_padding is not None: + self.email_body_padding = email_body_padding + if color_picker_favorite5 is not None: + self.color_picker_favorite5 = color_picker_favorite5 + if body_color is not None: + self.body_color = body_color + if color_picker_favorite6 is not None: + self.color_picker_favorite6 = color_picker_favorite6 + if background_image is not None: + self.background_image = background_image + if email_body_width is not None: + self.email_body_width = email_body_width + if secondary_font is not None: + self.secondary_font = secondary_font + if primary_accent_color is not None: + self.primary_accent_color = primary_accent_color + if color_picker_favorite3 is not None: + self.color_picker_favorite3 = color_picker_favorite3 + if primary_font_line_height is not None: + self.primary_font_line_height = primary_font_line_height + if color_picker_favorite4 is not None: + self.color_picker_favorite4 = color_picker_favorite4 + if secondary_font_color is not None: + self.secondary_font_color = secondary_font_color + if color_picker_favorite1 is not None: + self.color_picker_favorite1 = color_picker_favorite1 + if color_picker_favorite2 is not None: + self.color_picker_favorite2 = color_picker_favorite2 + if body_border_color is not None: + self.body_border_color = body_border_color + if body_border_width is not None: + self.body_border_width = body_border_width + if links_font is not None: + self.links_font = links_font + if background_color is not None: + self.background_color = background_color + if background_image_type is not None: + self.background_image_type = background_image_type + if divider_style_settings is not None: + self.divider_style_settings = divider_style_settings + if secondary_accent_color is not None: + self.secondary_accent_color = secondary_accent_color + if secondary_font_line_height is not None: + self.secondary_font_line_height = secondary_font_line_height + if primary_font_size is not None: + self.primary_font_size = primary_font_size + if secondary_font_size is not None: + self.secondary_font_size = secondary_font_size + if primary_font_color is not None: + self.primary_font_color = primary_font_color + if heading_one_font is not None: + self.heading_one_font = heading_one_font + if primary_font is not None: + self.primary_font = primary_font + if heading_two_font is not None: + self.heading_two_font = heading_two_font + if button_style_settings is not None: + self.button_style_settings = button_style_settings + if body_border_color_choice is not None: + self.body_border_color_choice = body_border_color_choice + + @property + def email_body_padding(self): + """Gets the email_body_padding of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The email_body_padding of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._email_body_padding + + @email_body_padding.setter + def email_body_padding(self, email_body_padding): + """Sets the email_body_padding of this PublicEmailStyleSettings. + + + :param email_body_padding: The email_body_padding of this PublicEmailStyleSettings. # noqa: E501 + :type email_body_padding: str + """ + + self._email_body_padding = email_body_padding + + @property + def color_picker_favorite5(self): + """Gets the color_picker_favorite5 of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The color_picker_favorite5 of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._color_picker_favorite5 + + @color_picker_favorite5.setter + def color_picker_favorite5(self, color_picker_favorite5): + """Sets the color_picker_favorite5 of this PublicEmailStyleSettings. + + + :param color_picker_favorite5: The color_picker_favorite5 of this PublicEmailStyleSettings. # noqa: E501 + :type color_picker_favorite5: str + """ + + self._color_picker_favorite5 = color_picker_favorite5 + + @property + def body_color(self): + """Gets the body_color of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The body_color of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._body_color + + @body_color.setter + def body_color(self, body_color): + """Sets the body_color of this PublicEmailStyleSettings. + + + :param body_color: The body_color of this PublicEmailStyleSettings. # noqa: E501 + :type body_color: str + """ + + self._body_color = body_color + + @property + def color_picker_favorite6(self): + """Gets the color_picker_favorite6 of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The color_picker_favorite6 of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._color_picker_favorite6 + + @color_picker_favorite6.setter + def color_picker_favorite6(self, color_picker_favorite6): + """Sets the color_picker_favorite6 of this PublicEmailStyleSettings. + + + :param color_picker_favorite6: The color_picker_favorite6 of this PublicEmailStyleSettings. # noqa: E501 + :type color_picker_favorite6: str + """ + + self._color_picker_favorite6 = color_picker_favorite6 + + @property + def background_image(self): + """Gets the background_image of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The background_image of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._background_image + + @background_image.setter + def background_image(self, background_image): + """Sets the background_image of this PublicEmailStyleSettings. + + + :param background_image: The background_image of this PublicEmailStyleSettings. # noqa: E501 + :type background_image: str + """ + + self._background_image = background_image + + @property + def email_body_width(self): + """Gets the email_body_width of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The email_body_width of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._email_body_width + + @email_body_width.setter + def email_body_width(self, email_body_width): + """Sets the email_body_width of this PublicEmailStyleSettings. + + + :param email_body_width: The email_body_width of this PublicEmailStyleSettings. # noqa: E501 + :type email_body_width: str + """ + + self._email_body_width = email_body_width + + @property + def secondary_font(self): + """Gets the secondary_font of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The secondary_font of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._secondary_font + + @secondary_font.setter + def secondary_font(self, secondary_font): + """Sets the secondary_font of this PublicEmailStyleSettings. + + + :param secondary_font: The secondary_font of this PublicEmailStyleSettings. # noqa: E501 + :type secondary_font: str + """ + + self._secondary_font = secondary_font + + @property + def primary_accent_color(self): + """Gets the primary_accent_color of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The primary_accent_color of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._primary_accent_color + + @primary_accent_color.setter + def primary_accent_color(self, primary_accent_color): + """Sets the primary_accent_color of this PublicEmailStyleSettings. + + + :param primary_accent_color: The primary_accent_color of this PublicEmailStyleSettings. # noqa: E501 + :type primary_accent_color: str + """ + + self._primary_accent_color = primary_accent_color + + @property + def color_picker_favorite3(self): + """Gets the color_picker_favorite3 of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The color_picker_favorite3 of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._color_picker_favorite3 + + @color_picker_favorite3.setter + def color_picker_favorite3(self, color_picker_favorite3): + """Sets the color_picker_favorite3 of this PublicEmailStyleSettings. + + + :param color_picker_favorite3: The color_picker_favorite3 of this PublicEmailStyleSettings. # noqa: E501 + :type color_picker_favorite3: str + """ + + self._color_picker_favorite3 = color_picker_favorite3 + + @property + def primary_font_line_height(self): + """Gets the primary_font_line_height of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The primary_font_line_height of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._primary_font_line_height + + @primary_font_line_height.setter + def primary_font_line_height(self, primary_font_line_height): + """Sets the primary_font_line_height of this PublicEmailStyleSettings. + + + :param primary_font_line_height: The primary_font_line_height of this PublicEmailStyleSettings. # noqa: E501 + :type primary_font_line_height: str + """ + + self._primary_font_line_height = primary_font_line_height + + @property + def color_picker_favorite4(self): + """Gets the color_picker_favorite4 of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The color_picker_favorite4 of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._color_picker_favorite4 + + @color_picker_favorite4.setter + def color_picker_favorite4(self, color_picker_favorite4): + """Sets the color_picker_favorite4 of this PublicEmailStyleSettings. + + + :param color_picker_favorite4: The color_picker_favorite4 of this PublicEmailStyleSettings. # noqa: E501 + :type color_picker_favorite4: str + """ + + self._color_picker_favorite4 = color_picker_favorite4 + + @property + def secondary_font_color(self): + """Gets the secondary_font_color of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The secondary_font_color of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._secondary_font_color + + @secondary_font_color.setter + def secondary_font_color(self, secondary_font_color): + """Sets the secondary_font_color of this PublicEmailStyleSettings. + + + :param secondary_font_color: The secondary_font_color of this PublicEmailStyleSettings. # noqa: E501 + :type secondary_font_color: str + """ + + self._secondary_font_color = secondary_font_color + + @property + def color_picker_favorite1(self): + """Gets the color_picker_favorite1 of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The color_picker_favorite1 of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._color_picker_favorite1 + + @color_picker_favorite1.setter + def color_picker_favorite1(self, color_picker_favorite1): + """Sets the color_picker_favorite1 of this PublicEmailStyleSettings. + + + :param color_picker_favorite1: The color_picker_favorite1 of this PublicEmailStyleSettings. # noqa: E501 + :type color_picker_favorite1: str + """ + + self._color_picker_favorite1 = color_picker_favorite1 + + @property + def color_picker_favorite2(self): + """Gets the color_picker_favorite2 of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The color_picker_favorite2 of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._color_picker_favorite2 + + @color_picker_favorite2.setter + def color_picker_favorite2(self, color_picker_favorite2): + """Sets the color_picker_favorite2 of this PublicEmailStyleSettings. + + + :param color_picker_favorite2: The color_picker_favorite2 of this PublicEmailStyleSettings. # noqa: E501 + :type color_picker_favorite2: str + """ + + self._color_picker_favorite2 = color_picker_favorite2 + + @property + def body_border_color(self): + """Gets the body_border_color of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The body_border_color of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._body_border_color + + @body_border_color.setter + def body_border_color(self, body_border_color): + """Sets the body_border_color of this PublicEmailStyleSettings. + + + :param body_border_color: The body_border_color of this PublicEmailStyleSettings. # noqa: E501 + :type body_border_color: str + """ + + self._body_border_color = body_border_color + + @property + def body_border_width(self): + """Gets the body_border_width of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The body_border_width of this PublicEmailStyleSettings. # noqa: E501 + :rtype: int + """ + return self._body_border_width + + @body_border_width.setter + def body_border_width(self, body_border_width): + """Sets the body_border_width of this PublicEmailStyleSettings. + + + :param body_border_width: The body_border_width of this PublicEmailStyleSettings. # noqa: E501 + :type body_border_width: int + """ + + self._body_border_width = body_border_width + + @property + def links_font(self): + """Gets the links_font of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The links_font of this PublicEmailStyleSettings. # noqa: E501 + :rtype: PublicFontStyle + """ + return self._links_font + + @links_font.setter + def links_font(self, links_font): + """Sets the links_font of this PublicEmailStyleSettings. + + + :param links_font: The links_font of this PublicEmailStyleSettings. # noqa: E501 + :type links_font: PublicFontStyle + """ + + self._links_font = links_font + + @property + def background_color(self): + """Gets the background_color of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The background_color of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._background_color + + @background_color.setter + def background_color(self, background_color): + """Sets the background_color of this PublicEmailStyleSettings. + + + :param background_color: The background_color of this PublicEmailStyleSettings. # noqa: E501 + :type background_color: str + """ + + self._background_color = background_color + + @property + def background_image_type(self): + """Gets the background_image_type of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The background_image_type of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._background_image_type + + @background_image_type.setter + def background_image_type(self, background_image_type): + """Sets the background_image_type of this PublicEmailStyleSettings. + + + :param background_image_type: The background_image_type of this PublicEmailStyleSettings. # noqa: E501 + :type background_image_type: str + """ + + self._background_image_type = background_image_type + + @property + def divider_style_settings(self): + """Gets the divider_style_settings of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The divider_style_settings of this PublicEmailStyleSettings. # noqa: E501 + :rtype: PublicDividerStyleSettings + """ + return self._divider_style_settings + + @divider_style_settings.setter + def divider_style_settings(self, divider_style_settings): + """Sets the divider_style_settings of this PublicEmailStyleSettings. + + + :param divider_style_settings: The divider_style_settings of this PublicEmailStyleSettings. # noqa: E501 + :type divider_style_settings: PublicDividerStyleSettings + """ + + self._divider_style_settings = divider_style_settings + + @property + def secondary_accent_color(self): + """Gets the secondary_accent_color of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The secondary_accent_color of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._secondary_accent_color + + @secondary_accent_color.setter + def secondary_accent_color(self, secondary_accent_color): + """Sets the secondary_accent_color of this PublicEmailStyleSettings. + + + :param secondary_accent_color: The secondary_accent_color of this PublicEmailStyleSettings. # noqa: E501 + :type secondary_accent_color: str + """ + + self._secondary_accent_color = secondary_accent_color + + @property + def secondary_font_line_height(self): + """Gets the secondary_font_line_height of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The secondary_font_line_height of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._secondary_font_line_height + + @secondary_font_line_height.setter + def secondary_font_line_height(self, secondary_font_line_height): + """Sets the secondary_font_line_height of this PublicEmailStyleSettings. + + + :param secondary_font_line_height: The secondary_font_line_height of this PublicEmailStyleSettings. # noqa: E501 + :type secondary_font_line_height: str + """ + + self._secondary_font_line_height = secondary_font_line_height + + @property + def primary_font_size(self): + """Gets the primary_font_size of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The primary_font_size of this PublicEmailStyleSettings. # noqa: E501 + :rtype: int + """ + return self._primary_font_size + + @primary_font_size.setter + def primary_font_size(self, primary_font_size): + """Sets the primary_font_size of this PublicEmailStyleSettings. + + + :param primary_font_size: The primary_font_size of this PublicEmailStyleSettings. # noqa: E501 + :type primary_font_size: int + """ + + self._primary_font_size = primary_font_size + + @property + def secondary_font_size(self): + """Gets the secondary_font_size of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The secondary_font_size of this PublicEmailStyleSettings. # noqa: E501 + :rtype: int + """ + return self._secondary_font_size + + @secondary_font_size.setter + def secondary_font_size(self, secondary_font_size): + """Sets the secondary_font_size of this PublicEmailStyleSettings. + + + :param secondary_font_size: The secondary_font_size of this PublicEmailStyleSettings. # noqa: E501 + :type secondary_font_size: int + """ + + self._secondary_font_size = secondary_font_size + + @property + def primary_font_color(self): + """Gets the primary_font_color of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The primary_font_color of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._primary_font_color + + @primary_font_color.setter + def primary_font_color(self, primary_font_color): + """Sets the primary_font_color of this PublicEmailStyleSettings. + + + :param primary_font_color: The primary_font_color of this PublicEmailStyleSettings. # noqa: E501 + :type primary_font_color: str + """ + + self._primary_font_color = primary_font_color + + @property + def heading_one_font(self): + """Gets the heading_one_font of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The heading_one_font of this PublicEmailStyleSettings. # noqa: E501 + :rtype: PublicFontStyle + """ + return self._heading_one_font + + @heading_one_font.setter + def heading_one_font(self, heading_one_font): + """Sets the heading_one_font of this PublicEmailStyleSettings. + + + :param heading_one_font: The heading_one_font of this PublicEmailStyleSettings. # noqa: E501 + :type heading_one_font: PublicFontStyle + """ + + self._heading_one_font = heading_one_font + + @property + def primary_font(self): + """Gets the primary_font of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The primary_font of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._primary_font + + @primary_font.setter + def primary_font(self, primary_font): + """Sets the primary_font of this PublicEmailStyleSettings. + + + :param primary_font: The primary_font of this PublicEmailStyleSettings. # noqa: E501 + :type primary_font: str + """ + + self._primary_font = primary_font + + @property + def heading_two_font(self): + """Gets the heading_two_font of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The heading_two_font of this PublicEmailStyleSettings. # noqa: E501 + :rtype: PublicFontStyle + """ + return self._heading_two_font + + @heading_two_font.setter + def heading_two_font(self, heading_two_font): + """Sets the heading_two_font of this PublicEmailStyleSettings. + + + :param heading_two_font: The heading_two_font of this PublicEmailStyleSettings. # noqa: E501 + :type heading_two_font: PublicFontStyle + """ + + self._heading_two_font = heading_two_font + + @property + def button_style_settings(self): + """Gets the button_style_settings of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The button_style_settings of this PublicEmailStyleSettings. # noqa: E501 + :rtype: PublicButtonStyleSettings + """ + return self._button_style_settings + + @button_style_settings.setter + def button_style_settings(self, button_style_settings): + """Sets the button_style_settings of this PublicEmailStyleSettings. + + + :param button_style_settings: The button_style_settings of this PublicEmailStyleSettings. # noqa: E501 + :type button_style_settings: PublicButtonStyleSettings + """ + + self._button_style_settings = button_style_settings + + @property + def body_border_color_choice(self): + """Gets the body_border_color_choice of this PublicEmailStyleSettings. # noqa: E501 + + + :return: The body_border_color_choice of this PublicEmailStyleSettings. # noqa: E501 + :rtype: str + """ + return self._body_border_color_choice + + @body_border_color_choice.setter + def body_border_color_choice(self, body_border_color_choice): + """Sets the body_border_color_choice of this PublicEmailStyleSettings. + + + :param body_border_color_choice: The body_border_color_choice of this PublicEmailStyleSettings. # noqa: E501 + :type body_border_color_choice: str + """ + + self._body_border_color_choice = body_border_color_choice + + 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, PublicEmailStyleSettings): + 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, PublicEmailStyleSettings): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/public_email_subscription_details.py b/hubspot/marketing/emails/models/public_email_subscription_details.py new file mode 100644 index 00000000..689666dc --- /dev/null +++ b/hubspot/marketing/emails/models/public_email_subscription_details.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class PublicEmailSubscriptionDetails(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 = {"office_location_id": "str", "preferences_group_id": "str", "subscription_id": "str"} + + attribute_map = {"office_location_id": "officeLocationId", "preferences_group_id": "preferencesGroupId", "subscription_id": "subscriptionId"} + + def __init__(self, office_location_id=None, preferences_group_id=None, subscription_id=None, local_vars_configuration=None): # noqa: E501 + """PublicEmailSubscriptionDetails - 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._office_location_id = None + self._preferences_group_id = None + self._subscription_id = None + self.discriminator = None + + if office_location_id is not None: + self.office_location_id = office_location_id + if preferences_group_id is not None: + self.preferences_group_id = preferences_group_id + if subscription_id is not None: + self.subscription_id = subscription_id + + @property + def office_location_id(self): + """Gets the office_location_id of this PublicEmailSubscriptionDetails. # noqa: E501 + + ID of the selected office location. # noqa: E501 + + :return: The office_location_id of this PublicEmailSubscriptionDetails. # noqa: E501 + :rtype: str + """ + return self._office_location_id + + @office_location_id.setter + def office_location_id(self, office_location_id): + """Sets the office_location_id of this PublicEmailSubscriptionDetails. + + ID of the selected office location. # noqa: E501 + + :param office_location_id: The office_location_id of this PublicEmailSubscriptionDetails. # noqa: E501 + :type office_location_id: str + """ + + self._office_location_id = office_location_id + + @property + def preferences_group_id(self): + """Gets the preferences_group_id of this PublicEmailSubscriptionDetails. # noqa: E501 + + # noqa: E501 + + :return: The preferences_group_id of this PublicEmailSubscriptionDetails. # noqa: E501 + :rtype: str + """ + return self._preferences_group_id + + @preferences_group_id.setter + def preferences_group_id(self, preferences_group_id): + """Sets the preferences_group_id of this PublicEmailSubscriptionDetails. + + # noqa: E501 + + :param preferences_group_id: The preferences_group_id of this PublicEmailSubscriptionDetails. # noqa: E501 + :type preferences_group_id: str + """ + + self._preferences_group_id = preferences_group_id + + @property + def subscription_id(self): + """Gets the subscription_id of this PublicEmailSubscriptionDetails. # noqa: E501 + + ID of the subscription. # noqa: E501 + + :return: The subscription_id of this PublicEmailSubscriptionDetails. # noqa: E501 + :rtype: str + """ + return self._subscription_id + + @subscription_id.setter + def subscription_id(self, subscription_id): + """Sets the subscription_id of this PublicEmailSubscriptionDetails. + + ID of the subscription. # noqa: E501 + + :param subscription_id: The subscription_id of this PublicEmailSubscriptionDetails. # noqa: E501 + :type subscription_id: str + """ + + self._subscription_id = subscription_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, PublicEmailSubscriptionDetails): + 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, PublicEmailSubscriptionDetails): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/public_email_testing_details.py b/hubspot/marketing/emails/models/public_email_testing_details.py new file mode 100644 index 00000000..824f07a1 --- /dev/null +++ b/hubspot/marketing/emails/models/public_email_testing_details.py @@ -0,0 +1,309 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class PublicEmailTestingDetails(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 = { + "ab_sampling_default": "str", + "ab_sample_size_default": "str", + "ab_status": "str", + "ab_test_percentage": "int", + "hours_to_wait": "int", + "test_id": "str", + "ab_success_metric": "str", + } + + attribute_map = { + "ab_sampling_default": "abSamplingDefault", + "ab_sample_size_default": "abSampleSizeDefault", + "ab_status": "abStatus", + "ab_test_percentage": "abTestPercentage", + "hours_to_wait": "hoursToWait", + "test_id": "testId", + "ab_success_metric": "abSuccessMetric", + } + + def __init__( + self, ab_sampling_default=None, ab_sample_size_default=None, ab_status=None, ab_test_percentage=None, hours_to_wait=None, test_id=None, ab_success_metric=None, local_vars_configuration=None + ): # noqa: E501 + """PublicEmailTestingDetails - 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._ab_sampling_default = None + self._ab_sample_size_default = None + self._ab_status = None + self._ab_test_percentage = None + self._hours_to_wait = None + self._test_id = None + self._ab_success_metric = None + self.discriminator = None + + if ab_sampling_default is not None: + self.ab_sampling_default = ab_sampling_default + if ab_sample_size_default is not None: + self.ab_sample_size_default = ab_sample_size_default + if ab_status is not None: + self.ab_status = ab_status + if ab_test_percentage is not None: + self.ab_test_percentage = ab_test_percentage + if hours_to_wait is not None: + self.hours_to_wait = hours_to_wait + if test_id is not None: + self.test_id = test_id + if ab_success_metric is not None: + self.ab_success_metric = ab_success_metric + + @property + def ab_sampling_default(self): + """Gets the ab_sampling_default of this PublicEmailTestingDetails. # noqa: E501 + + Version of the email that should be sent if the results are inconclusive after the test period, master or variant. # noqa: E501 + + :return: The ab_sampling_default of this PublicEmailTestingDetails. # noqa: E501 + :rtype: str + """ + return self._ab_sampling_default + + @ab_sampling_default.setter + def ab_sampling_default(self, ab_sampling_default): + """Sets the ab_sampling_default of this PublicEmailTestingDetails. + + Version of the email that should be sent if the results are inconclusive after the test period, master or variant. # noqa: E501 + + :param ab_sampling_default: The ab_sampling_default of this PublicEmailTestingDetails. # noqa: E501 + :type ab_sampling_default: str + """ + allowed_values = ["master", "variant", "loser_variant", "mab_master", "mab_variant", "automated_master", "automated_variant", "automated_loser_variant"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and ab_sampling_default not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `ab_sampling_default` ({0}), must be one of {1}".format(ab_sampling_default, allowed_values)) # noqa: E501 + + self._ab_sampling_default = ab_sampling_default + + @property + def ab_sample_size_default(self): + """Gets the ab_sample_size_default of this PublicEmailTestingDetails. # noqa: E501 + + Version of the email that should be sent if there are too few recipients to conduct an AB test. # noqa: E501 + + :return: The ab_sample_size_default of this PublicEmailTestingDetails. # noqa: E501 + :rtype: str + """ + return self._ab_sample_size_default + + @ab_sample_size_default.setter + def ab_sample_size_default(self, ab_sample_size_default): + """Sets the ab_sample_size_default of this PublicEmailTestingDetails. + + Version of the email that should be sent if there are too few recipients to conduct an AB test. # noqa: E501 + + :param ab_sample_size_default: The ab_sample_size_default of this PublicEmailTestingDetails. # noqa: E501 + :type ab_sample_size_default: str + """ + allowed_values = ["master", "variant", "loser_variant", "mab_master", "mab_variant", "automated_master", "automated_variant", "automated_loser_variant"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and ab_sample_size_default not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `ab_sample_size_default` ({0}), must be one of {1}".format(ab_sample_size_default, allowed_values)) # noqa: E501 + + self._ab_sample_size_default = ab_sample_size_default + + @property + def ab_status(self): + """Gets the ab_status of this PublicEmailTestingDetails. # noqa: E501 + + Status of the AB test. # noqa: E501 + + :return: The ab_status of this PublicEmailTestingDetails. # noqa: E501 + :rtype: str + """ + return self._ab_status + + @ab_status.setter + def ab_status(self, ab_status): + """Sets the ab_status of this PublicEmailTestingDetails. + + Status of the AB test. # noqa: E501 + + :param ab_status: The ab_status of this PublicEmailTestingDetails. # noqa: E501 + :type ab_status: str + """ + allowed_values = ["master", "variant", "loser_variant", "mab_master", "mab_variant", "automated_master", "automated_variant", "automated_loser_variant"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and ab_status not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `ab_status` ({0}), must be one of {1}".format(ab_status, allowed_values)) # noqa: E501 + + self._ab_status = ab_status + + @property + def ab_test_percentage(self): + """Gets the ab_test_percentage of this PublicEmailTestingDetails. # noqa: E501 + + The size of your test group. # noqa: E501 + + :return: The ab_test_percentage of this PublicEmailTestingDetails. # noqa: E501 + :rtype: int + """ + return self._ab_test_percentage + + @ab_test_percentage.setter + def ab_test_percentage(self, ab_test_percentage): + """Sets the ab_test_percentage of this PublicEmailTestingDetails. + + The size of your test group. # noqa: E501 + + :param ab_test_percentage: The ab_test_percentage of this PublicEmailTestingDetails. # noqa: E501 + :type ab_test_percentage: int + """ + + self._ab_test_percentage = ab_test_percentage + + @property + def hours_to_wait(self): + """Gets the hours_to_wait of this PublicEmailTestingDetails. # noqa: E501 + + Time limit on gathering test results. After this time is up, the winning version will be sent to the remaining contacts. # noqa: E501 + + :return: The hours_to_wait of this PublicEmailTestingDetails. # noqa: E501 + :rtype: int + """ + return self._hours_to_wait + + @hours_to_wait.setter + def hours_to_wait(self, hours_to_wait): + """Sets the hours_to_wait of this PublicEmailTestingDetails. + + Time limit on gathering test results. After this time is up, the winning version will be sent to the remaining contacts. # noqa: E501 + + :param hours_to_wait: The hours_to_wait of this PublicEmailTestingDetails. # noqa: E501 + :type hours_to_wait: int + """ + + self._hours_to_wait = hours_to_wait + + @property + def test_id(self): + """Gets the test_id of this PublicEmailTestingDetails. # noqa: E501 + + The ID of the AB test. # noqa: E501 + + :return: The test_id of this PublicEmailTestingDetails. # noqa: E501 + :rtype: str + """ + return self._test_id + + @test_id.setter + def test_id(self, test_id): + """Sets the test_id of this PublicEmailTestingDetails. + + The ID of the AB test. # noqa: E501 + + :param test_id: The test_id of this PublicEmailTestingDetails. # noqa: E501 + :type test_id: str + """ + + self._test_id = test_id + + @property + def ab_success_metric(self): + """Gets the ab_success_metric of this PublicEmailTestingDetails. # noqa: E501 + + Metric to determine the version that will be sent to the remaining contacts. # noqa: E501 + + :return: The ab_success_metric of this PublicEmailTestingDetails. # noqa: E501 + :rtype: str + """ + return self._ab_success_metric + + @ab_success_metric.setter + def ab_success_metric(self, ab_success_metric): + """Sets the ab_success_metric of this PublicEmailTestingDetails. + + Metric to determine the version that will be sent to the remaining contacts. # noqa: E501 + + :param ab_success_metric: The ab_success_metric of this PublicEmailTestingDetails. # noqa: E501 + :type ab_success_metric: str + """ + allowed_values = ["CLICKS_BY_OPENS", "CLICKS_BY_DELIVERED", "OPENS_BY_DELIVERED"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and ab_success_metric not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `ab_success_metric` ({0}), must be one of {1}".format(ab_success_metric, allowed_values)) # noqa: E501 + + self._ab_success_metric = ab_success_metric + + 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, PublicEmailTestingDetails): + 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, PublicEmailTestingDetails): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/public_email_to_details.py b/hubspot/marketing/emails/models/public_email_to_details.py new file mode 100644 index 00000000..34bc9b49 --- /dev/null +++ b/hubspot/marketing/emails/models/public_email_to_details.py @@ -0,0 +1,233 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class PublicEmailToDetails(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 = { + "contact_ils_lists": "PublicEmailRecipients", + "limit_send_frequency": "bool", + "suppress_graymail": "bool", + "contact_ids": "PublicEmailRecipients", + "contact_lists": "PublicEmailRecipients", + } + + attribute_map = { + "contact_ils_lists": "contactIlsLists", + "limit_send_frequency": "limitSendFrequency", + "suppress_graymail": "suppressGraymail", + "contact_ids": "contactIds", + "contact_lists": "contactLists", + } + + def __init__(self, contact_ils_lists=None, limit_send_frequency=None, suppress_graymail=None, contact_ids=None, contact_lists=None, local_vars_configuration=None): # noqa: E501 + """PublicEmailToDetails - 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._contact_ils_lists = None + self._limit_send_frequency = None + self._suppress_graymail = None + self._contact_ids = None + self._contact_lists = None + self.discriminator = None + + if contact_ils_lists is not None: + self.contact_ils_lists = contact_ils_lists + if limit_send_frequency is not None: + self.limit_send_frequency = limit_send_frequency + if suppress_graymail is not None: + self.suppress_graymail = suppress_graymail + if contact_ids is not None: + self.contact_ids = contact_ids + if contact_lists is not None: + self.contact_lists = contact_lists + + @property + def contact_ils_lists(self): + """Gets the contact_ils_lists of this PublicEmailToDetails. # noqa: E501 + + + :return: The contact_ils_lists of this PublicEmailToDetails. # noqa: E501 + :rtype: PublicEmailRecipients + """ + return self._contact_ils_lists + + @contact_ils_lists.setter + def contact_ils_lists(self, contact_ils_lists): + """Sets the contact_ils_lists of this PublicEmailToDetails. + + + :param contact_ils_lists: The contact_ils_lists of this PublicEmailToDetails. # noqa: E501 + :type contact_ils_lists: PublicEmailRecipients + """ + + self._contact_ils_lists = contact_ils_lists + + @property + def limit_send_frequency(self): + """Gets the limit_send_frequency of this PublicEmailToDetails. # noqa: E501 + + # noqa: E501 + + :return: The limit_send_frequency of this PublicEmailToDetails. # noqa: E501 + :rtype: bool + """ + return self._limit_send_frequency + + @limit_send_frequency.setter + def limit_send_frequency(self, limit_send_frequency): + """Sets the limit_send_frequency of this PublicEmailToDetails. + + # noqa: E501 + + :param limit_send_frequency: The limit_send_frequency of this PublicEmailToDetails. # noqa: E501 + :type limit_send_frequency: bool + """ + + self._limit_send_frequency = limit_send_frequency + + @property + def suppress_graymail(self): + """Gets the suppress_graymail of this PublicEmailToDetails. # noqa: E501 + + # noqa: E501 + + :return: The suppress_graymail of this PublicEmailToDetails. # noqa: E501 + :rtype: bool + """ + return self._suppress_graymail + + @suppress_graymail.setter + def suppress_graymail(self, suppress_graymail): + """Sets the suppress_graymail of this PublicEmailToDetails. + + # noqa: E501 + + :param suppress_graymail: The suppress_graymail of this PublicEmailToDetails. # noqa: E501 + :type suppress_graymail: bool + """ + + self._suppress_graymail = suppress_graymail + + @property + def contact_ids(self): + """Gets the contact_ids of this PublicEmailToDetails. # noqa: E501 + + + :return: The contact_ids of this PublicEmailToDetails. # noqa: E501 + :rtype: PublicEmailRecipients + """ + return self._contact_ids + + @contact_ids.setter + def contact_ids(self, contact_ids): + """Sets the contact_ids of this PublicEmailToDetails. + + + :param contact_ids: The contact_ids of this PublicEmailToDetails. # noqa: E501 + :type contact_ids: PublicEmailRecipients + """ + + self._contact_ids = contact_ids + + @property + def contact_lists(self): + """Gets the contact_lists of this PublicEmailToDetails. # noqa: E501 + + + :return: The contact_lists of this PublicEmailToDetails. # noqa: E501 + :rtype: PublicEmailRecipients + """ + return self._contact_lists + + @contact_lists.setter + def contact_lists(self, contact_lists): + """Sets the contact_lists of this PublicEmailToDetails. + + + :param contact_lists: The contact_lists of this PublicEmailToDetails. # noqa: E501 + :type contact_lists: PublicEmailRecipients + """ + + self._contact_lists = contact_lists + + 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, PublicEmailToDetails): + 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, PublicEmailToDetails): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/public_font_style.py b/hubspot/marketing/emails/models/public_font_style.py new file mode 100644 index 00000000..dd5657cc --- /dev/null +++ b/hubspot/marketing/emails/models/public_font_style.py @@ -0,0 +1,241 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class PublicFontStyle(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 = {"size": "int", "color": "str", "underline": "bool", "bold": "bool", "italic": "bool", "font": "str"} + + attribute_map = {"size": "size", "color": "color", "underline": "underline", "bold": "bold", "italic": "italic", "font": "font"} + + def __init__(self, size=None, color=None, underline=None, bold=None, italic=None, font=None, local_vars_configuration=None): # noqa: E501 + """PublicFontStyle - 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._size = None + self._color = None + self._underline = None + self._bold = None + self._italic = None + self._font = None + self.discriminator = None + + if size is not None: + self.size = size + if color is not None: + self.color = color + if underline is not None: + self.underline = underline + if bold is not None: + self.bold = bold + if italic is not None: + self.italic = italic + if font is not None: + self.font = font + + @property + def size(self): + """Gets the size of this PublicFontStyle. # noqa: E501 + + + :return: The size of this PublicFontStyle. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this PublicFontStyle. + + + :param size: The size of this PublicFontStyle. # noqa: E501 + :type size: int + """ + + self._size = size + + @property + def color(self): + """Gets the color of this PublicFontStyle. # noqa: E501 + + + :return: The color of this PublicFontStyle. # noqa: E501 + :rtype: str + """ + return self._color + + @color.setter + def color(self, color): + """Sets the color of this PublicFontStyle. + + + :param color: The color of this PublicFontStyle. # noqa: E501 + :type color: str + """ + + self._color = color + + @property + def underline(self): + """Gets the underline of this PublicFontStyle. # noqa: E501 + + + :return: The underline of this PublicFontStyle. # noqa: E501 + :rtype: bool + """ + return self._underline + + @underline.setter + def underline(self, underline): + """Sets the underline of this PublicFontStyle. + + + :param underline: The underline of this PublicFontStyle. # noqa: E501 + :type underline: bool + """ + + self._underline = underline + + @property + def bold(self): + """Gets the bold of this PublicFontStyle. # noqa: E501 + + + :return: The bold of this PublicFontStyle. # noqa: E501 + :rtype: bool + """ + return self._bold + + @bold.setter + def bold(self, bold): + """Sets the bold of this PublicFontStyle. + + + :param bold: The bold of this PublicFontStyle. # noqa: E501 + :type bold: bool + """ + + self._bold = bold + + @property + def italic(self): + """Gets the italic of this PublicFontStyle. # noqa: E501 + + + :return: The italic of this PublicFontStyle. # noqa: E501 + :rtype: bool + """ + return self._italic + + @italic.setter + def italic(self, italic): + """Sets the italic of this PublicFontStyle. + + + :param italic: The italic of this PublicFontStyle. # noqa: E501 + :type italic: bool + """ + + self._italic = italic + + @property + def font(self): + """Gets the font of this PublicFontStyle. # noqa: E501 + + + :return: The font of this PublicFontStyle. # noqa: E501 + :rtype: str + """ + return self._font + + @font.setter + def font(self, font): + """Sets the font of this PublicFontStyle. + + + :param font: The font of this PublicFontStyle. # noqa: E501 + :type font: str + """ + + self._font = font + + 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, PublicFontStyle): + 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, PublicFontStyle): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/public_rss_email_details.py b/hubspot/marketing/emails/models/public_rss_email_details.py new file mode 100644 index 00000000..c2bd39b8 --- /dev/null +++ b/hubspot/marketing/emails/models/public_rss_email_details.py @@ -0,0 +1,363 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class PublicRssEmailDetails(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 = { + "blog_image_max_width": "int", + "blog_email_type": "str", + "hubspot_blog_id": "str", + "rss_entry_template": "str", + "timing": "dict[str, object]", + "max_entries": "int", + "use_headline_as_subject": "bool", + "blog_layout": "str", + "url": "str", + } + + attribute_map = { + "blog_image_max_width": "blogImageMaxWidth", + "blog_email_type": "blogEmailType", + "hubspot_blog_id": "hubspotBlogId", + "rss_entry_template": "rssEntryTemplate", + "timing": "timing", + "max_entries": "maxEntries", + "use_headline_as_subject": "useHeadlineAsSubject", + "blog_layout": "blogLayout", + "url": "url", + } + + def __init__( + self, + blog_image_max_width=None, + blog_email_type=None, + hubspot_blog_id=None, + rss_entry_template=None, + timing=None, + max_entries=None, + use_headline_as_subject=None, + blog_layout=None, + url=None, + local_vars_configuration=None, + ): # noqa: E501 + """PublicRssEmailDetails - 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._blog_image_max_width = None + self._blog_email_type = None + self._hubspot_blog_id = None + self._rss_entry_template = None + self._timing = None + self._max_entries = None + self._use_headline_as_subject = None + self._blog_layout = None + self._url = None + self.discriminator = None + + if blog_image_max_width is not None: + self.blog_image_max_width = blog_image_max_width + if blog_email_type is not None: + self.blog_email_type = blog_email_type + if hubspot_blog_id is not None: + self.hubspot_blog_id = hubspot_blog_id + if rss_entry_template is not None: + self.rss_entry_template = rss_entry_template + if timing is not None: + self.timing = timing + if max_entries is not None: + self.max_entries = max_entries + if use_headline_as_subject is not None: + self.use_headline_as_subject = use_headline_as_subject + if blog_layout is not None: + self.blog_layout = blog_layout + if url is not None: + self.url = url + + @property + def blog_image_max_width(self): + """Gets the blog_image_max_width of this PublicRssEmailDetails. # noqa: E501 + + # noqa: E501 + + :return: The blog_image_max_width of this PublicRssEmailDetails. # noqa: E501 + :rtype: int + """ + return self._blog_image_max_width + + @blog_image_max_width.setter + def blog_image_max_width(self, blog_image_max_width): + """Sets the blog_image_max_width of this PublicRssEmailDetails. + + # noqa: E501 + + :param blog_image_max_width: The blog_image_max_width of this PublicRssEmailDetails. # noqa: E501 + :type blog_image_max_width: int + """ + + self._blog_image_max_width = blog_image_max_width + + @property + def blog_email_type(self): + """Gets the blog_email_type of this PublicRssEmailDetails. # noqa: E501 + + # noqa: E501 + + :return: The blog_email_type of this PublicRssEmailDetails. # noqa: E501 + :rtype: str + """ + return self._blog_email_type + + @blog_email_type.setter + def blog_email_type(self, blog_email_type): + """Sets the blog_email_type of this PublicRssEmailDetails. + + # noqa: E501 + + :param blog_email_type: The blog_email_type of this PublicRssEmailDetails. # noqa: E501 + :type blog_email_type: str + """ + + self._blog_email_type = blog_email_type + + @property + def hubspot_blog_id(self): + """Gets the hubspot_blog_id of this PublicRssEmailDetails. # noqa: E501 + + # noqa: E501 + + :return: The hubspot_blog_id of this PublicRssEmailDetails. # noqa: E501 + :rtype: str + """ + return self._hubspot_blog_id + + @hubspot_blog_id.setter + def hubspot_blog_id(self, hubspot_blog_id): + """Sets the hubspot_blog_id of this PublicRssEmailDetails. + + # noqa: E501 + + :param hubspot_blog_id: The hubspot_blog_id of this PublicRssEmailDetails. # noqa: E501 + :type hubspot_blog_id: str + """ + + self._hubspot_blog_id = hubspot_blog_id + + @property + def rss_entry_template(self): + """Gets the rss_entry_template of this PublicRssEmailDetails. # noqa: E501 + + # noqa: E501 + + :return: The rss_entry_template of this PublicRssEmailDetails. # noqa: E501 + :rtype: str + """ + return self._rss_entry_template + + @rss_entry_template.setter + def rss_entry_template(self, rss_entry_template): + """Sets the rss_entry_template of this PublicRssEmailDetails. + + # noqa: E501 + + :param rss_entry_template: The rss_entry_template of this PublicRssEmailDetails. # noqa: E501 + :type rss_entry_template: str + """ + + self._rss_entry_template = rss_entry_template + + @property + def timing(self): + """Gets the timing of this PublicRssEmailDetails. # noqa: E501 + + # noqa: E501 + + :return: The timing of this PublicRssEmailDetails. # noqa: E501 + :rtype: dict[str, object] + """ + return self._timing + + @timing.setter + def timing(self, timing): + """Sets the timing of this PublicRssEmailDetails. + + # noqa: E501 + + :param timing: The timing of this PublicRssEmailDetails. # noqa: E501 + :type timing: dict[str, object] + """ + + self._timing = timing + + @property + def max_entries(self): + """Gets the max_entries of this PublicRssEmailDetails. # noqa: E501 + + # noqa: E501 + + :return: The max_entries of this PublicRssEmailDetails. # noqa: E501 + :rtype: int + """ + return self._max_entries + + @max_entries.setter + def max_entries(self, max_entries): + """Sets the max_entries of this PublicRssEmailDetails. + + # noqa: E501 + + :param max_entries: The max_entries of this PublicRssEmailDetails. # noqa: E501 + :type max_entries: int + """ + + self._max_entries = max_entries + + @property + def use_headline_as_subject(self): + """Gets the use_headline_as_subject of this PublicRssEmailDetails. # noqa: E501 + + # noqa: E501 + + :return: The use_headline_as_subject of this PublicRssEmailDetails. # noqa: E501 + :rtype: bool + """ + return self._use_headline_as_subject + + @use_headline_as_subject.setter + def use_headline_as_subject(self, use_headline_as_subject): + """Sets the use_headline_as_subject of this PublicRssEmailDetails. + + # noqa: E501 + + :param use_headline_as_subject: The use_headline_as_subject of this PublicRssEmailDetails. # noqa: E501 + :type use_headline_as_subject: bool + """ + + self._use_headline_as_subject = use_headline_as_subject + + @property + def blog_layout(self): + """Gets the blog_layout of this PublicRssEmailDetails. # noqa: E501 + + # noqa: E501 + + :return: The blog_layout of this PublicRssEmailDetails. # noqa: E501 + :rtype: str + """ + return self._blog_layout + + @blog_layout.setter + def blog_layout(self, blog_layout): + """Sets the blog_layout of this PublicRssEmailDetails. + + # noqa: E501 + + :param blog_layout: The blog_layout of this PublicRssEmailDetails. # noqa: E501 + :type blog_layout: str + """ + + self._blog_layout = blog_layout + + @property + def url(self): + """Gets the url of this PublicRssEmailDetails. # noqa: E501 + + # noqa: E501 + + :return: The url of this PublicRssEmailDetails. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this PublicRssEmailDetails. + + # noqa: E501 + + :param url: The url of this PublicRssEmailDetails. # noqa: E501 + :type url: str + """ + + self._url = url + + 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, PublicRssEmailDetails): + 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, PublicRssEmailDetails): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/public_webversion_details.py b/hubspot/marketing/emails/models/public_webversion_details.py new file mode 100644 index 00000000..27235325 --- /dev/null +++ b/hubspot/marketing/emails/models/public_webversion_details.py @@ -0,0 +1,386 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class PublicWebversionDetails(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 = { + "domain": "str", + "redirect_to_page_id": "str", + "is_page_redirected": "bool", + "redirect_to_url": "str", + "title": "str", + "meta_description": "str", + "page_expiry_enabled": "bool", + "slug": "str", + "url": "str", + "expires_at": "datetime", + } + + attribute_map = { + "domain": "domain", + "redirect_to_page_id": "redirectToPageId", + "is_page_redirected": "isPageRedirected", + "redirect_to_url": "redirectToUrl", + "title": "title", + "meta_description": "metaDescription", + "page_expiry_enabled": "pageExpiryEnabled", + "slug": "slug", + "url": "url", + "expires_at": "expiresAt", + } + + def __init__( + self, + domain=None, + redirect_to_page_id=None, + is_page_redirected=None, + redirect_to_url=None, + title=None, + meta_description=None, + page_expiry_enabled=None, + slug=None, + url=None, + expires_at=None, + local_vars_configuration=None, + ): # noqa: E501 + """PublicWebversionDetails - 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._domain = None + self._redirect_to_page_id = None + self._is_page_redirected = None + self._redirect_to_url = None + self._title = None + self._meta_description = None + self._page_expiry_enabled = None + self._slug = None + self._url = None + self._expires_at = None + self.discriminator = None + + if domain is not None: + self.domain = domain + if redirect_to_page_id is not None: + self.redirect_to_page_id = redirect_to_page_id + if is_page_redirected is not None: + self.is_page_redirected = is_page_redirected + if redirect_to_url is not None: + self.redirect_to_url = redirect_to_url + if title is not None: + self.title = title + if meta_description is not None: + self.meta_description = meta_description + if page_expiry_enabled is not None: + self.page_expiry_enabled = page_expiry_enabled + if slug is not None: + self.slug = slug + if url is not None: + self.url = url + if expires_at is not None: + self.expires_at = expires_at + + @property + def domain(self): + """Gets the domain of this PublicWebversionDetails. # noqa: E501 + + # noqa: E501 + + :return: The domain of this PublicWebversionDetails. # noqa: E501 + :rtype: str + """ + return self._domain + + @domain.setter + def domain(self, domain): + """Sets the domain of this PublicWebversionDetails. + + # noqa: E501 + + :param domain: The domain of this PublicWebversionDetails. # noqa: E501 + :type domain: str + """ + + self._domain = domain + + @property + def redirect_to_page_id(self): + """Gets the redirect_to_page_id of this PublicWebversionDetails. # noqa: E501 + + # noqa: E501 + + :return: The redirect_to_page_id of this PublicWebversionDetails. # noqa: E501 + :rtype: str + """ + return self._redirect_to_page_id + + @redirect_to_page_id.setter + def redirect_to_page_id(self, redirect_to_page_id): + """Sets the redirect_to_page_id of this PublicWebversionDetails. + + # noqa: E501 + + :param redirect_to_page_id: The redirect_to_page_id of this PublicWebversionDetails. # noqa: E501 + :type redirect_to_page_id: str + """ + + self._redirect_to_page_id = redirect_to_page_id + + @property + def is_page_redirected(self): + """Gets the is_page_redirected of this PublicWebversionDetails. # noqa: E501 + + + :return: The is_page_redirected of this PublicWebversionDetails. # noqa: E501 + :rtype: bool + """ + return self._is_page_redirected + + @is_page_redirected.setter + def is_page_redirected(self, is_page_redirected): + """Sets the is_page_redirected of this PublicWebversionDetails. + + + :param is_page_redirected: The is_page_redirected of this PublicWebversionDetails. # noqa: E501 + :type is_page_redirected: bool + """ + + self._is_page_redirected = is_page_redirected + + @property + def redirect_to_url(self): + """Gets the redirect_to_url of this PublicWebversionDetails. # noqa: E501 + + # noqa: E501 + + :return: The redirect_to_url of this PublicWebversionDetails. # noqa: E501 + :rtype: str + """ + return self._redirect_to_url + + @redirect_to_url.setter + def redirect_to_url(self, redirect_to_url): + """Sets the redirect_to_url of this PublicWebversionDetails. + + # noqa: E501 + + :param redirect_to_url: The redirect_to_url of this PublicWebversionDetails. # noqa: E501 + :type redirect_to_url: str + """ + + self._redirect_to_url = redirect_to_url + + @property + def title(self): + """Gets the title of this PublicWebversionDetails. # noqa: E501 + + # noqa: E501 + + :return: The title of this PublicWebversionDetails. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this PublicWebversionDetails. + + # noqa: E501 + + :param title: The title of this PublicWebversionDetails. # noqa: E501 + :type title: str + """ + + self._title = title + + @property + def meta_description(self): + """Gets the meta_description of this PublicWebversionDetails. # noqa: E501 + + # noqa: E501 + + :return: The meta_description of this PublicWebversionDetails. # noqa: E501 + :rtype: str + """ + return self._meta_description + + @meta_description.setter + def meta_description(self, meta_description): + """Sets the meta_description of this PublicWebversionDetails. + + # noqa: E501 + + :param meta_description: The meta_description of this PublicWebversionDetails. # noqa: E501 + :type meta_description: str + """ + + self._meta_description = meta_description + + @property + def page_expiry_enabled(self): + """Gets the page_expiry_enabled of this PublicWebversionDetails. # noqa: E501 + + + :return: The page_expiry_enabled of this PublicWebversionDetails. # noqa: E501 + :rtype: bool + """ + return self._page_expiry_enabled + + @page_expiry_enabled.setter + def page_expiry_enabled(self, page_expiry_enabled): + """Sets the page_expiry_enabled of this PublicWebversionDetails. + + + :param page_expiry_enabled: The page_expiry_enabled of this PublicWebversionDetails. # noqa: E501 + :type page_expiry_enabled: bool + """ + + self._page_expiry_enabled = page_expiry_enabled + + @property + def slug(self): + """Gets the slug of this PublicWebversionDetails. # noqa: E501 + + # noqa: E501 + + :return: The slug of this PublicWebversionDetails. # noqa: E501 + :rtype: str + """ + return self._slug + + @slug.setter + def slug(self, slug): + """Sets the slug of this PublicWebversionDetails. + + # noqa: E501 + + :param slug: The slug of this PublicWebversionDetails. # noqa: E501 + :type slug: str + """ + + self._slug = slug + + @property + def url(self): + """Gets the url of this PublicWebversionDetails. # noqa: E501 + + + :return: The url of this PublicWebversionDetails. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this PublicWebversionDetails. + + + :param url: The url of this PublicWebversionDetails. # noqa: E501 + :type url: str + """ + + self._url = url + + @property + def expires_at(self): + """Gets the expires_at of this PublicWebversionDetails. # noqa: E501 + + # noqa: E501 + + :return: The expires_at of this PublicWebversionDetails. # noqa: E501 + :rtype: datetime + """ + return self._expires_at + + @expires_at.setter + def expires_at(self, expires_at): + """Sets the expires_at of this PublicWebversionDetails. + + # noqa: E501 + + :param expires_at: The expires_at of this PublicWebversionDetails. # noqa: E501 + :type expires_at: datetime + """ + + self._expires_at = expires_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, PublicWebversionDetails): + 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, PublicWebversionDetails): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/version_public_email.py b/hubspot/marketing/emails/models/version_public_email.py new file mode 100644 index 00000000..87608b64 --- /dev/null +++ b/hubspot/marketing/emails/models/version_public_email.py @@ -0,0 +1,199 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class VersionPublicEmail(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", "user": "VersionUser", "object": "PublicEmail", "updated_at": "datetime"} + + attribute_map = {"id": "id", "user": "user", "object": "object", "updated_at": "updatedAt"} + + def __init__(self, id=None, user=None, object=None, updated_at=None, local_vars_configuration=None): # noqa: E501 + """VersionPublicEmail - 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._user = None + self._object = None + self._updated_at = None + self.discriminator = None + + self.id = id + self.user = user + self.object = object + self.updated_at = updated_at + + @property + def id(self): + """Gets the id of this VersionPublicEmail. # noqa: E501 + + ID of this marketing email version. # noqa: E501 + + :return: The id of this VersionPublicEmail. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this VersionPublicEmail. + + ID of this marketing email version. # noqa: E501 + + :param id: The id of this VersionPublicEmail. # 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 user(self): + """Gets the user of this VersionPublicEmail. # noqa: E501 + + + :return: The user of this VersionPublicEmail. # noqa: E501 + :rtype: VersionUser + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this VersionPublicEmail. + + + :param user: The user of this VersionPublicEmail. # noqa: E501 + :type user: VersionUser + """ + if self.local_vars_configuration.client_side_validation and user is None: # noqa: E501 + raise ValueError("Invalid value for `user`, must not be `None`") # noqa: E501 + + self._user = user + + @property + def object(self): + """Gets the object of this VersionPublicEmail. # noqa: E501 + + + :return: The object of this VersionPublicEmail. # noqa: E501 + :rtype: PublicEmail + """ + return self._object + + @object.setter + def object(self, object): + """Sets the object of this VersionPublicEmail. + + + :param object: The object of this VersionPublicEmail. # noqa: E501 + :type object: PublicEmail + """ + if self.local_vars_configuration.client_side_validation and object is None: # noqa: E501 + raise ValueError("Invalid value for `object`, must not be `None`") # noqa: E501 + + self._object = object + + @property + def updated_at(self): + """Gets the updated_at of this VersionPublicEmail. # noqa: E501 + + + :return: The updated_at of this VersionPublicEmail. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this VersionPublicEmail. + + + :param updated_at: The updated_at of this VersionPublicEmail. # 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, VersionPublicEmail): + 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, VersionPublicEmail): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/models/version_user.py b/hubspot/marketing/emails/models/version_user.py new file mode 100644 index 00000000..53e1974d --- /dev/null +++ b/hubspot/marketing/emails/models/version_user.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Marketing Emails + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.emails.configuration import Configuration + + +class VersionUser(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 = {"full_name": "str", "id": "str", "email": "str"} + + attribute_map = {"full_name": "fullName", "id": "id", "email": "email"} + + def __init__(self, full_name=None, id=None, email=None, local_vars_configuration=None): # noqa: E501 + """VersionUser - 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._full_name = None + self._id = None + self._email = None + self.discriminator = None + + self.full_name = full_name + self.id = id + self.email = email + + @property + def full_name(self): + """Gets the full_name of this VersionUser. # noqa: E501 + + The user's full name. # noqa: E501 + + :return: The full_name of this VersionUser. # noqa: E501 + :rtype: str + """ + return self._full_name + + @full_name.setter + def full_name(self, full_name): + """Sets the full_name of this VersionUser. + + The user's full name. # noqa: E501 + + :param full_name: The full_name of this VersionUser. # noqa: E501 + :type full_name: str + """ + if self.local_vars_configuration.client_side_validation and full_name is None: # noqa: E501 + raise ValueError("Invalid value for `full_name`, must not be `None`") # noqa: E501 + + self._full_name = full_name + + @property + def id(self): + """Gets the id of this VersionUser. # noqa: E501 + + The user ID. # noqa: E501 + + :return: The id of this VersionUser. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this VersionUser. + + The user ID. # noqa: E501 + + :param id: The id of this VersionUser. # 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 email(self): + """Gets the email of this VersionUser. # noqa: E501 + + The user email. # noqa: E501 + + :return: The email of this VersionUser. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this VersionUser. + + The user email. # noqa: E501 + + :param email: The email of this VersionUser. # noqa: E501 + :type email: str + """ + if self.local_vars_configuration.client_side_validation and email is None: # noqa: E501 + raise ValueError("Invalid value for `email`, must not be `None`") # noqa: E501 + + self._email = email + + 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, VersionUser): + 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, VersionUser): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/emails/rest.py b/hubspot/marketing/emails/rest.py new file mode 100644 index 00000000..555f05fb --- /dev/null +++ b/hubspot/marketing/emails/rest.py @@ -0,0 +1,213 @@ +# coding: utf-8 + +""" + Marketing Emails + + 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.marketing.emails.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) From f4d968065c23c53a705a9eb922176d66145cc84a Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 1 Apr 2025 12:35:21 +0300 Subject: [PATCH 04/49] Codegen Marketing Events --- hubspot/marketing/events/__init__.py | 24 +- hubspot/marketing/events/api/__init__.py | 7 +- .../events/api/add_event_attendees_api.py | 630 +++++++++++++++++ hubspot/marketing/events/api/basic_api.py | 570 ++++++--------- hubspot/marketing/events/api/batch_api.py | 543 +++++++++++++++ ..._changes_api.py => change_property_api.py} | 138 ++-- .../marketing/events/api/identifiers_api.py | 280 ++++++++ .../events/api/list_associations_api.py | 4 +- ...i.py => retrieve_participant_state_api.py} | 2 +- .../api/subscriber_state_changes_api.py | 16 +- hubspot/marketing/events/models/__init__.py | 17 +- hubspot/marketing/events/models/app_info.py | 147 ++++ ...g_event_public_object_id_delete_request.py | 122 ++++ ...ing_event_public_update_request_full_v2.py | 122 ++++ ...keting_event_public_default_response_v2.py | 255 +++++++ ..._public_default_response_v2_with_errors.py | 314 +++++++++ ..._public_read_response_v2_forward_paging.py | 146 ++++ ...arch_public_response_wrapper_no_paging.py} | 22 +- ...ng_event_identifiers_response_no_paging.py | 147 ++++ .../events/models/crm_property_wrapper.py | 147 ++++ .../marketing_event_default_response.py | 27 + .../marketing_event_email_subscriber.py | 4 +- .../marketing_event_identifiers_response.py | 220 ++++++ ...marketing_event_public_default_response.py | 27 + ...keting_event_public_default_response_v2.py | 485 +++++++++++++ ...g_event_public_object_id_delete_request.py | 122 ++++ .../marketing_event_public_read_response.py | 27 + ...marketing_event_public_read_response_v2.py | 647 ++++++++++++++++++ ...ing_event_public_update_request_full_v2.py | 374 ++++++++++ ...arketing_event_public_update_request_v2.py | 346 ++++++++++ .../models/marketing_event_subscriber.py | 4 +- .../marketing/events/models/property_value.py | 1 + .../models/search_public_response_wrapper.py | 197 ++++++ 33 files changed, 5661 insertions(+), 473 deletions(-) create mode 100644 hubspot/marketing/events/api/add_event_attendees_api.py create mode 100644 hubspot/marketing/events/api/batch_api.py rename hubspot/marketing/events/api/{attendance_subscriber_state_changes_api.py => change_property_api.py} (60%) create mode 100644 hubspot/marketing/events/api/identifiers_api.py rename hubspot/marketing/events/api/{participant_state_api.py => retrieve_participant_state_api.py} (99%) create mode 100644 hubspot/marketing/events/models/app_info.py create mode 100644 hubspot/marketing/events/models/batch_input_marketing_event_public_object_id_delete_request.py create mode 100644 hubspot/marketing/events/models/batch_input_marketing_event_public_update_request_full_v2.py create mode 100644 hubspot/marketing/events/models/batch_response_marketing_event_public_default_response_v2.py create mode 100644 hubspot/marketing/events/models/batch_response_marketing_event_public_default_response_v2_with_errors.py create mode 100644 hubspot/marketing/events/models/collection_response_marketing_event_public_read_response_v2_forward_paging.py rename hubspot/marketing/events/models/{collection_response_marketing_event_external_unique_identifier_no_paging.py => collection_response_search_public_response_wrapper_no_paging.py} (74%) create mode 100644 hubspot/marketing/events/models/collection_response_with_total_marketing_event_identifiers_response_no_paging.py create mode 100644 hubspot/marketing/events/models/crm_property_wrapper.py create mode 100644 hubspot/marketing/events/models/marketing_event_identifiers_response.py create mode 100644 hubspot/marketing/events/models/marketing_event_public_default_response_v2.py create mode 100644 hubspot/marketing/events/models/marketing_event_public_object_id_delete_request.py create mode 100644 hubspot/marketing/events/models/marketing_event_public_read_response_v2.py create mode 100644 hubspot/marketing/events/models/marketing_event_public_update_request_full_v2.py create mode 100644 hubspot/marketing/events/models/marketing_event_public_update_request_v2.py create mode 100644 hubspot/marketing/events/models/search_public_response_wrapper.py diff --git a/hubspot/marketing/events/__init__.py b/hubspot/marketing/events/__init__.py index 7a87e818..1a4973cb 100644 --- a/hubspot/marketing/events/__init__.py +++ b/hubspot/marketing/events/__init__.py @@ -17,10 +17,13 @@ __version__ = "1.0.0" # import apis into sdk package -from hubspot.marketing.events.api.attendance_subscriber_state_changes_api import AttendanceSubscriberStateChangesApi +from hubspot.marketing.events.api.add_event_attendees_api import AddEventAttendeesApi from hubspot.marketing.events.api.basic_api import BasicApi +from hubspot.marketing.events.api.batch_api import BatchApi +from hubspot.marketing.events.api.change_property_api import ChangePropertyApi +from hubspot.marketing.events.api.identifiers_api import IdentifiersApi from hubspot.marketing.events.api.list_associations_api import ListAssociationsApi -from hubspot.marketing.events.api.participant_state_api import ParticipantStateApi +from hubspot.marketing.events.api.retrieve_participant_state_api import RetrieveParticipantStateApi from hubspot.marketing.events.api.settings_api import SettingsApi from hubspot.marketing.events.api.subscriber_state_changes_api import SubscriberStateChangesApi @@ -35,18 +38,26 @@ from hubspot.marketing.events.exceptions import ApiException # import models into sdk package +from hubspot.marketing.events.models.app_info import AppInfo from hubspot.marketing.events.models.attendance_counters import AttendanceCounters from hubspot.marketing.events.models.batch_input_marketing_event_create_request_params import BatchInputMarketingEventCreateRequestParams from hubspot.marketing.events.models.batch_input_marketing_event_email_subscriber import BatchInputMarketingEventEmailSubscriber from hubspot.marketing.events.models.batch_input_marketing_event_external_unique_identifier import BatchInputMarketingEventExternalUniqueIdentifier +from hubspot.marketing.events.models.batch_input_marketing_event_public_object_id_delete_request import BatchInputMarketingEventPublicObjectIdDeleteRequest +from hubspot.marketing.events.models.batch_input_marketing_event_public_update_request_full_v2 import BatchInputMarketingEventPublicUpdateRequestFullV2 from hubspot.marketing.events.models.batch_input_marketing_event_subscriber import BatchInputMarketingEventSubscriber from hubspot.marketing.events.models.batch_response_marketing_event_public_default_response import BatchResponseMarketingEventPublicDefaultResponse +from hubspot.marketing.events.models.batch_response_marketing_event_public_default_response_v2 import BatchResponseMarketingEventPublicDefaultResponseV2 +from hubspot.marketing.events.models.batch_response_marketing_event_public_default_response_v2_with_errors import BatchResponseMarketingEventPublicDefaultResponseV2WithErrors from hubspot.marketing.events.models.batch_response_subscriber_email_response import BatchResponseSubscriberEmailResponse from hubspot.marketing.events.models.batch_response_subscriber_vid_response import BatchResponseSubscriberVidResponse -from hubspot.marketing.events.models.collection_response_marketing_event_external_unique_identifier_no_paging import CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging +from hubspot.marketing.events.models.collection_response_marketing_event_public_read_response_v2_forward_paging import CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging +from hubspot.marketing.events.models.collection_response_search_public_response_wrapper_no_paging import CollectionResponseSearchPublicResponseWrapperNoPaging +from hubspot.marketing.events.models.collection_response_with_total_marketing_event_identifiers_response_no_paging import CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging from hubspot.marketing.events.models.collection_response_with_total_participation_breakdown_forward_paging import CollectionResponseWithTotalParticipationBreakdownForwardPaging from hubspot.marketing.events.models.collection_response_with_total_public_list_no_paging import CollectionResponseWithTotalPublicListNoPaging from hubspot.marketing.events.models.contact_association import ContactAssociation +from hubspot.marketing.events.models.crm_property_wrapper import CrmPropertyWrapper from hubspot.marketing.events.models.error import Error from hubspot.marketing.events.models.error_detail import ErrorDetail from hubspot.marketing.events.models.event_detail_settings import EventDetailSettings @@ -58,8 +69,14 @@ from hubspot.marketing.events.models.marketing_event_default_response import MarketingEventDefaultResponse from hubspot.marketing.events.models.marketing_event_email_subscriber import MarketingEventEmailSubscriber from hubspot.marketing.events.models.marketing_event_external_unique_identifier import MarketingEventExternalUniqueIdentifier +from hubspot.marketing.events.models.marketing_event_identifiers_response import MarketingEventIdentifiersResponse from hubspot.marketing.events.models.marketing_event_public_default_response import MarketingEventPublicDefaultResponse +from hubspot.marketing.events.models.marketing_event_public_default_response_v2 import MarketingEventPublicDefaultResponseV2 +from hubspot.marketing.events.models.marketing_event_public_object_id_delete_request import MarketingEventPublicObjectIdDeleteRequest from hubspot.marketing.events.models.marketing_event_public_read_response import MarketingEventPublicReadResponse +from hubspot.marketing.events.models.marketing_event_public_read_response_v2 import MarketingEventPublicReadResponseV2 +from hubspot.marketing.events.models.marketing_event_public_update_request_full_v2 import MarketingEventPublicUpdateRequestFullV2 +from hubspot.marketing.events.models.marketing_event_public_update_request_v2 import MarketingEventPublicUpdateRequestV2 from hubspot.marketing.events.models.marketing_event_subscriber import MarketingEventSubscriber from hubspot.marketing.events.models.marketing_event_update_request_params import MarketingEventUpdateRequestParams from hubspot.marketing.events.models.next_page import NextPage @@ -68,6 +85,7 @@ from hubspot.marketing.events.models.participation_properties import ParticipationProperties from hubspot.marketing.events.models.property_value import PropertyValue from hubspot.marketing.events.models.public_list import PublicList +from hubspot.marketing.events.models.search_public_response_wrapper import SearchPublicResponseWrapper from hubspot.marketing.events.models.standard_error import StandardError from hubspot.marketing.events.models.subscriber_email_response import SubscriberEmailResponse from hubspot.marketing.events.models.subscriber_vid_response import SubscriberVidResponse diff --git a/hubspot/marketing/events/api/__init__.py b/hubspot/marketing/events/api/__init__.py index 262c723e..482f7fa6 100644 --- a/hubspot/marketing/events/api/__init__.py +++ b/hubspot/marketing/events/api/__init__.py @@ -3,9 +3,12 @@ # flake8: noqa # import apis into api package -from hubspot.marketing.events.api.attendance_subscriber_state_changes_api import AttendanceSubscriberStateChangesApi +from hubspot.marketing.events.api.add_event_attendees_api import AddEventAttendeesApi from hubspot.marketing.events.api.basic_api import BasicApi +from hubspot.marketing.events.api.batch_api import BatchApi +from hubspot.marketing.events.api.change_property_api import ChangePropertyApi +from hubspot.marketing.events.api.identifiers_api import IdentifiersApi from hubspot.marketing.events.api.list_associations_api import ListAssociationsApi -from hubspot.marketing.events.api.participant_state_api import ParticipantStateApi +from hubspot.marketing.events.api.retrieve_participant_state_api import RetrieveParticipantStateApi from hubspot.marketing.events.api.settings_api import SettingsApi from hubspot.marketing.events.api.subscriber_state_changes_api import SubscriberStateChangesApi diff --git a/hubspot/marketing/events/api/add_event_attendees_api.py b/hubspot/marketing/events/api/add_event_attendees_api.py new file mode 100644 index 00000000..65f00ab6 --- /dev/null +++ b/hubspot/marketing/events/api/add_event_attendees_api.py @@ -0,0 +1,630 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from hubspot.marketing.events.api_client import ApiClient +from hubspot.marketing.events.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class AddEventAttendeesApi(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 record_by_contact_emails(self, external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, **kwargs): # noqa: E501 + """Record Participants by Email with Marketing Event External Ids # noqa: E501 + + Records the participation of multiple HubSpot contacts in a Marketing Event using their email addresses. If a contact does not exist, it will be automatically created. The contactProperties field is used exclusively for creating new contacts and will not update properties of existing contacts. Additional Functionality: - Adds a timeline event to the contacts. Allowed Properties: For the state \"attend\": - joinedAt - leftAt # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.record_by_contact_emails(external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, async_req=True) + >>> result = thread.get() + + :param external_event_id: The id of the marketing event in the external event application (required) + :type external_event_id: str + :param subscriber_state: The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'. (required) + :type subscriber_state: str + :param batch_input_marketing_event_email_subscriber: (required) + :type batch_input_marketing_event_email_subscriber: BatchInputMarketingEventEmailSubscriber + :param external_account_id: The accountId that is associated with this marketing event in the external event application + :type external_account_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: BatchResponseSubscriberEmailResponse + """ + kwargs["_return_http_data_only"] = True + return self.record_by_contact_emails_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, **kwargs) # noqa: E501 + + def record_by_contact_emails_with_http_info(self, external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, **kwargs): # noqa: E501 + """Record Participants by Email with Marketing Event External Ids # noqa: E501 + + Records the participation of multiple HubSpot contacts in a Marketing Event using their email addresses. If a contact does not exist, it will be automatically created. The contactProperties field is used exclusively for creating new contacts and will not update properties of existing contacts. Additional Functionality: - Adds a timeline event to the contacts. Allowed Properties: For the state \"attend\": - joinedAt - leftAt # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.record_by_contact_emails_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, async_req=True) + >>> result = thread.get() + + :param external_event_id: The id of the marketing event in the external event application (required) + :type external_event_id: str + :param subscriber_state: The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'. (required) + :type subscriber_state: str + :param batch_input_marketing_event_email_subscriber: (required) + :type batch_input_marketing_event_email_subscriber: BatchInputMarketingEventEmailSubscriber + :param external_account_id: The accountId that is associated with this marketing event in the external event application + :type external_account_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BatchResponseSubscriberEmailResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["external_event_id", "subscriber_state", "batch_input_marketing_event_email_subscriber", "external_account_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 record_by_contact_emails" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'external_event_id' is set + if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `external_event_id` when calling `record_by_contact_emails`") # noqa: E501 + # verify the required parameter 'subscriber_state' is set + if self.api_client.client_side_validation and local_var_params.get("subscriber_state") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `subscriber_state` when calling `record_by_contact_emails`") # noqa: E501 + # verify the required parameter 'batch_input_marketing_event_email_subscriber' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_marketing_event_email_subscriber") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_marketing_event_email_subscriber` when calling `record_by_contact_emails`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "external_event_id" in local_var_params: + path_params["externalEventId"] = local_var_params["external_event_id"] # noqa: E501 + if "subscriber_state" in local_var_params: + path_params["subscriberState"] = local_var_params["subscriber_state"] # noqa: E501 + + query_params = [] + if local_var_params.get("external_account_id") is not None: # noqa: E501 + query_params.append(("externalAccountId", local_var_params["external_account_id"])) # noqa: E501 + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "batch_input_marketing_event_email_subscriber" in local_var_params: + body_params = local_var_params["batch_input_marketing_event_email_subscriber"] + # 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: "BatchResponseSubscriberEmailResponse", + } + + return self.api_client.call_api( + "/marketing/v3/marketing-events/attendance/{externalEventId}/{subscriberState}/email-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 record_by_contact_id(self, object_id, subscriber_state, batch_input_marketing_event_subscriber, **kwargs): # noqa: E501 + """Record Participants by ContactId with Marketing Event Object Id # noqa: E501 + + Records the participation of multiple HubSpot contacts in a Marketing Event using their HubSpot contact IDs. Additional Functionality: - Adds a timeline event to the contacts. Allowed Properties: For the state \"attend\": - joinedAt - leftAt # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.record_by_contact_id(object_id, subscriber_state, batch_input_marketing_event_subscriber, async_req=True) + >>> result = thread.get() + + :param object_id: The internal id of the marketing event in HubSpot (required) + :type object_id: str + :param subscriber_state: The attendance state value. It may be 'register', 'attend' or 'cancel' (required) + :type subscriber_state: str + :param batch_input_marketing_event_subscriber: (required) + :type batch_input_marketing_event_subscriber: BatchInputMarketingEventSubscriber + :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: BatchResponseSubscriberVidResponse + """ + kwargs["_return_http_data_only"] = True + return self.record_by_contact_id_with_http_info(object_id, subscriber_state, batch_input_marketing_event_subscriber, **kwargs) # noqa: E501 + + def record_by_contact_id_with_http_info(self, object_id, subscriber_state, batch_input_marketing_event_subscriber, **kwargs): # noqa: E501 + """Record Participants by ContactId with Marketing Event Object Id # noqa: E501 + + Records the participation of multiple HubSpot contacts in a Marketing Event using their HubSpot contact IDs. Additional Functionality: - Adds a timeline event to the contacts. Allowed Properties: For the state \"attend\": - joinedAt - leftAt # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.record_by_contact_id_with_http_info(object_id, subscriber_state, batch_input_marketing_event_subscriber, async_req=True) + >>> result = thread.get() + + :param object_id: The internal id of the marketing event in HubSpot (required) + :type object_id: str + :param subscriber_state: The attendance state value. It may be 'register', 'attend' or 'cancel' (required) + :type subscriber_state: str + :param batch_input_marketing_event_subscriber: (required) + :type batch_input_marketing_event_subscriber: BatchInputMarketingEventSubscriber + :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(BatchResponseSubscriberVidResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["object_id", "subscriber_state", "batch_input_marketing_event_subscriber"] + 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 record_by_contact_id" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'object_id' is set + if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `object_id` when calling `record_by_contact_id`") # noqa: E501 + # verify the required parameter 'subscriber_state' is set + if self.api_client.client_side_validation and local_var_params.get("subscriber_state") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `subscriber_state` when calling `record_by_contact_id`") # noqa: E501 + # verify the required parameter 'batch_input_marketing_event_subscriber' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_marketing_event_subscriber") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_marketing_event_subscriber` when calling `record_by_contact_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "object_id" in local_var_params: + path_params["objectId"] = local_var_params["object_id"] # noqa: E501 + if "subscriber_state" in local_var_params: + path_params["subscriberState"] = local_var_params["subscriber_state"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "batch_input_marketing_event_subscriber" in local_var_params: + body_params = local_var_params["batch_input_marketing_event_subscriber"] + # 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: "BatchResponseSubscriberVidResponse", + } + + return self.api_client.call_api( + "/marketing/v3/marketing-events/{objectId}/attendance/{subscriberState}/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 record_by_contact_ids(self, external_event_id, subscriber_state, batch_input_marketing_event_subscriber, **kwargs): # noqa: E501 + """Record Participants by ContactId with Marketing Event External Ids # noqa: E501 + + Records the participation of multiple HubSpot contacts in a Marketing Event using their HubSpot contact IDs. Additional Functionality: - Adds a timeline event to the contacts. Allowed Properties: For the state \"attend\": - joinedAt - leftAt # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.record_by_contact_ids(external_event_id, subscriber_state, batch_input_marketing_event_subscriber, async_req=True) + >>> result = thread.get() + + :param external_event_id: The id of the marketing event in the external event application (required) + :type external_event_id: str + :param subscriber_state: The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'. (required) + :type subscriber_state: str + :param batch_input_marketing_event_subscriber: (required) + :type batch_input_marketing_event_subscriber: BatchInputMarketingEventSubscriber + :param external_account_id: The accountId that is associated with this marketing event in the external event application + :type external_account_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: BatchResponseSubscriberVidResponse + """ + kwargs["_return_http_data_only"] = True + return self.record_by_contact_ids_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_subscriber, **kwargs) # noqa: E501 + + def record_by_contact_ids_with_http_info(self, external_event_id, subscriber_state, batch_input_marketing_event_subscriber, **kwargs): # noqa: E501 + """Record Participants by ContactId with Marketing Event External Ids # noqa: E501 + + Records the participation of multiple HubSpot contacts in a Marketing Event using their HubSpot contact IDs. Additional Functionality: - Adds a timeline event to the contacts. Allowed Properties: For the state \"attend\": - joinedAt - leftAt # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.record_by_contact_ids_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_subscriber, async_req=True) + >>> result = thread.get() + + :param external_event_id: The id of the marketing event in the external event application (required) + :type external_event_id: str + :param subscriber_state: The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'. (required) + :type subscriber_state: str + :param batch_input_marketing_event_subscriber: (required) + :type batch_input_marketing_event_subscriber: BatchInputMarketingEventSubscriber + :param external_account_id: The accountId that is associated with this marketing event in the external event application + :type external_account_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BatchResponseSubscriberVidResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["external_event_id", "subscriber_state", "batch_input_marketing_event_subscriber", "external_account_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 record_by_contact_ids" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'external_event_id' is set + if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `external_event_id` when calling `record_by_contact_ids`") # noqa: E501 + # verify the required parameter 'subscriber_state' is set + if self.api_client.client_side_validation and local_var_params.get("subscriber_state") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `subscriber_state` when calling `record_by_contact_ids`") # noqa: E501 + # verify the required parameter 'batch_input_marketing_event_subscriber' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_marketing_event_subscriber") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_marketing_event_subscriber` when calling `record_by_contact_ids`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "external_event_id" in local_var_params: + path_params["externalEventId"] = local_var_params["external_event_id"] # noqa: E501 + if "subscriber_state" in local_var_params: + path_params["subscriberState"] = local_var_params["subscriber_state"] # noqa: E501 + + query_params = [] + if local_var_params.get("external_account_id") is not None: # noqa: E501 + query_params.append(("externalAccountId", local_var_params["external_account_id"])) # noqa: E501 + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "batch_input_marketing_event_subscriber" in local_var_params: + body_params = local_var_params["batch_input_marketing_event_subscriber"] + # 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: "BatchResponseSubscriberVidResponse", + } + + return self.api_client.call_api( + "/marketing/v3/marketing-events/attendance/{externalEventId}/{subscriberState}/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 record_by_email(self, object_id, subscriber_state, batch_input_marketing_event_email_subscriber, **kwargs): # noqa: E501 + """Record Participants by Email with Marketing Event Object Id # noqa: E501 + + Records the participation of multiple HubSpot contacts in a Marketing Event using their email addresses. If a contact does not exist, it will be automatically created. The contactProperties field is used exclusively for creating new contacts and will not update properties of existing contacts. Additional Functionality: - Adds a timeline event to the contacts. Allowed Properties: For the state \"attend\": - joinedAt - leftAt # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.record_by_email(object_id, subscriber_state, batch_input_marketing_event_email_subscriber, async_req=True) + >>> result = thread.get() + + :param object_id: The internal ID of the marketing event in HubSpot (required) + :type object_id: str + :param subscriber_state: The attendance state value. It may be 'register', 'attend' or 'cancel' (required) + :type subscriber_state: str + :param batch_input_marketing_event_email_subscriber: (required) + :type batch_input_marketing_event_email_subscriber: BatchInputMarketingEventEmailSubscriber + :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: BatchResponseSubscriberEmailResponse + """ + kwargs["_return_http_data_only"] = True + return self.record_by_email_with_http_info(object_id, subscriber_state, batch_input_marketing_event_email_subscriber, **kwargs) # noqa: E501 + + def record_by_email_with_http_info(self, object_id, subscriber_state, batch_input_marketing_event_email_subscriber, **kwargs): # noqa: E501 + """Record Participants by Email with Marketing Event Object Id # noqa: E501 + + Records the participation of multiple HubSpot contacts in a Marketing Event using their email addresses. If a contact does not exist, it will be automatically created. The contactProperties field is used exclusively for creating new contacts and will not update properties of existing contacts. Additional Functionality: - Adds a timeline event to the contacts. Allowed Properties: For the state \"attend\": - joinedAt - leftAt # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.record_by_email_with_http_info(object_id, subscriber_state, batch_input_marketing_event_email_subscriber, async_req=True) + >>> result = thread.get() + + :param object_id: The internal ID of the marketing event in HubSpot (required) + :type object_id: str + :param subscriber_state: The attendance state value. It may be 'register', 'attend' or 'cancel' (required) + :type subscriber_state: str + :param batch_input_marketing_event_email_subscriber: (required) + :type batch_input_marketing_event_email_subscriber: BatchInputMarketingEventEmailSubscriber + :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(BatchResponseSubscriberEmailResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["object_id", "subscriber_state", "batch_input_marketing_event_email_subscriber"] + 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 record_by_email" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'object_id' is set + if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `object_id` when calling `record_by_email`") # noqa: E501 + # verify the required parameter 'subscriber_state' is set + if self.api_client.client_side_validation and local_var_params.get("subscriber_state") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `subscriber_state` when calling `record_by_email`") # noqa: E501 + # verify the required parameter 'batch_input_marketing_event_email_subscriber' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_marketing_event_email_subscriber") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_marketing_event_email_subscriber` when calling `record_by_email`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "object_id" in local_var_params: + path_params["objectId"] = local_var_params["object_id"] # noqa: E501 + if "subscriber_state" in local_var_params: + path_params["subscriberState"] = local_var_params["subscriber_state"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "batch_input_marketing_event_email_subscriber" in local_var_params: + body_params = local_var_params["batch_input_marketing_event_email_subscriber"] + # 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: "BatchResponseSubscriberEmailResponse", + } + + return self.api_client.call_api( + "/marketing/v3/marketing-events/{objectId}/attendance/{subscriberState}/email-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"), + ) diff --git a/hubspot/marketing/events/api/basic_api.py b/hubspot/marketing/events/api/basic_api.py index d5930a12..c59d4579 100644 --- a/hubspot/marketing/events/api/basic_api.py +++ b/hubspot/marketing/events/api/basic_api.py @@ -34,18 +34,18 @@ def __init__(self, api_client=None): self.api_client = api_client def archive(self, external_event_id, external_account_id, **kwargs): # noqa: E501 - """Delete a marketing event # noqa: E501 + """Delete Marketing Event by External Ids # noqa: E501 - Deletes an existing Marketing Event with the specified id, if one exists. # noqa: E501 + Deletes the existing Marketing Event with the specified externalAccountId, externalEventId, if it exists. Only Marketing Events created by the same app can be deleted. # 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(external_event_id, external_account_id, async_req=True) >>> result = thread.get() - :param external_event_id: The id of the marketing event to delete (required) + :param external_event_id: The id of the marketing event in the external event application (required) :type external_event_id: str - :param external_account_id: The account id associated with the marketing event (required) + :param external_account_id: The accountId that is associated with this marketing event in the external event application (required) :type external_account_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -66,18 +66,18 @@ def archive(self, external_event_id, external_account_id, **kwargs): # noqa: E5 return self.archive_with_http_info(external_event_id, external_account_id, **kwargs) # noqa: E501 def archive_with_http_info(self, external_event_id, external_account_id, **kwargs): # noqa: E501 - """Delete a marketing event # noqa: E501 + """Delete Marketing Event by External Ids # noqa: E501 - Deletes an existing Marketing Event with the specified id, if one exists. # noqa: E501 + Deletes the existing Marketing Event with the specified externalAccountId, externalEventId, if it exists. Only Marketing Events created by the same app can be deleted. # 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(external_event_id, external_account_id, async_req=True) >>> result = thread.get() - :param external_event_id: The id of the marketing event to delete (required) + :param external_event_id: The id of the marketing event in the external event application (required) :type external_event_id: str - :param external_account_id: The account id associated with the marketing event (required) + :param external_account_id: The accountId that is associated with this marketing event in the external event application (required) :type external_account_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -163,18 +163,18 @@ def archive_with_http_info(self, external_event_id, external_account_id, **kwarg _request_auth=local_var_params.get("_request_auth"), ) - def batch_archive(self, batch_input_marketing_event_external_unique_identifier, **kwargs): # noqa: E501 - """Delete multiple marketing events # noqa: E501 + def archive_by_object_id(self, object_id, **kwargs): # noqa: E501 + """Delete Marketing Event by objectId # noqa: E501 - Bulk delete a number of marketing events in HubSpot # noqa: E501 + Deletes the existing Marketing Event with the specified objectId, if it exists. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.batch_archive(batch_input_marketing_event_external_unique_identifier, async_req=True) + >>> thread = api.archive_by_object_id(object_id, async_req=True) >>> result = thread.get() - :param batch_input_marketing_event_external_unique_identifier: (required) - :type batch_input_marketing_event_external_unique_identifier: BatchInputMarketingEventExternalUniqueIdentifier + :param object_id: The internal ID of the marketing event in HubSpot (required) + :type object_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 @@ -188,23 +188,23 @@ def batch_archive(self, batch_input_marketing_event_external_unique_identifier, :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: Error + :rtype: None """ kwargs["_return_http_data_only"] = True - return self.batch_archive_with_http_info(batch_input_marketing_event_external_unique_identifier, **kwargs) # noqa: E501 + return self.archive_by_object_id_with_http_info(object_id, **kwargs) # noqa: E501 - def batch_archive_with_http_info(self, batch_input_marketing_event_external_unique_identifier, **kwargs): # noqa: E501 - """Delete multiple marketing events # noqa: E501 + def archive_by_object_id_with_http_info(self, object_id, **kwargs): # noqa: E501 + """Delete Marketing Event by objectId # noqa: E501 - Bulk delete a number of marketing events in HubSpot # noqa: E501 + Deletes the existing Marketing Event with the specified objectId, if it exists. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.batch_archive_with_http_info(batch_input_marketing_event_external_unique_identifier, async_req=True) + >>> thread = api.archive_by_object_id_with_http_info(object_id, async_req=True) >>> result = thread.get() - :param batch_input_marketing_event_external_unique_identifier: (required) - :type batch_input_marketing_event_external_unique_identifier: BatchInputMarketingEventExternalUniqueIdentifier + :param object_id: The internal ID of the marketing event in HubSpot (required) + :type object_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 @@ -226,26 +226,28 @@ def batch_archive_with_http_info(self, batch_input_marketing_event_external_uniq :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(Error, status_code(int), headers(HTTPHeaderDict)) + :rtype: None """ local_var_params = locals() - all_params = ["batch_input_marketing_event_external_unique_identifier"] + all_params = ["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 batch_archive" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method archive_by_object_id" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'batch_input_marketing_event_external_unique_identifier' is set - if self.api_client.client_side_validation and local_var_params.get("batch_input_marketing_event_external_unique_identifier") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `batch_input_marketing_event_external_unique_identifier` when calling `batch_archive`") # noqa: E501 + # verify the required parameter 'object_id' is set + if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `object_id` when calling `archive_by_object_id`") # noqa: E501 collection_formats = {} path_params = {} + if "object_id" in local_var_params: + path_params["objectId"] = local_var_params["object_id"] # noqa: E501 query_params = [] @@ -255,24 +257,17 @@ def batch_archive_with_http_info(self, batch_input_marketing_event_external_uniq local_var_files = {} body_params = None - if "batch_input_marketing_event_external_unique_identifier" in local_var_params: - body_params = local_var_params["batch_input_marketing_event_external_unique_identifier"] # 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( - "/marketing/v3/marketing-events/events/delete", - "POST", + "/marketing/v3/marketing-events/{objectId}", + "DELETE", path_params, query_params, header_params, @@ -289,18 +284,18 @@ def batch_archive_with_http_info(self, batch_input_marketing_event_external_uniq _request_auth=local_var_params.get("_request_auth"), ) - def batch_upsert(self, batch_input_marketing_event_create_request_params, **kwargs): # noqa: E501 - """Create or update multiple marketing events # noqa: E501 + def create(self, marketing_event_create_request_params, **kwargs): # noqa: E501 + """Create a marketing event # noqa: E501 - Upsert multiple marketing events. If there is an existing Marketing event with the specified ID, it will be updated; otherwise a new event will be created. # noqa: E501 + Creates a new marketing event in HubSpot # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.batch_upsert(batch_input_marketing_event_create_request_params, async_req=True) + >>> thread = api.create(marketing_event_create_request_params, async_req=True) >>> result = thread.get() - :param batch_input_marketing_event_create_request_params: (required) - :type batch_input_marketing_event_create_request_params: BatchInputMarketingEventCreateRequestParams + :param marketing_event_create_request_params: (required) + :type marketing_event_create_request_params: MarketingEventCreateRequestParams :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -314,23 +309,23 @@ def batch_upsert(self, batch_input_marketing_event_create_request_params, **kwar :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: BatchResponseMarketingEventPublicDefaultResponse + :rtype: MarketingEventDefaultResponse """ kwargs["_return_http_data_only"] = True - return self.batch_upsert_with_http_info(batch_input_marketing_event_create_request_params, **kwargs) # noqa: E501 + return self.create_with_http_info(marketing_event_create_request_params, **kwargs) # noqa: E501 - def batch_upsert_with_http_info(self, batch_input_marketing_event_create_request_params, **kwargs): # noqa: E501 - """Create or update multiple marketing events # noqa: E501 + def create_with_http_info(self, marketing_event_create_request_params, **kwargs): # noqa: E501 + """Create a marketing event # noqa: E501 - Upsert multiple marketing events. If there is an existing Marketing event with the specified ID, it will be updated; otherwise a new event will be created. # noqa: E501 + Creates a new marketing event in HubSpot # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.batch_upsert_with_http_info(batch_input_marketing_event_create_request_params, async_req=True) + >>> thread = api.create_with_http_info(marketing_event_create_request_params, async_req=True) >>> result = thread.get() - :param batch_input_marketing_event_create_request_params: (required) - :type batch_input_marketing_event_create_request_params: BatchInputMarketingEventCreateRequestParams + :param marketing_event_create_request_params: (required) + :type marketing_event_create_request_params: MarketingEventCreateRequestParams :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 @@ -352,22 +347,22 @@ def batch_upsert_with_http_info(self, batch_input_marketing_event_create_request :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(BatchResponseMarketingEventPublicDefaultResponse, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(MarketingEventDefaultResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["batch_input_marketing_event_create_request_params"] + all_params = ["marketing_event_create_request_params"] all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: - raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method batch_upsert" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method create" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'batch_input_marketing_event_create_request_params' is set - if self.api_client.client_side_validation and local_var_params.get("batch_input_marketing_event_create_request_params") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `batch_input_marketing_event_create_request_params` when calling `batch_upsert`") # noqa: E501 + # verify the required parameter 'marketing_event_create_request_params' is set + if self.api_client.client_side_validation and local_var_params.get("marketing_event_create_request_params") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `marketing_event_create_request_params` when calling `create`") # noqa: E501 collection_formats = {} @@ -381,8 +376,8 @@ def batch_upsert_with_http_info(self, batch_input_marketing_event_create_request local_var_files = {} body_params = None - if "batch_input_marketing_event_create_request_params" in local_var_params: - body_params = local_var_params["batch_input_marketing_event_create_request_params"] + if "marketing_event_create_request_params" in local_var_params: + body_params = local_var_params["marketing_event_create_request_params"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -394,144 +389,12 @@ def batch_upsert_with_http_info(self, batch_input_marketing_event_create_request # Authentication setting auth_settings = ["oauth2"] # noqa: E501 - response_types_map = { - 200: "BatchResponseMarketingEventPublicDefaultResponse", - } - - return self.api_client.call_api( - "/marketing/v3/marketing-events/events/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"), - ) - - def cancel(self, external_event_id, external_account_id, **kwargs): # noqa: E501 - """Mark a marketing event as cancelled # noqa: E501 - - Mark a marketing event as cancelled. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.cancel(external_event_id, external_account_id, async_req=True) - >>> result = thread.get() - - :param external_event_id: The id of the marketing event to mark as cancelled (required) - :type external_event_id: str - :param external_account_id: The account id associated with the marketing event (required) - :type external_account_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: MarketingEventDefaultResponse - """ - kwargs["_return_http_data_only"] = True - return self.cancel_with_http_info(external_event_id, external_account_id, **kwargs) # noqa: E501 - - def cancel_with_http_info(self, external_event_id, external_account_id, **kwargs): # noqa: E501 - """Mark a marketing event as cancelled # noqa: E501 - - Mark a marketing event as cancelled. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.cancel_with_http_info(external_event_id, external_account_id, async_req=True) - >>> result = thread.get() - - :param external_event_id: The id of the marketing event to mark as cancelled (required) - :type external_event_id: str - :param external_account_id: The account id associated with the marketing event (required) - :type external_account_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(MarketingEventDefaultResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = ["external_event_id", "external_account_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 cancel" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'external_event_id' is set - if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `external_event_id` when calling `cancel`") # noqa: E501 - # verify the required parameter 'external_account_id' is set - if self.api_client.client_side_validation and local_var_params.get("external_account_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `external_account_id` when calling `cancel`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if "external_event_id" in local_var_params: - path_params["externalEventId"] = local_var_params["external_event_id"] # noqa: E501 - - query_params = [] - if local_var_params.get("external_account_id") is not None: # noqa: E501 - query_params.append(("externalAccountId", local_var_params["external_account_id"])) # 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: "MarketingEventDefaultResponse", } return self.api_client.call_api( - "/marketing/v3/marketing-events/events/{externalEventId}/cancel", + "/marketing/v3/marketing-events/events", "POST", path_params, query_params, @@ -549,22 +412,20 @@ def cancel_with_http_info(self, external_event_id, external_account_id, **kwargs _request_auth=local_var_params.get("_request_auth"), ) - def complete(self, external_event_id, external_account_id, marketing_event_complete_request_params, **kwargs): # noqa: E501 - """Mark a marketing event as completed # noqa: E501 + def get_all(self, **kwargs): # noqa: E501 + """Get all marketing event # noqa: E501 - Mark a marketing event as completed # noqa: E501 + Returns all Marketing Events available on the portal, along with their properties, regardless of whether they were created manually or through the application. The marketing events returned by this endpoint are sorted by objectId. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.complete(external_event_id, external_account_id, marketing_event_complete_request_params, async_req=True) + >>> thread = api.get_all(async_req=True) >>> result = thread.get() - :param external_event_id: The id of the marketing event in the external event application. (required) - :type external_event_id: str - :param external_account_id: The accountId that is associated with this marketing event in the external event application. (required) - :type external_account_id: str - :param marketing_event_complete_request_params: (required) - :type marketing_event_complete_request_params: MarketingEventCompleteRequestParams + :param after: The cursor indicating the position of the last retrieved item. + :type after: str + :param limit: The limit for response size. The default value is 10, the max number is 100 + :type limit: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -578,27 +439,25 @@ def complete(self, external_event_id, external_account_id, marketing_event_compl :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: MarketingEventDefaultResponse + :rtype: CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging """ kwargs["_return_http_data_only"] = True - return self.complete_with_http_info(external_event_id, external_account_id, marketing_event_complete_request_params, **kwargs) # noqa: E501 + return self.get_all_with_http_info(**kwargs) # noqa: E501 - def complete_with_http_info(self, external_event_id, external_account_id, marketing_event_complete_request_params, **kwargs): # noqa: E501 - """Mark a marketing event as completed # noqa: E501 + def get_all_with_http_info(self, **kwargs): # noqa: E501 + """Get all marketing event # noqa: E501 - Mark a marketing event as completed # noqa: E501 + Returns all Marketing Events available on the portal, along with their properties, regardless of whether they were created manually or through the application. The marketing events returned by this endpoint are sorted by objectId. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.complete_with_http_info(external_event_id, external_account_id, marketing_event_complete_request_params, async_req=True) + >>> thread = api.get_all_with_http_info(async_req=True) >>> result = thread.get() - :param external_event_id: The id of the marketing event in the external event application. (required) - :type external_event_id: str - :param external_account_id: The accountId that is associated with this marketing event in the external event application. (required) - :type external_account_id: str - :param marketing_event_complete_request_params: (required) - :type marketing_event_complete_request_params: MarketingEventCompleteRequestParams + :param after: The cursor indicating the position of the last retrieved item. + :type after: str + :param limit: The limit for response size. The default value is 10, the max number is 100 + :type limit: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -620,38 +479,29 @@ def complete_with_http_info(self, external_event_id, external_account_id, market :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(MarketingEventDefaultResponse, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["external_event_id", "external_account_id", "marketing_event_complete_request_params"] + all_params = ["after", "limit"] 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 complete" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_all" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'external_event_id' is set - if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `external_event_id` when calling `complete`") # noqa: E501 - # verify the required parameter 'external_account_id' is set - if self.api_client.client_side_validation and local_var_params.get("external_account_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `external_account_id` when calling `complete`") # noqa: E501 - # verify the required parameter 'marketing_event_complete_request_params' is set - if self.api_client.client_side_validation and local_var_params.get("marketing_event_complete_request_params") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `marketing_event_complete_request_params` when calling `complete`") # noqa: E501 collection_formats = {} path_params = {} - if "external_event_id" in local_var_params: - path_params["externalEventId"] = local_var_params["external_event_id"] # noqa: E501 query_params = [] - if local_var_params.get("external_account_id") is not None: # noqa: E501 - query_params.append(("externalAccountId", local_var_params["external_account_id"])) # 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("limit") is not None: # noqa: E501 + query_params.append(("limit", local_var_params["limit"])) # noqa: E501 header_params = dict(local_var_params.get("_headers", {})) @@ -659,26 +509,19 @@ def complete_with_http_info(self, external_event_id, external_account_id, market local_var_files = {} body_params = None - if "marketing_event_complete_request_params" in local_var_params: - body_params = local_var_params["marketing_event_complete_request_params"] # 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: "MarketingEventDefaultResponse", + 200: "CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging", } return self.api_client.call_api( - "/marketing/v3/marketing-events/events/{externalEventId}/complete", - "POST", + "/marketing/v3/marketing-events/", + "GET", path_params, query_params, header_params, @@ -695,18 +538,18 @@ def complete_with_http_info(self, external_event_id, external_account_id, market _request_auth=local_var_params.get("_request_auth"), ) - def create(self, marketing_event_create_request_params, **kwargs): # noqa: E501 - """Create a marketing event # noqa: E501 + def get_by_object_id(self, object_id, **kwargs): # noqa: E501 + """Get Marketing Event by objectId # noqa: E501 - Creates a new marketing event in HubSpot # noqa: E501 + Returns the details of a Marketing Event with the specified objectId, if it exists. # 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(marketing_event_create_request_params, async_req=True) + >>> thread = api.get_by_object_id(object_id, async_req=True) >>> result = thread.get() - :param marketing_event_create_request_params: (required) - :type marketing_event_create_request_params: MarketingEventCreateRequestParams + :param object_id: The internal ID of the marketing event in HubSpot (required) + :type object_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 @@ -720,23 +563,23 @@ def create(self, marketing_event_create_request_params, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: MarketingEventDefaultResponse + :rtype: MarketingEventPublicReadResponseV2 """ kwargs["_return_http_data_only"] = True - return self.create_with_http_info(marketing_event_create_request_params, **kwargs) # noqa: E501 + return self.get_by_object_id_with_http_info(object_id, **kwargs) # noqa: E501 - def create_with_http_info(self, marketing_event_create_request_params, **kwargs): # noqa: E501 - """Create a marketing event # noqa: E501 + def get_by_object_id_with_http_info(self, object_id, **kwargs): # noqa: E501 + """Get Marketing Event by objectId # noqa: E501 - Creates a new marketing event in HubSpot # noqa: E501 + Returns the details of a Marketing Event with the specified objectId, if it exists. # 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(marketing_event_create_request_params, async_req=True) + >>> thread = api.get_by_object_id_with_http_info(object_id, async_req=True) >>> result = thread.get() - :param marketing_event_create_request_params: (required) - :type marketing_event_create_request_params: MarketingEventCreateRequestParams + :param object_id: The internal ID of the marketing event in HubSpot (required) + :type object_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 @@ -758,26 +601,28 @@ def create_with_http_info(self, marketing_event_create_request_params, **kwargs) :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(MarketingEventDefaultResponse, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(MarketingEventPublicReadResponseV2, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["marketing_event_create_request_params"] + all_params = ["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 create" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_by_object_id" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'marketing_event_create_request_params' is set - if self.api_client.client_side_validation and local_var_params.get("marketing_event_create_request_params") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `marketing_event_create_request_params` when calling `create`") # noqa: E501 + # verify the required parameter 'object_id' is set + if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `object_id` when calling `get_by_object_id`") # noqa: E501 collection_formats = {} path_params = {} + if "object_id" in local_var_params: + path_params["objectId"] = local_var_params["object_id"] # noqa: E501 query_params = [] @@ -787,26 +632,19 @@ def create_with_http_info(self, marketing_event_create_request_params, **kwargs) local_var_files = {} body_params = None - if "marketing_event_create_request_params" in local_var_params: - body_params = local_var_params["marketing_event_create_request_params"] # 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: "MarketingEventDefaultResponse", + 200: "MarketingEventPublicReadResponseV2", } return self.api_client.call_api( - "/marketing/v3/marketing-events/events", - "POST", + "/marketing/v3/marketing-events/{objectId}", + "GET", path_params, query_params, header_params, @@ -823,18 +661,20 @@ def create_with_http_info(self, marketing_event_create_request_params, **kwargs) _request_auth=local_var_params.get("_request_auth"), ) - def do_search(self, q, **kwargs): # noqa: E501 - """Search for marketing events # noqa: E501 + def get_details(self, external_event_id, external_account_id, **kwargs): # noqa: E501 + """Get Marketing Event by External IDs # noqa: E501 - Search for marketing events that have an event id that starts with the query string # noqa: E501 + Returns the details of a Marketing Event with the specified externalAccountId, externalEventId, if it exists. Only Marketing Events created by the same app making the request can be retrieved. # 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(q, async_req=True) + >>> thread = api.get_details(external_event_id, external_account_id, async_req=True) >>> result = thread.get() - :param q: The id of the marketing event in the external event application (required) - :type q: str + :param external_event_id: The id of the marketing event in the external event application (required) + :type external_event_id: str + :param external_account_id: The accountId that is associated with this marketing event in the external event application (required) + :type external_account_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -848,23 +688,25 @@ def do_search(self, q, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging + :rtype: MarketingEventPublicReadResponse """ kwargs["_return_http_data_only"] = True - return self.do_search_with_http_info(q, **kwargs) # noqa: E501 + return self.get_details_with_http_info(external_event_id, external_account_id, **kwargs) # noqa: E501 - def do_search_with_http_info(self, q, **kwargs): # noqa: E501 - """Search for marketing events # noqa: E501 + def get_details_with_http_info(self, external_event_id, external_account_id, **kwargs): # noqa: E501 + """Get Marketing Event by External IDs # noqa: E501 - Search for marketing events that have an event id that starts with the query string # noqa: E501 + Returns the details of a Marketing Event with the specified externalAccountId, externalEventId, if it exists. Only Marketing Events created by the same app making the request can be retrieved. # 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(q, async_req=True) + >>> thread = api.get_details_with_http_info(external_event_id, external_account_id, async_req=True) >>> result = thread.get() - :param q: The id of the marketing event in the external event application (required) - :type q: str + :param external_event_id: The id of the marketing event in the external event application (required) + :type external_event_id: str + :param external_account_id: The accountId that is associated with this marketing event in the external event application (required) + :type external_account_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -886,30 +728,35 @@ def do_search_with_http_info(self, q, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(MarketingEventPublicReadResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["q"] + all_params = ["external_event_id", "external_account_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 do_search" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_details" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'q' is set - if self.api_client.client_side_validation and local_var_params.get("q") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `q` when calling `do_search`") # noqa: E501 + # verify the required parameter 'external_event_id' is set + if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `external_event_id` when calling `get_details`") # noqa: E501 + # verify the required parameter 'external_account_id' is set + if self.api_client.client_side_validation and local_var_params.get("external_account_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `external_account_id` when calling `get_details`") # noqa: E501 collection_formats = {} path_params = {} + if "external_event_id" in local_var_params: + path_params["externalEventId"] = local_var_params["external_event_id"] # noqa: E501 query_params = [] - if local_var_params.get("q") is not None: # noqa: E501 - query_params.append(("q", local_var_params["q"])) # noqa: E501 + if local_var_params.get("external_account_id") is not None: # noqa: E501 + query_params.append(("externalAccountId", local_var_params["external_account_id"])) # noqa: E501 header_params = dict(local_var_params.get("_headers", {})) @@ -924,11 +771,11 @@ def do_search_with_http_info(self, q, **kwargs): # noqa: E501 auth_settings = ["oauth2"] # noqa: E501 response_types_map = { - 200: "CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging", + 200: "MarketingEventPublicReadResponse", } return self.api_client.call_api( - "/marketing/v3/marketing-events/events/search", + "/marketing/v3/marketing-events/events/{externalEventId}", "GET", path_params, query_params, @@ -946,20 +793,22 @@ def do_search_with_http_info(self, q, **kwargs): # noqa: E501 _request_auth=local_var_params.get("_request_auth"), ) - def get_details(self, external_event_id, external_account_id, **kwargs): # noqa: E501 - """Get a marketing event # noqa: E501 + def update(self, external_event_id, external_account_id, marketing_event_update_request_params, **kwargs): # noqa: E501 + """Update Marketing Event by External IDs # noqa: E501 - Returns the details of the Marketing Event with the specified id, if one exists. # noqa: E501 + Updates the details of an existing Marketing Event identified by its externalAccountId, externalEventId if it exists. Only Marketing Events created by the same app can be updated. # 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_details(external_event_id, external_account_id, async_req=True) + >>> thread = api.update(external_event_id, external_account_id, marketing_event_update_request_params, async_req=True) >>> result = thread.get() - :param external_event_id: The id of the marketing event to return (required) + :param external_event_id: The id of the marketing event in the external event application (required) :type external_event_id: str - :param external_account_id: The account id associated with the marketing event (required) + :param external_account_id: The accountId that is associated with this marketing event in the external event application (required) :type external_account_id: str + :param marketing_event_update_request_params: (required) + :type marketing_event_update_request_params: MarketingEventUpdateRequestParams :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -973,25 +822,27 @@ def get_details(self, external_event_id, external_account_id, **kwargs): # noqa :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: MarketingEventPublicReadResponse + :rtype: MarketingEventPublicDefaultResponse """ kwargs["_return_http_data_only"] = True - return self.get_details_with_http_info(external_event_id, external_account_id, **kwargs) # noqa: E501 + return self.update_with_http_info(external_event_id, external_account_id, marketing_event_update_request_params, **kwargs) # noqa: E501 - def get_details_with_http_info(self, external_event_id, external_account_id, **kwargs): # noqa: E501 - """Get a marketing event # noqa: E501 + def update_with_http_info(self, external_event_id, external_account_id, marketing_event_update_request_params, **kwargs): # noqa: E501 + """Update Marketing Event by External IDs # noqa: E501 - Returns the details of the Marketing Event with the specified id, if one exists. # noqa: E501 + Updates the details of an existing Marketing Event identified by its externalAccountId, externalEventId if it exists. Only Marketing Events created by the same app can be updated. # 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_details_with_http_info(external_event_id, external_account_id, async_req=True) + >>> thread = api.update_with_http_info(external_event_id, external_account_id, marketing_event_update_request_params, async_req=True) >>> result = thread.get() - :param external_event_id: The id of the marketing event to return (required) + :param external_event_id: The id of the marketing event in the external event application (required) :type external_event_id: str - :param external_account_id: The account id associated with the marketing event (required) + :param external_account_id: The accountId that is associated with this marketing event in the external event application (required) :type external_account_id: str + :param marketing_event_update_request_params: (required) + :type marketing_event_update_request_params: MarketingEventUpdateRequestParams :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 @@ -1013,25 +864,28 @@ def get_details_with_http_info(self, external_event_id, external_account_id, **k :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(MarketingEventPublicReadResponse, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(MarketingEventPublicDefaultResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["external_event_id", "external_account_id"] + all_params = ["external_event_id", "external_account_id", "marketing_event_update_request_params"] all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: - raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_details" % key) + 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 'external_event_id' is set if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `external_event_id` when calling `get_details`") # noqa: E501 + raise ApiValueError("Missing the required parameter `external_event_id` when calling `update`") # noqa: E501 # verify the required parameter 'external_account_id' is set if self.api_client.client_side_validation and local_var_params.get("external_account_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `external_account_id` when calling `get_details`") # noqa: E501 + raise ApiValueError("Missing the required parameter `external_account_id` when calling `update`") # noqa: E501 + # verify the required parameter 'marketing_event_update_request_params' is set + if self.api_client.client_side_validation and local_var_params.get("marketing_event_update_request_params") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `marketing_event_update_request_params` when calling `update`") # noqa: E501 collection_formats = {} @@ -1049,19 +903,26 @@ def get_details_with_http_info(self, external_event_id, external_account_id, **k local_var_files = {} body_params = None + if "marketing_event_update_request_params" in local_var_params: + body_params = local_var_params["marketing_event_update_request_params"] # 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: "MarketingEventPublicReadResponse", + 200: "MarketingEventPublicDefaultResponse", } return self.api_client.call_api( "/marketing/v3/marketing-events/events/{externalEventId}", - "GET", + "PATCH", path_params, query_params, header_params, @@ -1078,22 +939,20 @@ def get_details_with_http_info(self, external_event_id, external_account_id, **k _request_auth=local_var_params.get("_request_auth"), ) - def update(self, external_event_id, external_account_id, marketing_event_update_request_params, **kwargs): # noqa: E501 - """Update a marketing event # noqa: E501 + def update_by_object_id(self, object_id, marketing_event_public_update_request_v2, **kwargs): # noqa: E501 + """Update Marketing Event by objectId # noqa: E501 - Updates an existing Marketing Event with the specified id, if one exists. # noqa: E501 + Updates the details of an existing Marketing Event identified by its objectId, if it exists. # 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(external_event_id, external_account_id, marketing_event_update_request_params, async_req=True) + >>> thread = api.update_by_object_id(object_id, marketing_event_public_update_request_v2, async_req=True) >>> result = thread.get() - :param external_event_id: The id of the marketing event to update (required) - :type external_event_id: str - :param external_account_id: The account id associated with the marketing event (required) - :type external_account_id: str - :param marketing_event_update_request_params: (required) - :type marketing_event_update_request_params: MarketingEventUpdateRequestParams + :param object_id: The internal ID of the marketing event in HubSpot (required) + :type object_id: str + :param marketing_event_public_update_request_v2: (required) + :type marketing_event_public_update_request_v2: MarketingEventPublicUpdateRequestV2 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1107,27 +966,25 @@ def update(self, external_event_id, external_account_id, marketing_event_update_ :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: MarketingEventPublicDefaultResponse + :rtype: MarketingEventPublicDefaultResponseV2 """ kwargs["_return_http_data_only"] = True - return self.update_with_http_info(external_event_id, external_account_id, marketing_event_update_request_params, **kwargs) # noqa: E501 + return self.update_by_object_id_with_http_info(object_id, marketing_event_public_update_request_v2, **kwargs) # noqa: E501 - def update_with_http_info(self, external_event_id, external_account_id, marketing_event_update_request_params, **kwargs): # noqa: E501 - """Update a marketing event # noqa: E501 + def update_by_object_id_with_http_info(self, object_id, marketing_event_public_update_request_v2, **kwargs): # noqa: E501 + """Update Marketing Event by objectId # noqa: E501 - Updates an existing Marketing Event with the specified id, if one exists. # noqa: E501 + Updates the details of an existing Marketing Event identified by its objectId, if it exists. # 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(external_event_id, external_account_id, marketing_event_update_request_params, async_req=True) + >>> thread = api.update_by_object_id_with_http_info(object_id, marketing_event_public_update_request_v2, async_req=True) >>> result = thread.get() - :param external_event_id: The id of the marketing event to update (required) - :type external_event_id: str - :param external_account_id: The account id associated with the marketing event (required) - :type external_account_id: str - :param marketing_event_update_request_params: (required) - :type marketing_event_update_request_params: MarketingEventUpdateRequestParams + :param object_id: The internal ID of the marketing event in HubSpot (required) + :type object_id: str + :param marketing_event_public_update_request_v2: (required) + :type marketing_event_public_update_request_v2: MarketingEventPublicUpdateRequestV2 :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 @@ -1149,38 +1006,33 @@ def update_with_http_info(self, external_event_id, external_account_id, marketin :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(MarketingEventPublicDefaultResponse, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(MarketingEventPublicDefaultResponseV2, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["external_event_id", "external_account_id", "marketing_event_update_request_params"] + all_params = ["object_id", "marketing_event_public_update_request_v2"] 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) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method update_by_object_id" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'external_event_id' is set - if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `external_event_id` when calling `update`") # noqa: E501 - # verify the required parameter 'external_account_id' is set - if self.api_client.client_side_validation and local_var_params.get("external_account_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `external_account_id` when calling `update`") # noqa: E501 - # verify the required parameter 'marketing_event_update_request_params' is set - if self.api_client.client_side_validation and local_var_params.get("marketing_event_update_request_params") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `marketing_event_update_request_params` when calling `update`") # noqa: E501 + # verify the required parameter 'object_id' is set + if self.api_client.client_side_validation and local_var_params.get("object_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `object_id` when calling `update_by_object_id`") # noqa: E501 + # verify the required parameter 'marketing_event_public_update_request_v2' is set + if self.api_client.client_side_validation and local_var_params.get("marketing_event_public_update_request_v2") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `marketing_event_public_update_request_v2` when calling `update_by_object_id`") # noqa: E501 collection_formats = {} path_params = {} - if "external_event_id" in local_var_params: - path_params["externalEventId"] = local_var_params["external_event_id"] # noqa: E501 + if "object_id" in local_var_params: + path_params["objectId"] = local_var_params["object_id"] # noqa: E501 query_params = [] - if local_var_params.get("external_account_id") is not None: # noqa: E501 - query_params.append(("externalAccountId", local_var_params["external_account_id"])) # noqa: E501 header_params = dict(local_var_params.get("_headers", {})) @@ -1188,8 +1040,8 @@ def update_with_http_info(self, external_event_id, external_account_id, marketin local_var_files = {} body_params = None - if "marketing_event_update_request_params" in local_var_params: - body_params = local_var_params["marketing_event_update_request_params"] + if "marketing_event_public_update_request_v2" in local_var_params: + body_params = local_var_params["marketing_event_public_update_request_v2"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -1202,11 +1054,11 @@ def update_with_http_info(self, external_event_id, external_account_id, marketin auth_settings = ["oauth2"] # noqa: E501 response_types_map = { - 200: "MarketingEventPublicDefaultResponse", + 200: "MarketingEventPublicDefaultResponseV2", } return self.api_client.call_api( - "/marketing/v3/marketing-events/events/{externalEventId}", + "/marketing/v3/marketing-events/{objectId}", "PATCH", path_params, query_params, @@ -1234,7 +1086,7 @@ def upsert(self, external_event_id, marketing_event_create_request_params, **kwa >>> thread = api.upsert(external_event_id, marketing_event_create_request_params, async_req=True) >>> result = thread.get() - :param external_event_id: The ID of the marketing event to upsert (required) + :param external_event_id: The id of the marketing event in the external event application (required) :type external_event_id: str :param marketing_event_create_request_params: (required) :type marketing_event_create_request_params: MarketingEventCreateRequestParams @@ -1266,7 +1118,7 @@ def upsert_with_http_info(self, external_event_id, marketing_event_create_reques >>> thread = api.upsert_with_http_info(external_event_id, marketing_event_create_request_params, async_req=True) >>> result = thread.get() - :param external_event_id: The ID of the marketing event to upsert (required) + :param external_event_id: The id of the marketing event in the external event application (required) :type external_event_id: str :param marketing_event_create_request_params: (required) :type marketing_event_create_request_params: MarketingEventCreateRequestParams diff --git a/hubspot/marketing/events/api/batch_api.py b/hubspot/marketing/events/api/batch_api.py new file mode 100644 index 00000000..833546a1 --- /dev/null +++ b/hubspot/marketing/events/api/batch_api.py @@ -0,0 +1,543 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from hubspot.marketing.events.api_client import ApiClient +from hubspot.marketing.events.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class 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_marketing_event_external_unique_identifier, **kwargs): # noqa: E501 + """Delete Multiple Marketing Events by External Ids # noqa: E501 + + Deletes multiple Marketing Events based on externalAccountId, externalEventId, and appId. Only Marketing Events created by the same apps will be deleted; events from other apps cannot be removed by this endpoint. # 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_marketing_event_external_unique_identifier, async_req=True) + >>> result = thread.get() + + :param batch_input_marketing_event_external_unique_identifier: (required) + :type batch_input_marketing_event_external_unique_identifier: BatchInputMarketingEventExternalUniqueIdentifier + :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: Error + """ + kwargs["_return_http_data_only"] = True + return self.archive_with_http_info(batch_input_marketing_event_external_unique_identifier, **kwargs) # noqa: E501 + + def archive_with_http_info(self, batch_input_marketing_event_external_unique_identifier, **kwargs): # noqa: E501 + """Delete Multiple Marketing Events by External Ids # noqa: E501 + + Deletes multiple Marketing Events based on externalAccountId, externalEventId, and appId. Only Marketing Events created by the same apps will be deleted; events from other apps cannot be removed by this endpoint. # 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_marketing_event_external_unique_identifier, async_req=True) + >>> result = thread.get() + + :param batch_input_marketing_event_external_unique_identifier: (required) + :type batch_input_marketing_event_external_unique_identifier: BatchInputMarketingEventExternalUniqueIdentifier + :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(Error, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["batch_input_marketing_event_external_unique_identifier"] + 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_marketing_event_external_unique_identifier' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_marketing_event_external_unique_identifier") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_marketing_event_external_unique_identifier` 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_marketing_event_external_unique_identifier" in local_var_params: + body_params = local_var_params["batch_input_marketing_event_external_unique_identifier"] + # 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( + "/marketing/v3/marketing-events/events/delete", + "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 archive_by_object_id(self, batch_input_marketing_event_public_object_id_delete_request, **kwargs): # noqa: E501 + """Delete Multiple Marketing Events by ObjectId # noqa: E501 + + Deletes multiple Marketing Events from the portal based on their objectId, if they exist. Responses: 204: Returned if all specified Marketing Events were successfully deleted. 207: Returned if some objectIds did not correspond to any existing Marketing Events. # 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_by_object_id(batch_input_marketing_event_public_object_id_delete_request, async_req=True) + >>> result = thread.get() + + :param batch_input_marketing_event_public_object_id_delete_request: (required) + :type batch_input_marketing_event_public_object_id_delete_request: BatchInputMarketingEventPublicObjectIdDeleteRequest + :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_by_object_id_with_http_info(batch_input_marketing_event_public_object_id_delete_request, **kwargs) # noqa: E501 + + def archive_by_object_id_with_http_info(self, batch_input_marketing_event_public_object_id_delete_request, **kwargs): # noqa: E501 + """Delete Multiple Marketing Events by ObjectId # noqa: E501 + + Deletes multiple Marketing Events from the portal based on their objectId, if they exist. Responses: 204: Returned if all specified Marketing Events were successfully deleted. 207: Returned if some objectIds did not correspond to any existing Marketing Events. # 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_by_object_id_with_http_info(batch_input_marketing_event_public_object_id_delete_request, async_req=True) + >>> result = thread.get() + + :param batch_input_marketing_event_public_object_id_delete_request: (required) + :type batch_input_marketing_event_public_object_id_delete_request: BatchInputMarketingEventPublicObjectIdDeleteRequest + :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_marketing_event_public_object_id_delete_request"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method archive_by_object_id" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'batch_input_marketing_event_public_object_id_delete_request' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_marketing_event_public_object_id_delete_request") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_marketing_event_public_object_id_delete_request` when calling `archive_by_object_id`") # 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_marketing_event_public_object_id_delete_request" in local_var_params: + body_params = local_var_params["batch_input_marketing_event_public_object_id_delete_request"] + # 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( + "/marketing/v3/marketing-events/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 update_by_object_id(self, batch_input_marketing_event_public_update_request_full_v2, **kwargs): # noqa: E501 + """Update Multiple Marketing Events by ObjectId # noqa: E501 + + Updates multiple Marketing Events on the portal based on their objectId, if they exist. # 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_by_object_id(batch_input_marketing_event_public_update_request_full_v2, async_req=True) + >>> result = thread.get() + + :param batch_input_marketing_event_public_update_request_full_v2: (required) + :type batch_input_marketing_event_public_update_request_full_v2: BatchInputMarketingEventPublicUpdateRequestFullV2 + :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: BatchResponseMarketingEventPublicDefaultResponseV2 + """ + kwargs["_return_http_data_only"] = True + return self.update_by_object_id_with_http_info(batch_input_marketing_event_public_update_request_full_v2, **kwargs) # noqa: E501 + + def update_by_object_id_with_http_info(self, batch_input_marketing_event_public_update_request_full_v2, **kwargs): # noqa: E501 + """Update Multiple Marketing Events by ObjectId # noqa: E501 + + Updates multiple Marketing Events on the portal based on their objectId, if they exist. # 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_by_object_id_with_http_info(batch_input_marketing_event_public_update_request_full_v2, async_req=True) + >>> result = thread.get() + + :param batch_input_marketing_event_public_update_request_full_v2: (required) + :type batch_input_marketing_event_public_update_request_full_v2: BatchInputMarketingEventPublicUpdateRequestFullV2 + :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(BatchResponseMarketingEventPublicDefaultResponseV2, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["batch_input_marketing_event_public_update_request_full_v2"] + 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_by_object_id" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'batch_input_marketing_event_public_update_request_full_v2' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_marketing_event_public_update_request_full_v2") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_marketing_event_public_update_request_full_v2` when calling `update_by_object_id`") # 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_marketing_event_public_update_request_full_v2" in local_var_params: + body_params = local_var_params["batch_input_marketing_event_public_update_request_full_v2"] + # 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: "BatchResponseMarketingEventPublicDefaultResponseV2", + 207: "BatchResponseMarketingEventPublicDefaultResponseV2WithErrors", + } + + return self.api_client.call_api( + "/marketing/v3/marketing-events/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_marketing_event_create_request_params, **kwargs): # noqa: E501 + """Create or Update Multiple Marketing Events # noqa: E501 + + Upserts multiple Marketing Events. If a Marketing Event with the specified ID already exists, it will be updated; otherwise, a new event will be created. Only Marketing Events originally created by the same app can be updated. # 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_marketing_event_create_request_params, async_req=True) + >>> result = thread.get() + + :param batch_input_marketing_event_create_request_params: (required) + :type batch_input_marketing_event_create_request_params: BatchInputMarketingEventCreateRequestParams + :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: BatchResponseMarketingEventPublicDefaultResponse + """ + kwargs["_return_http_data_only"] = True + return self.upsert_with_http_info(batch_input_marketing_event_create_request_params, **kwargs) # noqa: E501 + + def upsert_with_http_info(self, batch_input_marketing_event_create_request_params, **kwargs): # noqa: E501 + """Create or Update Multiple Marketing Events # noqa: E501 + + Upserts multiple Marketing Events. If a Marketing Event with the specified ID already exists, it will be updated; otherwise, a new event will be created. Only Marketing Events originally created by the same app can be updated. # 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_marketing_event_create_request_params, async_req=True) + >>> result = thread.get() + + :param batch_input_marketing_event_create_request_params: (required) + :type batch_input_marketing_event_create_request_params: BatchInputMarketingEventCreateRequestParams + :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(BatchResponseMarketingEventPublicDefaultResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["batch_input_marketing_event_create_request_params"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method upsert" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'batch_input_marketing_event_create_request_params' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_marketing_event_create_request_params") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_marketing_event_create_request_params` 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_marketing_event_create_request_params" in local_var_params: + body_params = local_var_params["batch_input_marketing_event_create_request_params"] + # 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: "BatchResponseMarketingEventPublicDefaultResponse", + } + + return self.api_client.call_api( + "/marketing/v3/marketing-events/events/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/marketing/events/api/attendance_subscriber_state_changes_api.py b/hubspot/marketing/events/api/change_property_api.py similarity index 60% rename from hubspot/marketing/events/api/attendance_subscriber_state_changes_api.py rename to hubspot/marketing/events/api/change_property_api.py index 5ff81508..513af68b 100644 --- a/hubspot/marketing/events/api/attendance_subscriber_state_changes_api.py +++ b/hubspot/marketing/events/api/change_property_api.py @@ -21,7 +21,7 @@ from hubspot.marketing.events.exceptions import ApiTypeError, ApiValueError # noqa: F401 -class AttendanceSubscriberStateChangesApi(object): +class ChangePropertyApi(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -33,23 +33,19 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def record_by_contact_emails(self, external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, **kwargs): # noqa: E501 - """Record a subscriber state by contact email # noqa: E501 + def cancel(self, external_event_id, external_account_id, **kwargs): # noqa: E501 + """Mark a marketing event as cancelled # noqa: E501 - Record a subscriber state between multiple HubSpot contacts and a marketing event, using contact email addresses. If contact is not present it will be automatically created. The contactProperties field is used only when creating a new contact. These properties will not update existing contacts. # noqa: E501 + Mark a marketing event as cancelled. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.record_by_contact_emails(external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, async_req=True) + >>> thread = api.cancel(external_event_id, external_account_id, async_req=True) >>> result = thread.get() - :param external_event_id: The id of the marketing event (required) + :param external_event_id: The id of the marketing event in the external event application (required) :type external_event_id: str - :param subscriber_state: The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'. (required) - :type subscriber_state: str - :param batch_input_marketing_event_email_subscriber: (required) - :type batch_input_marketing_event_email_subscriber: BatchInputMarketingEventEmailSubscriber - :param external_account_id: The account id associated with the marketing event + :param external_account_id: The accountId that is associated with this marketing event in the external event application (required) :type external_account_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -64,28 +60,24 @@ def record_by_contact_emails(self, external_event_id, subscriber_state, batch_in :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: BatchResponseSubscriberEmailResponse + :rtype: MarketingEventDefaultResponse """ kwargs["_return_http_data_only"] = True - return self.record_by_contact_emails_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, **kwargs) # noqa: E501 + return self.cancel_with_http_info(external_event_id, external_account_id, **kwargs) # noqa: E501 - def record_by_contact_emails_with_http_info(self, external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, **kwargs): # noqa: E501 - """Record a subscriber state by contact email # noqa: E501 + def cancel_with_http_info(self, external_event_id, external_account_id, **kwargs): # noqa: E501 + """Mark a marketing event as cancelled # noqa: E501 - Record a subscriber state between multiple HubSpot contacts and a marketing event, using contact email addresses. If contact is not present it will be automatically created. The contactProperties field is used only when creating a new contact. These properties will not update existing contacts. # noqa: E501 + Mark a marketing event as cancelled. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.record_by_contact_emails_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_email_subscriber, async_req=True) + >>> thread = api.cancel_with_http_info(external_event_id, external_account_id, async_req=True) >>> result = thread.get() - :param external_event_id: The id of the marketing event (required) + :param external_event_id: The id of the marketing event in the external event application (required) :type external_event_id: str - :param subscriber_state: The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'. (required) - :type subscriber_state: str - :param batch_input_marketing_event_email_subscriber: (required) - :type batch_input_marketing_event_email_subscriber: BatchInputMarketingEventEmailSubscriber - :param external_account_id: The account id associated with the marketing event + :param external_account_id: The accountId that is associated with this marketing event in the external event application (required) :type external_account_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -108,36 +100,31 @@ def record_by_contact_emails_with_http_info(self, external_event_id, subscriber_ :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(BatchResponseSubscriberEmailResponse, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(MarketingEventDefaultResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["external_event_id", "subscriber_state", "batch_input_marketing_event_email_subscriber", "external_account_id"] + all_params = ["external_event_id", "external_account_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 record_by_contact_emails" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method cancel" % key) local_var_params[key] = val del local_var_params["kwargs"] # verify the required parameter 'external_event_id' is set if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `external_event_id` when calling `record_by_contact_emails`") # noqa: E501 - # verify the required parameter 'subscriber_state' is set - if self.api_client.client_side_validation and local_var_params.get("subscriber_state") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `subscriber_state` when calling `record_by_contact_emails`") # noqa: E501 - # verify the required parameter 'batch_input_marketing_event_email_subscriber' is set - if self.api_client.client_side_validation and local_var_params.get("batch_input_marketing_event_email_subscriber") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `batch_input_marketing_event_email_subscriber` when calling `record_by_contact_emails`") # noqa: E501 + raise ApiValueError("Missing the required parameter `external_event_id` when calling `cancel`") # noqa: E501 + # verify the required parameter 'external_account_id' is set + if self.api_client.client_side_validation and local_var_params.get("external_account_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `external_account_id` when calling `cancel`") # noqa: E501 collection_formats = {} path_params = {} if "external_event_id" in local_var_params: path_params["externalEventId"] = local_var_params["external_event_id"] # noqa: E501 - if "subscriber_state" in local_var_params: - path_params["subscriberState"] = local_var_params["subscriber_state"] # noqa: E501 query_params = [] if local_var_params.get("external_account_id") is not None: # noqa: E501 @@ -149,25 +136,18 @@ def record_by_contact_emails_with_http_info(self, external_event_id, subscriber_ local_var_files = {} body_params = None - if "batch_input_marketing_event_email_subscriber" in local_var_params: - body_params = local_var_params["batch_input_marketing_event_email_subscriber"] # 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: "BatchResponseSubscriberEmailResponse", + 200: "MarketingEventDefaultResponse", } return self.api_client.call_api( - "/marketing/v3/marketing-events/attendance/{externalEventId}/{subscriberState}/email-create", + "/marketing/v3/marketing-events/events/{externalEventId}/cancel", "POST", path_params, query_params, @@ -185,24 +165,22 @@ def record_by_contact_emails_with_http_info(self, external_event_id, subscriber_ _request_auth=local_var_params.get("_request_auth"), ) - def record_by_contact_ids(self, external_event_id, subscriber_state, batch_input_marketing_event_subscriber, **kwargs): # noqa: E501 - """Record a subscriber state by contact ids # noqa: E501 + def complete(self, external_event_id, external_account_id, marketing_event_complete_request_params, **kwargs): # noqa: E501 + """Mark a marketing event as completed # noqa: E501 - Record a subscriber state between multiple HubSpot contacts and a marketing event, using HubSpot contact ids. # noqa: E501 + Mark a marketing event as completed # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.record_by_contact_ids(external_event_id, subscriber_state, batch_input_marketing_event_subscriber, async_req=True) + >>> thread = api.complete(external_event_id, external_account_id, marketing_event_complete_request_params, async_req=True) >>> result = thread.get() - :param external_event_id: The id of the marketing event (required) + :param external_event_id: The id of the marketing event in the external event application. (required) :type external_event_id: str - :param subscriber_state: The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'. (required) - :type subscriber_state: str - :param batch_input_marketing_event_subscriber: (required) - :type batch_input_marketing_event_subscriber: BatchInputMarketingEventSubscriber - :param external_account_id: The account id associated with the marketing event + :param external_account_id: The accountId that is associated with this marketing event in the external event application. (required) :type external_account_id: str + :param marketing_event_complete_request_params: (required) + :type marketing_event_complete_request_params: MarketingEventCompleteRequestParams :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -216,29 +194,27 @@ def record_by_contact_ids(self, external_event_id, subscriber_state, batch_input :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: BatchResponseSubscriberVidResponse + :rtype: MarketingEventDefaultResponse """ kwargs["_return_http_data_only"] = True - return self.record_by_contact_ids_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_subscriber, **kwargs) # noqa: E501 + return self.complete_with_http_info(external_event_id, external_account_id, marketing_event_complete_request_params, **kwargs) # noqa: E501 - def record_by_contact_ids_with_http_info(self, external_event_id, subscriber_state, batch_input_marketing_event_subscriber, **kwargs): # noqa: E501 - """Record a subscriber state by contact ids # noqa: E501 + def complete_with_http_info(self, external_event_id, external_account_id, marketing_event_complete_request_params, **kwargs): # noqa: E501 + """Mark a marketing event as completed # noqa: E501 - Record a subscriber state between multiple HubSpot contacts and a marketing event, using HubSpot contact ids. # noqa: E501 + Mark a marketing event as completed # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.record_by_contact_ids_with_http_info(external_event_id, subscriber_state, batch_input_marketing_event_subscriber, async_req=True) + >>> thread = api.complete_with_http_info(external_event_id, external_account_id, marketing_event_complete_request_params, async_req=True) >>> result = thread.get() - :param external_event_id: The id of the marketing event (required) + :param external_event_id: The id of the marketing event in the external event application. (required) :type external_event_id: str - :param subscriber_state: The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'. (required) - :type subscriber_state: str - :param batch_input_marketing_event_subscriber: (required) - :type batch_input_marketing_event_subscriber: BatchInputMarketingEventSubscriber - :param external_account_id: The account id associated with the marketing event + :param external_account_id: The accountId that is associated with this marketing event in the external event application. (required) :type external_account_id: str + :param marketing_event_complete_request_params: (required) + :type marketing_event_complete_request_params: MarketingEventCompleteRequestParams :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 @@ -260,36 +236,34 @@ def record_by_contact_ids_with_http_info(self, external_event_id, subscriber_sta :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(BatchResponseSubscriberVidResponse, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(MarketingEventDefaultResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["external_event_id", "subscriber_state", "batch_input_marketing_event_subscriber", "external_account_id"] + all_params = ["external_event_id", "external_account_id", "marketing_event_complete_request_params"] all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: - raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method record_by_contact_ids" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method complete" % key) local_var_params[key] = val del local_var_params["kwargs"] # verify the required parameter 'external_event_id' is set if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `external_event_id` when calling `record_by_contact_ids`") # noqa: E501 - # verify the required parameter 'subscriber_state' is set - if self.api_client.client_side_validation and local_var_params.get("subscriber_state") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `subscriber_state` when calling `record_by_contact_ids`") # noqa: E501 - # verify the required parameter 'batch_input_marketing_event_subscriber' is set - if self.api_client.client_side_validation and local_var_params.get("batch_input_marketing_event_subscriber") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `batch_input_marketing_event_subscriber` when calling `record_by_contact_ids`") # noqa: E501 + raise ApiValueError("Missing the required parameter `external_event_id` when calling `complete`") # noqa: E501 + # verify the required parameter 'external_account_id' is set + if self.api_client.client_side_validation and local_var_params.get("external_account_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `external_account_id` when calling `complete`") # noqa: E501 + # verify the required parameter 'marketing_event_complete_request_params' is set + if self.api_client.client_side_validation and local_var_params.get("marketing_event_complete_request_params") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `marketing_event_complete_request_params` when calling `complete`") # noqa: E501 collection_formats = {} path_params = {} if "external_event_id" in local_var_params: path_params["externalEventId"] = local_var_params["external_event_id"] # noqa: E501 - if "subscriber_state" in local_var_params: - path_params["subscriberState"] = local_var_params["subscriber_state"] # noqa: E501 query_params = [] if local_var_params.get("external_account_id") is not None: # noqa: E501 @@ -301,8 +275,8 @@ def record_by_contact_ids_with_http_info(self, external_event_id, subscriber_sta local_var_files = {} body_params = None - if "batch_input_marketing_event_subscriber" in local_var_params: - body_params = local_var_params["batch_input_marketing_event_subscriber"] + if "marketing_event_complete_request_params" in local_var_params: + body_params = local_var_params["marketing_event_complete_request_params"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -315,11 +289,11 @@ def record_by_contact_ids_with_http_info(self, external_event_id, subscriber_sta auth_settings = ["oauth2"] # noqa: E501 response_types_map = { - 200: "BatchResponseSubscriberVidResponse", + 200: "MarketingEventDefaultResponse", } return self.api_client.call_api( - "/marketing/v3/marketing-events/attendance/{externalEventId}/{subscriberState}/create", + "/marketing/v3/marketing-events/events/{externalEventId}/complete", "POST", path_params, query_params, diff --git a/hubspot/marketing/events/api/identifiers_api.py b/hubspot/marketing/events/api/identifiers_api.py new file mode 100644 index 00000000..384c57da --- /dev/null +++ b/hubspot/marketing/events/api/identifiers_api.py @@ -0,0 +1,280 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from hubspot.marketing.events.api_client import ApiClient +from hubspot.marketing.events.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class IdentifiersApi(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, q, **kwargs): # noqa: E501 + """Find App-Specific Marketing Events by External Event Id # noqa: E501 + + Retrieves Marketing Events where the externalEventId matches the value provided in the request, limited to events created by the app making the request. Marketing Events created by other apps will not be included in the results. # 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(q, async_req=True) + >>> result = thread.get() + + :param q: The id of the marketing event in the external event application (externalEventId) (required) + :type q: 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: CollectionResponseSearchPublicResponseWrapperNoPaging + """ + kwargs["_return_http_data_only"] = True + return self.do_search_with_http_info(q, **kwargs) # noqa: E501 + + def do_search_with_http_info(self, q, **kwargs): # noqa: E501 + """Find App-Specific Marketing Events by External Event Id # noqa: E501 + + Retrieves Marketing Events where the externalEventId matches the value provided in the request, limited to events created by the app making the request. Marketing Events created by other apps will not be included in the results. # 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(q, async_req=True) + >>> result = thread.get() + + :param q: The id of the marketing event in the external event application (externalEventId) (required) + :type q: 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(CollectionResponseSearchPublicResponseWrapperNoPaging, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["q"] + 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 'q' is set + if self.api_client.client_side_validation and local_var_params.get("q") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `q` when calling `do_search`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get("q") is not None: # noqa: E501 + query_params.append(("q", local_var_params["q"])) # 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: "CollectionResponseSearchPublicResponseWrapperNoPaging", + } + + return self.api_client.call_api( + "/marketing/v3/marketing-events/events/search", + "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 search_portal_events(self, external_event_id, **kwargs): # noqa: E501 + """Find Marketing Events by External Event Id # noqa: E501 + + This endpoint searches the portal for all Marketing Events whose externalEventId matches the value provided in the request. It retrieves the objectId and additional event details for each matching Marketing Event. Since multiple Marketing Events can have the same externalEventId, the endpoint returns all matching results. Note: Marketing Events become searchable by externalEventId a few minutes after creation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.search_portal_events(external_event_id, async_req=True) + >>> result = thread.get() + + :param external_event_id: The id of the marketing event in the external event application. (required) + :type external_event_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging + """ + kwargs["_return_http_data_only"] = True + return self.search_portal_events_with_http_info(external_event_id, **kwargs) # noqa: E501 + + def search_portal_events_with_http_info(self, external_event_id, **kwargs): # noqa: E501 + """Find Marketing Events by External Event Id # noqa: E501 + + This endpoint searches the portal for all Marketing Events whose externalEventId matches the value provided in the request. It retrieves the objectId and additional event details for each matching Marketing Event. Since multiple Marketing Events can have the same externalEventId, the endpoint returns all matching results. Note: Marketing Events become searchable by externalEventId a few minutes after creation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.search_portal_events_with_http_info(external_event_id, async_req=True) + >>> result = thread.get() + + :param external_event_id: The id of the marketing event in the external event application. (required) + :type external_event_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["external_event_id"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method search_portal_events" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'external_event_id' is set + if self.api_client.client_side_validation and local_var_params.get("external_event_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `external_event_id` when calling `search_portal_events`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "external_event_id" in local_var_params: + path_params["externalEventId"] = local_var_params["external_event_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 200: "CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging", + } + + return self.api_client.call_api( + "/marketing/v3/marketing-events/{externalEventId}/identifiers", + "GET", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) diff --git a/hubspot/marketing/events/api/list_associations_api.py b/hubspot/marketing/events/api/list_associations_api.py index 5108c078..a6a52a04 100644 --- a/hubspot/marketing/events/api/list_associations_api.py +++ b/hubspot/marketing/events/api/list_associations_api.py @@ -581,7 +581,7 @@ def get_all_by_external_account_and_event_ids(self, external_account_id, externa >>> thread = api.get_all_by_external_account_and_event_ids(external_account_id, external_event_id, async_req=True) >>> result = thread.get() - :param external_account_id: The accountId that is associated with this marketing event in the external event application. (required) + :param external_account_id: The accountId that is associated with this marketing event in the external event application (required) :type external_account_id: str :param external_event_id: The id of the marketing event in the external event application. (required) :type external_event_id: str @@ -613,7 +613,7 @@ def get_all_by_external_account_and_event_ids_with_http_info(self, external_acco >>> thread = api.get_all_by_external_account_and_event_ids_with_http_info(external_account_id, external_event_id, async_req=True) >>> result = thread.get() - :param external_account_id: The accountId that is associated with this marketing event in the external event application. (required) + :param external_account_id: The accountId that is associated with this marketing event in the external event application (required) :type external_account_id: str :param external_event_id: The id of the marketing event in the external event application. (required) :type external_event_id: str diff --git a/hubspot/marketing/events/api/participant_state_api.py b/hubspot/marketing/events/api/retrieve_participant_state_api.py similarity index 99% rename from hubspot/marketing/events/api/participant_state_api.py rename to hubspot/marketing/events/api/retrieve_participant_state_api.py index e0ccf750..2edf38fb 100644 --- a/hubspot/marketing/events/api/participant_state_api.py +++ b/hubspot/marketing/events/api/retrieve_participant_state_api.py @@ -21,7 +21,7 @@ from hubspot.marketing.events.exceptions import ApiTypeError, ApiValueError # noqa: F401 -class ParticipantStateApi(object): +class RetrieveParticipantStateApi(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech diff --git a/hubspot/marketing/events/api/subscriber_state_changes_api.py b/hubspot/marketing/events/api/subscriber_state_changes_api.py index d3772fc1..cec7fa63 100644 --- a/hubspot/marketing/events/api/subscriber_state_changes_api.py +++ b/hubspot/marketing/events/api/subscriber_state_changes_api.py @@ -43,11 +43,11 @@ def upsert_by_contact_email(self, external_event_id, subscriber_state, external_ >>> thread = api.upsert_by_contact_email(external_event_id, subscriber_state, external_account_id, batch_input_marketing_event_email_subscriber, async_req=True) >>> result = thread.get() - :param external_event_id: The ID of the marketing event (required) + :param external_event_id: The id of the marketing event in the external event application (required) :type external_event_id: str :param subscriber_state: The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'. (required) :type subscriber_state: str - :param external_account_id: The account ID associated with the marketing event (required) + :param external_account_id: The accountId that is associated with this marketing event in the external event application (required) :type external_account_id: str :param batch_input_marketing_event_email_subscriber: (required) :type batch_input_marketing_event_email_subscriber: BatchInputMarketingEventEmailSubscriber @@ -79,11 +79,11 @@ def upsert_by_contact_email_with_http_info(self, external_event_id, subscriber_s >>> thread = api.upsert_by_contact_email_with_http_info(external_event_id, subscriber_state, external_account_id, batch_input_marketing_event_email_subscriber, async_req=True) >>> result = thread.get() - :param external_event_id: The ID of the marketing event (required) + :param external_event_id: The id of the marketing event in the external event application (required) :type external_event_id: str :param subscriber_state: The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'. (required) :type subscriber_state: str - :param external_account_id: The account ID associated with the marketing event (required) + :param external_account_id: The accountId that is associated with this marketing event in the external event application (required) :type external_account_id: str :param batch_input_marketing_event_email_subscriber: (required) :type batch_input_marketing_event_email_subscriber: BatchInputMarketingEventEmailSubscriber @@ -196,11 +196,11 @@ def upsert_by_contact_id(self, external_event_id, subscriber_state, external_acc >>> thread = api.upsert_by_contact_id(external_event_id, subscriber_state, external_account_id, batch_input_marketing_event_subscriber, async_req=True) >>> result = thread.get() - :param external_event_id: The ID of the marketing event (required) + :param external_event_id: The id of the marketing event in the external event application (required) :type external_event_id: str :param subscriber_state: The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'. (required) :type subscriber_state: str - :param external_account_id: The account ID associated with the marketing event (required) + :param external_account_id: The accountId that is associated with this marketing event in the external event application (required) :type external_account_id: str :param batch_input_marketing_event_subscriber: (required) :type batch_input_marketing_event_subscriber: BatchInputMarketingEventSubscriber @@ -232,11 +232,11 @@ def upsert_by_contact_id_with_http_info(self, external_event_id, subscriber_stat >>> thread = api.upsert_by_contact_id_with_http_info(external_event_id, subscriber_state, external_account_id, batch_input_marketing_event_subscriber, async_req=True) >>> result = thread.get() - :param external_event_id: The ID of the marketing event (required) + :param external_event_id: The id of the marketing event in the external event application (required) :type external_event_id: str :param subscriber_state: The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'. (required) :type subscriber_state: str - :param external_account_id: The account ID associated with the marketing event (required) + :param external_account_id: The accountId that is associated with this marketing event in the external event application (required) :type external_account_id: str :param batch_input_marketing_event_subscriber: (required) :type batch_input_marketing_event_subscriber: BatchInputMarketingEventSubscriber diff --git a/hubspot/marketing/events/models/__init__.py b/hubspot/marketing/events/models/__init__.py index cb5f5173..30cf17f5 100644 --- a/hubspot/marketing/events/models/__init__.py +++ b/hubspot/marketing/events/models/__init__.py @@ -14,18 +14,26 @@ from __future__ import absolute_import # import models into model package +from hubspot.marketing.events.models.app_info import AppInfo from hubspot.marketing.events.models.attendance_counters import AttendanceCounters from hubspot.marketing.events.models.batch_input_marketing_event_create_request_params import BatchInputMarketingEventCreateRequestParams from hubspot.marketing.events.models.batch_input_marketing_event_email_subscriber import BatchInputMarketingEventEmailSubscriber from hubspot.marketing.events.models.batch_input_marketing_event_external_unique_identifier import BatchInputMarketingEventExternalUniqueIdentifier +from hubspot.marketing.events.models.batch_input_marketing_event_public_object_id_delete_request import BatchInputMarketingEventPublicObjectIdDeleteRequest +from hubspot.marketing.events.models.batch_input_marketing_event_public_update_request_full_v2 import BatchInputMarketingEventPublicUpdateRequestFullV2 from hubspot.marketing.events.models.batch_input_marketing_event_subscriber import BatchInputMarketingEventSubscriber from hubspot.marketing.events.models.batch_response_marketing_event_public_default_response import BatchResponseMarketingEventPublicDefaultResponse +from hubspot.marketing.events.models.batch_response_marketing_event_public_default_response_v2 import BatchResponseMarketingEventPublicDefaultResponseV2 +from hubspot.marketing.events.models.batch_response_marketing_event_public_default_response_v2_with_errors import BatchResponseMarketingEventPublicDefaultResponseV2WithErrors from hubspot.marketing.events.models.batch_response_subscriber_email_response import BatchResponseSubscriberEmailResponse from hubspot.marketing.events.models.batch_response_subscriber_vid_response import BatchResponseSubscriberVidResponse -from hubspot.marketing.events.models.collection_response_marketing_event_external_unique_identifier_no_paging import CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging +from hubspot.marketing.events.models.collection_response_marketing_event_public_read_response_v2_forward_paging import CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging +from hubspot.marketing.events.models.collection_response_search_public_response_wrapper_no_paging import CollectionResponseSearchPublicResponseWrapperNoPaging +from hubspot.marketing.events.models.collection_response_with_total_marketing_event_identifiers_response_no_paging import CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging from hubspot.marketing.events.models.collection_response_with_total_participation_breakdown_forward_paging import CollectionResponseWithTotalParticipationBreakdownForwardPaging from hubspot.marketing.events.models.collection_response_with_total_public_list_no_paging import CollectionResponseWithTotalPublicListNoPaging from hubspot.marketing.events.models.contact_association import ContactAssociation +from hubspot.marketing.events.models.crm_property_wrapper import CrmPropertyWrapper from hubspot.marketing.events.models.error import Error from hubspot.marketing.events.models.error_detail import ErrorDetail from hubspot.marketing.events.models.event_detail_settings import EventDetailSettings @@ -37,8 +45,14 @@ from hubspot.marketing.events.models.marketing_event_default_response import MarketingEventDefaultResponse from hubspot.marketing.events.models.marketing_event_email_subscriber import MarketingEventEmailSubscriber from hubspot.marketing.events.models.marketing_event_external_unique_identifier import MarketingEventExternalUniqueIdentifier +from hubspot.marketing.events.models.marketing_event_identifiers_response import MarketingEventIdentifiersResponse from hubspot.marketing.events.models.marketing_event_public_default_response import MarketingEventPublicDefaultResponse +from hubspot.marketing.events.models.marketing_event_public_default_response_v2 import MarketingEventPublicDefaultResponseV2 +from hubspot.marketing.events.models.marketing_event_public_object_id_delete_request import MarketingEventPublicObjectIdDeleteRequest from hubspot.marketing.events.models.marketing_event_public_read_response import MarketingEventPublicReadResponse +from hubspot.marketing.events.models.marketing_event_public_read_response_v2 import MarketingEventPublicReadResponseV2 +from hubspot.marketing.events.models.marketing_event_public_update_request_full_v2 import MarketingEventPublicUpdateRequestFullV2 +from hubspot.marketing.events.models.marketing_event_public_update_request_v2 import MarketingEventPublicUpdateRequestV2 from hubspot.marketing.events.models.marketing_event_subscriber import MarketingEventSubscriber from hubspot.marketing.events.models.marketing_event_update_request_params import MarketingEventUpdateRequestParams from hubspot.marketing.events.models.next_page import NextPage @@ -47,6 +61,7 @@ from hubspot.marketing.events.models.participation_properties import ParticipationProperties from hubspot.marketing.events.models.property_value import PropertyValue from hubspot.marketing.events.models.public_list import PublicList +from hubspot.marketing.events.models.search_public_response_wrapper import SearchPublicResponseWrapper from hubspot.marketing.events.models.standard_error import StandardError from hubspot.marketing.events.models.subscriber_email_response import SubscriberEmailResponse from hubspot.marketing.events.models.subscriber_vid_response import SubscriberVidResponse diff --git a/hubspot/marketing/events/models/app_info.py b/hubspot/marketing/events/models/app_info.py new file mode 100644 index 00000000..9d35f192 --- /dev/null +++ b/hubspot/marketing/events/models/app_info.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class AppInfo(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 = {"name": "str", "id": "str"} + + attribute_map = {"name": "name", "id": "id"} + + def __init__(self, name=None, id=None, local_vars_configuration=None): # noqa: E501 + """AppInfo - 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._name = None + self._id = None + self.discriminator = None + + self.name = name + self.id = id + + @property + def name(self): + """Gets the name of this AppInfo. # noqa: E501 + + + :return: The name of this AppInfo. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AppInfo. + + + :param name: The name of this AppInfo. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def id(self): + """Gets the id of this AppInfo. # noqa: E501 + + + :return: The id of this AppInfo. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AppInfo. + + + :param id: The id of this AppInfo. # 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, AppInfo): + 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, AppInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/batch_input_marketing_event_public_object_id_delete_request.py b/hubspot/marketing/events/models/batch_input_marketing_event_public_object_id_delete_request.py new file mode 100644 index 00000000..5b55f6ca --- /dev/null +++ b/hubspot/marketing/events/models/batch_input_marketing_event_public_object_id_delete_request.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class BatchInputMarketingEventPublicObjectIdDeleteRequest(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[MarketingEventPublicObjectIdDeleteRequest]"} + + attribute_map = {"inputs": "inputs"} + + def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 + """BatchInputMarketingEventPublicObjectIdDeleteRequest - 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 BatchInputMarketingEventPublicObjectIdDeleteRequest. # noqa: E501 + + + :return: The inputs of this BatchInputMarketingEventPublicObjectIdDeleteRequest. # noqa: E501 + :rtype: list[MarketingEventPublicObjectIdDeleteRequest] + """ + return self._inputs + + @inputs.setter + def inputs(self, inputs): + """Sets the inputs of this BatchInputMarketingEventPublicObjectIdDeleteRequest. + + + :param inputs: The inputs of this BatchInputMarketingEventPublicObjectIdDeleteRequest. # noqa: E501 + :type inputs: list[MarketingEventPublicObjectIdDeleteRequest] + """ + 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, BatchInputMarketingEventPublicObjectIdDeleteRequest): + 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, BatchInputMarketingEventPublicObjectIdDeleteRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/batch_input_marketing_event_public_update_request_full_v2.py b/hubspot/marketing/events/models/batch_input_marketing_event_public_update_request_full_v2.py new file mode 100644 index 00000000..fbb78ad4 --- /dev/null +++ b/hubspot/marketing/events/models/batch_input_marketing_event_public_update_request_full_v2.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class BatchInputMarketingEventPublicUpdateRequestFullV2(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[MarketingEventPublicUpdateRequestFullV2]"} + + attribute_map = {"inputs": "inputs"} + + def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 + """BatchInputMarketingEventPublicUpdateRequestFullV2 - 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 BatchInputMarketingEventPublicUpdateRequestFullV2. # noqa: E501 + + + :return: The inputs of this BatchInputMarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :rtype: list[MarketingEventPublicUpdateRequestFullV2] + """ + return self._inputs + + @inputs.setter + def inputs(self, inputs): + """Sets the inputs of this BatchInputMarketingEventPublicUpdateRequestFullV2. + + + :param inputs: The inputs of this BatchInputMarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :type inputs: list[MarketingEventPublicUpdateRequestFullV2] + """ + 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, BatchInputMarketingEventPublicUpdateRequestFullV2): + 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, BatchInputMarketingEventPublicUpdateRequestFullV2): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/batch_response_marketing_event_public_default_response_v2.py b/hubspot/marketing/events/models/batch_response_marketing_event_public_default_response_v2.py new file mode 100644 index 00000000..aeaddfba --- /dev/null +++ b/hubspot/marketing/events/models/batch_response_marketing_event_public_default_response_v2.py @@ -0,0 +1,255 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class BatchResponseMarketingEventPublicDefaultResponseV2(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[MarketingEventPublicDefaultResponseV2]", + "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 + """BatchResponseMarketingEventPublicDefaultResponseV2 - 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 BatchResponseMarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The completed_at of this BatchResponseMarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: datetime + """ + return self._completed_at + + @completed_at.setter + def completed_at(self, completed_at): + """Sets the completed_at of this BatchResponseMarketingEventPublicDefaultResponseV2. + + + :param completed_at: The completed_at of this BatchResponseMarketingEventPublicDefaultResponseV2. # 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 BatchResponseMarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The requested_at of this BatchResponseMarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: datetime + """ + return self._requested_at + + @requested_at.setter + def requested_at(self, requested_at): + """Sets the requested_at of this BatchResponseMarketingEventPublicDefaultResponseV2. + + + :param requested_at: The requested_at of this BatchResponseMarketingEventPublicDefaultResponseV2. # noqa: E501 + :type requested_at: datetime + """ + + self._requested_at = requested_at + + @property + def started_at(self): + """Gets the started_at of this BatchResponseMarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The started_at of this BatchResponseMarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this BatchResponseMarketingEventPublicDefaultResponseV2. + + + :param started_at: The started_at of this BatchResponseMarketingEventPublicDefaultResponseV2. # 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 BatchResponseMarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The links of this BatchResponseMarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this BatchResponseMarketingEventPublicDefaultResponseV2. + + + :param links: The links of this BatchResponseMarketingEventPublicDefaultResponseV2. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def results(self): + """Gets the results of this BatchResponseMarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The results of this BatchResponseMarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: list[MarketingEventPublicDefaultResponseV2] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this BatchResponseMarketingEventPublicDefaultResponseV2. + + + :param results: The results of this BatchResponseMarketingEventPublicDefaultResponseV2. # noqa: E501 + :type results: list[MarketingEventPublicDefaultResponseV2] + """ + 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 BatchResponseMarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The status of this BatchResponseMarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this BatchResponseMarketingEventPublicDefaultResponseV2. + + + :param status: The status of this BatchResponseMarketingEventPublicDefaultResponseV2. # 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, BatchResponseMarketingEventPublicDefaultResponseV2): + 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, BatchResponseMarketingEventPublicDefaultResponseV2): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/batch_response_marketing_event_public_default_response_v2_with_errors.py b/hubspot/marketing/events/models/batch_response_marketing_event_public_default_response_v2_with_errors.py new file mode 100644 index 00000000..c24d24cb --- /dev/null +++ b/hubspot/marketing/events/models/batch_response_marketing_event_public_default_response_v2_with_errors.py @@ -0,0 +1,314 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class BatchResponseMarketingEventPublicDefaultResponseV2WithErrors(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[MarketingEventPublicDefaultResponseV2]", + "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 + """BatchResponseMarketingEventPublicDefaultResponseV2WithErrors - 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 BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + + + :return: The completed_at of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + :rtype: datetime + """ + return self._completed_at + + @completed_at.setter + def completed_at(self, completed_at): + """Sets the completed_at of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. + + + :param completed_at: The completed_at of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # 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 BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + + + :return: The num_errors of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + :rtype: int + """ + return self._num_errors + + @num_errors.setter + def num_errors(self, num_errors): + """Sets the num_errors of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. + + + :param num_errors: The num_errors of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + :type num_errors: int + """ + + self._num_errors = num_errors + + @property + def requested_at(self): + """Gets the requested_at of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + + + :return: The requested_at of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + :rtype: datetime + """ + return self._requested_at + + @requested_at.setter + def requested_at(self, requested_at): + """Sets the requested_at of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. + + + :param requested_at: The requested_at of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + :type requested_at: datetime + """ + + self._requested_at = requested_at + + @property + def started_at(self): + """Gets the started_at of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + + + :return: The started_at of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. + + + :param started_at: The started_at of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # 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 BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + + + :return: The links of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. + + + :param links: The links of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def results(self): + """Gets the results of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + + + :return: The results of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + :rtype: list[MarketingEventPublicDefaultResponseV2] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. + + + :param results: The results of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + :type results: list[MarketingEventPublicDefaultResponseV2] + """ + 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 BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + + + :return: The errors of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + :rtype: list[StandardError] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. + + + :param errors: The errors of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + :type errors: list[StandardError] + """ + + self._errors = errors + + @property + def status(self): + """Gets the status of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + + + :return: The status of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. + + + :param status: The status of this BatchResponseMarketingEventPublicDefaultResponseV2WithErrors. # 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, BatchResponseMarketingEventPublicDefaultResponseV2WithErrors): + 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, BatchResponseMarketingEventPublicDefaultResponseV2WithErrors): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/collection_response_marketing_event_public_read_response_v2_forward_paging.py b/hubspot/marketing/events/models/collection_response_marketing_event_public_read_response_v2_forward_paging.py new file mode 100644 index 00000000..d2d68032 --- /dev/null +++ b/hubspot/marketing/events/models/collection_response_marketing_event_public_read_response_v2_forward_paging.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging(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[MarketingEventPublicReadResponseV2]"} + + attribute_map = {"paging": "paging", "results": "results"} + + def __init__(self, paging=None, results=None, local_vars_configuration=None): # noqa: E501 + """CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging - 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 CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging. # noqa: E501 + + + :return: The paging of this CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging. # noqa: E501 + :rtype: ForwardPaging + """ + return self._paging + + @paging.setter + def paging(self, paging): + """Sets the paging of this CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging. + + + :param paging: The paging of this CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging. # noqa: E501 + :type paging: ForwardPaging + """ + + self._paging = paging + + @property + def results(self): + """Gets the results of this CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging. # noqa: E501 + + + :return: The results of this CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging. # noqa: E501 + :rtype: list[MarketingEventPublicReadResponseV2] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging. + + + :param results: The results of this CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging. # noqa: E501 + :type results: list[MarketingEventPublicReadResponseV2] + """ + 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, CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging): + 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, CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/collection_response_marketing_event_external_unique_identifier_no_paging.py b/hubspot/marketing/events/models/collection_response_search_public_response_wrapper_no_paging.py similarity index 74% rename from hubspot/marketing/events/models/collection_response_marketing_event_external_unique_identifier_no_paging.py rename to hubspot/marketing/events/models/collection_response_search_public_response_wrapper_no_paging.py index af326a80..13bc7b43 100644 --- a/hubspot/marketing/events/models/collection_response_marketing_event_external_unique_identifier_no_paging.py +++ b/hubspot/marketing/events/models/collection_response_search_public_response_wrapper_no_paging.py @@ -21,7 +21,7 @@ from hubspot.marketing.events.configuration import Configuration -class CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging(object): +class CollectionResponseSearchPublicResponseWrapperNoPaging(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"results": "list[MarketingEventExternalUniqueIdentifier]"} + openapi_types = {"results": "list[SearchPublicResponseWrapper]"} attribute_map = {"results": "results"} def __init__(self, results=None, local_vars_configuration=None): # noqa: E501 - """CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging - a model defined in OpenAPI""" # noqa: E501 + """CollectionResponseSearchPublicResponseWrapperNoPaging - 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 @@ -52,21 +52,21 @@ def __init__(self, results=None, local_vars_configuration=None): # noqa: E501 @property def results(self): - """Gets the results of this CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging. # noqa: E501 + """Gets the results of this CollectionResponseSearchPublicResponseWrapperNoPaging. # noqa: E501 - :return: The results of this CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging. # noqa: E501 - :rtype: list[MarketingEventExternalUniqueIdentifier] + :return: The results of this CollectionResponseSearchPublicResponseWrapperNoPaging. # noqa: E501 + :rtype: list[SearchPublicResponseWrapper] """ return self._results @results.setter def results(self, results): - """Sets the results of this CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging. + """Sets the results of this CollectionResponseSearchPublicResponseWrapperNoPaging. - :param results: The results of this CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging. # noqa: E501 - :type results: list[MarketingEventExternalUniqueIdentifier] + :param results: The results of this CollectionResponseSearchPublicResponseWrapperNoPaging. # noqa: E501 + :type results: list[SearchPublicResponseWrapper] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging): + if not isinstance(other, CollectionResponseSearchPublicResponseWrapperNoPaging): 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, CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging): + if not isinstance(other, CollectionResponseSearchPublicResponseWrapperNoPaging): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/collection_response_with_total_marketing_event_identifiers_response_no_paging.py b/hubspot/marketing/events/models/collection_response_with_total_marketing_event_identifiers_response_no_paging.py new file mode 100644 index 00000000..46ea70f4 --- /dev/null +++ b/hubspot/marketing/events/models/collection_response_with_total_marketing_event_identifiers_response_no_paging.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"total": "int", "results": "list[MarketingEventIdentifiersResponse]"} + + attribute_map = {"total": "total", "results": "results"} + + def __init__(self, total=None, results=None, local_vars_configuration=None): # noqa: E501 + """CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._total = None + self._results = None + self.discriminator = None + + self.total = total + self.results = results + + @property + def total(self): + """Gets the total of this CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging. # noqa: E501 + + + :return: The total of this CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging. + + + :param total: The total of this CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging. # noqa: E501 + :type total: int + """ + if self.local_vars_configuration.client_side_validation and total is None: # noqa: E501 + raise ValueError("Invalid value for `total`, must not be `None`") # noqa: E501 + + self._total = total + + @property + def results(self): + """Gets the results of this CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging. # noqa: E501 + + + :return: The results of this CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging. # noqa: E501 + :rtype: list[MarketingEventIdentifiersResponse] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging. + + + :param results: The results of this CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging. # noqa: E501 + :type results: list[MarketingEventIdentifiersResponse] + """ + 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, CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging): + 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, CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/crm_property_wrapper.py b/hubspot/marketing/events/models/crm_property_wrapper.py new file mode 100644 index 00000000..5c9c9965 --- /dev/null +++ b/hubspot/marketing/events/models/crm_property_wrapper.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class CrmPropertyWrapper(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 = {"name": "str", "value": "str"} + + attribute_map = {"name": "name", "value": "value"} + + def __init__(self, name=None, value=None, local_vars_configuration=None): # noqa: E501 + """CrmPropertyWrapper - 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._name = None + self._value = None + self.discriminator = None + + self.name = name + self.value = value + + @property + def name(self): + """Gets the name of this CrmPropertyWrapper. # noqa: E501 + + + :return: The name of this CrmPropertyWrapper. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CrmPropertyWrapper. + + + :param name: The name of this CrmPropertyWrapper. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def value(self): + """Gets the value of this CrmPropertyWrapper. # noqa: E501 + + + :return: The value of this CrmPropertyWrapper. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this CrmPropertyWrapper. + + + :param value: The value of this CrmPropertyWrapper. # 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 + + 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, CrmPropertyWrapper): + 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, CrmPropertyWrapper): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/marketing_event_default_response.py b/hubspot/marketing/events/models/marketing_event_default_response.py index 6e6aa31b..b058367e 100644 --- a/hubspot/marketing/events/models/marketing_event_default_response.py +++ b/hubspot/marketing/events/models/marketing_event_default_response.py @@ -46,6 +46,7 @@ class MarketingEventDefaultResponse(object): "event_type": "str", "event_completed": "bool", "end_date_time": "datetime", + "object_id": "str", } attribute_map = { @@ -59,6 +60,7 @@ class MarketingEventDefaultResponse(object): "event_type": "eventType", "event_completed": "eventCompleted", "end_date_time": "endDateTime", + "object_id": "objectId", } def __init__( @@ -73,6 +75,7 @@ def __init__( event_type=None, event_completed=None, end_date_time=None, + object_id=None, local_vars_configuration=None, ): # noqa: E501 """MarketingEventDefaultResponse - a model defined in OpenAPI""" # noqa: E501 @@ -90,6 +93,7 @@ def __init__( self._event_type = None self._event_completed = None self._end_date_time = None + self._object_id = None self.discriminator = None if start_date_time is not None: @@ -110,6 +114,8 @@ def __init__( self.event_completed = event_completed if end_date_time is not None: self.end_date_time = end_date_time + if object_id is not None: + self.object_id = object_id @property def start_date_time(self): @@ -343,6 +349,27 @@ def end_date_time(self, end_date_time): self._end_date_time = end_date_time + @property + def object_id(self): + """Gets the object_id of this MarketingEventDefaultResponse. # noqa: E501 + + + :return: The object_id of this MarketingEventDefaultResponse. # noqa: E501 + :rtype: str + """ + return self._object_id + + @object_id.setter + def object_id(self, object_id): + """Sets the object_id of this MarketingEventDefaultResponse. + + + :param object_id: The object_id of this MarketingEventDefaultResponse. # noqa: E501 + :type object_id: str + """ + + self._object_id = object_id + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} diff --git a/hubspot/marketing/events/models/marketing_event_email_subscriber.py b/hubspot/marketing/events/models/marketing_event_email_subscriber.py index 6da91f16..5ea24edd 100644 --- a/hubspot/marketing/events/models/marketing_event_email_subscriber.py +++ b/hubspot/marketing/events/models/marketing_event_email_subscriber.py @@ -129,7 +129,7 @@ def email(self, email): def interaction_date_time(self): """Gets the interaction_date_time of this MarketingEventEmailSubscriber. # noqa: E501 - The date and time at which the contact subscribed to the event. # noqa: E501 + Timestamp in milliseconds at which the contact subscribed to the event. # noqa: E501 :return: The interaction_date_time of this MarketingEventEmailSubscriber. # noqa: E501 :rtype: int @@ -140,7 +140,7 @@ def interaction_date_time(self): def interaction_date_time(self, interaction_date_time): """Sets the interaction_date_time of this MarketingEventEmailSubscriber. - The date and time at which the contact subscribed to the event. # noqa: E501 + Timestamp in milliseconds at which the contact subscribed to the event. # noqa: E501 :param interaction_date_time: The interaction_date_time of this MarketingEventEmailSubscriber. # noqa: E501 :type interaction_date_time: int diff --git a/hubspot/marketing/events/models/marketing_event_identifiers_response.py b/hubspot/marketing/events/models/marketing_event_identifiers_response.py new file mode 100644 index 00000000..f4153dc2 --- /dev/null +++ b/hubspot/marketing/events/models/marketing_event_identifiers_response.py @@ -0,0 +1,220 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class MarketingEventIdentifiersResponse(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 = {"external_account_id": "str", "external_event_id": "str", "app_info": "AppInfo", "object_id": "str", "marketing_event_name": "str"} + + attribute_map = {"external_account_id": "externalAccountId", "external_event_id": "externalEventId", "app_info": "appInfo", "object_id": "objectId", "marketing_event_name": "marketingEventName"} + + def __init__(self, external_account_id=None, external_event_id=None, app_info=None, object_id=None, marketing_event_name=None, local_vars_configuration=None): # noqa: E501 + """MarketingEventIdentifiersResponse - 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._external_account_id = None + self._external_event_id = None + self._app_info = None + self._object_id = None + self._marketing_event_name = None + self.discriminator = None + + if external_account_id is not None: + self.external_account_id = external_account_id + self.external_event_id = external_event_id + if app_info is not None: + self.app_info = app_info + self.object_id = object_id + self.marketing_event_name = marketing_event_name + + @property + def external_account_id(self): + """Gets the external_account_id of this MarketingEventIdentifiersResponse. # noqa: E501 + + + :return: The external_account_id of this MarketingEventIdentifiersResponse. # noqa: E501 + :rtype: str + """ + return self._external_account_id + + @external_account_id.setter + def external_account_id(self, external_account_id): + """Sets the external_account_id of this MarketingEventIdentifiersResponse. + + + :param external_account_id: The external_account_id of this MarketingEventIdentifiersResponse. # noqa: E501 + :type external_account_id: str + """ + + self._external_account_id = external_account_id + + @property + def external_event_id(self): + """Gets the external_event_id of this MarketingEventIdentifiersResponse. # noqa: E501 + + + :return: The external_event_id of this MarketingEventIdentifiersResponse. # noqa: E501 + :rtype: str + """ + return self._external_event_id + + @external_event_id.setter + def external_event_id(self, external_event_id): + """Sets the external_event_id of this MarketingEventIdentifiersResponse. + + + :param external_event_id: The external_event_id of this MarketingEventIdentifiersResponse. # noqa: E501 + :type external_event_id: str + """ + if self.local_vars_configuration.client_side_validation and external_event_id is None: # noqa: E501 + raise ValueError("Invalid value for `external_event_id`, must not be `None`") # noqa: E501 + + self._external_event_id = external_event_id + + @property + def app_info(self): + """Gets the app_info of this MarketingEventIdentifiersResponse. # noqa: E501 + + + :return: The app_info of this MarketingEventIdentifiersResponse. # noqa: E501 + :rtype: AppInfo + """ + return self._app_info + + @app_info.setter + def app_info(self, app_info): + """Sets the app_info of this MarketingEventIdentifiersResponse. + + + :param app_info: The app_info of this MarketingEventIdentifiersResponse. # noqa: E501 + :type app_info: AppInfo + """ + + self._app_info = app_info + + @property + def object_id(self): + """Gets the object_id of this MarketingEventIdentifiersResponse. # noqa: E501 + + + :return: The object_id of this MarketingEventIdentifiersResponse. # noqa: E501 + :rtype: str + """ + return self._object_id + + @object_id.setter + def object_id(self, object_id): + """Sets the object_id of this MarketingEventIdentifiersResponse. + + + :param object_id: The object_id of this MarketingEventIdentifiersResponse. # noqa: E501 + :type object_id: str + """ + if self.local_vars_configuration.client_side_validation and object_id is None: # noqa: E501 + raise ValueError("Invalid value for `object_id`, must not be `None`") # noqa: E501 + + self._object_id = object_id + + @property + def marketing_event_name(self): + """Gets the marketing_event_name of this MarketingEventIdentifiersResponse. # noqa: E501 + + + :return: The marketing_event_name of this MarketingEventIdentifiersResponse. # noqa: E501 + :rtype: str + """ + return self._marketing_event_name + + @marketing_event_name.setter + def marketing_event_name(self, marketing_event_name): + """Sets the marketing_event_name of this MarketingEventIdentifiersResponse. + + + :param marketing_event_name: The marketing_event_name of this MarketingEventIdentifiersResponse. # noqa: E501 + :type marketing_event_name: str + """ + if self.local_vars_configuration.client_side_validation and marketing_event_name is None: # noqa: E501 + raise ValueError("Invalid value for `marketing_event_name`, must not be `None`") # noqa: E501 + + self._marketing_event_name = marketing_event_name + + 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, MarketingEventIdentifiersResponse): + 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, MarketingEventIdentifiersResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/marketing_event_public_default_response.py b/hubspot/marketing/events/models/marketing_event_public_default_response.py index b055f528..37b20ae8 100644 --- a/hubspot/marketing/events/models/marketing_event_public_default_response.py +++ b/hubspot/marketing/events/models/marketing_event_public_default_response.py @@ -48,6 +48,7 @@ class MarketingEventPublicDefaultResponse(object): "event_description": "str", "event_name": "str", "id": "str", + "object_id": "str", "updated_at": "datetime", } @@ -64,6 +65,7 @@ class MarketingEventPublicDefaultResponse(object): "event_description": "eventDescription", "event_name": "eventName", "id": "id", + "object_id": "objectId", "updated_at": "updatedAt", } @@ -81,6 +83,7 @@ def __init__( event_description=None, event_name=None, id=None, + object_id=None, updated_at=None, local_vars_configuration=None, ): # noqa: E501 @@ -101,6 +104,7 @@ def __init__( self._event_description = None self._event_name = None self._id = None + self._object_id = None self._updated_at = None self.discriminator = None @@ -124,6 +128,8 @@ def __init__( self.event_description = event_description self.event_name = event_name self.id = id + if object_id is not None: + self.object_id = object_id self.updated_at = updated_at @property @@ -408,6 +414,27 @@ def id(self, id): self._id = id + @property + def object_id(self): + """Gets the object_id of this MarketingEventPublicDefaultResponse. # noqa: E501 + + + :return: The object_id of this MarketingEventPublicDefaultResponse. # noqa: E501 + :rtype: str + """ + return self._object_id + + @object_id.setter + def object_id(self, object_id): + """Sets the object_id of this MarketingEventPublicDefaultResponse. + + + :param object_id: The object_id of this MarketingEventPublicDefaultResponse. # noqa: E501 + :type object_id: str + """ + + self._object_id = object_id + @property def updated_at(self): """Gets the updated_at of this MarketingEventPublicDefaultResponse. # noqa: E501 diff --git a/hubspot/marketing/events/models/marketing_event_public_default_response_v2.py b/hubspot/marketing/events/models/marketing_event_public_default_response_v2.py new file mode 100644 index 00000000..df662e7e --- /dev/null +++ b/hubspot/marketing/events/models/marketing_event_public_default_response_v2.py @@ -0,0 +1,485 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class MarketingEventPublicDefaultResponseV2(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 = { + "event_organizer": "str", + "event_url": "str", + "app_info": "AppInfo", + "event_type": "str", + "event_completed": "bool", + "end_date_time": "datetime", + "created_at": "datetime", + "start_date_time": "datetime", + "custom_properties": "list[CrmPropertyWrapper]", + "event_cancelled": "bool", + "event_description": "str", + "event_name": "str", + "object_id": "str", + "updated_at": "datetime", + } + + attribute_map = { + "event_organizer": "eventOrganizer", + "event_url": "eventUrl", + "app_info": "appInfo", + "event_type": "eventType", + "event_completed": "eventCompleted", + "end_date_time": "endDateTime", + "created_at": "createdAt", + "start_date_time": "startDateTime", + "custom_properties": "customProperties", + "event_cancelled": "eventCancelled", + "event_description": "eventDescription", + "event_name": "eventName", + "object_id": "objectId", + "updated_at": "updatedAt", + } + + def __init__( + self, + event_organizer=None, + event_url=None, + app_info=None, + event_type=None, + event_completed=None, + end_date_time=None, + created_at=None, + start_date_time=None, + custom_properties=None, + event_cancelled=None, + event_description=None, + event_name=None, + object_id=None, + updated_at=None, + local_vars_configuration=None, + ): # noqa: E501 + """MarketingEventPublicDefaultResponseV2 - 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._event_organizer = None + self._event_url = None + self._app_info = None + self._event_type = None + self._event_completed = None + self._end_date_time = None + self._created_at = None + self._start_date_time = None + self._custom_properties = None + self._event_cancelled = None + self._event_description = None + self._event_name = None + self._object_id = None + self._updated_at = None + self.discriminator = None + + if event_organizer is not None: + self.event_organizer = event_organizer + if event_url is not None: + self.event_url = event_url + if app_info is not None: + self.app_info = app_info + if event_type is not None: + self.event_type = event_type + if event_completed is not None: + self.event_completed = event_completed + if end_date_time is not None: + self.end_date_time = end_date_time + self.created_at = created_at + if start_date_time is not None: + self.start_date_time = start_date_time + self.custom_properties = custom_properties + if event_cancelled is not None: + self.event_cancelled = event_cancelled + if event_description is not None: + self.event_description = event_description + self.event_name = event_name + self.object_id = object_id + self.updated_at = updated_at + + @property + def event_organizer(self): + """Gets the event_organizer of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The event_organizer of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: str + """ + return self._event_organizer + + @event_organizer.setter + def event_organizer(self, event_organizer): + """Sets the event_organizer of this MarketingEventPublicDefaultResponseV2. + + + :param event_organizer: The event_organizer of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :type event_organizer: str + """ + + self._event_organizer = event_organizer + + @property + def event_url(self): + """Gets the event_url of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The event_url of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: str + """ + return self._event_url + + @event_url.setter + def event_url(self, event_url): + """Sets the event_url of this MarketingEventPublicDefaultResponseV2. + + + :param event_url: The event_url of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :type event_url: str + """ + + self._event_url = event_url + + @property + def app_info(self): + """Gets the app_info of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The app_info of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: AppInfo + """ + return self._app_info + + @app_info.setter + def app_info(self, app_info): + """Sets the app_info of this MarketingEventPublicDefaultResponseV2. + + + :param app_info: The app_info of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :type app_info: AppInfo + """ + + self._app_info = app_info + + @property + def event_type(self): + """Gets the event_type of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The event_type of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: str + """ + return self._event_type + + @event_type.setter + def event_type(self, event_type): + """Sets the event_type of this MarketingEventPublicDefaultResponseV2. + + + :param event_type: The event_type of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :type event_type: str + """ + + self._event_type = event_type + + @property + def event_completed(self): + """Gets the event_completed of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The event_completed of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: bool + """ + return self._event_completed + + @event_completed.setter + def event_completed(self, event_completed): + """Sets the event_completed of this MarketingEventPublicDefaultResponseV2. + + + :param event_completed: The event_completed of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :type event_completed: bool + """ + + self._event_completed = event_completed + + @property + def end_date_time(self): + """Gets the end_date_time of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The end_date_time of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: datetime + """ + return self._end_date_time + + @end_date_time.setter + def end_date_time(self, end_date_time): + """Sets the end_date_time of this MarketingEventPublicDefaultResponseV2. + + + :param end_date_time: The end_date_time of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :type end_date_time: datetime + """ + + self._end_date_time = end_date_time + + @property + def created_at(self): + """Gets the created_at of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The created_at of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this MarketingEventPublicDefaultResponseV2. + + + :param created_at: The created_at of this MarketingEventPublicDefaultResponseV2. # 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 start_date_time(self): + """Gets the start_date_time of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The start_date_time of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: datetime + """ + return self._start_date_time + + @start_date_time.setter + def start_date_time(self, start_date_time): + """Sets the start_date_time of this MarketingEventPublicDefaultResponseV2. + + + :param start_date_time: The start_date_time of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :type start_date_time: datetime + """ + + self._start_date_time = start_date_time + + @property + def custom_properties(self): + """Gets the custom_properties of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The custom_properties of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: list[CrmPropertyWrapper] + """ + return self._custom_properties + + @custom_properties.setter + def custom_properties(self, custom_properties): + """Sets the custom_properties of this MarketingEventPublicDefaultResponseV2. + + + :param custom_properties: The custom_properties of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :type custom_properties: list[CrmPropertyWrapper] + """ + if self.local_vars_configuration.client_side_validation and custom_properties is None: # noqa: E501 + raise ValueError("Invalid value for `custom_properties`, must not be `None`") # noqa: E501 + + self._custom_properties = custom_properties + + @property + def event_cancelled(self): + """Gets the event_cancelled of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The event_cancelled of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: bool + """ + return self._event_cancelled + + @event_cancelled.setter + def event_cancelled(self, event_cancelled): + """Sets the event_cancelled of this MarketingEventPublicDefaultResponseV2. + + + :param event_cancelled: The event_cancelled of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :type event_cancelled: bool + """ + + self._event_cancelled = event_cancelled + + @property + def event_description(self): + """Gets the event_description of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The event_description of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: str + """ + return self._event_description + + @event_description.setter + def event_description(self, event_description): + """Sets the event_description of this MarketingEventPublicDefaultResponseV2. + + + :param event_description: The event_description of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :type event_description: str + """ + + self._event_description = event_description + + @property + def event_name(self): + """Gets the event_name of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The event_name of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: str + """ + return self._event_name + + @event_name.setter + def event_name(self, event_name): + """Sets the event_name of this MarketingEventPublicDefaultResponseV2. + + + :param event_name: The event_name of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :type event_name: str + """ + if self.local_vars_configuration.client_side_validation and event_name is None: # noqa: E501 + raise ValueError("Invalid value for `event_name`, must not be `None`") # noqa: E501 + + self._event_name = event_name + + @property + def object_id(self): + """Gets the object_id of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The object_id of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: str + """ + return self._object_id + + @object_id.setter + def object_id(self, object_id): + """Sets the object_id of this MarketingEventPublicDefaultResponseV2. + + + :param object_id: The object_id of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :type object_id: str + """ + if self.local_vars_configuration.client_side_validation and object_id is None: # noqa: E501 + raise ValueError("Invalid value for `object_id`, must not be `None`") # noqa: E501 + + self._object_id = object_id + + @property + def updated_at(self): + """Gets the updated_at of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + + + :return: The updated_at of this MarketingEventPublicDefaultResponseV2. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this MarketingEventPublicDefaultResponseV2. + + + :param updated_at: The updated_at of this MarketingEventPublicDefaultResponseV2. # 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, MarketingEventPublicDefaultResponseV2): + 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, MarketingEventPublicDefaultResponseV2): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/marketing_event_public_object_id_delete_request.py b/hubspot/marketing/events/models/marketing_event_public_object_id_delete_request.py new file mode 100644 index 00000000..5a3a66e4 --- /dev/null +++ b/hubspot/marketing/events/models/marketing_event_public_object_id_delete_request.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class MarketingEventPublicObjectIdDeleteRequest(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_id": "str"} + + attribute_map = {"object_id": "objectId"} + + def __init__(self, object_id=None, local_vars_configuration=None): # noqa: E501 + """MarketingEventPublicObjectIdDeleteRequest - 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_id = None + self.discriminator = None + + self.object_id = object_id + + @property + def object_id(self): + """Gets the object_id of this MarketingEventPublicObjectIdDeleteRequest. # noqa: E501 + + + :return: The object_id of this MarketingEventPublicObjectIdDeleteRequest. # noqa: E501 + :rtype: str + """ + return self._object_id + + @object_id.setter + def object_id(self, object_id): + """Sets the object_id of this MarketingEventPublicObjectIdDeleteRequest. + + + :param object_id: The object_id of this MarketingEventPublicObjectIdDeleteRequest. # noqa: E501 + :type object_id: str + """ + if self.local_vars_configuration.client_side_validation and object_id is None: # noqa: E501 + raise ValueError("Invalid value for `object_id`, must not be `None`") # noqa: E501 + + self._object_id = object_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, MarketingEventPublicObjectIdDeleteRequest): + 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, MarketingEventPublicObjectIdDeleteRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/marketing_event_public_read_response.py b/hubspot/marketing/events/models/marketing_event_public_read_response.py index fa91fbae..f1823540 100644 --- a/hubspot/marketing/events/models/marketing_event_public_read_response.py +++ b/hubspot/marketing/events/models/marketing_event_public_read_response.py @@ -53,6 +53,7 @@ class MarketingEventPublicReadResponse(object): "event_description": "str", "event_name": "str", "id": "str", + "object_id": "str", "updated_at": "datetime", } @@ -74,6 +75,7 @@ class MarketingEventPublicReadResponse(object): "event_description": "eventDescription", "event_name": "eventName", "id": "id", + "object_id": "objectId", "updated_at": "updatedAt", } @@ -96,6 +98,7 @@ def __init__( event_description=None, event_name=None, id=None, + object_id=None, updated_at=None, local_vars_configuration=None, ): # noqa: E501 @@ -121,6 +124,7 @@ def __init__( self._event_description = None self._event_name = None self._id = None + self._object_id = None self._updated_at = None self.discriminator = None @@ -149,6 +153,8 @@ def __init__( self.event_description = event_description self.event_name = event_name self.id = id + if object_id is not None: + self.object_id = object_id self.updated_at = updated_at @property @@ -558,6 +564,27 @@ def id(self, id): self._id = id + @property + def object_id(self): + """Gets the object_id of this MarketingEventPublicReadResponse. # noqa: E501 + + + :return: The object_id of this MarketingEventPublicReadResponse. # noqa: E501 + :rtype: str + """ + return self._object_id + + @object_id.setter + def object_id(self, object_id): + """Sets the object_id of this MarketingEventPublicReadResponse. + + + :param object_id: The object_id of this MarketingEventPublicReadResponse. # noqa: E501 + :type object_id: str + """ + + self._object_id = object_id + @property def updated_at(self): """Gets the updated_at of this MarketingEventPublicReadResponse. # noqa: E501 diff --git a/hubspot/marketing/events/models/marketing_event_public_read_response_v2.py b/hubspot/marketing/events/models/marketing_event_public_read_response_v2.py new file mode 100644 index 00000000..c608795c --- /dev/null +++ b/hubspot/marketing/events/models/marketing_event_public_read_response_v2.py @@ -0,0 +1,647 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class MarketingEventPublicReadResponseV2(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 = { + "registrants": "int", + "event_organizer": "str", + "event_url": "str", + "attendees": "int", + "app_info": "AppInfo", + "event_type": "str", + "event_completed": "bool", + "end_date_time": "datetime", + "no_shows": "int", + "cancellations": "int", + "created_at": "datetime", + "start_date_time": "datetime", + "custom_properties": "list[CrmPropertyWrapper]", + "event_cancelled": "bool", + "external_event_id": "str", + "event_status": "str", + "event_description": "str", + "event_name": "str", + "object_id": "str", + "updated_at": "datetime", + } + + attribute_map = { + "registrants": "registrants", + "event_organizer": "eventOrganizer", + "event_url": "eventUrl", + "attendees": "attendees", + "app_info": "appInfo", + "event_type": "eventType", + "event_completed": "eventCompleted", + "end_date_time": "endDateTime", + "no_shows": "noShows", + "cancellations": "cancellations", + "created_at": "createdAt", + "start_date_time": "startDateTime", + "custom_properties": "customProperties", + "event_cancelled": "eventCancelled", + "external_event_id": "externalEventId", + "event_status": "eventStatus", + "event_description": "eventDescription", + "event_name": "eventName", + "object_id": "objectId", + "updated_at": "updatedAt", + } + + def __init__( + self, + registrants=None, + event_organizer=None, + event_url=None, + attendees=None, + app_info=None, + event_type=None, + event_completed=None, + end_date_time=None, + no_shows=None, + cancellations=None, + created_at=None, + start_date_time=None, + custom_properties=None, + event_cancelled=None, + external_event_id=None, + event_status=None, + event_description=None, + event_name=None, + object_id=None, + updated_at=None, + local_vars_configuration=None, + ): # noqa: E501 + """MarketingEventPublicReadResponseV2 - 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._registrants = None + self._event_organizer = None + self._event_url = None + self._attendees = None + self._app_info = None + self._event_type = None + self._event_completed = None + self._end_date_time = None + self._no_shows = None + self._cancellations = None + self._created_at = None + self._start_date_time = None + self._custom_properties = None + self._event_cancelled = None + self._external_event_id = None + self._event_status = None + self._event_description = None + self._event_name = None + self._object_id = None + self._updated_at = None + self.discriminator = None + + if registrants is not None: + self.registrants = registrants + if event_organizer is not None: + self.event_organizer = event_organizer + if event_url is not None: + self.event_url = event_url + if attendees is not None: + self.attendees = attendees + if app_info is not None: + self.app_info = app_info + if event_type is not None: + self.event_type = event_type + if event_completed is not None: + self.event_completed = event_completed + if end_date_time is not None: + self.end_date_time = end_date_time + if no_shows is not None: + self.no_shows = no_shows + if cancellations is not None: + self.cancellations = cancellations + self.created_at = created_at + if start_date_time is not None: + self.start_date_time = start_date_time + self.custom_properties = custom_properties + if event_cancelled is not None: + self.event_cancelled = event_cancelled + if external_event_id is not None: + self.external_event_id = external_event_id + if event_status is not None: + self.event_status = event_status + if event_description is not None: + self.event_description = event_description + self.event_name = event_name + self.object_id = object_id + self.updated_at = updated_at + + @property + def registrants(self): + """Gets the registrants of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The registrants of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: int + """ + return self._registrants + + @registrants.setter + def registrants(self, registrants): + """Sets the registrants of this MarketingEventPublicReadResponseV2. + + + :param registrants: The registrants of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type registrants: int + """ + + self._registrants = registrants + + @property + def event_organizer(self): + """Gets the event_organizer of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The event_organizer of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: str + """ + return self._event_organizer + + @event_organizer.setter + def event_organizer(self, event_organizer): + """Sets the event_organizer of this MarketingEventPublicReadResponseV2. + + + :param event_organizer: The event_organizer of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type event_organizer: str + """ + + self._event_organizer = event_organizer + + @property + def event_url(self): + """Gets the event_url of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The event_url of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: str + """ + return self._event_url + + @event_url.setter + def event_url(self, event_url): + """Sets the event_url of this MarketingEventPublicReadResponseV2. + + + :param event_url: The event_url of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type event_url: str + """ + + self._event_url = event_url + + @property + def attendees(self): + """Gets the attendees of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The attendees of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: int + """ + return self._attendees + + @attendees.setter + def attendees(self, attendees): + """Sets the attendees of this MarketingEventPublicReadResponseV2. + + + :param attendees: The attendees of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type attendees: int + """ + + self._attendees = attendees + + @property + def app_info(self): + """Gets the app_info of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The app_info of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: AppInfo + """ + return self._app_info + + @app_info.setter + def app_info(self, app_info): + """Sets the app_info of this MarketingEventPublicReadResponseV2. + + + :param app_info: The app_info of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type app_info: AppInfo + """ + + self._app_info = app_info + + @property + def event_type(self): + """Gets the event_type of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The event_type of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: str + """ + return self._event_type + + @event_type.setter + def event_type(self, event_type): + """Sets the event_type of this MarketingEventPublicReadResponseV2. + + + :param event_type: The event_type of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type event_type: str + """ + + self._event_type = event_type + + @property + def event_completed(self): + """Gets the event_completed of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The event_completed of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: bool + """ + return self._event_completed + + @event_completed.setter + def event_completed(self, event_completed): + """Sets the event_completed of this MarketingEventPublicReadResponseV2. + + + :param event_completed: The event_completed of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type event_completed: bool + """ + + self._event_completed = event_completed + + @property + def end_date_time(self): + """Gets the end_date_time of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The end_date_time of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: datetime + """ + return self._end_date_time + + @end_date_time.setter + def end_date_time(self, end_date_time): + """Sets the end_date_time of this MarketingEventPublicReadResponseV2. + + + :param end_date_time: The end_date_time of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type end_date_time: datetime + """ + + self._end_date_time = end_date_time + + @property + def no_shows(self): + """Gets the no_shows of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The no_shows of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: int + """ + return self._no_shows + + @no_shows.setter + def no_shows(self, no_shows): + """Sets the no_shows of this MarketingEventPublicReadResponseV2. + + + :param no_shows: The no_shows of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type no_shows: int + """ + + self._no_shows = no_shows + + @property + def cancellations(self): + """Gets the cancellations of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The cancellations of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: int + """ + return self._cancellations + + @cancellations.setter + def cancellations(self, cancellations): + """Sets the cancellations of this MarketingEventPublicReadResponseV2. + + + :param cancellations: The cancellations of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type cancellations: int + """ + + self._cancellations = cancellations + + @property + def created_at(self): + """Gets the created_at of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The created_at of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this MarketingEventPublicReadResponseV2. + + + :param created_at: The created_at of this MarketingEventPublicReadResponseV2. # 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 start_date_time(self): + """Gets the start_date_time of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The start_date_time of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: datetime + """ + return self._start_date_time + + @start_date_time.setter + def start_date_time(self, start_date_time): + """Sets the start_date_time of this MarketingEventPublicReadResponseV2. + + + :param start_date_time: The start_date_time of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type start_date_time: datetime + """ + + self._start_date_time = start_date_time + + @property + def custom_properties(self): + """Gets the custom_properties of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The custom_properties of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: list[CrmPropertyWrapper] + """ + return self._custom_properties + + @custom_properties.setter + def custom_properties(self, custom_properties): + """Sets the custom_properties of this MarketingEventPublicReadResponseV2. + + + :param custom_properties: The custom_properties of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type custom_properties: list[CrmPropertyWrapper] + """ + if self.local_vars_configuration.client_side_validation and custom_properties is None: # noqa: E501 + raise ValueError("Invalid value for `custom_properties`, must not be `None`") # noqa: E501 + + self._custom_properties = custom_properties + + @property + def event_cancelled(self): + """Gets the event_cancelled of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The event_cancelled of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: bool + """ + return self._event_cancelled + + @event_cancelled.setter + def event_cancelled(self, event_cancelled): + """Sets the event_cancelled of this MarketingEventPublicReadResponseV2. + + + :param event_cancelled: The event_cancelled of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type event_cancelled: bool + """ + + self._event_cancelled = event_cancelled + + @property + def external_event_id(self): + """Gets the external_event_id of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The external_event_id of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: str + """ + return self._external_event_id + + @external_event_id.setter + def external_event_id(self, external_event_id): + """Sets the external_event_id of this MarketingEventPublicReadResponseV2. + + + :param external_event_id: The external_event_id of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type external_event_id: str + """ + + self._external_event_id = external_event_id + + @property + def event_status(self): + """Gets the event_status of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The event_status of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: str + """ + return self._event_status + + @event_status.setter + def event_status(self, event_status): + """Sets the event_status of this MarketingEventPublicReadResponseV2. + + + :param event_status: The event_status of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type event_status: str + """ + + self._event_status = event_status + + @property + def event_description(self): + """Gets the event_description of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The event_description of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: str + """ + return self._event_description + + @event_description.setter + def event_description(self, event_description): + """Sets the event_description of this MarketingEventPublicReadResponseV2. + + + :param event_description: The event_description of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type event_description: str + """ + + self._event_description = event_description + + @property + def event_name(self): + """Gets the event_name of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The event_name of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: str + """ + return self._event_name + + @event_name.setter + def event_name(self, event_name): + """Sets the event_name of this MarketingEventPublicReadResponseV2. + + + :param event_name: The event_name of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type event_name: str + """ + if self.local_vars_configuration.client_side_validation and event_name is None: # noqa: E501 + raise ValueError("Invalid value for `event_name`, must not be `None`") # noqa: E501 + + self._event_name = event_name + + @property + def object_id(self): + """Gets the object_id of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The object_id of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: str + """ + return self._object_id + + @object_id.setter + def object_id(self, object_id): + """Sets the object_id of this MarketingEventPublicReadResponseV2. + + + :param object_id: The object_id of this MarketingEventPublicReadResponseV2. # noqa: E501 + :type object_id: str + """ + if self.local_vars_configuration.client_side_validation and object_id is None: # noqa: E501 + raise ValueError("Invalid value for `object_id`, must not be `None`") # noqa: E501 + + self._object_id = object_id + + @property + def updated_at(self): + """Gets the updated_at of this MarketingEventPublicReadResponseV2. # noqa: E501 + + + :return: The updated_at of this MarketingEventPublicReadResponseV2. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this MarketingEventPublicReadResponseV2. + + + :param updated_at: The updated_at of this MarketingEventPublicReadResponseV2. # 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, MarketingEventPublicReadResponseV2): + 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, MarketingEventPublicReadResponseV2): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/marketing_event_public_update_request_full_v2.py b/hubspot/marketing/events/models/marketing_event_public_update_request_full_v2.py new file mode 100644 index 00000000..28562fe3 --- /dev/null +++ b/hubspot/marketing/events/models/marketing_event_public_update_request_full_v2.py @@ -0,0 +1,374 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class MarketingEventPublicUpdateRequestFullV2(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 = { + "start_date_time": "datetime", + "custom_properties": "list[PropertyValue]", + "event_cancelled": "bool", + "event_organizer": "str", + "event_url": "str", + "event_description": "str", + "event_name": "str", + "event_type": "str", + "end_date_time": "datetime", + "object_id": "str", + } + + attribute_map = { + "start_date_time": "startDateTime", + "custom_properties": "customProperties", + "event_cancelled": "eventCancelled", + "event_organizer": "eventOrganizer", + "event_url": "eventUrl", + "event_description": "eventDescription", + "event_name": "eventName", + "event_type": "eventType", + "end_date_time": "endDateTime", + "object_id": "objectId", + } + + def __init__( + self, + start_date_time=None, + custom_properties=None, + event_cancelled=None, + event_organizer=None, + event_url=None, + event_description=None, + event_name=None, + event_type=None, + end_date_time=None, + object_id=None, + local_vars_configuration=None, + ): # noqa: E501 + """MarketingEventPublicUpdateRequestFullV2 - 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._start_date_time = None + self._custom_properties = None + self._event_cancelled = None + self._event_organizer = None + self._event_url = None + self._event_description = None + self._event_name = None + self._event_type = None + self._end_date_time = None + self._object_id = None + self.discriminator = None + + if start_date_time is not None: + self.start_date_time = start_date_time + self.custom_properties = custom_properties + if event_cancelled is not None: + self.event_cancelled = event_cancelled + if event_organizer is not None: + self.event_organizer = event_organizer + if event_url is not None: + self.event_url = event_url + if event_description is not None: + self.event_description = event_description + if event_name is not None: + self.event_name = event_name + if event_type is not None: + self.event_type = event_type + if end_date_time is not None: + self.end_date_time = end_date_time + self.object_id = object_id + + @property + def start_date_time(self): + """Gets the start_date_time of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + + + :return: The start_date_time of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :rtype: datetime + """ + return self._start_date_time + + @start_date_time.setter + def start_date_time(self, start_date_time): + """Sets the start_date_time of this MarketingEventPublicUpdateRequestFullV2. + + + :param start_date_time: The start_date_time of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :type start_date_time: datetime + """ + + self._start_date_time = start_date_time + + @property + def custom_properties(self): + """Gets the custom_properties of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + + + :return: The custom_properties of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :rtype: list[PropertyValue] + """ + return self._custom_properties + + @custom_properties.setter + def custom_properties(self, custom_properties): + """Sets the custom_properties of this MarketingEventPublicUpdateRequestFullV2. + + + :param custom_properties: The custom_properties of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :type custom_properties: list[PropertyValue] + """ + if self.local_vars_configuration.client_side_validation and custom_properties is None: # noqa: E501 + raise ValueError("Invalid value for `custom_properties`, must not be `None`") # noqa: E501 + + self._custom_properties = custom_properties + + @property + def event_cancelled(self): + """Gets the event_cancelled of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + + + :return: The event_cancelled of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :rtype: bool + """ + return self._event_cancelled + + @event_cancelled.setter + def event_cancelled(self, event_cancelled): + """Sets the event_cancelled of this MarketingEventPublicUpdateRequestFullV2. + + + :param event_cancelled: The event_cancelled of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :type event_cancelled: bool + """ + + self._event_cancelled = event_cancelled + + @property + def event_organizer(self): + """Gets the event_organizer of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + + + :return: The event_organizer of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :rtype: str + """ + return self._event_organizer + + @event_organizer.setter + def event_organizer(self, event_organizer): + """Sets the event_organizer of this MarketingEventPublicUpdateRequestFullV2. + + + :param event_organizer: The event_organizer of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :type event_organizer: str + """ + + self._event_organizer = event_organizer + + @property + def event_url(self): + """Gets the event_url of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + + + :return: The event_url of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :rtype: str + """ + return self._event_url + + @event_url.setter + def event_url(self, event_url): + """Sets the event_url of this MarketingEventPublicUpdateRequestFullV2. + + + :param event_url: The event_url of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :type event_url: str + """ + + self._event_url = event_url + + @property + def event_description(self): + """Gets the event_description of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + + + :return: The event_description of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :rtype: str + """ + return self._event_description + + @event_description.setter + def event_description(self, event_description): + """Sets the event_description of this MarketingEventPublicUpdateRequestFullV2. + + + :param event_description: The event_description of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :type event_description: str + """ + + self._event_description = event_description + + @property + def event_name(self): + """Gets the event_name of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + + + :return: The event_name of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :rtype: str + """ + return self._event_name + + @event_name.setter + def event_name(self, event_name): + """Sets the event_name of this MarketingEventPublicUpdateRequestFullV2. + + + :param event_name: The event_name of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :type event_name: str + """ + + self._event_name = event_name + + @property + def event_type(self): + """Gets the event_type of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + + + :return: The event_type of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :rtype: str + """ + return self._event_type + + @event_type.setter + def event_type(self, event_type): + """Sets the event_type of this MarketingEventPublicUpdateRequestFullV2. + + + :param event_type: The event_type of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :type event_type: str + """ + + self._event_type = event_type + + @property + def end_date_time(self): + """Gets the end_date_time of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + + + :return: The end_date_time of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :rtype: datetime + """ + return self._end_date_time + + @end_date_time.setter + def end_date_time(self, end_date_time): + """Sets the end_date_time of this MarketingEventPublicUpdateRequestFullV2. + + + :param end_date_time: The end_date_time of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :type end_date_time: datetime + """ + + self._end_date_time = end_date_time + + @property + def object_id(self): + """Gets the object_id of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + + + :return: The object_id of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :rtype: str + """ + return self._object_id + + @object_id.setter + def object_id(self, object_id): + """Sets the object_id of this MarketingEventPublicUpdateRequestFullV2. + + + :param object_id: The object_id of this MarketingEventPublicUpdateRequestFullV2. # noqa: E501 + :type object_id: str + """ + if self.local_vars_configuration.client_side_validation and object_id is None: # noqa: E501 + raise ValueError("Invalid value for `object_id`, must not be `None`") # noqa: E501 + + self._object_id = object_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, MarketingEventPublicUpdateRequestFullV2): + 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, MarketingEventPublicUpdateRequestFullV2): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/marketing_event_public_update_request_v2.py b/hubspot/marketing/events/models/marketing_event_public_update_request_v2.py new file mode 100644 index 00000000..d759d76b --- /dev/null +++ b/hubspot/marketing/events/models/marketing_event_public_update_request_v2.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class MarketingEventPublicUpdateRequestV2(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 = { + "start_date_time": "datetime", + "custom_properties": "list[PropertyValue]", + "event_cancelled": "bool", + "event_organizer": "str", + "event_url": "str", + "event_description": "str", + "event_name": "str", + "event_type": "str", + "end_date_time": "datetime", + } + + attribute_map = { + "start_date_time": "startDateTime", + "custom_properties": "customProperties", + "event_cancelled": "eventCancelled", + "event_organizer": "eventOrganizer", + "event_url": "eventUrl", + "event_description": "eventDescription", + "event_name": "eventName", + "event_type": "eventType", + "end_date_time": "endDateTime", + } + + def __init__( + self, + start_date_time=None, + custom_properties=None, + event_cancelled=None, + event_organizer=None, + event_url=None, + event_description=None, + event_name=None, + event_type=None, + end_date_time=None, + local_vars_configuration=None, + ): # noqa: E501 + """MarketingEventPublicUpdateRequestV2 - 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._start_date_time = None + self._custom_properties = None + self._event_cancelled = None + self._event_organizer = None + self._event_url = None + self._event_description = None + self._event_name = None + self._event_type = None + self._end_date_time = None + self.discriminator = None + + if start_date_time is not None: + self.start_date_time = start_date_time + self.custom_properties = custom_properties + if event_cancelled is not None: + self.event_cancelled = event_cancelled + if event_organizer is not None: + self.event_organizer = event_organizer + if event_url is not None: + self.event_url = event_url + if event_description is not None: + self.event_description = event_description + if event_name is not None: + self.event_name = event_name + if event_type is not None: + self.event_type = event_type + if end_date_time is not None: + self.end_date_time = end_date_time + + @property + def start_date_time(self): + """Gets the start_date_time of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + + + :return: The start_date_time of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :rtype: datetime + """ + return self._start_date_time + + @start_date_time.setter + def start_date_time(self, start_date_time): + """Sets the start_date_time of this MarketingEventPublicUpdateRequestV2. + + + :param start_date_time: The start_date_time of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :type start_date_time: datetime + """ + + self._start_date_time = start_date_time + + @property + def custom_properties(self): + """Gets the custom_properties of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + + + :return: The custom_properties of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :rtype: list[PropertyValue] + """ + return self._custom_properties + + @custom_properties.setter + def custom_properties(self, custom_properties): + """Sets the custom_properties of this MarketingEventPublicUpdateRequestV2. + + + :param custom_properties: The custom_properties of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :type custom_properties: list[PropertyValue] + """ + if self.local_vars_configuration.client_side_validation and custom_properties is None: # noqa: E501 + raise ValueError("Invalid value for `custom_properties`, must not be `None`") # noqa: E501 + + self._custom_properties = custom_properties + + @property + def event_cancelled(self): + """Gets the event_cancelled of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + + + :return: The event_cancelled of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :rtype: bool + """ + return self._event_cancelled + + @event_cancelled.setter + def event_cancelled(self, event_cancelled): + """Sets the event_cancelled of this MarketingEventPublicUpdateRequestV2. + + + :param event_cancelled: The event_cancelled of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :type event_cancelled: bool + """ + + self._event_cancelled = event_cancelled + + @property + def event_organizer(self): + """Gets the event_organizer of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + + + :return: The event_organizer of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :rtype: str + """ + return self._event_organizer + + @event_organizer.setter + def event_organizer(self, event_organizer): + """Sets the event_organizer of this MarketingEventPublicUpdateRequestV2. + + + :param event_organizer: The event_organizer of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :type event_organizer: str + """ + + self._event_organizer = event_organizer + + @property + def event_url(self): + """Gets the event_url of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + + + :return: The event_url of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :rtype: str + """ + return self._event_url + + @event_url.setter + def event_url(self, event_url): + """Sets the event_url of this MarketingEventPublicUpdateRequestV2. + + + :param event_url: The event_url of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :type event_url: str + """ + + self._event_url = event_url + + @property + def event_description(self): + """Gets the event_description of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + + + :return: The event_description of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :rtype: str + """ + return self._event_description + + @event_description.setter + def event_description(self, event_description): + """Sets the event_description of this MarketingEventPublicUpdateRequestV2. + + + :param event_description: The event_description of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :type event_description: str + """ + + self._event_description = event_description + + @property + def event_name(self): + """Gets the event_name of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + + + :return: The event_name of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :rtype: str + """ + return self._event_name + + @event_name.setter + def event_name(self, event_name): + """Sets the event_name of this MarketingEventPublicUpdateRequestV2. + + + :param event_name: The event_name of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :type event_name: str + """ + + self._event_name = event_name + + @property + def event_type(self): + """Gets the event_type of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + + + :return: The event_type of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :rtype: str + """ + return self._event_type + + @event_type.setter + def event_type(self, event_type): + """Sets the event_type of this MarketingEventPublicUpdateRequestV2. + + + :param event_type: The event_type of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :type event_type: str + """ + + self._event_type = event_type + + @property + def end_date_time(self): + """Gets the end_date_time of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + + + :return: The end_date_time of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :rtype: datetime + """ + return self._end_date_time + + @end_date_time.setter + def end_date_time(self, end_date_time): + """Sets the end_date_time of this MarketingEventPublicUpdateRequestV2. + + + :param end_date_time: The end_date_time of this MarketingEventPublicUpdateRequestV2. # noqa: E501 + :type end_date_time: datetime + """ + + self._end_date_time = end_date_time + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MarketingEventPublicUpdateRequestV2): + 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, MarketingEventPublicUpdateRequestV2): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/marketing/events/models/marketing_event_subscriber.py b/hubspot/marketing/events/models/marketing_event_subscriber.py index b0cf263b..9f9044fb 100644 --- a/hubspot/marketing/events/models/marketing_event_subscriber.py +++ b/hubspot/marketing/events/models/marketing_event_subscriber.py @@ -102,7 +102,7 @@ def properties(self, properties): def interaction_date_time(self): """Gets the interaction_date_time of this MarketingEventSubscriber. # noqa: E501 - The date and time at which the contact subscribed to the event. # noqa: E501 + Timestamp in milliseconds at which the contact subscribed to the event. # noqa: E501 :return: The interaction_date_time of this MarketingEventSubscriber. # noqa: E501 :rtype: int @@ -113,7 +113,7 @@ def interaction_date_time(self): def interaction_date_time(self, interaction_date_time): """Sets the interaction_date_time of this MarketingEventSubscriber. - The date and time at which the contact subscribed to the event. # noqa: E501 + Timestamp in milliseconds at which the contact subscribed to the event. # noqa: E501 :param interaction_date_time: The interaction_date_time of this MarketingEventSubscriber. # noqa: E501 :type interaction_date_time: int diff --git a/hubspot/marketing/events/models/property_value.py b/hubspot/marketing/events/models/property_value.py index d4d11d6f..6859b31e 100644 --- a/hubspot/marketing/events/models/property_value.py +++ b/hubspot/marketing/events/models/property_value.py @@ -336,6 +336,7 @@ def source(self, source): "MICROAPPS", "INTENT", "PROSPECTING_AGENT", + "CENTRAL_EXCHANGE_RATES", ] # noqa: E501 if self.local_vars_configuration.client_side_validation and source not in allowed_values: # noqa: E501 raise ValueError("Invalid value for `source` ({0}), must be one of {1}".format(source, allowed_values)) # noqa: E501 diff --git a/hubspot/marketing/events/models/search_public_response_wrapper.py b/hubspot/marketing/events/models/search_public_response_wrapper.py new file mode 100644 index 00000000..b6852685 --- /dev/null +++ b/hubspot/marketing/events/models/search_public_response_wrapper.py @@ -0,0 +1,197 @@ +# coding: utf-8 + +""" + Marketing Events + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: v3 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from hubspot.marketing.events.configuration import Configuration + + +class SearchPublicResponseWrapper(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 = {"external_account_id": "str", "external_event_id": "str", "app_id": "int", "object_id": "str"} + + attribute_map = {"external_account_id": "externalAccountId", "external_event_id": "externalEventId", "app_id": "appId", "object_id": "objectId"} + + def __init__(self, external_account_id=None, external_event_id=None, app_id=None, object_id=None, local_vars_configuration=None): # noqa: E501 + """SearchPublicResponseWrapper - 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._external_account_id = None + self._external_event_id = None + self._app_id = None + self._object_id = None + self.discriminator = None + + self.external_account_id = external_account_id + self.external_event_id = external_event_id + self.app_id = app_id + self.object_id = object_id + + @property + def external_account_id(self): + """Gets the external_account_id of this SearchPublicResponseWrapper. # noqa: E501 + + + :return: The external_account_id of this SearchPublicResponseWrapper. # noqa: E501 + :rtype: str + """ + return self._external_account_id + + @external_account_id.setter + def external_account_id(self, external_account_id): + """Sets the external_account_id of this SearchPublicResponseWrapper. + + + :param external_account_id: The external_account_id of this SearchPublicResponseWrapper. # noqa: E501 + :type external_account_id: str + """ + if self.local_vars_configuration.client_side_validation and external_account_id is None: # noqa: E501 + raise ValueError("Invalid value for `external_account_id`, must not be `None`") # noqa: E501 + + self._external_account_id = external_account_id + + @property + def external_event_id(self): + """Gets the external_event_id of this SearchPublicResponseWrapper. # noqa: E501 + + + :return: The external_event_id of this SearchPublicResponseWrapper. # noqa: E501 + :rtype: str + """ + return self._external_event_id + + @external_event_id.setter + def external_event_id(self, external_event_id): + """Sets the external_event_id of this SearchPublicResponseWrapper. + + + :param external_event_id: The external_event_id of this SearchPublicResponseWrapper. # noqa: E501 + :type external_event_id: str + """ + if self.local_vars_configuration.client_side_validation and external_event_id is None: # noqa: E501 + raise ValueError("Invalid value for `external_event_id`, must not be `None`") # noqa: E501 + + self._external_event_id = external_event_id + + @property + def app_id(self): + """Gets the app_id of this SearchPublicResponseWrapper. # noqa: E501 + + + :return: The app_id of this SearchPublicResponseWrapper. # noqa: E501 + :rtype: int + """ + return self._app_id + + @app_id.setter + def app_id(self, app_id): + """Sets the app_id of this SearchPublicResponseWrapper. + + + :param app_id: The app_id of this SearchPublicResponseWrapper. # noqa: E501 + :type app_id: int + """ + if self.local_vars_configuration.client_side_validation and app_id is None: # noqa: E501 + raise ValueError("Invalid value for `app_id`, must not be `None`") # noqa: E501 + + self._app_id = app_id + + @property + def object_id(self): + """Gets the object_id of this SearchPublicResponseWrapper. # noqa: E501 + + + :return: The object_id of this SearchPublicResponseWrapper. # noqa: E501 + :rtype: str + """ + return self._object_id + + @object_id.setter + def object_id(self, object_id): + """Sets the object_id of this SearchPublicResponseWrapper. + + + :param object_id: The object_id of this SearchPublicResponseWrapper. # noqa: E501 + :type object_id: str + """ + if self.local_vars_configuration.client_side_validation and object_id is None: # noqa: E501 + raise ValueError("Invalid value for `object_id`, must not be `None`") # noqa: E501 + + self._object_id = object_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, SearchPublicResponseWrapper): + 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, SearchPublicResponseWrapper): + return True + + return self.to_dict() != other.to_dict() From 2f0143c87d1eb6deaee741a93a986c43d63453ee Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 1 Apr 2025 12:38:50 +0300 Subject: [PATCH 05/49] Codegen Marketing Forms --- .../forms/models/datepicker_field.py | 282 +++++++-------- .../models/dependent_field_dependent_field.py | 322 +++++++++--------- .../forms/models/dependent_field_filter.py | 166 ++++----- .../marketing/forms/models/dropdown_field.py | 306 ++++++++--------- hubspot/marketing/forms/models/email_field.py | 282 +++++++-------- .../forms/models/email_field_validation.py | 60 ++-- .../forms/models/enumerated_field_option.py | 110 +++--- hubspot/marketing/forms/models/file_field.py | 314 ++++++++--------- ...definition_all_of_legal_consent_options.py | 102 +++--- .../forms/models/legal_consent_checkbox.py | 62 ++-- ...ent_options_explicit_consent_to_process.py | 160 +++++---- ...ent_options_implicit_consent_to_process.py | 84 +++-- ...gal_consent_options_legitimate_interest.py | 70 ++-- .../models/legal_consent_options_none.py | 2 + .../forms/models/mobile_phone_field.py | 282 +++++++-------- .../forms/models/multi_line_text_field.py | 282 +++++++-------- .../forms/models/multiple_checkboxes_field.py | 286 ++++++++-------- .../marketing/forms/models/number_field.py | 282 +++++++-------- .../forms/models/number_field_validation.py | 4 + .../forms/models/payment_link_radio_field.py | 262 +++++++------- hubspot/marketing/forms/models/phone_field.py | 314 ++++++++--------- .../forms/models/phone_field_validation.py | 4 + hubspot/marketing/forms/models/radio_field.py | 306 ++++++++--------- .../forms/models/single_checkbox_field.py | 274 +++++++-------- .../forms/models/single_line_text_field.py | 282 +++++++-------- 25 files changed, 2487 insertions(+), 2413 deletions(-) diff --git a/hubspot/marketing/forms/models/datepicker_field.py b/hubspot/marketing/forms/models/datepicker_field.py index 93f9cfa5..9c61cf70 100644 --- a/hubspot/marketing/forms/models/datepicker_field.py +++ b/hubspot/marketing/forms/models/datepicker_field.py @@ -36,43 +36,43 @@ class DatepickerField(object): and the value is json key in definition. """ openapi_types = { - "field_type": "str", "object_type_id": "str", + "hidden": "bool", + "default_value": "str", "name": "str", - "label": "str", "description": "str", - "required": "bool", - "hidden": "bool", "dependent_fields": "list[DependentField]", + "label": "str", "placeholder": "str", - "default_value": "str", + "field_type": "str", + "required": "bool", } attribute_map = { - "field_type": "fieldType", "object_type_id": "objectTypeId", + "hidden": "hidden", + "default_value": "defaultValue", "name": "name", - "label": "label", "description": "description", - "required": "required", - "hidden": "hidden", "dependent_fields": "dependentFields", + "label": "label", "placeholder": "placeholder", - "default_value": "defaultValue", + "field_type": "fieldType", + "required": "required", } def __init__( self, - field_type="datepicker", object_type_id=None, + hidden=None, + default_value=None, name=None, - label=None, description=None, - required=None, - hidden=None, dependent_fields=None, + label=None, placeholder=None, - default_value=None, + field_type="datepicker", + required=None, local_vars_configuration=None, ): # noqa: E501 """DatepickerField - a model defined in OpenAPI""" # noqa: E501 @@ -80,59 +80,31 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._field_type = None self._object_type_id = None + self._hidden = None + self._default_value = None self._name = None - self._label = None self._description = None - self._required = None - self._hidden = None self._dependent_fields = None + self._label = None self._placeholder = None - self._default_value = None + self._field_type = None + self._required = None self.discriminator = None - self.field_type = field_type self.object_type_id = object_type_id + self.hidden = hidden + if default_value is not None: + self.default_value = default_value self.name = name - self.label = label if description is not None: self.description = description - self.required = required - self.hidden = hidden self.dependent_fields = dependent_fields + self.label = label if placeholder is not None: self.placeholder = placeholder - if default_value is not None: - self.default_value = default_value - - @property - def field_type(self): - """Gets the field_type of this DatepickerField. # noqa: E501 - - Determines how the field will be displayed and validated. # noqa: E501 - - :return: The field_type of this DatepickerField. # noqa: E501 - :rtype: str - """ - return self._field_type - - @field_type.setter - def field_type(self, field_type): - """Sets the field_type of this DatepickerField. - - Determines how the field will be displayed and validated. # noqa: E501 - - :param field_type: The field_type of this DatepickerField. # noqa: E501 - :type field_type: str - """ - if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 - raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 - allowed_values = ["datepicker"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - - self._field_type = field_type + self.field_type = field_type + self.required = required @property def object_type_id(self): @@ -159,6 +131,54 @@ def object_type_id(self, object_type_id): self._object_type_id = object_type_id + @property + def hidden(self): + """Gets the hidden of this DatepickerField. # noqa: E501 + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :return: The hidden of this DatepickerField. # noqa: E501 + :rtype: bool + """ + return self._hidden + + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this DatepickerField. + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :param hidden: The hidden of this DatepickerField. # noqa: E501 + :type hidden: bool + """ + if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + + self._hidden = hidden + + @property + def default_value(self): + """Gets the default_value of this DatepickerField. # noqa: E501 + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :return: The default_value of this DatepickerField. # noqa: E501 + :rtype: str + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this DatepickerField. + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :param default_value: The default_value of this DatepickerField. # noqa: E501 + :type default_value: str + """ + + self._default_value = default_value + @property def name(self): """Gets the name of this DatepickerField. # noqa: E501 @@ -184,31 +204,6 @@ def name(self, name): self._name = name - @property - def label(self): - """Gets the label of this DatepickerField. # noqa: E501 - - The main label for the form field. # noqa: E501 - - :return: The label of this DatepickerField. # noqa: E501 - :rtype: str - """ - return self._label - - @label.setter - def label(self, label): - """Sets the label of this DatepickerField. - - The main label for the form field. # noqa: E501 - - :param label: The label of this DatepickerField. # noqa: E501 - :type label: str - """ - if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 - raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 - - self._label = label - @property def description(self): """Gets the description of this DatepickerField. # noqa: E501 @@ -232,56 +227,6 @@ def description(self, description): self._description = description - @property - def required(self): - """Gets the required of this DatepickerField. # noqa: E501 - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :return: The required of this DatepickerField. # noqa: E501 - :rtype: bool - """ - return self._required - - @required.setter - def required(self, required): - """Sets the required of this DatepickerField. - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :param required: The required of this DatepickerField. # noqa: E501 - :type required: bool - """ - if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 - raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 - - self._required = required - - @property - def hidden(self): - """Gets the hidden of this DatepickerField. # noqa: E501 - - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - - :return: The hidden of this DatepickerField. # noqa: E501 - :rtype: bool - """ - return self._hidden - - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this DatepickerField. - - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - - :param hidden: The hidden of this DatepickerField. # noqa: E501 - :type hidden: bool - """ - if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 - - self._hidden = hidden - @property def dependent_fields(self): """Gets the dependent_fields of this DatepickerField. # noqa: E501 @@ -307,6 +252,31 @@ def dependent_fields(self, dependent_fields): self._dependent_fields = dependent_fields + @property + def label(self): + """Gets the label of this DatepickerField. # noqa: E501 + + The main label for the form field. # noqa: E501 + + :return: The label of this DatepickerField. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this DatepickerField. + + The main label for the form field. # noqa: E501 + + :param label: The label of this DatepickerField. # noqa: E501 + :type label: str + """ + if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + + self._label = label + @property def placeholder(self): """Gets the placeholder of this DatepickerField. # noqa: E501 @@ -331,27 +301,57 @@ def placeholder(self, placeholder): self._placeholder = placeholder @property - def default_value(self): - """Gets the default_value of this DatepickerField. # noqa: E501 + def field_type(self): + """Gets the field_type of this DatepickerField. # noqa: E501 - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :return: The default_value of this DatepickerField. # noqa: E501 + :return: The field_type of this DatepickerField. # noqa: E501 :rtype: str """ - return self._default_value + return self._field_type - @default_value.setter - def default_value(self, default_value): - """Sets the default_value of this DatepickerField. + @field_type.setter + def field_type(self, field_type): + """Sets the field_type of this DatepickerField. - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :param default_value: The default_value of this DatepickerField. # noqa: E501 - :type default_value: str + :param field_type: The field_type of this DatepickerField. # noqa: E501 + :type field_type: str """ + if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 + raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 + allowed_values = ["datepicker"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - self._default_value = default_value + self._field_type = field_type + + @property + def required(self): + """Gets the required of this DatepickerField. # noqa: E501 + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :return: The required of this DatepickerField. # noqa: E501 + :rtype: bool + """ + return self._required + + @required.setter + def required(self, required): + """Sets the required of this DatepickerField. + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :param required: The required of this DatepickerField. # noqa: E501 + :type required: bool + """ + if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 + raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 + + self._required = required def to_dict(self, serialize=False): """Returns the model properties as a dict""" diff --git a/hubspot/marketing/forms/models/dependent_field_dependent_field.py b/hubspot/marketing/forms/models/dependent_field_dependent_field.py index 2fb79c59..ea223084 100644 --- a/hubspot/marketing/forms/models/dependent_field_dependent_field.py +++ b/hubspot/marketing/forms/models/dependent_field_dependent_field.py @@ -36,57 +36,57 @@ class DependentFieldDependentField(object): and the value is json key in definition. """ openapi_types = { - "field_type": "str", "object_type_id": "str", + "hidden": "bool", + "default_value": "str", "name": "str", - "label": "str", "description": "str", - "required": "bool", - "hidden": "bool", "dependent_fields": "list[DependentField]", + "label": "str", "placeholder": "str", - "default_value": "str", + "field_type": "str", + "required": "bool", "validation": "NumberFieldValidation", "use_country_code_select": "bool", - "default_values": "list[str]", "options": "list[EnumeratedFieldOption]", + "default_values": "list[str]", "allow_multiple_files": "bool", } attribute_map = { - "field_type": "fieldType", "object_type_id": "objectTypeId", + "hidden": "hidden", + "default_value": "defaultValue", "name": "name", - "label": "label", "description": "description", - "required": "required", - "hidden": "hidden", "dependent_fields": "dependentFields", + "label": "label", "placeholder": "placeholder", - "default_value": "defaultValue", + "field_type": "fieldType", + "required": "required", "validation": "validation", "use_country_code_select": "useCountryCodeSelect", - "default_values": "defaultValues", "options": "options", + "default_values": "defaultValues", "allow_multiple_files": "allowMultipleFiles", } def __init__( self, - field_type="payment_link_radio", object_type_id=None, + hidden=None, + default_value=None, name=None, - label=None, description=None, - required=None, - hidden=None, dependent_fields=None, + label=None, placeholder=None, - default_value=None, + field_type="payment_link_radio", + required=None, validation=None, use_country_code_select=None, - default_values=None, options=None, + default_values=None, allow_multiple_files=None, local_vars_configuration=None, ): # noqa: E501 @@ -95,68 +95,42 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._field_type = None self._object_type_id = None + self._hidden = None + self._default_value = None self._name = None - self._label = None self._description = None - self._required = None - self._hidden = None self._dependent_fields = None + self._label = None self._placeholder = None - self._default_value = None + self._field_type = None + self._required = None self._validation = None self._use_country_code_select = None - self._default_values = None self._options = None + self._default_values = None self._allow_multiple_files = None self.discriminator = None - self.field_type = field_type self.object_type_id = object_type_id + self.hidden = hidden + if default_value is not None: + self.default_value = default_value self.name = name - self.label = label if description is not None: self.description = description - self.required = required - self.hidden = hidden self.dependent_fields = dependent_fields + self.label = label if placeholder is not None: self.placeholder = placeholder - if default_value is not None: - self.default_value = default_value + self.field_type = field_type + self.required = required self.validation = validation self.use_country_code_select = use_country_code_select - self.default_values = default_values self.options = options + self.default_values = default_values self.allow_multiple_files = allow_multiple_files - @property - def field_type(self): - """Gets the field_type of this DependentFieldDependentField. # noqa: E501 - - - :return: The field_type of this DependentFieldDependentField. # noqa: E501 - :rtype: str - """ - return self._field_type - - @field_type.setter - def field_type(self, field_type): - """Sets the field_type of this DependentFieldDependentField. - - - :param field_type: The field_type of this DependentFieldDependentField. # noqa: E501 - :type field_type: str - """ - if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 - raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 - allowed_values = ["payment_link_radio"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - - self._field_type = field_type - @property def object_type_id(self): """Gets the object_type_id of this DependentFieldDependentField. # noqa: E501 @@ -180,6 +154,52 @@ def object_type_id(self, object_type_id): self._object_type_id = object_type_id + @property + def hidden(self): + """Gets the hidden of this DependentFieldDependentField. # noqa: E501 + + + :return: The hidden of this DependentFieldDependentField. # noqa: E501 + :rtype: bool + """ + return self._hidden + + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this DependentFieldDependentField. + + + :param hidden: The hidden of this DependentFieldDependentField. # noqa: E501 + :type hidden: bool + """ + if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + + self._hidden = hidden + + @property + def default_value(self): + """Gets the default_value of this DependentFieldDependentField. # noqa: E501 + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :return: The default_value of this DependentFieldDependentField. # noqa: E501 + :rtype: str + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this DependentFieldDependentField. + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :param default_value: The default_value of this DependentFieldDependentField. # noqa: E501 + :type default_value: str + """ + + self._default_value = default_value + @property def name(self): """Gets the name of this DependentFieldDependentField. # noqa: E501 @@ -203,29 +223,6 @@ def name(self, name): self._name = name - @property - def label(self): - """Gets the label of this DependentFieldDependentField. # noqa: E501 - - - :return: The label of this DependentFieldDependentField. # noqa: E501 - :rtype: str - """ - return self._label - - @label.setter - def label(self, label): - """Sets the label of this DependentFieldDependentField. - - - :param label: The label of this DependentFieldDependentField. # noqa: E501 - :type label: str - """ - if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 - raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 - - self._label = label - @property def description(self): """Gets the description of this DependentFieldDependentField. # noqa: E501 @@ -247,52 +244,6 @@ def description(self, description): self._description = description - @property - def required(self): - """Gets the required of this DependentFieldDependentField. # noqa: E501 - - - :return: The required of this DependentFieldDependentField. # noqa: E501 - :rtype: bool - """ - return self._required - - @required.setter - def required(self, required): - """Sets the required of this DependentFieldDependentField. - - - :param required: The required of this DependentFieldDependentField. # noqa: E501 - :type required: bool - """ - if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 - raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 - - self._required = required - - @property - def hidden(self): - """Gets the hidden of this DependentFieldDependentField. # noqa: E501 - - - :return: The hidden of this DependentFieldDependentField. # noqa: E501 - :rtype: bool - """ - return self._hidden - - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this DependentFieldDependentField. - - - :param hidden: The hidden of this DependentFieldDependentField. # noqa: E501 - :type hidden: bool - """ - if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 - - self._hidden = hidden - @property def dependent_fields(self): """Gets the dependent_fields of this DependentFieldDependentField. # noqa: E501 @@ -316,6 +267,29 @@ def dependent_fields(self, dependent_fields): self._dependent_fields = dependent_fields + @property + def label(self): + """Gets the label of this DependentFieldDependentField. # noqa: E501 + + + :return: The label of this DependentFieldDependentField. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this DependentFieldDependentField. + + + :param label: The label of this DependentFieldDependentField. # noqa: E501 + :type label: str + """ + if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + + self._label = label + @property def placeholder(self): """Gets the placeholder of this DependentFieldDependentField. # noqa: E501 @@ -340,27 +314,53 @@ def placeholder(self, placeholder): self._placeholder = placeholder @property - def default_value(self): - """Gets the default_value of this DependentFieldDependentField. # noqa: E501 + def field_type(self): + """Gets the field_type of this DependentFieldDependentField. # noqa: E501 - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 - :return: The default_value of this DependentFieldDependentField. # noqa: E501 + :return: The field_type of this DependentFieldDependentField. # noqa: E501 :rtype: str """ - return self._default_value + return self._field_type - @default_value.setter - def default_value(self, default_value): - """Sets the default_value of this DependentFieldDependentField. + @field_type.setter + def field_type(self, field_type): + """Sets the field_type of this DependentFieldDependentField. - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 - :param default_value: The default_value of this DependentFieldDependentField. # noqa: E501 - :type default_value: str + :param field_type: The field_type of this DependentFieldDependentField. # noqa: E501 + :type field_type: str """ + if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 + raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 + allowed_values = ["payment_link_radio"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - self._default_value = default_value + self._field_type = field_type + + @property + def required(self): + """Gets the required of this DependentFieldDependentField. # noqa: E501 + + + :return: The required of this DependentFieldDependentField. # noqa: E501 + :rtype: bool + """ + return self._required + + @required.setter + def required(self, required): + """Sets the required of this DependentFieldDependentField. + + + :param required: The required of this DependentFieldDependentField. # noqa: E501 + :type required: bool + """ + if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 + raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 + + self._required = required @property def validation(self): @@ -410,29 +410,6 @@ def use_country_code_select(self, use_country_code_select): self._use_country_code_select = use_country_code_select - @property - def default_values(self): - """Gets the default_values of this DependentFieldDependentField. # noqa: E501 - - - :return: The default_values of this DependentFieldDependentField. # noqa: E501 - :rtype: list[str] - """ - return self._default_values - - @default_values.setter - def default_values(self, default_values): - """Sets the default_values of this DependentFieldDependentField. - - - :param default_values: The default_values of this DependentFieldDependentField. # noqa: E501 - :type default_values: list[str] - """ - if self.local_vars_configuration.client_side_validation and default_values is None: # noqa: E501 - raise ValueError("Invalid value for `default_values`, must not be `None`") # noqa: E501 - - self._default_values = default_values - @property def options(self): """Gets the options of this DependentFieldDependentField. # noqa: E501 @@ -456,6 +433,29 @@ def options(self, options): self._options = options + @property + def default_values(self): + """Gets the default_values of this DependentFieldDependentField. # noqa: E501 + + + :return: The default_values of this DependentFieldDependentField. # noqa: E501 + :rtype: list[str] + """ + return self._default_values + + @default_values.setter + def default_values(self, default_values): + """Sets the default_values of this DependentFieldDependentField. + + + :param default_values: The default_values of this DependentFieldDependentField. # noqa: E501 + :type default_values: list[str] + """ + if self.local_vars_configuration.client_side_validation and default_values is None: # noqa: E501 + raise ValueError("Invalid value for `default_values`, must not be `None`") # noqa: E501 + + self._default_values = default_values + @property def allow_multiple_files(self): """Gets the allow_multiple_files of this DependentFieldDependentField. # noqa: E501 diff --git a/hubspot/marketing/forms/models/dependent_field_filter.py b/hubspot/marketing/forms/models/dependent_field_filter.py index 0b7f2c0b..b8b19c6d 100644 --- a/hubspot/marketing/forms/models/dependent_field_filter.py +++ b/hubspot/marketing/forms/models/dependent_field_filter.py @@ -35,33 +35,109 @@ class DependentFieldFilter(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"operator": "str", "value": "str", "values": "list[str]", "range_start": "str", "range_end": "str"} + openapi_types = {"range_start": "str", "values": "list[str]", "value": "str", "operator": "str", "range_end": "str"} - attribute_map = {"operator": "operator", "value": "value", "values": "values", "range_start": "rangeStart", "range_end": "rangeEnd"} + attribute_map = {"range_start": "rangeStart", "values": "values", "value": "value", "operator": "operator", "range_end": "rangeEnd"} - def __init__(self, operator=None, value=None, values=None, range_start=None, range_end=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, range_start=None, values=None, value=None, operator=None, range_end=None, local_vars_configuration=None): # noqa: E501 """DependentFieldFilter - 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._operator = None - self._value = None - self._values = None self._range_start = None + self._values = None + self._value = None + self._operator = None self._range_end = None self.discriminator = None - self.operator = operator - self.value = value - self.values = values self.range_start = range_start + self.values = values + self.value = value + self.operator = operator self.range_end = range_end + @property + def range_start(self): + """Gets the range_start of this DependentFieldFilter. # noqa: E501 + + # noqa: E501 + + :return: The range_start of this DependentFieldFilter. # noqa: E501 + :rtype: str + """ + return self._range_start + + @range_start.setter + def range_start(self, range_start): + """Sets the range_start of this DependentFieldFilter. + + # noqa: E501 + + :param range_start: The range_start of this DependentFieldFilter. # noqa: E501 + :type range_start: str + """ + if self.local_vars_configuration.client_side_validation and range_start is None: # noqa: E501 + raise ValueError("Invalid value for `range_start`, must not be `None`") # noqa: E501 + + self._range_start = range_start + + @property + def values(self): + """Gets the values of this DependentFieldFilter. # noqa: E501 + + # noqa: E501 + + :return: The values of this DependentFieldFilter. # noqa: E501 + :rtype: list[str] + """ + return self._values + + @values.setter + def values(self, values): + """Sets the values of this DependentFieldFilter. + + # noqa: E501 + + :param values: The values of this DependentFieldFilter. # noqa: E501 + :type values: list[str] + """ + if self.local_vars_configuration.client_side_validation and values is None: # noqa: E501 + raise ValueError("Invalid value for `values`, must not be `None`") # noqa: E501 + + self._values = values + + @property + def value(self): + """Gets the value of this DependentFieldFilter. # noqa: E501 + + # noqa: E501 + + :return: The value of this DependentFieldFilter. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this DependentFieldFilter. + + # noqa: E501 + + :param value: The value of this DependentFieldFilter. # 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 operator(self): """Gets the operator of this DependentFieldFilter. # noqa: E501 + # noqa: E501 :return: The operator of this DependentFieldFilter. # noqa: E501 :rtype: str @@ -72,6 +148,7 @@ def operator(self): def operator(self, operator): """Sets the operator of this DependentFieldFilter. + # noqa: E501 :param operator: The operator of this DependentFieldFilter. # noqa: E501 :type operator: str @@ -106,79 +183,11 @@ def operator(self, operator): self._operator = operator - @property - def value(self): - """Gets the value of this DependentFieldFilter. # noqa: E501 - - - :return: The value of this DependentFieldFilter. # noqa: E501 - :rtype: str - """ - return self._value - - @value.setter - def value(self, value): - """Sets the value of this DependentFieldFilter. - - - :param value: The value of this DependentFieldFilter. # 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 values(self): - """Gets the values of this DependentFieldFilter. # noqa: E501 - - - :return: The values of this DependentFieldFilter. # noqa: E501 - :rtype: list[str] - """ - return self._values - - @values.setter - def values(self, values): - """Sets the values of this DependentFieldFilter. - - - :param values: The values of this DependentFieldFilter. # noqa: E501 - :type values: list[str] - """ - if self.local_vars_configuration.client_side_validation and values is None: # noqa: E501 - raise ValueError("Invalid value for `values`, must not be `None`") # noqa: E501 - - self._values = values - - @property - def range_start(self): - """Gets the range_start of this DependentFieldFilter. # noqa: E501 - - - :return: The range_start of this DependentFieldFilter. # noqa: E501 - :rtype: str - """ - return self._range_start - - @range_start.setter - def range_start(self, range_start): - """Sets the range_start of this DependentFieldFilter. - - - :param range_start: The range_start of this DependentFieldFilter. # noqa: E501 - :type range_start: str - """ - if self.local_vars_configuration.client_side_validation and range_start is None: # noqa: E501 - raise ValueError("Invalid value for `range_start`, must not be `None`") # noqa: E501 - - self._range_start = range_start - @property def range_end(self): """Gets the range_end of this DependentFieldFilter. # noqa: E501 + # noqa: E501 :return: The range_end of this DependentFieldFilter. # noqa: E501 :rtype: str @@ -189,6 +198,7 @@ def range_end(self): def range_end(self, range_end): """Sets the range_end of this DependentFieldFilter. + # noqa: E501 :param range_end: The range_end of this DependentFieldFilter. # noqa: E501 :type range_end: str diff --git a/hubspot/marketing/forms/models/dropdown_field.py b/hubspot/marketing/forms/models/dropdown_field.py index 7783235a..c6b232fe 100644 --- a/hubspot/marketing/forms/models/dropdown_field.py +++ b/hubspot/marketing/forms/models/dropdown_field.py @@ -36,46 +36,46 @@ class DropdownField(object): and the value is json key in definition. """ openapi_types = { - "field_type": "str", "object_type_id": "str", + "hidden": "bool", "name": "str", - "label": "str", + "options": "list[EnumeratedFieldOption]", "description": "str", - "required": "bool", - "hidden": "bool", - "dependent_fields": "list[DependentField]", "default_values": "list[str]", - "options": "list[EnumeratedFieldOption]", + "dependent_fields": "list[DependentField]", + "label": "str", "placeholder": "str", + "field_type": "str", + "required": "bool", } attribute_map = { - "field_type": "fieldType", "object_type_id": "objectTypeId", + "hidden": "hidden", "name": "name", - "label": "label", + "options": "options", "description": "description", - "required": "required", - "hidden": "hidden", - "dependent_fields": "dependentFields", "default_values": "defaultValues", - "options": "options", + "dependent_fields": "dependentFields", + "label": "label", "placeholder": "placeholder", + "field_type": "fieldType", + "required": "required", } def __init__( self, - field_type="dropdown", object_type_id=None, + hidden=None, name=None, - label=None, + options=None, description=None, - required=None, - hidden=None, - dependent_fields=None, default_values=None, - options=None, + dependent_fields=None, + label=None, placeholder=None, + field_type="dropdown", + required=None, local_vars_configuration=None, ): # noqa: E501 """DropdownField - a model defined in OpenAPI""" # noqa: E501 @@ -83,60 +83,32 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._field_type = None self._object_type_id = None + self._hidden = None self._name = None - self._label = None + self._options = None self._description = None - self._required = None - self._hidden = None - self._dependent_fields = None self._default_values = None - self._options = None + self._dependent_fields = None + self._label = None self._placeholder = None + self._field_type = None + self._required = None self.discriminator = None - self.field_type = field_type self.object_type_id = object_type_id + self.hidden = hidden self.name = name - self.label = label + self.options = options if description is not None: self.description = description - self.required = required - self.hidden = hidden - self.dependent_fields = dependent_fields self.default_values = default_values - self.options = options + self.dependent_fields = dependent_fields + self.label = label if placeholder is not None: self.placeholder = placeholder - - @property - def field_type(self): - """Gets the field_type of this DropdownField. # noqa: E501 - - Determines how the field will be displayed and validated. # noqa: E501 - - :return: The field_type of this DropdownField. # noqa: E501 - :rtype: str - """ - return self._field_type - - @field_type.setter - def field_type(self, field_type): - """Sets the field_type of this DropdownField. - - Determines how the field will be displayed and validated. # noqa: E501 - - :param field_type: The field_type of this DropdownField. # noqa: E501 - :type field_type: str - """ - if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 - raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 - allowed_values = ["dropdown"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - - self._field_type = field_type + self.field_type = field_type + self.required = required @property def object_type_id(self): @@ -163,6 +135,31 @@ def object_type_id(self, object_type_id): self._object_type_id = object_type_id + @property + def hidden(self): + """Gets the hidden of this DropdownField. # noqa: E501 + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :return: The hidden of this DropdownField. # noqa: E501 + :rtype: bool + """ + return self._hidden + + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this DropdownField. + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :param hidden: The hidden of this DropdownField. # noqa: E501 + :type hidden: bool + """ + if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + + self._hidden = hidden + @property def name(self): """Gets the name of this DropdownField. # noqa: E501 @@ -189,29 +186,29 @@ def name(self, name): self._name = name @property - def label(self): - """Gets the label of this DropdownField. # noqa: E501 + def options(self): + """Gets the options of this DropdownField. # noqa: E501 - The main label for the form field. # noqa: E501 + The list of available choices for this field. # noqa: E501 - :return: The label of this DropdownField. # noqa: E501 - :rtype: str + :return: The options of this DropdownField. # noqa: E501 + :rtype: list[EnumeratedFieldOption] """ - return self._label + return self._options - @label.setter - def label(self, label): - """Sets the label of this DropdownField. + @options.setter + def options(self, options): + """Sets the options of this DropdownField. - The main label for the form field. # noqa: E501 + The list of available choices for this field. # noqa: E501 - :param label: The label of this DropdownField. # noqa: E501 - :type label: str + :param options: The options of this DropdownField. # noqa: E501 + :type options: list[EnumeratedFieldOption] """ - if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 - raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and options is None: # noqa: E501 + raise ValueError("Invalid value for `options`, must not be `None`") # noqa: E501 - self._label = label + self._options = options @property def description(self): @@ -237,54 +234,29 @@ def description(self, description): self._description = description @property - def required(self): - """Gets the required of this DropdownField. # noqa: E501 - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :return: The required of this DropdownField. # noqa: E501 - :rtype: bool - """ - return self._required - - @required.setter - def required(self, required): - """Sets the required of this DropdownField. - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :param required: The required of this DropdownField. # noqa: E501 - :type required: bool - """ - if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 - raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 - - self._required = required - - @property - def hidden(self): - """Gets the hidden of this DropdownField. # noqa: E501 + def default_values(self): + """Gets the default_values of this DropdownField. # noqa: E501 - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + The values selected by default. Those values will be submitted unless the customer modifies them. # noqa: E501 - :return: The hidden of this DropdownField. # noqa: E501 - :rtype: bool + :return: The default_values of this DropdownField. # noqa: E501 + :rtype: list[str] """ - return self._hidden + return self._default_values - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this DropdownField. + @default_values.setter + def default_values(self, default_values): + """Sets the default_values of this DropdownField. - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + The values selected by default. Those values will be submitted unless the customer modifies them. # noqa: E501 - :param hidden: The hidden of this DropdownField. # noqa: E501 - :type hidden: bool + :param default_values: The default_values of this DropdownField. # noqa: E501 + :type default_values: list[str] """ - if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and default_values is None: # noqa: E501 + raise ValueError("Invalid value for `default_values`, must not be `None`") # noqa: E501 - self._hidden = hidden + self._default_values = default_values @property def dependent_fields(self): @@ -312,54 +284,29 @@ def dependent_fields(self, dependent_fields): self._dependent_fields = dependent_fields @property - def default_values(self): - """Gets the default_values of this DropdownField. # noqa: E501 - - The values selected by default. Those values will be submitted unless the customer modifies them. # noqa: E501 - - :return: The default_values of this DropdownField. # noqa: E501 - :rtype: list[str] - """ - return self._default_values - - @default_values.setter - def default_values(self, default_values): - """Sets the default_values of this DropdownField. - - The values selected by default. Those values will be submitted unless the customer modifies them. # noqa: E501 - - :param default_values: The default_values of this DropdownField. # noqa: E501 - :type default_values: list[str] - """ - if self.local_vars_configuration.client_side_validation and default_values is None: # noqa: E501 - raise ValueError("Invalid value for `default_values`, must not be `None`") # noqa: E501 - - self._default_values = default_values - - @property - def options(self): - """Gets the options of this DropdownField. # noqa: E501 + def label(self): + """Gets the label of this DropdownField. # noqa: E501 - The list of available choices for this field. # noqa: E501 + The main label for the form field. # noqa: E501 - :return: The options of this DropdownField. # noqa: E501 - :rtype: list[EnumeratedFieldOption] + :return: The label of this DropdownField. # noqa: E501 + :rtype: str """ - return self._options + return self._label - @options.setter - def options(self, options): - """Sets the options of this DropdownField. + @label.setter + def label(self, label): + """Sets the label of this DropdownField. - The list of available choices for this field. # noqa: E501 + The main label for the form field. # noqa: E501 - :param options: The options of this DropdownField. # noqa: E501 - :type options: list[EnumeratedFieldOption] + :param label: The label of this DropdownField. # noqa: E501 + :type label: str """ - if self.local_vars_configuration.client_side_validation and options is None: # noqa: E501 - raise ValueError("Invalid value for `options`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 - self._options = options + self._label = label @property def placeholder(self): @@ -384,6 +331,59 @@ def placeholder(self, placeholder): self._placeholder = placeholder + @property + def field_type(self): + """Gets the field_type of this DropdownField. # noqa: E501 + + Determines how the field will be displayed and validated. # noqa: E501 + + :return: The field_type of this DropdownField. # noqa: E501 + :rtype: str + """ + return self._field_type + + @field_type.setter + def field_type(self, field_type): + """Sets the field_type of this DropdownField. + + Determines how the field will be displayed and validated. # noqa: E501 + + :param field_type: The field_type of this DropdownField. # noqa: E501 + :type field_type: str + """ + if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 + raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 + allowed_values = ["dropdown"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 + + self._field_type = field_type + + @property + def required(self): + """Gets the required of this DropdownField. # noqa: E501 + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :return: The required of this DropdownField. # noqa: E501 + :rtype: bool + """ + return self._required + + @required.setter + def required(self, required): + """Sets the required of this DropdownField. + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :param required: The required of this DropdownField. # noqa: E501 + :type required: bool + """ + if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 + raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 + + self._required = required + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} diff --git a/hubspot/marketing/forms/models/email_field.py b/hubspot/marketing/forms/models/email_field.py index c5970142..f850987e 100644 --- a/hubspot/marketing/forms/models/email_field.py +++ b/hubspot/marketing/forms/models/email_field.py @@ -36,45 +36,45 @@ class EmailField(object): and the value is json key in definition. """ openapi_types = { - "field_type": "str", "object_type_id": "str", + "hidden": "bool", + "default_value": "str", "name": "str", - "label": "str", "description": "str", - "required": "bool", - "hidden": "bool", "dependent_fields": "list[DependentField]", + "label": "str", "placeholder": "str", - "default_value": "str", + "field_type": "str", + "required": "bool", "validation": "EmailFieldValidation", } attribute_map = { - "field_type": "fieldType", "object_type_id": "objectTypeId", + "hidden": "hidden", + "default_value": "defaultValue", "name": "name", - "label": "label", "description": "description", - "required": "required", - "hidden": "hidden", "dependent_fields": "dependentFields", + "label": "label", "placeholder": "placeholder", - "default_value": "defaultValue", + "field_type": "fieldType", + "required": "required", "validation": "validation", } def __init__( self, - field_type="email", object_type_id=None, + hidden=None, + default_value=None, name=None, - label=None, description=None, - required=None, - hidden=None, dependent_fields=None, + label=None, placeholder=None, - default_value=None, + field_type="email", + required=None, validation=None, local_vars_configuration=None, ): # noqa: E501 @@ -83,62 +83,34 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._field_type = None self._object_type_id = None + self._hidden = None + self._default_value = None self._name = None - self._label = None self._description = None - self._required = None - self._hidden = None self._dependent_fields = None + self._label = None self._placeholder = None - self._default_value = None + self._field_type = None + self._required = None self._validation = None self.discriminator = None - self.field_type = field_type self.object_type_id = object_type_id + self.hidden = hidden + if default_value is not None: + self.default_value = default_value self.name = name - self.label = label if description is not None: self.description = description - self.required = required - self.hidden = hidden self.dependent_fields = dependent_fields + self.label = label if placeholder is not None: self.placeholder = placeholder - if default_value is not None: - self.default_value = default_value + self.field_type = field_type + self.required = required self.validation = validation - @property - def field_type(self): - """Gets the field_type of this EmailField. # noqa: E501 - - Determines how the field will be displayed and validated. # noqa: E501 - - :return: The field_type of this EmailField. # noqa: E501 - :rtype: str - """ - return self._field_type - - @field_type.setter - def field_type(self, field_type): - """Sets the field_type of this EmailField. - - Determines how the field will be displayed and validated. # noqa: E501 - - :param field_type: The field_type of this EmailField. # noqa: E501 - :type field_type: str - """ - if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 - raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 - allowed_values = ["email"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - - self._field_type = field_type - @property def object_type_id(self): """Gets the object_type_id of this EmailField. # noqa: E501 @@ -164,6 +136,54 @@ def object_type_id(self, object_type_id): self._object_type_id = object_type_id + @property + def hidden(self): + """Gets the hidden of this EmailField. # noqa: E501 + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :return: The hidden of this EmailField. # noqa: E501 + :rtype: bool + """ + return self._hidden + + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this EmailField. + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :param hidden: The hidden of this EmailField. # noqa: E501 + :type hidden: bool + """ + if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + + self._hidden = hidden + + @property + def default_value(self): + """Gets the default_value of this EmailField. # noqa: E501 + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :return: The default_value of this EmailField. # noqa: E501 + :rtype: str + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this EmailField. + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :param default_value: The default_value of this EmailField. # noqa: E501 + :type default_value: str + """ + + self._default_value = default_value + @property def name(self): """Gets the name of this EmailField. # noqa: E501 @@ -189,31 +209,6 @@ def name(self, name): self._name = name - @property - def label(self): - """Gets the label of this EmailField. # noqa: E501 - - The main label for the form field. # noqa: E501 - - :return: The label of this EmailField. # noqa: E501 - :rtype: str - """ - return self._label - - @label.setter - def label(self, label): - """Sets the label of this EmailField. - - The main label for the form field. # noqa: E501 - - :param label: The label of this EmailField. # noqa: E501 - :type label: str - """ - if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 - raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 - - self._label = label - @property def description(self): """Gets the description of this EmailField. # noqa: E501 @@ -237,56 +232,6 @@ def description(self, description): self._description = description - @property - def required(self): - """Gets the required of this EmailField. # noqa: E501 - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :return: The required of this EmailField. # noqa: E501 - :rtype: bool - """ - return self._required - - @required.setter - def required(self, required): - """Sets the required of this EmailField. - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :param required: The required of this EmailField. # noqa: E501 - :type required: bool - """ - if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 - raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 - - self._required = required - - @property - def hidden(self): - """Gets the hidden of this EmailField. # noqa: E501 - - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - - :return: The hidden of this EmailField. # noqa: E501 - :rtype: bool - """ - return self._hidden - - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this EmailField. - - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - - :param hidden: The hidden of this EmailField. # noqa: E501 - :type hidden: bool - """ - if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 - - self._hidden = hidden - @property def dependent_fields(self): """Gets the dependent_fields of this EmailField. # noqa: E501 @@ -312,6 +257,31 @@ def dependent_fields(self, dependent_fields): self._dependent_fields = dependent_fields + @property + def label(self): + """Gets the label of this EmailField. # noqa: E501 + + The main label for the form field. # noqa: E501 + + :return: The label of this EmailField. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this EmailField. + + The main label for the form field. # noqa: E501 + + :param label: The label of this EmailField. # noqa: E501 + :type label: str + """ + if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + + self._label = label + @property def placeholder(self): """Gets the placeholder of this EmailField. # noqa: E501 @@ -336,27 +306,57 @@ def placeholder(self, placeholder): self._placeholder = placeholder @property - def default_value(self): - """Gets the default_value of this EmailField. # noqa: E501 + def field_type(self): + """Gets the field_type of this EmailField. # noqa: E501 - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :return: The default_value of this EmailField. # noqa: E501 + :return: The field_type of this EmailField. # noqa: E501 :rtype: str """ - return self._default_value + return self._field_type - @default_value.setter - def default_value(self, default_value): - """Sets the default_value of this EmailField. + @field_type.setter + def field_type(self, field_type): + """Sets the field_type of this EmailField. - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :param default_value: The default_value of this EmailField. # noqa: E501 - :type default_value: str + :param field_type: The field_type of this EmailField. # noqa: E501 + :type field_type: str """ + if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 + raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 + allowed_values = ["email"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - self._default_value = default_value + self._field_type = field_type + + @property + def required(self): + """Gets the required of this EmailField. # noqa: E501 + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :return: The required of this EmailField. # noqa: E501 + :rtype: bool + """ + return self._required + + @required.setter + def required(self, required): + """Sets the required of this EmailField. + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :param required: The required of this EmailField. # noqa: E501 + :type required: bool + """ + if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 + raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 + + self._required = required @property def validation(self): diff --git a/hubspot/marketing/forms/models/email_field_validation.py b/hubspot/marketing/forms/models/email_field_validation.py index 764d4747..b95f036c 100644 --- a/hubspot/marketing/forms/models/email_field_validation.py +++ b/hubspot/marketing/forms/models/email_field_validation.py @@ -35,47 +35,22 @@ class EmailFieldValidation(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"blocked_email_domains": "list[str]", "use_default_block_list": "bool"} + openapi_types = {"use_default_block_list": "bool", "blocked_email_domains": "list[str]"} - attribute_map = {"blocked_email_domains": "blockedEmailDomains", "use_default_block_list": "useDefaultBlockList"} + attribute_map = {"use_default_block_list": "useDefaultBlockList", "blocked_email_domains": "blockedEmailDomains"} - def __init__(self, blocked_email_domains=None, use_default_block_list=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, use_default_block_list=None, blocked_email_domains=None, local_vars_configuration=None): # noqa: E501 """EmailFieldValidation - 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._blocked_email_domains = None self._use_default_block_list = None + self._blocked_email_domains = None self.discriminator = None - self.blocked_email_domains = blocked_email_domains self.use_default_block_list = use_default_block_list - - @property - def blocked_email_domains(self): - """Gets the blocked_email_domains of this EmailFieldValidation. # noqa: E501 - - A list of email domains to block. # noqa: E501 - - :return: The blocked_email_domains of this EmailFieldValidation. # noqa: E501 - :rtype: list[str] - """ - return self._blocked_email_domains - - @blocked_email_domains.setter - def blocked_email_domains(self, blocked_email_domains): - """Sets the blocked_email_domains of this EmailFieldValidation. - - A list of email domains to block. # noqa: E501 - - :param blocked_email_domains: The blocked_email_domains of this EmailFieldValidation. # noqa: E501 - :type blocked_email_domains: list[str] - """ - if self.local_vars_configuration.client_side_validation and blocked_email_domains is None: # noqa: E501 - raise ValueError("Invalid value for `blocked_email_domains`, must not be `None`") # noqa: E501 - - self._blocked_email_domains = blocked_email_domains + self.blocked_email_domains = blocked_email_domains @property def use_default_block_list(self): @@ -102,6 +77,31 @@ def use_default_block_list(self, use_default_block_list): self._use_default_block_list = use_default_block_list + @property + def blocked_email_domains(self): + """Gets the blocked_email_domains of this EmailFieldValidation. # noqa: E501 + + A list of email domains to block. # noqa: E501 + + :return: The blocked_email_domains of this EmailFieldValidation. # noqa: E501 + :rtype: list[str] + """ + return self._blocked_email_domains + + @blocked_email_domains.setter + def blocked_email_domains(self, blocked_email_domains): + """Sets the blocked_email_domains of this EmailFieldValidation. + + A list of email domains to block. # noqa: E501 + + :param blocked_email_domains: The blocked_email_domains of this EmailFieldValidation. # noqa: E501 + :type blocked_email_domains: list[str] + """ + if self.local_vars_configuration.client_side_validation and blocked_email_domains is None: # noqa: E501 + raise ValueError("Invalid value for `blocked_email_domains`, must not be `None`") # noqa: E501 + + self._blocked_email_domains = blocked_email_domains + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} diff --git a/hubspot/marketing/forms/models/enumerated_field_option.py b/hubspot/marketing/forms/models/enumerated_field_option.py index 44dda3d2..c38ac0b7 100644 --- a/hubspot/marketing/forms/models/enumerated_field_option.py +++ b/hubspot/marketing/forms/models/enumerated_field_option.py @@ -35,27 +35,75 @@ class EnumeratedFieldOption(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"label": "str", "value": "str", "description": "str", "display_order": "int"} + openapi_types = {"display_order": "int", "description": "str", "label": "str", "value": "str"} - attribute_map = {"label": "label", "value": "value", "description": "description", "display_order": "displayOrder"} + attribute_map = {"display_order": "displayOrder", "description": "description", "label": "label", "value": "value"} - def __init__(self, label=None, value=None, description=None, display_order=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, display_order=None, description=None, label=None, value=None, local_vars_configuration=None): # noqa: E501 """EnumeratedFieldOption - 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._display_order = None + self._description = None self._label = None self._value = None - self._description = None - self._display_order = None self.discriminator = None - self.label = label - self.value = value + self.display_order = display_order if description is not None: self.description = description - self.display_order = display_order + self.label = label + self.value = value + + @property + def display_order(self): + """Gets the display_order of this EnumeratedFieldOption. # noqa: E501 + + The order the choices will be displayed in. # noqa: E501 + + :return: The display_order of this EnumeratedFieldOption. # noqa: E501 + :rtype: int + """ + return self._display_order + + @display_order.setter + def display_order(self, display_order): + """Sets the display_order of this EnumeratedFieldOption. + + The order the choices will be displayed in. # noqa: E501 + + :param display_order: The display_order of this EnumeratedFieldOption. # noqa: E501 + :type display_order: int + """ + if self.local_vars_configuration.client_side_validation and display_order is None: # noqa: E501 + raise ValueError("Invalid value for `display_order`, must not be `None`") # noqa: E501 + + self._display_order = display_order + + @property + def description(self): + """Gets the description of this EnumeratedFieldOption. # noqa: E501 + + # noqa: E501 + + :return: The description of this EnumeratedFieldOption. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this EnumeratedFieldOption. + + # noqa: E501 + + :param description: The description of this EnumeratedFieldOption. # noqa: E501 + :type description: str + """ + + self._description = description @property def label(self): @@ -107,52 +155,6 @@ def value(self, value): self._value = value - @property - def description(self): - """Gets the description of this EnumeratedFieldOption. # noqa: E501 - - - :return: The description of this EnumeratedFieldOption. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this EnumeratedFieldOption. - - - :param description: The description of this EnumeratedFieldOption. # noqa: E501 - :type description: str - """ - - self._description = description - - @property - def display_order(self): - """Gets the display_order of this EnumeratedFieldOption. # noqa: E501 - - The order the choices will be displayed in. # noqa: E501 - - :return: The display_order of this EnumeratedFieldOption. # noqa: E501 - :rtype: int - """ - return self._display_order - - @display_order.setter - def display_order(self, display_order): - """Sets the display_order of this EnumeratedFieldOption. - - The order the choices will be displayed in. # noqa: E501 - - :param display_order: The display_order of this EnumeratedFieldOption. # noqa: E501 - :type display_order: int - """ - if self.local_vars_configuration.client_side_validation and display_order is None: # noqa: E501 - raise ValueError("Invalid value for `display_order`, must not be `None`") # noqa: E501 - - self._display_order = display_order - def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} diff --git a/hubspot/marketing/forms/models/file_field.py b/hubspot/marketing/forms/models/file_field.py index a83ad2c7..0905a721 100644 --- a/hubspot/marketing/forms/models/file_field.py +++ b/hubspot/marketing/forms/models/file_field.py @@ -36,46 +36,46 @@ class FileField(object): and the value is json key in definition. """ openapi_types = { - "field_type": "str", "object_type_id": "str", + "allow_multiple_files": "bool", + "hidden": "bool", + "default_value": "str", "name": "str", - "label": "str", "description": "str", - "required": "bool", - "hidden": "bool", "dependent_fields": "list[DependentField]", + "label": "str", "placeholder": "str", - "default_value": "str", - "allow_multiple_files": "bool", + "field_type": "str", + "required": "bool", } attribute_map = { - "field_type": "fieldType", "object_type_id": "objectTypeId", + "allow_multiple_files": "allowMultipleFiles", + "hidden": "hidden", + "default_value": "defaultValue", "name": "name", - "label": "label", "description": "description", - "required": "required", - "hidden": "hidden", "dependent_fields": "dependentFields", + "label": "label", "placeholder": "placeholder", - "default_value": "defaultValue", - "allow_multiple_files": "allowMultipleFiles", + "field_type": "fieldType", + "required": "required", } def __init__( self, - field_type="file", object_type_id=None, + allow_multiple_files=None, + hidden=None, + default_value=None, name=None, - label=None, description=None, - required=None, - hidden=None, dependent_fields=None, + label=None, placeholder=None, - default_value=None, - allow_multiple_files=None, + field_type="file", + required=None, local_vars_configuration=None, ): # noqa: E501 """FileField - a model defined in OpenAPI""" # noqa: E501 @@ -83,61 +83,33 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._field_type = None self._object_type_id = None + self._allow_multiple_files = None + self._hidden = None + self._default_value = None self._name = None - self._label = None self._description = None - self._required = None - self._hidden = None self._dependent_fields = None + self._label = None self._placeholder = None - self._default_value = None - self._allow_multiple_files = None + self._field_type = None + self._required = None self.discriminator = None - self.field_type = field_type self.object_type_id = object_type_id + self.allow_multiple_files = allow_multiple_files + self.hidden = hidden + if default_value is not None: + self.default_value = default_value self.name = name - self.label = label if description is not None: self.description = description - self.required = required - self.hidden = hidden self.dependent_fields = dependent_fields + self.label = label if placeholder is not None: self.placeholder = placeholder - if default_value is not None: - self.default_value = default_value - self.allow_multiple_files = allow_multiple_files - - @property - def field_type(self): - """Gets the field_type of this FileField. # noqa: E501 - - Determines how the field will be displayed and validated. # noqa: E501 - - :return: The field_type of this FileField. # noqa: E501 - :rtype: str - """ - return self._field_type - - @field_type.setter - def field_type(self, field_type): - """Sets the field_type of this FileField. - - Determines how the field will be displayed and validated. # noqa: E501 - - :param field_type: The field_type of this FileField. # noqa: E501 - :type field_type: str - """ - if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 - raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 - allowed_values = ["file"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - - self._field_type = field_type + self.field_type = field_type + self.required = required @property def object_type_id(self): @@ -165,127 +137,125 @@ def object_type_id(self, object_type_id): self._object_type_id = object_type_id @property - def name(self): - """Gets the name of this FileField. # noqa: E501 + def allow_multiple_files(self): + """Gets the allow_multiple_files of this FileField. # noqa: E501 - The identifier of the field. In combination with the object type ID, it must be unique. # noqa: E501 + Whether to allow the upload of multiple files. # noqa: E501 - :return: The name of this FileField. # noqa: E501 - :rtype: str + :return: The allow_multiple_files of this FileField. # noqa: E501 + :rtype: bool """ - return self._name + return self._allow_multiple_files - @name.setter - def name(self, name): - """Sets the name of this FileField. + @allow_multiple_files.setter + def allow_multiple_files(self, allow_multiple_files): + """Sets the allow_multiple_files of this FileField. - The identifier of the field. In combination with the object type ID, it must be unique. # noqa: E501 + Whether to allow the upload of multiple files. # noqa: E501 - :param name: The name of this FileField. # noqa: E501 - :type name: str + :param allow_multiple_files: The allow_multiple_files of this FileField. # noqa: E501 + :type allow_multiple_files: bool """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and allow_multiple_files is None: # noqa: E501 + raise ValueError("Invalid value for `allow_multiple_files`, must not be `None`") # noqa: E501 - self._name = name + self._allow_multiple_files = allow_multiple_files @property - def label(self): - """Gets the label of this FileField. # noqa: E501 + def hidden(self): + """Gets the hidden of this FileField. # noqa: E501 - The main label for the form field. # noqa: E501 + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - :return: The label of this FileField. # noqa: E501 - :rtype: str + :return: The hidden of this FileField. # noqa: E501 + :rtype: bool """ - return self._label + return self._hidden - @label.setter - def label(self, label): - """Sets the label of this FileField. + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this FileField. - The main label for the form field. # noqa: E501 + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - :param label: The label of this FileField. # noqa: E501 - :type label: str + :param hidden: The hidden of this FileField. # noqa: E501 + :type hidden: bool """ - if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 - raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 - self._label = label + self._hidden = hidden @property - def description(self): - """Gets the description of this FileField. # noqa: E501 + def default_value(self): + """Gets the default_value of this FileField. # noqa: E501 - Additional text helping the customer to complete the field. # noqa: E501 + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 - :return: The description of this FileField. # noqa: E501 + :return: The default_value of this FileField. # noqa: E501 :rtype: str """ - return self._description + return self._default_value - @description.setter - def description(self, description): - """Sets the description of this FileField. + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this FileField. - Additional text helping the customer to complete the field. # noqa: E501 + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 - :param description: The description of this FileField. # noqa: E501 - :type description: str + :param default_value: The default_value of this FileField. # noqa: E501 + :type default_value: str """ - self._description = description + self._default_value = default_value @property - def required(self): - """Gets the required of this FileField. # noqa: E501 + def name(self): + """Gets the name of this FileField. # noqa: E501 - Whether a value for this field is required when submitting the form. # noqa: E501 + The identifier of the field. In combination with the object type ID, it must be unique. # noqa: E501 - :return: The required of this FileField. # noqa: E501 - :rtype: bool + :return: The name of this FileField. # noqa: E501 + :rtype: str """ - return self._required + return self._name - @required.setter - def required(self, required): - """Sets the required of this FileField. + @name.setter + def name(self, name): + """Sets the name of this FileField. - Whether a value for this field is required when submitting the form. # noqa: E501 + The identifier of the field. In combination with the object type ID, it must be unique. # noqa: E501 - :param required: The required of this FileField. # noqa: E501 - :type required: bool + :param name: The name of this FileField. # noqa: E501 + :type name: str """ - if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 - raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._required = required + self._name = name @property - def hidden(self): - """Gets the hidden of this FileField. # noqa: E501 + def description(self): + """Gets the description of this FileField. # noqa: E501 - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + Additional text helping the customer to complete the field. # noqa: E501 - :return: The hidden of this FileField. # noqa: E501 - :rtype: bool + :return: The description of this FileField. # noqa: E501 + :rtype: str """ - return self._hidden + return self._description - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this FileField. + @description.setter + def description(self, description): + """Sets the description of this FileField. - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + Additional text helping the customer to complete the field. # noqa: E501 - :param hidden: The hidden of this FileField. # noqa: E501 - :type hidden: bool + :param description: The description of this FileField. # noqa: E501 + :type description: str """ - if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 - self._hidden = hidden + self._description = description @property def dependent_fields(self): @@ -312,6 +282,31 @@ def dependent_fields(self, dependent_fields): self._dependent_fields = dependent_fields + @property + def label(self): + """Gets the label of this FileField. # noqa: E501 + + The main label for the form field. # noqa: E501 + + :return: The label of this FileField. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this FileField. + + The main label for the form field. # noqa: E501 + + :param label: The label of this FileField. # noqa: E501 + :type label: str + """ + if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + + self._label = label + @property def placeholder(self): """Gets the placeholder of this FileField. # noqa: E501 @@ -336,52 +331,57 @@ def placeholder(self, placeholder): self._placeholder = placeholder @property - def default_value(self): - """Gets the default_value of this FileField. # noqa: E501 + def field_type(self): + """Gets the field_type of this FileField. # noqa: E501 - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :return: The default_value of this FileField. # noqa: E501 + :return: The field_type of this FileField. # noqa: E501 :rtype: str """ - return self._default_value + return self._field_type - @default_value.setter - def default_value(self, default_value): - """Sets the default_value of this FileField. + @field_type.setter + def field_type(self, field_type): + """Sets the field_type of this FileField. - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :param default_value: The default_value of this FileField. # noqa: E501 - :type default_value: str + :param field_type: The field_type of this FileField. # noqa: E501 + :type field_type: str """ + if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 + raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 + allowed_values = ["file"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - self._default_value = default_value + self._field_type = field_type @property - def allow_multiple_files(self): - """Gets the allow_multiple_files of this FileField. # noqa: E501 + def required(self): + """Gets the required of this FileField. # noqa: E501 - Whether to allow the upload of multiple files. # noqa: E501 + Whether a value for this field is required when submitting the form. # noqa: E501 - :return: The allow_multiple_files of this FileField. # noqa: E501 + :return: The required of this FileField. # noqa: E501 :rtype: bool """ - return self._allow_multiple_files + return self._required - @allow_multiple_files.setter - def allow_multiple_files(self, allow_multiple_files): - """Sets the allow_multiple_files of this FileField. + @required.setter + def required(self, required): + """Sets the required of this FileField. - Whether to allow the upload of multiple files. # noqa: E501 + Whether a value for this field is required when submitting the form. # noqa: E501 - :param allow_multiple_files: The allow_multiple_files of this FileField. # noqa: E501 - :type allow_multiple_files: bool + :param required: The required of this FileField. # noqa: E501 + :type required: bool """ - if self.local_vars_configuration.client_side_validation and allow_multiple_files is None: # noqa: E501 - raise ValueError("Invalid value for `allow_multiple_files`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 + raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 - self._allow_multiple_files = allow_multiple_files + self._required = required def to_dict(self, serialize=False): """Returns the model properties as a dict""" diff --git a/hubspot/marketing/forms/models/hub_spot_form_definition_all_of_legal_consent_options.py b/hubspot/marketing/forms/models/hub_spot_form_definition_all_of_legal_consent_options.py index 4c7361ca..da7c9d8c 100644 --- a/hubspot/marketing/forms/models/hub_spot_form_definition_all_of_legal_consent_options.py +++ b/hubspot/marketing/forms/models/hub_spot_form_definition_all_of_legal_consent_options.py @@ -40,11 +40,11 @@ class HubSpotFormDefinitionAllOfLegalConsentOptions(object): "subscription_type_ids": "list[int]", "lawful_basis": "str", "privacy_text": "str", - "communication_consent_text": "str", "communications_checkboxes": "list[LegalConsentCheckbox]", - "consent_to_process_text": "str", + "communication_consent_text": "str", "consent_to_process_checkbox_label": "str", "consent_to_process_footer_text": "str", + "consent_to_process_text": "str", } attribute_map = { @@ -52,11 +52,11 @@ class HubSpotFormDefinitionAllOfLegalConsentOptions(object): "subscription_type_ids": "subscriptionTypeIds", "lawful_basis": "lawfulBasis", "privacy_text": "privacyText", - "communication_consent_text": "communicationConsentText", "communications_checkboxes": "communicationsCheckboxes", - "consent_to_process_text": "consentToProcessText", + "communication_consent_text": "communicationConsentText", "consent_to_process_checkbox_label": "consentToProcessCheckboxLabel", "consent_to_process_footer_text": "consentToProcessFooterText", + "consent_to_process_text": "consentToProcessText", } def __init__( @@ -65,11 +65,11 @@ def __init__( subscription_type_ids=None, lawful_basis=None, privacy_text=None, - communication_consent_text=None, communications_checkboxes=None, - consent_to_process_text=None, + communication_consent_text=None, consent_to_process_checkbox_label=None, consent_to_process_footer_text=None, + consent_to_process_text=None, local_vars_configuration=None, ): # noqa: E501 """HubSpotFormDefinitionAllOfLegalConsentOptions - a model defined in OpenAPI""" # noqa: E501 @@ -81,31 +81,32 @@ def __init__( self._subscription_type_ids = None self._lawful_basis = None self._privacy_text = None - self._communication_consent_text = None self._communications_checkboxes = None - self._consent_to_process_text = None + self._communication_consent_text = None self._consent_to_process_checkbox_label = None self._consent_to_process_footer_text = None + self._consent_to_process_text = None self.discriminator = None self.type = type self.subscription_type_ids = subscription_type_ids self.lawful_basis = lawful_basis self.privacy_text = privacy_text + self.communications_checkboxes = communications_checkboxes if communication_consent_text is not None: self.communication_consent_text = communication_consent_text - self.communications_checkboxes = communications_checkboxes - if consent_to_process_text is not None: - self.consent_to_process_text = consent_to_process_text if consent_to_process_checkbox_label is not None: self.consent_to_process_checkbox_label = consent_to_process_checkbox_label if consent_to_process_footer_text is not None: self.consent_to_process_footer_text = consent_to_process_footer_text + if consent_to_process_text is not None: + self.consent_to_process_text = consent_to_process_text @property def type(self): """Gets the type of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 + # noqa: E501 :return: The type of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 :rtype: str @@ -116,6 +117,7 @@ def type(self): def type(self, type): """Sets the type of this HubSpotFormDefinitionAllOfLegalConsentOptions. + # noqa: E501 :param type: The type of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 :type type: str @@ -132,6 +134,7 @@ def type(self, type): def subscription_type_ids(self): """Gets the subscription_type_ids of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 + # noqa: E501 :return: The subscription_type_ids of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 :rtype: list[int] @@ -142,6 +145,7 @@ def subscription_type_ids(self): def subscription_type_ids(self, subscription_type_ids): """Sets the subscription_type_ids of this HubSpotFormDefinitionAllOfLegalConsentOptions. + # noqa: E501 :param subscription_type_ids: The subscription_type_ids of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 :type subscription_type_ids: list[int] @@ -155,6 +159,7 @@ def subscription_type_ids(self, subscription_type_ids): def lawful_basis(self): """Gets the lawful_basis of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 + # noqa: E501 :return: The lawful_basis of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 :rtype: str @@ -165,6 +170,7 @@ def lawful_basis(self): def lawful_basis(self, lawful_basis): """Sets the lawful_basis of this HubSpotFormDefinitionAllOfLegalConsentOptions. + # noqa: E501 :param lawful_basis: The lawful_basis of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 :type lawful_basis: str @@ -181,6 +187,7 @@ def lawful_basis(self, lawful_basis): def privacy_text(self): """Gets the privacy_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 + # noqa: E501 :return: The privacy_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 :rtype: str @@ -191,6 +198,7 @@ def privacy_text(self): def privacy_text(self, privacy_text): """Sets the privacy_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. + # noqa: E501 :param privacy_text: The privacy_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 :type privacy_text: str @@ -200,31 +208,11 @@ def privacy_text(self, privacy_text): self._privacy_text = privacy_text - @property - def communication_consent_text(self): - """Gets the communication_consent_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 - - - :return: The communication_consent_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 - :rtype: str - """ - return self._communication_consent_text - - @communication_consent_text.setter - def communication_consent_text(self, communication_consent_text): - """Sets the communication_consent_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. - - - :param communication_consent_text: The communication_consent_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 - :type communication_consent_text: str - """ - - self._communication_consent_text = communication_consent_text - @property def communications_checkboxes(self): """Gets the communications_checkboxes of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 + # noqa: E501 :return: The communications_checkboxes of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 :rtype: list[LegalConsentCheckbox] @@ -235,6 +223,7 @@ def communications_checkboxes(self): def communications_checkboxes(self, communications_checkboxes): """Sets the communications_checkboxes of this HubSpotFormDefinitionAllOfLegalConsentOptions. + # noqa: E501 :param communications_checkboxes: The communications_checkboxes of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 :type communications_checkboxes: list[LegalConsentCheckbox] @@ -245,30 +234,33 @@ def communications_checkboxes(self, communications_checkboxes): self._communications_checkboxes = communications_checkboxes @property - def consent_to_process_text(self): - """Gets the consent_to_process_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 + def communication_consent_text(self): + """Gets the communication_consent_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 + # noqa: E501 - :return: The consent_to_process_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 + :return: The communication_consent_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 :rtype: str """ - return self._consent_to_process_text + return self._communication_consent_text - @consent_to_process_text.setter - def consent_to_process_text(self, consent_to_process_text): - """Sets the consent_to_process_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. + @communication_consent_text.setter + def communication_consent_text(self, communication_consent_text): + """Sets the communication_consent_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. + # noqa: E501 - :param consent_to_process_text: The consent_to_process_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 - :type consent_to_process_text: str + :param communication_consent_text: The communication_consent_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 + :type communication_consent_text: str """ - self._consent_to_process_text = consent_to_process_text + self._communication_consent_text = communication_consent_text @property def consent_to_process_checkbox_label(self): """Gets the consent_to_process_checkbox_label of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 + # noqa: E501 :return: The consent_to_process_checkbox_label of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 :rtype: str @@ -279,6 +271,7 @@ def consent_to_process_checkbox_label(self): def consent_to_process_checkbox_label(self, consent_to_process_checkbox_label): """Sets the consent_to_process_checkbox_label of this HubSpotFormDefinitionAllOfLegalConsentOptions. + # noqa: E501 :param consent_to_process_checkbox_label: The consent_to_process_checkbox_label of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 :type consent_to_process_checkbox_label: str @@ -290,6 +283,7 @@ def consent_to_process_checkbox_label(self, consent_to_process_checkbox_label): def consent_to_process_footer_text(self): """Gets the consent_to_process_footer_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 + # noqa: E501 :return: The consent_to_process_footer_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 :rtype: str @@ -300,6 +294,7 @@ def consent_to_process_footer_text(self): def consent_to_process_footer_text(self, consent_to_process_footer_text): """Sets the consent_to_process_footer_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. + # noqa: E501 :param consent_to_process_footer_text: The consent_to_process_footer_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 :type consent_to_process_footer_text: str @@ -307,6 +302,29 @@ def consent_to_process_footer_text(self, consent_to_process_footer_text): self._consent_to_process_footer_text = consent_to_process_footer_text + @property + def consent_to_process_text(self): + """Gets the consent_to_process_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 + + # noqa: E501 + + :return: The consent_to_process_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 + :rtype: str + """ + return self._consent_to_process_text + + @consent_to_process_text.setter + def consent_to_process_text(self, consent_to_process_text): + """Sets the consent_to_process_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. + + # noqa: E501 + + :param consent_to_process_text: The consent_to_process_text of this HubSpotFormDefinitionAllOfLegalConsentOptions. # noqa: E501 + :type consent_to_process_text: str + """ + + self._consent_to_process_text = consent_to_process_text + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} diff --git a/hubspot/marketing/forms/models/legal_consent_checkbox.py b/hubspot/marketing/forms/models/legal_consent_checkbox.py index 7e69a8c9..12a5fed0 100644 --- a/hubspot/marketing/forms/models/legal_consent_checkbox.py +++ b/hubspot/marketing/forms/models/legal_consent_checkbox.py @@ -35,54 +35,30 @@ class LegalConsentCheckbox(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"required": "bool", "subscription_type_id": "int", "label": "str"} + openapi_types = {"subscription_type_id": "int", "label": "str", "required": "bool"} - attribute_map = {"required": "required", "subscription_type_id": "subscriptionTypeId", "label": "label"} + attribute_map = {"subscription_type_id": "subscriptionTypeId", "label": "label", "required": "required"} - def __init__(self, required=None, subscription_type_id=None, label=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, subscription_type_id=None, label=None, required=None, local_vars_configuration=None): # noqa: E501 """LegalConsentCheckbox - 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._required = None self._subscription_type_id = None self._label = None + self._required = None self.discriminator = None - self.required = required self.subscription_type_id = subscription_type_id self.label = label - - @property - def required(self): - """Gets the required of this LegalConsentCheckbox. # noqa: E501 - - Whether this checkbox is required when submitting the form. # noqa: E501 - - :return: The required of this LegalConsentCheckbox. # noqa: E501 - :rtype: bool - """ - return self._required - - @required.setter - def required(self, required): - """Sets the required of this LegalConsentCheckbox. - - Whether this checkbox is required when submitting the form. # noqa: E501 - - :param required: The required of this LegalConsentCheckbox. # noqa: E501 - :type required: bool - """ - if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 - raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 - - self._required = required + self.required = required @property def subscription_type_id(self): """Gets the subscription_type_id of this LegalConsentCheckbox. # noqa: E501 + # noqa: E501 :return: The subscription_type_id of this LegalConsentCheckbox. # noqa: E501 :rtype: int @@ -93,6 +69,7 @@ def subscription_type_id(self): def subscription_type_id(self, subscription_type_id): """Sets the subscription_type_id of this LegalConsentCheckbox. + # noqa: E501 :param subscription_type_id: The subscription_type_id of this LegalConsentCheckbox. # noqa: E501 :type subscription_type_id: int @@ -127,6 +104,31 @@ def label(self, label): self._label = label + @property + def required(self): + """Gets the required of this LegalConsentCheckbox. # noqa: E501 + + Whether this checkbox is required when submitting the form. # noqa: E501 + + :return: The required of this LegalConsentCheckbox. # noqa: E501 + :rtype: bool + """ + return self._required + + @required.setter + def required(self, required): + """Sets the required of this LegalConsentCheckbox. + + Whether this checkbox is required when submitting the form. # noqa: E501 + + :param required: The required of this LegalConsentCheckbox. # noqa: E501 + :type required: bool + """ + if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 + raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 + + self._required = required + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} diff --git a/hubspot/marketing/forms/models/legal_consent_options_explicit_consent_to_process.py b/hubspot/marketing/forms/models/legal_consent_options_explicit_consent_to_process.py index 5284e0f5..18461bc8 100644 --- a/hubspot/marketing/forms/models/legal_consent_options_explicit_consent_to_process.py +++ b/hubspot/marketing/forms/models/legal_consent_options_explicit_consent_to_process.py @@ -36,34 +36,34 @@ class LegalConsentOptionsExplicitConsentToProcess(object): and the value is json key in definition. """ openapi_types = { - "type": "str", - "communication_consent_text": "str", "communications_checkboxes": "list[LegalConsentCheckbox]", - "consent_to_process_text": "str", + "communication_consent_text": "str", "consent_to_process_checkbox_label": "str", "consent_to_process_footer_text": "str", + "type": "str", "privacy_text": "str", + "consent_to_process_text": "str", } attribute_map = { - "type": "type", - "communication_consent_text": "communicationConsentText", "communications_checkboxes": "communicationsCheckboxes", - "consent_to_process_text": "consentToProcessText", + "communication_consent_text": "communicationConsentText", "consent_to_process_checkbox_label": "consentToProcessCheckboxLabel", "consent_to_process_footer_text": "consentToProcessFooterText", + "type": "type", "privacy_text": "privacyText", + "consent_to_process_text": "consentToProcessText", } def __init__( self, - type="explicit_consent_to_process", - communication_consent_text=None, communications_checkboxes=None, - consent_to_process_text=None, + communication_consent_text=None, consent_to_process_checkbox_label=None, consent_to_process_footer_text=None, + type="explicit_consent_to_process", privacy_text=None, + consent_to_process_text=None, local_vars_configuration=None, ): # noqa: E501 """LegalConsentOptionsExplicitConsentToProcess - a model defined in OpenAPI""" # noqa: E501 @@ -71,78 +71,32 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._type = None - self._communication_consent_text = None self._communications_checkboxes = None - self._consent_to_process_text = None + self._communication_consent_text = None self._consent_to_process_checkbox_label = None self._consent_to_process_footer_text = None + self._type = None self._privacy_text = None + self._consent_to_process_text = None self.discriminator = None - self.type = type + self.communications_checkboxes = communications_checkboxes if communication_consent_text is not None: self.communication_consent_text = communication_consent_text - self.communications_checkboxes = communications_checkboxes - if consent_to_process_text is not None: - self.consent_to_process_text = consent_to_process_text if consent_to_process_checkbox_label is not None: self.consent_to_process_checkbox_label = consent_to_process_checkbox_label if consent_to_process_footer_text is not None: self.consent_to_process_footer_text = consent_to_process_footer_text + self.type = type self.privacy_text = privacy_text - - @property - def type(self): - """Gets the type of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 - - - :return: The type of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this LegalConsentOptionsExplicitConsentToProcess. - - - :param type: The type of this LegalConsentOptionsExplicitConsentToProcess. # 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 - allowed_values = ["explicit_consent_to_process"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `type` ({0}), must be one of {1}".format(type, allowed_values)) # noqa: E501 - - self._type = type - - @property - def communication_consent_text(self): - """Gets the communication_consent_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 - - - :return: The communication_consent_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 - :rtype: str - """ - return self._communication_consent_text - - @communication_consent_text.setter - def communication_consent_text(self, communication_consent_text): - """Sets the communication_consent_text of this LegalConsentOptionsExplicitConsentToProcess. - - - :param communication_consent_text: The communication_consent_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 - :type communication_consent_text: str - """ - - self._communication_consent_text = communication_consent_text + if consent_to_process_text is not None: + self.consent_to_process_text = consent_to_process_text @property def communications_checkboxes(self): """Gets the communications_checkboxes of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 + # noqa: E501 :return: The communications_checkboxes of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 :rtype: list[LegalConsentCheckbox] @@ -153,6 +107,7 @@ def communications_checkboxes(self): def communications_checkboxes(self, communications_checkboxes): """Sets the communications_checkboxes of this LegalConsentOptionsExplicitConsentToProcess. + # noqa: E501 :param communications_checkboxes: The communications_checkboxes of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 :type communications_checkboxes: list[LegalConsentCheckbox] @@ -163,30 +118,33 @@ def communications_checkboxes(self, communications_checkboxes): self._communications_checkboxes = communications_checkboxes @property - def consent_to_process_text(self): - """Gets the consent_to_process_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 + def communication_consent_text(self): + """Gets the communication_consent_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 + # noqa: E501 - :return: The consent_to_process_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 + :return: The communication_consent_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 :rtype: str """ - return self._consent_to_process_text + return self._communication_consent_text - @consent_to_process_text.setter - def consent_to_process_text(self, consent_to_process_text): - """Sets the consent_to_process_text of this LegalConsentOptionsExplicitConsentToProcess. + @communication_consent_text.setter + def communication_consent_text(self, communication_consent_text): + """Sets the communication_consent_text of this LegalConsentOptionsExplicitConsentToProcess. + # noqa: E501 - :param consent_to_process_text: The consent_to_process_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 - :type consent_to_process_text: str + :param communication_consent_text: The communication_consent_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 + :type communication_consent_text: str """ - self._consent_to_process_text = consent_to_process_text + self._communication_consent_text = communication_consent_text @property def consent_to_process_checkbox_label(self): """Gets the consent_to_process_checkbox_label of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 + # noqa: E501 :return: The consent_to_process_checkbox_label of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 :rtype: str @@ -197,6 +155,7 @@ def consent_to_process_checkbox_label(self): def consent_to_process_checkbox_label(self, consent_to_process_checkbox_label): """Sets the consent_to_process_checkbox_label of this LegalConsentOptionsExplicitConsentToProcess. + # noqa: E501 :param consent_to_process_checkbox_label: The consent_to_process_checkbox_label of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 :type consent_to_process_checkbox_label: str @@ -208,6 +167,7 @@ def consent_to_process_checkbox_label(self, consent_to_process_checkbox_label): def consent_to_process_footer_text(self): """Gets the consent_to_process_footer_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 + # noqa: E501 :return: The consent_to_process_footer_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 :rtype: str @@ -218,6 +178,7 @@ def consent_to_process_footer_text(self): def consent_to_process_footer_text(self, consent_to_process_footer_text): """Sets the consent_to_process_footer_text of this LegalConsentOptionsExplicitConsentToProcess. + # noqa: E501 :param consent_to_process_footer_text: The consent_to_process_footer_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 :type consent_to_process_footer_text: str @@ -225,10 +186,39 @@ def consent_to_process_footer_text(self, consent_to_process_footer_text): self._consent_to_process_footer_text = consent_to_process_footer_text + @property + def type(self): + """Gets the type of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 + + # noqa: E501 + + :return: The type of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this LegalConsentOptionsExplicitConsentToProcess. + + # noqa: E501 + + :param type: The type of this LegalConsentOptionsExplicitConsentToProcess. # 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 + allowed_values = ["explicit_consent_to_process"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `type` ({0}), must be one of {1}".format(type, allowed_values)) # noqa: E501 + + self._type = type + @property def privacy_text(self): """Gets the privacy_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 + # noqa: E501 :return: The privacy_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 :rtype: str @@ -239,6 +229,7 @@ def privacy_text(self): def privacy_text(self, privacy_text): """Sets the privacy_text of this LegalConsentOptionsExplicitConsentToProcess. + # noqa: E501 :param privacy_text: The privacy_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 :type privacy_text: str @@ -248,6 +239,29 @@ def privacy_text(self, privacy_text): self._privacy_text = privacy_text + @property + def consent_to_process_text(self): + """Gets the consent_to_process_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 + + # noqa: E501 + + :return: The consent_to_process_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 + :rtype: str + """ + return self._consent_to_process_text + + @consent_to_process_text.setter + def consent_to_process_text(self, consent_to_process_text): + """Sets the consent_to_process_text of this LegalConsentOptionsExplicitConsentToProcess. + + # noqa: E501 + + :param consent_to_process_text: The consent_to_process_text of this LegalConsentOptionsExplicitConsentToProcess. # noqa: E501 + :type consent_to_process_text: str + """ + + self._consent_to_process_text = consent_to_process_text + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} diff --git a/hubspot/marketing/forms/models/legal_consent_options_implicit_consent_to_process.py b/hubspot/marketing/forms/models/legal_consent_options_implicit_consent_to_process.py index c6b48eba..4a182da7 100644 --- a/hubspot/marketing/forms/models/legal_consent_options_implicit_consent_to_process.py +++ b/hubspot/marketing/forms/models/legal_consent_options_implicit_consent_to_process.py @@ -35,69 +35,69 @@ class LegalConsentOptionsImplicitConsentToProcess(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"type": "str", "communication_consent_text": "str", "communications_checkboxes": "list[LegalConsentCheckbox]", "privacy_text": "str", "consent_to_process_text": "str"} + openapi_types = {"communications_checkboxes": "list[LegalConsentCheckbox]", "communication_consent_text": "str", "type": "str", "privacy_text": "str", "consent_to_process_text": "str"} attribute_map = { - "type": "type", - "communication_consent_text": "communicationConsentText", "communications_checkboxes": "communicationsCheckboxes", + "communication_consent_text": "communicationConsentText", + "type": "type", "privacy_text": "privacyText", "consent_to_process_text": "consentToProcessText", } def __init__( - self, type="implicit_consent_to_process", communication_consent_text=None, communications_checkboxes=None, privacy_text=None, consent_to_process_text=None, local_vars_configuration=None + self, communications_checkboxes=None, communication_consent_text=None, type="implicit_consent_to_process", privacy_text=None, consent_to_process_text=None, local_vars_configuration=None ): # noqa: E501 """LegalConsentOptionsImplicitConsentToProcess - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._type = None - self._communication_consent_text = None self._communications_checkboxes = None + self._communication_consent_text = None + self._type = None self._privacy_text = None self._consent_to_process_text = None self.discriminator = None - self.type = type + self.communications_checkboxes = communications_checkboxes if communication_consent_text is not None: self.communication_consent_text = communication_consent_text - self.communications_checkboxes = communications_checkboxes + self.type = type self.privacy_text = privacy_text if consent_to_process_text is not None: self.consent_to_process_text = consent_to_process_text @property - def type(self): - """Gets the type of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 + def communications_checkboxes(self): + """Gets the communications_checkboxes of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 + # noqa: E501 - :return: The type of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 - :rtype: str + :return: The communications_checkboxes of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 + :rtype: list[LegalConsentCheckbox] """ - return self._type + return self._communications_checkboxes - @type.setter - def type(self, type): - """Sets the type of this LegalConsentOptionsImplicitConsentToProcess. + @communications_checkboxes.setter + def communications_checkboxes(self, communications_checkboxes): + """Sets the communications_checkboxes of this LegalConsentOptionsImplicitConsentToProcess. + # noqa: E501 - :param type: The type of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 - :type type: str + :param communications_checkboxes: The communications_checkboxes of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 + :type communications_checkboxes: list[LegalConsentCheckbox] """ - 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 - allowed_values = ["implicit_consent_to_process"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `type` ({0}), must be one of {1}".format(type, allowed_values)) # noqa: E501 + if self.local_vars_configuration.client_side_validation and communications_checkboxes is None: # noqa: E501 + raise ValueError("Invalid value for `communications_checkboxes`, must not be `None`") # noqa: E501 - self._type = type + self._communications_checkboxes = communications_checkboxes @property def communication_consent_text(self): """Gets the communication_consent_text of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 + # noqa: E501 :return: The communication_consent_text of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 :rtype: str @@ -108,6 +108,7 @@ def communication_consent_text(self): def communication_consent_text(self, communication_consent_text): """Sets the communication_consent_text of this LegalConsentOptionsImplicitConsentToProcess. + # noqa: E501 :param communication_consent_text: The communication_consent_text of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 :type communication_consent_text: str @@ -116,32 +117,38 @@ def communication_consent_text(self, communication_consent_text): self._communication_consent_text = communication_consent_text @property - def communications_checkboxes(self): - """Gets the communications_checkboxes of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 + def type(self): + """Gets the type of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 + # noqa: E501 - :return: The communications_checkboxes of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 - :rtype: list[LegalConsentCheckbox] + :return: The type of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 + :rtype: str """ - return self._communications_checkboxes + return self._type - @communications_checkboxes.setter - def communications_checkboxes(self, communications_checkboxes): - """Sets the communications_checkboxes of this LegalConsentOptionsImplicitConsentToProcess. + @type.setter + def type(self, type): + """Sets the type of this LegalConsentOptionsImplicitConsentToProcess. + # noqa: E501 - :param communications_checkboxes: The communications_checkboxes of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 - :type communications_checkboxes: list[LegalConsentCheckbox] + :param type: The type of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 + :type type: str """ - if self.local_vars_configuration.client_side_validation and communications_checkboxes is None: # noqa: E501 - raise ValueError("Invalid value for `communications_checkboxes`, must not be `None`") # noqa: E501 + 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 + allowed_values = ["implicit_consent_to_process"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `type` ({0}), must be one of {1}".format(type, allowed_values)) # noqa: E501 - self._communications_checkboxes = communications_checkboxes + self._type = type @property def privacy_text(self): """Gets the privacy_text of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 + # noqa: E501 :return: The privacy_text of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 :rtype: str @@ -152,6 +159,7 @@ def privacy_text(self): def privacy_text(self, privacy_text): """Sets the privacy_text of this LegalConsentOptionsImplicitConsentToProcess. + # noqa: E501 :param privacy_text: The privacy_text of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 :type privacy_text: str @@ -165,6 +173,7 @@ def privacy_text(self, privacy_text): def consent_to_process_text(self): """Gets the consent_to_process_text of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 + # noqa: E501 :return: The consent_to_process_text of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 :rtype: str @@ -175,6 +184,7 @@ def consent_to_process_text(self): def consent_to_process_text(self, consent_to_process_text): """Sets the consent_to_process_text of this LegalConsentOptionsImplicitConsentToProcess. + # noqa: E501 :param consent_to_process_text: The consent_to_process_text of this LegalConsentOptionsImplicitConsentToProcess. # noqa: E501 :type consent_to_process_text: str diff --git a/hubspot/marketing/forms/models/legal_consent_options_legitimate_interest.py b/hubspot/marketing/forms/models/legal_consent_options_legitimate_interest.py index 53c6c7fb..9b0bb250 100644 --- a/hubspot/marketing/forms/models/legal_consent_options_legitimate_interest.py +++ b/hubspot/marketing/forms/models/legal_consent_options_legitimate_interest.py @@ -35,57 +35,32 @@ class LegalConsentOptionsLegitimateInterest(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"type": "str", "subscription_type_ids": "list[int]", "lawful_basis": "str", "privacy_text": "str"} + openapi_types = {"subscription_type_ids": "list[int]", "lawful_basis": "str", "type": "str", "privacy_text": "str"} - attribute_map = {"type": "type", "subscription_type_ids": "subscriptionTypeIds", "lawful_basis": "lawfulBasis", "privacy_text": "privacyText"} + attribute_map = {"subscription_type_ids": "subscriptionTypeIds", "lawful_basis": "lawfulBasis", "type": "type", "privacy_text": "privacyText"} - def __init__(self, type="legitimate_interest", subscription_type_ids=None, lawful_basis=None, privacy_text=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, subscription_type_ids=None, lawful_basis=None, type="legitimate_interest", privacy_text=None, local_vars_configuration=None): # noqa: E501 """LegalConsentOptionsLegitimateInterest - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._type = None self._subscription_type_ids = None self._lawful_basis = None + self._type = None self._privacy_text = None self.discriminator = None - self.type = type self.subscription_type_ids = subscription_type_ids self.lawful_basis = lawful_basis + self.type = type self.privacy_text = privacy_text - @property - def type(self): - """Gets the type of this LegalConsentOptionsLegitimateInterest. # noqa: E501 - - - :return: The type of this LegalConsentOptionsLegitimateInterest. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this LegalConsentOptionsLegitimateInterest. - - - :param type: The type of this LegalConsentOptionsLegitimateInterest. # 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 - allowed_values = ["legitimate_interest"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `type` ({0}), must be one of {1}".format(type, allowed_values)) # noqa: E501 - - self._type = type - @property def subscription_type_ids(self): """Gets the subscription_type_ids of this LegalConsentOptionsLegitimateInterest. # noqa: E501 + # noqa: E501 :return: The subscription_type_ids of this LegalConsentOptionsLegitimateInterest. # noqa: E501 :rtype: list[int] @@ -96,6 +71,7 @@ def subscription_type_ids(self): def subscription_type_ids(self, subscription_type_ids): """Sets the subscription_type_ids of this LegalConsentOptionsLegitimateInterest. + # noqa: E501 :param subscription_type_ids: The subscription_type_ids of this LegalConsentOptionsLegitimateInterest. # noqa: E501 :type subscription_type_ids: list[int] @@ -109,6 +85,7 @@ def subscription_type_ids(self, subscription_type_ids): def lawful_basis(self): """Gets the lawful_basis of this LegalConsentOptionsLegitimateInterest. # noqa: E501 + # noqa: E501 :return: The lawful_basis of this LegalConsentOptionsLegitimateInterest. # noqa: E501 :rtype: str @@ -119,6 +96,7 @@ def lawful_basis(self): def lawful_basis(self, lawful_basis): """Sets the lawful_basis of this LegalConsentOptionsLegitimateInterest. + # noqa: E501 :param lawful_basis: The lawful_basis of this LegalConsentOptionsLegitimateInterest. # noqa: E501 :type lawful_basis: str @@ -131,10 +109,39 @@ def lawful_basis(self, lawful_basis): self._lawful_basis = lawful_basis + @property + def type(self): + """Gets the type of this LegalConsentOptionsLegitimateInterest. # noqa: E501 + + # noqa: E501 + + :return: The type of this LegalConsentOptionsLegitimateInterest. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this LegalConsentOptionsLegitimateInterest. + + # noqa: E501 + + :param type: The type of this LegalConsentOptionsLegitimateInterest. # 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 + allowed_values = ["legitimate_interest"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `type` ({0}), must be one of {1}".format(type, allowed_values)) # noqa: E501 + + self._type = type + @property def privacy_text(self): """Gets the privacy_text of this LegalConsentOptionsLegitimateInterest. # noqa: E501 + # noqa: E501 :return: The privacy_text of this LegalConsentOptionsLegitimateInterest. # noqa: E501 :rtype: str @@ -145,6 +152,7 @@ def privacy_text(self): def privacy_text(self, privacy_text): """Sets the privacy_text of this LegalConsentOptionsLegitimateInterest. + # noqa: E501 :param privacy_text: The privacy_text of this LegalConsentOptionsLegitimateInterest. # noqa: E501 :type privacy_text: str diff --git a/hubspot/marketing/forms/models/legal_consent_options_none.py b/hubspot/marketing/forms/models/legal_consent_options_none.py index cb2f2801..d8753203 100644 --- a/hubspot/marketing/forms/models/legal_consent_options_none.py +++ b/hubspot/marketing/forms/models/legal_consent_options_none.py @@ -54,6 +54,7 @@ def __init__(self, type="none", local_vars_configuration=None): # noqa: E501 def type(self): """Gets the type of this LegalConsentOptionsNone. # noqa: E501 + # noqa: E501 :return: The type of this LegalConsentOptionsNone. # noqa: E501 :rtype: str @@ -64,6 +65,7 @@ def type(self): def type(self, type): """Sets the type of this LegalConsentOptionsNone. + # noqa: E501 :param type: The type of this LegalConsentOptionsNone. # noqa: E501 :type type: str diff --git a/hubspot/marketing/forms/models/mobile_phone_field.py b/hubspot/marketing/forms/models/mobile_phone_field.py index 2a89629d..180c0123 100644 --- a/hubspot/marketing/forms/models/mobile_phone_field.py +++ b/hubspot/marketing/forms/models/mobile_phone_field.py @@ -36,45 +36,45 @@ class MobilePhoneField(object): and the value is json key in definition. """ openapi_types = { - "field_type": "str", "object_type_id": "str", + "hidden": "bool", + "default_value": "str", "name": "str", - "label": "str", "description": "str", - "required": "bool", - "hidden": "bool", "dependent_fields": "list[DependentField]", + "label": "str", "placeholder": "str", - "default_value": "str", + "field_type": "str", + "required": "bool", "validation": "PhoneFieldValidation", } attribute_map = { - "field_type": "fieldType", "object_type_id": "objectTypeId", + "hidden": "hidden", + "default_value": "defaultValue", "name": "name", - "label": "label", "description": "description", - "required": "required", - "hidden": "hidden", "dependent_fields": "dependentFields", + "label": "label", "placeholder": "placeholder", - "default_value": "defaultValue", + "field_type": "fieldType", + "required": "required", "validation": "validation", } def __init__( self, - field_type="mobile_phone", object_type_id=None, + hidden=None, + default_value=None, name=None, - label=None, description=None, - required=None, - hidden=None, dependent_fields=None, + label=None, placeholder=None, - default_value=None, + field_type="mobile_phone", + required=None, validation=None, local_vars_configuration=None, ): # noqa: E501 @@ -83,62 +83,34 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._field_type = None self._object_type_id = None + self._hidden = None + self._default_value = None self._name = None - self._label = None self._description = None - self._required = None - self._hidden = None self._dependent_fields = None + self._label = None self._placeholder = None - self._default_value = None + self._field_type = None + self._required = None self._validation = None self.discriminator = None - self.field_type = field_type self.object_type_id = object_type_id + self.hidden = hidden + if default_value is not None: + self.default_value = default_value self.name = name - self.label = label if description is not None: self.description = description - self.required = required - self.hidden = hidden self.dependent_fields = dependent_fields + self.label = label if placeholder is not None: self.placeholder = placeholder - if default_value is not None: - self.default_value = default_value + self.field_type = field_type + self.required = required self.validation = validation - @property - def field_type(self): - """Gets the field_type of this MobilePhoneField. # noqa: E501 - - Determines how the field will be displayed and validated. # noqa: E501 - - :return: The field_type of this MobilePhoneField. # noqa: E501 - :rtype: str - """ - return self._field_type - - @field_type.setter - def field_type(self, field_type): - """Sets the field_type of this MobilePhoneField. - - Determines how the field will be displayed and validated. # noqa: E501 - - :param field_type: The field_type of this MobilePhoneField. # noqa: E501 - :type field_type: str - """ - if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 - raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 - allowed_values = ["mobile_phone"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - - self._field_type = field_type - @property def object_type_id(self): """Gets the object_type_id of this MobilePhoneField. # noqa: E501 @@ -164,6 +136,54 @@ def object_type_id(self, object_type_id): self._object_type_id = object_type_id + @property + def hidden(self): + """Gets the hidden of this MobilePhoneField. # noqa: E501 + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :return: The hidden of this MobilePhoneField. # noqa: E501 + :rtype: bool + """ + return self._hidden + + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this MobilePhoneField. + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :param hidden: The hidden of this MobilePhoneField. # noqa: E501 + :type hidden: bool + """ + if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + + self._hidden = hidden + + @property + def default_value(self): + """Gets the default_value of this MobilePhoneField. # noqa: E501 + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :return: The default_value of this MobilePhoneField. # noqa: E501 + :rtype: str + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this MobilePhoneField. + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :param default_value: The default_value of this MobilePhoneField. # noqa: E501 + :type default_value: str + """ + + self._default_value = default_value + @property def name(self): """Gets the name of this MobilePhoneField. # noqa: E501 @@ -189,31 +209,6 @@ def name(self, name): self._name = name - @property - def label(self): - """Gets the label of this MobilePhoneField. # noqa: E501 - - The main label for the form field. # noqa: E501 - - :return: The label of this MobilePhoneField. # noqa: E501 - :rtype: str - """ - return self._label - - @label.setter - def label(self, label): - """Sets the label of this MobilePhoneField. - - The main label for the form field. # noqa: E501 - - :param label: The label of this MobilePhoneField. # noqa: E501 - :type label: str - """ - if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 - raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 - - self._label = label - @property def description(self): """Gets the description of this MobilePhoneField. # noqa: E501 @@ -237,56 +232,6 @@ def description(self, description): self._description = description - @property - def required(self): - """Gets the required of this MobilePhoneField. # noqa: E501 - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :return: The required of this MobilePhoneField. # noqa: E501 - :rtype: bool - """ - return self._required - - @required.setter - def required(self, required): - """Sets the required of this MobilePhoneField. - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :param required: The required of this MobilePhoneField. # noqa: E501 - :type required: bool - """ - if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 - raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 - - self._required = required - - @property - def hidden(self): - """Gets the hidden of this MobilePhoneField. # noqa: E501 - - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - - :return: The hidden of this MobilePhoneField. # noqa: E501 - :rtype: bool - """ - return self._hidden - - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this MobilePhoneField. - - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - - :param hidden: The hidden of this MobilePhoneField. # noqa: E501 - :type hidden: bool - """ - if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 - - self._hidden = hidden - @property def dependent_fields(self): """Gets the dependent_fields of this MobilePhoneField. # noqa: E501 @@ -312,6 +257,31 @@ def dependent_fields(self, dependent_fields): self._dependent_fields = dependent_fields + @property + def label(self): + """Gets the label of this MobilePhoneField. # noqa: E501 + + The main label for the form field. # noqa: E501 + + :return: The label of this MobilePhoneField. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this MobilePhoneField. + + The main label for the form field. # noqa: E501 + + :param label: The label of this MobilePhoneField. # noqa: E501 + :type label: str + """ + if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + + self._label = label + @property def placeholder(self): """Gets the placeholder of this MobilePhoneField. # noqa: E501 @@ -336,27 +306,57 @@ def placeholder(self, placeholder): self._placeholder = placeholder @property - def default_value(self): - """Gets the default_value of this MobilePhoneField. # noqa: E501 + def field_type(self): + """Gets the field_type of this MobilePhoneField. # noqa: E501 - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :return: The default_value of this MobilePhoneField. # noqa: E501 + :return: The field_type of this MobilePhoneField. # noqa: E501 :rtype: str """ - return self._default_value + return self._field_type - @default_value.setter - def default_value(self, default_value): - """Sets the default_value of this MobilePhoneField. + @field_type.setter + def field_type(self, field_type): + """Sets the field_type of this MobilePhoneField. - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :param default_value: The default_value of this MobilePhoneField. # noqa: E501 - :type default_value: str + :param field_type: The field_type of this MobilePhoneField. # noqa: E501 + :type field_type: str """ + if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 + raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 + allowed_values = ["mobile_phone"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - self._default_value = default_value + self._field_type = field_type + + @property + def required(self): + """Gets the required of this MobilePhoneField. # noqa: E501 + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :return: The required of this MobilePhoneField. # noqa: E501 + :rtype: bool + """ + return self._required + + @required.setter + def required(self, required): + """Sets the required of this MobilePhoneField. + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :param required: The required of this MobilePhoneField. # noqa: E501 + :type required: bool + """ + if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 + raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 + + self._required = required @property def validation(self): diff --git a/hubspot/marketing/forms/models/multi_line_text_field.py b/hubspot/marketing/forms/models/multi_line_text_field.py index 5267ff8c..825ce3b0 100644 --- a/hubspot/marketing/forms/models/multi_line_text_field.py +++ b/hubspot/marketing/forms/models/multi_line_text_field.py @@ -36,43 +36,43 @@ class MultiLineTextField(object): and the value is json key in definition. """ openapi_types = { - "field_type": "str", "object_type_id": "str", + "hidden": "bool", + "default_value": "str", "name": "str", - "label": "str", "description": "str", - "required": "bool", - "hidden": "bool", "dependent_fields": "list[DependentField]", + "label": "str", "placeholder": "str", - "default_value": "str", + "field_type": "str", + "required": "bool", } attribute_map = { - "field_type": "fieldType", "object_type_id": "objectTypeId", + "hidden": "hidden", + "default_value": "defaultValue", "name": "name", - "label": "label", "description": "description", - "required": "required", - "hidden": "hidden", "dependent_fields": "dependentFields", + "label": "label", "placeholder": "placeholder", - "default_value": "defaultValue", + "field_type": "fieldType", + "required": "required", } def __init__( self, - field_type="multi_line_text", object_type_id=None, + hidden=None, + default_value=None, name=None, - label=None, description=None, - required=None, - hidden=None, dependent_fields=None, + label=None, placeholder=None, - default_value=None, + field_type="multi_line_text", + required=None, local_vars_configuration=None, ): # noqa: E501 """MultiLineTextField - a model defined in OpenAPI""" # noqa: E501 @@ -80,59 +80,31 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._field_type = None self._object_type_id = None + self._hidden = None + self._default_value = None self._name = None - self._label = None self._description = None - self._required = None - self._hidden = None self._dependent_fields = None + self._label = None self._placeholder = None - self._default_value = None + self._field_type = None + self._required = None self.discriminator = None - self.field_type = field_type self.object_type_id = object_type_id + self.hidden = hidden + if default_value is not None: + self.default_value = default_value self.name = name - self.label = label if description is not None: self.description = description - self.required = required - self.hidden = hidden self.dependent_fields = dependent_fields + self.label = label if placeholder is not None: self.placeholder = placeholder - if default_value is not None: - self.default_value = default_value - - @property - def field_type(self): - """Gets the field_type of this MultiLineTextField. # noqa: E501 - - Determines how the field will be displayed and validated. # noqa: E501 - - :return: The field_type of this MultiLineTextField. # noqa: E501 - :rtype: str - """ - return self._field_type - - @field_type.setter - def field_type(self, field_type): - """Sets the field_type of this MultiLineTextField. - - Determines how the field will be displayed and validated. # noqa: E501 - - :param field_type: The field_type of this MultiLineTextField. # noqa: E501 - :type field_type: str - """ - if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 - raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 - allowed_values = ["multi_line_text"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - - self._field_type = field_type + self.field_type = field_type + self.required = required @property def object_type_id(self): @@ -159,6 +131,54 @@ def object_type_id(self, object_type_id): self._object_type_id = object_type_id + @property + def hidden(self): + """Gets the hidden of this MultiLineTextField. # noqa: E501 + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :return: The hidden of this MultiLineTextField. # noqa: E501 + :rtype: bool + """ + return self._hidden + + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this MultiLineTextField. + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :param hidden: The hidden of this MultiLineTextField. # noqa: E501 + :type hidden: bool + """ + if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + + self._hidden = hidden + + @property + def default_value(self): + """Gets the default_value of this MultiLineTextField. # noqa: E501 + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :return: The default_value of this MultiLineTextField. # noqa: E501 + :rtype: str + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this MultiLineTextField. + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :param default_value: The default_value of this MultiLineTextField. # noqa: E501 + :type default_value: str + """ + + self._default_value = default_value + @property def name(self): """Gets the name of this MultiLineTextField. # noqa: E501 @@ -184,31 +204,6 @@ def name(self, name): self._name = name - @property - def label(self): - """Gets the label of this MultiLineTextField. # noqa: E501 - - The main label for the form field. # noqa: E501 - - :return: The label of this MultiLineTextField. # noqa: E501 - :rtype: str - """ - return self._label - - @label.setter - def label(self, label): - """Sets the label of this MultiLineTextField. - - The main label for the form field. # noqa: E501 - - :param label: The label of this MultiLineTextField. # noqa: E501 - :type label: str - """ - if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 - raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 - - self._label = label - @property def description(self): """Gets the description of this MultiLineTextField. # noqa: E501 @@ -232,56 +227,6 @@ def description(self, description): self._description = description - @property - def required(self): - """Gets the required of this MultiLineTextField. # noqa: E501 - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :return: The required of this MultiLineTextField. # noqa: E501 - :rtype: bool - """ - return self._required - - @required.setter - def required(self, required): - """Sets the required of this MultiLineTextField. - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :param required: The required of this MultiLineTextField. # noqa: E501 - :type required: bool - """ - if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 - raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 - - self._required = required - - @property - def hidden(self): - """Gets the hidden of this MultiLineTextField. # noqa: E501 - - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - - :return: The hidden of this MultiLineTextField. # noqa: E501 - :rtype: bool - """ - return self._hidden - - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this MultiLineTextField. - - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - - :param hidden: The hidden of this MultiLineTextField. # noqa: E501 - :type hidden: bool - """ - if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 - - self._hidden = hidden - @property def dependent_fields(self): """Gets the dependent_fields of this MultiLineTextField. # noqa: E501 @@ -307,6 +252,31 @@ def dependent_fields(self, dependent_fields): self._dependent_fields = dependent_fields + @property + def label(self): + """Gets the label of this MultiLineTextField. # noqa: E501 + + The main label for the form field. # noqa: E501 + + :return: The label of this MultiLineTextField. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this MultiLineTextField. + + The main label for the form field. # noqa: E501 + + :param label: The label of this MultiLineTextField. # noqa: E501 + :type label: str + """ + if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + + self._label = label + @property def placeholder(self): """Gets the placeholder of this MultiLineTextField. # noqa: E501 @@ -331,27 +301,57 @@ def placeholder(self, placeholder): self._placeholder = placeholder @property - def default_value(self): - """Gets the default_value of this MultiLineTextField. # noqa: E501 + def field_type(self): + """Gets the field_type of this MultiLineTextField. # noqa: E501 - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :return: The default_value of this MultiLineTextField. # noqa: E501 + :return: The field_type of this MultiLineTextField. # noqa: E501 :rtype: str """ - return self._default_value + return self._field_type - @default_value.setter - def default_value(self, default_value): - """Sets the default_value of this MultiLineTextField. + @field_type.setter + def field_type(self, field_type): + """Sets the field_type of this MultiLineTextField. - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :param default_value: The default_value of this MultiLineTextField. # noqa: E501 - :type default_value: str + :param field_type: The field_type of this MultiLineTextField. # noqa: E501 + :type field_type: str """ + if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 + raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 + allowed_values = ["multi_line_text"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - self._default_value = default_value + self._field_type = field_type + + @property + def required(self): + """Gets the required of this MultiLineTextField. # noqa: E501 + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :return: The required of this MultiLineTextField. # noqa: E501 + :rtype: bool + """ + return self._required + + @required.setter + def required(self, required): + """Sets the required of this MultiLineTextField. + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :param required: The required of this MultiLineTextField. # noqa: E501 + :type required: bool + """ + if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 + raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 + + self._required = required def to_dict(self, serialize=False): """Returns the model properties as a dict""" diff --git a/hubspot/marketing/forms/models/multiple_checkboxes_field.py b/hubspot/marketing/forms/models/multiple_checkboxes_field.py index 9fc11925..461246f6 100644 --- a/hubspot/marketing/forms/models/multiple_checkboxes_field.py +++ b/hubspot/marketing/forms/models/multiple_checkboxes_field.py @@ -36,43 +36,43 @@ class MultipleCheckboxesField(object): and the value is json key in definition. """ openapi_types = { - "field_type": "str", "object_type_id": "str", + "hidden": "bool", "name": "str", - "label": "str", + "options": "list[EnumeratedFieldOption]", "description": "str", - "required": "bool", - "hidden": "bool", - "dependent_fields": "list[DependentField]", "default_values": "list[str]", - "options": "list[EnumeratedFieldOption]", + "dependent_fields": "list[DependentField]", + "label": "str", + "field_type": "str", + "required": "bool", } attribute_map = { - "field_type": "fieldType", "object_type_id": "objectTypeId", + "hidden": "hidden", "name": "name", - "label": "label", + "options": "options", "description": "description", - "required": "required", - "hidden": "hidden", - "dependent_fields": "dependentFields", "default_values": "defaultValues", - "options": "options", + "dependent_fields": "dependentFields", + "label": "label", + "field_type": "fieldType", + "required": "required", } def __init__( self, - field_type="multiple_checkboxes", object_type_id=None, + hidden=None, name=None, - label=None, + options=None, description=None, - required=None, - hidden=None, - dependent_fields=None, default_values=None, - options=None, + dependent_fields=None, + label=None, + field_type="multiple_checkboxes", + required=None, local_vars_configuration=None, ): # noqa: E501 """MultipleCheckboxesField - a model defined in OpenAPI""" # noqa: E501 @@ -80,57 +80,29 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._field_type = None self._object_type_id = None + self._hidden = None self._name = None - self._label = None + self._options = None self._description = None - self._required = None - self._hidden = None - self._dependent_fields = None self._default_values = None - self._options = None + self._dependent_fields = None + self._label = None + self._field_type = None + self._required = None self.discriminator = None - self.field_type = field_type self.object_type_id = object_type_id + self.hidden = hidden self.name = name - self.label = label + self.options = options if description is not None: self.description = description - self.required = required - self.hidden = hidden - self.dependent_fields = dependent_fields self.default_values = default_values - self.options = options - - @property - def field_type(self): - """Gets the field_type of this MultipleCheckboxesField. # noqa: E501 - - Determines how the field will be displayed and validated. # noqa: E501 - - :return: The field_type of this MultipleCheckboxesField. # noqa: E501 - :rtype: str - """ - return self._field_type - - @field_type.setter - def field_type(self, field_type): - """Sets the field_type of this MultipleCheckboxesField. - - Determines how the field will be displayed and validated. # noqa: E501 - - :param field_type: The field_type of this MultipleCheckboxesField. # noqa: E501 - :type field_type: str - """ - if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 - raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 - allowed_values = ["multiple_checkboxes"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - - self._field_type = field_type + self.dependent_fields = dependent_fields + self.label = label + self.field_type = field_type + self.required = required @property def object_type_id(self): @@ -157,6 +129,31 @@ def object_type_id(self, object_type_id): self._object_type_id = object_type_id + @property + def hidden(self): + """Gets the hidden of this MultipleCheckboxesField. # noqa: E501 + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :return: The hidden of this MultipleCheckboxesField. # noqa: E501 + :rtype: bool + """ + return self._hidden + + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this MultipleCheckboxesField. + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :param hidden: The hidden of this MultipleCheckboxesField. # noqa: E501 + :type hidden: bool + """ + if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + + self._hidden = hidden + @property def name(self): """Gets the name of this MultipleCheckboxesField. # noqa: E501 @@ -183,29 +180,29 @@ def name(self, name): self._name = name @property - def label(self): - """Gets the label of this MultipleCheckboxesField. # noqa: E501 + def options(self): + """Gets the options of this MultipleCheckboxesField. # noqa: E501 - The main label for the form field. # noqa: E501 + The list of available choices for this field. # noqa: E501 - :return: The label of this MultipleCheckboxesField. # noqa: E501 - :rtype: str + :return: The options of this MultipleCheckboxesField. # noqa: E501 + :rtype: list[EnumeratedFieldOption] """ - return self._label + return self._options - @label.setter - def label(self, label): - """Sets the label of this MultipleCheckboxesField. + @options.setter + def options(self, options): + """Sets the options of this MultipleCheckboxesField. - The main label for the form field. # noqa: E501 + The list of available choices for this field. # noqa: E501 - :param label: The label of this MultipleCheckboxesField. # noqa: E501 - :type label: str + :param options: The options of this MultipleCheckboxesField. # noqa: E501 + :type options: list[EnumeratedFieldOption] """ - if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 - raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and options is None: # noqa: E501 + raise ValueError("Invalid value for `options`, must not be `None`") # noqa: E501 - self._label = label + self._options = options @property def description(self): @@ -231,54 +228,29 @@ def description(self, description): self._description = description @property - def required(self): - """Gets the required of this MultipleCheckboxesField. # noqa: E501 - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :return: The required of this MultipleCheckboxesField. # noqa: E501 - :rtype: bool - """ - return self._required - - @required.setter - def required(self, required): - """Sets the required of this MultipleCheckboxesField. - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :param required: The required of this MultipleCheckboxesField. # noqa: E501 - :type required: bool - """ - if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 - raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 - - self._required = required - - @property - def hidden(self): - """Gets the hidden of this MultipleCheckboxesField. # noqa: E501 + def default_values(self): + """Gets the default_values of this MultipleCheckboxesField. # noqa: E501 - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + The values selected by default. Those values will be submitted unless the customer modifies them. # noqa: E501 - :return: The hidden of this MultipleCheckboxesField. # noqa: E501 - :rtype: bool + :return: The default_values of this MultipleCheckboxesField. # noqa: E501 + :rtype: list[str] """ - return self._hidden + return self._default_values - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this MultipleCheckboxesField. + @default_values.setter + def default_values(self, default_values): + """Sets the default_values of this MultipleCheckboxesField. - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + The values selected by default. Those values will be submitted unless the customer modifies them. # noqa: E501 - :param hidden: The hidden of this MultipleCheckboxesField. # noqa: E501 - :type hidden: bool + :param default_values: The default_values of this MultipleCheckboxesField. # noqa: E501 + :type default_values: list[str] """ - if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and default_values is None: # noqa: E501 + raise ValueError("Invalid value for `default_values`, must not be `None`") # noqa: E501 - self._hidden = hidden + self._default_values = default_values @property def dependent_fields(self): @@ -306,54 +278,82 @@ def dependent_fields(self, dependent_fields): self._dependent_fields = dependent_fields @property - def default_values(self): - """Gets the default_values of this MultipleCheckboxesField. # noqa: E501 + def label(self): + """Gets the label of this MultipleCheckboxesField. # noqa: E501 - The values selected by default. Those values will be submitted unless the customer modifies them. # noqa: E501 + The main label for the form field. # noqa: E501 - :return: The default_values of this MultipleCheckboxesField. # noqa: E501 - :rtype: list[str] + :return: The label of this MultipleCheckboxesField. # noqa: E501 + :rtype: str """ - return self._default_values + return self._label - @default_values.setter - def default_values(self, default_values): - """Sets the default_values of this MultipleCheckboxesField. + @label.setter + def label(self, label): + """Sets the label of this MultipleCheckboxesField. - The values selected by default. Those values will be submitted unless the customer modifies them. # noqa: E501 + The main label for the form field. # noqa: E501 - :param default_values: The default_values of this MultipleCheckboxesField. # noqa: E501 - :type default_values: list[str] + :param label: The label of this MultipleCheckboxesField. # noqa: E501 + :type label: str """ - if self.local_vars_configuration.client_side_validation and default_values is None: # noqa: E501 - raise ValueError("Invalid value for `default_values`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 - self._default_values = default_values + self._label = label @property - def options(self): - """Gets the options of this MultipleCheckboxesField. # noqa: E501 + def field_type(self): + """Gets the field_type of this MultipleCheckboxesField. # noqa: E501 - The list of available choices for this field. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :return: The options of this MultipleCheckboxesField. # noqa: E501 - :rtype: list[EnumeratedFieldOption] + :return: The field_type of this MultipleCheckboxesField. # noqa: E501 + :rtype: str """ - return self._options + return self._field_type - @options.setter - def options(self, options): - """Sets the options of this MultipleCheckboxesField. + @field_type.setter + def field_type(self, field_type): + """Sets the field_type of this MultipleCheckboxesField. - The list of available choices for this field. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :param options: The options of this MultipleCheckboxesField. # noqa: E501 - :type options: list[EnumeratedFieldOption] + :param field_type: The field_type of this MultipleCheckboxesField. # noqa: E501 + :type field_type: str """ - if self.local_vars_configuration.client_side_validation and options is None: # noqa: E501 - raise ValueError("Invalid value for `options`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 + raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 + allowed_values = ["multiple_checkboxes"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - self._options = options + self._field_type = field_type + + @property + def required(self): + """Gets the required of this MultipleCheckboxesField. # noqa: E501 + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :return: The required of this MultipleCheckboxesField. # noqa: E501 + :rtype: bool + """ + return self._required + + @required.setter + def required(self, required): + """Sets the required of this MultipleCheckboxesField. + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :param required: The required of this MultipleCheckboxesField. # noqa: E501 + :type required: bool + """ + if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 + raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 + + self._required = required def to_dict(self, serialize=False): """Returns the model properties as a dict""" diff --git a/hubspot/marketing/forms/models/number_field.py b/hubspot/marketing/forms/models/number_field.py index acc2ab2c..6cc3a77f 100644 --- a/hubspot/marketing/forms/models/number_field.py +++ b/hubspot/marketing/forms/models/number_field.py @@ -36,45 +36,45 @@ class NumberField(object): and the value is json key in definition. """ openapi_types = { - "field_type": "str", "object_type_id": "str", + "hidden": "bool", + "default_value": "str", "name": "str", - "label": "str", "description": "str", - "required": "bool", - "hidden": "bool", "dependent_fields": "list[DependentField]", + "label": "str", "placeholder": "str", - "default_value": "str", + "field_type": "str", + "required": "bool", "validation": "NumberFieldValidation", } attribute_map = { - "field_type": "fieldType", "object_type_id": "objectTypeId", + "hidden": "hidden", + "default_value": "defaultValue", "name": "name", - "label": "label", "description": "description", - "required": "required", - "hidden": "hidden", "dependent_fields": "dependentFields", + "label": "label", "placeholder": "placeholder", - "default_value": "defaultValue", + "field_type": "fieldType", + "required": "required", "validation": "validation", } def __init__( self, - field_type="number", object_type_id=None, + hidden=None, + default_value=None, name=None, - label=None, description=None, - required=None, - hidden=None, dependent_fields=None, + label=None, placeholder=None, - default_value=None, + field_type="number", + required=None, validation=None, local_vars_configuration=None, ): # noqa: E501 @@ -83,63 +83,35 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._field_type = None self._object_type_id = None + self._hidden = None + self._default_value = None self._name = None - self._label = None self._description = None - self._required = None - self._hidden = None self._dependent_fields = None + self._label = None self._placeholder = None - self._default_value = None + self._field_type = None + self._required = None self._validation = None self.discriminator = None - self.field_type = field_type self.object_type_id = object_type_id + self.hidden = hidden + if default_value is not None: + self.default_value = default_value self.name = name - self.label = label if description is not None: self.description = description - self.required = required - self.hidden = hidden self.dependent_fields = dependent_fields + self.label = label if placeholder is not None: self.placeholder = placeholder - if default_value is not None: - self.default_value = default_value + self.field_type = field_type + self.required = required if validation is not None: self.validation = validation - @property - def field_type(self): - """Gets the field_type of this NumberField. # noqa: E501 - - Determines how the field will be displayed and validated. # noqa: E501 - - :return: The field_type of this NumberField. # noqa: E501 - :rtype: str - """ - return self._field_type - - @field_type.setter - def field_type(self, field_type): - """Sets the field_type of this NumberField. - - Determines how the field will be displayed and validated. # noqa: E501 - - :param field_type: The field_type of this NumberField. # noqa: E501 - :type field_type: str - """ - if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 - raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 - allowed_values = ["number"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - - self._field_type = field_type - @property def object_type_id(self): """Gets the object_type_id of this NumberField. # noqa: E501 @@ -165,6 +137,54 @@ def object_type_id(self, object_type_id): self._object_type_id = object_type_id + @property + def hidden(self): + """Gets the hidden of this NumberField. # noqa: E501 + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :return: The hidden of this NumberField. # noqa: E501 + :rtype: bool + """ + return self._hidden + + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this NumberField. + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :param hidden: The hidden of this NumberField. # noqa: E501 + :type hidden: bool + """ + if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + + self._hidden = hidden + + @property + def default_value(self): + """Gets the default_value of this NumberField. # noqa: E501 + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :return: The default_value of this NumberField. # noqa: E501 + :rtype: str + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this NumberField. + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :param default_value: The default_value of this NumberField. # noqa: E501 + :type default_value: str + """ + + self._default_value = default_value + @property def name(self): """Gets the name of this NumberField. # noqa: E501 @@ -190,31 +210,6 @@ def name(self, name): self._name = name - @property - def label(self): - """Gets the label of this NumberField. # noqa: E501 - - The main label for the form field. # noqa: E501 - - :return: The label of this NumberField. # noqa: E501 - :rtype: str - """ - return self._label - - @label.setter - def label(self, label): - """Sets the label of this NumberField. - - The main label for the form field. # noqa: E501 - - :param label: The label of this NumberField. # noqa: E501 - :type label: str - """ - if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 - raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 - - self._label = label - @property def description(self): """Gets the description of this NumberField. # noqa: E501 @@ -238,56 +233,6 @@ def description(self, description): self._description = description - @property - def required(self): - """Gets the required of this NumberField. # noqa: E501 - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :return: The required of this NumberField. # noqa: E501 - :rtype: bool - """ - return self._required - - @required.setter - def required(self, required): - """Sets the required of this NumberField. - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :param required: The required of this NumberField. # noqa: E501 - :type required: bool - """ - if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 - raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 - - self._required = required - - @property - def hidden(self): - """Gets the hidden of this NumberField. # noqa: E501 - - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - - :return: The hidden of this NumberField. # noqa: E501 - :rtype: bool - """ - return self._hidden - - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this NumberField. - - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - - :param hidden: The hidden of this NumberField. # noqa: E501 - :type hidden: bool - """ - if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 - - self._hidden = hidden - @property def dependent_fields(self): """Gets the dependent_fields of this NumberField. # noqa: E501 @@ -313,6 +258,31 @@ def dependent_fields(self, dependent_fields): self._dependent_fields = dependent_fields + @property + def label(self): + """Gets the label of this NumberField. # noqa: E501 + + The main label for the form field. # noqa: E501 + + :return: The label of this NumberField. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this NumberField. + + The main label for the form field. # noqa: E501 + + :param label: The label of this NumberField. # noqa: E501 + :type label: str + """ + if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + + self._label = label + @property def placeholder(self): """Gets the placeholder of this NumberField. # noqa: E501 @@ -337,27 +307,57 @@ def placeholder(self, placeholder): self._placeholder = placeholder @property - def default_value(self): - """Gets the default_value of this NumberField. # noqa: E501 + def field_type(self): + """Gets the field_type of this NumberField. # noqa: E501 - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :return: The default_value of this NumberField. # noqa: E501 + :return: The field_type of this NumberField. # noqa: E501 :rtype: str """ - return self._default_value + return self._field_type - @default_value.setter - def default_value(self, default_value): - """Sets the default_value of this NumberField. + @field_type.setter + def field_type(self, field_type): + """Sets the field_type of this NumberField. - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :param default_value: The default_value of this NumberField. # noqa: E501 - :type default_value: str + :param field_type: The field_type of this NumberField. # noqa: E501 + :type field_type: str """ + if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 + raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 + allowed_values = ["number"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - self._default_value = default_value + self._field_type = field_type + + @property + def required(self): + """Gets the required of this NumberField. # noqa: E501 + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :return: The required of this NumberField. # noqa: E501 + :rtype: bool + """ + return self._required + + @required.setter + def required(self, required): + """Sets the required of this NumberField. + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :param required: The required of this NumberField. # noqa: E501 + :type required: bool + """ + if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 + raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 + + self._required = required @property def validation(self): diff --git a/hubspot/marketing/forms/models/number_field_validation.py b/hubspot/marketing/forms/models/number_field_validation.py index b58c87d9..4387a14d 100644 --- a/hubspot/marketing/forms/models/number_field_validation.py +++ b/hubspot/marketing/forms/models/number_field_validation.py @@ -56,6 +56,7 @@ def __init__(self, min_allowed_digits=None, max_allowed_digits=None, local_vars_ def min_allowed_digits(self): """Gets the min_allowed_digits of this NumberFieldValidation. # noqa: E501 + # noqa: E501 :return: The min_allowed_digits of this NumberFieldValidation. # noqa: E501 :rtype: int @@ -66,6 +67,7 @@ def min_allowed_digits(self): def min_allowed_digits(self, min_allowed_digits): """Sets the min_allowed_digits of this NumberFieldValidation. + # noqa: E501 :param min_allowed_digits: The min_allowed_digits of this NumberFieldValidation. # noqa: E501 :type min_allowed_digits: int @@ -79,6 +81,7 @@ def min_allowed_digits(self, min_allowed_digits): def max_allowed_digits(self): """Gets the max_allowed_digits of this NumberFieldValidation. # noqa: E501 + # noqa: E501 :return: The max_allowed_digits of this NumberFieldValidation. # noqa: E501 :rtype: int @@ -89,6 +92,7 @@ def max_allowed_digits(self): def max_allowed_digits(self, max_allowed_digits): """Sets the max_allowed_digits of this NumberFieldValidation. + # noqa: E501 :param max_allowed_digits: The max_allowed_digits of this NumberFieldValidation. # noqa: E501 :type max_allowed_digits: int diff --git a/hubspot/marketing/forms/models/payment_link_radio_field.py b/hubspot/marketing/forms/models/payment_link_radio_field.py index 19bcefe9..ca539cef 100644 --- a/hubspot/marketing/forms/models/payment_link_radio_field.py +++ b/hubspot/marketing/forms/models/payment_link_radio_field.py @@ -36,43 +36,43 @@ class PaymentLinkRadioField(object): and the value is json key in definition. """ openapi_types = { - "field_type": "str", "object_type_id": "str", + "hidden": "bool", "name": "str", - "label": "str", + "options": "list[EnumeratedFieldOption]", "description": "str", - "required": "bool", - "hidden": "bool", - "dependent_fields": "list[DependentField]", "default_values": "list[str]", - "options": "list[EnumeratedFieldOption]", + "dependent_fields": "list[DependentField]", + "label": "str", + "field_type": "str", + "required": "bool", } attribute_map = { - "field_type": "fieldType", "object_type_id": "objectTypeId", + "hidden": "hidden", "name": "name", - "label": "label", + "options": "options", "description": "description", - "required": "required", - "hidden": "hidden", - "dependent_fields": "dependentFields", "default_values": "defaultValues", - "options": "options", + "dependent_fields": "dependentFields", + "label": "label", + "field_type": "fieldType", + "required": "required", } def __init__( self, - field_type="payment_link_radio", object_type_id=None, + hidden=None, name=None, - label=None, + options=None, description=None, - required=None, - hidden=None, - dependent_fields=None, default_values=None, - options=None, + dependent_fields=None, + label=None, + field_type="payment_link_radio", + required=None, local_vars_configuration=None, ): # noqa: E501 """PaymentLinkRadioField - a model defined in OpenAPI""" # noqa: E501 @@ -80,55 +80,29 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._field_type = None self._object_type_id = None + self._hidden = None self._name = None - self._label = None + self._options = None self._description = None - self._required = None - self._hidden = None - self._dependent_fields = None self._default_values = None - self._options = None + self._dependent_fields = None + self._label = None + self._field_type = None + self._required = None self.discriminator = None - self.field_type = field_type self.object_type_id = object_type_id + self.hidden = hidden self.name = name - self.label = label + self.options = options if description is not None: self.description = description - self.required = required - self.hidden = hidden - self.dependent_fields = dependent_fields self.default_values = default_values - self.options = options - - @property - def field_type(self): - """Gets the field_type of this PaymentLinkRadioField. # noqa: E501 - - - :return: The field_type of this PaymentLinkRadioField. # noqa: E501 - :rtype: str - """ - return self._field_type - - @field_type.setter - def field_type(self, field_type): - """Sets the field_type of this PaymentLinkRadioField. - - - :param field_type: The field_type of this PaymentLinkRadioField. # noqa: E501 - :type field_type: str - """ - if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 - raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 - allowed_values = ["payment_link_radio"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - - self._field_type = field_type + self.dependent_fields = dependent_fields + self.label = label + self.field_type = field_type + self.required = required @property def object_type_id(self): @@ -153,6 +127,29 @@ def object_type_id(self, object_type_id): self._object_type_id = object_type_id + @property + def hidden(self): + """Gets the hidden of this PaymentLinkRadioField. # noqa: E501 + + + :return: The hidden of this PaymentLinkRadioField. # noqa: E501 + :rtype: bool + """ + return self._hidden + + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this PaymentLinkRadioField. + + + :param hidden: The hidden of this PaymentLinkRadioField. # noqa: E501 + :type hidden: bool + """ + if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + + self._hidden = hidden + @property def name(self): """Gets the name of this PaymentLinkRadioField. # noqa: E501 @@ -177,27 +174,27 @@ def name(self, name): self._name = name @property - def label(self): - """Gets the label of this PaymentLinkRadioField. # noqa: E501 + def options(self): + """Gets the options of this PaymentLinkRadioField. # noqa: E501 - :return: The label of this PaymentLinkRadioField. # noqa: E501 - :rtype: str + :return: The options of this PaymentLinkRadioField. # noqa: E501 + :rtype: list[EnumeratedFieldOption] """ - return self._label + return self._options - @label.setter - def label(self, label): - """Sets the label of this PaymentLinkRadioField. + @options.setter + def options(self, options): + """Sets the options of this PaymentLinkRadioField. - :param label: The label of this PaymentLinkRadioField. # noqa: E501 - :type label: str + :param options: The options of this PaymentLinkRadioField. # noqa: E501 + :type options: list[EnumeratedFieldOption] """ - if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 - raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and options is None: # noqa: E501 + raise ValueError("Invalid value for `options`, must not be `None`") # noqa: E501 - self._label = label + self._options = options @property def description(self): @@ -221,50 +218,27 @@ def description(self, description): self._description = description @property - def required(self): - """Gets the required of this PaymentLinkRadioField. # noqa: E501 - - - :return: The required of this PaymentLinkRadioField. # noqa: E501 - :rtype: bool - """ - return self._required - - @required.setter - def required(self, required): - """Sets the required of this PaymentLinkRadioField. - - - :param required: The required of this PaymentLinkRadioField. # noqa: E501 - :type required: bool - """ - if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 - raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 - - self._required = required - - @property - def hidden(self): - """Gets the hidden of this PaymentLinkRadioField. # noqa: E501 + def default_values(self): + """Gets the default_values of this PaymentLinkRadioField. # noqa: E501 - :return: The hidden of this PaymentLinkRadioField. # noqa: E501 - :rtype: bool + :return: The default_values of this PaymentLinkRadioField. # noqa: E501 + :rtype: list[str] """ - return self._hidden + return self._default_values - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this PaymentLinkRadioField. + @default_values.setter + def default_values(self, default_values): + """Sets the default_values of this PaymentLinkRadioField. - :param hidden: The hidden of this PaymentLinkRadioField. # noqa: E501 - :type hidden: bool + :param default_values: The default_values of this PaymentLinkRadioField. # noqa: E501 + :type default_values: list[str] """ - if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and default_values is None: # noqa: E501 + raise ValueError("Invalid value for `default_values`, must not be `None`") # noqa: E501 - self._hidden = hidden + self._default_values = default_values @property def dependent_fields(self): @@ -290,50 +264,76 @@ def dependent_fields(self, dependent_fields): self._dependent_fields = dependent_fields @property - def default_values(self): - """Gets the default_values of this PaymentLinkRadioField. # noqa: E501 + def label(self): + """Gets the label of this PaymentLinkRadioField. # noqa: E501 - :return: The default_values of this PaymentLinkRadioField. # noqa: E501 - :rtype: list[str] + :return: The label of this PaymentLinkRadioField. # noqa: E501 + :rtype: str """ - return self._default_values + return self._label - @default_values.setter - def default_values(self, default_values): - """Sets the default_values of this PaymentLinkRadioField. + @label.setter + def label(self, label): + """Sets the label of this PaymentLinkRadioField. - :param default_values: The default_values of this PaymentLinkRadioField. # noqa: E501 - :type default_values: list[str] + :param label: The label of this PaymentLinkRadioField. # noqa: E501 + :type label: str """ - if self.local_vars_configuration.client_side_validation and default_values is None: # noqa: E501 - raise ValueError("Invalid value for `default_values`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 - self._default_values = default_values + self._label = label @property - def options(self): - """Gets the options of this PaymentLinkRadioField. # noqa: E501 + def field_type(self): + """Gets the field_type of this PaymentLinkRadioField. # noqa: E501 - :return: The options of this PaymentLinkRadioField. # noqa: E501 - :rtype: list[EnumeratedFieldOption] + :return: The field_type of this PaymentLinkRadioField. # noqa: E501 + :rtype: str """ - return self._options + return self._field_type - @options.setter - def options(self, options): - """Sets the options of this PaymentLinkRadioField. + @field_type.setter + def field_type(self, field_type): + """Sets the field_type of this PaymentLinkRadioField. - :param options: The options of this PaymentLinkRadioField. # noqa: E501 - :type options: list[EnumeratedFieldOption] + :param field_type: The field_type of this PaymentLinkRadioField. # noqa: E501 + :type field_type: str """ - if self.local_vars_configuration.client_side_validation and options is None: # noqa: E501 - raise ValueError("Invalid value for `options`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 + raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 + allowed_values = ["payment_link_radio"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - self._options = options + self._field_type = field_type + + @property + def required(self): + """Gets the required of this PaymentLinkRadioField. # noqa: E501 + + + :return: The required of this PaymentLinkRadioField. # noqa: E501 + :rtype: bool + """ + return self._required + + @required.setter + def required(self, required): + """Sets the required of this PaymentLinkRadioField. + + + :param required: The required of this PaymentLinkRadioField. # noqa: E501 + :type required: bool + """ + if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 + raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 + + self._required = required def to_dict(self, serialize=False): """Returns the model properties as a dict""" diff --git a/hubspot/marketing/forms/models/phone_field.py b/hubspot/marketing/forms/models/phone_field.py index 4a7c7b50..f1bd312b 100644 --- a/hubspot/marketing/forms/models/phone_field.py +++ b/hubspot/marketing/forms/models/phone_field.py @@ -36,48 +36,48 @@ class PhoneField(object): and the value is json key in definition. """ openapi_types = { - "field_type": "str", "object_type_id": "str", + "hidden": "bool", + "default_value": "str", + "use_country_code_select": "bool", "name": "str", - "label": "str", "description": "str", - "required": "bool", - "hidden": "bool", "dependent_fields": "list[DependentField]", + "label": "str", "placeholder": "str", - "default_value": "str", - "use_country_code_select": "bool", + "field_type": "str", + "required": "bool", "validation": "PhoneFieldValidation", } attribute_map = { - "field_type": "fieldType", "object_type_id": "objectTypeId", + "hidden": "hidden", + "default_value": "defaultValue", + "use_country_code_select": "useCountryCodeSelect", "name": "name", - "label": "label", "description": "description", - "required": "required", - "hidden": "hidden", "dependent_fields": "dependentFields", + "label": "label", "placeholder": "placeholder", - "default_value": "defaultValue", - "use_country_code_select": "useCountryCodeSelect", + "field_type": "fieldType", + "required": "required", "validation": "validation", } def __init__( self, - field_type="phone", object_type_id=None, + hidden=None, + default_value=None, + use_country_code_select=None, name=None, - label=None, description=None, - required=None, - hidden=None, dependent_fields=None, + label=None, placeholder=None, - default_value=None, - use_country_code_select=None, + field_type="phone", + required=None, validation=None, local_vars_configuration=None, ): # noqa: E501 @@ -86,64 +86,36 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._field_type = None self._object_type_id = None + self._hidden = None + self._default_value = None + self._use_country_code_select = None self._name = None - self._label = None self._description = None - self._required = None - self._hidden = None self._dependent_fields = None + self._label = None self._placeholder = None - self._default_value = None - self._use_country_code_select = None + self._field_type = None + self._required = None self._validation = None self.discriminator = None - self.field_type = field_type self.object_type_id = object_type_id + self.hidden = hidden + if default_value is not None: + self.default_value = default_value + self.use_country_code_select = use_country_code_select self.name = name - self.label = label if description is not None: self.description = description - self.required = required - self.hidden = hidden self.dependent_fields = dependent_fields + self.label = label if placeholder is not None: self.placeholder = placeholder - if default_value is not None: - self.default_value = default_value - self.use_country_code_select = use_country_code_select + self.field_type = field_type + self.required = required self.validation = validation - @property - def field_type(self): - """Gets the field_type of this PhoneField. # noqa: E501 - - Determines how the field will be displayed and validated. # noqa: E501 - - :return: The field_type of this PhoneField. # noqa: E501 - :rtype: str - """ - return self._field_type - - @field_type.setter - def field_type(self, field_type): - """Sets the field_type of this PhoneField. - - Determines how the field will be displayed and validated. # noqa: E501 - - :param field_type: The field_type of this PhoneField. # noqa: E501 - :type field_type: str - """ - if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 - raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 - allowed_values = ["phone"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - - self._field_type = field_type - @property def object_type_id(self): """Gets the object_type_id of this PhoneField. # noqa: E501 @@ -170,127 +142,125 @@ def object_type_id(self, object_type_id): self._object_type_id = object_type_id @property - def name(self): - """Gets the name of this PhoneField. # noqa: E501 + def hidden(self): + """Gets the hidden of this PhoneField. # noqa: E501 - The identifier of the field. In combination with the object type ID, it must be unique. # noqa: E501 + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - :return: The name of this PhoneField. # noqa: E501 - :rtype: str + :return: The hidden of this PhoneField. # noqa: E501 + :rtype: bool """ - return self._name + return self._hidden - @name.setter - def name(self, name): - """Sets the name of this PhoneField. + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this PhoneField. - The identifier of the field. In combination with the object type ID, it must be unique. # noqa: E501 + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - :param name: The name of this PhoneField. # noqa: E501 - :type name: str + :param hidden: The hidden of this PhoneField. # noqa: E501 + :type hidden: bool """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 - self._name = name + self._hidden = hidden @property - def label(self): - """Gets the label of this PhoneField. # noqa: E501 + def default_value(self): + """Gets the default_value of this PhoneField. # noqa: E501 - The main label for the form field. # noqa: E501 + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 - :return: The label of this PhoneField. # noqa: E501 + :return: The default_value of this PhoneField. # noqa: E501 :rtype: str """ - return self._label + return self._default_value - @label.setter - def label(self, label): - """Sets the label of this PhoneField. + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this PhoneField. - The main label for the form field. # noqa: E501 + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 - :param label: The label of this PhoneField. # noqa: E501 - :type label: str + :param default_value: The default_value of this PhoneField. # noqa: E501 + :type default_value: str """ - if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 - raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 - self._label = label + self._default_value = default_value @property - def description(self): - """Gets the description of this PhoneField. # noqa: E501 + def use_country_code_select(self): + """Gets the use_country_code_select of this PhoneField. # noqa: E501 - Additional text helping the customer to complete the field. # noqa: E501 + Whether to display a country code drop down next to the phone field. # noqa: E501 - :return: The description of this PhoneField. # noqa: E501 - :rtype: str + :return: The use_country_code_select of this PhoneField. # noqa: E501 + :rtype: bool """ - return self._description + return self._use_country_code_select - @description.setter - def description(self, description): - """Sets the description of this PhoneField. + @use_country_code_select.setter + def use_country_code_select(self, use_country_code_select): + """Sets the use_country_code_select of this PhoneField. - Additional text helping the customer to complete the field. # noqa: E501 + Whether to display a country code drop down next to the phone field. # noqa: E501 - :param description: The description of this PhoneField. # noqa: E501 - :type description: str + :param use_country_code_select: The use_country_code_select of this PhoneField. # noqa: E501 + :type use_country_code_select: bool """ + if self.local_vars_configuration.client_side_validation and use_country_code_select is None: # noqa: E501 + raise ValueError("Invalid value for `use_country_code_select`, must not be `None`") # noqa: E501 - self._description = description + self._use_country_code_select = use_country_code_select @property - def required(self): - """Gets the required of this PhoneField. # noqa: E501 + def name(self): + """Gets the name of this PhoneField. # noqa: E501 - Whether a value for this field is required when submitting the form. # noqa: E501 + The identifier of the field. In combination with the object type ID, it must be unique. # noqa: E501 - :return: The required of this PhoneField. # noqa: E501 - :rtype: bool + :return: The name of this PhoneField. # noqa: E501 + :rtype: str """ - return self._required + return self._name - @required.setter - def required(self, required): - """Sets the required of this PhoneField. + @name.setter + def name(self, name): + """Sets the name of this PhoneField. - Whether a value for this field is required when submitting the form. # noqa: E501 + The identifier of the field. In combination with the object type ID, it must be unique. # noqa: E501 - :param required: The required of this PhoneField. # noqa: E501 - :type required: bool + :param name: The name of this PhoneField. # noqa: E501 + :type name: str """ - if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 - raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._required = required + self._name = name @property - def hidden(self): - """Gets the hidden of this PhoneField. # noqa: E501 + def description(self): + """Gets the description of this PhoneField. # noqa: E501 - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + Additional text helping the customer to complete the field. # noqa: E501 - :return: The hidden of this PhoneField. # noqa: E501 - :rtype: bool + :return: The description of this PhoneField. # noqa: E501 + :rtype: str """ - return self._hidden + return self._description - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this PhoneField. + @description.setter + def description(self, description): + """Sets the description of this PhoneField. - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + Additional text helping the customer to complete the field. # noqa: E501 - :param hidden: The hidden of this PhoneField. # noqa: E501 - :type hidden: bool + :param description: The description of this PhoneField. # noqa: E501 + :type description: str """ - if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 - self._hidden = hidden + self._description = description @property def dependent_fields(self): @@ -317,6 +287,31 @@ def dependent_fields(self, dependent_fields): self._dependent_fields = dependent_fields + @property + def label(self): + """Gets the label of this PhoneField. # noqa: E501 + + The main label for the form field. # noqa: E501 + + :return: The label of this PhoneField. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this PhoneField. + + The main label for the form field. # noqa: E501 + + :param label: The label of this PhoneField. # noqa: E501 + :type label: str + """ + if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + + self._label = label + @property def placeholder(self): """Gets the placeholder of this PhoneField. # noqa: E501 @@ -341,52 +336,57 @@ def placeholder(self, placeholder): self._placeholder = placeholder @property - def default_value(self): - """Gets the default_value of this PhoneField. # noqa: E501 + def field_type(self): + """Gets the field_type of this PhoneField. # noqa: E501 - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :return: The default_value of this PhoneField. # noqa: E501 + :return: The field_type of this PhoneField. # noqa: E501 :rtype: str """ - return self._default_value + return self._field_type - @default_value.setter - def default_value(self, default_value): - """Sets the default_value of this PhoneField. + @field_type.setter + def field_type(self, field_type): + """Sets the field_type of this PhoneField. - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :param default_value: The default_value of this PhoneField. # noqa: E501 - :type default_value: str + :param field_type: The field_type of this PhoneField. # noqa: E501 + :type field_type: str """ + if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 + raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 + allowed_values = ["phone"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - self._default_value = default_value + self._field_type = field_type @property - def use_country_code_select(self): - """Gets the use_country_code_select of this PhoneField. # noqa: E501 + def required(self): + """Gets the required of this PhoneField. # noqa: E501 - Whether to display a country code drop down next to the phone field. # noqa: E501 + Whether a value for this field is required when submitting the form. # noqa: E501 - :return: The use_country_code_select of this PhoneField. # noqa: E501 + :return: The required of this PhoneField. # noqa: E501 :rtype: bool """ - return self._use_country_code_select + return self._required - @use_country_code_select.setter - def use_country_code_select(self, use_country_code_select): - """Sets the use_country_code_select of this PhoneField. + @required.setter + def required(self, required): + """Sets the required of this PhoneField. - Whether to display a country code drop down next to the phone field. # noqa: E501 + Whether a value for this field is required when submitting the form. # noqa: E501 - :param use_country_code_select: The use_country_code_select of this PhoneField. # noqa: E501 - :type use_country_code_select: bool + :param required: The required of this PhoneField. # noqa: E501 + :type required: bool """ - if self.local_vars_configuration.client_side_validation and use_country_code_select is None: # noqa: E501 - raise ValueError("Invalid value for `use_country_code_select`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 + raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 - self._use_country_code_select = use_country_code_select + self._required = required @property def validation(self): diff --git a/hubspot/marketing/forms/models/phone_field_validation.py b/hubspot/marketing/forms/models/phone_field_validation.py index 287d7cbc..6f4fe7fd 100644 --- a/hubspot/marketing/forms/models/phone_field_validation.py +++ b/hubspot/marketing/forms/models/phone_field_validation.py @@ -56,6 +56,7 @@ def __init__(self, min_allowed_digits=None, max_allowed_digits=None, local_vars_ def min_allowed_digits(self): """Gets the min_allowed_digits of this PhoneFieldValidation. # noqa: E501 + # noqa: E501 :return: The min_allowed_digits of this PhoneFieldValidation. # noqa: E501 :rtype: int @@ -66,6 +67,7 @@ def min_allowed_digits(self): def min_allowed_digits(self, min_allowed_digits): """Sets the min_allowed_digits of this PhoneFieldValidation. + # noqa: E501 :param min_allowed_digits: The min_allowed_digits of this PhoneFieldValidation. # noqa: E501 :type min_allowed_digits: int @@ -79,6 +81,7 @@ def min_allowed_digits(self, min_allowed_digits): def max_allowed_digits(self): """Gets the max_allowed_digits of this PhoneFieldValidation. # noqa: E501 + # noqa: E501 :return: The max_allowed_digits of this PhoneFieldValidation. # noqa: E501 :rtype: int @@ -89,6 +92,7 @@ def max_allowed_digits(self): def max_allowed_digits(self, max_allowed_digits): """Sets the max_allowed_digits of this PhoneFieldValidation. + # noqa: E501 :param max_allowed_digits: The max_allowed_digits of this PhoneFieldValidation. # noqa: E501 :type max_allowed_digits: int diff --git a/hubspot/marketing/forms/models/radio_field.py b/hubspot/marketing/forms/models/radio_field.py index 0644c977..a3864850 100644 --- a/hubspot/marketing/forms/models/radio_field.py +++ b/hubspot/marketing/forms/models/radio_field.py @@ -36,46 +36,46 @@ class RadioField(object): and the value is json key in definition. """ openapi_types = { - "field_type": "str", "object_type_id": "str", + "hidden": "bool", "name": "str", - "label": "str", + "options": "list[EnumeratedFieldOption]", "description": "str", - "required": "bool", - "hidden": "bool", - "dependent_fields": "list[DependentField]", "default_values": "list[str]", - "options": "list[EnumeratedFieldOption]", + "dependent_fields": "list[DependentField]", + "label": "str", "placeholder": "str", + "field_type": "str", + "required": "bool", } attribute_map = { - "field_type": "fieldType", "object_type_id": "objectTypeId", + "hidden": "hidden", "name": "name", - "label": "label", + "options": "options", "description": "description", - "required": "required", - "hidden": "hidden", - "dependent_fields": "dependentFields", "default_values": "defaultValues", - "options": "options", + "dependent_fields": "dependentFields", + "label": "label", "placeholder": "placeholder", + "field_type": "fieldType", + "required": "required", } def __init__( self, - field_type="radio", object_type_id=None, + hidden=None, name=None, - label=None, + options=None, description=None, - required=None, - hidden=None, - dependent_fields=None, default_values=None, - options=None, + dependent_fields=None, + label=None, placeholder=None, + field_type="radio", + required=None, local_vars_configuration=None, ): # noqa: E501 """RadioField - a model defined in OpenAPI""" # noqa: E501 @@ -83,60 +83,32 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._field_type = None self._object_type_id = None + self._hidden = None self._name = None - self._label = None + self._options = None self._description = None - self._required = None - self._hidden = None - self._dependent_fields = None self._default_values = None - self._options = None + self._dependent_fields = None + self._label = None self._placeholder = None + self._field_type = None + self._required = None self.discriminator = None - self.field_type = field_type self.object_type_id = object_type_id + self.hidden = hidden self.name = name - self.label = label + self.options = options if description is not None: self.description = description - self.required = required - self.hidden = hidden - self.dependent_fields = dependent_fields self.default_values = default_values - self.options = options + self.dependent_fields = dependent_fields + self.label = label if placeholder is not None: self.placeholder = placeholder - - @property - def field_type(self): - """Gets the field_type of this RadioField. # noqa: E501 - - Determines how the field will be displayed and validated. # noqa: E501 - - :return: The field_type of this RadioField. # noqa: E501 - :rtype: str - """ - return self._field_type - - @field_type.setter - def field_type(self, field_type): - """Sets the field_type of this RadioField. - - Determines how the field will be displayed and validated. # noqa: E501 - - :param field_type: The field_type of this RadioField. # noqa: E501 - :type field_type: str - """ - if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 - raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 - allowed_values = ["radio"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - - self._field_type = field_type + self.field_type = field_type + self.required = required @property def object_type_id(self): @@ -163,6 +135,31 @@ def object_type_id(self, object_type_id): self._object_type_id = object_type_id + @property + def hidden(self): + """Gets the hidden of this RadioField. # noqa: E501 + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :return: The hidden of this RadioField. # noqa: E501 + :rtype: bool + """ + return self._hidden + + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this RadioField. + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :param hidden: The hidden of this RadioField. # noqa: E501 + :type hidden: bool + """ + if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + + self._hidden = hidden + @property def name(self): """Gets the name of this RadioField. # noqa: E501 @@ -189,29 +186,29 @@ def name(self, name): self._name = name @property - def label(self): - """Gets the label of this RadioField. # noqa: E501 + def options(self): + """Gets the options of this RadioField. # noqa: E501 - The main label for the form field. # noqa: E501 + The list of available choices for this field. # noqa: E501 - :return: The label of this RadioField. # noqa: E501 - :rtype: str + :return: The options of this RadioField. # noqa: E501 + :rtype: list[EnumeratedFieldOption] """ - return self._label + return self._options - @label.setter - def label(self, label): - """Sets the label of this RadioField. + @options.setter + def options(self, options): + """Sets the options of this RadioField. - The main label for the form field. # noqa: E501 + The list of available choices for this field. # noqa: E501 - :param label: The label of this RadioField. # noqa: E501 - :type label: str + :param options: The options of this RadioField. # noqa: E501 + :type options: list[EnumeratedFieldOption] """ - if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 - raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and options is None: # noqa: E501 + raise ValueError("Invalid value for `options`, must not be `None`") # noqa: E501 - self._label = label + self._options = options @property def description(self): @@ -237,54 +234,29 @@ def description(self, description): self._description = description @property - def required(self): - """Gets the required of this RadioField. # noqa: E501 - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :return: The required of this RadioField. # noqa: E501 - :rtype: bool - """ - return self._required - - @required.setter - def required(self, required): - """Sets the required of this RadioField. - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :param required: The required of this RadioField. # noqa: E501 - :type required: bool - """ - if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 - raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 - - self._required = required - - @property - def hidden(self): - """Gets the hidden of this RadioField. # noqa: E501 + def default_values(self): + """Gets the default_values of this RadioField. # noqa: E501 - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + The values selected by default. Those values will be submitted unless the customer modifies them. # noqa: E501 - :return: The hidden of this RadioField. # noqa: E501 - :rtype: bool + :return: The default_values of this RadioField. # noqa: E501 + :rtype: list[str] """ - return self._hidden + return self._default_values - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this RadioField. + @default_values.setter + def default_values(self, default_values): + """Sets the default_values of this RadioField. - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + The values selected by default. Those values will be submitted unless the customer modifies them. # noqa: E501 - :param hidden: The hidden of this RadioField. # noqa: E501 - :type hidden: bool + :param default_values: The default_values of this RadioField. # noqa: E501 + :type default_values: list[str] """ - if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and default_values is None: # noqa: E501 + raise ValueError("Invalid value for `default_values`, must not be `None`") # noqa: E501 - self._hidden = hidden + self._default_values = default_values @property def dependent_fields(self): @@ -312,54 +284,29 @@ def dependent_fields(self, dependent_fields): self._dependent_fields = dependent_fields @property - def default_values(self): - """Gets the default_values of this RadioField. # noqa: E501 - - The values selected by default. Those values will be submitted unless the customer modifies them. # noqa: E501 - - :return: The default_values of this RadioField. # noqa: E501 - :rtype: list[str] - """ - return self._default_values - - @default_values.setter - def default_values(self, default_values): - """Sets the default_values of this RadioField. - - The values selected by default. Those values will be submitted unless the customer modifies them. # noqa: E501 - - :param default_values: The default_values of this RadioField. # noqa: E501 - :type default_values: list[str] - """ - if self.local_vars_configuration.client_side_validation and default_values is None: # noqa: E501 - raise ValueError("Invalid value for `default_values`, must not be `None`") # noqa: E501 - - self._default_values = default_values - - @property - def options(self): - """Gets the options of this RadioField. # noqa: E501 + def label(self): + """Gets the label of this RadioField. # noqa: E501 - The list of available choices for this field. # noqa: E501 + The main label for the form field. # noqa: E501 - :return: The options of this RadioField. # noqa: E501 - :rtype: list[EnumeratedFieldOption] + :return: The label of this RadioField. # noqa: E501 + :rtype: str """ - return self._options + return self._label - @options.setter - def options(self, options): - """Sets the options of this RadioField. + @label.setter + def label(self, label): + """Sets the label of this RadioField. - The list of available choices for this field. # noqa: E501 + The main label for the form field. # noqa: E501 - :param options: The options of this RadioField. # noqa: E501 - :type options: list[EnumeratedFieldOption] + :param label: The label of this RadioField. # noqa: E501 + :type label: str """ - if self.local_vars_configuration.client_side_validation and options is None: # noqa: E501 - raise ValueError("Invalid value for `options`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 - self._options = options + self._label = label @property def placeholder(self): @@ -384,6 +331,59 @@ def placeholder(self, placeholder): self._placeholder = placeholder + @property + def field_type(self): + """Gets the field_type of this RadioField. # noqa: E501 + + Determines how the field will be displayed and validated. # noqa: E501 + + :return: The field_type of this RadioField. # noqa: E501 + :rtype: str + """ + return self._field_type + + @field_type.setter + def field_type(self, field_type): + """Sets the field_type of this RadioField. + + Determines how the field will be displayed and validated. # noqa: E501 + + :param field_type: The field_type of this RadioField. # noqa: E501 + :type field_type: str + """ + if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 + raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 + allowed_values = ["radio"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 + + self._field_type = field_type + + @property + def required(self): + """Gets the required of this RadioField. # noqa: E501 + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :return: The required of this RadioField. # noqa: E501 + :rtype: bool + """ + return self._required + + @required.setter + def required(self, required): + """Sets the required of this RadioField. + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :param required: The required of this RadioField. # noqa: E501 + :type required: bool + """ + if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 + raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 + + self._required = required + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} diff --git a/hubspot/marketing/forms/models/single_checkbox_field.py b/hubspot/marketing/forms/models/single_checkbox_field.py index 69dce881..f8a588d9 100644 --- a/hubspot/marketing/forms/models/single_checkbox_field.py +++ b/hubspot/marketing/forms/models/single_checkbox_field.py @@ -36,40 +36,40 @@ class SingleCheckboxField(object): and the value is json key in definition. """ openapi_types = { - "field_type": "str", "object_type_id": "str", + "hidden": "bool", + "default_value": "str", "name": "str", - "label": "str", "description": "str", - "required": "bool", - "hidden": "bool", "dependent_fields": "list[DependentField]", - "default_value": "str", + "label": "str", + "field_type": "str", + "required": "bool", } attribute_map = { - "field_type": "fieldType", "object_type_id": "objectTypeId", + "hidden": "hidden", + "default_value": "defaultValue", "name": "name", - "label": "label", "description": "description", - "required": "required", - "hidden": "hidden", "dependent_fields": "dependentFields", - "default_value": "defaultValue", + "label": "label", + "field_type": "fieldType", + "required": "required", } def __init__( self, - field_type="single_checkbox", object_type_id=None, + hidden=None, + default_value=None, name=None, - label=None, description=None, - required=None, - hidden=None, dependent_fields=None, - default_value=None, + label=None, + field_type="single_checkbox", + required=None, local_vars_configuration=None, ): # noqa: E501 """SingleCheckboxField - a model defined in OpenAPI""" # noqa: E501 @@ -77,56 +77,28 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._field_type = None self._object_type_id = None + self._hidden = None + self._default_value = None self._name = None - self._label = None self._description = None - self._required = None - self._hidden = None self._dependent_fields = None - self._default_value = None + self._label = None + self._field_type = None + self._required = None self.discriminator = None - self.field_type = field_type self.object_type_id = object_type_id + self.hidden = hidden + if default_value is not None: + self.default_value = default_value self.name = name - self.label = label if description is not None: self.description = description - self.required = required - self.hidden = hidden self.dependent_fields = dependent_fields - if default_value is not None: - self.default_value = default_value - - @property - def field_type(self): - """Gets the field_type of this SingleCheckboxField. # noqa: E501 - - Determines how the field will be displayed and validated. # noqa: E501 - - :return: The field_type of this SingleCheckboxField. # noqa: E501 - :rtype: str - """ - return self._field_type - - @field_type.setter - def field_type(self, field_type): - """Sets the field_type of this SingleCheckboxField. - - Determines how the field will be displayed and validated. # noqa: E501 - - :param field_type: The field_type of this SingleCheckboxField. # noqa: E501 - :type field_type: str - """ - if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 - raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 - allowed_values = ["single_checkbox"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - - self._field_type = field_type + self.label = label + self.field_type = field_type + self.required = required @property def object_type_id(self): @@ -153,6 +125,54 @@ def object_type_id(self, object_type_id): self._object_type_id = object_type_id + @property + def hidden(self): + """Gets the hidden of this SingleCheckboxField. # noqa: E501 + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :return: The hidden of this SingleCheckboxField. # noqa: E501 + :rtype: bool + """ + return self._hidden + + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this SingleCheckboxField. + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :param hidden: The hidden of this SingleCheckboxField. # noqa: E501 + :type hidden: bool + """ + if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + + self._hidden = hidden + + @property + def default_value(self): + """Gets the default_value of this SingleCheckboxField. # noqa: E501 + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :return: The default_value of this SingleCheckboxField. # noqa: E501 + :rtype: str + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this SingleCheckboxField. + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :param default_value: The default_value of this SingleCheckboxField. # noqa: E501 + :type default_value: str + """ + + self._default_value = default_value + @property def name(self): """Gets the name of this SingleCheckboxField. # noqa: E501 @@ -178,31 +198,6 @@ def name(self, name): self._name = name - @property - def label(self): - """Gets the label of this SingleCheckboxField. # noqa: E501 - - The main label for the form field. # noqa: E501 - - :return: The label of this SingleCheckboxField. # noqa: E501 - :rtype: str - """ - return self._label - - @label.setter - def label(self, label): - """Sets the label of this SingleCheckboxField. - - The main label for the form field. # noqa: E501 - - :param label: The label of this SingleCheckboxField. # noqa: E501 - :type label: str - """ - if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 - raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 - - self._label = label - @property def description(self): """Gets the description of this SingleCheckboxField. # noqa: E501 @@ -227,102 +222,107 @@ def description(self, description): self._description = description @property - def required(self): - """Gets the required of this SingleCheckboxField. # noqa: E501 + def dependent_fields(self): + """Gets the dependent_fields of this SingleCheckboxField. # noqa: E501 - Whether a value for this field is required when submitting the form. # noqa: E501 + A list of other fields to make visible based on the value filled in for this field. # noqa: E501 - :return: The required of this SingleCheckboxField. # noqa: E501 - :rtype: bool + :return: The dependent_fields of this SingleCheckboxField. # noqa: E501 + :rtype: list[DependentField] """ - return self._required + return self._dependent_fields - @required.setter - def required(self, required): - """Sets the required of this SingleCheckboxField. + @dependent_fields.setter + def dependent_fields(self, dependent_fields): + """Sets the dependent_fields of this SingleCheckboxField. - Whether a value for this field is required when submitting the form. # noqa: E501 + A list of other fields to make visible based on the value filled in for this field. # noqa: E501 - :param required: The required of this SingleCheckboxField. # noqa: E501 - :type required: bool + :param dependent_fields: The dependent_fields of this SingleCheckboxField. # noqa: E501 + :type dependent_fields: list[DependentField] """ - if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 - raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and dependent_fields is None: # noqa: E501 + raise ValueError("Invalid value for `dependent_fields`, must not be `None`") # noqa: E501 - self._required = required + self._dependent_fields = dependent_fields @property - def hidden(self): - """Gets the hidden of this SingleCheckboxField. # noqa: E501 + def label(self): + """Gets the label of this SingleCheckboxField. # noqa: E501 - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + The main label for the form field. # noqa: E501 - :return: The hidden of this SingleCheckboxField. # noqa: E501 - :rtype: bool + :return: The label of this SingleCheckboxField. # noqa: E501 + :rtype: str """ - return self._hidden + return self._label - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this SingleCheckboxField. + @label.setter + def label(self, label): + """Sets the label of this SingleCheckboxField. - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + The main label for the form field. # noqa: E501 - :param hidden: The hidden of this SingleCheckboxField. # noqa: E501 - :type hidden: bool + :param label: The label of this SingleCheckboxField. # noqa: E501 + :type label: str """ - if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 - self._hidden = hidden + self._label = label @property - def dependent_fields(self): - """Gets the dependent_fields of this SingleCheckboxField. # noqa: E501 + def field_type(self): + """Gets the field_type of this SingleCheckboxField. # noqa: E501 - A list of other fields to make visible based on the value filled in for this field. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :return: The dependent_fields of this SingleCheckboxField. # noqa: E501 - :rtype: list[DependentField] + :return: The field_type of this SingleCheckboxField. # noqa: E501 + :rtype: str """ - return self._dependent_fields + return self._field_type - @dependent_fields.setter - def dependent_fields(self, dependent_fields): - """Sets the dependent_fields of this SingleCheckboxField. + @field_type.setter + def field_type(self, field_type): + """Sets the field_type of this SingleCheckboxField. - A list of other fields to make visible based on the value filled in for this field. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :param dependent_fields: The dependent_fields of this SingleCheckboxField. # noqa: E501 - :type dependent_fields: list[DependentField] + :param field_type: The field_type of this SingleCheckboxField. # noqa: E501 + :type field_type: str """ - if self.local_vars_configuration.client_side_validation and dependent_fields is None: # noqa: E501 - raise ValueError("Invalid value for `dependent_fields`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 + raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 + allowed_values = ["single_checkbox"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - self._dependent_fields = dependent_fields + self._field_type = field_type @property - def default_value(self): - """Gets the default_value of this SingleCheckboxField. # noqa: E501 + def required(self): + """Gets the required of this SingleCheckboxField. # noqa: E501 - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Whether a value for this field is required when submitting the form. # noqa: E501 - :return: The default_value of this SingleCheckboxField. # noqa: E501 - :rtype: str + :return: The required of this SingleCheckboxField. # noqa: E501 + :rtype: bool """ - return self._default_value + return self._required - @default_value.setter - def default_value(self, default_value): - """Sets the default_value of this SingleCheckboxField. + @required.setter + def required(self, required): + """Sets the required of this SingleCheckboxField. - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Whether a value for this field is required when submitting the form. # noqa: E501 - :param default_value: The default_value of this SingleCheckboxField. # noqa: E501 - :type default_value: str + :param required: The required of this SingleCheckboxField. # noqa: E501 + :type required: bool """ + if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 + raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 - self._default_value = default_value + self._required = required def to_dict(self, serialize=False): """Returns the model properties as a dict""" diff --git a/hubspot/marketing/forms/models/single_line_text_field.py b/hubspot/marketing/forms/models/single_line_text_field.py index 064799c7..f8475e5b 100644 --- a/hubspot/marketing/forms/models/single_line_text_field.py +++ b/hubspot/marketing/forms/models/single_line_text_field.py @@ -36,43 +36,43 @@ class SingleLineTextField(object): and the value is json key in definition. """ openapi_types = { - "field_type": "str", "object_type_id": "str", + "hidden": "bool", + "default_value": "str", "name": "str", - "label": "str", "description": "str", - "required": "bool", - "hidden": "bool", "dependent_fields": "list[DependentField]", + "label": "str", "placeholder": "str", - "default_value": "str", + "field_type": "str", + "required": "bool", } attribute_map = { - "field_type": "fieldType", "object_type_id": "objectTypeId", + "hidden": "hidden", + "default_value": "defaultValue", "name": "name", - "label": "label", "description": "description", - "required": "required", - "hidden": "hidden", "dependent_fields": "dependentFields", + "label": "label", "placeholder": "placeholder", - "default_value": "defaultValue", + "field_type": "fieldType", + "required": "required", } def __init__( self, - field_type="single_line_text", object_type_id=None, + hidden=None, + default_value=None, name=None, - label=None, description=None, - required=None, - hidden=None, dependent_fields=None, + label=None, placeholder=None, - default_value=None, + field_type="single_line_text", + required=None, local_vars_configuration=None, ): # noqa: E501 """SingleLineTextField - a model defined in OpenAPI""" # noqa: E501 @@ -80,59 +80,31 @@ def __init__( local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration - self._field_type = None self._object_type_id = None + self._hidden = None + self._default_value = None self._name = None - self._label = None self._description = None - self._required = None - self._hidden = None self._dependent_fields = None + self._label = None self._placeholder = None - self._default_value = None + self._field_type = None + self._required = None self.discriminator = None - self.field_type = field_type self.object_type_id = object_type_id + self.hidden = hidden + if default_value is not None: + self.default_value = default_value self.name = name - self.label = label if description is not None: self.description = description - self.required = required - self.hidden = hidden self.dependent_fields = dependent_fields + self.label = label if placeholder is not None: self.placeholder = placeholder - if default_value is not None: - self.default_value = default_value - - @property - def field_type(self): - """Gets the field_type of this SingleLineTextField. # noqa: E501 - - Determines how the field will be displayed and validated. # noqa: E501 - - :return: The field_type of this SingleLineTextField. # noqa: E501 - :rtype: str - """ - return self._field_type - - @field_type.setter - def field_type(self, field_type): - """Sets the field_type of this SingleLineTextField. - - Determines how the field will be displayed and validated. # noqa: E501 - - :param field_type: The field_type of this SingleLineTextField. # noqa: E501 - :type field_type: str - """ - if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 - raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 - allowed_values = ["single_line_text"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - - self._field_type = field_type + self.field_type = field_type + self.required = required @property def object_type_id(self): @@ -159,6 +131,54 @@ def object_type_id(self, object_type_id): self._object_type_id = object_type_id + @property + def hidden(self): + """Gets the hidden of this SingleLineTextField. # noqa: E501 + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :return: The hidden of this SingleLineTextField. # noqa: E501 + :rtype: bool + """ + return self._hidden + + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this SingleLineTextField. + + Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 + + :param hidden: The hidden of this SingleLineTextField. # noqa: E501 + :type hidden: bool + """ + if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 + raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 + + self._hidden = hidden + + @property + def default_value(self): + """Gets the default_value of this SingleLineTextField. # noqa: E501 + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :return: The default_value of this SingleLineTextField. # noqa: E501 + :rtype: str + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this SingleLineTextField. + + The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + + :param default_value: The default_value of this SingleLineTextField. # noqa: E501 + :type default_value: str + """ + + self._default_value = default_value + @property def name(self): """Gets the name of this SingleLineTextField. # noqa: E501 @@ -184,31 +204,6 @@ def name(self, name): self._name = name - @property - def label(self): - """Gets the label of this SingleLineTextField. # noqa: E501 - - The main label for the form field. # noqa: E501 - - :return: The label of this SingleLineTextField. # noqa: E501 - :rtype: str - """ - return self._label - - @label.setter - def label(self, label): - """Sets the label of this SingleLineTextField. - - The main label for the form field. # noqa: E501 - - :param label: The label of this SingleLineTextField. # noqa: E501 - :type label: str - """ - if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 - raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 - - self._label = label - @property def description(self): """Gets the description of this SingleLineTextField. # noqa: E501 @@ -232,56 +227,6 @@ def description(self, description): self._description = description - @property - def required(self): - """Gets the required of this SingleLineTextField. # noqa: E501 - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :return: The required of this SingleLineTextField. # noqa: E501 - :rtype: bool - """ - return self._required - - @required.setter - def required(self, required): - """Sets the required of this SingleLineTextField. - - Whether a value for this field is required when submitting the form. # noqa: E501 - - :param required: The required of this SingleLineTextField. # noqa: E501 - :type required: bool - """ - if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 - raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 - - self._required = required - - @property - def hidden(self): - """Gets the hidden of this SingleLineTextField. # noqa: E501 - - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - - :return: The hidden of this SingleLineTextField. # noqa: E501 - :rtype: bool - """ - return self._hidden - - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this SingleLineTextField. - - Whether a field should be hidden or not. Hidden fields won't appear on the form, but can be used to pass a value to a property without requiring the customer to fill it in. # noqa: E501 - - :param hidden: The hidden of this SingleLineTextField. # noqa: E501 - :type hidden: bool - """ - if self.local_vars_configuration.client_side_validation and hidden is None: # noqa: E501 - raise ValueError("Invalid value for `hidden`, must not be `None`") # noqa: E501 - - self._hidden = hidden - @property def dependent_fields(self): """Gets the dependent_fields of this SingleLineTextField. # noqa: E501 @@ -307,6 +252,31 @@ def dependent_fields(self, dependent_fields): self._dependent_fields = dependent_fields + @property + def label(self): + """Gets the label of this SingleLineTextField. # noqa: E501 + + The main label for the form field. # noqa: E501 + + :return: The label of this SingleLineTextField. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this SingleLineTextField. + + The main label for the form field. # noqa: E501 + + :param label: The label of this SingleLineTextField. # noqa: E501 + :type label: str + """ + if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + + self._label = label + @property def placeholder(self): """Gets the placeholder of this SingleLineTextField. # noqa: E501 @@ -331,27 +301,57 @@ def placeholder(self, placeholder): self._placeholder = placeholder @property - def default_value(self): - """Gets the default_value of this SingleLineTextField. # noqa: E501 + def field_type(self): + """Gets the field_type of this SingleLineTextField. # noqa: E501 - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :return: The default_value of this SingleLineTextField. # noqa: E501 + :return: The field_type of this SingleLineTextField. # noqa: E501 :rtype: str """ - return self._default_value + return self._field_type - @default_value.setter - def default_value(self, default_value): - """Sets the default_value of this SingleLineTextField. + @field_type.setter + def field_type(self, field_type): + """Sets the field_type of this SingleLineTextField. - The value filled in by default. This value will be submitted unless the customer modifies it. # noqa: E501 + Determines how the field will be displayed and validated. # noqa: E501 - :param default_value: The default_value of this SingleLineTextField. # noqa: E501 - :type default_value: str + :param field_type: The field_type of this SingleLineTextField. # noqa: E501 + :type field_type: str """ + if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 + raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 + allowed_values = ["single_line_text"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and field_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `field_type` ({0}), must be one of {1}".format(field_type, allowed_values)) # noqa: E501 - self._default_value = default_value + self._field_type = field_type + + @property + def required(self): + """Gets the required of this SingleLineTextField. # noqa: E501 + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :return: The required of this SingleLineTextField. # noqa: E501 + :rtype: bool + """ + return self._required + + @required.setter + def required(self, required): + """Sets the required of this SingleLineTextField. + + Whether a value for this field is required when submitting the form. # noqa: E501 + + :param required: The required of this SingleLineTextField. # noqa: E501 + :type required: bool + """ + if self.local_vars_configuration.client_side_validation and required is None: # noqa: E501 + raise ValueError("Invalid value for `required`, must not be `None`") # noqa: E501 + + self._required = required def to_dict(self, serialize=False): """Returns the model properties as a dict""" From b41998280f99953c3fe65a96c150d4f2d353bed0 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 1 Apr 2025 12:42:18 +0300 Subject: [PATCH 06/49] Codegen Marketing Transactional --- hubspot/marketing/transactional/__init__.py | 2 +- hubspot/marketing/transactional/api/__init__.py | 2 +- hubspot/marketing/transactional/api/public_smtp_tokens_api.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hubspot/marketing/transactional/__init__.py b/hubspot/marketing/transactional/__init__.py index eb584b79..9cc508ee 100644 --- a/hubspot/marketing/transactional/__init__.py +++ b/hubspot/marketing/transactional/__init__.py @@ -17,7 +17,7 @@ __version__ = "1.0.0" # import apis into sdk package -from hubspot.marketing.transactional.api.public_smtp_tokens_api import PublicSmtpTokensApi +from hubspot.marketing.transactional.api.public_smtp_tokens_api import PublicSMTPTokensApi from hubspot.marketing.transactional.api.single_send_api import SingleSendApi # import ApiClient diff --git a/hubspot/marketing/transactional/api/__init__.py b/hubspot/marketing/transactional/api/__init__.py index 8af3e0b2..ed3db351 100644 --- a/hubspot/marketing/transactional/api/__init__.py +++ b/hubspot/marketing/transactional/api/__init__.py @@ -3,5 +3,5 @@ # flake8: noqa # import apis into api package -from hubspot.marketing.transactional.api.public_smtp_tokens_api import PublicSmtpTokensApi +from hubspot.marketing.transactional.api.public_smtp_tokens_api import PublicSMTPTokensApi from hubspot.marketing.transactional.api.single_send_api import SingleSendApi diff --git a/hubspot/marketing/transactional/api/public_smtp_tokens_api.py b/hubspot/marketing/transactional/api/public_smtp_tokens_api.py index 78911ac3..944f29ed 100644 --- a/hubspot/marketing/transactional/api/public_smtp_tokens_api.py +++ b/hubspot/marketing/transactional/api/public_smtp_tokens_api.py @@ -21,7 +21,7 @@ from hubspot.marketing.transactional.exceptions import ApiTypeError, ApiValueError # noqa: F401 -class PublicSmtpTokensApi(object): +class PublicSMTPTokensApi(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech From 47a651c260c2609552bc2ed27b2f06007c2749e5 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 1 Apr 2025 12:51:32 +0300 Subject: [PATCH 07/49] Codegen Crm Commerce Invoices --- hubspot/crm/commerce/__init__.py | 0 hubspot/crm/commerce/invoices/__init__.py | 70 ++ hubspot/crm/commerce/invoices/api/__init__.py | 8 + .../crm/commerce/invoices/api/basic_api.py | 735 ++++++++++++++++++ .../crm/commerce/invoices/api/batch_api.py | 676 ++++++++++++++++ .../crm/commerce/invoices/api/search_api.py | 162 ++++ hubspot/crm/commerce/invoices/api_client.py | 664 ++++++++++++++++ .../crm/commerce/invoices/configuration.py | 439 +++++++++++ hubspot/crm/commerce/invoices/exceptions.py | 155 ++++ .../crm/commerce/invoices/models/__init__.py | 52 ++ .../commerce/invoices/models/associated_id.py | 147 ++++ .../invoices/models/association_spec.py | 150 ++++ ..._input_simple_public_object_batch_input.py | 122 +++ ...le_public_object_batch_input_for_create.py | 122 +++ ...simple_public_object_batch_input_upsert.py | 122 +++ .../batch_input_simple_public_object_id.py | 122 +++ ...atch_read_input_simple_public_object_id.py | 198 +++++ .../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/commerce/invoices/models/error.py | 282 +++++++ .../commerce/invoices/models/error_detail.py | 228 ++++++ .../crm/commerce/invoices/models/filter.py | 224 ++++++ .../commerce/invoices/models/filter_group.py | 122 +++ .../invoices/models/forward_paging.py | 121 +++ .../crm/commerce/invoices/models/next_page.py | 146 ++++ .../crm/commerce/invoices/models/paging.py | 145 ++++ .../commerce/invoices/models/previous_page.py | 146 ++++ .../models/public_associations_for_object.py | 147 ++++ .../invoices/models/public_object_id.py | 122 +++ .../models/public_object_search_request.py | 241 ++++++ .../invoices/models/simple_public_object.py | 313 ++++++++ .../simple_public_object_batch_input.py | 199 +++++ ...le_public_object_batch_input_for_create.py | 170 ++++ ...simple_public_object_batch_input_upsert.py | 197 +++++ .../models/simple_public_object_id.py | 122 +++ .../models/simple_public_object_input.py | 122 +++ .../simple_public_object_input_for_create.py | 146 ++++ .../simple_public_object_with_associations.py | 349 +++++++++ .../models/simple_public_upsert_object.py | 350 +++++++++ .../invoices/models/standard_error.py | 304 ++++++++ .../invoices/models/value_with_timestamp.py | 244 ++++++ hubspot/crm/commerce/invoices/rest.py | 213 +++++ 47 files changed, 10184 insertions(+) create mode 100644 hubspot/crm/commerce/__init__.py create mode 100644 hubspot/crm/commerce/invoices/__init__.py create mode 100644 hubspot/crm/commerce/invoices/api/__init__.py create mode 100644 hubspot/crm/commerce/invoices/api/basic_api.py create mode 100644 hubspot/crm/commerce/invoices/api/batch_api.py create mode 100644 hubspot/crm/commerce/invoices/api/search_api.py create mode 100644 hubspot/crm/commerce/invoices/api_client.py create mode 100644 hubspot/crm/commerce/invoices/configuration.py create mode 100644 hubspot/crm/commerce/invoices/exceptions.py create mode 100644 hubspot/crm/commerce/invoices/models/__init__.py create mode 100644 hubspot/crm/commerce/invoices/models/associated_id.py create mode 100644 hubspot/crm/commerce/invoices/models/association_spec.py create mode 100644 hubspot/crm/commerce/invoices/models/batch_input_simple_public_object_batch_input.py create mode 100644 hubspot/crm/commerce/invoices/models/batch_input_simple_public_object_batch_input_for_create.py create mode 100644 hubspot/crm/commerce/invoices/models/batch_input_simple_public_object_batch_input_upsert.py create mode 100644 hubspot/crm/commerce/invoices/models/batch_input_simple_public_object_id.py create mode 100644 hubspot/crm/commerce/invoices/models/batch_read_input_simple_public_object_id.py create mode 100644 hubspot/crm/commerce/invoices/models/batch_response_simple_public_object.py create mode 100644 hubspot/crm/commerce/invoices/models/batch_response_simple_public_object_with_errors.py create mode 100644 hubspot/crm/commerce/invoices/models/batch_response_simple_public_upsert_object.py create mode 100644 hubspot/crm/commerce/invoices/models/batch_response_simple_public_upsert_object_with_errors.py create mode 100644 hubspot/crm/commerce/invoices/models/collection_response_associated_id.py create mode 100644 hubspot/crm/commerce/invoices/models/collection_response_simple_public_object_with_associations_forward_paging.py create mode 100644 hubspot/crm/commerce/invoices/models/collection_response_with_total_simple_public_object_forward_paging.py create mode 100644 hubspot/crm/commerce/invoices/models/error.py create mode 100644 hubspot/crm/commerce/invoices/models/error_detail.py create mode 100644 hubspot/crm/commerce/invoices/models/filter.py create mode 100644 hubspot/crm/commerce/invoices/models/filter_group.py create mode 100644 hubspot/crm/commerce/invoices/models/forward_paging.py create mode 100644 hubspot/crm/commerce/invoices/models/next_page.py create mode 100644 hubspot/crm/commerce/invoices/models/paging.py create mode 100644 hubspot/crm/commerce/invoices/models/previous_page.py create mode 100644 hubspot/crm/commerce/invoices/models/public_associations_for_object.py create mode 100644 hubspot/crm/commerce/invoices/models/public_object_id.py create mode 100644 hubspot/crm/commerce/invoices/models/public_object_search_request.py create mode 100644 hubspot/crm/commerce/invoices/models/simple_public_object.py create mode 100644 hubspot/crm/commerce/invoices/models/simple_public_object_batch_input.py create mode 100644 hubspot/crm/commerce/invoices/models/simple_public_object_batch_input_for_create.py create mode 100644 hubspot/crm/commerce/invoices/models/simple_public_object_batch_input_upsert.py create mode 100644 hubspot/crm/commerce/invoices/models/simple_public_object_id.py create mode 100644 hubspot/crm/commerce/invoices/models/simple_public_object_input.py create mode 100644 hubspot/crm/commerce/invoices/models/simple_public_object_input_for_create.py create mode 100644 hubspot/crm/commerce/invoices/models/simple_public_object_with_associations.py create mode 100644 hubspot/crm/commerce/invoices/models/simple_public_upsert_object.py create mode 100644 hubspot/crm/commerce/invoices/models/standard_error.py create mode 100644 hubspot/crm/commerce/invoices/models/value_with_timestamp.py create mode 100644 hubspot/crm/commerce/invoices/rest.py diff --git a/hubspot/crm/commerce/__init__.py b/hubspot/crm/commerce/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/hubspot/crm/commerce/invoices/__init__.py b/hubspot/crm/commerce/invoices/__init__.py new file mode 100644 index 00000000..e6118512 --- /dev/null +++ b/hubspot/crm/commerce/invoices/__init__.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Invoices + + 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.commerce.invoices.api.basic_api import BasicApi +from hubspot.crm.commerce.invoices.api.batch_api import BatchApi +from hubspot.crm.commerce.invoices.api.search_api import SearchApi + +# import ApiClient +from hubspot.crm.commerce.invoices.api_client import ApiClient +from hubspot.crm.commerce.invoices.configuration import Configuration +from hubspot.crm.commerce.invoices.exceptions import OpenApiException +from hubspot.crm.commerce.invoices.exceptions import ApiTypeError +from hubspot.crm.commerce.invoices.exceptions import ApiValueError +from hubspot.crm.commerce.invoices.exceptions import ApiKeyError +from hubspot.crm.commerce.invoices.exceptions import ApiAttributeError +from hubspot.crm.commerce.invoices.exceptions import ApiException + +# import models into sdk package +from hubspot.crm.commerce.invoices.models.associated_id import AssociatedId +from hubspot.crm.commerce.invoices.models.association_spec import AssociationSpec +from hubspot.crm.commerce.invoices.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.commerce.invoices.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate +from hubspot.crm.commerce.invoices.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert +from hubspot.crm.commerce.invoices.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId +from hubspot.crm.commerce.invoices.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId +from hubspot.crm.commerce.invoices.models.batch_response_simple_public_object import BatchResponseSimplePublicObject +from hubspot.crm.commerce.invoices.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors +from hubspot.crm.commerce.invoices.models.batch_response_simple_public_upsert_object import BatchResponseSimplePublicUpsertObject +from hubspot.crm.commerce.invoices.models.batch_response_simple_public_upsert_object_with_errors import BatchResponseSimplePublicUpsertObjectWithErrors +from hubspot.crm.commerce.invoices.models.collection_response_associated_id import CollectionResponseAssociatedId +from hubspot.crm.commerce.invoices.models.collection_response_simple_public_object_with_associations_forward_paging import CollectionResponseSimplePublicObjectWithAssociationsForwardPaging +from hubspot.crm.commerce.invoices.models.collection_response_with_total_simple_public_object_forward_paging import CollectionResponseWithTotalSimplePublicObjectForwardPaging +from hubspot.crm.commerce.invoices.models.error import Error +from hubspot.crm.commerce.invoices.models.error_detail import ErrorDetail +from hubspot.crm.commerce.invoices.models.filter import Filter +from hubspot.crm.commerce.invoices.models.filter_group import FilterGroup +from hubspot.crm.commerce.invoices.models.forward_paging import ForwardPaging +from hubspot.crm.commerce.invoices.models.next_page import NextPage +from hubspot.crm.commerce.invoices.models.paging import Paging +from hubspot.crm.commerce.invoices.models.previous_page import PreviousPage +from hubspot.crm.commerce.invoices.models.public_associations_for_object import PublicAssociationsForObject +from hubspot.crm.commerce.invoices.models.public_object_id import PublicObjectId +from hubspot.crm.commerce.invoices.models.public_object_search_request import PublicObjectSearchRequest +from hubspot.crm.commerce.invoices.models.simple_public_object import SimplePublicObject +from hubspot.crm.commerce.invoices.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.commerce.invoices.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate +from hubspot.crm.commerce.invoices.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert +from hubspot.crm.commerce.invoices.models.simple_public_object_id import SimplePublicObjectId +from hubspot.crm.commerce.invoices.models.simple_public_object_input import SimplePublicObjectInput +from hubspot.crm.commerce.invoices.models.simple_public_object_input_for_create import SimplePublicObjectInputForCreate +from hubspot.crm.commerce.invoices.models.simple_public_object_with_associations import SimplePublicObjectWithAssociations +from hubspot.crm.commerce.invoices.models.simple_public_upsert_object import SimplePublicUpsertObject +from hubspot.crm.commerce.invoices.models.standard_error import StandardError +from hubspot.crm.commerce.invoices.models.value_with_timestamp import ValueWithTimestamp diff --git a/hubspot/crm/commerce/invoices/api/__init__.py b/hubspot/crm/commerce/invoices/api/__init__.py new file mode 100644 index 00000000..37ef6143 --- /dev/null +++ b/hubspot/crm/commerce/invoices/api/__init__.py @@ -0,0 +1,8 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from hubspot.crm.commerce.invoices.api.basic_api import BasicApi +from hubspot.crm.commerce.invoices.api.batch_api import BatchApi +from hubspot.crm.commerce.invoices.api.search_api import SearchApi diff --git a/hubspot/crm/commerce/invoices/api/basic_api.py b/hubspot/crm/commerce/invoices/api/basic_api.py new file mode 100644 index 00000000..72f2bb4b --- /dev/null +++ b/hubspot/crm/commerce/invoices/api/basic_api.py @@ -0,0 +1,735 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.api_client import ApiClient +from hubspot.crm.commerce.invoices.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, invoice_id, **kwargs): # noqa: E501 + """Archive # noqa: E501 + + Move an Object identified by `{invoiceId}` 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(invoice_id, async_req=True) + >>> result = thread.get() + + :param invoice_id: (required) + :type invoice_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(invoice_id, **kwargs) # noqa: E501 + + def archive_with_http_info(self, invoice_id, **kwargs): # noqa: E501 + """Archive # noqa: E501 + + Move an Object identified by `{invoiceId}` 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(invoice_id, async_req=True) + >>> result = thread.get() + + :param invoice_id: (required) + :type invoice_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 = ["invoice_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 'invoice_id' is set + if self.api_client.client_side_validation and local_var_params.get("invoice_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `invoice_id` when calling `archive`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "invoice_id" in local_var_params: + path_params["invoiceId"] = local_var_params["invoice_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/invoices/{invoiceId}", + "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 invoice with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard invoices 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 invoice with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard invoices 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/invoices", + "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, invoice_id, **kwargs): # noqa: E501 + """Read # noqa: E501 + + Read an Object identified by `{invoiceId}`. `{invoiceId}` 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(invoice_id, async_req=True) + >>> result = thread.get() + + :param invoice_id: (required) + :type invoice_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(invoice_id, **kwargs) # noqa: E501 + + def get_by_id_with_http_info(self, invoice_id, **kwargs): # noqa: E501 + """Read # noqa: E501 + + Read an Object identified by `{invoiceId}`. `{invoiceId}` 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(invoice_id, async_req=True) + >>> result = thread.get() + + :param invoice_id: (required) + :type invoice_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 = ["invoice_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 'invoice_id' is set + if self.api_client.client_side_validation and local_var_params.get("invoice_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `invoice_id` when calling `get_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "invoice_id" in local_var_params: + path_params["invoiceId"] = local_var_params["invoice_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/invoices/{invoiceId}", + "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 invoices. 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 invoices. 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/invoices", + "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, invoice_id, simple_public_object_input, **kwargs): # noqa: E501 + """Update # noqa: E501 + + Perform a partial update of an Object identified by `{invoiceId}`or optionally a unique property value as specified by the `idProperty` query param. `{invoiceId}` 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(invoice_id, simple_public_object_input, async_req=True) + >>> result = thread.get() + + :param invoice_id: (required) + :type invoice_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(invoice_id, simple_public_object_input, **kwargs) # noqa: E501 + + def update_with_http_info(self, invoice_id, simple_public_object_input, **kwargs): # noqa: E501 + """Update # noqa: E501 + + Perform a partial update of an Object identified by `{invoiceId}`or optionally a unique property value as specified by the `idProperty` query param. `{invoiceId}` 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(invoice_id, simple_public_object_input, async_req=True) + >>> result = thread.get() + + :param invoice_id: (required) + :type invoice_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 = ["invoice_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 'invoice_id' is set + if self.api_client.client_side_validation and local_var_params.get("invoice_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `invoice_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 "invoice_id" in local_var_params: + path_params["invoiceId"] = local_var_params["invoice_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/invoices/{invoiceId}", + "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/commerce/invoices/api/batch_api.py b/hubspot/crm/commerce/invoices/api/batch_api.py new file mode 100644 index 00000000..fb92f215 --- /dev/null +++ b/hubspot/crm/commerce/invoices/api/batch_api.py @@ -0,0 +1,676 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.api_client import ApiClient +from hubspot.crm.commerce.invoices.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 invoices 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 invoices 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/invoices/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_batch_input_for_create, **kwargs): # noqa: E501 + """Create a batch of invoices # 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_batch_input_for_create, async_req=True) + >>> result = thread.get() + + :param batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate + :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_batch_input_for_create, **kwargs) # noqa: E501 + + def create_with_http_info(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 + """Create a batch of invoices # 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_batch_input_for_create, async_req=True) + >>> result = thread.get() + + :param batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate + :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_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_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_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_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_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/invoices/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 invoices by internal ID, or unique property values # noqa: E501 + + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # 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 invoices by internal ID, or unique property values # noqa: E501 + + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # 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/invoices/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 invoices 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 invoices 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/invoices/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 invoices by unique property values # noqa: E501 + + Create or update records identified by a unique property value as specified by the `idProperty` query param. `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 invoices by unique property values # noqa: E501 + + Create or update records identified by a unique property value as specified by the `idProperty` query param. `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/invoices/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/commerce/invoices/api/search_api.py b/hubspot/crm/commerce/invoices/api/search_api.py new file mode 100644 index 00000000..7b303147 --- /dev/null +++ b/hubspot/crm/commerce/invoices/api/search_api.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.api_client import ApiClient +from hubspot.crm.commerce.invoices.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 + """Search for invoices # noqa: E501 + + Search for invoices by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request). # 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 + """Search for invoices # noqa: E501 + + Search for invoices by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request). # 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/invoices/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/commerce/invoices/api_client.py b/hubspot/crm/commerce/invoices/api_client.py new file mode 100644 index 00000000..25724c17 --- /dev/null +++ b/hubspot/crm/commerce/invoices/api_client.py @@ -0,0 +1,664 @@ +# coding: utf-8 +""" + Invoices + + 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.commerce.invoices.configuration import Configuration +import hubspot.crm.commerce.invoices.models +from hubspot.crm.commerce.invoices import rest +from hubspot.crm.commerce.invoices.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.commerce.invoices.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/commerce/invoices/configuration.py b/hubspot/crm/commerce/invoices/configuration.py new file mode 100644 index 00000000..877d2ed0 --- /dev/null +++ b/hubspot/crm/commerce/invoices/configuration.py @@ -0,0 +1,439 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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.commerce.invoices") + 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/commerce/invoices/exceptions.py b/hubspot/crm/commerce/invoices/exceptions.py new file mode 100644 index 00000000..21bddb12 --- /dev/null +++ b/hubspot/crm/commerce/invoices/exceptions.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Invoices + + 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/commerce/invoices/models/__init__.py b/hubspot/crm/commerce/invoices/models/__init__.py new file mode 100644 index 00000000..43b6f857 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/__init__.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +# flake8: noqa +""" + Invoices + + 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.commerce.invoices.models.associated_id import AssociatedId +from hubspot.crm.commerce.invoices.models.association_spec import AssociationSpec +from hubspot.crm.commerce.invoices.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.commerce.invoices.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate +from hubspot.crm.commerce.invoices.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert +from hubspot.crm.commerce.invoices.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId +from hubspot.crm.commerce.invoices.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId +from hubspot.crm.commerce.invoices.models.batch_response_simple_public_object import BatchResponseSimplePublicObject +from hubspot.crm.commerce.invoices.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors +from hubspot.crm.commerce.invoices.models.batch_response_simple_public_upsert_object import BatchResponseSimplePublicUpsertObject +from hubspot.crm.commerce.invoices.models.batch_response_simple_public_upsert_object_with_errors import BatchResponseSimplePublicUpsertObjectWithErrors +from hubspot.crm.commerce.invoices.models.collection_response_associated_id import CollectionResponseAssociatedId +from hubspot.crm.commerce.invoices.models.collection_response_simple_public_object_with_associations_forward_paging import CollectionResponseSimplePublicObjectWithAssociationsForwardPaging +from hubspot.crm.commerce.invoices.models.collection_response_with_total_simple_public_object_forward_paging import CollectionResponseWithTotalSimplePublicObjectForwardPaging +from hubspot.crm.commerce.invoices.models.error import Error +from hubspot.crm.commerce.invoices.models.error_detail import ErrorDetail +from hubspot.crm.commerce.invoices.models.filter import Filter +from hubspot.crm.commerce.invoices.models.filter_group import FilterGroup +from hubspot.crm.commerce.invoices.models.forward_paging import ForwardPaging +from hubspot.crm.commerce.invoices.models.next_page import NextPage +from hubspot.crm.commerce.invoices.models.paging import Paging +from hubspot.crm.commerce.invoices.models.previous_page import PreviousPage +from hubspot.crm.commerce.invoices.models.public_associations_for_object import PublicAssociationsForObject +from hubspot.crm.commerce.invoices.models.public_object_id import PublicObjectId +from hubspot.crm.commerce.invoices.models.public_object_search_request import PublicObjectSearchRequest +from hubspot.crm.commerce.invoices.models.simple_public_object import SimplePublicObject +from hubspot.crm.commerce.invoices.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.commerce.invoices.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate +from hubspot.crm.commerce.invoices.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert +from hubspot.crm.commerce.invoices.models.simple_public_object_id import SimplePublicObjectId +from hubspot.crm.commerce.invoices.models.simple_public_object_input import SimplePublicObjectInput +from hubspot.crm.commerce.invoices.models.simple_public_object_input_for_create import SimplePublicObjectInputForCreate +from hubspot.crm.commerce.invoices.models.simple_public_object_with_associations import SimplePublicObjectWithAssociations +from hubspot.crm.commerce.invoices.models.simple_public_upsert_object import SimplePublicUpsertObject +from hubspot.crm.commerce.invoices.models.standard_error import StandardError +from hubspot.crm.commerce.invoices.models.value_with_timestamp import ValueWithTimestamp diff --git a/hubspot/crm/commerce/invoices/models/associated_id.py b/hubspot/crm/commerce/invoices/models/associated_id.py new file mode 100644 index 00000000..15d9c5b1 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/associated_id.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/association_spec.py b/hubspot/crm/commerce/invoices/models/association_spec.py new file mode 100644 index 00000000..1a479374 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/association_spec.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/batch_input_simple_public_object_batch_input.py b/hubspot/crm/commerce/invoices/models/batch_input_simple_public_object_batch_input.py new file mode 100644 index 00000000..d305a021 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/batch_input_simple_public_object_batch_input.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/batch_input_simple_public_object_batch_input_for_create.py b/hubspot/crm/commerce/invoices/models/batch_input_simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..0b2f4224 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/batch_input_simple_public_object_batch_input_for_create.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.configuration import Configuration + + +class BatchInputSimplePublicObjectBatchInputForCreate(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[SimplePublicObjectBatchInputForCreate]"} + + attribute_map = {"inputs": "inputs"} + + def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] + """ + return self._inputs + + @inputs.setter + def inputs(self, inputs): + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. + + + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] + """ + 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, BatchInputSimplePublicObjectBatchInputForCreate): + 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, BatchInputSimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/commerce/invoices/models/batch_input_simple_public_object_batch_input_upsert.py b/hubspot/crm/commerce/invoices/models/batch_input_simple_public_object_batch_input_upsert.py new file mode 100644 index 00000000..8831e9f2 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/batch_input_simple_public_object_batch_input_upsert.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/batch_input_simple_public_object_id.py b/hubspot/crm/commerce/invoices/models/batch_input_simple_public_object_id.py new file mode 100644 index 00000000..ccbc1034 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/batch_input_simple_public_object_id.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/commerce/invoices/models/batch_read_input_simple_public_object_id.py new file mode 100644 index 00000000..bc25765f --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/batch_read_input_simple_public_object_id.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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 + + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # 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. + + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 + + :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/commerce/invoices/models/batch_response_simple_public_object.py b/hubspot/crm/commerce/invoices/models/batch_response_simple_public_object.py new file mode 100644 index 00000000..9aff7581 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/batch_response_simple_public_object.py @@ -0,0 +1,248 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/batch_response_simple_public_object_with_errors.py b/hubspot/crm/commerce/invoices/models/batch_response_simple_public_object_with_errors.py new file mode 100644 index 00000000..d544e102 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/batch_response_simple_public_object_with_errors.py @@ -0,0 +1,314 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/batch_response_simple_public_upsert_object.py b/hubspot/crm/commerce/invoices/models/batch_response_simple_public_upsert_object.py new file mode 100644 index 00000000..aee5808b --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/batch_response_simple_public_upsert_object.py @@ -0,0 +1,248 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/batch_response_simple_public_upsert_object_with_errors.py b/hubspot/crm/commerce/invoices/models/batch_response_simple_public_upsert_object_with_errors.py new file mode 100644 index 00000000..966b8267 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/batch_response_simple_public_upsert_object_with_errors.py @@ -0,0 +1,314 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/collection_response_associated_id.py b/hubspot/crm/commerce/invoices/models/collection_response_associated_id.py new file mode 100644 index 00000000..de9f686f --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/collection_response_associated_id.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/collection_response_simple_public_object_with_associations_forward_paging.py b/hubspot/crm/commerce/invoices/models/collection_response_simple_public_object_with_associations_forward_paging.py new file mode 100644 index 00000000..3368083c --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/collection_response_simple_public_object_with_associations_forward_paging.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/collection_response_with_total_simple_public_object_forward_paging.py b/hubspot/crm/commerce/invoices/models/collection_response_with_total_simple_public_object_forward_paging.py new file mode 100644 index 00000000..04b51d71 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/collection_response_with_total_simple_public_object_forward_paging.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/error.py b/hubspot/crm/commerce/invoices/models/error.py new file mode 100644 index 00000000..0e2ff424 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/error.py @@ -0,0 +1,282 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/error_detail.py b/hubspot/crm/commerce/invoices/models/error_detail.py new file mode 100644 index 00000000..7268d4cd --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/error_detail.py @@ -0,0 +1,228 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/filter.py b/hubspot/crm/commerce/invoices/models/filter.py new file mode 100644 index 00000000..8ec84f3e --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/filter.py @@ -0,0 +1,224 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/filter_group.py b/hubspot/crm/commerce/invoices/models/filter_group.py new file mode 100644 index 00000000..eb3ac58f --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/filter_group.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/forward_paging.py b/hubspot/crm/commerce/invoices/models/forward_paging.py new file mode 100644 index 00000000..64070358 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/forward_paging.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/next_page.py b/hubspot/crm/commerce/invoices/models/next_page.py new file mode 100644 index 00000000..6a069432 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/next_page.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/paging.py b/hubspot/crm/commerce/invoices/models/paging.py new file mode 100644 index 00000000..ae53b76c --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/paging.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/previous_page.py b/hubspot/crm/commerce/invoices/models/previous_page.py new file mode 100644 index 00000000..66600612 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/previous_page.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/public_associations_for_object.py b/hubspot/crm/commerce/invoices/models/public_associations_for_object.py new file mode 100644 index 00000000..7319c5e3 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/public_associations_for_object.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/public_object_id.py b/hubspot/crm/commerce/invoices/models/public_object_id.py new file mode 100644 index 00000000..162b01ed --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/public_object_id.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/public_object_search_request.py b/hubspot/crm/commerce/invoices/models/public_object_search_request.py new file mode 100644 index 00000000..c3940c51 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/public_object_search_request.py @@ -0,0 +1,241 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/simple_public_object.py b/hubspot/crm/commerce/invoices/models/simple_public_object.py new file mode 100644 index 00000000..f9621ed4 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/simple_public_object.py @@ -0,0 +1,313 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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", + "object_write_trace_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", + "object_write_trace_id": "objectWriteTraceId", + "properties": "properties", + "updated_at": "updatedAt", + } + + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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._object_write_trace_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 + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_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 object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 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/commerce/invoices/models/simple_public_object_batch_input.py b/hubspot/crm/commerce/invoices/models/simple_public_object_batch_input.py new file mode 100644 index 00000000..af46bce9 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/simple_public_object_batch_input.py @@ -0,0 +1,199 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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 + + The name of a property whose values are unique for this object # 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. + + The name of a property whose values are unique for this object # noqa: E501 + + :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 + + The id to be updated. This can be the object id, or the unique property value of the idProperty property # 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. + + The id to be updated. This can be the object id, or the unique property value of the idProperty property # noqa: E501 + + :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/commerce/invoices/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/commerce/invoices/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..15b29b6d --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.configuration import Configuration + + +class SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/commerce/invoices/models/simple_public_object_batch_input_upsert.py b/hubspot/crm/commerce/invoices/models/simple_public_object_batch_input_upsert.py new file mode 100644 index 00000000..e3cc4b6d --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/simple_public_object_batch_input_upsert.py @@ -0,0 +1,197 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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 + + The name of a property whose values are unique for this object # 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. + + The name of a property whose values are unique for this object # noqa: E501 + + :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/commerce/invoices/models/simple_public_object_id.py b/hubspot/crm/commerce/invoices/models/simple_public_object_id.py new file mode 100644 index 00000000..bfc9e12c --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/simple_public_object_id.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/simple_public_object_input.py b/hubspot/crm/commerce/invoices/models/simple_public_object_input.py new file mode 100644 index 00000000..f2992374 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/simple_public_object_input.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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 = {"properties": "dict[str, str]"} + + attribute_map = {"properties": "properties"} + + def __init__(self, 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._properties = None + self.discriminator = None + + self.properties = properties + + @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/commerce/invoices/models/simple_public_object_input_for_create.py b/hubspot/crm/commerce/invoices/models/simple_public_object_input_for_create.py new file mode 100644 index 00000000..8e9a987a --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/simple_public_object_input_for_create.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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]", "properties": "dict[str, str]"} + + attribute_map = {"associations": "associations", "properties": "properties"} + + def __init__(self, associations=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._properties = None + self.discriminator = None + + if associations is not None: + self.associations = associations + 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] + """ + + self._associations = associations + + @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/commerce/invoices/models/simple_public_object_with_associations.py b/hubspot/crm/commerce/invoices/models/simple_public_object_with_associations.py new file mode 100644 index 00000000..8b9e8796 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/simple_public_object_with_associations.py @@ -0,0 +1,349 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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", + "object_write_trace_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", + "object_write_trace_id": "objectWriteTraceId", + "properties": "properties", + "updated_at": "updatedAt", + } + + def __init__( + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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._object_write_trace_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 + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_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 object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 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/commerce/invoices/models/simple_public_upsert_object.py b/hubspot/crm/commerce/invoices/models/simple_public_upsert_object.py new file mode 100644 index 00000000..85e7913a --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/simple_public_upsert_object.py @@ -0,0 +1,350 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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", + "object_write_trace_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", + "object_write_trace_id": "objectWriteTraceId", + "properties": "properties", + "updated_at": "updatedAt", + } + + def __init__( + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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._object_write_trace_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 + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_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 object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 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/commerce/invoices/models/standard_error.py b/hubspot/crm/commerce/invoices/models/standard_error.py new file mode 100644 index 00000000..39a19c8a --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/standard_error.py @@ -0,0 +1,304 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/models/value_with_timestamp.py b/hubspot/crm/commerce/invoices/models/value_with_timestamp.py new file mode 100644 index 00000000..16ac0c65 --- /dev/null +++ b/hubspot/crm/commerce/invoices/models/value_with_timestamp.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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/commerce/invoices/rest.py b/hubspot/crm/commerce/invoices/rest.py new file mode 100644 index 00000000..15aece59 --- /dev/null +++ b/hubspot/crm/commerce/invoices/rest.py @@ -0,0 +1,213 @@ +# coding: utf-8 + +""" + Invoices + + 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.commerce.invoices.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) From 32777f32db65b0379166f486bd31f8ef60739b14 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 1 Apr 2025 12:53:45 +0300 Subject: [PATCH 08/49] Codegen Crm Exports --- hubspot/crm/exports/__init__.py | 44 ++ hubspot/crm/exports/api/__init__.py | 6 + hubspot/crm/exports/api/public_exports_api.py | 285 ++++++++ hubspot/crm/exports/api_client.py | 664 ++++++++++++++++++ hubspot/crm/exports/configuration.py | 439 ++++++++++++ hubspot/crm/exports/exceptions.py | 155 ++++ hubspot/crm/exports/models/__init__.py | 28 + .../action_response_with_single_result_uri.py | 313 +++++++++ hubspot/crm/exports/models/error.py | 282 ++++++++ hubspot/crm/exports/models/error_detail.py | 228 ++++++ hubspot/crm/exports/models/filter.py | 222 ++++++ .../models/public_crm_search_request.py | 172 +++++ .../models/public_export_list_request.py | 397 +++++++++++ .../public_export_list_request_all_of.py | 397 +++++++++++ .../exports/models/public_export_request.py | 424 +++++++++++ .../models/public_export_view_request.py | 396 +++++++++++ .../public_export_view_request_all_of.py | 396 +++++++++++ hubspot/crm/exports/models/standard_error.py | 304 ++++++++ hubspot/crm/exports/models/task_locator.py | 146 ++++ hubspot/crm/exports/rest.py | 213 ++++++ 20 files changed, 5511 insertions(+) create mode 100644 hubspot/crm/exports/__init__.py create mode 100644 hubspot/crm/exports/api/__init__.py create mode 100644 hubspot/crm/exports/api/public_exports_api.py create mode 100644 hubspot/crm/exports/api_client.py create mode 100644 hubspot/crm/exports/configuration.py create mode 100644 hubspot/crm/exports/exceptions.py create mode 100644 hubspot/crm/exports/models/__init__.py create mode 100644 hubspot/crm/exports/models/action_response_with_single_result_uri.py create mode 100644 hubspot/crm/exports/models/error.py create mode 100644 hubspot/crm/exports/models/error_detail.py create mode 100644 hubspot/crm/exports/models/filter.py create mode 100644 hubspot/crm/exports/models/public_crm_search_request.py create mode 100644 hubspot/crm/exports/models/public_export_list_request.py create mode 100644 hubspot/crm/exports/models/public_export_list_request_all_of.py create mode 100644 hubspot/crm/exports/models/public_export_request.py create mode 100644 hubspot/crm/exports/models/public_export_view_request.py create mode 100644 hubspot/crm/exports/models/public_export_view_request_all_of.py create mode 100644 hubspot/crm/exports/models/standard_error.py create mode 100644 hubspot/crm/exports/models/task_locator.py create mode 100644 hubspot/crm/exports/rest.py diff --git a/hubspot/crm/exports/__init__.py b/hubspot/crm/exports/__init__.py new file mode 100644 index 00000000..ab7dba20 --- /dev/null +++ b/hubspot/crm/exports/__init__.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +# flake8: noqa + +""" + CRM Exports + + 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.exports.api.public_exports_api import PublicExportsApi + +# import ApiClient +from hubspot.crm.exports.api_client import ApiClient +from hubspot.crm.exports.configuration import Configuration +from hubspot.crm.exports.exceptions import OpenApiException +from hubspot.crm.exports.exceptions import ApiTypeError +from hubspot.crm.exports.exceptions import ApiValueError +from hubspot.crm.exports.exceptions import ApiKeyError +from hubspot.crm.exports.exceptions import ApiAttributeError +from hubspot.crm.exports.exceptions import ApiException + +# import models into sdk package +from hubspot.crm.exports.models.action_response_with_single_result_uri import ActionResponseWithSingleResultURI +from hubspot.crm.exports.models.error import Error +from hubspot.crm.exports.models.error_detail import ErrorDetail +from hubspot.crm.exports.models.filter import Filter +from hubspot.crm.exports.models.public_crm_search_request import PublicCrmSearchRequest +from hubspot.crm.exports.models.public_export_list_request import PublicExportListRequest +from hubspot.crm.exports.models.public_export_list_request_all_of import PublicExportListRequestAllOf +from hubspot.crm.exports.models.public_export_request import PublicExportRequest +from hubspot.crm.exports.models.public_export_view_request import PublicExportViewRequest +from hubspot.crm.exports.models.public_export_view_request_all_of import PublicExportViewRequestAllOf +from hubspot.crm.exports.models.standard_error import StandardError +from hubspot.crm.exports.models.task_locator import TaskLocator diff --git a/hubspot/crm/exports/api/__init__.py b/hubspot/crm/exports/api/__init__.py new file mode 100644 index 00000000..aa09ef4e --- /dev/null +++ b/hubspot/crm/exports/api/__init__.py @@ -0,0 +1,6 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from hubspot.crm.exports.api.public_exports_api import PublicExportsApi diff --git a/hubspot/crm/exports/api/public_exports_api.py b/hubspot/crm/exports/api/public_exports_api.py new file mode 100644 index 00000000..181f4555 --- /dev/null +++ b/hubspot/crm/exports/api/public_exports_api.py @@ -0,0 +1,285 @@ +# coding: utf-8 + +""" + CRM Exports + + 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.exports.api_client import ApiClient +from hubspot.crm.exports.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class PublicExportsApi(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 get_status(self, task_id, **kwargs): # noqa: E501 + """Get the status of the export including the URL to download the file # noqa: E501 + + Returns the status of the export with taskId, including the URL of the resulting file if the export status is COMPLETE # 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_status(task_id, async_req=True) + >>> result = thread.get() + + :param task_id: (required) + :type task_id: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ActionResponseWithSingleResultURI + """ + kwargs["_return_http_data_only"] = True + return self.get_status_with_http_info(task_id, **kwargs) # noqa: E501 + + def get_status_with_http_info(self, task_id, **kwargs): # noqa: E501 + """Get the status of the export including the URL to download the file # noqa: E501 + + Returns the status of the export with taskId, including the URL of the resulting file if the export status is COMPLETE # 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_status_with_http_info(task_id, async_req=True) + >>> result = thread.get() + + :param task_id: (required) + :type task_id: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ActionResponseWithSingleResultURI, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["task_id"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_status" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'task_id' is set + if self.api_client.client_side_validation and local_var_params.get("task_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `task_id` when calling `get_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "task_id" in local_var_params: + path_params["taskId"] = local_var_params["task_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 200: "ActionResponseWithSingleResultURI", + } + + return self.api_client.call_api( + "/crm/v3/exports/export/async/tasks/{taskId}/status", + "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 start(self, public_export_request, **kwargs): # noqa: E501 + """Start an export # noqa: E501 + + Begins exporting CRM data for the portal as specified in the request body # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.start(public_export_request, async_req=True) + >>> result = thread.get() + + :param public_export_request: (required) + :type public_export_request: PublicExportRequest + :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: TaskLocator + """ + kwargs["_return_http_data_only"] = True + return self.start_with_http_info(public_export_request, **kwargs) # noqa: E501 + + def start_with_http_info(self, public_export_request, **kwargs): # noqa: E501 + """Start an export # noqa: E501 + + Begins exporting CRM data for the portal as specified in the request body # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.start_with_http_info(public_export_request, async_req=True) + >>> result = thread.get() + + :param public_export_request: (required) + :type public_export_request: PublicExportRequest + :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(TaskLocator, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["public_export_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 start" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'public_export_request' is set + if self.api_client.client_side_validation and local_var_params.get("public_export_request") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `public_export_request` when calling `start`") # 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_export_request" in local_var_params: + body_params = local_var_params["public_export_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 = { + 202: "TaskLocator", + } + + return self.api_client.call_api( + "/crm/v3/exports/export/async", + "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/exports/api_client.py b/hubspot/crm/exports/api_client.py new file mode 100644 index 00000000..0243ae59 --- /dev/null +++ b/hubspot/crm/exports/api_client.py @@ -0,0 +1,664 @@ +# coding: utf-8 +""" + CRM Exports + + 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.exports.configuration import Configuration +import hubspot.crm.exports.models +from hubspot.crm.exports import rest +from hubspot.crm.exports.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.exports.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/exports/configuration.py b/hubspot/crm/exports/configuration.py new file mode 100644 index 00000000..b829159b --- /dev/null +++ b/hubspot/crm/exports/configuration.py @@ -0,0 +1,439 @@ +# coding: utf-8 + +""" + CRM Exports + + 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.exports.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.exports") + 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/exports/exceptions.py b/hubspot/crm/exports/exceptions.py new file mode 100644 index 00000000..1935ae30 --- /dev/null +++ b/hubspot/crm/exports/exceptions.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + CRM Exports + + 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/exports/models/__init__.py b/hubspot/crm/exports/models/__init__.py new file mode 100644 index 00000000..1db4d295 --- /dev/null +++ b/hubspot/crm/exports/models/__init__.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +# flake8: noqa +""" + CRM Exports + + 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.exports.models.action_response_with_single_result_uri import ActionResponseWithSingleResultURI +from hubspot.crm.exports.models.error import Error +from hubspot.crm.exports.models.error_detail import ErrorDetail +from hubspot.crm.exports.models.filter import Filter +from hubspot.crm.exports.models.public_crm_search_request import PublicCrmSearchRequest +from hubspot.crm.exports.models.public_export_list_request import PublicExportListRequest +from hubspot.crm.exports.models.public_export_list_request_all_of import PublicExportListRequestAllOf +from hubspot.crm.exports.models.public_export_request import PublicExportRequest +from hubspot.crm.exports.models.public_export_view_request import PublicExportViewRequest +from hubspot.crm.exports.models.public_export_view_request_all_of import PublicExportViewRequestAllOf +from hubspot.crm.exports.models.standard_error import StandardError +from hubspot.crm.exports.models.task_locator import TaskLocator diff --git a/hubspot/crm/exports/models/action_response_with_single_result_uri.py b/hubspot/crm/exports/models/action_response_with_single_result_uri.py new file mode 100644 index 00000000..c3fa8378 --- /dev/null +++ b/hubspot/crm/exports/models/action_response_with_single_result_uri.py @@ -0,0 +1,313 @@ +# coding: utf-8 + +""" + CRM Exports + + 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.exports.configuration import Configuration + + +class ActionResponseWithSingleResultURI(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 = { + "result": "str", + "completed_at": "datetime", + "num_errors": "int", + "requested_at": "datetime", + "started_at": "datetime", + "links": "dict[str, str]", + "errors": "list[StandardError]", + "status": "str", + } + + attribute_map = { + "result": "result", + "completed_at": "completedAt", + "num_errors": "numErrors", + "requested_at": "requestedAt", + "started_at": "startedAt", + "links": "links", + "errors": "errors", + "status": "status", + } + + def __init__(self, result=None, completed_at=None, num_errors=None, requested_at=None, started_at=None, links=None, errors=None, status=None, local_vars_configuration=None): # noqa: E501 + """ActionResponseWithSingleResultURI - 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._result = None + self._completed_at = None + self._num_errors = None + self._requested_at = None + self._started_at = None + self._links = None + self._errors = None + self._status = None + self.discriminator = None + + if result is not None: + self.result = result + 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 + if errors is not None: + self.errors = errors + self.status = status + + @property + def result(self): + """Gets the result of this ActionResponseWithSingleResultURI. # noqa: E501 + + + :return: The result of this ActionResponseWithSingleResultURI. # noqa: E501 + :rtype: str + """ + return self._result + + @result.setter + def result(self, result): + """Sets the result of this ActionResponseWithSingleResultURI. + + + :param result: The result of this ActionResponseWithSingleResultURI. # noqa: E501 + :type result: str + """ + + self._result = result + + @property + def completed_at(self): + """Gets the completed_at of this ActionResponseWithSingleResultURI. # noqa: E501 + + + :return: The completed_at of this ActionResponseWithSingleResultURI. # noqa: E501 + :rtype: datetime + """ + return self._completed_at + + @completed_at.setter + def completed_at(self, completed_at): + """Sets the completed_at of this ActionResponseWithSingleResultURI. + + + :param completed_at: The completed_at of this ActionResponseWithSingleResultURI. # 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 ActionResponseWithSingleResultURI. # noqa: E501 + + + :return: The num_errors of this ActionResponseWithSingleResultURI. # noqa: E501 + :rtype: int + """ + return self._num_errors + + @num_errors.setter + def num_errors(self, num_errors): + """Sets the num_errors of this ActionResponseWithSingleResultURI. + + + :param num_errors: The num_errors of this ActionResponseWithSingleResultURI. # noqa: E501 + :type num_errors: int + """ + + self._num_errors = num_errors + + @property + def requested_at(self): + """Gets the requested_at of this ActionResponseWithSingleResultURI. # noqa: E501 + + + :return: The requested_at of this ActionResponseWithSingleResultURI. # noqa: E501 + :rtype: datetime + """ + return self._requested_at + + @requested_at.setter + def requested_at(self, requested_at): + """Sets the requested_at of this ActionResponseWithSingleResultURI. + + + :param requested_at: The requested_at of this ActionResponseWithSingleResultURI. # noqa: E501 + :type requested_at: datetime + """ + + self._requested_at = requested_at + + @property + def started_at(self): + """Gets the started_at of this ActionResponseWithSingleResultURI. # noqa: E501 + + + :return: The started_at of this ActionResponseWithSingleResultURI. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this ActionResponseWithSingleResultURI. + + + :param started_at: The started_at of this ActionResponseWithSingleResultURI. # 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 ActionResponseWithSingleResultURI. # noqa: E501 + + + :return: The links of this ActionResponseWithSingleResultURI. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this ActionResponseWithSingleResultURI. + + + :param links: The links of this ActionResponseWithSingleResultURI. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def errors(self): + """Gets the errors of this ActionResponseWithSingleResultURI. # noqa: E501 + + + :return: The errors of this ActionResponseWithSingleResultURI. # noqa: E501 + :rtype: list[StandardError] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this ActionResponseWithSingleResultURI. + + + :param errors: The errors of this ActionResponseWithSingleResultURI. # noqa: E501 + :type errors: list[StandardError] + """ + + self._errors = errors + + @property + def status(self): + """Gets the status of this ActionResponseWithSingleResultURI. # noqa: E501 + + + :return: The status of this ActionResponseWithSingleResultURI. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ActionResponseWithSingleResultURI. + + + :param status: The status of this ActionResponseWithSingleResultURI. # 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, ActionResponseWithSingleResultURI): + 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, ActionResponseWithSingleResultURI): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/exports/models/error.py b/hubspot/crm/exports/models/error.py new file mode 100644 index 00000000..3b1cf5b4 --- /dev/null +++ b/hubspot/crm/exports/models/error.py @@ -0,0 +1,282 @@ +# coding: utf-8 + +""" + CRM Exports + + 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.exports.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/exports/models/error_detail.py b/hubspot/crm/exports/models/error_detail.py new file mode 100644 index 00000000..91e29c05 --- /dev/null +++ b/hubspot/crm/exports/models/error_detail.py @@ -0,0 +1,228 @@ +# coding: utf-8 + +""" + CRM Exports + + 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.exports.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/exports/models/filter.py b/hubspot/crm/exports/models/filter.py new file mode 100644 index 00000000..95a81fb9 --- /dev/null +++ b/hubspot/crm/exports/models/filter.py @@ -0,0 +1,222 @@ +# coding: utf-8 + +""" + CRM Exports + + 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.exports.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 + + + :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. + + + :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"] # 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/exports/models/public_crm_search_request.py b/hubspot/crm/exports/models/public_crm_search_request.py new file mode 100644 index 00000000..44bca71e --- /dev/null +++ b/hubspot/crm/exports/models/public_crm_search_request.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + CRM Exports + + 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.exports.configuration import Configuration + + +class PublicCrmSearchRequest(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", "filters": "list[Filter]", "sorts": "list[str]"} + + attribute_map = {"query": "query", "filters": "filters", "sorts": "sorts"} + + def __init__(self, query=None, filters=None, sorts=None, local_vars_configuration=None): # noqa: E501 + """PublicCrmSearchRequest - 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._filters = None + self._sorts = None + self.discriminator = None + + self.query = query + self.filters = filters + self.sorts = sorts + + @property + def query(self): + """Gets the query of this PublicCrmSearchRequest. # noqa: E501 + + + :return: The query of this PublicCrmSearchRequest. # noqa: E501 + :rtype: str + """ + return self._query + + @query.setter + def query(self, query): + """Sets the query of this PublicCrmSearchRequest. + + + :param query: The query of this PublicCrmSearchRequest. # noqa: E501 + :type query: str + """ + if self.local_vars_configuration.client_side_validation and query is None: # noqa: E501 + raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 + + self._query = query + + @property + def filters(self): + """Gets the filters of this PublicCrmSearchRequest. # noqa: E501 + + + :return: The filters of this PublicCrmSearchRequest. # noqa: E501 + :rtype: list[Filter] + """ + return self._filters + + @filters.setter + def filters(self, filters): + """Sets the filters of this PublicCrmSearchRequest. + + + :param filters: The filters of this PublicCrmSearchRequest. # 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 + + @property + def sorts(self): + """Gets the sorts of this PublicCrmSearchRequest. # noqa: E501 + + + :return: The sorts of this PublicCrmSearchRequest. # noqa: E501 + :rtype: list[str] + """ + return self._sorts + + @sorts.setter + def sorts(self, sorts): + """Sets the sorts of this PublicCrmSearchRequest. + + + :param sorts: The sorts of this PublicCrmSearchRequest. # noqa: E501 + :type sorts: list[str] + """ + if self.local_vars_configuration.client_side_validation and sorts is None: # noqa: E501 + raise ValueError("Invalid value for `sorts`, must not be `None`") # noqa: E501 + + self._sorts = sorts + + 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, PublicCrmSearchRequest): + 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, PublicCrmSearchRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/exports/models/public_export_list_request.py b/hubspot/crm/exports/models/public_export_list_request.py new file mode 100644 index 00000000..782dd115 --- /dev/null +++ b/hubspot/crm/exports/models/public_export_list_request.py @@ -0,0 +1,397 @@ +# coding: utf-8 + +""" + CRM Exports + + 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.exports.configuration import Configuration + + +class PublicExportListRequest(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 = { + "export_type": "str", + "format": "str", + "export_name": "str", + "object_properties": "list[str]", + "associated_object_type": "str", + "object_type": "str", + "language": "str", + "export_internal_values_options": "list[str]", + "override_associated_objects_per_definition_per_row_limit": "bool", + "list_id": "str", + } + + attribute_map = { + "export_type": "exportType", + "format": "format", + "export_name": "exportName", + "object_properties": "objectProperties", + "associated_object_type": "associatedObjectType", + "object_type": "objectType", + "language": "language", + "export_internal_values_options": "exportInternalValuesOptions", + "override_associated_objects_per_definition_per_row_limit": "overrideAssociatedObjectsPerDefinitionPerRowLimit", + "list_id": "listId", + } + + def __init__( + self, + export_type="LIST", + format=None, + export_name=None, + object_properties=None, + associated_object_type=None, + object_type=None, + language=None, + export_internal_values_options=None, + override_associated_objects_per_definition_per_row_limit=None, + list_id=None, + local_vars_configuration=None, + ): # noqa: E501 + """PublicExportListRequest - 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._export_type = None + self._format = None + self._export_name = None + self._object_properties = None + self._associated_object_type = None + self._object_type = None + self._language = None + self._export_internal_values_options = None + self._override_associated_objects_per_definition_per_row_limit = None + self._list_id = None + self.discriminator = None + + self.export_type = export_type + self.format = format + self.export_name = export_name + self.object_properties = object_properties + if associated_object_type is not None: + self.associated_object_type = associated_object_type + self.object_type = object_type + self.language = language + self.export_internal_values_options = export_internal_values_options + self.override_associated_objects_per_definition_per_row_limit = override_associated_objects_per_definition_per_row_limit + self.list_id = list_id + + @property + def export_type(self): + """Gets the export_type of this PublicExportListRequest. # noqa: E501 + + + :return: The export_type of this PublicExportListRequest. # noqa: E501 + :rtype: str + """ + return self._export_type + + @export_type.setter + def export_type(self, export_type): + """Sets the export_type of this PublicExportListRequest. + + + :param export_type: The export_type of this PublicExportListRequest. # noqa: E501 + :type export_type: str + """ + if self.local_vars_configuration.client_side_validation and export_type is None: # noqa: E501 + raise ValueError("Invalid value for `export_type`, must not be `None`") # noqa: E501 + allowed_values = ["LIST"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and export_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `export_type` ({0}), must be one of {1}".format(export_type, allowed_values)) # noqa: E501 + + self._export_type = export_type + + @property + def format(self): + """Gets the format of this PublicExportListRequest. # noqa: E501 + + + :return: The format of this PublicExportListRequest. # noqa: E501 + :rtype: str + """ + return self._format + + @format.setter + def format(self, format): + """Sets the format of this PublicExportListRequest. + + + :param format: The format of this PublicExportListRequest. # noqa: E501 + :type format: str + """ + if self.local_vars_configuration.client_side_validation and format is None: # noqa: E501 + raise ValueError("Invalid value for `format`, must not be `None`") # noqa: E501 + allowed_values = ["XLS", "XLSX", "CSV"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and format not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `format` ({0}), must be one of {1}".format(format, allowed_values)) # noqa: E501 + + self._format = format + + @property + def export_name(self): + """Gets the export_name of this PublicExportListRequest. # noqa: E501 + + + :return: The export_name of this PublicExportListRequest. # noqa: E501 + :rtype: str + """ + return self._export_name + + @export_name.setter + def export_name(self, export_name): + """Sets the export_name of this PublicExportListRequest. + + + :param export_name: The export_name of this PublicExportListRequest. # noqa: E501 + :type export_name: str + """ + if self.local_vars_configuration.client_side_validation and export_name is None: # noqa: E501 + raise ValueError("Invalid value for `export_name`, must not be `None`") # noqa: E501 + + self._export_name = export_name + + @property + def object_properties(self): + """Gets the object_properties of this PublicExportListRequest. # noqa: E501 + + + :return: The object_properties of this PublicExportListRequest. # noqa: E501 + :rtype: list[str] + """ + return self._object_properties + + @object_properties.setter + def object_properties(self, object_properties): + """Sets the object_properties of this PublicExportListRequest. + + + :param object_properties: The object_properties of this PublicExportListRequest. # noqa: E501 + :type object_properties: list[str] + """ + if self.local_vars_configuration.client_side_validation and object_properties is None: # noqa: E501 + raise ValueError("Invalid value for `object_properties`, must not be `None`") # noqa: E501 + + self._object_properties = object_properties + + @property + def associated_object_type(self): + """Gets the associated_object_type of this PublicExportListRequest. # noqa: E501 + + + :return: The associated_object_type of this PublicExportListRequest. # noqa: E501 + :rtype: str + """ + return self._associated_object_type + + @associated_object_type.setter + def associated_object_type(self, associated_object_type): + """Sets the associated_object_type of this PublicExportListRequest. + + + :param associated_object_type: The associated_object_type of this PublicExportListRequest. # noqa: E501 + :type associated_object_type: str + """ + + self._associated_object_type = associated_object_type + + @property + def object_type(self): + """Gets the object_type of this PublicExportListRequest. # noqa: E501 + + + :return: The object_type of this PublicExportListRequest. # noqa: E501 + :rtype: str + """ + return self._object_type + + @object_type.setter + def object_type(self, object_type): + """Sets the object_type of this PublicExportListRequest. + + + :param object_type: The object_type of this PublicExportListRequest. # noqa: E501 + :type object_type: str + """ + if self.local_vars_configuration.client_side_validation and object_type is None: # noqa: E501 + raise ValueError("Invalid value for `object_type`, must not be `None`") # noqa: E501 + + self._object_type = object_type + + @property + def language(self): + """Gets the language of this PublicExportListRequest. # noqa: E501 + + + :return: The language of this PublicExportListRequest. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this PublicExportListRequest. + + + :param language: The language of this PublicExportListRequest. # noqa: E501 + :type language: str + """ + if self.local_vars_configuration.client_side_validation and language is None: # noqa: E501 + raise ValueError("Invalid value for `language`, must not be `None`") # noqa: E501 + allowed_values = ["EN", "DE", "ES", "FR", "JA", "NL", "PT_BR", "IT", "PL", "SV", "FI", "ZH_TW", "DA_DK", "NO"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and language not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `language` ({0}), must be one of {1}".format(language, allowed_values)) # noqa: E501 + + self._language = language + + @property + def export_internal_values_options(self): + """Gets the export_internal_values_options of this PublicExportListRequest. # noqa: E501 + + + :return: The export_internal_values_options of this PublicExportListRequest. # noqa: E501 + :rtype: list[str] + """ + return self._export_internal_values_options + + @export_internal_values_options.setter + def export_internal_values_options(self, export_internal_values_options): + """Sets the export_internal_values_options of this PublicExportListRequest. + + + :param export_internal_values_options: The export_internal_values_options of this PublicExportListRequest. # noqa: E501 + :type export_internal_values_options: list[str] + """ + if self.local_vars_configuration.client_side_validation and export_internal_values_options is None: # noqa: E501 + raise ValueError("Invalid value for `export_internal_values_options`, must not be `None`") # noqa: E501 + allowed_values = ["NAMES", "VALUES"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and not set(export_internal_values_options).issubset(set(allowed_values)): # noqa: E501 + raise ValueError( + "Invalid values for `export_internal_values_options` [{0}], must be a subset of [{1}]".format( # noqa: E501 + ", ".join(map(str, set(export_internal_values_options) - set(allowed_values))), ", ".join(map(str, allowed_values)) # noqa: E501 + ) + ) + + self._export_internal_values_options = export_internal_values_options + + @property + def override_associated_objects_per_definition_per_row_limit(self): + """Gets the override_associated_objects_per_definition_per_row_limit of this PublicExportListRequest. # noqa: E501 + + + :return: The override_associated_objects_per_definition_per_row_limit of this PublicExportListRequest. # noqa: E501 + :rtype: bool + """ + return self._override_associated_objects_per_definition_per_row_limit + + @override_associated_objects_per_definition_per_row_limit.setter + def override_associated_objects_per_definition_per_row_limit(self, override_associated_objects_per_definition_per_row_limit): + """Sets the override_associated_objects_per_definition_per_row_limit of this PublicExportListRequest. + + + :param override_associated_objects_per_definition_per_row_limit: The override_associated_objects_per_definition_per_row_limit of this PublicExportListRequest. # noqa: E501 + :type override_associated_objects_per_definition_per_row_limit: bool + """ + if self.local_vars_configuration.client_side_validation and override_associated_objects_per_definition_per_row_limit is None: # noqa: E501 + raise ValueError("Invalid value for `override_associated_objects_per_definition_per_row_limit`, must not be `None`") # noqa: E501 + + self._override_associated_objects_per_definition_per_row_limit = override_associated_objects_per_definition_per_row_limit + + @property + def list_id(self): + """Gets the list_id of this PublicExportListRequest. # noqa: E501 + + + :return: The list_id of this PublicExportListRequest. # noqa: E501 + :rtype: str + """ + return self._list_id + + @list_id.setter + def list_id(self, list_id): + """Sets the list_id of this PublicExportListRequest. + + + :param list_id: The list_id of this PublicExportListRequest. # noqa: E501 + :type list_id: str + """ + if self.local_vars_configuration.client_side_validation and list_id is None: # noqa: E501 + raise ValueError("Invalid value for `list_id`, must not be `None`") # noqa: E501 + + self._list_id = list_id + + 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, PublicExportListRequest): + 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, PublicExportListRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/exports/models/public_export_list_request_all_of.py b/hubspot/crm/exports/models/public_export_list_request_all_of.py new file mode 100644 index 00000000..1fb17eba --- /dev/null +++ b/hubspot/crm/exports/models/public_export_list_request_all_of.py @@ -0,0 +1,397 @@ +# coding: utf-8 + +""" + CRM Exports + + 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.exports.configuration import Configuration + + +class PublicExportListRequestAllOf(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 = { + "export_type": "str", + "format": "str", + "export_name": "str", + "object_properties": "list[str]", + "associated_object_type": "str", + "object_type": "str", + "language": "str", + "export_internal_values_options": "list[str]", + "override_associated_objects_per_definition_per_row_limit": "bool", + "list_id": "str", + } + + attribute_map = { + "export_type": "exportType", + "format": "format", + "export_name": "exportName", + "object_properties": "objectProperties", + "associated_object_type": "associatedObjectType", + "object_type": "objectType", + "language": "language", + "export_internal_values_options": "exportInternalValuesOptions", + "override_associated_objects_per_definition_per_row_limit": "overrideAssociatedObjectsPerDefinitionPerRowLimit", + "list_id": "listId", + } + + def __init__( + self, + export_type="LIST", + format=None, + export_name=None, + object_properties=None, + associated_object_type=None, + object_type=None, + language=None, + export_internal_values_options=None, + override_associated_objects_per_definition_per_row_limit=None, + list_id=None, + local_vars_configuration=None, + ): # noqa: E501 + """PublicExportListRequestAllOf - 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._export_type = None + self._format = None + self._export_name = None + self._object_properties = None + self._associated_object_type = None + self._object_type = None + self._language = None + self._export_internal_values_options = None + self._override_associated_objects_per_definition_per_row_limit = None + self._list_id = None + self.discriminator = None + + self.export_type = export_type + self.format = format + self.export_name = export_name + self.object_properties = object_properties + if associated_object_type is not None: + self.associated_object_type = associated_object_type + self.object_type = object_type + self.language = language + self.export_internal_values_options = export_internal_values_options + self.override_associated_objects_per_definition_per_row_limit = override_associated_objects_per_definition_per_row_limit + self.list_id = list_id + + @property + def export_type(self): + """Gets the export_type of this PublicExportListRequestAllOf. # noqa: E501 + + + :return: The export_type of this PublicExportListRequestAllOf. # noqa: E501 + :rtype: str + """ + return self._export_type + + @export_type.setter + def export_type(self, export_type): + """Sets the export_type of this PublicExportListRequestAllOf. + + + :param export_type: The export_type of this PublicExportListRequestAllOf. # noqa: E501 + :type export_type: str + """ + if self.local_vars_configuration.client_side_validation and export_type is None: # noqa: E501 + raise ValueError("Invalid value for `export_type`, must not be `None`") # noqa: E501 + allowed_values = ["LIST"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and export_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `export_type` ({0}), must be one of {1}".format(export_type, allowed_values)) # noqa: E501 + + self._export_type = export_type + + @property + def format(self): + """Gets the format of this PublicExportListRequestAllOf. # noqa: E501 + + + :return: The format of this PublicExportListRequestAllOf. # noqa: E501 + :rtype: str + """ + return self._format + + @format.setter + def format(self, format): + """Sets the format of this PublicExportListRequestAllOf. + + + :param format: The format of this PublicExportListRequestAllOf. # noqa: E501 + :type format: str + """ + if self.local_vars_configuration.client_side_validation and format is None: # noqa: E501 + raise ValueError("Invalid value for `format`, must not be `None`") # noqa: E501 + allowed_values = ["XLS", "XLSX", "CSV"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and format not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `format` ({0}), must be one of {1}".format(format, allowed_values)) # noqa: E501 + + self._format = format + + @property + def export_name(self): + """Gets the export_name of this PublicExportListRequestAllOf. # noqa: E501 + + + :return: The export_name of this PublicExportListRequestAllOf. # noqa: E501 + :rtype: str + """ + return self._export_name + + @export_name.setter + def export_name(self, export_name): + """Sets the export_name of this PublicExportListRequestAllOf. + + + :param export_name: The export_name of this PublicExportListRequestAllOf. # noqa: E501 + :type export_name: str + """ + if self.local_vars_configuration.client_side_validation and export_name is None: # noqa: E501 + raise ValueError("Invalid value for `export_name`, must not be `None`") # noqa: E501 + + self._export_name = export_name + + @property + def object_properties(self): + """Gets the object_properties of this PublicExportListRequestAllOf. # noqa: E501 + + + :return: The object_properties of this PublicExportListRequestAllOf. # noqa: E501 + :rtype: list[str] + """ + return self._object_properties + + @object_properties.setter + def object_properties(self, object_properties): + """Sets the object_properties of this PublicExportListRequestAllOf. + + + :param object_properties: The object_properties of this PublicExportListRequestAllOf. # noqa: E501 + :type object_properties: list[str] + """ + if self.local_vars_configuration.client_side_validation and object_properties is None: # noqa: E501 + raise ValueError("Invalid value for `object_properties`, must not be `None`") # noqa: E501 + + self._object_properties = object_properties + + @property + def associated_object_type(self): + """Gets the associated_object_type of this PublicExportListRequestAllOf. # noqa: E501 + + + :return: The associated_object_type of this PublicExportListRequestAllOf. # noqa: E501 + :rtype: str + """ + return self._associated_object_type + + @associated_object_type.setter + def associated_object_type(self, associated_object_type): + """Sets the associated_object_type of this PublicExportListRequestAllOf. + + + :param associated_object_type: The associated_object_type of this PublicExportListRequestAllOf. # noqa: E501 + :type associated_object_type: str + """ + + self._associated_object_type = associated_object_type + + @property + def object_type(self): + """Gets the object_type of this PublicExportListRequestAllOf. # noqa: E501 + + + :return: The object_type of this PublicExportListRequestAllOf. # noqa: E501 + :rtype: str + """ + return self._object_type + + @object_type.setter + def object_type(self, object_type): + """Sets the object_type of this PublicExportListRequestAllOf. + + + :param object_type: The object_type of this PublicExportListRequestAllOf. # noqa: E501 + :type object_type: str + """ + if self.local_vars_configuration.client_side_validation and object_type is None: # noqa: E501 + raise ValueError("Invalid value for `object_type`, must not be `None`") # noqa: E501 + + self._object_type = object_type + + @property + def language(self): + """Gets the language of this PublicExportListRequestAllOf. # noqa: E501 + + + :return: The language of this PublicExportListRequestAllOf. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this PublicExportListRequestAllOf. + + + :param language: The language of this PublicExportListRequestAllOf. # noqa: E501 + :type language: str + """ + if self.local_vars_configuration.client_side_validation and language is None: # noqa: E501 + raise ValueError("Invalid value for `language`, must not be `None`") # noqa: E501 + allowed_values = ["EN", "DE", "ES", "FR", "JA", "NL", "PT_BR", "IT", "PL", "SV", "FI", "ZH_TW", "DA_DK", "NO"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and language not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `language` ({0}), must be one of {1}".format(language, allowed_values)) # noqa: E501 + + self._language = language + + @property + def export_internal_values_options(self): + """Gets the export_internal_values_options of this PublicExportListRequestAllOf. # noqa: E501 + + + :return: The export_internal_values_options of this PublicExportListRequestAllOf. # noqa: E501 + :rtype: list[str] + """ + return self._export_internal_values_options + + @export_internal_values_options.setter + def export_internal_values_options(self, export_internal_values_options): + """Sets the export_internal_values_options of this PublicExportListRequestAllOf. + + + :param export_internal_values_options: The export_internal_values_options of this PublicExportListRequestAllOf. # noqa: E501 + :type export_internal_values_options: list[str] + """ + if self.local_vars_configuration.client_side_validation and export_internal_values_options is None: # noqa: E501 + raise ValueError("Invalid value for `export_internal_values_options`, must not be `None`") # noqa: E501 + allowed_values = ["NAMES", "VALUES"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and not set(export_internal_values_options).issubset(set(allowed_values)): # noqa: E501 + raise ValueError( + "Invalid values for `export_internal_values_options` [{0}], must be a subset of [{1}]".format( # noqa: E501 + ", ".join(map(str, set(export_internal_values_options) - set(allowed_values))), ", ".join(map(str, allowed_values)) # noqa: E501 + ) + ) + + self._export_internal_values_options = export_internal_values_options + + @property + def override_associated_objects_per_definition_per_row_limit(self): + """Gets the override_associated_objects_per_definition_per_row_limit of this PublicExportListRequestAllOf. # noqa: E501 + + + :return: The override_associated_objects_per_definition_per_row_limit of this PublicExportListRequestAllOf. # noqa: E501 + :rtype: bool + """ + return self._override_associated_objects_per_definition_per_row_limit + + @override_associated_objects_per_definition_per_row_limit.setter + def override_associated_objects_per_definition_per_row_limit(self, override_associated_objects_per_definition_per_row_limit): + """Sets the override_associated_objects_per_definition_per_row_limit of this PublicExportListRequestAllOf. + + + :param override_associated_objects_per_definition_per_row_limit: The override_associated_objects_per_definition_per_row_limit of this PublicExportListRequestAllOf. # noqa: E501 + :type override_associated_objects_per_definition_per_row_limit: bool + """ + if self.local_vars_configuration.client_side_validation and override_associated_objects_per_definition_per_row_limit is None: # noqa: E501 + raise ValueError("Invalid value for `override_associated_objects_per_definition_per_row_limit`, must not be `None`") # noqa: E501 + + self._override_associated_objects_per_definition_per_row_limit = override_associated_objects_per_definition_per_row_limit + + @property + def list_id(self): + """Gets the list_id of this PublicExportListRequestAllOf. # noqa: E501 + + + :return: The list_id of this PublicExportListRequestAllOf. # noqa: E501 + :rtype: str + """ + return self._list_id + + @list_id.setter + def list_id(self, list_id): + """Sets the list_id of this PublicExportListRequestAllOf. + + + :param list_id: The list_id of this PublicExportListRequestAllOf. # noqa: E501 + :type list_id: str + """ + if self.local_vars_configuration.client_side_validation and list_id is None: # noqa: E501 + raise ValueError("Invalid value for `list_id`, must not be `None`") # noqa: E501 + + self._list_id = list_id + + 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, PublicExportListRequestAllOf): + 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, PublicExportListRequestAllOf): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/exports/models/public_export_request.py b/hubspot/crm/exports/models/public_export_request.py new file mode 100644 index 00000000..925ad531 --- /dev/null +++ b/hubspot/crm/exports/models/public_export_request.py @@ -0,0 +1,424 @@ +# coding: utf-8 + +""" + CRM Exports + + 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.exports.configuration import Configuration + + +class PublicExportRequest(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 = { + "export_type": "str", + "format": "str", + "export_name": "str", + "object_properties": "list[str]", + "associated_object_type": "str", + "object_type": "str", + "language": "str", + "export_internal_values_options": "list[str]", + "override_associated_objects_per_definition_per_row_limit": "bool", + "public_crm_search_request": "PublicCrmSearchRequest", + "list_id": "str", + } + + attribute_map = { + "export_type": "exportType", + "format": "format", + "export_name": "exportName", + "object_properties": "objectProperties", + "associated_object_type": "associatedObjectType", + "object_type": "objectType", + "language": "language", + "export_internal_values_options": "exportInternalValuesOptions", + "override_associated_objects_per_definition_per_row_limit": "overrideAssociatedObjectsPerDefinitionPerRowLimit", + "public_crm_search_request": "publicCrmSearchRequest", + "list_id": "listId", + } + + def __init__( + self, + export_type="LIST", + format=None, + export_name=None, + object_properties=None, + associated_object_type=None, + object_type=None, + language=None, + export_internal_values_options=None, + override_associated_objects_per_definition_per_row_limit=None, + public_crm_search_request=None, + list_id=None, + local_vars_configuration=None, + ): # noqa: E501 + """PublicExportRequest - 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._export_type = None + self._format = None + self._export_name = None + self._object_properties = None + self._associated_object_type = None + self._object_type = None + self._language = None + self._export_internal_values_options = None + self._override_associated_objects_per_definition_per_row_limit = None + self._public_crm_search_request = None + self._list_id = None + self.discriminator = None + + self.export_type = export_type + self.format = format + self.export_name = export_name + self.object_properties = object_properties + if associated_object_type is not None: + self.associated_object_type = associated_object_type + self.object_type = object_type + self.language = language + self.export_internal_values_options = export_internal_values_options + self.override_associated_objects_per_definition_per_row_limit = override_associated_objects_per_definition_per_row_limit + if public_crm_search_request is not None: + self.public_crm_search_request = public_crm_search_request + self.list_id = list_id + + @property + def export_type(self): + """Gets the export_type of this PublicExportRequest. # noqa: E501 + + + :return: The export_type of this PublicExportRequest. # noqa: E501 + :rtype: str + """ + return self._export_type + + @export_type.setter + def export_type(self, export_type): + """Sets the export_type of this PublicExportRequest. + + + :param export_type: The export_type of this PublicExportRequest. # noqa: E501 + :type export_type: str + """ + if self.local_vars_configuration.client_side_validation and export_type is None: # noqa: E501 + raise ValueError("Invalid value for `export_type`, must not be `None`") # noqa: E501 + allowed_values = ["LIST"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and export_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `export_type` ({0}), must be one of {1}".format(export_type, allowed_values)) # noqa: E501 + + self._export_type = export_type + + @property + def format(self): + """Gets the format of this PublicExportRequest. # noqa: E501 + + + :return: The format of this PublicExportRequest. # noqa: E501 + :rtype: str + """ + return self._format + + @format.setter + def format(self, format): + """Sets the format of this PublicExportRequest. + + + :param format: The format of this PublicExportRequest. # noqa: E501 + :type format: str + """ + if self.local_vars_configuration.client_side_validation and format is None: # noqa: E501 + raise ValueError("Invalid value for `format`, must not be `None`") # noqa: E501 + allowed_values = ["XLS", "XLSX", "CSV"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and format not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `format` ({0}), must be one of {1}".format(format, allowed_values)) # noqa: E501 + + self._format = format + + @property + def export_name(self): + """Gets the export_name of this PublicExportRequest. # noqa: E501 + + + :return: The export_name of this PublicExportRequest. # noqa: E501 + :rtype: str + """ + return self._export_name + + @export_name.setter + def export_name(self, export_name): + """Sets the export_name of this PublicExportRequest. + + + :param export_name: The export_name of this PublicExportRequest. # noqa: E501 + :type export_name: str + """ + if self.local_vars_configuration.client_side_validation and export_name is None: # noqa: E501 + raise ValueError("Invalid value for `export_name`, must not be `None`") # noqa: E501 + + self._export_name = export_name + + @property + def object_properties(self): + """Gets the object_properties of this PublicExportRequest. # noqa: E501 + + + :return: The object_properties of this PublicExportRequest. # noqa: E501 + :rtype: list[str] + """ + return self._object_properties + + @object_properties.setter + def object_properties(self, object_properties): + """Sets the object_properties of this PublicExportRequest. + + + :param object_properties: The object_properties of this PublicExportRequest. # noqa: E501 + :type object_properties: list[str] + """ + if self.local_vars_configuration.client_side_validation and object_properties is None: # noqa: E501 + raise ValueError("Invalid value for `object_properties`, must not be `None`") # noqa: E501 + + self._object_properties = object_properties + + @property + def associated_object_type(self): + """Gets the associated_object_type of this PublicExportRequest. # noqa: E501 + + + :return: The associated_object_type of this PublicExportRequest. # noqa: E501 + :rtype: str + """ + return self._associated_object_type + + @associated_object_type.setter + def associated_object_type(self, associated_object_type): + """Sets the associated_object_type of this PublicExportRequest. + + + :param associated_object_type: The associated_object_type of this PublicExportRequest. # noqa: E501 + :type associated_object_type: str + """ + + self._associated_object_type = associated_object_type + + @property + def object_type(self): + """Gets the object_type of this PublicExportRequest. # noqa: E501 + + + :return: The object_type of this PublicExportRequest. # noqa: E501 + :rtype: str + """ + return self._object_type + + @object_type.setter + def object_type(self, object_type): + """Sets the object_type of this PublicExportRequest. + + + :param object_type: The object_type of this PublicExportRequest. # noqa: E501 + :type object_type: str + """ + if self.local_vars_configuration.client_side_validation and object_type is None: # noqa: E501 + raise ValueError("Invalid value for `object_type`, must not be `None`") # noqa: E501 + + self._object_type = object_type + + @property + def language(self): + """Gets the language of this PublicExportRequest. # noqa: E501 + + + :return: The language of this PublicExportRequest. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this PublicExportRequest. + + + :param language: The language of this PublicExportRequest. # noqa: E501 + :type language: str + """ + if self.local_vars_configuration.client_side_validation and language is None: # noqa: E501 + raise ValueError("Invalid value for `language`, must not be `None`") # noqa: E501 + allowed_values = ["EN", "DE", "ES", "FR", "JA", "NL", "PT_BR", "IT", "PL", "SV", "FI", "ZH_TW", "DA_DK", "NO"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and language not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `language` ({0}), must be one of {1}".format(language, allowed_values)) # noqa: E501 + + self._language = language + + @property + def export_internal_values_options(self): + """Gets the export_internal_values_options of this PublicExportRequest. # noqa: E501 + + + :return: The export_internal_values_options of this PublicExportRequest. # noqa: E501 + :rtype: list[str] + """ + return self._export_internal_values_options + + @export_internal_values_options.setter + def export_internal_values_options(self, export_internal_values_options): + """Sets the export_internal_values_options of this PublicExportRequest. + + + :param export_internal_values_options: The export_internal_values_options of this PublicExportRequest. # noqa: E501 + :type export_internal_values_options: list[str] + """ + if self.local_vars_configuration.client_side_validation and export_internal_values_options is None: # noqa: E501 + raise ValueError("Invalid value for `export_internal_values_options`, must not be `None`") # noqa: E501 + allowed_values = ["NAMES", "VALUES"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and not set(export_internal_values_options).issubset(set(allowed_values)): # noqa: E501 + raise ValueError( + "Invalid values for `export_internal_values_options` [{0}], must be a subset of [{1}]".format( # noqa: E501 + ", ".join(map(str, set(export_internal_values_options) - set(allowed_values))), ", ".join(map(str, allowed_values)) # noqa: E501 + ) + ) + + self._export_internal_values_options = export_internal_values_options + + @property + def override_associated_objects_per_definition_per_row_limit(self): + """Gets the override_associated_objects_per_definition_per_row_limit of this PublicExportRequest. # noqa: E501 + + + :return: The override_associated_objects_per_definition_per_row_limit of this PublicExportRequest. # noqa: E501 + :rtype: bool + """ + return self._override_associated_objects_per_definition_per_row_limit + + @override_associated_objects_per_definition_per_row_limit.setter + def override_associated_objects_per_definition_per_row_limit(self, override_associated_objects_per_definition_per_row_limit): + """Sets the override_associated_objects_per_definition_per_row_limit of this PublicExportRequest. + + + :param override_associated_objects_per_definition_per_row_limit: The override_associated_objects_per_definition_per_row_limit of this PublicExportRequest. # noqa: E501 + :type override_associated_objects_per_definition_per_row_limit: bool + """ + if self.local_vars_configuration.client_side_validation and override_associated_objects_per_definition_per_row_limit is None: # noqa: E501 + raise ValueError("Invalid value for `override_associated_objects_per_definition_per_row_limit`, must not be `None`") # noqa: E501 + + self._override_associated_objects_per_definition_per_row_limit = override_associated_objects_per_definition_per_row_limit + + @property + def public_crm_search_request(self): + """Gets the public_crm_search_request of this PublicExportRequest. # noqa: E501 + + + :return: The public_crm_search_request of this PublicExportRequest. # noqa: E501 + :rtype: PublicCrmSearchRequest + """ + return self._public_crm_search_request + + @public_crm_search_request.setter + def public_crm_search_request(self, public_crm_search_request): + """Sets the public_crm_search_request of this PublicExportRequest. + + + :param public_crm_search_request: The public_crm_search_request of this PublicExportRequest. # noqa: E501 + :type public_crm_search_request: PublicCrmSearchRequest + """ + + self._public_crm_search_request = public_crm_search_request + + @property + def list_id(self): + """Gets the list_id of this PublicExportRequest. # noqa: E501 + + + :return: The list_id of this PublicExportRequest. # noqa: E501 + :rtype: str + """ + return self._list_id + + @list_id.setter + def list_id(self, list_id): + """Sets the list_id of this PublicExportRequest. + + + :param list_id: The list_id of this PublicExportRequest. # noqa: E501 + :type list_id: str + """ + if self.local_vars_configuration.client_side_validation and list_id is None: # noqa: E501 + raise ValueError("Invalid value for `list_id`, must not be `None`") # noqa: E501 + + self._list_id = list_id + + 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, PublicExportRequest): + 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, PublicExportRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/exports/models/public_export_view_request.py b/hubspot/crm/exports/models/public_export_view_request.py new file mode 100644 index 00000000..12d192cd --- /dev/null +++ b/hubspot/crm/exports/models/public_export_view_request.py @@ -0,0 +1,396 @@ +# coding: utf-8 + +""" + CRM Exports + + 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.exports.configuration import Configuration + + +class PublicExportViewRequest(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 = { + "export_type": "str", + "format": "str", + "export_name": "str", + "object_properties": "list[str]", + "associated_object_type": "str", + "object_type": "str", + "language": "str", + "export_internal_values_options": "list[str]", + "override_associated_objects_per_definition_per_row_limit": "bool", + "public_crm_search_request": "PublicCrmSearchRequest", + } + + attribute_map = { + "export_type": "exportType", + "format": "format", + "export_name": "exportName", + "object_properties": "objectProperties", + "associated_object_type": "associatedObjectType", + "object_type": "objectType", + "language": "language", + "export_internal_values_options": "exportInternalValuesOptions", + "override_associated_objects_per_definition_per_row_limit": "overrideAssociatedObjectsPerDefinitionPerRowLimit", + "public_crm_search_request": "publicCrmSearchRequest", + } + + def __init__( + self, + export_type="VIEW", + format=None, + export_name=None, + object_properties=None, + associated_object_type=None, + object_type=None, + language=None, + export_internal_values_options=None, + override_associated_objects_per_definition_per_row_limit=None, + public_crm_search_request=None, + local_vars_configuration=None, + ): # noqa: E501 + """PublicExportViewRequest - 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._export_type = None + self._format = None + self._export_name = None + self._object_properties = None + self._associated_object_type = None + self._object_type = None + self._language = None + self._export_internal_values_options = None + self._override_associated_objects_per_definition_per_row_limit = None + self._public_crm_search_request = None + self.discriminator = None + + self.export_type = export_type + self.format = format + self.export_name = export_name + self.object_properties = object_properties + if associated_object_type is not None: + self.associated_object_type = associated_object_type + self.object_type = object_type + self.language = language + self.export_internal_values_options = export_internal_values_options + self.override_associated_objects_per_definition_per_row_limit = override_associated_objects_per_definition_per_row_limit + if public_crm_search_request is not None: + self.public_crm_search_request = public_crm_search_request + + @property + def export_type(self): + """Gets the export_type of this PublicExportViewRequest. # noqa: E501 + + + :return: The export_type of this PublicExportViewRequest. # noqa: E501 + :rtype: str + """ + return self._export_type + + @export_type.setter + def export_type(self, export_type): + """Sets the export_type of this PublicExportViewRequest. + + + :param export_type: The export_type of this PublicExportViewRequest. # noqa: E501 + :type export_type: str + """ + if self.local_vars_configuration.client_side_validation and export_type is None: # noqa: E501 + raise ValueError("Invalid value for `export_type`, must not be `None`") # noqa: E501 + allowed_values = ["VIEW"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and export_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `export_type` ({0}), must be one of {1}".format(export_type, allowed_values)) # noqa: E501 + + self._export_type = export_type + + @property + def format(self): + """Gets the format of this PublicExportViewRequest. # noqa: E501 + + + :return: The format of this PublicExportViewRequest. # noqa: E501 + :rtype: str + """ + return self._format + + @format.setter + def format(self, format): + """Sets the format of this PublicExportViewRequest. + + + :param format: The format of this PublicExportViewRequest. # noqa: E501 + :type format: str + """ + if self.local_vars_configuration.client_side_validation and format is None: # noqa: E501 + raise ValueError("Invalid value for `format`, must not be `None`") # noqa: E501 + allowed_values = ["XLS", "XLSX", "CSV"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and format not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `format` ({0}), must be one of {1}".format(format, allowed_values)) # noqa: E501 + + self._format = format + + @property + def export_name(self): + """Gets the export_name of this PublicExportViewRequest. # noqa: E501 + + + :return: The export_name of this PublicExportViewRequest. # noqa: E501 + :rtype: str + """ + return self._export_name + + @export_name.setter + def export_name(self, export_name): + """Sets the export_name of this PublicExportViewRequest. + + + :param export_name: The export_name of this PublicExportViewRequest. # noqa: E501 + :type export_name: str + """ + if self.local_vars_configuration.client_side_validation and export_name is None: # noqa: E501 + raise ValueError("Invalid value for `export_name`, must not be `None`") # noqa: E501 + + self._export_name = export_name + + @property + def object_properties(self): + """Gets the object_properties of this PublicExportViewRequest. # noqa: E501 + + + :return: The object_properties of this PublicExportViewRequest. # noqa: E501 + :rtype: list[str] + """ + return self._object_properties + + @object_properties.setter + def object_properties(self, object_properties): + """Sets the object_properties of this PublicExportViewRequest. + + + :param object_properties: The object_properties of this PublicExportViewRequest. # noqa: E501 + :type object_properties: list[str] + """ + if self.local_vars_configuration.client_side_validation and object_properties is None: # noqa: E501 + raise ValueError("Invalid value for `object_properties`, must not be `None`") # noqa: E501 + + self._object_properties = object_properties + + @property + def associated_object_type(self): + """Gets the associated_object_type of this PublicExportViewRequest. # noqa: E501 + + + :return: The associated_object_type of this PublicExportViewRequest. # noqa: E501 + :rtype: str + """ + return self._associated_object_type + + @associated_object_type.setter + def associated_object_type(self, associated_object_type): + """Sets the associated_object_type of this PublicExportViewRequest. + + + :param associated_object_type: The associated_object_type of this PublicExportViewRequest. # noqa: E501 + :type associated_object_type: str + """ + + self._associated_object_type = associated_object_type + + @property + def object_type(self): + """Gets the object_type of this PublicExportViewRequest. # noqa: E501 + + + :return: The object_type of this PublicExportViewRequest. # noqa: E501 + :rtype: str + """ + return self._object_type + + @object_type.setter + def object_type(self, object_type): + """Sets the object_type of this PublicExportViewRequest. + + + :param object_type: The object_type of this PublicExportViewRequest. # noqa: E501 + :type object_type: str + """ + if self.local_vars_configuration.client_side_validation and object_type is None: # noqa: E501 + raise ValueError("Invalid value for `object_type`, must not be `None`") # noqa: E501 + + self._object_type = object_type + + @property + def language(self): + """Gets the language of this PublicExportViewRequest. # noqa: E501 + + + :return: The language of this PublicExportViewRequest. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this PublicExportViewRequest. + + + :param language: The language of this PublicExportViewRequest. # noqa: E501 + :type language: str + """ + if self.local_vars_configuration.client_side_validation and language is None: # noqa: E501 + raise ValueError("Invalid value for `language`, must not be `None`") # noqa: E501 + allowed_values = ["EN", "DE", "ES", "FR", "JA", "NL", "PT_BR", "IT", "PL", "SV", "FI", "ZH_TW", "DA_DK", "NO"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and language not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `language` ({0}), must be one of {1}".format(language, allowed_values)) # noqa: E501 + + self._language = language + + @property + def export_internal_values_options(self): + """Gets the export_internal_values_options of this PublicExportViewRequest. # noqa: E501 + + + :return: The export_internal_values_options of this PublicExportViewRequest. # noqa: E501 + :rtype: list[str] + """ + return self._export_internal_values_options + + @export_internal_values_options.setter + def export_internal_values_options(self, export_internal_values_options): + """Sets the export_internal_values_options of this PublicExportViewRequest. + + + :param export_internal_values_options: The export_internal_values_options of this PublicExportViewRequest. # noqa: E501 + :type export_internal_values_options: list[str] + """ + if self.local_vars_configuration.client_side_validation and export_internal_values_options is None: # noqa: E501 + raise ValueError("Invalid value for `export_internal_values_options`, must not be `None`") # noqa: E501 + allowed_values = ["NAMES", "VALUES"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and not set(export_internal_values_options).issubset(set(allowed_values)): # noqa: E501 + raise ValueError( + "Invalid values for `export_internal_values_options` [{0}], must be a subset of [{1}]".format( # noqa: E501 + ", ".join(map(str, set(export_internal_values_options) - set(allowed_values))), ", ".join(map(str, allowed_values)) # noqa: E501 + ) + ) + + self._export_internal_values_options = export_internal_values_options + + @property + def override_associated_objects_per_definition_per_row_limit(self): + """Gets the override_associated_objects_per_definition_per_row_limit of this PublicExportViewRequest. # noqa: E501 + + + :return: The override_associated_objects_per_definition_per_row_limit of this PublicExportViewRequest. # noqa: E501 + :rtype: bool + """ + return self._override_associated_objects_per_definition_per_row_limit + + @override_associated_objects_per_definition_per_row_limit.setter + def override_associated_objects_per_definition_per_row_limit(self, override_associated_objects_per_definition_per_row_limit): + """Sets the override_associated_objects_per_definition_per_row_limit of this PublicExportViewRequest. + + + :param override_associated_objects_per_definition_per_row_limit: The override_associated_objects_per_definition_per_row_limit of this PublicExportViewRequest. # noqa: E501 + :type override_associated_objects_per_definition_per_row_limit: bool + """ + if self.local_vars_configuration.client_side_validation and override_associated_objects_per_definition_per_row_limit is None: # noqa: E501 + raise ValueError("Invalid value for `override_associated_objects_per_definition_per_row_limit`, must not be `None`") # noqa: E501 + + self._override_associated_objects_per_definition_per_row_limit = override_associated_objects_per_definition_per_row_limit + + @property + def public_crm_search_request(self): + """Gets the public_crm_search_request of this PublicExportViewRequest. # noqa: E501 + + + :return: The public_crm_search_request of this PublicExportViewRequest. # noqa: E501 + :rtype: PublicCrmSearchRequest + """ + return self._public_crm_search_request + + @public_crm_search_request.setter + def public_crm_search_request(self, public_crm_search_request): + """Sets the public_crm_search_request of this PublicExportViewRequest. + + + :param public_crm_search_request: The public_crm_search_request of this PublicExportViewRequest. # noqa: E501 + :type public_crm_search_request: PublicCrmSearchRequest + """ + + self._public_crm_search_request = public_crm_search_request + + 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, PublicExportViewRequest): + 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, PublicExportViewRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/exports/models/public_export_view_request_all_of.py b/hubspot/crm/exports/models/public_export_view_request_all_of.py new file mode 100644 index 00000000..831b6b51 --- /dev/null +++ b/hubspot/crm/exports/models/public_export_view_request_all_of.py @@ -0,0 +1,396 @@ +# coding: utf-8 + +""" + CRM Exports + + 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.exports.configuration import Configuration + + +class PublicExportViewRequestAllOf(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 = { + "export_type": "str", + "format": "str", + "export_name": "str", + "object_properties": "list[str]", + "associated_object_type": "str", + "object_type": "str", + "language": "str", + "export_internal_values_options": "list[str]", + "override_associated_objects_per_definition_per_row_limit": "bool", + "public_crm_search_request": "PublicCrmSearchRequest", + } + + attribute_map = { + "export_type": "exportType", + "format": "format", + "export_name": "exportName", + "object_properties": "objectProperties", + "associated_object_type": "associatedObjectType", + "object_type": "objectType", + "language": "language", + "export_internal_values_options": "exportInternalValuesOptions", + "override_associated_objects_per_definition_per_row_limit": "overrideAssociatedObjectsPerDefinitionPerRowLimit", + "public_crm_search_request": "publicCrmSearchRequest", + } + + def __init__( + self, + export_type="VIEW", + format=None, + export_name=None, + object_properties=None, + associated_object_type=None, + object_type=None, + language=None, + export_internal_values_options=None, + override_associated_objects_per_definition_per_row_limit=None, + public_crm_search_request=None, + local_vars_configuration=None, + ): # noqa: E501 + """PublicExportViewRequestAllOf - 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._export_type = None + self._format = None + self._export_name = None + self._object_properties = None + self._associated_object_type = None + self._object_type = None + self._language = None + self._export_internal_values_options = None + self._override_associated_objects_per_definition_per_row_limit = None + self._public_crm_search_request = None + self.discriminator = None + + self.export_type = export_type + self.format = format + self.export_name = export_name + self.object_properties = object_properties + if associated_object_type is not None: + self.associated_object_type = associated_object_type + self.object_type = object_type + self.language = language + self.export_internal_values_options = export_internal_values_options + self.override_associated_objects_per_definition_per_row_limit = override_associated_objects_per_definition_per_row_limit + if public_crm_search_request is not None: + self.public_crm_search_request = public_crm_search_request + + @property + def export_type(self): + """Gets the export_type of this PublicExportViewRequestAllOf. # noqa: E501 + + + :return: The export_type of this PublicExportViewRequestAllOf. # noqa: E501 + :rtype: str + """ + return self._export_type + + @export_type.setter + def export_type(self, export_type): + """Sets the export_type of this PublicExportViewRequestAllOf. + + + :param export_type: The export_type of this PublicExportViewRequestAllOf. # noqa: E501 + :type export_type: str + """ + if self.local_vars_configuration.client_side_validation and export_type is None: # noqa: E501 + raise ValueError("Invalid value for `export_type`, must not be `None`") # noqa: E501 + allowed_values = ["VIEW"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and export_type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `export_type` ({0}), must be one of {1}".format(export_type, allowed_values)) # noqa: E501 + + self._export_type = export_type + + @property + def format(self): + """Gets the format of this PublicExportViewRequestAllOf. # noqa: E501 + + + :return: The format of this PublicExportViewRequestAllOf. # noqa: E501 + :rtype: str + """ + return self._format + + @format.setter + def format(self, format): + """Sets the format of this PublicExportViewRequestAllOf. + + + :param format: The format of this PublicExportViewRequestAllOf. # noqa: E501 + :type format: str + """ + if self.local_vars_configuration.client_side_validation and format is None: # noqa: E501 + raise ValueError("Invalid value for `format`, must not be `None`") # noqa: E501 + allowed_values = ["XLS", "XLSX", "CSV"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and format not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `format` ({0}), must be one of {1}".format(format, allowed_values)) # noqa: E501 + + self._format = format + + @property + def export_name(self): + """Gets the export_name of this PublicExportViewRequestAllOf. # noqa: E501 + + + :return: The export_name of this PublicExportViewRequestAllOf. # noqa: E501 + :rtype: str + """ + return self._export_name + + @export_name.setter + def export_name(self, export_name): + """Sets the export_name of this PublicExportViewRequestAllOf. + + + :param export_name: The export_name of this PublicExportViewRequestAllOf. # noqa: E501 + :type export_name: str + """ + if self.local_vars_configuration.client_side_validation and export_name is None: # noqa: E501 + raise ValueError("Invalid value for `export_name`, must not be `None`") # noqa: E501 + + self._export_name = export_name + + @property + def object_properties(self): + """Gets the object_properties of this PublicExportViewRequestAllOf. # noqa: E501 + + + :return: The object_properties of this PublicExportViewRequestAllOf. # noqa: E501 + :rtype: list[str] + """ + return self._object_properties + + @object_properties.setter + def object_properties(self, object_properties): + """Sets the object_properties of this PublicExportViewRequestAllOf. + + + :param object_properties: The object_properties of this PublicExportViewRequestAllOf. # noqa: E501 + :type object_properties: list[str] + """ + if self.local_vars_configuration.client_side_validation and object_properties is None: # noqa: E501 + raise ValueError("Invalid value for `object_properties`, must not be `None`") # noqa: E501 + + self._object_properties = object_properties + + @property + def associated_object_type(self): + """Gets the associated_object_type of this PublicExportViewRequestAllOf. # noqa: E501 + + + :return: The associated_object_type of this PublicExportViewRequestAllOf. # noqa: E501 + :rtype: str + """ + return self._associated_object_type + + @associated_object_type.setter + def associated_object_type(self, associated_object_type): + """Sets the associated_object_type of this PublicExportViewRequestAllOf. + + + :param associated_object_type: The associated_object_type of this PublicExportViewRequestAllOf. # noqa: E501 + :type associated_object_type: str + """ + + self._associated_object_type = associated_object_type + + @property + def object_type(self): + """Gets the object_type of this PublicExportViewRequestAllOf. # noqa: E501 + + + :return: The object_type of this PublicExportViewRequestAllOf. # noqa: E501 + :rtype: str + """ + return self._object_type + + @object_type.setter + def object_type(self, object_type): + """Sets the object_type of this PublicExportViewRequestAllOf. + + + :param object_type: The object_type of this PublicExportViewRequestAllOf. # noqa: E501 + :type object_type: str + """ + if self.local_vars_configuration.client_side_validation and object_type is None: # noqa: E501 + raise ValueError("Invalid value for `object_type`, must not be `None`") # noqa: E501 + + self._object_type = object_type + + @property + def language(self): + """Gets the language of this PublicExportViewRequestAllOf. # noqa: E501 + + + :return: The language of this PublicExportViewRequestAllOf. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this PublicExportViewRequestAllOf. + + + :param language: The language of this PublicExportViewRequestAllOf. # noqa: E501 + :type language: str + """ + if self.local_vars_configuration.client_side_validation and language is None: # noqa: E501 + raise ValueError("Invalid value for `language`, must not be `None`") # noqa: E501 + allowed_values = ["EN", "DE", "ES", "FR", "JA", "NL", "PT_BR", "IT", "PL", "SV", "FI", "ZH_TW", "DA_DK", "NO"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and language not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `language` ({0}), must be one of {1}".format(language, allowed_values)) # noqa: E501 + + self._language = language + + @property + def export_internal_values_options(self): + """Gets the export_internal_values_options of this PublicExportViewRequestAllOf. # noqa: E501 + + + :return: The export_internal_values_options of this PublicExportViewRequestAllOf. # noqa: E501 + :rtype: list[str] + """ + return self._export_internal_values_options + + @export_internal_values_options.setter + def export_internal_values_options(self, export_internal_values_options): + """Sets the export_internal_values_options of this PublicExportViewRequestAllOf. + + + :param export_internal_values_options: The export_internal_values_options of this PublicExportViewRequestAllOf. # noqa: E501 + :type export_internal_values_options: list[str] + """ + if self.local_vars_configuration.client_side_validation and export_internal_values_options is None: # noqa: E501 + raise ValueError("Invalid value for `export_internal_values_options`, must not be `None`") # noqa: E501 + allowed_values = ["NAMES", "VALUES"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and not set(export_internal_values_options).issubset(set(allowed_values)): # noqa: E501 + raise ValueError( + "Invalid values for `export_internal_values_options` [{0}], must be a subset of [{1}]".format( # noqa: E501 + ", ".join(map(str, set(export_internal_values_options) - set(allowed_values))), ", ".join(map(str, allowed_values)) # noqa: E501 + ) + ) + + self._export_internal_values_options = export_internal_values_options + + @property + def override_associated_objects_per_definition_per_row_limit(self): + """Gets the override_associated_objects_per_definition_per_row_limit of this PublicExportViewRequestAllOf. # noqa: E501 + + + :return: The override_associated_objects_per_definition_per_row_limit of this PublicExportViewRequestAllOf. # noqa: E501 + :rtype: bool + """ + return self._override_associated_objects_per_definition_per_row_limit + + @override_associated_objects_per_definition_per_row_limit.setter + def override_associated_objects_per_definition_per_row_limit(self, override_associated_objects_per_definition_per_row_limit): + """Sets the override_associated_objects_per_definition_per_row_limit of this PublicExportViewRequestAllOf. + + + :param override_associated_objects_per_definition_per_row_limit: The override_associated_objects_per_definition_per_row_limit of this PublicExportViewRequestAllOf. # noqa: E501 + :type override_associated_objects_per_definition_per_row_limit: bool + """ + if self.local_vars_configuration.client_side_validation and override_associated_objects_per_definition_per_row_limit is None: # noqa: E501 + raise ValueError("Invalid value for `override_associated_objects_per_definition_per_row_limit`, must not be `None`") # noqa: E501 + + self._override_associated_objects_per_definition_per_row_limit = override_associated_objects_per_definition_per_row_limit + + @property + def public_crm_search_request(self): + """Gets the public_crm_search_request of this PublicExportViewRequestAllOf. # noqa: E501 + + + :return: The public_crm_search_request of this PublicExportViewRequestAllOf. # noqa: E501 + :rtype: PublicCrmSearchRequest + """ + return self._public_crm_search_request + + @public_crm_search_request.setter + def public_crm_search_request(self, public_crm_search_request): + """Sets the public_crm_search_request of this PublicExportViewRequestAllOf. + + + :param public_crm_search_request: The public_crm_search_request of this PublicExportViewRequestAllOf. # noqa: E501 + :type public_crm_search_request: PublicCrmSearchRequest + """ + + self._public_crm_search_request = public_crm_search_request + + 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, PublicExportViewRequestAllOf): + 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, PublicExportViewRequestAllOf): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/exports/models/standard_error.py b/hubspot/crm/exports/models/standard_error.py new file mode 100644 index 00000000..7dfdcae4 --- /dev/null +++ b/hubspot/crm/exports/models/standard_error.py @@ -0,0 +1,304 @@ +# coding: utf-8 + +""" + CRM Exports + + 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.exports.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/exports/models/task_locator.py b/hubspot/crm/exports/models/task_locator.py new file mode 100644 index 00000000..d4c78741 --- /dev/null +++ b/hubspot/crm/exports/models/task_locator.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + CRM Exports + + 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.exports.configuration import Configuration + + +class TaskLocator(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 = {"links": "dict[str, str]", "id": "str"} + + attribute_map = {"links": "links", "id": "id"} + + def __init__(self, links=None, id=None, local_vars_configuration=None): # noqa: E501 + """TaskLocator - 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._links = None + self._id = None + self.discriminator = None + + if links is not None: + self.links = links + self.id = id + + @property + def links(self): + """Gets the links of this TaskLocator. # noqa: E501 + + + :return: The links of this TaskLocator. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this TaskLocator. + + + :param links: The links of this TaskLocator. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def id(self): + """Gets the id of this TaskLocator. # noqa: E501 + + + :return: The id of this TaskLocator. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TaskLocator. + + + :param id: The id of this TaskLocator. # 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, TaskLocator): + 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, TaskLocator): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/exports/rest.py b/hubspot/crm/exports/rest.py new file mode 100644 index 00000000..07993cb0 --- /dev/null +++ b/hubspot/crm/exports/rest.py @@ -0,0 +1,213 @@ +# coding: utf-8 + +""" + CRM Exports + + 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.exports.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) From ba7d55bb337f2761ae2b4476c058136c8300392e Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 1 Apr 2025 15:27:45 +0300 Subject: [PATCH 09/49] Codegen Crm Extensions Calling --- hubspot/crm/extensions/calling/__init__.py | 4 + .../crm/extensions/calling/api/__init__.py | 1 + .../api/channel_connection_settings_api.py | 552 ++++++++++++++++++ .../calling/api/recording_settings_api.py | 24 +- .../extensions/calling/api/settings_api.py | 20 +- .../crm/extensions/calling/models/__init__.py | 3 + ...annel_connection_settings_patch_request.py | 149 +++++ .../channel_connection_settings_request.py | 151 +++++ .../channel_connection_settings_response.py | 205 +++++++ .../models/recording_settings_response.py | 2 + .../calling/models/settings_patch_request.py | 90 ++- .../calling/models/settings_request.py | 95 ++- .../calling/models/settings_response.py | 82 ++- 13 files changed, 1336 insertions(+), 42 deletions(-) create mode 100644 hubspot/crm/extensions/calling/api/channel_connection_settings_api.py create mode 100644 hubspot/crm/extensions/calling/models/channel_connection_settings_patch_request.py create mode 100644 hubspot/crm/extensions/calling/models/channel_connection_settings_request.py create mode 100644 hubspot/crm/extensions/calling/models/channel_connection_settings_response.py diff --git a/hubspot/crm/extensions/calling/__init__.py b/hubspot/crm/extensions/calling/__init__.py index 82d87782..7a70c655 100644 --- a/hubspot/crm/extensions/calling/__init__.py +++ b/hubspot/crm/extensions/calling/__init__.py @@ -17,6 +17,7 @@ __version__ = "1.0.0" # import apis into sdk package +from hubspot.crm.extensions.calling.api.channel_connection_settings_api import ChannelConnectionSettingsApi from hubspot.crm.extensions.calling.api.recording_settings_api import RecordingSettingsApi from hubspot.crm.extensions.calling.api.settings_api import SettingsApi @@ -31,6 +32,9 @@ from hubspot.crm.extensions.calling.exceptions import ApiException # import models into sdk package +from hubspot.crm.extensions.calling.models.channel_connection_settings_patch_request import ChannelConnectionSettingsPatchRequest +from hubspot.crm.extensions.calling.models.channel_connection_settings_request import ChannelConnectionSettingsRequest +from hubspot.crm.extensions.calling.models.channel_connection_settings_response import ChannelConnectionSettingsResponse from hubspot.crm.extensions.calling.models.error import Error from hubspot.crm.extensions.calling.models.error_detail import ErrorDetail from hubspot.crm.extensions.calling.models.mark_recording_as_ready_request import MarkRecordingAsReadyRequest diff --git a/hubspot/crm/extensions/calling/api/__init__.py b/hubspot/crm/extensions/calling/api/__init__.py index 4147080e..d5d61f37 100644 --- a/hubspot/crm/extensions/calling/api/__init__.py +++ b/hubspot/crm/extensions/calling/api/__init__.py @@ -3,5 +3,6 @@ # flake8: noqa # import apis into api package +from hubspot.crm.extensions.calling.api.channel_connection_settings_api import ChannelConnectionSettingsApi from hubspot.crm.extensions.calling.api.recording_settings_api import RecordingSettingsApi from hubspot.crm.extensions.calling.api.settings_api import SettingsApi diff --git a/hubspot/crm/extensions/calling/api/channel_connection_settings_api.py b/hubspot/crm/extensions/calling/api/channel_connection_settings_api.py new file mode 100644 index 00000000..eb6e5102 --- /dev/null +++ b/hubspot/crm/extensions/calling/api/channel_connection_settings_api.py @@ -0,0 +1,552 @@ +# coding: utf-8 + +""" + CRM Calling Extensions + + 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.extensions.calling.api_client import ApiClient +from hubspot.crm.extensions.calling.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class ChannelConnectionSettingsApi(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, app_id, **kwargs): # noqa: E501 + """Delete channel connection settings # noqa: E501 + + Delete the [channel connection settings](https://developers.hubspot.com/docs/guides/api/crm/extensions/third-party-calling#delete-existing-channel-connection-settings) for the app. # 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(app_id, async_req=True) + >>> result = thread.get() + + :param app_id: The ID of the app. (required) + :type app_id: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + return self.archive_with_http_info(app_id, **kwargs) # noqa: E501 + + def archive_with_http_info(self, app_id, **kwargs): # noqa: E501 + """Delete channel connection settings # noqa: E501 + + Delete the [channel connection settings](https://developers.hubspot.com/docs/guides/api/crm/extensions/third-party-calling#delete-existing-channel-connection-settings) for the app. # 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(app_id, async_req=True) + >>> result = thread.get() + + :param app_id: The ID of the app. (required) + :type app_id: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + local_var_params = locals() + + all_params = ["app_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 'app_id' is set + if self.api_client.client_side_validation and local_var_params.get("app_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `app_id` when calling `archive`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "app_id" in local_var_params: + path_params["appId"] = local_var_params["app_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 = ["developer_hapikey"] # noqa: E501 + + response_types_map = {} + + return self.api_client.call_api( + "/crm/v3/extensions/calling/{appId}/settings/channel-connection", + "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, app_id, channel_connection_settings_request, **kwargs): # noqa: E501 + """Configure channel connection settings # noqa: E501 + + Configure [channel connection settings](https://developers.hubspot.com/docs/guides/api/crm/extensions/third-party-calling#create-channel-connection-settings) for the app. # 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(app_id, channel_connection_settings_request, async_req=True) + >>> result = thread.get() + + :param app_id: The ID of the app. (required) + :type app_id: int + :param channel_connection_settings_request: (required) + :type channel_connection_settings_request: ChannelConnectionSettingsRequest + :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: ChannelConnectionSettingsResponse + """ + kwargs["_return_http_data_only"] = True + return self.create_with_http_info(app_id, channel_connection_settings_request, **kwargs) # noqa: E501 + + def create_with_http_info(self, app_id, channel_connection_settings_request, **kwargs): # noqa: E501 + """Configure channel connection settings # noqa: E501 + + Configure [channel connection settings](https://developers.hubspot.com/docs/guides/api/crm/extensions/third-party-calling#create-channel-connection-settings) for the app. # 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(app_id, channel_connection_settings_request, async_req=True) + >>> result = thread.get() + + :param app_id: The ID of the app. (required) + :type app_id: int + :param channel_connection_settings_request: (required) + :type channel_connection_settings_request: ChannelConnectionSettingsRequest + :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(ChannelConnectionSettingsResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["app_id", "channel_connection_settings_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 create" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'app_id' is set + if self.api_client.client_side_validation and local_var_params.get("app_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `app_id` when calling `create`") # noqa: E501 + # verify the required parameter 'channel_connection_settings_request' is set + if self.api_client.client_side_validation and local_var_params.get("channel_connection_settings_request") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `channel_connection_settings_request` when calling `create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "app_id" in local_var_params: + path_params["appId"] = local_var_params["app_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "channel_connection_settings_request" in local_var_params: + body_params = local_var_params["channel_connection_settings_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 = ["developer_hapikey"] # noqa: E501 + + response_types_map = { + 200: "ChannelConnectionSettingsResponse", + } + + return self.api_client.call_api( + "/crm/v3/extensions/calling/{appId}/settings/channel-connection", + "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, app_id, **kwargs): # noqa: E501 + """Retrieve channel connection settings # noqa: E501 + + Retrieve the settings related to the app's [channel connection](https://developers.hubspot.com/docs/guides/api/crm/extensions/third-party-calling#fetch-existing-channel-connection-settings). # 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(app_id, async_req=True) + >>> result = thread.get() + + :param app_id: The ID of the app. (required) + :type app_id: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ChannelConnectionSettingsResponse + """ + kwargs["_return_http_data_only"] = True + return self.get_by_id_with_http_info(app_id, **kwargs) # noqa: E501 + + def get_by_id_with_http_info(self, app_id, **kwargs): # noqa: E501 + """Retrieve channel connection settings # noqa: E501 + + Retrieve the settings related to the app's [channel connection](https://developers.hubspot.com/docs/guides/api/crm/extensions/third-party-calling#fetch-existing-channel-connection-settings). # 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(app_id, async_req=True) + >>> result = thread.get() + + :param app_id: The ID of the app. (required) + :type app_id: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ChannelConnectionSettingsResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["app_id"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_by_id" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'app_id' is set + if self.api_client.client_side_validation and local_var_params.get("app_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `app_id` when calling `get_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "app_id" in local_var_params: + path_params["appId"] = local_var_params["app_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["developer_hapikey"] # noqa: E501 + + response_types_map = { + 200: "ChannelConnectionSettingsResponse", + } + + return self.api_client.call_api( + "/crm/v3/extensions/calling/{appId}/settings/channel-connection", + "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, app_id, channel_connection_settings_patch_request, **kwargs): # noqa: E501 + """Update channel connection settings # noqa: E501 + + Update existing [channel connection settings](https://developers.hubspot.com/docs/guides/api/crm/extensions/third-party-calling#manage-the-webhook-settings-for-channel-connection) for your app. # 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(app_id, channel_connection_settings_patch_request, async_req=True) + >>> result = thread.get() + + :param app_id: The ID of the app. (required) + :type app_id: int + :param channel_connection_settings_patch_request: (required) + :type channel_connection_settings_patch_request: ChannelConnectionSettingsPatchRequest + :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: ChannelConnectionSettingsResponse + """ + kwargs["_return_http_data_only"] = True + return self.update_with_http_info(app_id, channel_connection_settings_patch_request, **kwargs) # noqa: E501 + + def update_with_http_info(self, app_id, channel_connection_settings_patch_request, **kwargs): # noqa: E501 + """Update channel connection settings # noqa: E501 + + Update existing [channel connection settings](https://developers.hubspot.com/docs/guides/api/crm/extensions/third-party-calling#manage-the-webhook-settings-for-channel-connection) for your app. # 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(app_id, channel_connection_settings_patch_request, async_req=True) + >>> result = thread.get() + + :param app_id: The ID of the app. (required) + :type app_id: int + :param channel_connection_settings_patch_request: (required) + :type channel_connection_settings_patch_request: ChannelConnectionSettingsPatchRequest + :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(ChannelConnectionSettingsResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["app_id", "channel_connection_settings_patch_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 update" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'app_id' is set + if self.api_client.client_side_validation and local_var_params.get("app_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `app_id` when calling `update`") # noqa: E501 + # verify the required parameter 'channel_connection_settings_patch_request' is set + if self.api_client.client_side_validation and local_var_params.get("channel_connection_settings_patch_request") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `channel_connection_settings_patch_request` when calling `update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "app_id" in local_var_params: + path_params["appId"] = local_var_params["app_id"] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + if "channel_connection_settings_patch_request" in local_var_params: + body_params = local_var_params["channel_connection_settings_patch_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"], "PATCH", body_params)) # noqa: E501 + if content_types_list: + header_params["Content-Type"] = content_types_list + + # Authentication setting + auth_settings = ["developer_hapikey"] # noqa: E501 + + response_types_map = { + 200: "ChannelConnectionSettingsResponse", + } + + return self.api_client.call_api( + "/crm/v3/extensions/calling/{appId}/settings/channel-connection", + "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/extensions/calling/api/recording_settings_api.py b/hubspot/crm/extensions/calling/api/recording_settings_api.py index 9cae5b0f..d664f80e 100644 --- a/hubspot/crm/extensions/calling/api/recording_settings_api.py +++ b/hubspot/crm/extensions/calling/api/recording_settings_api.py @@ -34,9 +34,9 @@ def __init__(self, api_client=None): self.api_client = api_client def get_url_format(self, app_id, **kwargs): # noqa: E501 - """Read calling app recording settings # noqa: E501 + """Retrieve recording settings # noqa: E501 - Retrieve the recording endpoint configured for a calling extension app. # noqa: E501 + Retrieve the URL that is registered for [call recording](https://developers.hubspot.com/docs/guides/apps/extensions/calling-extensions/recordings-and-transcriptions#register-your-app-s-endpoint-with-hubspot-using-the-calling-settings-api). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -64,9 +64,9 @@ def get_url_format(self, app_id, **kwargs): # noqa: E501 return self.get_url_format_with_http_info(app_id, **kwargs) # noqa: E501 def get_url_format_with_http_info(self, app_id, **kwargs): # noqa: E501 - """Read calling app recording settings # noqa: E501 + """Retrieve recording settings # noqa: E501 - Retrieve the recording endpoint configured for a calling extension app. # noqa: E501 + Retrieve the URL that is registered for [call recording](https://developers.hubspot.com/docs/guides/apps/extensions/calling-extensions/recordings-and-transcriptions#register-your-app-s-endpoint-with-hubspot-using-the-calling-settings-api). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -283,9 +283,9 @@ def mark_as_ready_with_http_info(self, mark_recording_as_ready_request, **kwargs ) def register_url_format(self, app_id, recording_settings_request, **kwargs): # noqa: E501 - """Register calling app for recording # noqa: E501 + """Enable the app for call recording # noqa: E501 - Configure a calling extension app with an external URL that HubSpot will use to retrieve call recordings. # noqa: E501 + Register an external URL that HubSpot will use to retrieve [call recordings](https://developers.hubspot.com/docs/guides/apps/extensions/calling-extensions/recordings-and-transcriptions#register-your-app-s-endpoint-with-hubspot-using-the-calling-settings-api). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -315,9 +315,9 @@ def register_url_format(self, app_id, recording_settings_request, **kwargs): # return self.register_url_format_with_http_info(app_id, recording_settings_request, **kwargs) # noqa: E501 def register_url_format_with_http_info(self, app_id, recording_settings_request, **kwargs): # noqa: E501 - """Register calling app for recording # noqa: E501 + """Enable the app for call recording # noqa: E501 - Configure a calling extension app with an external URL that HubSpot will use to retrieve call recordings. # noqa: E501 + Register an external URL that HubSpot will use to retrieve [call recordings](https://developers.hubspot.com/docs/guides/apps/extensions/calling-extensions/recordings-and-transcriptions#register-your-app-s-endpoint-with-hubspot-using-the-calling-settings-api). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -420,9 +420,9 @@ def register_url_format_with_http_info(self, app_id, recording_settings_request, ) def update_url_format(self, app_id, recording_settings_patch_request, **kwargs): # noqa: E501 - """Update calling app's recording settings # noqa: E501 + """Update recording settings # noqa: E501 - Update the URL that HubSpot will use to retrieve call recordings for a calling extension app. # noqa: E501 + Update the URL that HubSpot will use to retrieve [call recordings](https://developers.hubspot.com/docs/guides/apps/extensions/calling-extensions/recordings-and-transcriptions#register-your-app-s-endpoint-with-hubspot-using-the-calling-settings-api). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -452,9 +452,9 @@ def update_url_format(self, app_id, recording_settings_patch_request, **kwargs): return self.update_url_format_with_http_info(app_id, recording_settings_patch_request, **kwargs) # noqa: E501 def update_url_format_with_http_info(self, app_id, recording_settings_patch_request, **kwargs): # noqa: E501 - """Update calling app's recording settings # noqa: E501 + """Update recording settings # noqa: E501 - Update the URL that HubSpot will use to retrieve call recordings for a calling extension app. # noqa: E501 + Update the URL that HubSpot will use to retrieve [call recordings](https://developers.hubspot.com/docs/guides/apps/extensions/calling-extensions/recordings-and-transcriptions#register-your-app-s-endpoint-with-hubspot-using-the-calling-settings-api). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/extensions/calling/api/settings_api.py b/hubspot/crm/extensions/calling/api/settings_api.py index 0beae33b..c306c190 100644 --- a/hubspot/crm/extensions/calling/api/settings_api.py +++ b/hubspot/crm/extensions/calling/api/settings_api.py @@ -36,7 +36,7 @@ def __init__(self, api_client=None): def archive(self, app_id, **kwargs): # noqa: E501 """Delete calling settings # noqa: E501 - Deletes this calling extension. This will remove your service as an option for all connected accounts. # noqa: E501 + Delete a calling extension. This will remove your service as an option for all connected accounts. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -66,7 +66,7 @@ def archive(self, app_id, **kwargs): # noqa: E501 def archive_with_http_info(self, app_id, **kwargs): # noqa: E501 """Delete calling settings # noqa: E501 - Deletes this calling extension. This will remove your service as an option for all connected accounts. # noqa: E501 + Delete a calling extension. This will remove your service as an option for all connected accounts. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -157,7 +157,7 @@ def archive_with_http_info(self, app_id, **kwargs): # noqa: E501 def create(self, app_id, settings_request, **kwargs): # noqa: E501 """Configure a calling extension # noqa: E501 - Used to set the menu label, target iframe URL, and dimensions for your calling extension. # noqa: E501 + Set the menu label, target iframe URL, and dimensions for your calling extension. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -189,7 +189,7 @@ def create(self, app_id, settings_request, **kwargs): # noqa: E501 def create_with_http_info(self, app_id, settings_request, **kwargs): # noqa: E501 """Configure a calling extension # noqa: E501 - Used to set the menu label, target iframe URL, and dimensions for your calling extension. # noqa: E501 + Set the menu label, target iframe URL, and dimensions for your calling extension. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -292,9 +292,9 @@ def create_with_http_info(self, app_id, settings_request, **kwargs): # noqa: E5 ) def get_by_id(self, app_id, **kwargs): # noqa: E501 - """Get calling settings # noqa: E501 + """Retrieve settings # noqa: E501 - Returns the calling extension settings configured for your app. # noqa: E501 + Retrieve the settings configured for the app. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -322,9 +322,9 @@ def get_by_id(self, app_id, **kwargs): # noqa: E501 return self.get_by_id_with_http_info(app_id, **kwargs) # noqa: E501 def get_by_id_with_http_info(self, app_id, **kwargs): # noqa: E501 - """Get calling settings # noqa: E501 + """Retrieve settings # noqa: E501 - Returns the calling extension settings configured for your app. # noqa: E501 + Retrieve the settings configured for the app. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -417,7 +417,7 @@ def get_by_id_with_http_info(self, app_id, **kwargs): # noqa: E501 def update(self, app_id, settings_patch_request, **kwargs): # noqa: E501 """Update settings # noqa: E501 - Updates existing calling extension settings. # noqa: E501 + Update existing calling extension settings. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -449,7 +449,7 @@ def update(self, app_id, settings_patch_request, **kwargs): # noqa: E501 def update_with_http_info(self, app_id, settings_patch_request, **kwargs): # noqa: E501 """Update settings # noqa: E501 - Updates existing calling extension settings. # noqa: E501 + Update existing calling extension settings. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/extensions/calling/models/__init__.py b/hubspot/crm/extensions/calling/models/__init__.py index afc209de..55de6163 100644 --- a/hubspot/crm/extensions/calling/models/__init__.py +++ b/hubspot/crm/extensions/calling/models/__init__.py @@ -14,6 +14,9 @@ from __future__ import absolute_import # import models into model package +from hubspot.crm.extensions.calling.models.channel_connection_settings_patch_request import ChannelConnectionSettingsPatchRequest +from hubspot.crm.extensions.calling.models.channel_connection_settings_request import ChannelConnectionSettingsRequest +from hubspot.crm.extensions.calling.models.channel_connection_settings_response import ChannelConnectionSettingsResponse from hubspot.crm.extensions.calling.models.error import Error from hubspot.crm.extensions.calling.models.error_detail import ErrorDetail from hubspot.crm.extensions.calling.models.mark_recording_as_ready_request import MarkRecordingAsReadyRequest diff --git a/hubspot/crm/extensions/calling/models/channel_connection_settings_patch_request.py b/hubspot/crm/extensions/calling/models/channel_connection_settings_patch_request.py new file mode 100644 index 00000000..a7abc877 --- /dev/null +++ b/hubspot/crm/extensions/calling/models/channel_connection_settings_patch_request.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + CRM Calling Extensions + + 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.extensions.calling.configuration import Configuration + + +class ChannelConnectionSettingsPatchRequest(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 = {"is_ready": "bool", "url": "str"} + + attribute_map = {"is_ready": "isReady", "url": "url"} + + def __init__(self, is_ready=None, url=None, local_vars_configuration=None): # noqa: E501 + """ChannelConnectionSettingsPatchRequest - 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._is_ready = None + self._url = None + self.discriminator = None + + if is_ready is not None: + self.is_ready = is_ready + if url is not None: + self.url = url + + @property + def is_ready(self): + """Gets the is_ready of this ChannelConnectionSettingsPatchRequest. # noqa: E501 + + If true, this app will be considered to support channel connection # noqa: E501 + + :return: The is_ready of this ChannelConnectionSettingsPatchRequest. # noqa: E501 + :rtype: bool + """ + return self._is_ready + + @is_ready.setter + def is_ready(self, is_ready): + """Sets the is_ready of this ChannelConnectionSettingsPatchRequest. + + If true, this app will be considered to support channel connection # noqa: E501 + + :param is_ready: The is_ready of this ChannelConnectionSettingsPatchRequest. # noqa: E501 + :type is_ready: bool + """ + + self._is_ready = is_ready + + @property + def url(self): + """Gets the url of this ChannelConnectionSettingsPatchRequest. # noqa: E501 + + The URL to fetch phone numbers available for channel connection # noqa: E501 + + :return: The url of this ChannelConnectionSettingsPatchRequest. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this ChannelConnectionSettingsPatchRequest. + + The URL to fetch phone numbers available for channel connection # noqa: E501 + + :param url: The url of this ChannelConnectionSettingsPatchRequest. # noqa: E501 + :type url: str + """ + + self._url = url + + 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, ChannelConnectionSettingsPatchRequest): + 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, ChannelConnectionSettingsPatchRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/extensions/calling/models/channel_connection_settings_request.py b/hubspot/crm/extensions/calling/models/channel_connection_settings_request.py new file mode 100644 index 00000000..422bea05 --- /dev/null +++ b/hubspot/crm/extensions/calling/models/channel_connection_settings_request.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + CRM Calling Extensions + + 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.extensions.calling.configuration import Configuration + + +class ChannelConnectionSettingsRequest(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 = {"is_ready": "bool", "url": "str"} + + attribute_map = {"is_ready": "isReady", "url": "url"} + + def __init__(self, is_ready=None, url=None, local_vars_configuration=None): # noqa: E501 + """ChannelConnectionSettingsRequest - 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._is_ready = None + self._url = None + self.discriminator = None + + self.is_ready = is_ready + self.url = url + + @property + def is_ready(self): + """Gets the is_ready of this ChannelConnectionSettingsRequest. # noqa: E501 + + If true, this app will be considered to support channel connection # noqa: E501 + + :return: The is_ready of this ChannelConnectionSettingsRequest. # noqa: E501 + :rtype: bool + """ + return self._is_ready + + @is_ready.setter + def is_ready(self, is_ready): + """Sets the is_ready of this ChannelConnectionSettingsRequest. + + If true, this app will be considered to support channel connection # noqa: E501 + + :param is_ready: The is_ready of this ChannelConnectionSettingsRequest. # noqa: E501 + :type is_ready: bool + """ + if self.local_vars_configuration.client_side_validation and is_ready is None: # noqa: E501 + raise ValueError("Invalid value for `is_ready`, must not be `None`") # noqa: E501 + + self._is_ready = is_ready + + @property + def url(self): + """Gets the url of this ChannelConnectionSettingsRequest. # noqa: E501 + + The URL to fetch phone numbers available for channel connection # noqa: E501 + + :return: The url of this ChannelConnectionSettingsRequest. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this ChannelConnectionSettingsRequest. + + The URL to fetch phone numbers available for channel connection # noqa: E501 + + :param url: The url of this ChannelConnectionSettingsRequest. # noqa: E501 + :type url: str + """ + if self.local_vars_configuration.client_side_validation and url is None: # noqa: E501 + raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 + + self._url = url + + 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, ChannelConnectionSettingsRequest): + 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, ChannelConnectionSettingsRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/extensions/calling/models/channel_connection_settings_response.py b/hubspot/crm/extensions/calling/models/channel_connection_settings_response.py new file mode 100644 index 00000000..9f2ee7d2 --- /dev/null +++ b/hubspot/crm/extensions/calling/models/channel_connection_settings_response.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + CRM Calling Extensions + + 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.extensions.calling.configuration import Configuration + + +class ChannelConnectionSettingsResponse(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", "is_ready": "bool", "url": "str", "updated_at": "datetime"} + + attribute_map = {"created_at": "createdAt", "is_ready": "isReady", "url": "url", "updated_at": "updatedAt"} + + def __init__(self, created_at=None, is_ready=None, url=None, updated_at=None, local_vars_configuration=None): # noqa: E501 + """ChannelConnectionSettingsResponse - 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._is_ready = None + self._url = None + self._updated_at = None + self.discriminator = None + + self.created_at = created_at + self.is_ready = is_ready + self.url = url + self.updated_at = updated_at + + @property + def created_at(self): + """Gets the created_at of this ChannelConnectionSettingsResponse. # noqa: E501 + + The timestamp this setting was created # noqa: E501 + + :return: The created_at of this ChannelConnectionSettingsResponse. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this ChannelConnectionSettingsResponse. + + The timestamp this setting was created # noqa: E501 + + :param created_at: The created_at of this ChannelConnectionSettingsResponse. # 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 is_ready(self): + """Gets the is_ready of this ChannelConnectionSettingsResponse. # noqa: E501 + + If true, this app will be considered to support channel connection # noqa: E501 + + :return: The is_ready of this ChannelConnectionSettingsResponse. # noqa: E501 + :rtype: bool + """ + return self._is_ready + + @is_ready.setter + def is_ready(self, is_ready): + """Sets the is_ready of this ChannelConnectionSettingsResponse. + + If true, this app will be considered to support channel connection # noqa: E501 + + :param is_ready: The is_ready of this ChannelConnectionSettingsResponse. # noqa: E501 + :type is_ready: bool + """ + if self.local_vars_configuration.client_side_validation and is_ready is None: # noqa: E501 + raise ValueError("Invalid value for `is_ready`, must not be `None`") # noqa: E501 + + self._is_ready = is_ready + + @property + def url(self): + """Gets the url of this ChannelConnectionSettingsResponse. # noqa: E501 + + The URL to fetch phone numbers available for channel connection # noqa: E501 + + :return: The url of this ChannelConnectionSettingsResponse. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this ChannelConnectionSettingsResponse. + + The URL to fetch phone numbers available for channel connection # noqa: E501 + + :param url: The url of this ChannelConnectionSettingsResponse. # noqa: E501 + :type url: str + """ + if self.local_vars_configuration.client_side_validation and url is None: # noqa: E501 + raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 + + self._url = url + + @property + def updated_at(self): + """Gets the updated_at of this ChannelConnectionSettingsResponse. # noqa: E501 + + The timestamp this setting was last updated # noqa: E501 + + :return: The updated_at of this ChannelConnectionSettingsResponse. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this ChannelConnectionSettingsResponse. + + The timestamp this setting was last updated # noqa: E501 + + :param updated_at: The updated_at of this ChannelConnectionSettingsResponse. # 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, ChannelConnectionSettingsResponse): + 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, ChannelConnectionSettingsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/extensions/calling/models/recording_settings_response.py b/hubspot/crm/extensions/calling/models/recording_settings_response.py index 66efc47e..7f5e6e99 100644 --- a/hubspot/crm/extensions/calling/models/recording_settings_response.py +++ b/hubspot/crm/extensions/calling/models/recording_settings_response.py @@ -54,6 +54,7 @@ def __init__(self, url_to_retrieve_authed_recording=None, local_vars_configurati def url_to_retrieve_authed_recording(self): """Gets the url_to_retrieve_authed_recording of this RecordingSettingsResponse. # noqa: E501 + # noqa: E501 :return: The url_to_retrieve_authed_recording of this RecordingSettingsResponse. # noqa: E501 :rtype: str @@ -64,6 +65,7 @@ def url_to_retrieve_authed_recording(self): def url_to_retrieve_authed_recording(self, url_to_retrieve_authed_recording): """Sets the url_to_retrieve_authed_recording of this RecordingSettingsResponse. + # noqa: E501 :param url_to_retrieve_authed_recording: The url_to_retrieve_authed_recording of this RecordingSettingsResponse. # noqa: E501 :type url_to_retrieve_authed_recording: str diff --git a/hubspot/crm/extensions/calling/models/settings_patch_request.py b/hubspot/crm/extensions/calling/models/settings_patch_request.py index 5a1e52bd..c5d941d9 100644 --- a/hubspot/crm/extensions/calling/models/settings_patch_request.py +++ b/hubspot/crm/extensions/calling/models/settings_patch_request.py @@ -35,28 +35,54 @@ class SettingsPatchRequest(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"supports_custom_objects": "bool", "is_ready": "bool", "name": "str", "width": "int", "supports_inbound_calling": "bool", "url": "str", "height": "int"} + openapi_types = { + "supports_custom_objects": "bool", + "uses_remote": "bool", + "is_ready": "bool", + "name": "str", + "width": "int", + "uses_calling_window": "bool", + "supports_inbound_calling": "bool", + "url": "str", + "height": "int", + } attribute_map = { "supports_custom_objects": "supportsCustomObjects", + "uses_remote": "usesRemote", "is_ready": "isReady", "name": "name", "width": "width", + "uses_calling_window": "usesCallingWindow", "supports_inbound_calling": "supportsInboundCalling", "url": "url", "height": "height", } - def __init__(self, supports_custom_objects=None, is_ready=None, name=None, width=None, supports_inbound_calling=None, url=None, height=None, local_vars_configuration=None): # noqa: E501 + def __init__( + self, + supports_custom_objects=None, + uses_remote=None, + is_ready=None, + name=None, + width=None, + uses_calling_window=None, + supports_inbound_calling=None, + url=None, + height=None, + local_vars_configuration=None, + ): # noqa: E501 """SettingsPatchRequest - 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._supports_custom_objects = None + self._uses_remote = None self._is_ready = None self._name = None self._width = None + self._uses_calling_window = None self._supports_inbound_calling = None self._url = None self._height = None @@ -64,12 +90,16 @@ def __init__(self, supports_custom_objects=None, is_ready=None, name=None, width if supports_custom_objects is not None: self.supports_custom_objects = supports_custom_objects + if uses_remote is not None: + self.uses_remote = uses_remote if is_ready is not None: self.is_ready = is_ready if name is not None: self.name = name if width is not None: self.width = width + if uses_calling_window is not None: + self.uses_calling_window = uses_calling_window if supports_inbound_calling is not None: self.supports_inbound_calling = supports_inbound_calling if url is not None: @@ -81,7 +111,7 @@ def __init__(self, supports_custom_objects=None, is_ready=None, name=None, width def supports_custom_objects(self): """Gets the supports_custom_objects of this SettingsPatchRequest. # noqa: E501 - When true, you are indicating that your service is compatible with engagement v2 service and can be used with custom objects. # noqa: E501 + When true, users will be able to click to dial from custom objects. # noqa: E501 :return: The supports_custom_objects of this SettingsPatchRequest. # noqa: E501 :rtype: bool @@ -92,7 +122,7 @@ def supports_custom_objects(self): def supports_custom_objects(self, supports_custom_objects): """Sets the supports_custom_objects of this SettingsPatchRequest. - When true, you are indicating that your service is compatible with engagement v2 service and can be used with custom objects. # noqa: E501 + When true, users will be able to click to dial from custom objects. # noqa: E501 :param supports_custom_objects: The supports_custom_objects of this SettingsPatchRequest. # noqa: E501 :type supports_custom_objects: bool @@ -100,11 +130,34 @@ def supports_custom_objects(self, supports_custom_objects): self._supports_custom_objects = supports_custom_objects + @property + def uses_remote(self): + """Gets the uses_remote of this SettingsPatchRequest. # noqa: E501 + + When false, this indicates that your calling app does not use the anchored calling remote within the HubSpot app. # noqa: E501 + + :return: The uses_remote of this SettingsPatchRequest. # noqa: E501 + :rtype: bool + """ + return self._uses_remote + + @uses_remote.setter + def uses_remote(self, uses_remote): + """Sets the uses_remote of this SettingsPatchRequest. + + When false, this indicates that your calling app does not use the anchored calling remote within the HubSpot app. # noqa: E501 + + :param uses_remote: The uses_remote of this SettingsPatchRequest. # noqa: E501 + :type uses_remote: bool + """ + + self._uses_remote = uses_remote + @property def is_ready(self): """Gets the is_ready of this SettingsPatchRequest. # noqa: E501 - When true, your service will appear as an option under the *Call* action in contact records of connected accounts. # noqa: E501 + When true, this indicates that your calling app is ready for production. Users will be able to select your calling app as their provider and can then click to dial within HubSpot. # noqa: E501 :return: The is_ready of this SettingsPatchRequest. # noqa: E501 :rtype: bool @@ -115,7 +168,7 @@ def is_ready(self): def is_ready(self, is_ready): """Sets the is_ready of this SettingsPatchRequest. - When true, your service will appear as an option under the *Call* action in contact records of connected accounts. # noqa: E501 + When true, this indicates that your calling app is ready for production. Users will be able to select your calling app as their provider and can then click to dial within HubSpot. # noqa: E501 :param is_ready: The is_ready of this SettingsPatchRequest. # noqa: E501 :type is_ready: bool @@ -169,10 +222,34 @@ def width(self, width): self._width = width + @property + def uses_calling_window(self): + """Gets the uses_calling_window of this SettingsPatchRequest. # noqa: E501 + + When false, this indicates that your calling app does not require the use of the separate calling window to hold the call connection. # noqa: E501 + + :return: The uses_calling_window of this SettingsPatchRequest. # noqa: E501 + :rtype: bool + """ + return self._uses_calling_window + + @uses_calling_window.setter + def uses_calling_window(self, uses_calling_window): + """Sets the uses_calling_window of this SettingsPatchRequest. + + When false, this indicates that your calling app does not require the use of the separate calling window to hold the call connection. # noqa: E501 + + :param uses_calling_window: The uses_calling_window of this SettingsPatchRequest. # noqa: E501 + :type uses_calling_window: bool + """ + + self._uses_calling_window = uses_calling_window + @property def supports_inbound_calling(self): """Gets the supports_inbound_calling of this SettingsPatchRequest. # noqa: E501 + When true, this indicates that your calling app supports inbound calling within HubSpot. # noqa: E501 :return: The supports_inbound_calling of this SettingsPatchRequest. # noqa: E501 :rtype: bool @@ -183,6 +260,7 @@ def supports_inbound_calling(self): def supports_inbound_calling(self, supports_inbound_calling): """Sets the supports_inbound_calling of this SettingsPatchRequest. + When true, this indicates that your calling app supports inbound calling within HubSpot. # noqa: E501 :param supports_inbound_calling: The supports_inbound_calling of this SettingsPatchRequest. # noqa: E501 :type supports_inbound_calling: bool diff --git a/hubspot/crm/extensions/calling/models/settings_request.py b/hubspot/crm/extensions/calling/models/settings_request.py index d934c94c..4e6de552 100644 --- a/hubspot/crm/extensions/calling/models/settings_request.py +++ b/hubspot/crm/extensions/calling/models/settings_request.py @@ -35,28 +35,54 @@ class SettingsRequest(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"supports_custom_objects": "bool", "is_ready": "bool", "name": "str", "width": "int", "supports_inbound_calling": "bool", "url": "str", "height": "int"} + openapi_types = { + "supports_custom_objects": "bool", + "uses_remote": "bool", + "is_ready": "bool", + "name": "str", + "width": "int", + "uses_calling_window": "bool", + "supports_inbound_calling": "bool", + "url": "str", + "height": "int", + } attribute_map = { "supports_custom_objects": "supportsCustomObjects", + "uses_remote": "usesRemote", "is_ready": "isReady", "name": "name", "width": "width", + "uses_calling_window": "usesCallingWindow", "supports_inbound_calling": "supportsInboundCalling", "url": "url", "height": "height", } - def __init__(self, supports_custom_objects=None, is_ready=None, name=None, width=None, supports_inbound_calling=None, url=None, height=None, local_vars_configuration=None): # noqa: E501 + def __init__( + self, + supports_custom_objects=None, + uses_remote=None, + is_ready=None, + name=None, + width=None, + uses_calling_window=None, + supports_inbound_calling=None, + url=None, + height=None, + local_vars_configuration=None, + ): # noqa: E501 """SettingsRequest - 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._supports_custom_objects = None + self._uses_remote = None self._is_ready = None self._name = None self._width = None + self._uses_calling_window = None self._supports_inbound_calling = None self._url = None self._height = None @@ -64,12 +90,17 @@ def __init__(self, supports_custom_objects=None, is_ready=None, name=None, width if supports_custom_objects is not None: self.supports_custom_objects = supports_custom_objects + if uses_remote is not None: + self.uses_remote = uses_remote if is_ready is not None: self.is_ready = is_ready self.name = name if width is not None: self.width = width - self.supports_inbound_calling = supports_inbound_calling + if uses_calling_window is not None: + self.uses_calling_window = uses_calling_window + if supports_inbound_calling is not None: + self.supports_inbound_calling = supports_inbound_calling self.url = url if height is not None: self.height = height @@ -78,7 +109,7 @@ def __init__(self, supports_custom_objects=None, is_ready=None, name=None, width def supports_custom_objects(self): """Gets the supports_custom_objects of this SettingsRequest. # noqa: E501 - When true, you are indicating that your service is compatible with engagement v2 service and can be used with custom objects. # noqa: E501 + When true, users will be able to click to dial from custom objects. # noqa: E501 :return: The supports_custom_objects of this SettingsRequest. # noqa: E501 :rtype: bool @@ -89,7 +120,7 @@ def supports_custom_objects(self): def supports_custom_objects(self, supports_custom_objects): """Sets the supports_custom_objects of this SettingsRequest. - When true, you are indicating that your service is compatible with engagement v2 service and can be used with custom objects. # noqa: E501 + When true, users will be able to click to dial from custom objects. # noqa: E501 :param supports_custom_objects: The supports_custom_objects of this SettingsRequest. # noqa: E501 :type supports_custom_objects: bool @@ -97,11 +128,34 @@ def supports_custom_objects(self, supports_custom_objects): self._supports_custom_objects = supports_custom_objects + @property + def uses_remote(self): + """Gets the uses_remote of this SettingsRequest. # noqa: E501 + + When false, this indicates that your calling app does not use the anchored calling remote within the HubSpot app. # noqa: E501 + + :return: The uses_remote of this SettingsRequest. # noqa: E501 + :rtype: bool + """ + return self._uses_remote + + @uses_remote.setter + def uses_remote(self, uses_remote): + """Sets the uses_remote of this SettingsRequest. + + When false, this indicates that your calling app does not use the anchored calling remote within the HubSpot app. # noqa: E501 + + :param uses_remote: The uses_remote of this SettingsRequest. # noqa: E501 + :type uses_remote: bool + """ + + self._uses_remote = uses_remote + @property def is_ready(self): """Gets the is_ready of this SettingsRequest. # noqa: E501 - When true, your service will appear as an option under the *Call* action in contact records of connected accounts. # noqa: E501 + When true, this indicates that your calling app is ready for production. Users will be able to select your calling app as their provider and can then click to dial within HubSpot. # noqa: E501 :return: The is_ready of this SettingsRequest. # noqa: E501 :rtype: bool @@ -112,7 +166,7 @@ def is_ready(self): def is_ready(self, is_ready): """Sets the is_ready of this SettingsRequest. - When true, your service will appear as an option under the *Call* action in contact records of connected accounts. # noqa: E501 + When true, this indicates that your calling app is ready for production. Users will be able to select your calling app as their provider and can then click to dial within HubSpot. # noqa: E501 :param is_ready: The is_ready of this SettingsRequest. # noqa: E501 :type is_ready: bool @@ -168,10 +222,34 @@ def width(self, width): self._width = width + @property + def uses_calling_window(self): + """Gets the uses_calling_window of this SettingsRequest. # noqa: E501 + + When false, this indicates that your calling app does not require the use of the separate calling window to hold the call connection. # noqa: E501 + + :return: The uses_calling_window of this SettingsRequest. # noqa: E501 + :rtype: bool + """ + return self._uses_calling_window + + @uses_calling_window.setter + def uses_calling_window(self, uses_calling_window): + """Sets the uses_calling_window of this SettingsRequest. + + When false, this indicates that your calling app does not require the use of the separate calling window to hold the call connection. # noqa: E501 + + :param uses_calling_window: The uses_calling_window of this SettingsRequest. # noqa: E501 + :type uses_calling_window: bool + """ + + self._uses_calling_window = uses_calling_window + @property def supports_inbound_calling(self): """Gets the supports_inbound_calling of this SettingsRequest. # noqa: E501 + When true, this indicates that your calling app supports inbound calling within HubSpot. # noqa: E501 :return: The supports_inbound_calling of this SettingsRequest. # noqa: E501 :rtype: bool @@ -182,12 +260,11 @@ def supports_inbound_calling(self): def supports_inbound_calling(self, supports_inbound_calling): """Sets the supports_inbound_calling of this SettingsRequest. + When true, this indicates that your calling app supports inbound calling within HubSpot. # noqa: E501 :param supports_inbound_calling: The supports_inbound_calling of this SettingsRequest. # noqa: E501 :type supports_inbound_calling: bool """ - if self.local_vars_configuration.client_side_validation and supports_inbound_calling is None: # noqa: E501 - raise ValueError("Invalid value for `supports_inbound_calling`, must not be `None`") # noqa: E501 self._supports_inbound_calling = supports_inbound_calling diff --git a/hubspot/crm/extensions/calling/models/settings_response.py b/hubspot/crm/extensions/calling/models/settings_response.py index b779bcd2..8a1a758c 100644 --- a/hubspot/crm/extensions/calling/models/settings_response.py +++ b/hubspot/crm/extensions/calling/models/settings_response.py @@ -38,9 +38,11 @@ class SettingsResponse(object): openapi_types = { "created_at": "datetime", "supports_custom_objects": "bool", + "uses_remote": "bool", "is_ready": "bool", "name": "str", "width": "int", + "uses_calling_window": "bool", "supports_inbound_calling": "bool", "url": "str", "height": "int", @@ -50,9 +52,11 @@ class SettingsResponse(object): attribute_map = { "created_at": "createdAt", "supports_custom_objects": "supportsCustomObjects", + "uses_remote": "usesRemote", "is_ready": "isReady", "name": "name", "width": "width", + "uses_calling_window": "usesCallingWindow", "supports_inbound_calling": "supportsInboundCalling", "url": "url", "height": "height", @@ -60,7 +64,19 @@ class SettingsResponse(object): } def __init__( - self, created_at=None, supports_custom_objects=None, is_ready=None, name=None, width=None, supports_inbound_calling=None, url=None, height=None, updated_at=None, local_vars_configuration=None + self, + created_at=None, + supports_custom_objects=None, + uses_remote=None, + is_ready=None, + name=None, + width=None, + uses_calling_window=None, + supports_inbound_calling=None, + url=None, + height=None, + updated_at=None, + local_vars_configuration=None, ): # noqa: E501 """SettingsResponse - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: @@ -69,9 +85,11 @@ def __init__( self._created_at = None self._supports_custom_objects = None + self._uses_remote = None self._is_ready = None self._name = None self._width = None + self._uses_calling_window = None self._supports_inbound_calling = None self._url = None self._height = None @@ -80,9 +98,11 @@ def __init__( self.created_at = created_at self.supports_custom_objects = supports_custom_objects + self.uses_remote = uses_remote self.is_ready = is_ready self.name = name self.width = width + self.uses_calling_window = uses_calling_window self.supports_inbound_calling = supports_inbound_calling self.url = url self.height = height @@ -117,7 +137,7 @@ def created_at(self, created_at): def supports_custom_objects(self): """Gets the supports_custom_objects of this SettingsResponse. # noqa: E501 - When true, you are indicating that your service is compatible with engagement v2 service and can be used with custom objects. # noqa: E501 + When true, users will be able to click to dial from custom objects. # noqa: E501 :return: The supports_custom_objects of this SettingsResponse. # noqa: E501 :rtype: bool @@ -128,7 +148,7 @@ def supports_custom_objects(self): def supports_custom_objects(self, supports_custom_objects): """Sets the supports_custom_objects of this SettingsResponse. - When true, you are indicating that your service is compatible with engagement v2 service and can be used with custom objects. # noqa: E501 + When true, users will be able to click to dial from custom objects. # noqa: E501 :param supports_custom_objects: The supports_custom_objects of this SettingsResponse. # noqa: E501 :type supports_custom_objects: bool @@ -138,11 +158,36 @@ def supports_custom_objects(self, supports_custom_objects): self._supports_custom_objects = supports_custom_objects + @property + def uses_remote(self): + """Gets the uses_remote of this SettingsResponse. # noqa: E501 + + When false, this indicates that your calling app does not use the anchored calling remote within the HubSpot app. # noqa: E501 + + :return: The uses_remote of this SettingsResponse. # noqa: E501 + :rtype: bool + """ + return self._uses_remote + + @uses_remote.setter + def uses_remote(self, uses_remote): + """Sets the uses_remote of this SettingsResponse. + + When false, this indicates that your calling app does not use the anchored calling remote within the HubSpot app. # noqa: E501 + + :param uses_remote: The uses_remote of this SettingsResponse. # noqa: E501 + :type uses_remote: bool + """ + if self.local_vars_configuration.client_side_validation and uses_remote is None: # noqa: E501 + raise ValueError("Invalid value for `uses_remote`, must not be `None`") # noqa: E501 + + self._uses_remote = uses_remote + @property def is_ready(self): """Gets the is_ready of this SettingsResponse. # noqa: E501 - When true, your service will appear as an option under the *Call* action in contact records of connected accounts. # noqa: E501 + When true, this indicates that your calling app is ready for production. Users will be able to select your calling app as their provider and can then click to dial within HubSpot. # noqa: E501 :return: The is_ready of this SettingsResponse. # noqa: E501 :rtype: bool @@ -153,7 +198,7 @@ def is_ready(self): def is_ready(self, is_ready): """Sets the is_ready of this SettingsResponse. - When true, your service will appear as an option under the *Call* action in contact records of connected accounts. # noqa: E501 + When true, this indicates that your calling app is ready for production. Users will be able to select your calling app as their provider and can then click to dial within HubSpot. # noqa: E501 :param is_ready: The is_ready of this SettingsResponse. # noqa: E501 :type is_ready: bool @@ -213,10 +258,36 @@ def width(self, width): self._width = width + @property + def uses_calling_window(self): + """Gets the uses_calling_window of this SettingsResponse. # noqa: E501 + + When false, this indicates that your calling app does not require the use of the separate calling window to hold the call connection. # noqa: E501 + + :return: The uses_calling_window of this SettingsResponse. # noqa: E501 + :rtype: bool + """ + return self._uses_calling_window + + @uses_calling_window.setter + def uses_calling_window(self, uses_calling_window): + """Sets the uses_calling_window of this SettingsResponse. + + When false, this indicates that your calling app does not require the use of the separate calling window to hold the call connection. # noqa: E501 + + :param uses_calling_window: The uses_calling_window of this SettingsResponse. # noqa: E501 + :type uses_calling_window: bool + """ + if self.local_vars_configuration.client_side_validation and uses_calling_window is None: # noqa: E501 + raise ValueError("Invalid value for `uses_calling_window`, must not be `None`") # noqa: E501 + + self._uses_calling_window = uses_calling_window + @property def supports_inbound_calling(self): """Gets the supports_inbound_calling of this SettingsResponse. # noqa: E501 + When true, this indicates that your calling app supports inbound calling within HubSpot. # noqa: E501 :return: The supports_inbound_calling of this SettingsResponse. # noqa: E501 :rtype: bool @@ -227,6 +298,7 @@ def supports_inbound_calling(self): def supports_inbound_calling(self, supports_inbound_calling): """Sets the supports_inbound_calling of this SettingsResponse. + When true, this indicates that your calling app supports inbound calling within HubSpot. # noqa: E501 :param supports_inbound_calling: The supports_inbound_calling of this SettingsResponse. # noqa: E501 :type supports_inbound_calling: bool From f09c65f5fc61411db571b7cbb494afb16708cc05 Mon Sep 17 00:00:00 2001 From: alexey Date: Wed, 2 Apr 2025 11:36:04 +0300 Subject: [PATCH 10/49] Codegen Events --- hubspot/events/__init__.py | 1 - hubspot/events/api/__init__.py | 1 - hubspot/events/api/events_api.py | 158 +++++++++++++++--- hubspot/events/send/__init__.py | 4 +- hubspot/events/send/api/__init__.py | 3 +- ...{custom_event_data_api.py => basic_api.py} | 10 +- .../default_api.py => send/api/batch_api.py} | 58 ++++--- hubspot/events/send/models/__init__.py | 1 + ...ehavioral_event_http_completion_request.py | 122 ++++++++++++++ ...ehavioral_event_http_completion_request.py | 26 +-- 10 files changed, 318 insertions(+), 66 deletions(-) rename hubspot/events/send/api/{custom_event_data_api.py => basic_api.py} (96%) rename hubspot/events/{api/default_api.py => send/api/batch_api.py} (66%) create mode 100644 hubspot/events/send/models/batched_behavioral_event_http_completion_request.py diff --git a/hubspot/events/__init__.py b/hubspot/events/__init__.py index f79c53a0..9ee1ab96 100644 --- a/hubspot/events/__init__.py +++ b/hubspot/events/__init__.py @@ -18,7 +18,6 @@ # import apis into sdk package from hubspot.events.api.events_api import EventsApi -from hubspot.events.api.default_api import DefaultApi # import ApiClient from hubspot.events.api_client import ApiClient diff --git a/hubspot/events/api/__init__.py b/hubspot/events/api/__init__.py index e2888c41..5f1979a6 100644 --- a/hubspot/events/api/__init__.py +++ b/hubspot/events/api/__init__.py @@ -4,4 +4,3 @@ # import apis into api package from hubspot.events.api.events_api import EventsApi -from hubspot.events.api.default_api import DefaultApi diff --git a/hubspot/events/api/events_api.py b/hubspot/events/api/events_api.py index 186a050c..4fe73806 100644 --- a/hubspot/events/api/events_api.py +++ b/hubspot/events/api/events_api.py @@ -34,18 +34,18 @@ def __init__(self, api_client=None): self.api_client = api_client def get_page(self, **kwargs): # noqa: E501 - """Event Instance Query # noqa: E501 + """Retrieve event data # noqa: E501 - This endpoint allows you to query for event instances using filter criteria. # noqa: E501 + Retrieve instances of event completion data. For example, retrieve all event completions associated with a specific contact. # 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 object_type: The CRM Object type name to filter event instances on. Optionally, you can also provide an objectId in another param to filter to a specific CRM Object instance. + :param object_type: The type of CRM object to filter event instances on (e.g., `contact`). To retrieve event data for a specific CRM record, include the additional `objectId` query parameter (below). :type object_type: str - :param event_type: The event type name. A list of available event type names can be obtained from another API call. + :param event_type: The event type name. You can retrieve available event types using the [event types endpoint](#get-%2Fevents%2Fv3%2Fevents%2Fevent-types). :type event_type: str :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 @@ -53,19 +53,19 @@ def get_page(self, **kwargs): # noqa: E501 :type before: str :param limit: The maximum number of results to display per page. :type limit: int - :param sort: Sort direction based on the timestamp of the event instance, ASCENDING or DESCENDING. + :param sort: Sort direction based on the timestamp of the event instance, `ASCENDING` or `DESCENDING`. :type sort: list[str] - :param occurred_after: + :param occurred_after: Filter for event data that occurred after a specific datetime. :type occurred_after: datetime - :param occurred_before: + :param occurred_before: Filter for event data that occurred before a specific datetime. :type occurred_before: datetime - :param object_id: The ID of the CRM Object to filter event instances on. If filtering on objectId, you must also provide an objectType. + :param object_id: The ID of the CRM Object to filter event instances on. When including this parameter, you must also include the `objectType` parameter. :type object_id: int - :param object_property_propname: + :param object_property_propname: Instead of retrieving event data for a specific object by its ID, you can specify a unique identifier property. For contacts, you can use the `email` property. (e.g., `objectProperty.email=name@domain.com`). :type object_property_propname: object - :param property_propname: + :param property_propname: Filter for event completions that contain a specific value for an event property (e.g., `property.hs_city=portland`). For properties values with spaces, replaces spaces with `%20` or `+` (e.g., `property.hs_city=new+york`). :type property_propname: object - :param id: ID of an event instance. IDs are 1:1 with event instances. If you. provide this filter and additional filters, the other filters must match the values on the event instance to yield results. + :param id: ID of an event instance. IDs are 1:1 with event instances. If you provide this filter and additional filters, the other filters must match the values on the event instance to yield results. :type id: list[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -86,18 +86,18 @@ def get_page(self, **kwargs): # noqa: E501 return self.get_page_with_http_info(**kwargs) # noqa: E501 def get_page_with_http_info(self, **kwargs): # noqa: E501 - """Event Instance Query # noqa: E501 + """Retrieve event data # noqa: E501 - This endpoint allows you to query for event instances using filter criteria. # noqa: E501 + Retrieve instances of event completion data. For example, retrieve all event completions associated with a specific contact. # 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 object_type: The CRM Object type name to filter event instances on. Optionally, you can also provide an objectId in another param to filter to a specific CRM Object instance. + :param object_type: The type of CRM object to filter event instances on (e.g., `contact`). To retrieve event data for a specific CRM record, include the additional `objectId` query parameter (below). :type object_type: str - :param event_type: The event type name. A list of available event type names can be obtained from another API call. + :param event_type: The event type name. You can retrieve available event types using the [event types endpoint](#get-%2Fevents%2Fv3%2Fevents%2Fevent-types). :type event_type: str :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 @@ -105,19 +105,19 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501 :type before: str :param limit: The maximum number of results to display per page. :type limit: int - :param sort: Sort direction based on the timestamp of the event instance, ASCENDING or DESCENDING. + :param sort: Sort direction based on the timestamp of the event instance, `ASCENDING` or `DESCENDING`. :type sort: list[str] - :param occurred_after: + :param occurred_after: Filter for event data that occurred after a specific datetime. :type occurred_after: datetime - :param occurred_before: + :param occurred_before: Filter for event data that occurred before a specific datetime. :type occurred_before: datetime - :param object_id: The ID of the CRM Object to filter event instances on. If filtering on objectId, you must also provide an objectType. + :param object_id: The ID of the CRM Object to filter event instances on. When including this parameter, you must also include the `objectType` parameter. :type object_id: int - :param object_property_propname: + :param object_property_propname: Instead of retrieving event data for a specific object by its ID, you can specify a unique identifier property. For contacts, you can use the `email` property. (e.g., `objectProperty.email=name@domain.com`). :type object_property_propname: object - :param property_propname: + :param property_propname: Filter for event completions that contain a specific value for an event property (e.g., `property.hs_city=portland`). For properties values with spaces, replaces spaces with `%20` or `+` (e.g., `property.hs_city=new+york`). :type property_propname: object - :param id: ID of an event instance. IDs are 1:1 with event instances. If you. provide this filter and additional filters, the other filters must match the values on the event instance to yield results. + :param id: ID of an event instance. IDs are 1:1 with event instances. If you provide this filter and additional filters, the other filters must match the values on the event instance to yield results. :type id: list[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -220,3 +220,117 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501 collection_formats=collection_formats, _request_auth=local_var_params.get("_request_auth"), ) + + def get_types(self, **kwargs): # noqa: E501 + """Event Types # noqa: E501 + + This endpoint returns a list of event type names which are visible to you. You may use these event type names to query the API for specific event instances of a desired type. # 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_types(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: VisibleExternalEventTypeNames + """ + kwargs["_return_http_data_only"] = True + return self.get_types_with_http_info(**kwargs) # noqa: E501 + + def get_types_with_http_info(self, **kwargs): # noqa: E501 + """Event Types # noqa: E501 + + This endpoint returns a list of event type names which are visible to you. You may use these event type names to query the API for specific event instances of a desired type. # 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_types_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(VisibleExternalEventTypeNames, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_types" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get("_headers", {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 200: "VisibleExternalEventTypeNames", + } + + return self.api_client.call_api( + "/events/v3/events/event-types", + "GET", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + _request_auth=local_var_params.get("_request_auth"), + ) diff --git a/hubspot/events/send/__init__.py b/hubspot/events/send/__init__.py index b27cabee..ed5f86da 100644 --- a/hubspot/events/send/__init__.py +++ b/hubspot/events/send/__init__.py @@ -17,7 +17,8 @@ __version__ = "1.0.0" # import apis into sdk package -from hubspot.events.send.api.custom_event_data_api import CustomEventDataApi +from hubspot.events.send.api.basic_api import BasicApi +from hubspot.events.send.api.batch_api import BatchApi # import ApiClient from hubspot.events.send.api_client import ApiClient @@ -30,6 +31,7 @@ from hubspot.events.send.exceptions import ApiException # import models into sdk package +from hubspot.events.send.models.batched_behavioral_event_http_completion_request import BatchedBehavioralEventHttpCompletionRequest from hubspot.events.send.models.behavioral_event_http_completion_request import BehavioralEventHttpCompletionRequest from hubspot.events.send.models.error import Error from hubspot.events.send.models.error_detail import ErrorDetail diff --git a/hubspot/events/send/api/__init__.py b/hubspot/events/send/api/__init__.py index 6f85894a..1548906a 100644 --- a/hubspot/events/send/api/__init__.py +++ b/hubspot/events/send/api/__init__.py @@ -3,4 +3,5 @@ # flake8: noqa # import apis into api package -from hubspot.events.send.api.custom_event_data_api import CustomEventDataApi +from hubspot.events.send.api.basic_api import BasicApi +from hubspot.events.send.api.batch_api import BatchApi diff --git a/hubspot/events/send/api/custom_event_data_api.py b/hubspot/events/send/api/basic_api.py similarity index 96% rename from hubspot/events/send/api/custom_event_data_api.py rename to hubspot/events/send/api/basic_api.py index a60a12b8..45606b17 100644 --- a/hubspot/events/send/api/custom_event_data_api.py +++ b/hubspot/events/send/api/basic_api.py @@ -21,7 +21,7 @@ from hubspot.events.send.exceptions import ApiTypeError, ApiValueError # noqa: F401 -class CustomEventDataApi(object): +class BasicApi(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -34,9 +34,9 @@ def __init__(self, api_client=None): self.api_client = api_client def send(self, behavioral_event_http_completion_request, **kwargs): # noqa: E501 - """Send custom event completion # noqa: E501 + """Send a custom event completion # noqa: E501 - Endpoint to send an instance of a custom event. # noqa: E501 + Send data for a single event completion. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -64,9 +64,9 @@ def send(self, behavioral_event_http_completion_request, **kwargs): # noqa: E50 return self.send_with_http_info(behavioral_event_http_completion_request, **kwargs) # noqa: E501 def send_with_http_info(self, behavioral_event_http_completion_request, **kwargs): # noqa: E501 - """Send custom event completion # noqa: E501 + """Send a custom event completion # noqa: E501 - Endpoint to send an instance of a custom event. # noqa: E501 + Send data for a single event completion. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/events/api/default_api.py b/hubspot/events/send/api/batch_api.py similarity index 66% rename from hubspot/events/api/default_api.py rename to hubspot/events/send/api/batch_api.py index d01cc266..a83424cc 100644 --- a/hubspot/events/api/default_api.py +++ b/hubspot/events/send/api/batch_api.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Events Events + Events Send Event Completions No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 @@ -17,11 +17,11 @@ # python 2 and python 3 compatibility library import six -from hubspot.events.api_client import ApiClient -from hubspot.events.exceptions import ApiTypeError, ApiValueError # noqa: F401 +from hubspot.events.send.api_client import ApiClient +from hubspot.events.send.exceptions import ApiTypeError, ApiValueError # noqa: F401 -class DefaultApi(object): +class BatchApi(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -33,16 +33,18 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def get_all(self, **kwargs): # noqa: E501 - """Event Types # noqa: E501 + def send(self, batched_behavioral_event_http_completion_request, **kwargs): # noqa: E501 + """Send a batch of event completions # noqa: E501 - This endpoint returns a list of event type names which are visible to you. You may use these event type names to query the API for specific event instances of a desired type. # noqa: E501 + Send multiple event completions at once. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_all(async_req=True) + >>> thread = api.send(batched_behavioral_event_http_completion_request, async_req=True) >>> result = thread.get() + :param batched_behavioral_event_http_completion_request: (required) + :type batched_behavioral_event_http_completion_request: BatchedBehavioralEventHttpCompletionRequest :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -56,21 +58,23 @@ def get_all(self, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: VisibleExternalEventTypeNames + :rtype: None """ kwargs["_return_http_data_only"] = True - return self.get_all_with_http_info(**kwargs) # noqa: E501 + return self.send_with_http_info(batched_behavioral_event_http_completion_request, **kwargs) # noqa: E501 - def get_all_with_http_info(self, **kwargs): # noqa: E501 - """Event Types # noqa: E501 + def send_with_http_info(self, batched_behavioral_event_http_completion_request, **kwargs): # noqa: E501 + """Send a batch of event completions # noqa: E501 - This endpoint returns a list of event type names which are visible to you. You may use these event type names to query the API for specific event instances of a desired type. # noqa: E501 + Send multiple event completions at once. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_all_with_http_info(async_req=True) + >>> thread = api.send_with_http_info(batched_behavioral_event_http_completion_request, async_req=True) >>> result = thread.get() + :param batched_behavioral_event_http_completion_request: (required) + :type batched_behavioral_event_http_completion_request: BatchedBehavioralEventHttpCompletionRequest :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 @@ -92,19 +96,22 @@ def get_all_with_http_info(self, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(VisibleExternalEventTypeNames, status_code(int), headers(HTTPHeaderDict)) + :rtype: None """ local_var_params = locals() - all_params = [] + all_params = ["batched_behavioral_event_http_completion_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 get_all" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method send" % key) local_var_params[key] = val del local_var_params["kwargs"] + # verify the required parameter 'batched_behavioral_event_http_completion_request' is set + if self.api_client.client_side_validation and local_var_params.get("batched_behavioral_event_http_completion_request") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batched_behavioral_event_http_completion_request` when calling `send`") # noqa: E501 collection_formats = {} @@ -118,19 +125,24 @@ def get_all_with_http_info(self, **kwargs): # noqa: E501 local_var_files = {} body_params = None + if "batched_behavioral_event_http_completion_request" in local_var_params: + body_params = local_var_params["batched_behavioral_event_http_completion_request"] # HTTP header `Accept` - header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) # noqa: E501 + + # 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: "VisibleExternalEventTypeNames", - } + response_types_map = {} return self.api_client.call_api( - "/events/v3/events/event-types", - "GET", + "/events/v3/send/batch", + "POST", path_params, query_params, header_params, diff --git a/hubspot/events/send/models/__init__.py b/hubspot/events/send/models/__init__.py index 9c98d89d..b6daacec 100644 --- a/hubspot/events/send/models/__init__.py +++ b/hubspot/events/send/models/__init__.py @@ -14,6 +14,7 @@ from __future__ import absolute_import # import models into model package +from hubspot.events.send.models.batched_behavioral_event_http_completion_request import BatchedBehavioralEventHttpCompletionRequest from hubspot.events.send.models.behavioral_event_http_completion_request import BehavioralEventHttpCompletionRequest from hubspot.events.send.models.error import Error from hubspot.events.send.models.error_detail import ErrorDetail diff --git a/hubspot/events/send/models/batched_behavioral_event_http_completion_request.py b/hubspot/events/send/models/batched_behavioral_event_http_completion_request.py new file mode 100644 index 00000000..6b15b905 --- /dev/null +++ b/hubspot/events/send/models/batched_behavioral_event_http_completion_request.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Events Send Event Completions + + 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.events.send.configuration import Configuration + + +class BatchedBehavioralEventHttpCompletionRequest(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[BehavioralEventHttpCompletionRequest]"} + + attribute_map = {"inputs": "inputs"} + + def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 + """BatchedBehavioralEventHttpCompletionRequest - 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 BatchedBehavioralEventHttpCompletionRequest. # noqa: E501 + + + :return: The inputs of this BatchedBehavioralEventHttpCompletionRequest. # noqa: E501 + :rtype: list[BehavioralEventHttpCompletionRequest] + """ + return self._inputs + + @inputs.setter + def inputs(self, inputs): + """Sets the inputs of this BatchedBehavioralEventHttpCompletionRequest. + + + :param inputs: The inputs of this BatchedBehavioralEventHttpCompletionRequest. # noqa: E501 + :type inputs: list[BehavioralEventHttpCompletionRequest] + """ + 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, BatchedBehavioralEventHttpCompletionRequest): + 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, BatchedBehavioralEventHttpCompletionRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/events/send/models/behavioral_event_http_completion_request.py b/hubspot/events/send/models/behavioral_event_http_completion_request.py index fad777f1..34d3f451 100644 --- a/hubspot/events/send/models/behavioral_event_http_completion_request.py +++ b/hubspot/events/send/models/behavioral_event_http_completion_request.py @@ -72,7 +72,7 @@ def __init__(self, occurred_at=None, event_name=None, utk=None, uuid=None, email def occurred_at(self): """Gets the occurred_at of this BehavioralEventHttpCompletionRequest. # noqa: E501 - The time when this event occurred (if any). If this isn't set, the current time will be used # noqa: E501 + The time when this event occurred. If this isn't set, the current time will be used. # noqa: E501 :return: The occurred_at of this BehavioralEventHttpCompletionRequest. # noqa: E501 :rtype: datetime @@ -83,7 +83,7 @@ def occurred_at(self): def occurred_at(self, occurred_at): """Sets the occurred_at of this BehavioralEventHttpCompletionRequest. - The time when this event occurred (if any). If this isn't set, the current time will be used # noqa: E501 + The time when this event occurred. If this isn't set, the current time will be used. # noqa: E501 :param occurred_at: The occurred_at of this BehavioralEventHttpCompletionRequest. # noqa: E501 :type occurred_at: datetime @@ -95,7 +95,7 @@ def occurred_at(self, occurred_at): def event_name(self): """Gets the event_name of this BehavioralEventHttpCompletionRequest. # noqa: E501 - Internal name of the event-type to trigger # noqa: E501 + The internal name of the event (`pe_eventName`). Can be retrieved through the [event definitions API](https://developers.hubspot.com/docs/reference/api/analytics-and-events/custom-events/custom-event-definitions#get-%2Fevents%2Fv3%2Fevent-definitions) or in [HubSpot's UI](https://knowledge.hubspot.com/reports/create-custom-behavioral-events-with-the-code-wizard#find-internal-name). # noqa: E501 :return: The event_name of this BehavioralEventHttpCompletionRequest. # noqa: E501 :rtype: str @@ -106,7 +106,7 @@ def event_name(self): def event_name(self, event_name): """Sets the event_name of this BehavioralEventHttpCompletionRequest. - Internal name of the event-type to trigger # noqa: E501 + The internal name of the event (`pe_eventName`). Can be retrieved through the [event definitions API](https://developers.hubspot.com/docs/reference/api/analytics-and-events/custom-events/custom-event-definitions#get-%2Fevents%2Fv3%2Fevent-definitions) or in [HubSpot's UI](https://knowledge.hubspot.com/reports/create-custom-behavioral-events-with-the-code-wizard#find-internal-name). # noqa: E501 :param event_name: The event_name of this BehavioralEventHttpCompletionRequest. # noqa: E501 :type event_name: str @@ -120,7 +120,7 @@ def event_name(self, event_name): def utk(self): """Gets the utk of this BehavioralEventHttpCompletionRequest. # noqa: E501 - User token # noqa: E501 + The visitor's usertoken. Used for associating the event data with a CRM record. # noqa: E501 :return: The utk of this BehavioralEventHttpCompletionRequest. # noqa: E501 :rtype: str @@ -131,7 +131,7 @@ def utk(self): def utk(self, utk): """Sets the utk of this BehavioralEventHttpCompletionRequest. - User token # noqa: E501 + The visitor's usertoken. Used for associating the event data with a CRM record. # noqa: E501 :param utk: The utk of this BehavioralEventHttpCompletionRequest. # noqa: E501 :type utk: str @@ -143,6 +143,7 @@ def utk(self, utk): def uuid(self): """Gets the uuid of this BehavioralEventHttpCompletionRequest. # noqa: E501 + Include a universally unique identifier to assign a unique ID to the event completion. Can be useful for matching data between HubSpot and other external systems. # noqa: E501 :return: The uuid of this BehavioralEventHttpCompletionRequest. # noqa: E501 :rtype: str @@ -153,6 +154,7 @@ def uuid(self): def uuid(self, uuid): """Sets the uuid of this BehavioralEventHttpCompletionRequest. + Include a universally unique identifier to assign a unique ID to the event completion. Can be useful for matching data between HubSpot and other external systems. # noqa: E501 :param uuid: The uuid of this BehavioralEventHttpCompletionRequest. # noqa: E501 :type uuid: str @@ -164,7 +166,7 @@ def uuid(self, uuid): def email(self): """Gets the email of this BehavioralEventHttpCompletionRequest. # noqa: E501 - Email of visitor # noqa: E501 + The visitor's email address. Used for associating the event data with a CRM record. # noqa: E501 :return: The email of this BehavioralEventHttpCompletionRequest. # noqa: E501 :rtype: str @@ -175,7 +177,7 @@ def email(self): def email(self, email): """Sets the email of this BehavioralEventHttpCompletionRequest. - Email of visitor # noqa: E501 + The visitor's email address. Used for associating the event data with a CRM record. # noqa: E501 :param email: The email of this BehavioralEventHttpCompletionRequest. # noqa: E501 :type email: str @@ -187,7 +189,7 @@ def email(self, email): def properties(self): """Gets the properties of this BehavioralEventHttpCompletionRequest. # noqa: E501 - Map of properties for the event in the format property internal name - property value # noqa: E501 + The event properties to update. Takes the format of key-value pairs (property internal name and property value). Learn more about [HubSpot's default event properties](https://developers.hubspot.com/docs/guides/api/analytics-and-events/custom-events/custom-event-definitions#hubspot-s-default-event-properties). # noqa: E501 :return: The properties of this BehavioralEventHttpCompletionRequest. # noqa: E501 :rtype: dict[str, str] @@ -198,7 +200,7 @@ def properties(self): def properties(self, properties): """Sets the properties of this BehavioralEventHttpCompletionRequest. - Map of properties for the event in the format property internal name - property value # noqa: E501 + The event properties to update. Takes the format of key-value pairs (property internal name and property value). Learn more about [HubSpot's default event properties](https://developers.hubspot.com/docs/guides/api/analytics-and-events/custom-events/custom-event-definitions#hubspot-s-default-event-properties). # noqa: E501 :param properties: The properties of this BehavioralEventHttpCompletionRequest. # noqa: E501 :type properties: dict[str, str] @@ -210,7 +212,7 @@ def properties(self, properties): def object_id(self): """Gets the object_id of this BehavioralEventHttpCompletionRequest. # noqa: E501 - The object id that this event occurred on. Could be a contact id or a visitor id. # noqa: E501 + The ID of the object that completed the event (e.g., contact ID or visitor ID). # noqa: E501 :return: The object_id of this BehavioralEventHttpCompletionRequest. # noqa: E501 :rtype: str @@ -221,7 +223,7 @@ def object_id(self): def object_id(self, object_id): """Sets the object_id of this BehavioralEventHttpCompletionRequest. - The object id that this event occurred on. Could be a contact id or a visitor id. # noqa: E501 + The ID of the object that completed the event (e.g., contact ID or visitor ID). # noqa: E501 :param object_id: The object_id of this BehavioralEventHttpCompletionRequest. # noqa: E501 :type object_id: str From 1e665cb5dc42c4a79d4315dd8e60f48c7e5b7efe Mon Sep 17 00:00:00 2001 From: alexey Date: Thu, 3 Apr 2025 10:53:50 +0300 Subject: [PATCH 11/49] Codegen Crm Imports --- hubspot/crm/imports/__init__.py | 1 + hubspot/crm/imports/api/core_api.py | 8 +- hubspot/crm/imports/api/public_imports_api.py | 14 +- hubspot/crm/imports/models/__init__.py | 1 + hubspot/crm/imports/models/import_row_core.py | 31 +- hubspot/crm/imports/models/property_value.py | 704 ++++++++++++++++++ .../crm/imports/models/public_import_error.py | 105 ++- .../imports/models/public_import_response.py | 28 + 8 files changed, 883 insertions(+), 9 deletions(-) create mode 100644 hubspot/crm/imports/models/property_value.py diff --git a/hubspot/crm/imports/__init__.py b/hubspot/crm/imports/__init__.py index 4e8672e8..420b9b57 100644 --- a/hubspot/crm/imports/__init__.py +++ b/hubspot/crm/imports/__init__.py @@ -42,6 +42,7 @@ from hubspot.crm.imports.models.next_page import NextPage from hubspot.crm.imports.models.paging import Paging from hubspot.crm.imports.models.previous_page import PreviousPage +from hubspot.crm.imports.models.property_value import PropertyValue from hubspot.crm.imports.models.public_import_error import PublicImportError from hubspot.crm.imports.models.public_import_metadata import PublicImportMetadata from hubspot.crm.imports.models.public_import_response import PublicImportResponse diff --git a/hubspot/crm/imports/api/core_api.py b/hubspot/crm/imports/api/core_api.py index 2ecd4081..313f9ba8 100644 --- a/hubspot/crm/imports/api/core_api.py +++ b/hubspot/crm/imports/api/core_api.py @@ -166,9 +166,9 @@ def create(self, **kwargs): # noqa: E501 >>> thread = api.create(async_req=True) >>> result = thread.get() - :param files: A list of files containing the data to import + :param files: :type files: file - :param import_request: JSON formatted metadata about the import. This includes a name for the import and the column mappings for each file. See the overview tab for more on the required format. + :param import_request: :type import_request: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -198,9 +198,9 @@ def create_with_http_info(self, **kwargs): # noqa: E501 >>> thread = api.create_with_http_info(async_req=True) >>> result = thread.get() - :param files: A list of files containing the data to import + :param files: :type files: file - :param import_request: JSON formatted metadata about the import. This includes a name for the import and the column mappings for each file. See the overview tab for more on the required format. + :param import_request: :type import_request: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional diff --git a/hubspot/crm/imports/api/public_imports_api.py b/hubspot/crm/imports/api/public_imports_api.py index 3da0cede..aebdbb2c 100644 --- a/hubspot/crm/imports/api/public_imports_api.py +++ b/hubspot/crm/imports/api/public_imports_api.py @@ -48,6 +48,10 @@ def get_errors(self, import_id, **kwargs): # noqa: E501 :type after: str :param limit: The maximum number of results to display per page. :type limit: int + :param include_error_message: Set to True to receive a message explaining the error. + :type include_error_message: bool + :param include_row_data: Set to True to receive the data values for the errored row. + :type include_row_data: 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 @@ -81,6 +85,10 @@ def get_errors_with_http_info(self, import_id, **kwargs): # noqa: E501 :type after: str :param limit: The maximum number of results to display per page. :type limit: int + :param include_error_message: Set to True to receive a message explaining the error. + :type include_error_message: bool + :param include_row_data: Set to True to receive the data values for the errored row. + :type include_row_data: 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 @@ -107,7 +115,7 @@ def get_errors_with_http_info(self, import_id, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ["import_id", "after", "limit"] + all_params = ["import_id", "after", "limit", "include_error_message", "include_row_data"] 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"]): @@ -130,6 +138,10 @@ def get_errors_with_http_info(self, import_id, **kwargs): # noqa: E501 query_params.append(("after", local_var_params["after"])) # noqa: E501 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("include_error_message") is not None: # noqa: E501 + query_params.append(("includeErrorMessage", local_var_params["include_error_message"])) # noqa: E501 + if local_var_params.get("include_row_data") is not None: # noqa: E501 + query_params.append(("includeRowData", local_var_params["include_row_data"])) # noqa: E501 header_params = dict(local_var_params.get("_headers", {})) diff --git a/hubspot/crm/imports/models/__init__.py b/hubspot/crm/imports/models/__init__.py index a9711056..e5d672ea 100644 --- a/hubspot/crm/imports/models/__init__.py +++ b/hubspot/crm/imports/models/__init__.py @@ -25,6 +25,7 @@ from hubspot.crm.imports.models.next_page import NextPage from hubspot.crm.imports.models.paging import Paging from hubspot.crm.imports.models.previous_page import PreviousPage +from hubspot.crm.imports.models.property_value import PropertyValue from hubspot.crm.imports.models.public_import_error import PublicImportError from hubspot.crm.imports.models.public_import_metadata import PublicImportMetadata from hubspot.crm.imports.models.public_import_response import PublicImportResponse diff --git a/hubspot/crm/imports/models/import_row_core.py b/hubspot/crm/imports/models/import_row_core.py index 56e1bc4d..6c2b2d35 100644 --- a/hubspot/crm/imports/models/import_row_core.py +++ b/hubspot/crm/imports/models/import_row_core.py @@ -35,23 +35,25 @@ class ImportRowCore(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"row_data": "list[str]", "line_number": "int", "page_name": "str", "file_id": "int"} + openapi_types = {"row_data": "list[str]", "contains_encrypted_properties": "bool", "line_number": "int", "page_name": "str", "file_id": "int"} - attribute_map = {"row_data": "rowData", "line_number": "lineNumber", "page_name": "pageName", "file_id": "fileId"} + attribute_map = {"row_data": "rowData", "contains_encrypted_properties": "containsEncryptedProperties", "line_number": "lineNumber", "page_name": "pageName", "file_id": "fileId"} - def __init__(self, row_data=None, line_number=None, page_name=None, file_id=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, row_data=None, contains_encrypted_properties=None, line_number=None, page_name=None, file_id=None, local_vars_configuration=None): # noqa: E501 """ImportRowCore - 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._row_data = None + self._contains_encrypted_properties = None self._line_number = None self._page_name = None self._file_id = None self.discriminator = None self.row_data = row_data + self.contains_encrypted_properties = contains_encrypted_properties self.line_number = line_number if page_name is not None: self.page_name = page_name @@ -80,6 +82,29 @@ def row_data(self, row_data): self._row_data = row_data + @property + def contains_encrypted_properties(self): + """Gets the contains_encrypted_properties of this ImportRowCore. # noqa: E501 + + + :return: The contains_encrypted_properties of this ImportRowCore. # noqa: E501 + :rtype: bool + """ + return self._contains_encrypted_properties + + @contains_encrypted_properties.setter + def contains_encrypted_properties(self, contains_encrypted_properties): + """Sets the contains_encrypted_properties of this ImportRowCore. + + + :param contains_encrypted_properties: The contains_encrypted_properties of this ImportRowCore. # noqa: E501 + :type contains_encrypted_properties: bool + """ + if self.local_vars_configuration.client_side_validation and contains_encrypted_properties is None: # noqa: E501 + raise ValueError("Invalid value for `contains_encrypted_properties`, must not be `None`") # noqa: E501 + + self._contains_encrypted_properties = contains_encrypted_properties + @property def line_number(self): """Gets the line_number of this ImportRowCore. # noqa: E501 diff --git a/hubspot/crm/imports/models/property_value.py b/hubspot/crm/imports/models/property_value.py new file mode 100644 index 00000000..73561629 --- /dev/null +++ b/hubspot/crm/imports/models/property_value.py @@ -0,0 +1,704 @@ +# coding: utf-8 + +""" + Imports + + 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.imports.configuration import Configuration + + +class PropertyValue(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", + "selected_by_user": "bool", + "source_label": "str", + "source": "str", + "updated_by_user_id": "int", + "persistence_timestamp": "int", + "source_metadata": "str", + "data_sensitivity": "str", + "source_vid": "list[int]", + "unit": "str", + "request_id": "str", + "is_encrypted": "bool", + "name": "str", + "use_timestamp_as_persistence_timestamp": "bool", + "value": "str", + "selected_by_user_timestamp": "int", + "timestamp": "int", + "is_large_value": "bool", + } + + attribute_map = { + "source_id": "sourceId", + "selected_by_user": "selectedByUser", + "source_label": "sourceLabel", + "source": "source", + "updated_by_user_id": "updatedByUserId", + "persistence_timestamp": "persistenceTimestamp", + "source_metadata": "sourceMetadata", + "data_sensitivity": "dataSensitivity", + "source_vid": "sourceVid", + "unit": "unit", + "request_id": "requestId", + "is_encrypted": "isEncrypted", + "name": "name", + "use_timestamp_as_persistence_timestamp": "useTimestampAsPersistenceTimestamp", + "value": "value", + "selected_by_user_timestamp": "selectedByUserTimestamp", + "timestamp": "timestamp", + "is_large_value": "isLargeValue", + } + + def __init__( + self, + source_id=None, + selected_by_user=None, + source_label=None, + source=None, + updated_by_user_id=None, + persistence_timestamp=None, + source_metadata=None, + data_sensitivity=None, + source_vid=None, + unit=None, + request_id=None, + is_encrypted=None, + name=None, + use_timestamp_as_persistence_timestamp=None, + value=None, + selected_by_user_timestamp=None, + timestamp=None, + is_large_value=None, + local_vars_configuration=None, + ): # noqa: E501 + """PropertyValue - 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._selected_by_user = None + self._source_label = None + self._source = None + self._updated_by_user_id = None + self._persistence_timestamp = None + self._source_metadata = None + self._data_sensitivity = None + self._source_vid = None + self._unit = None + self._request_id = None + self._is_encrypted = None + self._name = None + self._use_timestamp_as_persistence_timestamp = None + self._value = None + self._selected_by_user_timestamp = None + self._timestamp = None + self._is_large_value = None + self.discriminator = None + + self.source_id = source_id + self.selected_by_user = selected_by_user + self.source_label = source_label + self.source = source + self.updated_by_user_id = updated_by_user_id + self.persistence_timestamp = persistence_timestamp + self.source_metadata = source_metadata + self.data_sensitivity = data_sensitivity + self.source_vid = source_vid + self.unit = unit + self.request_id = request_id + self.is_encrypted = is_encrypted + self.name = name + self.use_timestamp_as_persistence_timestamp = use_timestamp_as_persistence_timestamp + self.value = value + self.selected_by_user_timestamp = selected_by_user_timestamp + self.timestamp = timestamp + self.is_large_value = is_large_value + + @property + def source_id(self): + """Gets the source_id of this PropertyValue. # noqa: E501 + + + :return: The source_id of this PropertyValue. # noqa: E501 + :rtype: str + """ + return self._source_id + + @source_id.setter + def source_id(self, source_id): + """Sets the source_id of this PropertyValue. + + + :param source_id: The source_id of this PropertyValue. # noqa: E501 + :type source_id: str + """ + if self.local_vars_configuration.client_side_validation and source_id is None: # noqa: E501 + raise ValueError("Invalid value for `source_id`, must not be `None`") # noqa: E501 + + self._source_id = source_id + + @property + def selected_by_user(self): + """Gets the selected_by_user of this PropertyValue. # noqa: E501 + + + :return: The selected_by_user of this PropertyValue. # noqa: E501 + :rtype: bool + """ + return self._selected_by_user + + @selected_by_user.setter + def selected_by_user(self, selected_by_user): + """Sets the selected_by_user of this PropertyValue. + + + :param selected_by_user: The selected_by_user of this PropertyValue. # noqa: E501 + :type selected_by_user: bool + """ + if self.local_vars_configuration.client_side_validation and selected_by_user is None: # noqa: E501 + raise ValueError("Invalid value for `selected_by_user`, must not be `None`") # noqa: E501 + + self._selected_by_user = selected_by_user + + @property + def source_label(self): + """Gets the source_label of this PropertyValue. # noqa: E501 + + + :return: The source_label of this PropertyValue. # noqa: E501 + :rtype: str + """ + return self._source_label + + @source_label.setter + def source_label(self, source_label): + """Sets the source_label of this PropertyValue. + + + :param source_label: The source_label of this PropertyValue. # noqa: E501 + :type source_label: str + """ + if self.local_vars_configuration.client_side_validation and source_label is None: # noqa: E501 + raise ValueError("Invalid value for `source_label`, must not be `None`") # noqa: E501 + + self._source_label = source_label + + @property + def source(self): + """Gets the source of this PropertyValue. # noqa: E501 + + + :return: The source of this PropertyValue. # noqa: E501 + :rtype: str + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this PropertyValue. + + + :param source: The source of this PropertyValue. # noqa: E501 + :type source: str + """ + if self.local_vars_configuration.client_side_validation and source is None: # noqa: E501 + raise ValueError("Invalid value for `source`, must not be `None`") # noqa: E501 + allowed_values = [ + "UNKNOWN", + "IMPORT", + "API", + "FORM", + "ANALYTICS", + "MIGRATION", + "SALESFORCE", + "INTEGRATION", + "CONTACTS_WEB", + "WAL_INCREMENTAL", + "TASK", + "EMAIL", + "WORKFLOWS", + "CALCULATED", + "SOCIAL", + "BATCH_UPDATE", + "SIGNALS", + "BIDEN", + "DEFAULT", + "COMPANIES", + "DEALS", + "ASSISTS", + "PRESENTATIONS", + "TALLY", + "SIDEKICK", + "CRM_UI", + "MERGE_CONTACTS", + "PORTAL_USER_ASSOCIATOR", + "INTEGRATIONS_PLATFORM", + "BCC_TO_CRM", + "FORWARD_TO_CRM", + "ENGAGEMENTS", + "SALES", + "HEISENBERG", + "LEADIN", + "GMAIL_INTEGRATION", + "ACADEMY", + "SALES_MESSAGES", + "AVATARS_SERVICE", + "MERGE_COMPANIES", + "SEQUENCES", + "COMPANY_FAMILIES", + "MOBILE_IOS", + "MOBILE_ANDROID", + "CONTACTS", + "ASSOCIATIONS", + "EXTENSION", + "SUCCESS", + "BOT", + "INTEGRATIONS_SYNC", + "AUTOMATION_PLATFORM", + "CONVERSATIONS", + "EMAIL_INTEGRATION", + "CONTENT_MEMBERSHIP", + "QUOTES", + "BET_ASSIGNMENT", + "QUOTAS", + "BET_CRM_CONNECTOR", + "MEETINGS", + "MERGE_OBJECTS", + "RECYCLING_BIN", + "ADS", + "AI_GROUP", + "COMMUNICATOR", + "SETTINGS", + "PROPERTY_SETTINGS", + "PIPELINE_SETTINGS", + "COMPANY_INSIGHTS", + "BEHAVIORAL_EVENTS", + "PAYMENTS", + "GOALS", + "PORTAL_OBJECT_SYNC", + "APPROVALS", + "FILE_MANAGER", + "MARKETPLACE", + "INTERNAL_PROCESSING", + "FORECASTING", + "SLACK_INTEGRATION", + "CRM_UI_BULK_ACTION", + "WORKFLOW_CONTACT_DELETE_ACTION", + "ACCEPTANCE_TEST", + "PLAYBOOKS", + "CHATSPOT", + "FLYWHEEL_PRODUCT_DATA_SYNC", + "HELP_DESK", + "BILLING", + "DATA_ENRICHMENT", + "AUTOMATION_JOURNEY", + "MICROAPPS", + "INTENT", + "PROSPECTING_AGENT", + ] # noqa: E501 + if self.local_vars_configuration.client_side_validation and source not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `source` ({0}), must be one of {1}".format(source, allowed_values)) # noqa: E501 + + self._source = source + + @property + def updated_by_user_id(self): + """Gets the updated_by_user_id of this PropertyValue. # noqa: E501 + + + :return: The updated_by_user_id of this PropertyValue. # 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 PropertyValue. + + + :param updated_by_user_id: The updated_by_user_id of this PropertyValue. # noqa: E501 + :type updated_by_user_id: int + """ + if self.local_vars_configuration.client_side_validation and updated_by_user_id is None: # noqa: E501 + raise ValueError("Invalid value for `updated_by_user_id`, must not be `None`") # noqa: E501 + + self._updated_by_user_id = updated_by_user_id + + @property + def persistence_timestamp(self): + """Gets the persistence_timestamp of this PropertyValue. # noqa: E501 + + + :return: The persistence_timestamp of this PropertyValue. # noqa: E501 + :rtype: int + """ + return self._persistence_timestamp + + @persistence_timestamp.setter + def persistence_timestamp(self, persistence_timestamp): + """Sets the persistence_timestamp of this PropertyValue. + + + :param persistence_timestamp: The persistence_timestamp of this PropertyValue. # noqa: E501 + :type persistence_timestamp: int + """ + if self.local_vars_configuration.client_side_validation and persistence_timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `persistence_timestamp`, must not be `None`") # noqa: E501 + + self._persistence_timestamp = persistence_timestamp + + @property + def source_metadata(self): + """Gets the source_metadata of this PropertyValue. # noqa: E501 + + + :return: The source_metadata of this PropertyValue. # noqa: E501 + :rtype: str + """ + return self._source_metadata + + @source_metadata.setter + def source_metadata(self, source_metadata): + """Sets the source_metadata of this PropertyValue. + + + :param source_metadata: The source_metadata of this PropertyValue. # noqa: E501 + :type source_metadata: str + """ + if self.local_vars_configuration.client_side_validation and source_metadata is None: # noqa: E501 + raise ValueError("Invalid value for `source_metadata`, must not be `None`") # noqa: E501 + + self._source_metadata = source_metadata + + @property + def data_sensitivity(self): + """Gets the data_sensitivity of this PropertyValue. # noqa: E501 + + + :return: The data_sensitivity of this PropertyValue. # noqa: E501 + :rtype: str + """ + return self._data_sensitivity + + @data_sensitivity.setter + def data_sensitivity(self, data_sensitivity): + """Sets the data_sensitivity of this PropertyValue. + + + :param data_sensitivity: The data_sensitivity of this PropertyValue. # noqa: E501 + :type data_sensitivity: str + """ + if self.local_vars_configuration.client_side_validation and data_sensitivity is None: # noqa: E501 + raise ValueError("Invalid value for `data_sensitivity`, must not be `None`") # noqa: E501 + allowed_values = ["none", "standard", "high"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and data_sensitivity not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `data_sensitivity` ({0}), must be one of {1}".format(data_sensitivity, allowed_values)) # noqa: E501 + + self._data_sensitivity = data_sensitivity + + @property + def source_vid(self): + """Gets the source_vid of this PropertyValue. # noqa: E501 + + + :return: The source_vid of this PropertyValue. # noqa: E501 + :rtype: list[int] + """ + return self._source_vid + + @source_vid.setter + def source_vid(self, source_vid): + """Sets the source_vid of this PropertyValue. + + + :param source_vid: The source_vid of this PropertyValue. # noqa: E501 + :type source_vid: list[int] + """ + if self.local_vars_configuration.client_side_validation and source_vid is None: # noqa: E501 + raise ValueError("Invalid value for `source_vid`, must not be `None`") # noqa: E501 + + self._source_vid = source_vid + + @property + def unit(self): + """Gets the unit of this PropertyValue. # noqa: E501 + + + :return: The unit of this PropertyValue. # noqa: E501 + :rtype: str + """ + return self._unit + + @unit.setter + def unit(self, unit): + """Sets the unit of this PropertyValue. + + + :param unit: The unit of this PropertyValue. # noqa: E501 + :type unit: str + """ + if self.local_vars_configuration.client_side_validation and unit is None: # noqa: E501 + raise ValueError("Invalid value for `unit`, must not be `None`") # noqa: E501 + + self._unit = unit + + @property + def request_id(self): + """Gets the request_id of this PropertyValue. # noqa: E501 + + + :return: The request_id of this PropertyValue. # noqa: E501 + :rtype: str + """ + return self._request_id + + @request_id.setter + def request_id(self, request_id): + """Sets the request_id of this PropertyValue. + + + :param request_id: The request_id of this PropertyValue. # noqa: E501 + :type request_id: str + """ + if self.local_vars_configuration.client_side_validation and request_id is None: # noqa: E501 + raise ValueError("Invalid value for `request_id`, must not be `None`") # noqa: E501 + + self._request_id = request_id + + @property + def is_encrypted(self): + """Gets the is_encrypted of this PropertyValue. # noqa: E501 + + + :return: The is_encrypted of this PropertyValue. # noqa: E501 + :rtype: bool + """ + return self._is_encrypted + + @is_encrypted.setter + def is_encrypted(self, is_encrypted): + """Sets the is_encrypted of this PropertyValue. + + + :param is_encrypted: The is_encrypted of this PropertyValue. # noqa: E501 + :type is_encrypted: bool + """ + if self.local_vars_configuration.client_side_validation and is_encrypted is None: # noqa: E501 + raise ValueError("Invalid value for `is_encrypted`, must not be `None`") # noqa: E501 + + self._is_encrypted = is_encrypted + + @property + def name(self): + """Gets the name of this PropertyValue. # noqa: E501 + + + :return: The name of this PropertyValue. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this PropertyValue. + + + :param name: The name of this PropertyValue. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def use_timestamp_as_persistence_timestamp(self): + """Gets the use_timestamp_as_persistence_timestamp of this PropertyValue. # noqa: E501 + + + :return: The use_timestamp_as_persistence_timestamp of this PropertyValue. # noqa: E501 + :rtype: bool + """ + return self._use_timestamp_as_persistence_timestamp + + @use_timestamp_as_persistence_timestamp.setter + def use_timestamp_as_persistence_timestamp(self, use_timestamp_as_persistence_timestamp): + """Sets the use_timestamp_as_persistence_timestamp of this PropertyValue. + + + :param use_timestamp_as_persistence_timestamp: The use_timestamp_as_persistence_timestamp of this PropertyValue. # noqa: E501 + :type use_timestamp_as_persistence_timestamp: bool + """ + if self.local_vars_configuration.client_side_validation and use_timestamp_as_persistence_timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `use_timestamp_as_persistence_timestamp`, must not be `None`") # noqa: E501 + + self._use_timestamp_as_persistence_timestamp = use_timestamp_as_persistence_timestamp + + @property + def value(self): + """Gets the value of this PropertyValue. # noqa: E501 + + + :return: The value of this PropertyValue. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this PropertyValue. + + + :param value: The value of this PropertyValue. # 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 selected_by_user_timestamp(self): + """Gets the selected_by_user_timestamp of this PropertyValue. # noqa: E501 + + + :return: The selected_by_user_timestamp of this PropertyValue. # noqa: E501 + :rtype: int + """ + return self._selected_by_user_timestamp + + @selected_by_user_timestamp.setter + def selected_by_user_timestamp(self, selected_by_user_timestamp): + """Sets the selected_by_user_timestamp of this PropertyValue. + + + :param selected_by_user_timestamp: The selected_by_user_timestamp of this PropertyValue. # noqa: E501 + :type selected_by_user_timestamp: int + """ + if self.local_vars_configuration.client_side_validation and selected_by_user_timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `selected_by_user_timestamp`, must not be `None`") # noqa: E501 + + self._selected_by_user_timestamp = selected_by_user_timestamp + + @property + def timestamp(self): + """Gets the timestamp of this PropertyValue. # noqa: E501 + + + :return: The timestamp of this PropertyValue. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this PropertyValue. + + + :param timestamp: The timestamp of this PropertyValue. # noqa: E501 + :type timestamp: int + """ + 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 + + @property + def is_large_value(self): + """Gets the is_large_value of this PropertyValue. # noqa: E501 + + + :return: The is_large_value of this PropertyValue. # noqa: E501 + :rtype: bool + """ + return self._is_large_value + + @is_large_value.setter + def is_large_value(self, is_large_value): + """Sets the is_large_value of this PropertyValue. + + + :param is_large_value: The is_large_value of this PropertyValue. # noqa: E501 + :type is_large_value: bool + """ + if self.local_vars_configuration.client_side_validation and is_large_value is None: # noqa: E501 + raise ValueError("Invalid value for `is_large_value`, must not be `None`") # noqa: E501 + + self._is_large_value = is_large_value + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PropertyValue): + 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, PropertyValue): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/imports/models/public_import_error.py b/hubspot/crm/imports/models/public_import_error.py index 5817fb20..770be8b6 100644 --- a/hubspot/crm/imports/models/public_import_error.py +++ b/hubspot/crm/imports/models/public_import_error.py @@ -40,7 +40,10 @@ class PublicImportError(object): "extra_context": "str", "object_type_id": "str", "error_type": "str", + "invalid_property_value": "PropertyValue", + "error_message": "str", "known_column_number": "int", + "invalid_value_to_display": "str", "id": "str", "source_data": "ImportRowCore", "object_type": "str", @@ -52,7 +55,10 @@ class PublicImportError(object): "extra_context": "extraContext", "object_type_id": "objectTypeId", "error_type": "errorType", + "invalid_property_value": "invalidPropertyValue", + "error_message": "errorMessage", "known_column_number": "knownColumnNumber", + "invalid_value_to_display": "invalidValueToDisplay", "id": "id", "source_data": "sourceData", "object_type": "objectType", @@ -65,7 +71,10 @@ def __init__( extra_context=None, object_type_id=None, error_type=None, + invalid_property_value=None, + error_message=None, known_column_number=None, + invalid_value_to_display=None, id=None, source_data=None, object_type=None, @@ -81,7 +90,10 @@ def __init__( self._extra_context = None self._object_type_id = None self._error_type = None + self._invalid_property_value = None + self._error_message = None self._known_column_number = None + self._invalid_value_to_display = None self._id = None self._source_data = None self._object_type = None @@ -94,8 +106,14 @@ def __init__( if object_type_id is not None: self.object_type_id = object_type_id self.error_type = error_type + if invalid_property_value is not None: + self.invalid_property_value = invalid_property_value + if error_message is not None: + self.error_message = error_message if known_column_number is not None: self.known_column_number = known_column_number + if invalid_value_to_display is not None: + self.invalid_value_to_display = invalid_value_to_display self.id = id self.source_data = source_data if object_type is not None: @@ -209,6 +227,7 @@ def error_type(self, error_type): "AMBIGUOUS_ENUMERATION_OPTION", "FAILED_VALIDATION", "FAILED_TO_CREATE_ASSOCIATION", + "ASSOCIATION_LIMIT_EXCEEDED", "FILE_NOT_FOUND", "INVALID_COLUMN_CONFIGURATION", "INVALID_FILE_TYPE", @@ -222,6 +241,7 @@ def error_type(self, error_type): "PORTAL_WIDE_CUSTOM_OBJECT_LIMIT_EXCEEDED", "INVALID_ALTERNATE_ID", "INVALID_EMAIL", + "SECONDARY_EMAIL_WRITE_FAILURE", "INVALID_DOMAIN", "DUPLICATE_ROW_CONTENT", "INVALID_NUMBER_SIZE", @@ -232,7 +252,6 @@ def error_type(self, error_type): "DUPLICATE_ALTERNATE_ID", "DUPLICATE_OBJECT_ID", "DUPLICATE_UNIQUE_PROPERTY_VALUE", - "BLANK_VALUE_PROVIDED", "UNKNOWN_ASSOCIATION_RECORD_ID", "INVALID_RECORD_ID", "DUPLICATE_RECORD_ID", @@ -241,16 +260,64 @@ def error_type(self, error_type): "UPDATE_ONLY_IMPORT", "COLUMN_TOO_LARGE", "ROW_DATA_TOO_LARGE", + "MISSING_EVENT_TIMESTAMP", "INVALID_EVENT_TIMESTAMP", "INVALID_EVENT", "DUPLICATE_EVENT", "MISSING_EVENT_DEFINITION", + "INVALID_ASSOCIATION_KEY", + "ASSOCIATION_RECORD_NOT_FOUND", + "MISSING_OBJECT_DEFINITION", + "ASSOCIATION_LABEL_NOT_FOUND", + "MANY_ERRORS_IN_ROW", ] # noqa: E501 if self.local_vars_configuration.client_side_validation and error_type not in allowed_values: # noqa: E501 raise ValueError("Invalid value for `error_type` ({0}), must be one of {1}".format(error_type, allowed_values)) # noqa: E501 self._error_type = error_type + @property + def invalid_property_value(self): + """Gets the invalid_property_value of this PublicImportError. # noqa: E501 + + + :return: The invalid_property_value of this PublicImportError. # noqa: E501 + :rtype: PropertyValue + """ + return self._invalid_property_value + + @invalid_property_value.setter + def invalid_property_value(self, invalid_property_value): + """Sets the invalid_property_value of this PublicImportError. + + + :param invalid_property_value: The invalid_property_value of this PublicImportError. # noqa: E501 + :type invalid_property_value: PropertyValue + """ + + self._invalid_property_value = invalid_property_value + + @property + def error_message(self): + """Gets the error_message of this PublicImportError. # noqa: E501 + + + :return: The error_message of this PublicImportError. # noqa: E501 + :rtype: str + """ + return self._error_message + + @error_message.setter + def error_message(self, error_message): + """Sets the error_message of this PublicImportError. + + + :param error_message: The error_message of this PublicImportError. # noqa: E501 + :type error_message: str + """ + + self._error_message = error_message + @property def known_column_number(self): """Gets the known_column_number of this PublicImportError. # noqa: E501 @@ -272,6 +339,27 @@ def known_column_number(self, known_column_number): self._known_column_number = known_column_number + @property + def invalid_value_to_display(self): + """Gets the invalid_value_to_display of this PublicImportError. # noqa: E501 + + + :return: The invalid_value_to_display of this PublicImportError. # noqa: E501 + :rtype: str + """ + return self._invalid_value_to_display + + @invalid_value_to_display.setter + def invalid_value_to_display(self, invalid_value_to_display): + """Sets the invalid_value_to_display of this PublicImportError. + + + :param invalid_value_to_display: The invalid_value_to_display of this PublicImportError. # noqa: E501 + :type invalid_value_to_display: str + """ + + self._invalid_value_to_display = invalid_value_to_display + @property def id(self): """Gets the id of this PublicImportError. # noqa: E501 @@ -482,6 +570,21 @@ def object_type(self, object_type): "ALL_PAGES", "AI_FORECAST", "CRM_PIPELINES_DUMMY_TYPE", + "KNOWLEDGE_ARTICLE", + "PROPERTY_INFO", + "DATA_PRIVACY_CONSENT", + "GOAL_TEMPLATE", + "SCORE_CONFIGURATION", + "AUDIENCE", + "PARTNER_CLIENT_REVENUE", + "AUTOMATION_JOURNEY", + "COMBO_EVENT_CONFIGURATION", + "CRM_OBJECTS_DUMMY_TYPE", + "CASE_STUDY", + "SERVICE", + "PODCAST_EPISODE", + "PARTNER_SERVICE", + "PROSPECTING_AGENT_CONTACT_ASSIGNMENT", "UNKNOWN", ] # noqa: E501 if self.local_vars_configuration.client_side_validation and object_type not in allowed_values: # noqa: E501 diff --git a/hubspot/crm/imports/models/public_import_response.py b/hubspot/crm/imports/models/public_import_response.py index 8e78b108..30f6c8a4 100644 --- a/hubspot/crm/imports/models/public_import_response.py +++ b/hubspot/crm/imports/models/public_import_response.py @@ -45,6 +45,7 @@ class PublicImportResponse(object): "state": "str", "id": "str", "opt_out_import": "bool", + "mapped_object_type_ids": "list[str]", "updated_at": "datetime", } @@ -58,6 +59,7 @@ class PublicImportResponse(object): "state": "state", "id": "id", "opt_out_import": "optOutImport", + "mapped_object_type_ids": "mappedObjectTypeIds", "updated_at": "updatedAt", } @@ -72,6 +74,7 @@ def __init__( state=None, id=None, opt_out_import=None, + mapped_object_type_ids=None, updated_at=None, local_vars_configuration=None, ): # noqa: E501 @@ -89,6 +92,7 @@ def __init__( self._state = None self._id = None self._opt_out_import = None + self._mapped_object_type_ids = None self._updated_at = None self.discriminator = None @@ -105,6 +109,7 @@ def __init__( self.state = state self.id = id self.opt_out_import = opt_out_import + self.mapped_object_type_ids = mapped_object_type_ids self.updated_at = updated_at @property @@ -316,6 +321,29 @@ def opt_out_import(self, opt_out_import): self._opt_out_import = opt_out_import + @property + def mapped_object_type_ids(self): + """Gets the mapped_object_type_ids of this PublicImportResponse. # noqa: E501 + + + :return: The mapped_object_type_ids of this PublicImportResponse. # noqa: E501 + :rtype: list[str] + """ + return self._mapped_object_type_ids + + @mapped_object_type_ids.setter + def mapped_object_type_ids(self, mapped_object_type_ids): + """Sets the mapped_object_type_ids of this PublicImportResponse. + + + :param mapped_object_type_ids: The mapped_object_type_ids of this PublicImportResponse. # noqa: E501 + :type mapped_object_type_ids: list[str] + """ + if self.local_vars_configuration.client_side_validation and mapped_object_type_ids is None: # noqa: E501 + raise ValueError("Invalid value for `mapped_object_type_ids`, must not be `None`") # noqa: E501 + + self._mapped_object_type_ids = mapped_object_type_ids + @property def updated_at(self): """Gets the updated_at of this PublicImportResponse. # noqa: E501 From 162018cf2f3d0f9707c4a9e664d1c6f2c30a8076 Mon Sep 17 00:00:00 2001 From: alexey Date: Thu, 3 Apr 2025 13:08:38 +0300 Subject: [PATCH 12/49] Codegen Crm LineItems --- hubspot/crm/line_items/__init__.py | 3 +- hubspot/crm/line_items/api/basic_api.py | 12 +- hubspot/crm/line_items/api/batch_api.py | 32 ++-- hubspot/crm/line_items/api/search_api.py | 6 +- hubspot/crm/line_items/models/__init__.py | 3 +- ...e_public_object_batch_input_for_create.py} | 22 +-- ...atch_read_input_simple_public_object_id.py | 2 + .../line_items/models/simple_public_object.py | 30 +++- .../simple_public_object_batch_input.py | 4 + ...le_public_object_batch_input_for_create.py | 170 ++++++++++++++++++ ...simple_public_object_batch_input_upsert.py | 2 + .../models/simple_public_object_input.py | 30 +--- .../simple_public_object_input_for_create.py | 35 +--- .../simple_public_object_with_associations.py | 38 +++- .../models/simple_public_upsert_object.py | 38 +++- 15 files changed, 331 insertions(+), 96 deletions(-) rename hubspot/crm/line_items/models/{batch_input_simple_public_object_input_for_create.py => batch_input_simple_public_object_batch_input_for_create.py} (80%) create mode 100644 hubspot/crm/line_items/models/simple_public_object_batch_input_for_create.py diff --git a/hubspot/crm/line_items/__init__.py b/hubspot/crm/line_items/__init__.py index ac9faf6a..1ff397b9 100644 --- a/hubspot/crm/line_items/__init__.py +++ b/hubspot/crm/line_items/__init__.py @@ -35,9 +35,9 @@ from hubspot.crm.line_items.models.associated_id import AssociatedId from hubspot.crm.line_items.models.association_spec import AssociationSpec from hubspot.crm.line_items.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.line_items.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.line_items.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.line_items.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.line_items.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.line_items.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.line_items.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.line_items.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -59,6 +59,7 @@ from hubspot.crm.line_items.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.line_items.models.simple_public_object import SimplePublicObject from hubspot.crm.line_items.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.line_items.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.line_items.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.line_items.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.line_items.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/line_items/api/basic_api.py b/hubspot/crm/line_items/api/basic_api.py index 4dd9c3e0..84b4ec1f 100644 --- a/hubspot/crm/line_items/api/basic_api.py +++ b/hubspot/crm/line_items/api/basic_api.py @@ -302,7 +302,7 @@ def get_by_id(self, line_item_id, **kwargs): # noqa: E501 :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 + :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 @@ -342,7 +342,7 @@ def get_by_id_with_http_info(self, line_item_id, **kwargs): # noqa: E501 :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 + :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 @@ -594,7 +594,7 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501 def update(self, line_item_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{lineItemId}`. `{lineItemId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{lineItemId}`or optionally a unique property value as specified by the `idProperty` query param. `{lineItemId}` 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 @@ -605,7 +605,7 @@ def update(self, line_item_id, simple_public_object_input, **kwargs): # noqa: E :type line_item_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 + :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 @@ -628,7 +628,7 @@ def update(self, line_item_id, simple_public_object_input, **kwargs): # noqa: E def update_with_http_info(self, line_item_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{lineItemId}`. `{lineItemId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{lineItemId}`or optionally a unique property value as specified by the `idProperty` query param. `{lineItemId}` 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 @@ -639,7 +639,7 @@ def update_with_http_info(self, line_item_id, simple_public_object_input, **kwar :type line_item_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 + :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 diff --git a/hubspot/crm/line_items/api/batch_api.py b/hubspot/crm/line_items/api/batch_api.py index 05d04cfa..83ef9393 100644 --- a/hubspot/crm/line_items/api/batch_api.py +++ b/hubspot/crm/line_items/api/batch_api.py @@ -157,17 +157,17 @@ def archive_with_http_info(self, batch_input_simple_public_object_id, **kwargs): _request_auth=local_var_params.get("_request_auth"), ) - def create(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of line items # 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) + >>> thread = api.create(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -184,19 +184,19 @@ def create(self, batch_input_simple_public_object_input_for_create, **kwargs): :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 + return self.create_with_http_info(batch_input_simple_public_object_batch_input_for_create, **kwargs) # noqa: E501 - def create_with_http_info(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create_with_http_info(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of line items # 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) + >>> thread = api.create_with_http_info(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :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 @@ -223,7 +223,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat local_var_params = locals() - all_params = ["batch_input_simple_public_object_input_for_create"] + all_params = ["batch_input_simple_public_object_batch_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"]): @@ -231,9 +231,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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 + # verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_for_create` when calling `create`") # noqa: E501 collection_formats = {} @@ -247,8 +247,8 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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"] + if "batch_input_simple_public_object_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_for_create"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -287,6 +287,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of line items by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -318,6 +319,7 @@ def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E50 def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of line items by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/line_items/api/search_api.py b/hubspot/crm/line_items/api/search_api.py index 908dd656..14a58aa4 100644 --- a/hubspot/crm/line_items/api/search_api.py +++ b/hubspot/crm/line_items/api/search_api.py @@ -34,8 +34,9 @@ def __init__(self, api_client=None): self.api_client = api_client def do_search(self, public_object_search_request, **kwargs): # noqa: E501 - """do_search # noqa: E501 + """Search for line items # noqa: E501 + Search for line items by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -63,8 +64,9 @@ def do_search(self, public_object_search_request, **kwargs): # noqa: E501 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 + """Search for line items # noqa: E501 + Search for line items by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/line_items/models/__init__.py b/hubspot/crm/line_items/models/__init__.py index cb4c719e..c809e626 100644 --- a/hubspot/crm/line_items/models/__init__.py +++ b/hubspot/crm/line_items/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.line_items.models.associated_id import AssociatedId from hubspot.crm.line_items.models.association_spec import AssociationSpec from hubspot.crm.line_items.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.line_items.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.line_items.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.line_items.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.line_items.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.line_items.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.line_items.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.line_items.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -41,6 +41,7 @@ from hubspot.crm.line_items.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.line_items.models.simple_public_object import SimplePublicObject from hubspot.crm.line_items.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.line_items.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.line_items.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.line_items.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.line_items.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/line_items/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/line_items/models/batch_input_simple_public_object_batch_input_for_create.py similarity index 80% rename from hubspot/crm/line_items/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/line_items/models/batch_input_simple_public_object_batch_input_for_create.py index 0945cbaa..be474915 100644 --- a/hubspot/crm/line_items/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/line_items/models/batch_input_simple_public_object_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.line_items.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectBatchInputForCreate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class BatchInputSimplePublicObjectInputForCreate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"inputs": "list[SimplePublicObjectInputForCreate]"} + openapi_types = {"inputs": "list[SimplePublicObjectBatchInputForCreate]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 @@ -52,21 +52,21 @@ def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 @property def inputs(self): - """Gets the inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + """Gets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] """ return self._inputs @inputs.setter def inputs(self, inputs): - """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/line_items/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/line_items/models/batch_read_input_simple_public_object_id.py index 5e0a1133..e5c75f0e 100644 --- a/hubspot/crm/line_items/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/line_items/models/batch_read_input_simple_public_object_id.py @@ -84,6 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -94,6 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/line_items/models/simple_public_object.py b/hubspot/crm/line_items/models/simple_public_object.py index 09ab6a82..419a6af5 100644 --- a/hubspot/crm/line_items/models/simple_public_object.py +++ b/hubspot/crm/line_items/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 diff --git a/hubspot/crm/line_items/models/simple_public_object_batch_input.py b/hubspot/crm/line_items/models/simple_public_object_batch_input.py index c794e099..e3b9bc19 100644 --- a/hubspot/crm/line_items/models/simple_public_object_batch_input.py +++ b/hubspot/crm/line_items/models/simple_public_object_batch_input.py @@ -62,6 +62,7 @@ def __init__(self, id_property=None, object_write_trace_id=None, id=None, proper def id_property(self): """Gets the id_property of this SimplePublicObjectBatchInput. # noqa: E501 + The name of a property whose values are unique for this object # noqa: E501 :return: The id_property of this SimplePublicObjectBatchInput. # noqa: E501 :rtype: str @@ -72,6 +73,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this SimplePublicObjectBatchInput. + The name of a property whose values are unique for this object # noqa: E501 :param id_property: The id_property of this SimplePublicObjectBatchInput. # noqa: E501 :type id_property: str @@ -104,6 +106,7 @@ def object_write_trace_id(self, object_write_trace_id): def id(self): """Gets the id of this SimplePublicObjectBatchInput. # noqa: E501 + The id to be updated. This can be the object id, or the unique property value of the idProperty property # noqa: E501 :return: The id of this SimplePublicObjectBatchInput. # noqa: E501 :rtype: str @@ -114,6 +117,7 @@ def id(self): def id(self, id): """Sets the id of this SimplePublicObjectBatchInput. + The id to be updated. This can be the object id, or the unique property value of the idProperty property # noqa: E501 :param id: The id of this SimplePublicObjectBatchInput. # noqa: E501 :type id: str diff --git a/hubspot/crm/line_items/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/line_items/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..5cca119f --- /dev/null +++ b/hubspot/crm/line_items/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Line Items + + 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.line_items.configuration import Configuration + + +class SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/line_items/models/simple_public_object_batch_input_upsert.py b/hubspot/crm/line_items/models/simple_public_object_batch_input_upsert.py index 6c0bbdb6..2b0f46b9 100644 --- a/hubspot/crm/line_items/models/simple_public_object_batch_input_upsert.py +++ b/hubspot/crm/line_items/models/simple_public_object_batch_input_upsert.py @@ -62,6 +62,7 @@ def __init__(self, id_property=None, object_write_trace_id=None, id=None, proper def id_property(self): """Gets the id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + The name of a property whose values are unique for this object # noqa: E501 :return: The id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :rtype: str @@ -72,6 +73,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this SimplePublicObjectBatchInputUpsert. + The name of a property whose values are unique for this object # noqa: E501 :param id_property: The id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/line_items/models/simple_public_object_input.py b/hubspot/crm/line_items/models/simple_public_object_input.py index a38e108f..e7ef6273 100644 --- a/hubspot/crm/line_items/models/simple_public_object_input.py +++ b/hubspot/crm/line_items/models/simple_public_object_input.py @@ -35,45 +35,21 @@ class SimplePublicObjectInput(object): 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]"} + openapi_types = {"properties": "dict[str, str]"} - attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"properties": "properties"} - def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, 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 diff --git a/hubspot/crm/line_items/models/simple_public_object_input_for_create.py b/hubspot/crm/line_items/models/simple_public_object_input_for_create.py index 865cf642..03d04812 100644 --- a/hubspot/crm/line_items/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/line_items/models/simple_public_object_input_for_create.py @@ -35,24 +35,22 @@ class SimplePublicObjectInputForCreate(object): 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]"} + openapi_types = {"associations": "list[PublicAssociationsForObject]", "properties": "dict[str, str]"} - attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"associations": "associations", "properties": "properties"} - def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, associations=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 + if associations is not None: + self.associations = associations self.properties = properties @property @@ -73,32 +71,9 @@ def associations(self, associations): :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 diff --git a/hubspot/crm/line_items/models/simple_public_object_with_associations.py b/hubspot/crm/line_items/models/simple_public_object_with_associations.py index 74844783..dee18d7a 100644 --- a/hubspot/crm/line_items/models/simple_public_object_with_associations.py +++ b/hubspot/crm/line_items/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -218,6 +233,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 diff --git a/hubspot/crm/line_items/models/simple_public_upsert_object.py b/hubspot/crm/line_items/models/simple_public_upsert_object.py index edfb4917..08c25aec 100644 --- a/hubspot/crm/line_items/models/simple_public_upsert_object.py +++ b/hubspot/crm/line_items/models/simple_public_upsert_object.py @@ -42,6 +42,7 @@ class SimplePublicUpsertObject(object): "new": "bool", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicUpsertObject(object): "new": "new", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._new = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -84,6 +97,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -219,6 +234,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. # noqa: E501 From 5ebc3eb3448aab0937f050df3e4b2b5b334ae592 Mon Sep 17 00:00:00 2001 From: alexey Date: Thu, 3 Apr 2025 13:12:09 +0300 Subject: [PATCH 13/49] Codegen Crm Owners --- hubspot/crm/owners/models/public_owner.py | 72 ++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/hubspot/crm/owners/models/public_owner.py b/hubspot/crm/owners/models/public_owner.py index 31da2ba1..5643bfc1 100644 --- a/hubspot/crm/owners/models/public_owner.py +++ b/hubspot/crm/owners/models/public_owner.py @@ -42,6 +42,8 @@ class PublicOwner(object): "archived": "bool", "teams": "list[PublicTeam]", "id": "str", + "user_id_including_inactive": "int", + "type": "str", "user_id": "int", "email": "str", "updated_at": "datetime", @@ -54,12 +56,28 @@ class PublicOwner(object): "archived": "archived", "teams": "teams", "id": "id", + "user_id_including_inactive": "userIdIncludingInactive", + "type": "type", "user_id": "userId", "email": "email", "updated_at": "updatedAt", } - def __init__(self, first_name=None, last_name=None, created_at=None, archived=None, teams=None, id=None, user_id=None, email=None, updated_at=None, local_vars_configuration=None): # noqa: E501 + def __init__( + self, + first_name=None, + last_name=None, + created_at=None, + archived=None, + teams=None, + id=None, + user_id_including_inactive=None, + type=None, + user_id=None, + email=None, + updated_at=None, + local_vars_configuration=None, + ): # noqa: E501 """PublicOwner - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() @@ -71,6 +89,8 @@ def __init__(self, first_name=None, last_name=None, created_at=None, archived=No self._archived = None self._teams = None self._id = None + self._user_id_including_inactive = None + self._type = None self._user_id = None self._email = None self._updated_at = None @@ -85,6 +105,9 @@ def __init__(self, first_name=None, last_name=None, created_at=None, archived=No if teams is not None: self.teams = teams self.id = id + if user_id_including_inactive is not None: + self.user_id_including_inactive = user_id_including_inactive + self.type = type if user_id is not None: self.user_id = user_id if email is not None: @@ -223,6 +246,53 @@ def id(self, id): self._id = id + @property + def user_id_including_inactive(self): + """Gets the user_id_including_inactive of this PublicOwner. # noqa: E501 + + + :return: The user_id_including_inactive of this PublicOwner. # noqa: E501 + :rtype: int + """ + return self._user_id_including_inactive + + @user_id_including_inactive.setter + def user_id_including_inactive(self, user_id_including_inactive): + """Sets the user_id_including_inactive of this PublicOwner. + + + :param user_id_including_inactive: The user_id_including_inactive of this PublicOwner. # noqa: E501 + :type user_id_including_inactive: int + """ + + self._user_id_including_inactive = user_id_including_inactive + + @property + def type(self): + """Gets the type of this PublicOwner. # noqa: E501 + + + :return: The type of this PublicOwner. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this PublicOwner. + + + :param type: The type of this PublicOwner. # 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 + allowed_values = ["PERSON", "QUEUE"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `type` ({0}), must be one of {1}".format(type, allowed_values)) # noqa: E501 + + self._type = type + @property def user_id(self): """Gets the user_id of this PublicOwner. # noqa: E501 From 5304953c064cbc643039bc13ba7a3ef1ee64fcc4 Mon Sep 17 00:00:00 2001 From: alexey Date: Thu, 3 Apr 2025 13:14:58 +0300 Subject: [PATCH 14/49] Codegen Crm Pipelines --- hubspot/crm/pipelines/models/pipeline_stage.py | 5 ++--- hubspot/crm/pipelines/models/pipeline_stage_input.py | 5 ++--- hubspot/crm/pipelines/models/pipeline_stage_patch_input.py | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/hubspot/crm/pipelines/models/pipeline_stage.py b/hubspot/crm/pipelines/models/pipeline_stage.py index 46dc0796..0734fddf 100644 --- a/hubspot/crm/pipelines/models/pipeline_stage.py +++ b/hubspot/crm/pipelines/models/pipeline_stage.py @@ -82,7 +82,8 @@ def __init__( if archived_at is not None: self.archived_at = archived_at self.archived = archived - self.metadata = metadata + if metadata is not None: + self.metadata = metadata self.display_order = display_order if write_permissions is not None: self.write_permissions = write_permissions @@ -183,8 +184,6 @@ def metadata(self, metadata): :param metadata: The metadata of this PipelineStage. # noqa: E501 :type metadata: dict[str, str] """ - if self.local_vars_configuration.client_side_validation and metadata is None: # noqa: E501 - raise ValueError("Invalid value for `metadata`, must not be `None`") # noqa: E501 self._metadata = metadata diff --git a/hubspot/crm/pipelines/models/pipeline_stage_input.py b/hubspot/crm/pipelines/models/pipeline_stage_input.py index 368f5780..39771d7e 100644 --- a/hubspot/crm/pipelines/models/pipeline_stage_input.py +++ b/hubspot/crm/pipelines/models/pipeline_stage_input.py @@ -50,7 +50,8 @@ def __init__(self, metadata=None, display_order=None, label=None, local_vars_con self._label = None self.discriminator = None - self.metadata = metadata + if metadata is not None: + self.metadata = metadata self.display_order = display_order self.label = label @@ -74,8 +75,6 @@ def metadata(self, metadata): :param metadata: The metadata of this PipelineStageInput. # noqa: E501 :type metadata: dict[str, str] """ - if self.local_vars_configuration.client_side_validation and metadata is None: # noqa: E501 - raise ValueError("Invalid value for `metadata`, must not be `None`") # noqa: E501 self._metadata = metadata diff --git a/hubspot/crm/pipelines/models/pipeline_stage_patch_input.py b/hubspot/crm/pipelines/models/pipeline_stage_patch_input.py index ef0cf474..a4f6d603 100644 --- a/hubspot/crm/pipelines/models/pipeline_stage_patch_input.py +++ b/hubspot/crm/pipelines/models/pipeline_stage_patch_input.py @@ -53,7 +53,8 @@ def __init__(self, archived=None, metadata=None, display_order=None, label=None, if archived is not None: self.archived = archived - self.metadata = metadata + if metadata is not None: + self.metadata = metadata if display_order is not None: self.display_order = display_order if label is not None: @@ -102,8 +103,6 @@ def metadata(self, metadata): :param metadata: The metadata of this PipelineStagePatchInput. # noqa: E501 :type metadata: dict[str, str] """ - if self.local_vars_configuration.client_side_validation and metadata is None: # noqa: E501 - raise ValueError("Invalid value for `metadata`, must not be `None`") # noqa: E501 self._metadata = metadata From ebddf25676c98fbbfd35c1229ed1ccf4be14339b Mon Sep 17 00:00:00 2001 From: alexey Date: Thu, 3 Apr 2025 13:18:56 +0300 Subject: [PATCH 15/49] Codegen Crm Quotes --- hubspot/crm/quotes/__init__.py | 3 +- hubspot/crm/quotes/api/basic_api.py | 12 +- hubspot/crm/quotes/api/batch_api.py | 32 ++-- hubspot/crm/quotes/models/__init__.py | 3 +- ...e_public_object_batch_input_for_create.py} | 22 +-- ...atch_read_input_simple_public_object_id.py | 2 + .../crm/quotes/models/simple_public_object.py | 30 +++- .../simple_public_object_batch_input.py | 4 + ...le_public_object_batch_input_for_create.py | 170 ++++++++++++++++++ ...simple_public_object_batch_input_upsert.py | 2 + .../models/simple_public_object_input.py | 30 +--- .../simple_public_object_input_for_create.py | 35 +--- .../simple_public_object_with_associations.py | 38 +++- .../models/simple_public_upsert_object.py | 38 +++- 14 files changed, 327 insertions(+), 94 deletions(-) rename hubspot/crm/quotes/models/{batch_input_simple_public_object_input_for_create.py => batch_input_simple_public_object_batch_input_for_create.py} (80%) create mode 100644 hubspot/crm/quotes/models/simple_public_object_batch_input_for_create.py diff --git a/hubspot/crm/quotes/__init__.py b/hubspot/crm/quotes/__init__.py index fc886c19..f2421db8 100644 --- a/hubspot/crm/quotes/__init__.py +++ b/hubspot/crm/quotes/__init__.py @@ -35,9 +35,9 @@ from hubspot.crm.quotes.models.associated_id import AssociatedId from hubspot.crm.quotes.models.association_spec import AssociationSpec from hubspot.crm.quotes.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.quotes.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.quotes.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.quotes.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.quotes.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.quotes.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.quotes.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.quotes.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -59,6 +59,7 @@ from hubspot.crm.quotes.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.quotes.models.simple_public_object import SimplePublicObject from hubspot.crm.quotes.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.quotes.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.quotes.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.quotes.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.quotes.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/quotes/api/basic_api.py b/hubspot/crm/quotes/api/basic_api.py index 146e0686..ef58ad14 100644 --- a/hubspot/crm/quotes/api/basic_api.py +++ b/hubspot/crm/quotes/api/basic_api.py @@ -302,7 +302,7 @@ def get_by_id(self, quote_id, **kwargs): # noqa: E501 :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 + :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 @@ -342,7 +342,7 @@ def get_by_id_with_http_info(self, quote_id, **kwargs): # noqa: E501 :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 + :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 @@ -594,7 +594,7 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501 def update(self, quote_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{quoteId}`. `{quoteId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{quoteId}`or optionally a unique property value as specified by the `idProperty` query param. `{quoteId}` 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 @@ -605,7 +605,7 @@ def update(self, quote_id, simple_public_object_input, **kwargs): # noqa: E501 :type quote_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 + :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 @@ -628,7 +628,7 @@ def update(self, quote_id, simple_public_object_input, **kwargs): # noqa: E501 def update_with_http_info(self, quote_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{quoteId}`. `{quoteId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{quoteId}`or optionally a unique property value as specified by the `idProperty` query param. `{quoteId}` 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 @@ -639,7 +639,7 @@ def update_with_http_info(self, quote_id, simple_public_object_input, **kwargs): :type quote_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 + :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 diff --git a/hubspot/crm/quotes/api/batch_api.py b/hubspot/crm/quotes/api/batch_api.py index acd03fd6..ece2890b 100644 --- a/hubspot/crm/quotes/api/batch_api.py +++ b/hubspot/crm/quotes/api/batch_api.py @@ -157,17 +157,17 @@ def archive_with_http_info(self, batch_input_simple_public_object_id, **kwargs): _request_auth=local_var_params.get("_request_auth"), ) - def create(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of quotes # 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) + >>> thread = api.create(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -184,19 +184,19 @@ def create(self, batch_input_simple_public_object_input_for_create, **kwargs): :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 + return self.create_with_http_info(batch_input_simple_public_object_batch_input_for_create, **kwargs) # noqa: E501 - def create_with_http_info(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create_with_http_info(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of quotes # 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) + >>> thread = api.create_with_http_info(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :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 @@ -223,7 +223,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat local_var_params = locals() - all_params = ["batch_input_simple_public_object_input_for_create"] + all_params = ["batch_input_simple_public_object_batch_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"]): @@ -231,9 +231,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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 + # verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_for_create` when calling `create`") # noqa: E501 collection_formats = {} @@ -247,8 +247,8 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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"] + if "batch_input_simple_public_object_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_for_create"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -287,6 +287,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of quotes by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -318,6 +319,7 @@ def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E50 def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of quotes by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/quotes/models/__init__.py b/hubspot/crm/quotes/models/__init__.py index 830f8df7..084e1a70 100644 --- a/hubspot/crm/quotes/models/__init__.py +++ b/hubspot/crm/quotes/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.quotes.models.associated_id import AssociatedId from hubspot.crm.quotes.models.association_spec import AssociationSpec from hubspot.crm.quotes.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.quotes.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.quotes.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.quotes.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.quotes.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.quotes.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.quotes.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.quotes.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -41,6 +41,7 @@ from hubspot.crm.quotes.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.quotes.models.simple_public_object import SimplePublicObject from hubspot.crm.quotes.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.quotes.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.quotes.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.quotes.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.quotes.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/quotes/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/quotes/models/batch_input_simple_public_object_batch_input_for_create.py similarity index 80% rename from hubspot/crm/quotes/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/quotes/models/batch_input_simple_public_object_batch_input_for_create.py index a369da3b..00661764 100644 --- a/hubspot/crm/quotes/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/quotes/models/batch_input_simple_public_object_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.quotes.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectBatchInputForCreate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class BatchInputSimplePublicObjectInputForCreate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"inputs": "list[SimplePublicObjectInputForCreate]"} + openapi_types = {"inputs": "list[SimplePublicObjectBatchInputForCreate]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 @@ -52,21 +52,21 @@ def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 @property def inputs(self): - """Gets the inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + """Gets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] """ return self._inputs @inputs.setter def inputs(self, inputs): - """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/quotes/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/quotes/models/batch_read_input_simple_public_object_id.py index 3bc77236..fa5d4772 100644 --- a/hubspot/crm/quotes/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/quotes/models/batch_read_input_simple_public_object_id.py @@ -84,6 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -94,6 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/quotes/models/simple_public_object.py b/hubspot/crm/quotes/models/simple_public_object.py index d0b2be09..7206e3ab 100644 --- a/hubspot/crm/quotes/models/simple_public_object.py +++ b/hubspot/crm/quotes/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 diff --git a/hubspot/crm/quotes/models/simple_public_object_batch_input.py b/hubspot/crm/quotes/models/simple_public_object_batch_input.py index cd026494..1c14a67a 100644 --- a/hubspot/crm/quotes/models/simple_public_object_batch_input.py +++ b/hubspot/crm/quotes/models/simple_public_object_batch_input.py @@ -62,6 +62,7 @@ def __init__(self, id_property=None, object_write_trace_id=None, id=None, proper def id_property(self): """Gets the id_property of this SimplePublicObjectBatchInput. # noqa: E501 + The name of a property whose values are unique for this object # noqa: E501 :return: The id_property of this SimplePublicObjectBatchInput. # noqa: E501 :rtype: str @@ -72,6 +73,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this SimplePublicObjectBatchInput. + The name of a property whose values are unique for this object # noqa: E501 :param id_property: The id_property of this SimplePublicObjectBatchInput. # noqa: E501 :type id_property: str @@ -104,6 +106,7 @@ def object_write_trace_id(self, object_write_trace_id): def id(self): """Gets the id of this SimplePublicObjectBatchInput. # noqa: E501 + The id to be updated. This can be the object id, or the unique property value of the idProperty property # noqa: E501 :return: The id of this SimplePublicObjectBatchInput. # noqa: E501 :rtype: str @@ -114,6 +117,7 @@ def id(self): def id(self, id): """Sets the id of this SimplePublicObjectBatchInput. + The id to be updated. This can be the object id, or the unique property value of the idProperty property # noqa: E501 :param id: The id of this SimplePublicObjectBatchInput. # noqa: E501 :type id: str diff --git a/hubspot/crm/quotes/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/quotes/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..0aea5cfc --- /dev/null +++ b/hubspot/crm/quotes/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Quotes + + 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.quotes.configuration import Configuration + + +class SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/quotes/models/simple_public_object_batch_input_upsert.py b/hubspot/crm/quotes/models/simple_public_object_batch_input_upsert.py index 670e36eb..a9df566f 100644 --- a/hubspot/crm/quotes/models/simple_public_object_batch_input_upsert.py +++ b/hubspot/crm/quotes/models/simple_public_object_batch_input_upsert.py @@ -62,6 +62,7 @@ def __init__(self, id_property=None, object_write_trace_id=None, id=None, proper def id_property(self): """Gets the id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + The name of a property whose values are unique for this object # noqa: E501 :return: The id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :rtype: str @@ -72,6 +73,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this SimplePublicObjectBatchInputUpsert. + The name of a property whose values are unique for this object # noqa: E501 :param id_property: The id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/quotes/models/simple_public_object_input.py b/hubspot/crm/quotes/models/simple_public_object_input.py index 79a8a1e9..70abd6c0 100644 --- a/hubspot/crm/quotes/models/simple_public_object_input.py +++ b/hubspot/crm/quotes/models/simple_public_object_input.py @@ -35,45 +35,21 @@ class SimplePublicObjectInput(object): 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]"} + openapi_types = {"properties": "dict[str, str]"} - attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"properties": "properties"} - def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, 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 diff --git a/hubspot/crm/quotes/models/simple_public_object_input_for_create.py b/hubspot/crm/quotes/models/simple_public_object_input_for_create.py index 1fdc2449..2e5aa5f8 100644 --- a/hubspot/crm/quotes/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/quotes/models/simple_public_object_input_for_create.py @@ -35,24 +35,22 @@ class SimplePublicObjectInputForCreate(object): 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]"} + openapi_types = {"associations": "list[PublicAssociationsForObject]", "properties": "dict[str, str]"} - attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"associations": "associations", "properties": "properties"} - def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, associations=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 + if associations is not None: + self.associations = associations self.properties = properties @property @@ -73,32 +71,9 @@ def associations(self, associations): :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 diff --git a/hubspot/crm/quotes/models/simple_public_object_with_associations.py b/hubspot/crm/quotes/models/simple_public_object_with_associations.py index 4a9ffd80..db015c80 100644 --- a/hubspot/crm/quotes/models/simple_public_object_with_associations.py +++ b/hubspot/crm/quotes/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -218,6 +233,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 diff --git a/hubspot/crm/quotes/models/simple_public_upsert_object.py b/hubspot/crm/quotes/models/simple_public_upsert_object.py index 430e4212..8a96a695 100644 --- a/hubspot/crm/quotes/models/simple_public_upsert_object.py +++ b/hubspot/crm/quotes/models/simple_public_upsert_object.py @@ -42,6 +42,7 @@ class SimplePublicUpsertObject(object): "new": "bool", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicUpsertObject(object): "new": "new", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._new = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -84,6 +97,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -219,6 +234,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. # noqa: E501 From bfedb32ccafcd077a846d2fbbfb881b86e32dcfb Mon Sep 17 00:00:00 2001 From: alexey Date: Thu, 3 Apr 2025 13:22:30 +0300 Subject: [PATCH 16/49] Codegen Objects Calls --- hubspot/crm/objects/calls/__init__.py | 3 +- hubspot/crm/objects/calls/api/basic_api.py | 12 +- hubspot/crm/objects/calls/api/batch_api.py | 38 ++-- hubspot/crm/objects/calls/api/search_api.py | 6 +- hubspot/crm/objects/calls/models/__init__.py | 3 +- ...e_public_object_batch_input_for_create.py} | 22 +-- ...atch_read_input_simple_public_object_id.py | 4 +- .../calls/models/simple_public_object.py | 30 +++- ...le_public_object_batch_input_for_create.py | 170 ++++++++++++++++++ .../models/simple_public_object_input.py | 30 +--- .../simple_public_object_input_for_create.py | 35 +--- .../simple_public_object_with_associations.py | 38 +++- .../models/simple_public_upsert_object.py | 38 +++- 13 files changed, 331 insertions(+), 98 deletions(-) rename hubspot/crm/objects/calls/models/{batch_input_simple_public_object_input_for_create.py => batch_input_simple_public_object_batch_input_for_create.py} (80%) create mode 100644 hubspot/crm/objects/calls/models/simple_public_object_batch_input_for_create.py diff --git a/hubspot/crm/objects/calls/__init__.py b/hubspot/crm/objects/calls/__init__.py index 974a5447..4b47179d 100644 --- a/hubspot/crm/objects/calls/__init__.py +++ b/hubspot/crm/objects/calls/__init__.py @@ -35,9 +35,9 @@ from hubspot.crm.objects.calls.models.associated_id import AssociatedId from hubspot.crm.objects.calls.models.association_spec import AssociationSpec from hubspot.crm.objects.calls.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.calls.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.calls.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.calls.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.calls.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.calls.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.calls.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.calls.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -59,6 +59,7 @@ from hubspot.crm.objects.calls.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.calls.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.calls.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.calls.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.calls.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.calls.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.calls.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/calls/api/basic_api.py b/hubspot/crm/objects/calls/api/basic_api.py index 92cd2378..0c7b84cd 100644 --- a/hubspot/crm/objects/calls/api/basic_api.py +++ b/hubspot/crm/objects/calls/api/basic_api.py @@ -43,7 +43,7 @@ def archive(self, call_id, **kwargs): # noqa: E501 >>> thread = api.archive(call_id, async_req=True) >>> result = thread.get() - :param call_id: (required) + :param call_id: The ID of the call. (required) :type call_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -73,7 +73,7 @@ def archive_with_http_info(self, call_id, **kwargs): # noqa: E501 >>> thread = api.archive_with_http_info(call_id, async_req=True) >>> result = thread.get() - :param call_id: (required) + :param call_id: The ID of the call. (required) :type call_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -292,7 +292,7 @@ def get_by_id(self, call_id, **kwargs): # noqa: E501 >>> thread = api.get_by_id(call_id, async_req=True) >>> result = thread.get() - :param call_id: (required) + :param call_id: The ID of the call. (required) :type call_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] @@ -332,7 +332,7 @@ def get_by_id_with_http_info(self, call_id, **kwargs): # noqa: E501 >>> thread = api.get_by_id_with_http_info(call_id, async_req=True) >>> result = thread.get() - :param call_id: (required) + :param call_id: The ID of the call. (required) :type call_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] @@ -601,7 +601,7 @@ def update(self, call_id, simple_public_object_input, **kwargs): # noqa: E501 >>> thread = api.update(call_id, simple_public_object_input, async_req=True) >>> result = thread.get() - :param call_id: (required) + :param call_id: The ID of the call. (required) :type call_id: str :param simple_public_object_input: (required) :type simple_public_object_input: SimplePublicObjectInput @@ -635,7 +635,7 @@ def update_with_http_info(self, call_id, simple_public_object_input, **kwargs): >>> thread = api.update_with_http_info(call_id, simple_public_object_input, async_req=True) >>> result = thread.get() - :param call_id: (required) + :param call_id: The ID of the call. (required) :type call_id: str :param simple_public_object_input: (required) :type simple_public_object_input: SimplePublicObjectInput diff --git a/hubspot/crm/objects/calls/api/batch_api.py b/hubspot/crm/objects/calls/api/batch_api.py index 06cc2da8..49ffa000 100644 --- a/hubspot/crm/objects/calls/api/batch_api.py +++ b/hubspot/crm/objects/calls/api/batch_api.py @@ -36,6 +36,7 @@ def __init__(self, api_client=None): def archive(self, batch_input_simple_public_object_id, **kwargs): # noqa: E501 """Archive a batch of calls by ID # noqa: E501 + Archive a batch of calls by ID. Deleted calls can be restored within 90 days of being deleted, but call recordings recording will be permanently deleted. Learn more about [restoring activity records](https://knowledge.hubspot.com/records/restore-deleted-activity-in-a-record). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -65,6 +66,7 @@ def archive(self, 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 calls by ID # noqa: E501 + Archive a batch of calls by ID. Deleted calls can be restored within 90 days of being deleted, but call recordings recording will be permanently deleted. Learn more about [restoring activity records](https://knowledge.hubspot.com/records/restore-deleted-activity-in-a-record). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -157,17 +159,18 @@ def archive_with_http_info(self, batch_input_simple_public_object_id, **kwargs): _request_auth=local_var_params.get("_request_auth"), ) - def create(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of calls # noqa: E501 + Create a batch of calls. The `inputs` array can contain a `properties` object to define property values for each record, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records. # 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) + >>> thread = api.create(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -184,19 +187,20 @@ def create(self, batch_input_simple_public_object_input_for_create, **kwargs): :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 + return self.create_with_http_info(batch_input_simple_public_object_batch_input_for_create, **kwargs) # noqa: E501 - def create_with_http_info(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create_with_http_info(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of calls # noqa: E501 + Create a batch of calls. The `inputs` array can contain a `properties` object to define property values for each record, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records. # 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) + >>> thread = api.create_with_http_info(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :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 @@ -223,7 +227,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat local_var_params = locals() - all_params = ["batch_input_simple_public_object_input_for_create"] + all_params = ["batch_input_simple_public_object_batch_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"]): @@ -231,9 +235,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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 + # verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_for_create` when calling `create`") # noqa: E501 collection_formats = {} @@ -247,8 +251,8 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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"] + if "batch_input_simple_public_object_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_for_create"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -287,6 +291,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of calls by internal ID, or unique property values # noqa: E501 + Retrieve a batch of calls by ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -318,6 +323,7 @@ def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E50 def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of calls by internal ID, or unique property values # noqa: E501 + Retrieve a batch of calls by ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -420,6 +426,7 @@ def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs def update(self, batch_input_simple_public_object_batch_input, **kwargs): # noqa: E501 """Update a batch of calls by internal ID, or unique property values # noqa: E501 + Update a batch of calls by ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -449,6 +456,7 @@ def update(self, batch_input_simple_public_object_batch_input, **kwargs): # noq def update_with_http_info(self, batch_input_simple_public_object_batch_input, **kwargs): # noqa: E501 """Update a batch of calls by internal ID, or unique property values # noqa: E501 + Update a batch of calls by ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/objects/calls/api/search_api.py b/hubspot/crm/objects/calls/api/search_api.py index eecbc1ca..ab153507 100644 --- a/hubspot/crm/objects/calls/api/search_api.py +++ b/hubspot/crm/objects/calls/api/search_api.py @@ -34,8 +34,9 @@ def __init__(self, api_client=None): self.api_client = api_client def do_search(self, public_object_search_request, **kwargs): # noqa: E501 - """do_search # noqa: E501 + """Search for calls # noqa: E501 + Search for calls by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -63,8 +64,9 @@ def do_search(self, public_object_search_request, **kwargs): # noqa: E501 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 + """Search for calls # noqa: E501 + Search for calls by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/objects/calls/models/__init__.py b/hubspot/crm/objects/calls/models/__init__.py index 6058f522..a37926c8 100644 --- a/hubspot/crm/objects/calls/models/__init__.py +++ b/hubspot/crm/objects/calls/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.objects.calls.models.associated_id import AssociatedId from hubspot.crm.objects.calls.models.association_spec import AssociationSpec from hubspot.crm.objects.calls.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.calls.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.calls.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.calls.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.calls.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.calls.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.calls.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.calls.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -41,6 +41,7 @@ from hubspot.crm.objects.calls.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.calls.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.calls.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.calls.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.calls.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.calls.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.calls.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/calls/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/objects/calls/models/batch_input_simple_public_object_batch_input_for_create.py similarity index 80% rename from hubspot/crm/objects/calls/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/objects/calls/models/batch_input_simple_public_object_batch_input_for_create.py index 0126b727..129badfa 100644 --- a/hubspot/crm/objects/calls/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/calls/models/batch_input_simple_public_object_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.objects.calls.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectBatchInputForCreate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class BatchInputSimplePublicObjectInputForCreate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"inputs": "list[SimplePublicObjectInputForCreate]"} + openapi_types = {"inputs": "list[SimplePublicObjectBatchInputForCreate]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 @@ -52,21 +52,21 @@ def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 @property def inputs(self): - """Gets the inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + """Gets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] """ return self._inputs @inputs.setter def inputs(self, inputs): - """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/calls/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/objects/calls/models/batch_read_input_simple_public_object_id.py index b5a15ee2..53a72a82 100644 --- a/hubspot/crm/objects/calls/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/objects/calls/models/batch_read_input_simple_public_object_id.py @@ -84,7 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -95,7 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/objects/calls/models/simple_public_object.py b/hubspot/crm/objects/calls/models/simple_public_object.py index dfd95643..f03fedc8 100644 --- a/hubspot/crm/objects/calls/models/simple_public_object.py +++ b/hubspot/crm/objects/calls/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 diff --git a/hubspot/crm/objects/calls/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/objects/calls/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..b79be3fb --- /dev/null +++ b/hubspot/crm/objects/calls/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Calls + + 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.calls.configuration import Configuration + + +class SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/calls/models/simple_public_object_input.py b/hubspot/crm/objects/calls/models/simple_public_object_input.py index 17aa08f4..acdb2baa 100644 --- a/hubspot/crm/objects/calls/models/simple_public_object_input.py +++ b/hubspot/crm/objects/calls/models/simple_public_object_input.py @@ -35,45 +35,21 @@ class SimplePublicObjectInput(object): 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]"} + openapi_types = {"properties": "dict[str, str]"} - attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"properties": "properties"} - def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, 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 diff --git a/hubspot/crm/objects/calls/models/simple_public_object_input_for_create.py b/hubspot/crm/objects/calls/models/simple_public_object_input_for_create.py index c02c9c59..6078cc26 100644 --- a/hubspot/crm/objects/calls/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/calls/models/simple_public_object_input_for_create.py @@ -35,24 +35,22 @@ class SimplePublicObjectInputForCreate(object): 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]"} + openapi_types = {"associations": "list[PublicAssociationsForObject]", "properties": "dict[str, str]"} - attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"associations": "associations", "properties": "properties"} - def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, associations=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 + if associations is not None: + self.associations = associations self.properties = properties @property @@ -73,32 +71,9 @@ def associations(self, associations): :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 diff --git a/hubspot/crm/objects/calls/models/simple_public_object_with_associations.py b/hubspot/crm/objects/calls/models/simple_public_object_with_associations.py index eb2eb840..e205eec8 100644 --- a/hubspot/crm/objects/calls/models/simple_public_object_with_associations.py +++ b/hubspot/crm/objects/calls/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -218,6 +233,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 diff --git a/hubspot/crm/objects/calls/models/simple_public_upsert_object.py b/hubspot/crm/objects/calls/models/simple_public_upsert_object.py index 9e484a96..4dad6879 100644 --- a/hubspot/crm/objects/calls/models/simple_public_upsert_object.py +++ b/hubspot/crm/objects/calls/models/simple_public_upsert_object.py @@ -42,6 +42,7 @@ class SimplePublicUpsertObject(object): "new": "bool", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicUpsertObject(object): "new": "new", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._new = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -84,6 +97,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -219,6 +234,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. # noqa: E501 From e4becc16a8a3be3b0ba325d3d25e17f14d79c71a Mon Sep 17 00:00:00 2001 From: alexey Date: Thu, 3 Apr 2025 13:34:15 +0300 Subject: [PATCH 17/49] Codegen Crm Objects Communications --- .../crm/objects/communications/__init__.py | 3 +- .../objects/communications/api/basic_api.py | 12 +- .../objects/communications/api/batch_api.py | 38 ++-- .../objects/communications/api/search_api.py | 6 +- .../objects/communications/models/__init__.py | 3 +- ...e_public_object_batch_input_for_create.py} | 22 +-- ...atch_read_input_simple_public_object_id.py | 4 +- .../models/simple_public_object.py | 30 +++- ...le_public_object_batch_input_for_create.py | 170 ++++++++++++++++++ .../models/simple_public_object_input.py | 30 +--- .../simple_public_object_input_for_create.py | 35 +--- .../simple_public_object_with_associations.py | 38 +++- .../models/simple_public_upsert_object.py | 38 +++- 13 files changed, 331 insertions(+), 98 deletions(-) rename hubspot/crm/objects/communications/models/{batch_input_simple_public_object_input_for_create.py => batch_input_simple_public_object_batch_input_for_create.py} (80%) create mode 100644 hubspot/crm/objects/communications/models/simple_public_object_batch_input_for_create.py diff --git a/hubspot/crm/objects/communications/__init__.py b/hubspot/crm/objects/communications/__init__.py index 9d32f026..e7801137 100644 --- a/hubspot/crm/objects/communications/__init__.py +++ b/hubspot/crm/objects/communications/__init__.py @@ -35,9 +35,9 @@ from hubspot.crm.objects.communications.models.associated_id import AssociatedId from hubspot.crm.objects.communications.models.association_spec import AssociationSpec from hubspot.crm.objects.communications.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.communications.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.communications.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.communications.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.communications.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.communications.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.communications.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.communications.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -59,6 +59,7 @@ from hubspot.crm.objects.communications.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.communications.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.communications.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.communications.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.communications.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.communications.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.communications.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/communications/api/basic_api.py b/hubspot/crm/objects/communications/api/basic_api.py index a4175e2b..50f442d0 100644 --- a/hubspot/crm/objects/communications/api/basic_api.py +++ b/hubspot/crm/objects/communications/api/basic_api.py @@ -43,7 +43,7 @@ def archive(self, communication_id, **kwargs): # noqa: E501 >>> thread = api.archive(communication_id, async_req=True) >>> result = thread.get() - :param communication_id: (required) + :param communication_id: The ID of the message to update. (required) :type communication_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -73,7 +73,7 @@ def archive_with_http_info(self, communication_id, **kwargs): # noqa: E501 >>> thread = api.archive_with_http_info(communication_id, async_req=True) >>> result = thread.get() - :param communication_id: (required) + :param communication_id: The ID of the message to update. (required) :type communication_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -292,7 +292,7 @@ def get_by_id(self, communication_id, **kwargs): # noqa: E501 >>> thread = api.get_by_id(communication_id, async_req=True) >>> result = thread.get() - :param communication_id: (required) + :param communication_id: The ID of the message to retrieve. (required) :type communication_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] @@ -332,7 +332,7 @@ def get_by_id_with_http_info(self, communication_id, **kwargs): # noqa: E501 >>> thread = api.get_by_id_with_http_info(communication_id, async_req=True) >>> result = thread.get() - :param communication_id: (required) + :param communication_id: The ID of the message to retrieve. (required) :type communication_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] @@ -601,7 +601,7 @@ def update(self, communication_id, simple_public_object_input, **kwargs): # noq >>> thread = api.update(communication_id, simple_public_object_input, async_req=True) >>> result = thread.get() - :param communication_id: (required) + :param communication_id: The ID of the communication to update. (required) :type communication_id: str :param simple_public_object_input: (required) :type simple_public_object_input: SimplePublicObjectInput @@ -635,7 +635,7 @@ def update_with_http_info(self, communication_id, simple_public_object_input, ** >>> thread = api.update_with_http_info(communication_id, simple_public_object_input, async_req=True) >>> result = thread.get() - :param communication_id: (required) + :param communication_id: The ID of the communication to update. (required) :type communication_id: str :param simple_public_object_input: (required) :type simple_public_object_input: SimplePublicObjectInput diff --git a/hubspot/crm/objects/communications/api/batch_api.py b/hubspot/crm/objects/communications/api/batch_api.py index ebbc2eca..f4ab06ea 100644 --- a/hubspot/crm/objects/communications/api/batch_api.py +++ b/hubspot/crm/objects/communications/api/batch_api.py @@ -36,6 +36,7 @@ def __init__(self, api_client=None): def archive(self, batch_input_simple_public_object_id, **kwargs): # noqa: E501 """Archive a batch of communications by ID # noqa: E501 + Delete a batch of messages by ID. A deleted message can be restored within 90 days of being deleted. Learn more about [restoring activity records](https://knowledge.hubspot.com/records/restore-deleted-activity-in-a-record). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -65,6 +66,7 @@ def archive(self, 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 communications by ID # noqa: E501 + Delete a batch of messages by ID. A deleted message can be restored within 90 days of being deleted. Learn more about [restoring activity records](https://knowledge.hubspot.com/records/restore-deleted-activity-in-a-record). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -157,17 +159,18 @@ def archive_with_http_info(self, batch_input_simple_public_object_id, **kwargs): _request_auth=local_var_params.get("_request_auth"), ) - def create(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of communications # noqa: E501 + Create a batch of messages. The `inputs` array can contain a `properties` object to define property values for each message, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records. # 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) + >>> thread = api.create(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -184,19 +187,20 @@ def create(self, batch_input_simple_public_object_input_for_create, **kwargs): :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 + return self.create_with_http_info(batch_input_simple_public_object_batch_input_for_create, **kwargs) # noqa: E501 - def create_with_http_info(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create_with_http_info(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of communications # noqa: E501 + Create a batch of messages. The `inputs` array can contain a `properties` object to define property values for each message, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records. # 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) + >>> thread = api.create_with_http_info(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :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 @@ -223,7 +227,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat local_var_params = locals() - all_params = ["batch_input_simple_public_object_input_for_create"] + all_params = ["batch_input_simple_public_object_batch_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"]): @@ -231,9 +235,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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 + # verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_for_create` when calling `create`") # noqa: E501 collection_formats = {} @@ -247,8 +251,8 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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"] + if "batch_input_simple_public_object_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_for_create"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -287,6 +291,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of communications by internal ID, or unique property values # noqa: E501 + Retrieve a batch of messages by ID (`communicationId`) or unique property value (`idProperty`). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -318,6 +323,7 @@ def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E50 def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of communications by internal ID, or unique property values # noqa: E501 + Retrieve a batch of messages by ID (`communicationId`) or unique property value (`idProperty`). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -420,6 +426,7 @@ def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs def update(self, batch_input_simple_public_object_batch_input, **kwargs): # noqa: E501 """Update a batch of communications by internal ID, or unique property values # noqa: E501 + Update a batch of messages by ID (`communicationId`) or unique property value (`idProperty`). 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 @@ -449,6 +456,7 @@ def update(self, batch_input_simple_public_object_batch_input, **kwargs): # noq def update_with_http_info(self, batch_input_simple_public_object_batch_input, **kwargs): # noqa: E501 """Update a batch of communications by internal ID, or unique property values # noqa: E501 + Update a batch of messages by ID (`communicationId`) or unique property value (`idProperty`). 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 diff --git a/hubspot/crm/objects/communications/api/search_api.py b/hubspot/crm/objects/communications/api/search_api.py index 06785815..73e6c783 100644 --- a/hubspot/crm/objects/communications/api/search_api.py +++ b/hubspot/crm/objects/communications/api/search_api.py @@ -34,8 +34,9 @@ def __init__(self, api_client=None): self.api_client = api_client def do_search(self, public_object_search_request, **kwargs): # noqa: E501 - """do_search # noqa: E501 + """Search for messages # noqa: E501 + Search for messages by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -63,8 +64,9 @@ def do_search(self, public_object_search_request, **kwargs): # noqa: E501 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 + """Search for messages # noqa: E501 + Search for messages by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/objects/communications/models/__init__.py b/hubspot/crm/objects/communications/models/__init__.py index a98e2b40..15060237 100644 --- a/hubspot/crm/objects/communications/models/__init__.py +++ b/hubspot/crm/objects/communications/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.objects.communications.models.associated_id import AssociatedId from hubspot.crm.objects.communications.models.association_spec import AssociationSpec from hubspot.crm.objects.communications.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.communications.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.communications.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.communications.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.communications.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.communications.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.communications.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.communications.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -41,6 +41,7 @@ from hubspot.crm.objects.communications.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.communications.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.communications.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.communications.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.communications.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.communications.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.communications.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/communications/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/objects/communications/models/batch_input_simple_public_object_batch_input_for_create.py similarity index 80% rename from hubspot/crm/objects/communications/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/objects/communications/models/batch_input_simple_public_object_batch_input_for_create.py index 7d195c12..cfd13ec6 100644 --- a/hubspot/crm/objects/communications/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/communications/models/batch_input_simple_public_object_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.objects.communications.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectBatchInputForCreate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class BatchInputSimplePublicObjectInputForCreate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"inputs": "list[SimplePublicObjectInputForCreate]"} + openapi_types = {"inputs": "list[SimplePublicObjectBatchInputForCreate]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 @@ -52,21 +52,21 @@ def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 @property def inputs(self): - """Gets the inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + """Gets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] """ return self._inputs @inputs.setter def inputs(self, inputs): - """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/communications/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/objects/communications/models/batch_read_input_simple_public_object_id.py index e013d36a..0eb79128 100644 --- a/hubspot/crm/objects/communications/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/objects/communications/models/batch_read_input_simple_public_object_id.py @@ -84,7 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -95,7 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/objects/communications/models/simple_public_object.py b/hubspot/crm/objects/communications/models/simple_public_object.py index 07e8b1e9..1bc6643b 100644 --- a/hubspot/crm/objects/communications/models/simple_public_object.py +++ b/hubspot/crm/objects/communications/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 diff --git a/hubspot/crm/objects/communications/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/objects/communications/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..2e6dd3ea --- /dev/null +++ b/hubspot/crm/objects/communications/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Communications + + 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.communications.configuration import Configuration + + +class SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/communications/models/simple_public_object_input.py b/hubspot/crm/objects/communications/models/simple_public_object_input.py index 23d73090..7ee07c2a 100644 --- a/hubspot/crm/objects/communications/models/simple_public_object_input.py +++ b/hubspot/crm/objects/communications/models/simple_public_object_input.py @@ -35,45 +35,21 @@ class SimplePublicObjectInput(object): 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]"} + openapi_types = {"properties": "dict[str, str]"} - attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"properties": "properties"} - def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, 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 diff --git a/hubspot/crm/objects/communications/models/simple_public_object_input_for_create.py b/hubspot/crm/objects/communications/models/simple_public_object_input_for_create.py index d482056d..d9b9a2b3 100644 --- a/hubspot/crm/objects/communications/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/communications/models/simple_public_object_input_for_create.py @@ -35,24 +35,22 @@ class SimplePublicObjectInputForCreate(object): 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]"} + openapi_types = {"associations": "list[PublicAssociationsForObject]", "properties": "dict[str, str]"} - attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"associations": "associations", "properties": "properties"} - def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, associations=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 + if associations is not None: + self.associations = associations self.properties = properties @property @@ -73,32 +71,9 @@ def associations(self, associations): :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 diff --git a/hubspot/crm/objects/communications/models/simple_public_object_with_associations.py b/hubspot/crm/objects/communications/models/simple_public_object_with_associations.py index 7be060ae..39442b34 100644 --- a/hubspot/crm/objects/communications/models/simple_public_object_with_associations.py +++ b/hubspot/crm/objects/communications/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -218,6 +233,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 diff --git a/hubspot/crm/objects/communications/models/simple_public_upsert_object.py b/hubspot/crm/objects/communications/models/simple_public_upsert_object.py index 0f706ebb..ba0bc223 100644 --- a/hubspot/crm/objects/communications/models/simple_public_upsert_object.py +++ b/hubspot/crm/objects/communications/models/simple_public_upsert_object.py @@ -42,6 +42,7 @@ class SimplePublicUpsertObject(object): "new": "bool", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicUpsertObject(object): "new": "new", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._new = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -84,6 +97,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -219,6 +234,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. # noqa: E501 From 1fa2bc408af4e3432a5216ca41ab3b5a6983cea8 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 8 Apr 2025 09:22:48 +0300 Subject: [PATCH 18/49] Codegen Crm Objects Emails --- hubspot/crm/objects/emails/__init__.py | 3 +- hubspot/crm/objects/emails/api/batch_api.py | 32 ++-- hubspot/crm/objects/emails/models/__init__.py | 3 +- ...e_public_object_batch_input_for_create.py} | 22 +-- ...atch_read_input_simple_public_object_id.py | 4 +- .../emails/models/simple_public_object.py | 30 +++- ...le_public_object_batch_input_for_create.py | 170 ++++++++++++++++++ .../models/simple_public_object_input.py | 30 +--- .../simple_public_object_input_for_create.py | 35 +--- .../simple_public_object_with_associations.py | 38 +++- .../models/simple_public_upsert_object.py | 38 +++- 11 files changed, 315 insertions(+), 90 deletions(-) rename hubspot/crm/objects/emails/models/{batch_input_simple_public_object_input_for_create.py => batch_input_simple_public_object_batch_input_for_create.py} (80%) create mode 100644 hubspot/crm/objects/emails/models/simple_public_object_batch_input_for_create.py diff --git a/hubspot/crm/objects/emails/__init__.py b/hubspot/crm/objects/emails/__init__.py index ac1031f8..80321616 100644 --- a/hubspot/crm/objects/emails/__init__.py +++ b/hubspot/crm/objects/emails/__init__.py @@ -35,9 +35,9 @@ from hubspot.crm.objects.emails.models.associated_id import AssociatedId from hubspot.crm.objects.emails.models.association_spec import AssociationSpec from hubspot.crm.objects.emails.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.emails.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.emails.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.emails.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.emails.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.emails.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.emails.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.emails.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -59,6 +59,7 @@ from hubspot.crm.objects.emails.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.emails.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.emails.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.emails.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.emails.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.emails.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.emails.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/emails/api/batch_api.py b/hubspot/crm/objects/emails/api/batch_api.py index 5bf9be2e..5a66515f 100644 --- a/hubspot/crm/objects/emails/api/batch_api.py +++ b/hubspot/crm/objects/emails/api/batch_api.py @@ -157,17 +157,17 @@ def archive_with_http_info(self, batch_input_simple_public_object_id, **kwargs): _request_auth=local_var_params.get("_request_auth"), ) - def create(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of emails # 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) + >>> thread = api.create(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -184,19 +184,19 @@ def create(self, batch_input_simple_public_object_input_for_create, **kwargs): :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 + return self.create_with_http_info(batch_input_simple_public_object_batch_input_for_create, **kwargs) # noqa: E501 - def create_with_http_info(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create_with_http_info(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of emails # 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) + >>> thread = api.create_with_http_info(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :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 @@ -223,7 +223,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat local_var_params = locals() - all_params = ["batch_input_simple_public_object_input_for_create"] + all_params = ["batch_input_simple_public_object_batch_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"]): @@ -231,9 +231,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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 + # verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_for_create` when calling `create`") # noqa: E501 collection_formats = {} @@ -247,8 +247,8 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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"] + if "batch_input_simple_public_object_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_for_create"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -287,6 +287,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of emails by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -318,6 +319,7 @@ def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E50 def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of emails by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/objects/emails/models/__init__.py b/hubspot/crm/objects/emails/models/__init__.py index e148db3e..a7b7baba 100644 --- a/hubspot/crm/objects/emails/models/__init__.py +++ b/hubspot/crm/objects/emails/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.objects.emails.models.associated_id import AssociatedId from hubspot.crm.objects.emails.models.association_spec import AssociationSpec from hubspot.crm.objects.emails.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.emails.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.emails.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.emails.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.emails.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.emails.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.emails.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.emails.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -41,6 +41,7 @@ from hubspot.crm.objects.emails.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.emails.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.emails.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.emails.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.emails.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.emails.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.emails.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/emails/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/objects/emails/models/batch_input_simple_public_object_batch_input_for_create.py similarity index 80% rename from hubspot/crm/objects/emails/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/objects/emails/models/batch_input_simple_public_object_batch_input_for_create.py index 2940c074..45fbd20d 100644 --- a/hubspot/crm/objects/emails/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/emails/models/batch_input_simple_public_object_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.objects.emails.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectBatchInputForCreate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class BatchInputSimplePublicObjectInputForCreate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"inputs": "list[SimplePublicObjectInputForCreate]"} + openapi_types = {"inputs": "list[SimplePublicObjectBatchInputForCreate]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 @@ -52,21 +52,21 @@ def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 @property def inputs(self): - """Gets the inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + """Gets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] """ return self._inputs @inputs.setter def inputs(self, inputs): - """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/emails/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/objects/emails/models/batch_read_input_simple_public_object_id.py index 79de0fe5..b3d2227f 100644 --- a/hubspot/crm/objects/emails/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/objects/emails/models/batch_read_input_simple_public_object_id.py @@ -84,7 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -95,7 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/objects/emails/models/simple_public_object.py b/hubspot/crm/objects/emails/models/simple_public_object.py index 736a3f47..6663cdce 100644 --- a/hubspot/crm/objects/emails/models/simple_public_object.py +++ b/hubspot/crm/objects/emails/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 diff --git a/hubspot/crm/objects/emails/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/objects/emails/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..86d35140 --- /dev/null +++ b/hubspot/crm/objects/emails/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Emails + + 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.emails.configuration import Configuration + + +class SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/emails/models/simple_public_object_input.py b/hubspot/crm/objects/emails/models/simple_public_object_input.py index 933b8b55..ea761211 100644 --- a/hubspot/crm/objects/emails/models/simple_public_object_input.py +++ b/hubspot/crm/objects/emails/models/simple_public_object_input.py @@ -35,45 +35,21 @@ class SimplePublicObjectInput(object): 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]"} + openapi_types = {"properties": "dict[str, str]"} - attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"properties": "properties"} - def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, 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 diff --git a/hubspot/crm/objects/emails/models/simple_public_object_input_for_create.py b/hubspot/crm/objects/emails/models/simple_public_object_input_for_create.py index 17777acc..3357f67a 100644 --- a/hubspot/crm/objects/emails/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/emails/models/simple_public_object_input_for_create.py @@ -35,24 +35,22 @@ class SimplePublicObjectInputForCreate(object): 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]"} + openapi_types = {"associations": "list[PublicAssociationsForObject]", "properties": "dict[str, str]"} - attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"associations": "associations", "properties": "properties"} - def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, associations=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 + if associations is not None: + self.associations = associations self.properties = properties @property @@ -73,32 +71,9 @@ def associations(self, associations): :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 diff --git a/hubspot/crm/objects/emails/models/simple_public_object_with_associations.py b/hubspot/crm/objects/emails/models/simple_public_object_with_associations.py index 7a726194..8a8d2e53 100644 --- a/hubspot/crm/objects/emails/models/simple_public_object_with_associations.py +++ b/hubspot/crm/objects/emails/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -218,6 +233,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 diff --git a/hubspot/crm/objects/emails/models/simple_public_upsert_object.py b/hubspot/crm/objects/emails/models/simple_public_upsert_object.py index b6f2d6d8..070da6a4 100644 --- a/hubspot/crm/objects/emails/models/simple_public_upsert_object.py +++ b/hubspot/crm/objects/emails/models/simple_public_upsert_object.py @@ -42,6 +42,7 @@ class SimplePublicUpsertObject(object): "new": "bool", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicUpsertObject(object): "new": "new", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._new = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -84,6 +97,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -219,6 +234,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. # noqa: E501 From 6daeb0091578e115c4803c84a6d2c5b4e36f4443 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 8 Apr 2025 09:26:33 +0300 Subject: [PATCH 19/49] Codegen Crm Objects Deal Splits --- hubspot/crm/objects/deal_splits/__init__.py | 45 ++ .../crm/objects/deal_splits/api/__init__.py | 6 + .../crm/objects/deal_splits/api/batch_api.py | 288 ++++++++ hubspot/crm/objects/deal_splits/api_client.py | 664 ++++++++++++++++++ .../crm/objects/deal_splits/configuration.py | 439 ++++++++++++ hubspot/crm/objects/deal_splits/exceptions.py | 155 ++++ .../objects/deal_splits/models/__init__.py | 29 + .../models/batch_input_public_object_id.py | 122 ++++ .../batch_response_deal_to_deal_splits.py | 248 +++++++ ...esponse_deal_to_deal_splits_with_errors.py | 314 +++++++++ .../deal_splits/models/deal_to_deal_splits.py | 147 ++++ .../crm/objects/deal_splits/models/error.py | 282 ++++++++ .../deal_splits/models/error_detail.py | 228 ++++++ .../models/public_deal_split_input.py | 147 ++++ ...public_deal_splits_batch_create_request.py | 122 ++++ .../public_deal_splits_create_request.py | 147 ++++ .../deal_splits/models/public_object_id.py | 122 ++++ .../models/simple_public_object.py | 285 ++++++++ .../deal_splits/models/standard_error.py | 318 +++++++++ .../models/value_with_timestamp.py | 244 +++++++ hubspot/crm/objects/deal_splits/rest.py | 213 ++++++ 21 files changed, 4565 insertions(+) create mode 100644 hubspot/crm/objects/deal_splits/__init__.py create mode 100644 hubspot/crm/objects/deal_splits/api/__init__.py create mode 100644 hubspot/crm/objects/deal_splits/api/batch_api.py create mode 100644 hubspot/crm/objects/deal_splits/api_client.py create mode 100644 hubspot/crm/objects/deal_splits/configuration.py create mode 100644 hubspot/crm/objects/deal_splits/exceptions.py create mode 100644 hubspot/crm/objects/deal_splits/models/__init__.py create mode 100644 hubspot/crm/objects/deal_splits/models/batch_input_public_object_id.py create mode 100644 hubspot/crm/objects/deal_splits/models/batch_response_deal_to_deal_splits.py create mode 100644 hubspot/crm/objects/deal_splits/models/batch_response_deal_to_deal_splits_with_errors.py create mode 100644 hubspot/crm/objects/deal_splits/models/deal_to_deal_splits.py create mode 100644 hubspot/crm/objects/deal_splits/models/error.py create mode 100644 hubspot/crm/objects/deal_splits/models/error_detail.py create mode 100644 hubspot/crm/objects/deal_splits/models/public_deal_split_input.py create mode 100644 hubspot/crm/objects/deal_splits/models/public_deal_splits_batch_create_request.py create mode 100644 hubspot/crm/objects/deal_splits/models/public_deal_splits_create_request.py create mode 100644 hubspot/crm/objects/deal_splits/models/public_object_id.py create mode 100644 hubspot/crm/objects/deal_splits/models/simple_public_object.py create mode 100644 hubspot/crm/objects/deal_splits/models/standard_error.py create mode 100644 hubspot/crm/objects/deal_splits/models/value_with_timestamp.py create mode 100644 hubspot/crm/objects/deal_splits/rest.py diff --git a/hubspot/crm/objects/deal_splits/__init__.py b/hubspot/crm/objects/deal_splits/__init__.py new file mode 100644 index 00000000..27138016 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/__init__.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +# flake8: noqa + +""" + CRM Deal Splits + + 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.deal_splits.api.batch_api import BatchApi + +# import ApiClient +from hubspot.crm.objects.deal_splits.api_client import ApiClient +from hubspot.crm.objects.deal_splits.configuration import Configuration +from hubspot.crm.objects.deal_splits.exceptions import OpenApiException +from hubspot.crm.objects.deal_splits.exceptions import ApiTypeError +from hubspot.crm.objects.deal_splits.exceptions import ApiValueError +from hubspot.crm.objects.deal_splits.exceptions import ApiKeyError +from hubspot.crm.objects.deal_splits.exceptions import ApiAttributeError +from hubspot.crm.objects.deal_splits.exceptions import ApiException + +# import models into sdk package +from hubspot.crm.objects.deal_splits.models.batch_input_public_object_id import BatchInputPublicObjectId +from hubspot.crm.objects.deal_splits.models.batch_response_deal_to_deal_splits import BatchResponseDealToDealSplits +from hubspot.crm.objects.deal_splits.models.batch_response_deal_to_deal_splits_with_errors import BatchResponseDealToDealSplitsWithErrors +from hubspot.crm.objects.deal_splits.models.deal_to_deal_splits import DealToDealSplits +from hubspot.crm.objects.deal_splits.models.error import Error +from hubspot.crm.objects.deal_splits.models.error_detail import ErrorDetail +from hubspot.crm.objects.deal_splits.models.public_deal_split_input import PublicDealSplitInput +from hubspot.crm.objects.deal_splits.models.public_deal_splits_batch_create_request import PublicDealSplitsBatchCreateRequest +from hubspot.crm.objects.deal_splits.models.public_deal_splits_create_request import PublicDealSplitsCreateRequest +from hubspot.crm.objects.deal_splits.models.public_object_id import PublicObjectId +from hubspot.crm.objects.deal_splits.models.simple_public_object import SimplePublicObject +from hubspot.crm.objects.deal_splits.models.standard_error import StandardError +from hubspot.crm.objects.deal_splits.models.value_with_timestamp import ValueWithTimestamp diff --git a/hubspot/crm/objects/deal_splits/api/__init__.py b/hubspot/crm/objects/deal_splits/api/__init__.py new file mode 100644 index 00000000..1eeafbce --- /dev/null +++ b/hubspot/crm/objects/deal_splits/api/__init__.py @@ -0,0 +1,6 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from hubspot.crm.objects.deal_splits.api.batch_api import BatchApi diff --git a/hubspot/crm/objects/deal_splits/api/batch_api.py b/hubspot/crm/objects/deal_splits/api/batch_api.py new file mode 100644 index 00000000..d4013d25 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/api/batch_api.py @@ -0,0 +1,288 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.api_client import ApiClient +from hubspot.crm.objects.deal_splits.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 read(self, batch_input_public_object_id, **kwargs): # noqa: E501 + """Read a batch of deal split objects by their associated deal object internal 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.read(batch_input_public_object_id, async_req=True) + >>> result = thread.get() + + :param batch_input_public_object_id: (required) + :type batch_input_public_object_id: BatchInputPublicObjectId + :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: BatchResponseDealToDealSplits + """ + kwargs["_return_http_data_only"] = True + return self.read_with_http_info(batch_input_public_object_id, **kwargs) # noqa: E501 + + def read_with_http_info(self, batch_input_public_object_id, **kwargs): # noqa: E501 + """Read a batch of deal split objects by their associated deal object internal 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.read_with_http_info(batch_input_public_object_id, async_req=True) + >>> result = thread.get() + + :param batch_input_public_object_id: (required) + :type batch_input_public_object_id: BatchInputPublicObjectId + :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(BatchResponseDealToDealSplits, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["batch_input_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 read" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'batch_input_public_object_id' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_public_object_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_public_object_id` when calling `read`") # 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_public_object_id" in local_var_params: + body_params = local_var_params["batch_input_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: "BatchResponseDealToDealSplits", + 207: "BatchResponseDealToDealSplitsWithErrors", + } + + return self.api_client.call_api( + "/crm/v3/objects/deals/splits/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 upsert(self, public_deal_splits_batch_create_request, **kwargs): # noqa: E501 + """Create or replace deal splits for deals with the provided IDs. Deal split percentages for each deal must sum up to 1.0 (100%) and may have up to 8 decimal places # 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(public_deal_splits_batch_create_request, async_req=True) + >>> result = thread.get() + + :param public_deal_splits_batch_create_request: (required) + :type public_deal_splits_batch_create_request: PublicDealSplitsBatchCreateRequest + :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: BatchResponseDealToDealSplits + """ + kwargs["_return_http_data_only"] = True + return self.upsert_with_http_info(public_deal_splits_batch_create_request, **kwargs) # noqa: E501 + + def upsert_with_http_info(self, public_deal_splits_batch_create_request, **kwargs): # noqa: E501 + """Create or replace deal splits for deals with the provided IDs. Deal split percentages for each deal must sum up to 1.0 (100%) and may have up to 8 decimal places # 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(public_deal_splits_batch_create_request, async_req=True) + >>> result = thread.get() + + :param public_deal_splits_batch_create_request: (required) + :type public_deal_splits_batch_create_request: PublicDealSplitsBatchCreateRequest + :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(BatchResponseDealToDealSplits, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["public_deal_splits_batch_create_request"] + all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method upsert" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'public_deal_splits_batch_create_request' is set + if self.api_client.client_side_validation and local_var_params.get("public_deal_splits_batch_create_request") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `public_deal_splits_batch_create_request` 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 "public_deal_splits_batch_create_request" in local_var_params: + body_params = local_var_params["public_deal_splits_batch_create_request"] + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get("_content_type", self.api_client.select_header_content_type(["application/json"], "POST", body_params)) # noqa: E501 + if content_types_list: + header_params["Content-Type"] = content_types_list + + # Authentication setting + auth_settings = ["oauth2"] # noqa: E501 + + response_types_map = { + 200: "BatchResponseDealToDealSplits", + 207: "BatchResponseDealToDealSplitsWithErrors", + } + + return self.api_client.call_api( + "/crm/v3/objects/deals/splits/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/deal_splits/api_client.py b/hubspot/crm/objects/deal_splits/api_client.py new file mode 100644 index 00000000..6affe49a --- /dev/null +++ b/hubspot/crm/objects/deal_splits/api_client.py @@ -0,0 +1,664 @@ +# coding: utf-8 +""" + CRM Deal Splits + + 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.deal_splits.configuration import Configuration +import hubspot.crm.objects.deal_splits.models +from hubspot.crm.objects.deal_splits import rest +from hubspot.crm.objects.deal_splits.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.deal_splits.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/deal_splits/configuration.py b/hubspot/crm/objects/deal_splits/configuration.py new file mode 100644 index 00000000..a6fafadd --- /dev/null +++ b/hubspot/crm/objects/deal_splits/configuration.py @@ -0,0 +1,439 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.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.deal_splits") + 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/deal_splits/exceptions.py b/hubspot/crm/objects/deal_splits/exceptions.py new file mode 100644 index 00000000..545552a8 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/exceptions.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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/deal_splits/models/__init__.py b/hubspot/crm/objects/deal_splits/models/__init__.py new file mode 100644 index 00000000..5d1fedc5 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/models/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +# flake8: noqa +""" + CRM Deal Splits + + 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.deal_splits.models.batch_input_public_object_id import BatchInputPublicObjectId +from hubspot.crm.objects.deal_splits.models.batch_response_deal_to_deal_splits import BatchResponseDealToDealSplits +from hubspot.crm.objects.deal_splits.models.batch_response_deal_to_deal_splits_with_errors import BatchResponseDealToDealSplitsWithErrors +from hubspot.crm.objects.deal_splits.models.deal_to_deal_splits import DealToDealSplits +from hubspot.crm.objects.deal_splits.models.error import Error +from hubspot.crm.objects.deal_splits.models.error_detail import ErrorDetail +from hubspot.crm.objects.deal_splits.models.public_deal_split_input import PublicDealSplitInput +from hubspot.crm.objects.deal_splits.models.public_deal_splits_batch_create_request import PublicDealSplitsBatchCreateRequest +from hubspot.crm.objects.deal_splits.models.public_deal_splits_create_request import PublicDealSplitsCreateRequest +from hubspot.crm.objects.deal_splits.models.public_object_id import PublicObjectId +from hubspot.crm.objects.deal_splits.models.simple_public_object import SimplePublicObject +from hubspot.crm.objects.deal_splits.models.standard_error import StandardError +from hubspot.crm.objects.deal_splits.models.value_with_timestamp import ValueWithTimestamp diff --git a/hubspot/crm/objects/deal_splits/models/batch_input_public_object_id.py b/hubspot/crm/objects/deal_splits/models/batch_input_public_object_id.py new file mode 100644 index 00000000..dfd53781 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/models/batch_input_public_object_id.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.configuration import Configuration + + +class BatchInputPublicObjectId(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[PublicObjectId]"} + + attribute_map = {"inputs": "inputs"} + + def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 + """BatchInputPublicObjectId - 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 BatchInputPublicObjectId. # noqa: E501 + + + :return: The inputs of this BatchInputPublicObjectId. # noqa: E501 + :rtype: list[PublicObjectId] + """ + return self._inputs + + @inputs.setter + def inputs(self, inputs): + """Sets the inputs of this BatchInputPublicObjectId. + + + :param inputs: The inputs of this BatchInputPublicObjectId. # noqa: E501 + :type inputs: list[PublicObjectId] + """ + 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, BatchInputPublicObjectId): + 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, BatchInputPublicObjectId): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/deal_splits/models/batch_response_deal_to_deal_splits.py b/hubspot/crm/objects/deal_splits/models/batch_response_deal_to_deal_splits.py new file mode 100644 index 00000000..2d46cab9 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/models/batch_response_deal_to_deal_splits.py @@ -0,0 +1,248 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.configuration import Configuration + + +class BatchResponseDealToDealSplits(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[DealToDealSplits]", "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 + """BatchResponseDealToDealSplits - 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 BatchResponseDealToDealSplits. # noqa: E501 + + + :return: The completed_at of this BatchResponseDealToDealSplits. # noqa: E501 + :rtype: datetime + """ + return self._completed_at + + @completed_at.setter + def completed_at(self, completed_at): + """Sets the completed_at of this BatchResponseDealToDealSplits. + + + :param completed_at: The completed_at of this BatchResponseDealToDealSplits. # 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 BatchResponseDealToDealSplits. # noqa: E501 + + + :return: The requested_at of this BatchResponseDealToDealSplits. # noqa: E501 + :rtype: datetime + """ + return self._requested_at + + @requested_at.setter + def requested_at(self, requested_at): + """Sets the requested_at of this BatchResponseDealToDealSplits. + + + :param requested_at: The requested_at of this BatchResponseDealToDealSplits. # noqa: E501 + :type requested_at: datetime + """ + + self._requested_at = requested_at + + @property + def started_at(self): + """Gets the started_at of this BatchResponseDealToDealSplits. # noqa: E501 + + + :return: The started_at of this BatchResponseDealToDealSplits. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this BatchResponseDealToDealSplits. + + + :param started_at: The started_at of this BatchResponseDealToDealSplits. # 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 BatchResponseDealToDealSplits. # noqa: E501 + + + :return: The links of this BatchResponseDealToDealSplits. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this BatchResponseDealToDealSplits. + + + :param links: The links of this BatchResponseDealToDealSplits. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def results(self): + """Gets the results of this BatchResponseDealToDealSplits. # noqa: E501 + + + :return: The results of this BatchResponseDealToDealSplits. # noqa: E501 + :rtype: list[DealToDealSplits] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this BatchResponseDealToDealSplits. + + + :param results: The results of this BatchResponseDealToDealSplits. # noqa: E501 + :type results: list[DealToDealSplits] + """ + 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 BatchResponseDealToDealSplits. # noqa: E501 + + + :return: The status of this BatchResponseDealToDealSplits. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this BatchResponseDealToDealSplits. + + + :param status: The status of this BatchResponseDealToDealSplits. # 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, BatchResponseDealToDealSplits): + 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, BatchResponseDealToDealSplits): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/deal_splits/models/batch_response_deal_to_deal_splits_with_errors.py b/hubspot/crm/objects/deal_splits/models/batch_response_deal_to_deal_splits_with_errors.py new file mode 100644 index 00000000..765aa180 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/models/batch_response_deal_to_deal_splits_with_errors.py @@ -0,0 +1,314 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.configuration import Configuration + + +class BatchResponseDealToDealSplitsWithErrors(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[DealToDealSplits]", + "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 + """BatchResponseDealToDealSplitsWithErrors - 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 BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + + + :return: The completed_at of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._completed_at + + @completed_at.setter + def completed_at(self, completed_at): + """Sets the completed_at of this BatchResponseDealToDealSplitsWithErrors. + + + :param completed_at: The completed_at of this BatchResponseDealToDealSplitsWithErrors. # 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 BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + + + :return: The num_errors of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + :rtype: int + """ + return self._num_errors + + @num_errors.setter + def num_errors(self, num_errors): + """Sets the num_errors of this BatchResponseDealToDealSplitsWithErrors. + + + :param num_errors: The num_errors of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + :type num_errors: int + """ + + self._num_errors = num_errors + + @property + def requested_at(self): + """Gets the requested_at of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + + + :return: The requested_at of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._requested_at + + @requested_at.setter + def requested_at(self, requested_at): + """Sets the requested_at of this BatchResponseDealToDealSplitsWithErrors. + + + :param requested_at: The requested_at of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + :type requested_at: datetime + """ + + self._requested_at = requested_at + + @property + def started_at(self): + """Gets the started_at of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + + + :return: The started_at of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this BatchResponseDealToDealSplitsWithErrors. + + + :param started_at: The started_at of this BatchResponseDealToDealSplitsWithErrors. # 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 BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + + + :return: The links of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this BatchResponseDealToDealSplitsWithErrors. + + + :param links: The links of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def results(self): + """Gets the results of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + + + :return: The results of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + :rtype: list[DealToDealSplits] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this BatchResponseDealToDealSplitsWithErrors. + + + :param results: The results of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + :type results: list[DealToDealSplits] + """ + 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 BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + + + :return: The errors of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + :rtype: list[StandardError] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this BatchResponseDealToDealSplitsWithErrors. + + + :param errors: The errors of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + :type errors: list[StandardError] + """ + + self._errors = errors + + @property + def status(self): + """Gets the status of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + + + :return: The status of this BatchResponseDealToDealSplitsWithErrors. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this BatchResponseDealToDealSplitsWithErrors. + + + :param status: The status of this BatchResponseDealToDealSplitsWithErrors. # 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, BatchResponseDealToDealSplitsWithErrors): + 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, BatchResponseDealToDealSplitsWithErrors): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/deal_splits/models/deal_to_deal_splits.py b/hubspot/crm/objects/deal_splits/models/deal_to_deal_splits.py new file mode 100644 index 00000000..7856f817 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/models/deal_to_deal_splits.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.configuration import Configuration + + +class DealToDealSplits(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 = {"splits": "list[SimplePublicObject]", "id": "str"} + + attribute_map = {"splits": "splits", "id": "id"} + + def __init__(self, splits=None, id=None, local_vars_configuration=None): # noqa: E501 + """DealToDealSplits - 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._splits = None + self._id = None + self.discriminator = None + + self.splits = splits + self.id = id + + @property + def splits(self): + """Gets the splits of this DealToDealSplits. # noqa: E501 + + + :return: The splits of this DealToDealSplits. # noqa: E501 + :rtype: list[SimplePublicObject] + """ + return self._splits + + @splits.setter + def splits(self, splits): + """Sets the splits of this DealToDealSplits. + + + :param splits: The splits of this DealToDealSplits. # noqa: E501 + :type splits: list[SimplePublicObject] + """ + if self.local_vars_configuration.client_side_validation and splits is None: # noqa: E501 + raise ValueError("Invalid value for `splits`, must not be `None`") # noqa: E501 + + self._splits = splits + + @property + def id(self): + """Gets the id of this DealToDealSplits. # noqa: E501 + + + :return: The id of this DealToDealSplits. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DealToDealSplits. + + + :param id: The id of this DealToDealSplits. # 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, DealToDealSplits): + 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, DealToDealSplits): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/deal_splits/models/error.py b/hubspot/crm/objects/deal_splits/models/error.py new file mode 100644 index 00000000..d32e2d6b --- /dev/null +++ b/hubspot/crm/objects/deal_splits/models/error.py @@ -0,0 +1,282 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.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/deal_splits/models/error_detail.py b/hubspot/crm/objects/deal_splits/models/error_detail.py new file mode 100644 index 00000000..d84cf465 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/models/error_detail.py @@ -0,0 +1,228 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.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/deal_splits/models/public_deal_split_input.py b/hubspot/crm/objects/deal_splits/models/public_deal_split_input.py new file mode 100644 index 00000000..d1fff746 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/models/public_deal_split_input.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.configuration import Configuration + + +class PublicDealSplitInput(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 = {"percentage": "float", "owner_id": "int"} + + attribute_map = {"percentage": "percentage", "owner_id": "ownerId"} + + def __init__(self, percentage=None, owner_id=None, local_vars_configuration=None): # noqa: E501 + """PublicDealSplitInput - 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._percentage = None + self._owner_id = None + self.discriminator = None + + self.percentage = percentage + self.owner_id = owner_id + + @property + def percentage(self): + """Gets the percentage of this PublicDealSplitInput. # noqa: E501 + + + :return: The percentage of this PublicDealSplitInput. # noqa: E501 + :rtype: float + """ + return self._percentage + + @percentage.setter + def percentage(self, percentage): + """Sets the percentage of this PublicDealSplitInput. + + + :param percentage: The percentage of this PublicDealSplitInput. # noqa: E501 + :type percentage: float + """ + if self.local_vars_configuration.client_side_validation and percentage is None: # noqa: E501 + raise ValueError("Invalid value for `percentage`, must not be `None`") # noqa: E501 + + self._percentage = percentage + + @property + def owner_id(self): + """Gets the owner_id of this PublicDealSplitInput. # noqa: E501 + + + :return: The owner_id of this PublicDealSplitInput. # noqa: E501 + :rtype: int + """ + return self._owner_id + + @owner_id.setter + def owner_id(self, owner_id): + """Sets the owner_id of this PublicDealSplitInput. + + + :param owner_id: The owner_id of this PublicDealSplitInput. # noqa: E501 + :type owner_id: int + """ + if self.local_vars_configuration.client_side_validation and owner_id is None: # noqa: E501 + raise ValueError("Invalid value for `owner_id`, must not be `None`") # noqa: E501 + + self._owner_id = owner_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, PublicDealSplitInput): + 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, PublicDealSplitInput): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/deal_splits/models/public_deal_splits_batch_create_request.py b/hubspot/crm/objects/deal_splits/models/public_deal_splits_batch_create_request.py new file mode 100644 index 00000000..fa973d5e --- /dev/null +++ b/hubspot/crm/objects/deal_splits/models/public_deal_splits_batch_create_request.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.configuration import Configuration + + +class PublicDealSplitsBatchCreateRequest(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[PublicDealSplitsCreateRequest]"} + + attribute_map = {"inputs": "inputs"} + + def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 + """PublicDealSplitsBatchCreateRequest - 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 PublicDealSplitsBatchCreateRequest. # noqa: E501 + + + :return: The inputs of this PublicDealSplitsBatchCreateRequest. # noqa: E501 + :rtype: list[PublicDealSplitsCreateRequest] + """ + return self._inputs + + @inputs.setter + def inputs(self, inputs): + """Sets the inputs of this PublicDealSplitsBatchCreateRequest. + + + :param inputs: The inputs of this PublicDealSplitsBatchCreateRequest. # noqa: E501 + :type inputs: list[PublicDealSplitsCreateRequest] + """ + 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, PublicDealSplitsBatchCreateRequest): + 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, PublicDealSplitsBatchCreateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/deal_splits/models/public_deal_splits_create_request.py b/hubspot/crm/objects/deal_splits/models/public_deal_splits_create_request.py new file mode 100644 index 00000000..2d5e36f6 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/models/public_deal_splits_create_request.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.configuration import Configuration + + +class PublicDealSplitsCreateRequest(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 = {"splits": "list[PublicDealSplitInput]", "id": "int"} + + attribute_map = {"splits": "splits", "id": "id"} + + def __init__(self, splits=None, id=None, local_vars_configuration=None): # noqa: E501 + """PublicDealSplitsCreateRequest - 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._splits = None + self._id = None + self.discriminator = None + + self.splits = splits + self.id = id + + @property + def splits(self): + """Gets the splits of this PublicDealSplitsCreateRequest. # noqa: E501 + + + :return: The splits of this PublicDealSplitsCreateRequest. # noqa: E501 + :rtype: list[PublicDealSplitInput] + """ + return self._splits + + @splits.setter + def splits(self, splits): + """Sets the splits of this PublicDealSplitsCreateRequest. + + + :param splits: The splits of this PublicDealSplitsCreateRequest. # noqa: E501 + :type splits: list[PublicDealSplitInput] + """ + if self.local_vars_configuration.client_side_validation and splits is None: # noqa: E501 + raise ValueError("Invalid value for `splits`, must not be `None`") # noqa: E501 + + self._splits = splits + + @property + def id(self): + """Gets the id of this PublicDealSplitsCreateRequest. # noqa: E501 + + + :return: The id of this PublicDealSplitsCreateRequest. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this PublicDealSplitsCreateRequest. + + + :param id: The id of this PublicDealSplitsCreateRequest. # noqa: E501 + :type id: int + """ + 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, PublicDealSplitsCreateRequest): + 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, PublicDealSplitsCreateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/deal_splits/models/public_object_id.py b/hubspot/crm/objects/deal_splits/models/public_object_id.py new file mode 100644 index 00000000..81fb9e51 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/models/public_object_id.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.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/deal_splits/models/simple_public_object.py b/hubspot/crm/objects/deal_splits/models/simple_public_object.py new file mode 100644 index 00000000..fec563b6 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/models/simple_public_object.py @@ -0,0 +1,285 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.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/deal_splits/models/standard_error.py b/hubspot/crm/objects/deal_splits/models/standard_error.py new file mode 100644 index 00000000..8ced92f5 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/models/standard_error.py @@ -0,0 +1,318 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.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 + + A specific category that contains more specific detail about the error # 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. + + A specific category that contains more specific detail about the error # noqa: E501 + + :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 + + Context about the error condition # 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. + + Context about the error condition # noqa: E501 + + :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 + + A map of link names to associated URIs containing documentation about the error or recommended remediation steps # 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. + + 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 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 + + The id of the error # 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. + + The id of the error # noqa: E501 + + :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 + + The error category # 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. + + The error category # noqa: E501 + + :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 + + The error message # 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. + + The error message # noqa: E501 + + :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 + + A human readable message describing the error along with remediation steps where appropriate # 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. + + A human readable message describing the error along with remediation steps where appropriate # noqa: E501 + + :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/deal_splits/models/value_with_timestamp.py b/hubspot/crm/objects/deal_splits/models/value_with_timestamp.py new file mode 100644 index 00000000..5cf35635 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/models/value_with_timestamp.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.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/deal_splits/rest.py b/hubspot/crm/objects/deal_splits/rest.py new file mode 100644 index 00000000..57f83d10 --- /dev/null +++ b/hubspot/crm/objects/deal_splits/rest.py @@ -0,0 +1,213 @@ +# coding: utf-8 + +""" + CRM Deal Splits + + 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.deal_splits.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) From 31a4543c90ecabfa784f3194f63beb46c08b4b58 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 8 Apr 2025 09:31:11 +0300 Subject: [PATCH 20/49] Codegen Crm Objects Feedback Submissions --- .../objects/feedback_submissions/__init__.py | 13 - .../feedback_submissions/api/__init__.py | 2 - .../feedback_submissions/api/basic_api.py | 396 +----------------- .../feedback_submissions/api/batch_api.py | 380 +---------------- .../feedback_submissions/api/gdpr_api.py | 160 ------- .../api/public_object_api.py | 160 ------- .../feedback_submissions/models/__init__.py | 11 - .../models/association_spec.py | 150 ------- ..._input_simple_public_object_batch_input.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 | 2 + .../models/public_associations_for_object.py | 147 ------- .../models/public_gdpr_delete_input.py | 146 ------- .../models/public_merge_input.py | 147 ------- .../models/public_object_id.py | 122 ------ .../models/public_object_search_request.py | 25 +- .../models/simple_public_object.py | 30 +- .../simple_public_object_batch_input.py | 171 -------- .../models/simple_public_object_input.py | 122 ------ .../simple_public_object_input_for_create.py | 147 ------- .../simple_public_object_with_associations.py | 38 +- 22 files changed, 82 insertions(+), 2653 deletions(-) delete mode 100644 hubspot/crm/objects/feedback_submissions/api/gdpr_api.py delete mode 100644 hubspot/crm/objects/feedback_submissions/api/public_object_api.py delete mode 100644 hubspot/crm/objects/feedback_submissions/models/association_spec.py delete mode 100644 hubspot/crm/objects/feedback_submissions/models/batch_input_simple_public_object_batch_input.py delete mode 100644 hubspot/crm/objects/feedback_submissions/models/batch_input_simple_public_object_id.py delete mode 100644 hubspot/crm/objects/feedback_submissions/models/batch_input_simple_public_object_input_for_create.py delete mode 100644 hubspot/crm/objects/feedback_submissions/models/public_associations_for_object.py delete mode 100644 hubspot/crm/objects/feedback_submissions/models/public_gdpr_delete_input.py delete mode 100644 hubspot/crm/objects/feedback_submissions/models/public_merge_input.py delete mode 100644 hubspot/crm/objects/feedback_submissions/models/public_object_id.py delete mode 100644 hubspot/crm/objects/feedback_submissions/models/simple_public_object_batch_input.py delete mode 100644 hubspot/crm/objects/feedback_submissions/models/simple_public_object_input.py delete mode 100644 hubspot/crm/objects/feedback_submissions/models/simple_public_object_input_for_create.py diff --git a/hubspot/crm/objects/feedback_submissions/__init__.py b/hubspot/crm/objects/feedback_submissions/__init__.py index b96bac76..444037d8 100644 --- a/hubspot/crm/objects/feedback_submissions/__init__.py +++ b/hubspot/crm/objects/feedback_submissions/__init__.py @@ -19,8 +19,6 @@ # import apis into sdk package from hubspot.crm.objects.feedback_submissions.api.basic_api import BasicApi from hubspot.crm.objects.feedback_submissions.api.batch_api import BatchApi -from hubspot.crm.objects.feedback_submissions.api.gdpr_api import GDPRApi -from hubspot.crm.objects.feedback_submissions.api.public_object_api import PublicObjectApi from hubspot.crm.objects.feedback_submissions.api.search_api import SearchApi # import ApiClient @@ -35,10 +33,6 @@ # import models into sdk package from hubspot.crm.objects.feedback_submissions.models.associated_id import AssociatedId -from hubspot.crm.objects.feedback_submissions.models.association_spec import AssociationSpec -from hubspot.crm.objects.feedback_submissions.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput -from hubspot.crm.objects.feedback_submissions.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.feedback_submissions.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.feedback_submissions.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.feedback_submissions.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.feedback_submissions.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -53,16 +47,9 @@ from hubspot.crm.objects.feedback_submissions.models.next_page import NextPage from hubspot.crm.objects.feedback_submissions.models.paging import Paging from hubspot.crm.objects.feedback_submissions.models.previous_page import PreviousPage -from hubspot.crm.objects.feedback_submissions.models.public_associations_for_object import PublicAssociationsForObject -from hubspot.crm.objects.feedback_submissions.models.public_gdpr_delete_input import PublicGdprDeleteInput -from hubspot.crm.objects.feedback_submissions.models.public_merge_input import PublicMergeInput -from hubspot.crm.objects.feedback_submissions.models.public_object_id import PublicObjectId from hubspot.crm.objects.feedback_submissions.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.feedback_submissions.models.simple_public_object import SimplePublicObject -from hubspot.crm.objects.feedback_submissions.models.simple_public_object_batch_input import SimplePublicObjectBatchInput from hubspot.crm.objects.feedback_submissions.models.simple_public_object_id import SimplePublicObjectId -from hubspot.crm.objects.feedback_submissions.models.simple_public_object_input import SimplePublicObjectInput -from hubspot.crm.objects.feedback_submissions.models.simple_public_object_input_for_create import SimplePublicObjectInputForCreate from hubspot.crm.objects.feedback_submissions.models.simple_public_object_with_associations import SimplePublicObjectWithAssociations from hubspot.crm.objects.feedback_submissions.models.standard_error import StandardError from hubspot.crm.objects.feedback_submissions.models.value_with_timestamp import ValueWithTimestamp diff --git a/hubspot/crm/objects/feedback_submissions/api/__init__.py b/hubspot/crm/objects/feedback_submissions/api/__init__.py index 69a3fda2..06adaa75 100644 --- a/hubspot/crm/objects/feedback_submissions/api/__init__.py +++ b/hubspot/crm/objects/feedback_submissions/api/__init__.py @@ -5,6 +5,4 @@ # import apis into api package from hubspot.crm.objects.feedback_submissions.api.basic_api import BasicApi from hubspot.crm.objects.feedback_submissions.api.batch_api import BatchApi -from hubspot.crm.objects.feedback_submissions.api.gdpr_api import GDPRApi -from hubspot.crm.objects.feedback_submissions.api.public_object_api import PublicObjectApi from hubspot.crm.objects.feedback_submissions.api.search_api import SearchApi diff --git a/hubspot/crm/objects/feedback_submissions/api/basic_api.py b/hubspot/crm/objects/feedback_submissions/api/basic_api.py index 9d0e292d..7d613d97 100644 --- a/hubspot/crm/objects/feedback_submissions/api/basic_api.py +++ b/hubspot/crm/objects/feedback_submissions/api/basic_api.py @@ -33,255 +33,6 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def archive(self, feedback_submission_id, **kwargs): # noqa: E501 - """Archive # noqa: E501 - - Move an Object identified by `{feedbackSubmissionId}` 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(feedback_submission_id, async_req=True) - >>> result = thread.get() - - :param feedback_submission_id: (required) - :type feedback_submission_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(feedback_submission_id, **kwargs) # noqa: E501 - - def archive_with_http_info(self, feedback_submission_id, **kwargs): # noqa: E501 - """Archive # noqa: E501 - - Move an Object identified by `{feedbackSubmissionId}` 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(feedback_submission_id, async_req=True) - >>> result = thread.get() - - :param feedback_submission_id: (required) - :type feedback_submission_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 = ["feedback_submission_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 'feedback_submission_id' is set - if self.api_client.client_side_validation and local_var_params.get("feedback_submission_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `feedback_submission_id` when calling `archive`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if "feedback_submission_id" in local_var_params: - path_params["feedbackSubmissionId"] = local_var_params["feedback_submission_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/feedback_submissions/{feedbackSubmissionId}", - "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 feedback submission with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard feedback submissions 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 feedback submission with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard feedback submissions 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/feedback_submissions", - "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, feedback_submission_id, **kwargs): # noqa: E501 """Read # noqa: E501 @@ -302,7 +53,7 @@ def get_by_id(self, feedback_submission_id, **kwargs): # noqa: E501 :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 + :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 @@ -342,7 +93,7 @@ def get_by_id_with_http_info(self, feedback_submission_id, **kwargs): # noqa: E :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 + :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 @@ -590,146 +341,3 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501 collection_formats=collection_formats, _request_auth=local_var_params.get("_request_auth"), ) - - def update(self, feedback_submission_id, simple_public_object_input, **kwargs): # noqa: E501 - """Update # noqa: E501 - - Perform a partial update of an Object identified by `{feedbackSubmissionId}`. `{feedbackSubmissionId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. 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(feedback_submission_id, simple_public_object_input, async_req=True) - >>> result = thread.get() - - :param feedback_submission_id: (required) - :type feedback_submission_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 - :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(feedback_submission_id, simple_public_object_input, **kwargs) # noqa: E501 - - def update_with_http_info(self, feedback_submission_id, simple_public_object_input, **kwargs): # noqa: E501 - """Update # noqa: E501 - - Perform a partial update of an Object identified by `{feedbackSubmissionId}`. `{feedbackSubmissionId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. 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(feedback_submission_id, simple_public_object_input, async_req=True) - >>> result = thread.get() - - :param feedback_submission_id: (required) - :type feedback_submission_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 - :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 = ["feedback_submission_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 'feedback_submission_id' is set - if self.api_client.client_side_validation and local_var_params.get("feedback_submission_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `feedback_submission_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 "feedback_submission_id" in local_var_params: - path_params["feedbackSubmissionId"] = local_var_params["feedback_submission_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/feedback_submissions/{feedbackSubmissionId}", - "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/feedback_submissions/api/batch_api.py b/hubspot/crm/objects/feedback_submissions/api/batch_api.py index d661f34e..1769fb04 100644 --- a/hubspot/crm/objects/feedback_submissions/api/batch_api.py +++ b/hubspot/crm/objects/feedback_submissions/api/batch_api.py @@ -33,260 +33,10 @@ def __init__(self, api_client=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 feedback submissions 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 feedback submissions 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/feedback_submissions/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 feedback submissions # 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 feedback submissions # 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/feedback_submissions/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 feedback submissions by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -318,6 +68,7 @@ def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E50 def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of feedback submissions by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -416,130 +167,3 @@ def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs 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 feedback submissions # 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 feedback submissions # 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/feedback_submissions/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"), - ) diff --git a/hubspot/crm/objects/feedback_submissions/api/gdpr_api.py b/hubspot/crm/objects/feedback_submissions/api/gdpr_api.py deleted file mode 100644 index f62d9934..00000000 --- a/hubspot/crm/objects/feedback_submissions/api/gdpr_api.py +++ /dev/null @@ -1,160 +0,0 @@ -# coding: utf-8 - -""" - Feedback Submissions - - 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.feedback_submissions.api_client import ApiClient -from hubspot.crm.objects.feedback_submissions.exceptions import ApiTypeError, ApiValueError # noqa: F401 - - -class GDPRApi(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 purge(self, public_gdpr_delete_input, **kwargs): # noqa: E501 - """GDPR DELETE # noqa: E501 - - Permanently delete a contact and all associated content to follow GDPR. Use optional property 'idProperty' set to 'email' to identify contact by email address. If email address is not found, the email address will be added to a blocklist and prevent it from being used in the future. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.purge(public_gdpr_delete_input, async_req=True) - >>> result = thread.get() - - :param public_gdpr_delete_input: (required) - :type public_gdpr_delete_input: PublicGdprDeleteInput - :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.purge_with_http_info(public_gdpr_delete_input, **kwargs) # noqa: E501 - - def purge_with_http_info(self, public_gdpr_delete_input, **kwargs): # noqa: E501 - """GDPR DELETE # noqa: E501 - - Permanently delete a contact and all associated content to follow GDPR. Use optional property 'idProperty' set to 'email' to identify contact by email address. If email address is not found, the email address will be added to a blocklist and prevent it from being used in the future. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.purge_with_http_info(public_gdpr_delete_input, async_req=True) - >>> result = thread.get() - - :param public_gdpr_delete_input: (required) - :type public_gdpr_delete_input: PublicGdprDeleteInput - :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 = ["public_gdpr_delete_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 purge" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'public_gdpr_delete_input' is set - if self.api_client.client_side_validation and local_var_params.get("public_gdpr_delete_input") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `public_gdpr_delete_input` when calling `purge`") # 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_gdpr_delete_input" in local_var_params: - body_params = local_var_params["public_gdpr_delete_input"] - # 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/feedback_submissions/gdpr-delete", - "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/feedback_submissions/api/public_object_api.py b/hubspot/crm/objects/feedback_submissions/api/public_object_api.py deleted file mode 100644 index be74273f..00000000 --- a/hubspot/crm/objects/feedback_submissions/api/public_object_api.py +++ /dev/null @@ -1,160 +0,0 @@ -# coding: utf-8 - -""" - Feedback Submissions - - 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.feedback_submissions.api_client import ApiClient -from hubspot.crm.objects.feedback_submissions.exceptions import ApiTypeError, ApiValueError # noqa: F401 - - -class PublicObjectApi(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 merge(self, public_merge_input, **kwargs): # noqa: E501 - """Merge two feedback submissions with same type # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.merge(public_merge_input, async_req=True) - >>> result = thread.get() - - :param public_merge_input: (required) - :type public_merge_input: PublicMergeInput - :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.merge_with_http_info(public_merge_input, **kwargs) # noqa: E501 - - def merge_with_http_info(self, public_merge_input, **kwargs): # noqa: E501 - """Merge two feedback submissions with same type # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.merge_with_http_info(public_merge_input, async_req=True) - >>> result = thread.get() - - :param public_merge_input: (required) - :type public_merge_input: PublicMergeInput - :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 = ["public_merge_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 merge" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'public_merge_input' is set - if self.api_client.client_side_validation and local_var_params.get("public_merge_input") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `public_merge_input` when calling `merge`") # 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_merge_input" in local_var_params: - body_params = local_var_params["public_merge_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: "SimplePublicObject", - } - - return self.api_client.call_api( - "/crm/v3/objects/feedback_submissions/merge", - "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/feedback_submissions/models/__init__.py b/hubspot/crm/objects/feedback_submissions/models/__init__.py index 87924f9d..1255b5c4 100644 --- a/hubspot/crm/objects/feedback_submissions/models/__init__.py +++ b/hubspot/crm/objects/feedback_submissions/models/__init__.py @@ -15,10 +15,6 @@ # import models into model package from hubspot.crm.objects.feedback_submissions.models.associated_id import AssociatedId -from hubspot.crm.objects.feedback_submissions.models.association_spec import AssociationSpec -from hubspot.crm.objects.feedback_submissions.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput -from hubspot.crm.objects.feedback_submissions.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.feedback_submissions.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.feedback_submissions.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.feedback_submissions.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.feedback_submissions.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -33,16 +29,9 @@ from hubspot.crm.objects.feedback_submissions.models.next_page import NextPage from hubspot.crm.objects.feedback_submissions.models.paging import Paging from hubspot.crm.objects.feedback_submissions.models.previous_page import PreviousPage -from hubspot.crm.objects.feedback_submissions.models.public_associations_for_object import PublicAssociationsForObject -from hubspot.crm.objects.feedback_submissions.models.public_gdpr_delete_input import PublicGdprDeleteInput -from hubspot.crm.objects.feedback_submissions.models.public_merge_input import PublicMergeInput -from hubspot.crm.objects.feedback_submissions.models.public_object_id import PublicObjectId from hubspot.crm.objects.feedback_submissions.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.feedback_submissions.models.simple_public_object import SimplePublicObject -from hubspot.crm.objects.feedback_submissions.models.simple_public_object_batch_input import SimplePublicObjectBatchInput from hubspot.crm.objects.feedback_submissions.models.simple_public_object_id import SimplePublicObjectId -from hubspot.crm.objects.feedback_submissions.models.simple_public_object_input import SimplePublicObjectInput -from hubspot.crm.objects.feedback_submissions.models.simple_public_object_input_for_create import SimplePublicObjectInputForCreate from hubspot.crm.objects.feedback_submissions.models.simple_public_object_with_associations import SimplePublicObjectWithAssociations from hubspot.crm.objects.feedback_submissions.models.standard_error import StandardError from hubspot.crm.objects.feedback_submissions.models.value_with_timestamp import ValueWithTimestamp diff --git a/hubspot/crm/objects/feedback_submissions/models/association_spec.py b/hubspot/crm/objects/feedback_submissions/models/association_spec.py deleted file mode 100644 index fe59a820..00000000 --- a/hubspot/crm/objects/feedback_submissions/models/association_spec.py +++ /dev/null @@ -1,150 +0,0 @@ -# coding: utf-8 - -""" - Feedback Submissions - - 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.feedback_submissions.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/feedback_submissions/models/batch_input_simple_public_object_batch_input.py b/hubspot/crm/objects/feedback_submissions/models/batch_input_simple_public_object_batch_input.py deleted file mode 100644 index ca1eb231..00000000 --- a/hubspot/crm/objects/feedback_submissions/models/batch_input_simple_public_object_batch_input.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - Feedback Submissions - - 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.feedback_submissions.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/feedback_submissions/models/batch_input_simple_public_object_id.py b/hubspot/crm/objects/feedback_submissions/models/batch_input_simple_public_object_id.py deleted file mode 100644 index 122b419b..00000000 --- a/hubspot/crm/objects/feedback_submissions/models/batch_input_simple_public_object_id.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - Feedback Submissions - - 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.feedback_submissions.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/feedback_submissions/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/objects/feedback_submissions/models/batch_input_simple_public_object_input_for_create.py deleted file mode 100644 index 45e1366d..00000000 --- a/hubspot/crm/objects/feedback_submissions/models/batch_input_simple_public_object_input_for_create.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - Feedback Submissions - - 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.feedback_submissions.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/feedback_submissions/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/objects/feedback_submissions/models/batch_read_input_simple_public_object_id.py index 504b2810..6ca93b20 100644 --- a/hubspot/crm/objects/feedback_submissions/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/objects/feedback_submissions/models/batch_read_input_simple_public_object_id.py @@ -84,6 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -94,6 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/objects/feedback_submissions/models/public_associations_for_object.py b/hubspot/crm/objects/feedback_submissions/models/public_associations_for_object.py deleted file mode 100644 index 197a33c0..00000000 --- a/hubspot/crm/objects/feedback_submissions/models/public_associations_for_object.py +++ /dev/null @@ -1,147 +0,0 @@ -# coding: utf-8 - -""" - Feedback Submissions - - 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.feedback_submissions.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/feedback_submissions/models/public_gdpr_delete_input.py b/hubspot/crm/objects/feedback_submissions/models/public_gdpr_delete_input.py deleted file mode 100644 index 965c04a8..00000000 --- a/hubspot/crm/objects/feedback_submissions/models/public_gdpr_delete_input.py +++ /dev/null @@ -1,146 +0,0 @@ -# coding: utf-8 - -""" - Feedback Submissions - - 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.feedback_submissions.configuration import Configuration - - -class PublicGdprDeleteInput(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_id": "str"} - - attribute_map = {"id_property": "idProperty", "object_id": "objectId"} - - def __init__(self, id_property=None, object_id=None, local_vars_configuration=None): # noqa: E501 - """PublicGdprDeleteInput - 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_id = None - self.discriminator = None - - if id_property is not None: - self.id_property = id_property - self.object_id = object_id - - @property - def id_property(self): - """Gets the id_property of this PublicGdprDeleteInput. # noqa: E501 - - - :return: The id_property of this PublicGdprDeleteInput. # noqa: E501 - :rtype: str - """ - return self._id_property - - @id_property.setter - def id_property(self, id_property): - """Sets the id_property of this PublicGdprDeleteInput. - - - :param id_property: The id_property of this PublicGdprDeleteInput. # noqa: E501 - :type id_property: str - """ - - self._id_property = id_property - - @property - def object_id(self): - """Gets the object_id of this PublicGdprDeleteInput. # noqa: E501 - - - :return: The object_id of this PublicGdprDeleteInput. # noqa: E501 - :rtype: str - """ - return self._object_id - - @object_id.setter - def object_id(self, object_id): - """Sets the object_id of this PublicGdprDeleteInput. - - - :param object_id: The object_id of this PublicGdprDeleteInput. # noqa: E501 - :type object_id: str - """ - if self.local_vars_configuration.client_side_validation and object_id is None: # noqa: E501 - raise ValueError("Invalid value for `object_id`, must not be `None`") # noqa: E501 - - self._object_id = object_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, PublicGdprDeleteInput): - 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, PublicGdprDeleteInput): - return True - - return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/feedback_submissions/models/public_merge_input.py b/hubspot/crm/objects/feedback_submissions/models/public_merge_input.py deleted file mode 100644 index 11a69d3c..00000000 --- a/hubspot/crm/objects/feedback_submissions/models/public_merge_input.py +++ /dev/null @@ -1,147 +0,0 @@ -# coding: utf-8 - -""" - Feedback Submissions - - 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.feedback_submissions.configuration import Configuration - - -class PublicMergeInput(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_id_to_merge": "str", "primary_object_id": "str"} - - attribute_map = {"object_id_to_merge": "objectIdToMerge", "primary_object_id": "primaryObjectId"} - - def __init__(self, object_id_to_merge=None, primary_object_id=None, local_vars_configuration=None): # noqa: E501 - """PublicMergeInput - 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_id_to_merge = None - self._primary_object_id = None - self.discriminator = None - - self.object_id_to_merge = object_id_to_merge - self.primary_object_id = primary_object_id - - @property - def object_id_to_merge(self): - """Gets the object_id_to_merge of this PublicMergeInput. # noqa: E501 - - - :return: The object_id_to_merge of this PublicMergeInput. # noqa: E501 - :rtype: str - """ - return self._object_id_to_merge - - @object_id_to_merge.setter - def object_id_to_merge(self, object_id_to_merge): - """Sets the object_id_to_merge of this PublicMergeInput. - - - :param object_id_to_merge: The object_id_to_merge of this PublicMergeInput. # noqa: E501 - :type object_id_to_merge: str - """ - if self.local_vars_configuration.client_side_validation and object_id_to_merge is None: # noqa: E501 - raise ValueError("Invalid value for `object_id_to_merge`, must not be `None`") # noqa: E501 - - self._object_id_to_merge = object_id_to_merge - - @property - def primary_object_id(self): - """Gets the primary_object_id of this PublicMergeInput. # noqa: E501 - - - :return: The primary_object_id of this PublicMergeInput. # noqa: E501 - :rtype: str - """ - return self._primary_object_id - - @primary_object_id.setter - def primary_object_id(self, primary_object_id): - """Sets the primary_object_id of this PublicMergeInput. - - - :param primary_object_id: The primary_object_id of this PublicMergeInput. # noqa: E501 - :type primary_object_id: str - """ - if self.local_vars_configuration.client_side_validation and primary_object_id is None: # noqa: E501 - raise ValueError("Invalid value for `primary_object_id`, must not be `None`") # noqa: E501 - - self._primary_object_id = primary_object_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, PublicMergeInput): - 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, PublicMergeInput): - return True - - return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/feedback_submissions/models/public_object_id.py b/hubspot/crm/objects/feedback_submissions/models/public_object_id.py deleted file mode 100644 index 25c05999..00000000 --- a/hubspot/crm/objects/feedback_submissions/models/public_object_id.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - Feedback Submissions - - 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.feedback_submissions.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/feedback_submissions/models/public_object_search_request.py b/hubspot/crm/objects/feedback_submissions/models/public_object_search_request.py index 3fb74573..f8550578 100644 --- a/hubspot/crm/objects/feedback_submissions/models/public_object_search_request.py +++ b/hubspot/crm/objects/feedback_submissions/models/public_object_search_request.py @@ -55,11 +55,16 @@ def __init__(self, query=None, limit=None, after=None, sorts=None, properties=No if query is not None: self.query = query - self.limit = limit - self.after = after - self.sorts = sorts - self.properties = properties - self.filter_groups = filter_groups + 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): @@ -100,8 +105,6 @@ def limit(self, limit): :param limit: The limit of this PublicObjectSearchRequest. # noqa: E501 :type limit: int """ - if self.local_vars_configuration.client_side_validation and limit is None: # noqa: E501 - raise ValueError("Invalid value for `limit`, must not be `None`") # noqa: E501 self._limit = limit @@ -123,8 +126,6 @@ def after(self, after): :param after: The after of this PublicObjectSearchRequest. # 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 @@ -146,8 +147,6 @@ def sorts(self, sorts): :param sorts: The sorts of this PublicObjectSearchRequest. # noqa: E501 :type sorts: list[str] """ - if self.local_vars_configuration.client_side_validation and sorts is None: # noqa: E501 - raise ValueError("Invalid value for `sorts`, must not be `None`") # noqa: E501 self._sorts = sorts @@ -169,8 +168,6 @@ def properties(self, properties): :param properties: The properties of this PublicObjectSearchRequest. # 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 @@ -192,8 +189,6 @@ def filter_groups(self, filter_groups): :param filter_groups: The filter_groups of this PublicObjectSearchRequest. # noqa: E501 :type filter_groups: list[FilterGroup] """ - if self.local_vars_configuration.client_side_validation and filter_groups is None: # noqa: E501 - raise ValueError("Invalid value for `filter_groups`, must not be `None`") # noqa: E501 self._filter_groups = filter_groups diff --git a/hubspot/crm/objects/feedback_submissions/models/simple_public_object.py b/hubspot/crm/objects/feedback_submissions/models/simple_public_object.py index daca7c50..b5999266 100644 --- a/hubspot/crm/objects/feedback_submissions/models/simple_public_object.py +++ b/hubspot/crm/objects/feedback_submissions/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 diff --git a/hubspot/crm/objects/feedback_submissions/models/simple_public_object_batch_input.py b/hubspot/crm/objects/feedback_submissions/models/simple_public_object_batch_input.py deleted file mode 100644 index e7559d07..00000000 --- a/hubspot/crm/objects/feedback_submissions/models/simple_public_object_batch_input.py +++ /dev/null @@ -1,171 +0,0 @@ -# coding: utf-8 - -""" - Feedback Submissions - - 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.feedback_submissions.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", "id": "str", "properties": "dict[str, str]"} - - attribute_map = {"id_property": "idProperty", "id": "id", "properties": "properties"} - - def __init__(self, id_property=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._id = None - self._properties = None - self.discriminator = None - - if id_property is not None: - self.id_property = id_property - 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 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/feedback_submissions/models/simple_public_object_input.py b/hubspot/crm/objects/feedback_submissions/models/simple_public_object_input.py deleted file mode 100644 index 2885660e..00000000 --- a/hubspot/crm/objects/feedback_submissions/models/simple_public_object_input.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - Feedback Submissions - - 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.feedback_submissions.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 = {"properties": "dict[str, str]"} - - attribute_map = {"properties": "properties"} - - def __init__(self, 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._properties = None - self.discriminator = None - - self.properties = properties - - @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/feedback_submissions/models/simple_public_object_input_for_create.py b/hubspot/crm/objects/feedback_submissions/models/simple_public_object_input_for_create.py deleted file mode 100644 index b61e3a57..00000000 --- a/hubspot/crm/objects/feedback_submissions/models/simple_public_object_input_for_create.py +++ /dev/null @@ -1,147 +0,0 @@ -# coding: utf-8 - -""" - Feedback Submissions - - 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.feedback_submissions.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]", "properties": "dict[str, str]"} - - attribute_map = {"associations": "associations", "properties": "properties"} - - def __init__(self, associations=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._properties = None - self.discriminator = None - - self.associations = associations - 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 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/feedback_submissions/models/simple_public_object_with_associations.py b/hubspot/crm/objects/feedback_submissions/models/simple_public_object_with_associations.py index d9db1ef3..7bf60571 100644 --- a/hubspot/crm/objects/feedback_submissions/models/simple_public_object_with_associations.py +++ b/hubspot/crm/objects/feedback_submissions/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -218,6 +233,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 From 754b72a3a752b860b9bad197d96adfc62f25bb98 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 8 Apr 2025 09:35:51 +0300 Subject: [PATCH 21/49] Codegen Crm Objects Leads --- hubspot/crm/objects/leads/__init__.py | 3 +- hubspot/crm/objects/leads/api/batch_api.py | 36 ++-- hubspot/crm/objects/leads/models/__init__.py | 3 +- ...e_public_object_batch_input_for_create.py} | 22 +-- ...atch_read_input_simple_public_object_id.py | 2 + .../leads/models/simple_public_object.py | 30 +++- .../simple_public_object_batch_input.py | 4 + ...le_public_object_batch_input_for_create.py | 170 ++++++++++++++++++ ...simple_public_object_batch_input_upsert.py | 2 + .../models/simple_public_object_input.py | 30 +--- .../simple_public_object_input_for_create.py | 35 +--- .../simple_public_object_with_associations.py | 38 +++- .../models/simple_public_upsert_object.py | 38 +++- 13 files changed, 323 insertions(+), 90 deletions(-) rename hubspot/crm/objects/leads/models/{batch_input_simple_public_object_input_for_create.py => batch_input_simple_public_object_batch_input_for_create.py} (80%) create mode 100644 hubspot/crm/objects/leads/models/simple_public_object_batch_input_for_create.py diff --git a/hubspot/crm/objects/leads/__init__.py b/hubspot/crm/objects/leads/__init__.py index 6f000be5..4492f665 100644 --- a/hubspot/crm/objects/leads/__init__.py +++ b/hubspot/crm/objects/leads/__init__.py @@ -35,9 +35,9 @@ 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_for_create import BatchInputSimplePublicObjectBatchInputForCreate 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 @@ -59,6 +59,7 @@ 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_for_create import SimplePublicObjectBatchInputForCreate 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 diff --git a/hubspot/crm/objects/leads/api/batch_api.py b/hubspot/crm/objects/leads/api/batch_api.py index 40035273..4ce274cc 100644 --- a/hubspot/crm/objects/leads/api/batch_api.py +++ b/hubspot/crm/objects/leads/api/batch_api.py @@ -157,17 +157,17 @@ def archive_with_http_info(self, batch_input_simple_public_object_id, **kwargs): _request_auth=local_var_params.get("_request_auth"), ) - def create(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create(self, batch_input_simple_public_object_batch_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) + >>> thread = api.create(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -184,19 +184,19 @@ def create(self, batch_input_simple_public_object_input_for_create, **kwargs): :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 + return self.create_with_http_info(batch_input_simple_public_object_batch_input_for_create, **kwargs) # noqa: E501 - def create_with_http_info(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create_with_http_info(self, batch_input_simple_public_object_batch_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) + >>> thread = api.create_with_http_info(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :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 @@ -223,7 +223,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat local_var_params = locals() - all_params = ["batch_input_simple_public_object_input_for_create"] + all_params = ["batch_input_simple_public_object_batch_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"]): @@ -231,9 +231,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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 + # verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_for_create` when calling `create`") # noqa: E501 collection_formats = {} @@ -247,8 +247,8 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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"] + if "batch_input_simple_public_object_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_for_create"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -287,6 +287,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -318,6 +319,7 @@ def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E50 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 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -547,7 +549,7 @@ def update_with_http_info(self, batch_input_simple_public_object_batch_input, ** 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 + Create or update records identified by a unique property value as specified by the `idProperty` query param. `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 @@ -577,7 +579,7 @@ def upsert(self, batch_input_simple_public_object_batch_input_upsert, **kwargs): 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 + Create or update records identified by a unique property value as specified by the `idProperty` query param. `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 diff --git a/hubspot/crm/objects/leads/models/__init__.py b/hubspot/crm/objects/leads/models/__init__.py index 0f9f5281..673e26cb 100644 --- a/hubspot/crm/objects/leads/models/__init__.py +++ b/hubspot/crm/objects/leads/models/__init__.py @@ -17,9 +17,9 @@ 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_for_create import BatchInputSimplePublicObjectBatchInputForCreate 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 @@ -41,6 +41,7 @@ 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_for_create import SimplePublicObjectBatchInputForCreate 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 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_batch_input_for_create.py similarity index 80% rename from hubspot/crm/objects/leads/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/objects/leads/models/batch_input_simple_public_object_batch_input_for_create.py index 588789bb..13aedee1 100644 --- 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_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.objects.leads.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectBatchInputForCreate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class BatchInputSimplePublicObjectInputForCreate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"inputs": "list[SimplePublicObjectInputForCreate]"} + openapi_types = {"inputs": "list[SimplePublicObjectBatchInputForCreate]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 @@ -52,21 +52,21 @@ def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 @property def inputs(self): - """Gets the inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + """Gets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] """ return self._inputs @inputs.setter def inputs(self, inputs): - """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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 index f0db907e..cfd541a9 100644 --- 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 @@ -84,6 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -94,6 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/objects/leads/models/simple_public_object.py b/hubspot/crm/objects/leads/models/simple_public_object.py index fb97f92f..5f66d577 100644 --- a/hubspot/crm/objects/leads/models/simple_public_object.py +++ b/hubspot/crm/objects/leads/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 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 index 80e5d708..371becb2 100644 --- a/hubspot/crm/objects/leads/models/simple_public_object_batch_input.py +++ b/hubspot/crm/objects/leads/models/simple_public_object_batch_input.py @@ -62,6 +62,7 @@ def __init__(self, id_property=None, object_write_trace_id=None, id=None, proper def id_property(self): """Gets the id_property of this SimplePublicObjectBatchInput. # noqa: E501 + The name of a property whose values are unique for this object # noqa: E501 :return: The id_property of this SimplePublicObjectBatchInput. # noqa: E501 :rtype: str @@ -72,6 +73,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this SimplePublicObjectBatchInput. + The name of a property whose values are unique for this object # noqa: E501 :param id_property: The id_property of this SimplePublicObjectBatchInput. # noqa: E501 :type id_property: str @@ -104,6 +106,7 @@ def object_write_trace_id(self, object_write_trace_id): def id(self): """Gets the id of this SimplePublicObjectBatchInput. # noqa: E501 + The id to be updated. This can be the object id, or the unique property value of the idProperty property # noqa: E501 :return: The id of this SimplePublicObjectBatchInput. # noqa: E501 :rtype: str @@ -114,6 +117,7 @@ def id(self): def id(self, id): """Sets the id of this SimplePublicObjectBatchInput. + The id to be updated. This can be the object id, or the unique property value of the idProperty property # noqa: E501 :param id: The id of this SimplePublicObjectBatchInput. # noqa: E501 :type id: str diff --git a/hubspot/crm/objects/leads/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/objects/leads/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..76e7c105 --- /dev/null +++ b/hubspot/crm/objects/leads/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# 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 SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + 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 index 738cb695..2691bd89 100644 --- 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 @@ -62,6 +62,7 @@ def __init__(self, id_property=None, object_write_trace_id=None, id=None, proper def id_property(self): """Gets the id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + The name of a property whose values are unique for this object # noqa: E501 :return: The id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :rtype: str @@ -72,6 +73,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this SimplePublicObjectBatchInputUpsert. + The name of a property whose values are unique for this object # noqa: E501 :param id_property: The id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/objects/leads/models/simple_public_object_input.py b/hubspot/crm/objects/leads/models/simple_public_object_input.py index 4b0ed4d3..3e923225 100644 --- a/hubspot/crm/objects/leads/models/simple_public_object_input.py +++ b/hubspot/crm/objects/leads/models/simple_public_object_input.py @@ -35,45 +35,21 @@ class SimplePublicObjectInput(object): 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]"} + openapi_types = {"properties": "dict[str, str]"} - attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"properties": "properties"} - def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, 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 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 index 48aff550..6c873a53 100644 --- 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 @@ -35,24 +35,22 @@ class SimplePublicObjectInputForCreate(object): 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]"} + openapi_types = {"associations": "list[PublicAssociationsForObject]", "properties": "dict[str, str]"} - attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"associations": "associations", "properties": "properties"} - def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, associations=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 + if associations is not None: + self.associations = associations self.properties = properties @property @@ -73,32 +71,9 @@ def associations(self, associations): :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 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 index 69f01cdc..98d13b94 100644 --- a/hubspot/crm/objects/leads/models/simple_public_object_with_associations.py +++ b/hubspot/crm/objects/leads/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -218,6 +233,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 diff --git a/hubspot/crm/objects/leads/models/simple_public_upsert_object.py b/hubspot/crm/objects/leads/models/simple_public_upsert_object.py index 63f44043..df04ad49 100644 --- a/hubspot/crm/objects/leads/models/simple_public_upsert_object.py +++ b/hubspot/crm/objects/leads/models/simple_public_upsert_object.py @@ -42,6 +42,7 @@ class SimplePublicUpsertObject(object): "new": "bool", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicUpsertObject(object): "new": "new", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._new = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -84,6 +97,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -219,6 +234,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. # noqa: E501 From e465b022f0ec70eea3a03c6e81be987bb22f5127 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 8 Apr 2025 09:38:14 +0300 Subject: [PATCH 22/49] Codegen Crm Objects Meetings --- hubspot/crm/objects/meetings/__init__.py | 3 +- hubspot/crm/objects/meetings/api/basic_api.py | 12 +- hubspot/crm/objects/meetings/api/batch_api.py | 32 ++-- .../crm/objects/meetings/models/__init__.py | 3 +- ...e_public_object_batch_input_for_create.py} | 22 +-- ...atch_read_input_simple_public_object_id.py | 4 +- .../meetings/models/simple_public_object.py | 30 +++- ...le_public_object_batch_input_for_create.py | 170 ++++++++++++++++++ .../models/simple_public_object_input.py | 30 +--- .../simple_public_object_input_for_create.py | 35 +--- .../simple_public_object_with_associations.py | 38 +++- .../models/simple_public_upsert_object.py | 38 +++- 12 files changed, 321 insertions(+), 96 deletions(-) rename hubspot/crm/objects/meetings/models/{batch_input_simple_public_object_input_for_create.py => batch_input_simple_public_object_batch_input_for_create.py} (80%) create mode 100644 hubspot/crm/objects/meetings/models/simple_public_object_batch_input_for_create.py diff --git a/hubspot/crm/objects/meetings/__init__.py b/hubspot/crm/objects/meetings/__init__.py index f96b69d1..265963d5 100644 --- a/hubspot/crm/objects/meetings/__init__.py +++ b/hubspot/crm/objects/meetings/__init__.py @@ -35,9 +35,9 @@ from hubspot.crm.objects.meetings.models.associated_id import AssociatedId from hubspot.crm.objects.meetings.models.association_spec import AssociationSpec from hubspot.crm.objects.meetings.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.meetings.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.meetings.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.meetings.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.meetings.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.meetings.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.meetings.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.meetings.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -59,6 +59,7 @@ from hubspot.crm.objects.meetings.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.meetings.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.meetings.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.meetings.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.meetings.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.meetings.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.meetings.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/meetings/api/basic_api.py b/hubspot/crm/objects/meetings/api/basic_api.py index 8b353a3a..75176758 100644 --- a/hubspot/crm/objects/meetings/api/basic_api.py +++ b/hubspot/crm/objects/meetings/api/basic_api.py @@ -302,7 +302,7 @@ def get_by_id(self, meeting_id, **kwargs): # noqa: E501 :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 + :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 @@ -342,7 +342,7 @@ def get_by_id_with_http_info(self, meeting_id, **kwargs): # noqa: E501 :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 + :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 @@ -594,7 +594,7 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501 def update(self, meeting_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{meetingId}`. `{meetingId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{meetingId}`or optionally a unique property value as specified by the `idProperty` query param. `{meetingId}` 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 @@ -605,7 +605,7 @@ def update(self, meeting_id, simple_public_object_input, **kwargs): # noqa: E50 :type meeting_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 + :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 @@ -628,7 +628,7 @@ def update(self, meeting_id, simple_public_object_input, **kwargs): # noqa: E50 def update_with_http_info(self, meeting_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{meetingId}`. `{meetingId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{meetingId}`or optionally a unique property value as specified by the `idProperty` query param. `{meetingId}` 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 @@ -639,7 +639,7 @@ def update_with_http_info(self, meeting_id, simple_public_object_input, **kwargs :type meeting_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 + :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 diff --git a/hubspot/crm/objects/meetings/api/batch_api.py b/hubspot/crm/objects/meetings/api/batch_api.py index 0e3d5cd0..f73f1059 100644 --- a/hubspot/crm/objects/meetings/api/batch_api.py +++ b/hubspot/crm/objects/meetings/api/batch_api.py @@ -157,17 +157,17 @@ def archive_with_http_info(self, batch_input_simple_public_object_id, **kwargs): _request_auth=local_var_params.get("_request_auth"), ) - def create(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of meetings # 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) + >>> thread = api.create(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -184,19 +184,19 @@ def create(self, batch_input_simple_public_object_input_for_create, **kwargs): :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 + return self.create_with_http_info(batch_input_simple_public_object_batch_input_for_create, **kwargs) # noqa: E501 - def create_with_http_info(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create_with_http_info(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of meetings # 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) + >>> thread = api.create_with_http_info(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :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 @@ -223,7 +223,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat local_var_params = locals() - all_params = ["batch_input_simple_public_object_input_for_create"] + all_params = ["batch_input_simple_public_object_batch_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"]): @@ -231,9 +231,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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 + # verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_for_create` when calling `create`") # noqa: E501 collection_formats = {} @@ -247,8 +247,8 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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"] + if "batch_input_simple_public_object_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_for_create"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -287,6 +287,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of meetings by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -318,6 +319,7 @@ def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E50 def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of meetings by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/objects/meetings/models/__init__.py b/hubspot/crm/objects/meetings/models/__init__.py index 4ee9d38d..93f4b2d1 100644 --- a/hubspot/crm/objects/meetings/models/__init__.py +++ b/hubspot/crm/objects/meetings/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.objects.meetings.models.associated_id import AssociatedId from hubspot.crm.objects.meetings.models.association_spec import AssociationSpec from hubspot.crm.objects.meetings.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.meetings.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.meetings.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.meetings.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.meetings.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.meetings.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.meetings.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.meetings.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -41,6 +41,7 @@ from hubspot.crm.objects.meetings.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.meetings.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.meetings.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.meetings.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.meetings.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.meetings.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.meetings.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/meetings/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/objects/meetings/models/batch_input_simple_public_object_batch_input_for_create.py similarity index 80% rename from hubspot/crm/objects/meetings/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/objects/meetings/models/batch_input_simple_public_object_batch_input_for_create.py index a06f5c52..ede810fb 100644 --- a/hubspot/crm/objects/meetings/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/meetings/models/batch_input_simple_public_object_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.objects.meetings.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectBatchInputForCreate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class BatchInputSimplePublicObjectInputForCreate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"inputs": "list[SimplePublicObjectInputForCreate]"} + openapi_types = {"inputs": "list[SimplePublicObjectBatchInputForCreate]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 @@ -52,21 +52,21 @@ def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 @property def inputs(self): - """Gets the inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + """Gets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] """ return self._inputs @inputs.setter def inputs(self, inputs): - """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/meetings/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/objects/meetings/models/batch_read_input_simple_public_object_id.py index 7fdb77ba..d0bcf200 100644 --- a/hubspot/crm/objects/meetings/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/objects/meetings/models/batch_read_input_simple_public_object_id.py @@ -84,7 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -95,7 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/objects/meetings/models/simple_public_object.py b/hubspot/crm/objects/meetings/models/simple_public_object.py index d2144088..293b7063 100644 --- a/hubspot/crm/objects/meetings/models/simple_public_object.py +++ b/hubspot/crm/objects/meetings/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 diff --git a/hubspot/crm/objects/meetings/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/objects/meetings/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..97c77434 --- /dev/null +++ b/hubspot/crm/objects/meetings/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Meetings + + 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.meetings.configuration import Configuration + + +class SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/meetings/models/simple_public_object_input.py b/hubspot/crm/objects/meetings/models/simple_public_object_input.py index 828639d4..49924f88 100644 --- a/hubspot/crm/objects/meetings/models/simple_public_object_input.py +++ b/hubspot/crm/objects/meetings/models/simple_public_object_input.py @@ -35,45 +35,21 @@ class SimplePublicObjectInput(object): 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]"} + openapi_types = {"properties": "dict[str, str]"} - attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"properties": "properties"} - def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, 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 diff --git a/hubspot/crm/objects/meetings/models/simple_public_object_input_for_create.py b/hubspot/crm/objects/meetings/models/simple_public_object_input_for_create.py index ae30a561..13132a00 100644 --- a/hubspot/crm/objects/meetings/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/meetings/models/simple_public_object_input_for_create.py @@ -35,24 +35,22 @@ class SimplePublicObjectInputForCreate(object): 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]"} + openapi_types = {"associations": "list[PublicAssociationsForObject]", "properties": "dict[str, str]"} - attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"associations": "associations", "properties": "properties"} - def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, associations=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 + if associations is not None: + self.associations = associations self.properties = properties @property @@ -73,32 +71,9 @@ def associations(self, associations): :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 diff --git a/hubspot/crm/objects/meetings/models/simple_public_object_with_associations.py b/hubspot/crm/objects/meetings/models/simple_public_object_with_associations.py index d74e4d7e..7a409f12 100644 --- a/hubspot/crm/objects/meetings/models/simple_public_object_with_associations.py +++ b/hubspot/crm/objects/meetings/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -218,6 +233,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 diff --git a/hubspot/crm/objects/meetings/models/simple_public_upsert_object.py b/hubspot/crm/objects/meetings/models/simple_public_upsert_object.py index 49cbe240..2eb444b2 100644 --- a/hubspot/crm/objects/meetings/models/simple_public_upsert_object.py +++ b/hubspot/crm/objects/meetings/models/simple_public_upsert_object.py @@ -42,6 +42,7 @@ class SimplePublicUpsertObject(object): "new": "bool", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicUpsertObject(object): "new": "new", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._new = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -84,6 +97,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -219,6 +234,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. # noqa: E501 From 9df94909e310f02472ba6c77e13c6a68356ced09 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 8 Apr 2025 09:40:07 +0300 Subject: [PATCH 23/49] Codegen Crm Objects Notes --- hubspot/crm/objects/notes/__init__.py | 3 +- hubspot/crm/objects/notes/api/basic_api.py | 12 +- hubspot/crm/objects/notes/api/batch_api.py | 32 ++-- hubspot/crm/objects/notes/models/__init__.py | 3 +- ...e_public_object_batch_input_for_create.py} | 22 +-- ...atch_read_input_simple_public_object_id.py | 4 +- .../notes/models/simple_public_object.py | 30 +++- ...le_public_object_batch_input_for_create.py | 170 ++++++++++++++++++ .../models/simple_public_object_input.py | 30 +--- .../simple_public_object_input_for_create.py | 35 +--- .../simple_public_object_with_associations.py | 38 +++- .../models/simple_public_upsert_object.py | 38 +++- 12 files changed, 321 insertions(+), 96 deletions(-) rename hubspot/crm/objects/notes/models/{batch_input_simple_public_object_input_for_create.py => batch_input_simple_public_object_batch_input_for_create.py} (80%) create mode 100644 hubspot/crm/objects/notes/models/simple_public_object_batch_input_for_create.py diff --git a/hubspot/crm/objects/notes/__init__.py b/hubspot/crm/objects/notes/__init__.py index eca7fd47..a2bd011f 100644 --- a/hubspot/crm/objects/notes/__init__.py +++ b/hubspot/crm/objects/notes/__init__.py @@ -35,9 +35,9 @@ from hubspot.crm.objects.notes.models.associated_id import AssociatedId from hubspot.crm.objects.notes.models.association_spec import AssociationSpec from hubspot.crm.objects.notes.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.notes.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.notes.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.notes.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.notes.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.notes.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.notes.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.notes.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -59,6 +59,7 @@ from hubspot.crm.objects.notes.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.notes.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.notes.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.notes.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.notes.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.notes.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.notes.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/notes/api/basic_api.py b/hubspot/crm/objects/notes/api/basic_api.py index d82b4c33..ab68cb78 100644 --- a/hubspot/crm/objects/notes/api/basic_api.py +++ b/hubspot/crm/objects/notes/api/basic_api.py @@ -302,7 +302,7 @@ def get_by_id(self, note_id, **kwargs): # noqa: E501 :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 + :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 @@ -342,7 +342,7 @@ def get_by_id_with_http_info(self, note_id, **kwargs): # noqa: E501 :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 + :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 @@ -594,7 +594,7 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501 def update(self, note_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{noteId}`. `{noteId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{noteId}`or optionally a unique property value as specified by the `idProperty` query param. `{noteId}` 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 @@ -605,7 +605,7 @@ def update(self, note_id, simple_public_object_input, **kwargs): # noqa: E501 :type note_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 + :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 @@ -628,7 +628,7 @@ def update(self, note_id, simple_public_object_input, **kwargs): # noqa: E501 def update_with_http_info(self, note_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{noteId}`. `{noteId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{noteId}`or optionally a unique property value as specified by the `idProperty` query param. `{noteId}` 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 @@ -639,7 +639,7 @@ def update_with_http_info(self, note_id, simple_public_object_input, **kwargs): :type note_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 + :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 diff --git a/hubspot/crm/objects/notes/api/batch_api.py b/hubspot/crm/objects/notes/api/batch_api.py index ea93db03..a3767e55 100644 --- a/hubspot/crm/objects/notes/api/batch_api.py +++ b/hubspot/crm/objects/notes/api/batch_api.py @@ -157,17 +157,17 @@ def archive_with_http_info(self, batch_input_simple_public_object_id, **kwargs): _request_auth=local_var_params.get("_request_auth"), ) - def create(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of notes # 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) + >>> thread = api.create(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -184,19 +184,19 @@ def create(self, batch_input_simple_public_object_input_for_create, **kwargs): :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 + return self.create_with_http_info(batch_input_simple_public_object_batch_input_for_create, **kwargs) # noqa: E501 - def create_with_http_info(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create_with_http_info(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of notes # 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) + >>> thread = api.create_with_http_info(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :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 @@ -223,7 +223,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat local_var_params = locals() - all_params = ["batch_input_simple_public_object_input_for_create"] + all_params = ["batch_input_simple_public_object_batch_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"]): @@ -231,9 +231,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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 + # verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_for_create` when calling `create`") # noqa: E501 collection_formats = {} @@ -247,8 +247,8 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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"] + if "batch_input_simple_public_object_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_for_create"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -287,6 +287,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of notes by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -318,6 +319,7 @@ def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E50 def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of notes by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/objects/notes/models/__init__.py b/hubspot/crm/objects/notes/models/__init__.py index 0fee99dc..51ac49b1 100644 --- a/hubspot/crm/objects/notes/models/__init__.py +++ b/hubspot/crm/objects/notes/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.objects.notes.models.associated_id import AssociatedId from hubspot.crm.objects.notes.models.association_spec import AssociationSpec from hubspot.crm.objects.notes.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.notes.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.notes.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.notes.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.notes.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.notes.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.notes.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.notes.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -41,6 +41,7 @@ from hubspot.crm.objects.notes.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.notes.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.notes.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.notes.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.notes.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.notes.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.notes.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/notes/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/objects/notes/models/batch_input_simple_public_object_batch_input_for_create.py similarity index 80% rename from hubspot/crm/objects/notes/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/objects/notes/models/batch_input_simple_public_object_batch_input_for_create.py index 1e312197..99baf7d2 100644 --- a/hubspot/crm/objects/notes/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/notes/models/batch_input_simple_public_object_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.objects.notes.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectBatchInputForCreate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class BatchInputSimplePublicObjectInputForCreate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"inputs": "list[SimplePublicObjectInputForCreate]"} + openapi_types = {"inputs": "list[SimplePublicObjectBatchInputForCreate]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 @@ -52,21 +52,21 @@ def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 @property def inputs(self): - """Gets the inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + """Gets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] """ return self._inputs @inputs.setter def inputs(self, inputs): - """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/notes/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/objects/notes/models/batch_read_input_simple_public_object_id.py index 7ede5425..1ef5b031 100644 --- a/hubspot/crm/objects/notes/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/objects/notes/models/batch_read_input_simple_public_object_id.py @@ -84,7 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -95,7 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/objects/notes/models/simple_public_object.py b/hubspot/crm/objects/notes/models/simple_public_object.py index 8c4e12ea..ca178100 100644 --- a/hubspot/crm/objects/notes/models/simple_public_object.py +++ b/hubspot/crm/objects/notes/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 diff --git a/hubspot/crm/objects/notes/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/objects/notes/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..8cb2e546 --- /dev/null +++ b/hubspot/crm/objects/notes/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Notes + + 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.notes.configuration import Configuration + + +class SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/notes/models/simple_public_object_input.py b/hubspot/crm/objects/notes/models/simple_public_object_input.py index 5463ae6e..deffa289 100644 --- a/hubspot/crm/objects/notes/models/simple_public_object_input.py +++ b/hubspot/crm/objects/notes/models/simple_public_object_input.py @@ -35,45 +35,21 @@ class SimplePublicObjectInput(object): 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]"} + openapi_types = {"properties": "dict[str, str]"} - attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"properties": "properties"} - def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, 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 diff --git a/hubspot/crm/objects/notes/models/simple_public_object_input_for_create.py b/hubspot/crm/objects/notes/models/simple_public_object_input_for_create.py index 5a2b79d0..d8daa00c 100644 --- a/hubspot/crm/objects/notes/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/notes/models/simple_public_object_input_for_create.py @@ -35,24 +35,22 @@ class SimplePublicObjectInputForCreate(object): 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]"} + openapi_types = {"associations": "list[PublicAssociationsForObject]", "properties": "dict[str, str]"} - attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"associations": "associations", "properties": "properties"} - def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, associations=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 + if associations is not None: + self.associations = associations self.properties = properties @property @@ -73,32 +71,9 @@ def associations(self, associations): :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 diff --git a/hubspot/crm/objects/notes/models/simple_public_object_with_associations.py b/hubspot/crm/objects/notes/models/simple_public_object_with_associations.py index d43de9a7..05ecaee9 100644 --- a/hubspot/crm/objects/notes/models/simple_public_object_with_associations.py +++ b/hubspot/crm/objects/notes/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -218,6 +233,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 diff --git a/hubspot/crm/objects/notes/models/simple_public_upsert_object.py b/hubspot/crm/objects/notes/models/simple_public_upsert_object.py index 2db349db..fd063575 100644 --- a/hubspot/crm/objects/notes/models/simple_public_upsert_object.py +++ b/hubspot/crm/objects/notes/models/simple_public_upsert_object.py @@ -42,6 +42,7 @@ class SimplePublicUpsertObject(object): "new": "bool", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicUpsertObject(object): "new": "new", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._new = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -84,6 +97,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -219,6 +234,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. # noqa: E501 From 4fcbd65f6dc5821c53a4929a5dbce1dc7dcbb93b Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 8 Apr 2025 09:43:24 +0300 Subject: [PATCH 24/49] Codegen Crm Objects Postal Mail --- hubspot/crm/objects/postal_mail/__init__.py | 3 +- .../crm/objects/postal_mail/api/basic_api.py | 12 +- .../crm/objects/postal_mail/api/batch_api.py | 32 ++-- .../objects/postal_mail/models/__init__.py | 3 +- ...e_public_object_batch_input_for_create.py} | 22 +-- ...atch_read_input_simple_public_object_id.py | 4 +- .../models/simple_public_object.py | 30 +++- ...le_public_object_batch_input_for_create.py | 170 ++++++++++++++++++ .../models/simple_public_object_input.py | 30 +--- .../simple_public_object_input_for_create.py | 35 +--- .../simple_public_object_with_associations.py | 38 +++- .../models/simple_public_upsert_object.py | 38 +++- 12 files changed, 321 insertions(+), 96 deletions(-) rename hubspot/crm/objects/postal_mail/models/{batch_input_simple_public_object_input_for_create.py => batch_input_simple_public_object_batch_input_for_create.py} (80%) create mode 100644 hubspot/crm/objects/postal_mail/models/simple_public_object_batch_input_for_create.py diff --git a/hubspot/crm/objects/postal_mail/__init__.py b/hubspot/crm/objects/postal_mail/__init__.py index 88aa2806..ea93badd 100644 --- a/hubspot/crm/objects/postal_mail/__init__.py +++ b/hubspot/crm/objects/postal_mail/__init__.py @@ -35,9 +35,9 @@ from hubspot.crm.objects.postal_mail.models.associated_id import AssociatedId from hubspot.crm.objects.postal_mail.models.association_spec import AssociationSpec from hubspot.crm.objects.postal_mail.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.postal_mail.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.postal_mail.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.postal_mail.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.postal_mail.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.postal_mail.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.postal_mail.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.postal_mail.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -59,6 +59,7 @@ from hubspot.crm.objects.postal_mail.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.postal_mail.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.postal_mail.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.postal_mail.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.postal_mail.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.postal_mail.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.postal_mail.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/postal_mail/api/basic_api.py b/hubspot/crm/objects/postal_mail/api/basic_api.py index c1365f9e..510cb8d6 100644 --- a/hubspot/crm/objects/postal_mail/api/basic_api.py +++ b/hubspot/crm/objects/postal_mail/api/basic_api.py @@ -302,7 +302,7 @@ def get_by_id(self, postal_mail_id, **kwargs): # noqa: E501 :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 + :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 @@ -342,7 +342,7 @@ def get_by_id_with_http_info(self, postal_mail_id, **kwargs): # noqa: E501 :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 + :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 @@ -594,7 +594,7 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501 def update(self, postal_mail_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{postalMailId}`. `{postalMailId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{postalMailId}`or optionally a unique property value as specified by the `idProperty` query param. `{postalMailId}` 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 @@ -605,7 +605,7 @@ def update(self, postal_mail_id, simple_public_object_input, **kwargs): # noqa: :type postal_mail_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 + :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 @@ -628,7 +628,7 @@ def update(self, postal_mail_id, simple_public_object_input, **kwargs): # noqa: def update_with_http_info(self, postal_mail_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{postalMailId}`. `{postalMailId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{postalMailId}`or optionally a unique property value as specified by the `idProperty` query param. `{postalMailId}` 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 @@ -639,7 +639,7 @@ def update_with_http_info(self, postal_mail_id, simple_public_object_input, **kw :type postal_mail_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 + :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 diff --git a/hubspot/crm/objects/postal_mail/api/batch_api.py b/hubspot/crm/objects/postal_mail/api/batch_api.py index b9428e18..d19ed80e 100644 --- a/hubspot/crm/objects/postal_mail/api/batch_api.py +++ b/hubspot/crm/objects/postal_mail/api/batch_api.py @@ -157,17 +157,17 @@ def archive_with_http_info(self, batch_input_simple_public_object_id, **kwargs): _request_auth=local_var_params.get("_request_auth"), ) - def create(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of postal mail # 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) + >>> thread = api.create(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -184,19 +184,19 @@ def create(self, batch_input_simple_public_object_input_for_create, **kwargs): :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 + return self.create_with_http_info(batch_input_simple_public_object_batch_input_for_create, **kwargs) # noqa: E501 - def create_with_http_info(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create_with_http_info(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of postal mail # 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) + >>> thread = api.create_with_http_info(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :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 @@ -223,7 +223,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat local_var_params = locals() - all_params = ["batch_input_simple_public_object_input_for_create"] + all_params = ["batch_input_simple_public_object_batch_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"]): @@ -231,9 +231,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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 + # verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_for_create` when calling `create`") # noqa: E501 collection_formats = {} @@ -247,8 +247,8 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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"] + if "batch_input_simple_public_object_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_for_create"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -287,6 +287,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of postal mail by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -318,6 +319,7 @@ def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E50 def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of postal mail by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/objects/postal_mail/models/__init__.py b/hubspot/crm/objects/postal_mail/models/__init__.py index 7da8bdcc..661fdc5b 100644 --- a/hubspot/crm/objects/postal_mail/models/__init__.py +++ b/hubspot/crm/objects/postal_mail/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.objects.postal_mail.models.associated_id import AssociatedId from hubspot.crm.objects.postal_mail.models.association_spec import AssociationSpec from hubspot.crm.objects.postal_mail.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.postal_mail.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.postal_mail.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.postal_mail.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.postal_mail.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.postal_mail.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.postal_mail.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.postal_mail.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -41,6 +41,7 @@ from hubspot.crm.objects.postal_mail.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.postal_mail.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.postal_mail.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.postal_mail.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.postal_mail.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.postal_mail.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.postal_mail.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/postal_mail/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/objects/postal_mail/models/batch_input_simple_public_object_batch_input_for_create.py similarity index 80% rename from hubspot/crm/objects/postal_mail/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/objects/postal_mail/models/batch_input_simple_public_object_batch_input_for_create.py index 64e79d1c..9bb6ce97 100644 --- a/hubspot/crm/objects/postal_mail/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/postal_mail/models/batch_input_simple_public_object_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.objects.postal_mail.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectBatchInputForCreate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class BatchInputSimplePublicObjectInputForCreate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"inputs": "list[SimplePublicObjectInputForCreate]"} + openapi_types = {"inputs": "list[SimplePublicObjectBatchInputForCreate]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 @@ -52,21 +52,21 @@ def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 @property def inputs(self): - """Gets the inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + """Gets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] """ return self._inputs @inputs.setter def inputs(self, inputs): - """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/postal_mail/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/objects/postal_mail/models/batch_read_input_simple_public_object_id.py index ae5552d3..89a0bb94 100644 --- a/hubspot/crm/objects/postal_mail/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/objects/postal_mail/models/batch_read_input_simple_public_object_id.py @@ -84,7 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -95,7 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/objects/postal_mail/models/simple_public_object.py b/hubspot/crm/objects/postal_mail/models/simple_public_object.py index 3f6ebe4b..eeacd876 100644 --- a/hubspot/crm/objects/postal_mail/models/simple_public_object.py +++ b/hubspot/crm/objects/postal_mail/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 diff --git a/hubspot/crm/objects/postal_mail/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/objects/postal_mail/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..4c271c64 --- /dev/null +++ b/hubspot/crm/objects/postal_mail/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Postal Mail + + 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.postal_mail.configuration import Configuration + + +class SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/postal_mail/models/simple_public_object_input.py b/hubspot/crm/objects/postal_mail/models/simple_public_object_input.py index 2762ca20..bf7bf189 100644 --- a/hubspot/crm/objects/postal_mail/models/simple_public_object_input.py +++ b/hubspot/crm/objects/postal_mail/models/simple_public_object_input.py @@ -35,45 +35,21 @@ class SimplePublicObjectInput(object): 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]"} + openapi_types = {"properties": "dict[str, str]"} - attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"properties": "properties"} - def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, 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 diff --git a/hubspot/crm/objects/postal_mail/models/simple_public_object_input_for_create.py b/hubspot/crm/objects/postal_mail/models/simple_public_object_input_for_create.py index 38a14d59..3f9f4b76 100644 --- a/hubspot/crm/objects/postal_mail/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/postal_mail/models/simple_public_object_input_for_create.py @@ -35,24 +35,22 @@ class SimplePublicObjectInputForCreate(object): 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]"} + openapi_types = {"associations": "list[PublicAssociationsForObject]", "properties": "dict[str, str]"} - attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"associations": "associations", "properties": "properties"} - def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, associations=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 + if associations is not None: + self.associations = associations self.properties = properties @property @@ -73,32 +71,9 @@ def associations(self, associations): :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 diff --git a/hubspot/crm/objects/postal_mail/models/simple_public_object_with_associations.py b/hubspot/crm/objects/postal_mail/models/simple_public_object_with_associations.py index 7202d782..f652caa5 100644 --- a/hubspot/crm/objects/postal_mail/models/simple_public_object_with_associations.py +++ b/hubspot/crm/objects/postal_mail/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -218,6 +233,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 diff --git a/hubspot/crm/objects/postal_mail/models/simple_public_upsert_object.py b/hubspot/crm/objects/postal_mail/models/simple_public_upsert_object.py index aacc3b1b..dfdfb341 100644 --- a/hubspot/crm/objects/postal_mail/models/simple_public_upsert_object.py +++ b/hubspot/crm/objects/postal_mail/models/simple_public_upsert_object.py @@ -42,6 +42,7 @@ class SimplePublicUpsertObject(object): "new": "bool", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicUpsertObject(object): "new": "new", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._new = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -84,6 +97,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -219,6 +234,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. # noqa: E501 From 44bd5bca3629d178069779bfce8c370e9b290f08 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 8 Apr 2025 09:45:36 +0300 Subject: [PATCH 25/49] Codegen Crm Objects Tasks --- hubspot/crm/objects/tasks/__init__.py | 3 +- hubspot/crm/objects/tasks/api/basic_api.py | 12 +- hubspot/crm/objects/tasks/api/batch_api.py | 32 ++-- hubspot/crm/objects/tasks/models/__init__.py | 3 +- ...e_public_object_batch_input_for_create.py} | 22 +-- ...atch_read_input_simple_public_object_id.py | 4 +- .../tasks/models/simple_public_object.py | 30 +++- ...le_public_object_batch_input_for_create.py | 170 ++++++++++++++++++ .../models/simple_public_object_input.py | 30 +--- .../simple_public_object_input_for_create.py | 35 +--- .../simple_public_object_with_associations.py | 38 +++- .../models/simple_public_upsert_object.py | 38 +++- 12 files changed, 321 insertions(+), 96 deletions(-) rename hubspot/crm/objects/tasks/models/{batch_input_simple_public_object_input_for_create.py => batch_input_simple_public_object_batch_input_for_create.py} (80%) create mode 100644 hubspot/crm/objects/tasks/models/simple_public_object_batch_input_for_create.py diff --git a/hubspot/crm/objects/tasks/__init__.py b/hubspot/crm/objects/tasks/__init__.py index 4a692ed2..f12087e6 100644 --- a/hubspot/crm/objects/tasks/__init__.py +++ b/hubspot/crm/objects/tasks/__init__.py @@ -35,9 +35,9 @@ from hubspot.crm.objects.tasks.models.associated_id import AssociatedId from hubspot.crm.objects.tasks.models.association_spec import AssociationSpec from hubspot.crm.objects.tasks.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.tasks.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.tasks.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.tasks.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.tasks.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.tasks.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.tasks.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.tasks.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -59,6 +59,7 @@ from hubspot.crm.objects.tasks.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.tasks.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.tasks.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.tasks.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.tasks.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.tasks.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.tasks.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/tasks/api/basic_api.py b/hubspot/crm/objects/tasks/api/basic_api.py index 7ac72a1d..c15d1b31 100644 --- a/hubspot/crm/objects/tasks/api/basic_api.py +++ b/hubspot/crm/objects/tasks/api/basic_api.py @@ -302,7 +302,7 @@ def get_by_id(self, task_id, **kwargs): # noqa: E501 :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 + :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 @@ -342,7 +342,7 @@ def get_by_id_with_http_info(self, task_id, **kwargs): # noqa: E501 :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 + :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 @@ -594,7 +594,7 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501 def update(self, task_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{taskId}`. `{taskId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{taskId}`or optionally a unique property value as specified by the `idProperty` query param. `{taskId}` 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 @@ -605,7 +605,7 @@ def update(self, task_id, simple_public_object_input, **kwargs): # noqa: E501 :type task_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 + :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 @@ -628,7 +628,7 @@ def update(self, task_id, simple_public_object_input, **kwargs): # noqa: E501 def update_with_http_info(self, task_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{taskId}`. `{taskId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{taskId}`or optionally a unique property value as specified by the `idProperty` query param. `{taskId}` 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 @@ -639,7 +639,7 @@ def update_with_http_info(self, task_id, simple_public_object_input, **kwargs): :type task_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 + :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 diff --git a/hubspot/crm/objects/tasks/api/batch_api.py b/hubspot/crm/objects/tasks/api/batch_api.py index 721560d2..dca0397a 100644 --- a/hubspot/crm/objects/tasks/api/batch_api.py +++ b/hubspot/crm/objects/tasks/api/batch_api.py @@ -157,17 +157,17 @@ def archive_with_http_info(self, batch_input_simple_public_object_id, **kwargs): _request_auth=local_var_params.get("_request_auth"), ) - def create(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of tasks # 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) + >>> thread = api.create(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -184,19 +184,19 @@ def create(self, batch_input_simple_public_object_input_for_create, **kwargs): :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 + return self.create_with_http_info(batch_input_simple_public_object_batch_input_for_create, **kwargs) # noqa: E501 - def create_with_http_info(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create_with_http_info(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of tasks # 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) + >>> thread = api.create_with_http_info(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :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 @@ -223,7 +223,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat local_var_params = locals() - all_params = ["batch_input_simple_public_object_input_for_create"] + all_params = ["batch_input_simple_public_object_batch_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"]): @@ -231,9 +231,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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 + # verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_for_create` when calling `create`") # noqa: E501 collection_formats = {} @@ -247,8 +247,8 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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"] + if "batch_input_simple_public_object_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_for_create"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -287,6 +287,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of tasks by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -318,6 +319,7 @@ def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E50 def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of tasks by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/objects/tasks/models/__init__.py b/hubspot/crm/objects/tasks/models/__init__.py index 558be422..ee7c67a2 100644 --- a/hubspot/crm/objects/tasks/models/__init__.py +++ b/hubspot/crm/objects/tasks/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.objects.tasks.models.associated_id import AssociatedId from hubspot.crm.objects.tasks.models.association_spec import AssociationSpec from hubspot.crm.objects.tasks.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.tasks.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.tasks.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.tasks.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.tasks.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.tasks.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.tasks.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.tasks.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -41,6 +41,7 @@ from hubspot.crm.objects.tasks.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.tasks.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.tasks.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.tasks.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.tasks.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.tasks.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.tasks.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/tasks/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/objects/tasks/models/batch_input_simple_public_object_batch_input_for_create.py similarity index 80% rename from hubspot/crm/objects/tasks/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/objects/tasks/models/batch_input_simple_public_object_batch_input_for_create.py index a442f359..2a53cb65 100644 --- a/hubspot/crm/objects/tasks/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/tasks/models/batch_input_simple_public_object_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.objects.tasks.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectBatchInputForCreate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class BatchInputSimplePublicObjectInputForCreate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"inputs": "list[SimplePublicObjectInputForCreate]"} + openapi_types = {"inputs": "list[SimplePublicObjectBatchInputForCreate]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 @@ -52,21 +52,21 @@ def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 @property def inputs(self): - """Gets the inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + """Gets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] """ return self._inputs @inputs.setter def inputs(self, inputs): - """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/tasks/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/objects/tasks/models/batch_read_input_simple_public_object_id.py index 969ac530..d5228aae 100644 --- a/hubspot/crm/objects/tasks/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/objects/tasks/models/batch_read_input_simple_public_object_id.py @@ -84,7 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -95,7 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/objects/tasks/models/simple_public_object.py b/hubspot/crm/objects/tasks/models/simple_public_object.py index 1c2da840..8dcf7fe6 100644 --- a/hubspot/crm/objects/tasks/models/simple_public_object.py +++ b/hubspot/crm/objects/tasks/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 diff --git a/hubspot/crm/objects/tasks/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/objects/tasks/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..54bb0f33 --- /dev/null +++ b/hubspot/crm/objects/tasks/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Tasks + + 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.tasks.configuration import Configuration + + +class SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/tasks/models/simple_public_object_input.py b/hubspot/crm/objects/tasks/models/simple_public_object_input.py index aa51b56f..a4a401e4 100644 --- a/hubspot/crm/objects/tasks/models/simple_public_object_input.py +++ b/hubspot/crm/objects/tasks/models/simple_public_object_input.py @@ -35,45 +35,21 @@ class SimplePublicObjectInput(object): 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]"} + openapi_types = {"properties": "dict[str, str]"} - attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"properties": "properties"} - def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, 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 diff --git a/hubspot/crm/objects/tasks/models/simple_public_object_input_for_create.py b/hubspot/crm/objects/tasks/models/simple_public_object_input_for_create.py index 64fb3349..7e51db36 100644 --- a/hubspot/crm/objects/tasks/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/tasks/models/simple_public_object_input_for_create.py @@ -35,24 +35,22 @@ class SimplePublicObjectInputForCreate(object): 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]"} + openapi_types = {"associations": "list[PublicAssociationsForObject]", "properties": "dict[str, str]"} - attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"associations": "associations", "properties": "properties"} - def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, associations=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 + if associations is not None: + self.associations = associations self.properties = properties @property @@ -73,32 +71,9 @@ def associations(self, associations): :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 diff --git a/hubspot/crm/objects/tasks/models/simple_public_object_with_associations.py b/hubspot/crm/objects/tasks/models/simple_public_object_with_associations.py index f9d71d46..743c7d83 100644 --- a/hubspot/crm/objects/tasks/models/simple_public_object_with_associations.py +++ b/hubspot/crm/objects/tasks/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -218,6 +233,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 diff --git a/hubspot/crm/objects/tasks/models/simple_public_upsert_object.py b/hubspot/crm/objects/tasks/models/simple_public_upsert_object.py index 6525e1e4..0cbcc478 100644 --- a/hubspot/crm/objects/tasks/models/simple_public_upsert_object.py +++ b/hubspot/crm/objects/tasks/models/simple_public_upsert_object.py @@ -42,6 +42,7 @@ class SimplePublicUpsertObject(object): "new": "bool", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicUpsertObject(object): "new": "new", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._new = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -84,6 +97,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -219,6 +234,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. # noqa: E501 From cfd7f9b3e274db7fd8ba464c936d3b6e1f5c0f8e Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 8 Apr 2025 09:47:37 +0300 Subject: [PATCH 26/49] Codegen Crm Objects Taxes --- hubspot/crm/objects/taxes/__init__.py | 3 +- hubspot/crm/objects/taxes/api/basic_api.py | 12 +- hubspot/crm/objects/taxes/api/batch_api.py | 32 ++-- hubspot/crm/objects/taxes/models/__init__.py | 3 +- ...e_public_object_batch_input_for_create.py} | 22 +-- ...atch_read_input_simple_public_object_id.py | 4 +- .../taxes/models/simple_public_object.py | 30 +++- ...le_public_object_batch_input_for_create.py | 170 ++++++++++++++++++ .../models/simple_public_object_input.py | 30 +--- .../simple_public_object_input_for_create.py | 35 +--- .../simple_public_object_with_associations.py | 38 +++- .../models/simple_public_upsert_object.py | 38 +++- 12 files changed, 321 insertions(+), 96 deletions(-) rename hubspot/crm/objects/taxes/models/{batch_input_simple_public_object_input_for_create.py => batch_input_simple_public_object_batch_input_for_create.py} (80%) create mode 100644 hubspot/crm/objects/taxes/models/simple_public_object_batch_input_for_create.py diff --git a/hubspot/crm/objects/taxes/__init__.py b/hubspot/crm/objects/taxes/__init__.py index 251c7651..404a9be2 100644 --- a/hubspot/crm/objects/taxes/__init__.py +++ b/hubspot/crm/objects/taxes/__init__.py @@ -35,9 +35,9 @@ from hubspot.crm.objects.taxes.models.associated_id import AssociatedId from hubspot.crm.objects.taxes.models.association_spec import AssociationSpec from hubspot.crm.objects.taxes.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.taxes.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.taxes.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.taxes.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.taxes.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.taxes.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.taxes.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.taxes.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -59,6 +59,7 @@ from hubspot.crm.objects.taxes.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.taxes.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.taxes.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.taxes.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.taxes.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.taxes.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.taxes.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/taxes/api/basic_api.py b/hubspot/crm/objects/taxes/api/basic_api.py index ff29ded4..2bddb0c2 100644 --- a/hubspot/crm/objects/taxes/api/basic_api.py +++ b/hubspot/crm/objects/taxes/api/basic_api.py @@ -302,7 +302,7 @@ def get_by_id(self, tax_id, **kwargs): # noqa: E501 :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 + :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 @@ -342,7 +342,7 @@ def get_by_id_with_http_info(self, tax_id, **kwargs): # noqa: E501 :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 + :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 @@ -594,7 +594,7 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501 def update(self, tax_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{taxId}`. `{taxId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{taxId}`or optionally a unique property value as specified by the `idProperty` query param. `{taxId}` 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 @@ -605,7 +605,7 @@ def update(self, tax_id, simple_public_object_input, **kwargs): # noqa: E501 :type tax_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 + :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 @@ -628,7 +628,7 @@ def update(self, tax_id, simple_public_object_input, **kwargs): # noqa: E501 def update_with_http_info(self, tax_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{taxId}`. `{taxId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{taxId}`or optionally a unique property value as specified by the `idProperty` query param. `{taxId}` 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 @@ -639,7 +639,7 @@ def update_with_http_info(self, tax_id, simple_public_object_input, **kwargs): :type tax_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 + :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 diff --git a/hubspot/crm/objects/taxes/api/batch_api.py b/hubspot/crm/objects/taxes/api/batch_api.py index dcc5fa23..1098dbac 100644 --- a/hubspot/crm/objects/taxes/api/batch_api.py +++ b/hubspot/crm/objects/taxes/api/batch_api.py @@ -157,17 +157,17 @@ def archive_with_http_info(self, batch_input_simple_public_object_id, **kwargs): _request_auth=local_var_params.get("_request_auth"), ) - def create(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of taxes # 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) + >>> thread = api.create(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -184,19 +184,19 @@ def create(self, batch_input_simple_public_object_input_for_create, **kwargs): :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 + return self.create_with_http_info(batch_input_simple_public_object_batch_input_for_create, **kwargs) # noqa: E501 - def create_with_http_info(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create_with_http_info(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of taxes # 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) + >>> thread = api.create_with_http_info(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :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 @@ -223,7 +223,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat local_var_params = locals() - all_params = ["batch_input_simple_public_object_input_for_create"] + all_params = ["batch_input_simple_public_object_batch_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"]): @@ -231,9 +231,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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 + # verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_for_create` when calling `create`") # noqa: E501 collection_formats = {} @@ -247,8 +247,8 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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"] + if "batch_input_simple_public_object_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_for_create"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -287,6 +287,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of taxes by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -318,6 +319,7 @@ def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E50 def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of taxes by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/objects/taxes/models/__init__.py b/hubspot/crm/objects/taxes/models/__init__.py index 4c77c67d..154d8b55 100644 --- a/hubspot/crm/objects/taxes/models/__init__.py +++ b/hubspot/crm/objects/taxes/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.objects.taxes.models.associated_id import AssociatedId from hubspot.crm.objects.taxes.models.association_spec import AssociationSpec from hubspot.crm.objects.taxes.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.taxes.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.taxes.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.taxes.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.taxes.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.taxes.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.taxes.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.taxes.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -41,6 +41,7 @@ from hubspot.crm.objects.taxes.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.taxes.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.taxes.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.taxes.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.taxes.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.taxes.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.taxes.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/taxes/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/objects/taxes/models/batch_input_simple_public_object_batch_input_for_create.py similarity index 80% rename from hubspot/crm/objects/taxes/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/objects/taxes/models/batch_input_simple_public_object_batch_input_for_create.py index dbaf77e7..d3b08874 100644 --- a/hubspot/crm/objects/taxes/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/taxes/models/batch_input_simple_public_object_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.objects.taxes.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectBatchInputForCreate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class BatchInputSimplePublicObjectInputForCreate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"inputs": "list[SimplePublicObjectInputForCreate]"} + openapi_types = {"inputs": "list[SimplePublicObjectBatchInputForCreate]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 @@ -52,21 +52,21 @@ def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 @property def inputs(self): - """Gets the inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + """Gets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] """ return self._inputs @inputs.setter def inputs(self, inputs): - """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/taxes/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/objects/taxes/models/batch_read_input_simple_public_object_id.py index 10212331..e1bfe0df 100644 --- a/hubspot/crm/objects/taxes/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/objects/taxes/models/batch_read_input_simple_public_object_id.py @@ -84,7 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -95,7 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/objects/taxes/models/simple_public_object.py b/hubspot/crm/objects/taxes/models/simple_public_object.py index 7d375ed7..cb85750d 100644 --- a/hubspot/crm/objects/taxes/models/simple_public_object.py +++ b/hubspot/crm/objects/taxes/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 diff --git a/hubspot/crm/objects/taxes/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/objects/taxes/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..9059e7f4 --- /dev/null +++ b/hubspot/crm/objects/taxes/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Taxes + + 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.taxes.configuration import Configuration + + +class SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/taxes/models/simple_public_object_input.py b/hubspot/crm/objects/taxes/models/simple_public_object_input.py index 1d068abe..752b3afe 100644 --- a/hubspot/crm/objects/taxes/models/simple_public_object_input.py +++ b/hubspot/crm/objects/taxes/models/simple_public_object_input.py @@ -35,45 +35,21 @@ class SimplePublicObjectInput(object): 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]"} + openapi_types = {"properties": "dict[str, str]"} - attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"properties": "properties"} - def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, 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 diff --git a/hubspot/crm/objects/taxes/models/simple_public_object_input_for_create.py b/hubspot/crm/objects/taxes/models/simple_public_object_input_for_create.py index 582bd8cb..74c6a755 100644 --- a/hubspot/crm/objects/taxes/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/taxes/models/simple_public_object_input_for_create.py @@ -35,24 +35,22 @@ class SimplePublicObjectInputForCreate(object): 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]"} + openapi_types = {"associations": "list[PublicAssociationsForObject]", "properties": "dict[str, str]"} - attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"associations": "associations", "properties": "properties"} - def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, associations=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 + if associations is not None: + self.associations = associations self.properties = properties @property @@ -73,32 +71,9 @@ def associations(self, associations): :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 diff --git a/hubspot/crm/objects/taxes/models/simple_public_object_with_associations.py b/hubspot/crm/objects/taxes/models/simple_public_object_with_associations.py index 82549a28..d33122ae 100644 --- a/hubspot/crm/objects/taxes/models/simple_public_object_with_associations.py +++ b/hubspot/crm/objects/taxes/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -218,6 +233,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 diff --git a/hubspot/crm/objects/taxes/models/simple_public_upsert_object.py b/hubspot/crm/objects/taxes/models/simple_public_upsert_object.py index 21dcdff4..fa209ad7 100644 --- a/hubspot/crm/objects/taxes/models/simple_public_upsert_object.py +++ b/hubspot/crm/objects/taxes/models/simple_public_upsert_object.py @@ -42,6 +42,7 @@ class SimplePublicUpsertObject(object): "new": "bool", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicUpsertObject(object): "new": "new", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._new = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -84,6 +97,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -219,6 +234,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. # noqa: E501 From 0924d275ce586927281c85735953d14e219475f5 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 8 Apr 2025 09:49:54 +0300 Subject: [PATCH 27/49] Codegen Crm Objects --- hubspot/crm/objects/__init__.py | 3 +- hubspot/crm/objects/api/batch_api.py | 32 ++-- hubspot/crm/objects/models/__init__.py | 3 +- ...e_public_object_batch_input_for_create.py} | 22 +-- ...atch_read_input_simple_public_object_id.py | 4 +- .../objects/models/simple_public_object.py | 30 +++- ...le_public_object_batch_input_for_create.py | 170 ++++++++++++++++++ .../models/simple_public_object_input.py | 30 +--- .../simple_public_object_input_for_create.py | 35 +--- .../simple_public_object_with_associations.py | 38 +++- .../models/simple_public_upsert_object.py | 38 +++- 11 files changed, 315 insertions(+), 90 deletions(-) rename hubspot/crm/objects/models/{batch_input_simple_public_object_input_for_create.py => batch_input_simple_public_object_batch_input_for_create.py} (84%) create mode 100644 hubspot/crm/objects/models/simple_public_object_batch_input_for_create.py diff --git a/hubspot/crm/objects/__init__.py b/hubspot/crm/objects/__init__.py index f9294aba..bbc00c9d 100644 --- a/hubspot/crm/objects/__init__.py +++ b/hubspot/crm/objects/__init__.py @@ -35,9 +35,9 @@ from hubspot.crm.objects.models.associated_id import AssociatedId from hubspot.crm.objects.models.association_spec import AssociationSpec from hubspot.crm.objects.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -59,6 +59,7 @@ from hubspot.crm.objects.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/api/batch_api.py b/hubspot/crm/objects/api/batch_api.py index 4b1ea81b..74b872bd 100644 --- a/hubspot/crm/objects/api/batch_api.py +++ b/hubspot/crm/objects/api/batch_api.py @@ -166,19 +166,19 @@ def archive_with_http_info(self, object_type, batch_input_simple_public_object_i _request_auth=local_var_params.get("_request_auth"), ) - def create(self, object_type, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create(self, object_type, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of objects # 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(object_type, batch_input_simple_public_object_input_for_create, async_req=True) + >>> thread = api.create(object_type, batch_input_simple_public_object_batch_input_for_create, async_req=True) >>> result = thread.get() :param object_type: (required) :type object_type: str - :param batch_input_simple_public_object_input_for_create: (required) - :type batch_input_simple_public_object_input_for_create: BatchInputSimplePublicObjectInputForCreate + :param batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -195,21 +195,21 @@ def create(self, object_type, batch_input_simple_public_object_input_for_create, :rtype: BatchResponseSimplePublicObject """ kwargs["_return_http_data_only"] = True - return self.create_with_http_info(object_type, batch_input_simple_public_object_input_for_create, **kwargs) # noqa: E501 + return self.create_with_http_info(object_type, batch_input_simple_public_object_batch_input_for_create, **kwargs) # noqa: E501 - def create_with_http_info(self, object_type, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create_with_http_info(self, object_type, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of objects # 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(object_type, batch_input_simple_public_object_input_for_create, async_req=True) + >>> thread = api.create_with_http_info(object_type, batch_input_simple_public_object_batch_input_for_create, async_req=True) >>> result = thread.get() :param object_type: (required) :type object_type: str - :param batch_input_simple_public_object_input_for_create: (required) - :type batch_input_simple_public_object_input_for_create: BatchInputSimplePublicObjectInputForCreate + :param batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :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 @@ -236,7 +236,7 @@ def create_with_http_info(self, object_type, batch_input_simple_public_object_in local_var_params = locals() - all_params = ["object_type", "batch_input_simple_public_object_input_for_create"] + all_params = ["object_type", "batch_input_simple_public_object_batch_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"]): @@ -247,9 +247,9 @@ def create_with_http_info(self, object_type, batch_input_simple_public_object_in # verify the required parameter 'object_type' is set if self.api_client.client_side_validation and local_var_params.get("object_type") is None: # noqa: E501 raise ApiValueError("Missing the required parameter `object_type` when calling `create`") # noqa: E501 - # 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 + # verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_for_create` when calling `create`") # noqa: E501 collection_formats = {} @@ -265,8 +265,8 @@ def create_with_http_info(self, object_type, batch_input_simple_public_object_in 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"] + if "batch_input_simple_public_object_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_for_create"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -305,6 +305,7 @@ def create_with_http_info(self, object_type, batch_input_simple_public_object_in def read(self, object_type, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of objects by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -338,6 +339,7 @@ def read(self, object_type, batch_read_input_simple_public_object_id, **kwargs): def read_with_http_info(self, object_type, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of objects by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/objects/models/__init__.py b/hubspot/crm/objects/models/__init__.py index 77506250..73f16b02 100644 --- a/hubspot/crm/objects/models/__init__.py +++ b/hubspot/crm/objects/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.objects.models.associated_id import AssociatedId from hubspot.crm.objects.models.association_spec import AssociationSpec from hubspot.crm.objects.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.objects.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.objects.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.objects.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.objects.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -41,6 +41,7 @@ from hubspot.crm.objects.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.models.simple_public_object import SimplePublicObject from hubspot.crm.objects.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.objects.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.objects.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/objects/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/objects/models/batch_input_simple_public_object_batch_input_for_create.py similarity index 84% rename from hubspot/crm/objects/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/objects/models/batch_input_simple_public_object_batch_input_for_create.py index 3336a9d2..e8b93a7b 100644 --- a/hubspot/crm/objects/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/models/batch_input_simple_public_object_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.objects.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectBatchInputForCreate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class BatchInputSimplePublicObjectInputForCreate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"inputs": "list[SimplePublicObjectInputForCreate]"} + openapi_types = {"inputs": "list[SimplePublicObjectBatchInputForCreate]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 @@ -52,21 +52,21 @@ def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 @property def inputs(self): - """Gets the inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + """Gets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] """ return self._inputs @inputs.setter def inputs(self, inputs): - """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/objects/models/batch_read_input_simple_public_object_id.py index 01e8fcfd..17eb99bb 100644 --- a/hubspot/crm/objects/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/objects/models/batch_read_input_simple_public_object_id.py @@ -84,7 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -95,7 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. - The name of a property whose values are unique for this object # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/objects/models/simple_public_object.py b/hubspot/crm/objects/models/simple_public_object.py index 4ef77dd7..6553c713 100644 --- a/hubspot/crm/objects/models/simple_public_object.py +++ b/hubspot/crm/objects/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 diff --git a/hubspot/crm/objects/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/objects/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..c518ae42 --- /dev/null +++ b/hubspot/crm/objects/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + CRM Objects + + CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. # 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.configuration import Configuration + + +class SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/models/simple_public_object_input.py b/hubspot/crm/objects/models/simple_public_object_input.py index 6083a71b..43803d55 100644 --- a/hubspot/crm/objects/models/simple_public_object_input.py +++ b/hubspot/crm/objects/models/simple_public_object_input.py @@ -35,45 +35,21 @@ class SimplePublicObjectInput(object): 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]"} + openapi_types = {"properties": "dict[str, str]"} - attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"properties": "properties"} - def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, 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 diff --git a/hubspot/crm/objects/models/simple_public_object_input_for_create.py b/hubspot/crm/objects/models/simple_public_object_input_for_create.py index 1e3f033b..cd7cb2e1 100644 --- a/hubspot/crm/objects/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/models/simple_public_object_input_for_create.py @@ -35,24 +35,22 @@ class SimplePublicObjectInputForCreate(object): 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]"} + openapi_types = {"associations": "list[PublicAssociationsForObject]", "properties": "dict[str, str]"} - attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"associations": "associations", "properties": "properties"} - def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, associations=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 + if associations is not None: + self.associations = associations self.properties = properties @property @@ -73,32 +71,9 @@ def associations(self, associations): :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 diff --git a/hubspot/crm/objects/models/simple_public_object_with_associations.py b/hubspot/crm/objects/models/simple_public_object_with_associations.py index fbb6d6a8..66129e37 100644 --- a/hubspot/crm/objects/models/simple_public_object_with_associations.py +++ b/hubspot/crm/objects/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -218,6 +233,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 diff --git a/hubspot/crm/objects/models/simple_public_upsert_object.py b/hubspot/crm/objects/models/simple_public_upsert_object.py index 5e3b3cb9..5a80770f 100644 --- a/hubspot/crm/objects/models/simple_public_upsert_object.py +++ b/hubspot/crm/objects/models/simple_public_upsert_object.py @@ -42,6 +42,7 @@ class SimplePublicUpsertObject(object): "new": "bool", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicUpsertObject(object): "new": "new", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._new = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -84,6 +97,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -219,6 +234,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. # noqa: E501 From 868a3e3002731bb2e8d71501cf00b2e52e608a1a Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 14 Apr 2025 11:13:16 +0300 Subject: [PATCH 28/49] Codegen Crm Objects Companies --- hubspot/crm/companies/__init__.py | 4 +- hubspot/crm/companies/api/__init__.py | 1 - hubspot/crm/companies/api/basic_api.py | 172 +++++++++++++++--- hubspot/crm/companies/api/batch_api.py | 54 +++--- hubspot/crm/companies/api/merge_api.py | 160 ---------------- hubspot/crm/companies/api/search_api.py | 6 +- hubspot/crm/companies/models/__init__.py | 3 +- .../crm/companies/models/association_spec.py | 14 +- ...e_public_object_batch_input_for_create.py} | 22 +-- ...atch_read_input_simple_public_object_id.py | 2 + .../models/public_associations_for_object.py | 10 +- .../companies/models/public_merge_input.py | 4 + .../crm/companies/models/public_object_id.py | 7 +- .../companies/models/simple_public_object.py | 30 ++- .../simple_public_object_batch_input.py | 8 + ...le_public_object_batch_input_for_create.py | 170 +++++++++++++++++ ...simple_public_object_batch_input_upsert.py | 8 + .../models/simple_public_object_input.py | 32 +--- .../simple_public_object_input_for_create.py | 32 +--- .../simple_public_object_with_associations.py | 38 +++- .../models/simple_public_upsert_object.py | 38 +++- 21 files changed, 526 insertions(+), 289 deletions(-) delete mode 100644 hubspot/crm/companies/api/merge_api.py rename hubspot/crm/companies/models/{batch_input_simple_public_object_input_for_create.py => batch_input_simple_public_object_batch_input_for_create.py} (80%) create mode 100644 hubspot/crm/companies/models/simple_public_object_batch_input_for_create.py diff --git a/hubspot/crm/companies/__init__.py b/hubspot/crm/companies/__init__.py index bfa7b8d6..961bb44e 100644 --- a/hubspot/crm/companies/__init__.py +++ b/hubspot/crm/companies/__init__.py @@ -19,7 +19,6 @@ # import apis into sdk package from hubspot.crm.companies.api.basic_api import BasicApi from hubspot.crm.companies.api.batch_api import BatchApi -from hubspot.crm.companies.api.merge_api import MergeApi from hubspot.crm.companies.api.search_api import SearchApi # import ApiClient @@ -36,9 +35,9 @@ from hubspot.crm.companies.models.associated_id import AssociatedId from hubspot.crm.companies.models.association_spec import AssociationSpec from hubspot.crm.companies.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.companies.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.companies.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.companies.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.companies.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.companies.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.companies.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.companies.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -61,6 +60,7 @@ from hubspot.crm.companies.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.companies.models.simple_public_object import SimplePublicObject from hubspot.crm.companies.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.companies.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.companies.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.companies.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.companies.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/companies/api/__init__.py b/hubspot/crm/companies/api/__init__.py index 5baf6880..73e699f2 100644 --- a/hubspot/crm/companies/api/__init__.py +++ b/hubspot/crm/companies/api/__init__.py @@ -5,5 +5,4 @@ # import apis into api package from hubspot.crm.companies.api.basic_api import BasicApi from hubspot.crm.companies.api.batch_api import BatchApi -from hubspot.crm.companies.api.merge_api import MergeApi from hubspot.crm.companies.api.search_api import SearchApi diff --git a/hubspot/crm/companies/api/basic_api.py b/hubspot/crm/companies/api/basic_api.py index 3d9e8ddc..ae216370 100644 --- a/hubspot/crm/companies/api/basic_api.py +++ b/hubspot/crm/companies/api/basic_api.py @@ -34,9 +34,9 @@ def __init__(self, api_client=None): self.api_client = api_client def archive(self, company_id, **kwargs): # noqa: E501 - """Archive # noqa: E501 + """Archive a company # noqa: E501 - Move an Object identified by `{companyId}` to the recycling bin. # noqa: E501 + Delete a company by ID. Deleted companies can be restored within 90 days of deletion. Learn more about [restoring records](https://knowledge.hubspot.com/records/restore-deleted-records). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -64,9 +64,9 @@ def archive(self, company_id, **kwargs): # noqa: E501 return self.archive_with_http_info(company_id, **kwargs) # noqa: E501 def archive_with_http_info(self, company_id, **kwargs): # noqa: E501 - """Archive # noqa: E501 + """Archive a company # noqa: E501 - Move an Object identified by `{companyId}` to the recycling bin. # noqa: E501 + Delete a company by ID. Deleted companies can be restored within 90 days of deletion. Learn more about [restoring records](https://knowledge.hubspot.com/records/restore-deleted-records). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -155,9 +155,9 @@ def archive_with_http_info(self, company_id, **kwargs): # noqa: E501 ) def create(self, simple_public_object_input_for_create, **kwargs): # noqa: E501 - """Create # noqa: E501 + """Create a company # noqa: E501 - Create a company with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard companies is provided. # noqa: E501 + Create a single company. Include a `properties` object to define [property values](https://developers.hubspot.com/docs/guides/api/crm/properties) for the company, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -185,9 +185,9 @@ def create(self, simple_public_object_input_for_create, **kwargs): # noqa: E501 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 company # noqa: E501 - Create a company with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard companies is provided. # noqa: E501 + Create a single company. Include a `properties` object to define [property values](https://developers.hubspot.com/docs/guides/api/crm/properties) for the company, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -283,16 +283,16 @@ def create_with_http_info(self, simple_public_object_input_for_create, **kwargs) ) def get_by_id(self, company_id, **kwargs): # noqa: E501 - """Read # noqa: E501 + """Retrieve a company # noqa: E501 - Read an Object identified by `{companyId}`. `{companyId}` 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 + Retrieve a company by its ID (`companyId`) or by a unique property (`idProperty`). You can specify what is returned using the `properties` query parameter. # 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(company_id, async_req=True) >>> result = thread.get() - :param company_id: (required) + :param company_id: The ID of the company (required) :type company_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] @@ -323,16 +323,16 @@ def get_by_id(self, company_id, **kwargs): # noqa: E501 return self.get_by_id_with_http_info(company_id, **kwargs) # noqa: E501 def get_by_id_with_http_info(self, company_id, **kwargs): # noqa: E501 - """Read # noqa: E501 + """Retrieve a company # noqa: E501 - Read an Object identified by `{companyId}`. `{companyId}` 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 + Retrieve a company by its ID (`companyId`) or by a unique property (`idProperty`). You can specify what is returned using the `properties` query parameter. # 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(company_id, async_req=True) >>> result = thread.get() - :param company_id: (required) + :param company_id: The ID of the company (required) :type company_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] @@ -439,9 +439,9 @@ def get_by_id_with_http_info(self, company_id, **kwargs): # noqa: E501 ) def get_page(self, **kwargs): # noqa: E501 - """List # noqa: E501 + """Retrieve companies # noqa: E501 - Read a page of companies. Control what is returned via the `properties` query param. # noqa: E501 + Retrieve all companies, using query parameters to control the information that gets returned. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -479,9 +479,9 @@ def get_page(self, **kwargs): # noqa: E501 return self.get_page_with_http_info(**kwargs) # noqa: E501 def get_page_with_http_info(self, **kwargs): # noqa: E501 - """List # noqa: E501 + """Retrieve companies # noqa: E501 - Read a page of companies. Control what is returned via the `properties` query param. # noqa: E501 + Retrieve all companies, using query parameters to control the information that gets returned. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -591,10 +591,138 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501 _request_auth=local_var_params.get("_request_auth"), ) + def merge(self, public_merge_input, **kwargs): # noqa: E501 + """Merge two companies # noqa: E501 + + Merge two company records. Learn more about [merging records](https://knowledge.hubspot.com/records/merge-records). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.merge(public_merge_input, async_req=True) + >>> result = thread.get() + + :param public_merge_input: (required) + :type public_merge_input: PublicMergeInput + :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.merge_with_http_info(public_merge_input, **kwargs) # noqa: E501 + + def merge_with_http_info(self, public_merge_input, **kwargs): # noqa: E501 + """Merge two companies # noqa: E501 + + Merge two company records. Learn more about [merging records](https://knowledge.hubspot.com/records/merge-records). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.merge_with_http_info(public_merge_input, async_req=True) + >>> result = thread.get() + + :param public_merge_input: (required) + :type public_merge_input: PublicMergeInput + :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 = ["public_merge_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 merge" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'public_merge_input' is set + if self.api_client.client_side_validation and local_var_params.get("public_merge_input") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `public_merge_input` when calling `merge`") # 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_merge_input" in local_var_params: + body_params = local_var_params["public_merge_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: "SimplePublicObject", + } + + return self.api_client.call_api( + "/crm/v3/objects/companies/merge", + "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, company_id, simple_public_object_input, **kwargs): # noqa: E501 - """Update # noqa: E501 + """Update a company # noqa: E501 - Perform a partial update of an Object identified by `{companyId}`or optionally a unique property value as specified by the `idProperty` query param. `{companyId}` 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 + Update a company by ID (`companyId`) or unique property value (`idProperty`). 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 @@ -626,9 +754,9 @@ def update(self, company_id, simple_public_object_input, **kwargs): # noqa: E50 return self.update_with_http_info(company_id, simple_public_object_input, **kwargs) # noqa: E501 def update_with_http_info(self, company_id, simple_public_object_input, **kwargs): # noqa: E501 - """Update # noqa: E501 + """Update a company # noqa: E501 - Perform a partial update of an Object identified by `{companyId}`or optionally a unique property value as specified by the `idProperty` query param. `{companyId}` 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 + Update a company by ID (`companyId`) or unique property value (`idProperty`). 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 diff --git a/hubspot/crm/companies/api/batch_api.py b/hubspot/crm/companies/api/batch_api.py index f0f081e4..e005985f 100644 --- a/hubspot/crm/companies/api/batch_api.py +++ b/hubspot/crm/companies/api/batch_api.py @@ -34,8 +34,9 @@ def __init__(self, api_client=None): self.api_client = api_client def archive(self, batch_input_simple_public_object_id, **kwargs): # noqa: E501 - """Archive a batch of companies by ID # noqa: E501 + """Archive a batch of companies # noqa: E501 + Delete a batch of companies by ID. Deleted companies can be restored within 90 days of deletion. Learn more about [restoring records](https://knowledge.hubspot.com/records/restore-deleted-records). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -63,8 +64,9 @@ def archive(self, batch_input_simple_public_object_id, **kwargs): # noqa: E501 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 companies by ID # noqa: E501 + """Archive a batch of companies # noqa: E501 + Delete a batch of companies by ID. Deleted companies can be restored within 90 days of deletion. Learn more about [restoring records](https://knowledge.hubspot.com/records/restore-deleted-records). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -157,17 +159,18 @@ def archive_with_http_info(self, batch_input_simple_public_object_id, **kwargs): _request_auth=local_var_params.get("_request_auth"), ) - def create(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of companies # noqa: E501 + Create a batch of companies. The `inputs` array can contain a `properties` object to define property values for each company, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records. # 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) + >>> thread = api.create(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -184,19 +187,20 @@ def create(self, batch_input_simple_public_object_input_for_create, **kwargs): :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 + return self.create_with_http_info(batch_input_simple_public_object_batch_input_for_create, **kwargs) # noqa: E501 - def create_with_http_info(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create_with_http_info(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of companies # noqa: E501 + Create a batch of companies. The `inputs` array can contain a `properties` object to define property values for each company, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records. # 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) + >>> thread = api.create_with_http_info(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :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 @@ -223,7 +227,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat local_var_params = locals() - all_params = ["batch_input_simple_public_object_input_for_create"] + all_params = ["batch_input_simple_public_object_batch_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"]): @@ -231,9 +235,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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 + # verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_for_create` when calling `create`") # noqa: E501 collection_formats = {} @@ -247,8 +251,8 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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"] + if "batch_input_simple_public_object_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_for_create"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -285,8 +289,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat ) def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 - """Read a batch of companies by internal ID, or unique property values # noqa: E501 + """Retrieve a batch of companies # noqa: E501 + Retrieve a batch of companies by ID (`companyId`) or by a unique property (`idProperty`). You can specify what is returned using the `properties` query parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -316,8 +321,9 @@ def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E50 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 companies by internal ID, or unique property values # noqa: E501 + """Retrieve a batch of companies # noqa: E501 + Retrieve a batch of companies by ID (`companyId`) or by a unique property (`idProperty`). You can specify what is returned using the `properties` query parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -418,8 +424,9 @@ def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs ) def update(self, batch_input_simple_public_object_batch_input, **kwargs): # noqa: E501 - """Update a batch of companies by internal ID, or unique property values # noqa: E501 + """Update a batch of companies # noqa: E501 + Update a batch of companies by ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -447,8 +454,9 @@ def update(self, batch_input_simple_public_object_batch_input, **kwargs): # noq 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 companies by internal ID, or unique property values # noqa: E501 + """Update a batch of companies # noqa: E501 + Update a batch of companies by ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -547,7 +555,7 @@ def update_with_http_info(self, batch_input_simple_public_object_batch_input, ** def upsert(self, batch_input_simple_public_object_batch_input_upsert, **kwargs): # noqa: E501 """Create or update a batch of companies by unique property values # noqa: E501 - Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object. # noqa: E501 + Create or update companies identified by a unique property value as specified by the `idProperty` query parameter. `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 @@ -577,7 +585,7 @@ def upsert(self, batch_input_simple_public_object_batch_input_upsert, **kwargs): def upsert_with_http_info(self, batch_input_simple_public_object_batch_input_upsert, **kwargs): # noqa: E501 """Create or update a batch of companies by unique property values # noqa: E501 - Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object. # noqa: E501 + Create or update companies identified by a unique property value as specified by the `idProperty` query parameter. `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 diff --git a/hubspot/crm/companies/api/merge_api.py b/hubspot/crm/companies/api/merge_api.py deleted file mode 100644 index ab31978b..00000000 --- a/hubspot/crm/companies/api/merge_api.py +++ /dev/null @@ -1,160 +0,0 @@ -# coding: utf-8 - -""" - Companies - - 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.companies.api_client import ApiClient -from hubspot.crm.companies.exceptions import ApiTypeError, ApiValueError # noqa: F401 - - -class MergeApi(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 merge(self, public_merge_input, **kwargs): # noqa: E501 - """Merge two companies with same type # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.merge(public_merge_input, async_req=True) - >>> result = thread.get() - - :param public_merge_input: (required) - :type public_merge_input: PublicMergeInput - :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.merge_with_http_info(public_merge_input, **kwargs) # noqa: E501 - - def merge_with_http_info(self, public_merge_input, **kwargs): # noqa: E501 - """Merge two companies with same type # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.merge_with_http_info(public_merge_input, async_req=True) - >>> result = thread.get() - - :param public_merge_input: (required) - :type public_merge_input: PublicMergeInput - :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 = ["public_merge_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 merge" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'public_merge_input' is set - if self.api_client.client_side_validation and local_var_params.get("public_merge_input") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `public_merge_input` when calling `merge`") # 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_merge_input" in local_var_params: - body_params = local_var_params["public_merge_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: "SimplePublicObject", - } - - return self.api_client.call_api( - "/crm/v3/objects/companies/merge", - "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/companies/api/search_api.py b/hubspot/crm/companies/api/search_api.py index 8c068c06..753d5f03 100644 --- a/hubspot/crm/companies/api/search_api.py +++ b/hubspot/crm/companies/api/search_api.py @@ -34,8 +34,9 @@ def __init__(self, api_client=None): self.api_client = api_client def do_search(self, public_object_search_request, **kwargs): # noqa: E501 - """do_search # noqa: E501 + """Search for companies # noqa: E501 + Search for companies by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -63,8 +64,9 @@ def do_search(self, public_object_search_request, **kwargs): # noqa: E501 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 + """Search for companies # noqa: E501 + Search for companies by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/companies/models/__init__.py b/hubspot/crm/companies/models/__init__.py index 64de596b..12514b09 100644 --- a/hubspot/crm/companies/models/__init__.py +++ b/hubspot/crm/companies/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.companies.models.associated_id import AssociatedId from hubspot.crm.companies.models.association_spec import AssociationSpec from hubspot.crm.companies.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.companies.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.companies.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.companies.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.companies.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.companies.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.companies.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.companies.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -42,6 +42,7 @@ from hubspot.crm.companies.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.companies.models.simple_public_object import SimplePublicObject from hubspot.crm.companies.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.companies.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.companies.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.companies.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.companies.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/companies/models/association_spec.py b/hubspot/crm/companies/models/association_spec.py index 3d747745..be7f4b67 100644 --- a/hubspot/crm/companies/models/association_spec.py +++ b/hubspot/crm/companies/models/association_spec.py @@ -49,15 +49,14 @@ def __init__(self, association_category=None, association_type_id=None, local_va self._association_type_id = None self.discriminator = None - if association_category is not None: - self.association_category = association_category - if association_type_id is not None: - self.association_type_id = association_type_id + 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 + For [labeled associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4#associate-records-with-a-label), the category of the association. # noqa: E501 :return: The association_category of this AssociationSpec. # noqa: E501 :rtype: str @@ -68,10 +67,13 @@ def association_category(self): def association_category(self, association_category): """Sets the association_category of this AssociationSpec. + For [labeled associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4#associate-records-with-a-label), the category of the association. # noqa: E501 :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 @@ -82,6 +84,7 @@ def association_category(self, association_category): def association_type_id(self): """Gets the association_type_id of this AssociationSpec. # noqa: E501 + The [association type ID](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4#association-type-id-values) (e.g., `4` for contact-to-company associations). # noqa: E501 :return: The association_type_id of this AssociationSpec. # noqa: E501 :rtype: int @@ -92,10 +95,13 @@ def association_type_id(self): def association_type_id(self, association_type_id): """Sets the association_type_id of this AssociationSpec. + The [association type ID](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4#association-type-id-values) (e.g., `4` for contact-to-company associations). # noqa: E501 :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 diff --git a/hubspot/crm/companies/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/companies/models/batch_input_simple_public_object_batch_input_for_create.py similarity index 80% rename from hubspot/crm/companies/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/companies/models/batch_input_simple_public_object_batch_input_for_create.py index 3b2cf8d3..e8401bfb 100644 --- a/hubspot/crm/companies/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/companies/models/batch_input_simple_public_object_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.companies.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectBatchInputForCreate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class BatchInputSimplePublicObjectInputForCreate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"inputs": "list[SimplePublicObjectInputForCreate]"} + openapi_types = {"inputs": "list[SimplePublicObjectBatchInputForCreate]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 @@ -52,21 +52,21 @@ def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 @property def inputs(self): - """Gets the inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + """Gets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] """ return self._inputs @inputs.setter def inputs(self, inputs): - """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/companies/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/companies/models/batch_read_input_simple_public_object_id.py index 99880ad8..41ae21bf 100644 --- a/hubspot/crm/companies/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/companies/models/batch_read_input_simple_public_object_id.py @@ -84,6 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -94,6 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/companies/models/public_associations_for_object.py b/hubspot/crm/companies/models/public_associations_for_object.py index 83d38899..12fc6e9a 100644 --- a/hubspot/crm/companies/models/public_associations_for_object.py +++ b/hubspot/crm/companies/models/public_associations_for_object.py @@ -49,10 +49,8 @@ def __init__(self, types=None, to=None, local_vars_configuration=None): # noqa: self._to = None self.discriminator = None - if types is not None: - self.types = types - if to is not None: - self.to = to + self.types = types + self.to = to @property def types(self): @@ -72,6 +70,8 @@ def types(self, types): :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 @@ -93,6 +93,8 @@ def to(self, to): :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 diff --git a/hubspot/crm/companies/models/public_merge_input.py b/hubspot/crm/companies/models/public_merge_input.py index eb514ed5..13bc811f 100644 --- a/hubspot/crm/companies/models/public_merge_input.py +++ b/hubspot/crm/companies/models/public_merge_input.py @@ -56,6 +56,7 @@ def __init__(self, object_id_to_merge=None, primary_object_id=None, local_vars_c def object_id_to_merge(self): """Gets the object_id_to_merge of this PublicMergeInput. # noqa: E501 + The ID of the company to merge into the primary. # noqa: E501 :return: The object_id_to_merge of this PublicMergeInput. # noqa: E501 :rtype: str @@ -66,6 +67,7 @@ def object_id_to_merge(self): def object_id_to_merge(self, object_id_to_merge): """Sets the object_id_to_merge of this PublicMergeInput. + The ID of the company to merge into the primary. # noqa: E501 :param object_id_to_merge: The object_id_to_merge of this PublicMergeInput. # noqa: E501 :type object_id_to_merge: str @@ -79,6 +81,7 @@ def object_id_to_merge(self, object_id_to_merge): def primary_object_id(self): """Gets the primary_object_id of this PublicMergeInput. # noqa: E501 + The ID of the primary company, which the other will merge into. # noqa: E501 :return: The primary_object_id of this PublicMergeInput. # noqa: E501 :rtype: str @@ -89,6 +92,7 @@ def primary_object_id(self): def primary_object_id(self, primary_object_id): """Sets the primary_object_id of this PublicMergeInput. + The ID of the primary company, which the other will merge into. # noqa: E501 :param primary_object_id: The primary_object_id of this PublicMergeInput. # noqa: E501 :type primary_object_id: str diff --git a/hubspot/crm/companies/models/public_object_id.py b/hubspot/crm/companies/models/public_object_id.py index f29d08c9..b13d350d 100644 --- a/hubspot/crm/companies/models/public_object_id.py +++ b/hubspot/crm/companies/models/public_object_id.py @@ -48,13 +48,13 @@ def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 self._id = None self.discriminator = None - if id is not None: - self.id = id + self.id = id @property def id(self): """Gets the id of this PublicObjectId. # noqa: E501 + The ID of the target record to associate. # noqa: E501 :return: The id of this PublicObjectId. # noqa: E501 :rtype: str @@ -65,10 +65,13 @@ def id(self): def id(self, id): """Sets the id of this PublicObjectId. + The ID of the target record to associate. # noqa: E501 :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 diff --git a/hubspot/crm/companies/models/simple_public_object.py b/hubspot/crm/companies/models/simple_public_object.py index b70e7402..e7c1971f 100644 --- a/hubspot/crm/companies/models/simple_public_object.py +++ b/hubspot/crm/companies/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 diff --git a/hubspot/crm/companies/models/simple_public_object_batch_input.py b/hubspot/crm/companies/models/simple_public_object_batch_input.py index b215ee22..bd25e23b 100644 --- a/hubspot/crm/companies/models/simple_public_object_batch_input.py +++ b/hubspot/crm/companies/models/simple_public_object_batch_input.py @@ -62,6 +62,7 @@ def __init__(self, id_property=None, object_write_trace_id=None, id=None, proper def id_property(self): """Gets the id_property of this SimplePublicObjectBatchInput. # noqa: E501 + The name of a property whose values are unique for this object # noqa: E501 :return: The id_property of this SimplePublicObjectBatchInput. # noqa: E501 :rtype: str @@ -72,6 +73,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this SimplePublicObjectBatchInput. + The name of a property whose values are unique for this object # noqa: E501 :param id_property: The id_property of this SimplePublicObjectBatchInput. # noqa: E501 :type id_property: str @@ -83,6 +85,7 @@ def id_property(self, id_property): def object_write_trace_id(self): """Gets the object_write_trace_id of this SimplePublicObjectBatchInput. # noqa: E501 + In each input object, set this field to a unique ID value to enable more granular debugging for error responses. Learn more about [multi-status errors](https://developers.hubspot.com/docs/reference/api/other-resources/error-handling#multi-status-errors). # noqa: E501 :return: The object_write_trace_id of this SimplePublicObjectBatchInput. # noqa: E501 :rtype: str @@ -93,6 +96,7 @@ def object_write_trace_id(self): def object_write_trace_id(self, object_write_trace_id): """Sets the object_write_trace_id of this SimplePublicObjectBatchInput. + In each input object, set this field to a unique ID value to enable more granular debugging for error responses. Learn more about [multi-status errors](https://developers.hubspot.com/docs/reference/api/other-resources/error-handling#multi-status-errors). # noqa: E501 :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInput. # noqa: E501 :type object_write_trace_id: str @@ -104,6 +108,7 @@ def object_write_trace_id(self, object_write_trace_id): def id(self): """Gets the id of this SimplePublicObjectBatchInput. # noqa: E501 + The ID to be updated. This can be the object ID, or the unique property value of the `idProperty` property. # noqa: E501 :return: The id of this SimplePublicObjectBatchInput. # noqa: E501 :rtype: str @@ -114,6 +119,7 @@ def id(self): def id(self, id): """Sets the id of this SimplePublicObjectBatchInput. + The ID to be updated. This can be the object ID, or the unique property value of the `idProperty` property. # noqa: E501 :param id: The id of this SimplePublicObjectBatchInput. # noqa: E501 :type id: str @@ -127,6 +133,7 @@ def id(self, id): def properties(self): """Gets the properties of this SimplePublicObjectBatchInput. # noqa: E501 + The company property values to set. # noqa: E501 :return: The properties of this SimplePublicObjectBatchInput. # noqa: E501 :rtype: dict[str, str] @@ -137,6 +144,7 @@ def properties(self): def properties(self, properties): """Sets the properties of this SimplePublicObjectBatchInput. + The company property values to set. # noqa: E501 :param properties: The properties of this SimplePublicObjectBatchInput. # noqa: E501 :type properties: dict[str, str] diff --git a/hubspot/crm/companies/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/companies/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..be973496 --- /dev/null +++ b/hubspot/crm/companies/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Companies + + 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.companies.configuration import Configuration + + +class SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/companies/models/simple_public_object_batch_input_upsert.py b/hubspot/crm/companies/models/simple_public_object_batch_input_upsert.py index c1747943..0ef8b9d2 100644 --- a/hubspot/crm/companies/models/simple_public_object_batch_input_upsert.py +++ b/hubspot/crm/companies/models/simple_public_object_batch_input_upsert.py @@ -62,6 +62,7 @@ def __init__(self, id_property=None, object_write_trace_id=None, id=None, proper def id_property(self): """Gets the id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + The name of a property whose values are unique for this object # noqa: E501 :return: The id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :rtype: str @@ -72,6 +73,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this SimplePublicObjectBatchInputUpsert. + The name of a property whose values are unique for this object # noqa: E501 :param id_property: The id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :type id_property: str @@ -83,6 +85,7 @@ def id_property(self, id_property): def object_write_trace_id(self): """Gets the object_write_trace_id of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + In each input object, set this field to a unique ID value to enable more granular debugging for error responses. Learn more about [multi-status errors](https://developers.hubspot.com/docs/reference/api/other-resources/error-handling#multi-status-errors). # noqa: E501 :return: The object_write_trace_id of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :rtype: str @@ -93,6 +96,7 @@ def object_write_trace_id(self): def object_write_trace_id(self, object_write_trace_id): """Sets the object_write_trace_id of this SimplePublicObjectBatchInputUpsert. + In each input object, set this field to a unique ID value to enable more granular debugging for error responses. Learn more about [multi-status errors](https://developers.hubspot.com/docs/reference/api/other-resources/error-handling#multi-status-errors). # noqa: E501 :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :type object_write_trace_id: str @@ -104,6 +108,7 @@ def object_write_trace_id(self, object_write_trace_id): def id(self): """Gets the id of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + The ID of the company to update. # noqa: E501 :return: The id of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :rtype: str @@ -114,6 +119,7 @@ def id(self): def id(self, id): """Sets the id of this SimplePublicObjectBatchInputUpsert. + The ID of the company to update. # noqa: E501 :param id: The id of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :type id: str @@ -127,6 +133,7 @@ def id(self, id): def properties(self): """Gets the properties of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + The company property values to set. # noqa: E501 :return: The properties of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :rtype: dict[str, str] @@ -137,6 +144,7 @@ def properties(self): def properties(self, properties): """Sets the properties of this SimplePublicObjectBatchInputUpsert. + The company property values to set. # noqa: E501 :param properties: The properties of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :type properties: dict[str, str] diff --git a/hubspot/crm/companies/models/simple_public_object_input.py b/hubspot/crm/companies/models/simple_public_object_input.py index aac05211..973b321c 100644 --- a/hubspot/crm/companies/models/simple_public_object_input.py +++ b/hubspot/crm/companies/models/simple_public_object_input.py @@ -35,49 +35,26 @@ class SimplePublicObjectInput(object): 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]"} + openapi_types = {"properties": "dict[str, str]"} - attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"properties": "properties"} - def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, 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 + The company property values to set. # noqa: E501 :return: The properties of this SimplePublicObjectInput. # noqa: E501 :rtype: dict[str, str] @@ -88,6 +65,7 @@ def properties(self): def properties(self, properties): """Sets the properties of this SimplePublicObjectInput. + The company property values to set. # noqa: E501 :param properties: The properties of this SimplePublicObjectInput. # noqa: E501 :type properties: dict[str, str] diff --git a/hubspot/crm/companies/models/simple_public_object_input_for_create.py b/hubspot/crm/companies/models/simple_public_object_input_for_create.py index adcf5077..445435c8 100644 --- a/hubspot/crm/companies/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/companies/models/simple_public_object_input_for_create.py @@ -35,25 +35,22 @@ class SimplePublicObjectInputForCreate(object): 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]"} + openapi_types = {"associations": "list[PublicAssociationsForObject]", "properties": "dict[str, str]"} - attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"associations": "associations", "properties": "properties"} - def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, associations=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 if associations is not 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 @@ -77,31 +74,11 @@ def associations(self, associations): 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 + The company property values to set. # noqa: E501 :return: The properties of this SimplePublicObjectInputForCreate. # noqa: E501 :rtype: dict[str, str] @@ -112,6 +89,7 @@ def properties(self): def properties(self, properties): """Sets the properties of this SimplePublicObjectInputForCreate. + The company property values to set. # noqa: E501 :param properties: The properties of this SimplePublicObjectInputForCreate. # noqa: E501 :type properties: dict[str, str] diff --git a/hubspot/crm/companies/models/simple_public_object_with_associations.py b/hubspot/crm/companies/models/simple_public_object_with_associations.py index bd1552a2..a070b811 100644 --- a/hubspot/crm/companies/models/simple_public_object_with_associations.py +++ b/hubspot/crm/companies/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -218,6 +233,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 diff --git a/hubspot/crm/companies/models/simple_public_upsert_object.py b/hubspot/crm/companies/models/simple_public_upsert_object.py index da8bfdbf..e2b27142 100644 --- a/hubspot/crm/companies/models/simple_public_upsert_object.py +++ b/hubspot/crm/companies/models/simple_public_upsert_object.py @@ -42,6 +42,7 @@ class SimplePublicUpsertObject(object): "new": "bool", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicUpsertObject(object): "new": "new", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._new = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -84,6 +97,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -219,6 +234,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. # noqa: E501 From c0a5c4f68572b9cd9a749dd6f5cf6686dc2039ff Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 14 Apr 2025 11:15:21 +0300 Subject: [PATCH 29/49] Codegen Crm Objects Contacts --- hubspot/crm/contacts/__init__.py | 5 +- hubspot/crm/contacts/api/__init__.py | 2 - hubspot/crm/contacts/api/basic_api.py | 306 ++++++++++++++++-- hubspot/crm/contacts/api/batch_api.py | 58 ++-- hubspot/crm/contacts/api/gdpr_api.py | 160 --------- hubspot/crm/contacts/api/merge_api.py | 160 --------- hubspot/crm/contacts/api/search_api.py | 6 +- hubspot/crm/contacts/models/__init__.py | 3 +- .../crm/contacts/models/association_spec.py | 10 +- ...e_public_object_batch_input_for_create.py} | 22 +- ...atch_read_input_simple_public_object_id.py | 2 + .../models/public_associations_for_object.py | 10 +- .../models/public_gdpr_delete_input.py | 4 + .../crm/contacts/models/public_object_id.py | 5 +- .../contacts/models/simple_public_object.py | 30 +- .../simple_public_object_batch_input.py | 4 + ...le_public_object_batch_input_for_create.py | 170 ++++++++++ ...simple_public_object_batch_input_upsert.py | 2 + .../models/simple_public_object_input.py | 30 +- .../simple_public_object_input_for_create.py | 30 +- .../simple_public_object_with_associations.py | 44 ++- .../models/simple_public_upsert_object.py | 38 ++- 22 files changed, 644 insertions(+), 457 deletions(-) delete mode 100644 hubspot/crm/contacts/api/gdpr_api.py delete mode 100644 hubspot/crm/contacts/api/merge_api.py rename hubspot/crm/contacts/models/{batch_input_simple_public_object_input_for_create.py => batch_input_simple_public_object_batch_input_for_create.py} (80%) create mode 100644 hubspot/crm/contacts/models/simple_public_object_batch_input_for_create.py diff --git a/hubspot/crm/contacts/__init__.py b/hubspot/crm/contacts/__init__.py index e64f3db8..7f0ea871 100644 --- a/hubspot/crm/contacts/__init__.py +++ b/hubspot/crm/contacts/__init__.py @@ -19,8 +19,6 @@ # import apis into sdk package from hubspot.crm.contacts.api.basic_api import BasicApi from hubspot.crm.contacts.api.batch_api import BatchApi -from hubspot.crm.contacts.api.gdpr_api import GDPRApi -from hubspot.crm.contacts.api.merge_api import MergeApi from hubspot.crm.contacts.api.search_api import SearchApi # import ApiClient @@ -37,9 +35,9 @@ from hubspot.crm.contacts.models.associated_id import AssociatedId from hubspot.crm.contacts.models.association_spec import AssociationSpec from hubspot.crm.contacts.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.contacts.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.contacts.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.contacts.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.contacts.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.contacts.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.contacts.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.contacts.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -63,6 +61,7 @@ from hubspot.crm.contacts.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.contacts.models.simple_public_object import SimplePublicObject from hubspot.crm.contacts.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.contacts.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.contacts.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.contacts.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.contacts.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/contacts/api/__init__.py b/hubspot/crm/contacts/api/__init__.py index c9cf62aa..8b6d587f 100644 --- a/hubspot/crm/contacts/api/__init__.py +++ b/hubspot/crm/contacts/api/__init__.py @@ -5,6 +5,4 @@ # import apis into api package from hubspot.crm.contacts.api.basic_api import BasicApi from hubspot.crm.contacts.api.batch_api import BatchApi -from hubspot.crm.contacts.api.gdpr_api import GDPRApi -from hubspot.crm.contacts.api.merge_api import MergeApi from hubspot.crm.contacts.api.search_api import SearchApi diff --git a/hubspot/crm/contacts/api/basic_api.py b/hubspot/crm/contacts/api/basic_api.py index 8513c7e6..4e9a7e7f 100644 --- a/hubspot/crm/contacts/api/basic_api.py +++ b/hubspot/crm/contacts/api/basic_api.py @@ -34,16 +34,16 @@ def __init__(self, api_client=None): self.api_client = api_client def archive(self, contact_id, **kwargs): # noqa: E501 - """Archive # noqa: E501 + """Archive a contact # noqa: E501 - Move an Object identified by `{contactId}` to the recycling bin. # noqa: E501 + Delete a contact by ID. Deleted contacts can be restored within 90 days of deletion. Learn more about the [data impacted by contact deletions](https://knowledge.hubspot.com/privacy-and-consent/understand-restorable-and-permanent-contact-deletions) and how to [restore archived records](https://knowledge.hubspot.com/records/restore-deleted-records). # 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(contact_id, async_req=True) >>> result = thread.get() - :param contact_id: (required) + :param contact_id: The ID of the contact to delete. (required) :type contact_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -64,16 +64,16 @@ def archive(self, contact_id, **kwargs): # noqa: E501 return self.archive_with_http_info(contact_id, **kwargs) # noqa: E501 def archive_with_http_info(self, contact_id, **kwargs): # noqa: E501 - """Archive # noqa: E501 + """Archive a contact # noqa: E501 - Move an Object identified by `{contactId}` to the recycling bin. # noqa: E501 + Delete a contact by ID. Deleted contacts can be restored within 90 days of deletion. Learn more about the [data impacted by contact deletions](https://knowledge.hubspot.com/privacy-and-consent/understand-restorable-and-permanent-contact-deletions) and how to [restore archived records](https://knowledge.hubspot.com/records/restore-deleted-records). # 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(contact_id, async_req=True) >>> result = thread.get() - :param contact_id: (required) + :param contact_id: The ID of the contact to delete. (required) :type contact_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -155,9 +155,9 @@ def archive_with_http_info(self, contact_id, **kwargs): # noqa: E501 ) def create(self, simple_public_object_input_for_create, **kwargs): # noqa: E501 - """Create # noqa: E501 + """Create a contact # noqa: E501 - Create a contact with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard contacts is provided. # noqa: E501 + Create a single contact. Include a `properties` object to define [property values](https://developers.hubspot.com/docs/guides/api/crm/properties) for the contact, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -185,9 +185,9 @@ def create(self, simple_public_object_input_for_create, **kwargs): # noqa: E501 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 contact # noqa: E501 - Create a contact with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard contacts is provided. # noqa: E501 + Create a single contact. Include a `properties` object to define [property values](https://developers.hubspot.com/docs/guides/api/crm/properties) for the contact, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -283,16 +283,16 @@ def create_with_http_info(self, simple_public_object_input_for_create, **kwargs) ) def get_by_id(self, contact_id, **kwargs): # noqa: E501 - """Read # noqa: E501 + """Retrieve a contact # noqa: E501 - Read an Object identified by `{contactId}`. `{contactId}` refers to the internal object ID. Control what is returned via the `properties` query param. # noqa: E501 + Retrieve a contact by its ID (`contactId`) or by a unique property (`idProperty`). You can specify what is returned using the `properties` query parameter. # 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(contact_id, async_req=True) >>> result = thread.get() - :param contact_id: (required) + :param contact_id: The ID of the contact to retrieve. (required) :type contact_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] @@ -323,16 +323,16 @@ def get_by_id(self, contact_id, **kwargs): # noqa: E501 return self.get_by_id_with_http_info(contact_id, **kwargs) # noqa: E501 def get_by_id_with_http_info(self, contact_id, **kwargs): # noqa: E501 - """Read # noqa: E501 + """Retrieve a contact # noqa: E501 - Read an Object identified by `{contactId}`. `{contactId}` refers to the internal object ID. Control what is returned via the `properties` query param. # noqa: E501 + Retrieve a contact by its ID (`contactId`) or by a unique property (`idProperty`). You can specify what is returned using the `properties` query parameter. # 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(contact_id, async_req=True) >>> result = thread.get() - :param contact_id: (required) + :param contact_id: The ID of the contact to retrieve. (required) :type contact_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] @@ -439,9 +439,9 @@ def get_by_id_with_http_info(self, contact_id, **kwargs): # noqa: E501 ) def get_page(self, **kwargs): # noqa: E501 - """List # noqa: E501 + """Retrieve contacts # noqa: E501 - Read a page of contacts. Control what is returned via the `properties` query param. # noqa: E501 + Retrieve all contacts, using query parameters to specify the information that gets returned. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -479,9 +479,9 @@ def get_page(self, **kwargs): # noqa: E501 return self.get_page_with_http_info(**kwargs) # noqa: E501 def get_page_with_http_info(self, **kwargs): # noqa: E501 - """List # noqa: E501 + """Retrieve contacts # noqa: E501 - Read a page of contacts. Control what is returned via the `properties` query param. # noqa: E501 + Retrieve all contacts, using query parameters to specify the information that gets returned. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -591,17 +591,271 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501 _request_auth=local_var_params.get("_request_auth"), ) + def merge(self, public_merge_input, **kwargs): # noqa: E501 + """Merge two contacts # noqa: E501 + + Merge two contact records. Learn more about [merging records](https://knowledge.hubspot.com/records/merge-records). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.merge(public_merge_input, async_req=True) + >>> result = thread.get() + + :param public_merge_input: (required) + :type public_merge_input: PublicMergeInput + :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.merge_with_http_info(public_merge_input, **kwargs) # noqa: E501 + + def merge_with_http_info(self, public_merge_input, **kwargs): # noqa: E501 + """Merge two contacts # noqa: E501 + + Merge two contact records. Learn more about [merging records](https://knowledge.hubspot.com/records/merge-records). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.merge_with_http_info(public_merge_input, async_req=True) + >>> result = thread.get() + + :param public_merge_input: (required) + :type public_merge_input: PublicMergeInput + :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 = ["public_merge_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 merge" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'public_merge_input' is set + if self.api_client.client_side_validation and local_var_params.get("public_merge_input") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `public_merge_input` when calling `merge`") # 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_merge_input" in local_var_params: + body_params = local_var_params["public_merge_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: "SimplePublicObject", + } + + return self.api_client.call_api( + "/crm/v3/objects/contacts/merge", + "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 purge(self, public_gdpr_delete_input, **kwargs): # noqa: E501 + """Permanently delete a contact (GDPR-compliant) # noqa: E501 + + Permanently delete a contact and all associated content to follow GDPR. Use optional property `idProperty` set to `email` to identify contact by email address. If email address is not found, the email address will be added to a blocklist and prevent it from being used in the future. Learn more about [permanently deleting contacts](https://knowledge.hubspot.com/privacy-and-consent/how-do-i-perform-a-gdpr-delete-in-hubspot). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.purge(public_gdpr_delete_input, async_req=True) + >>> result = thread.get() + + :param public_gdpr_delete_input: (required) + :type public_gdpr_delete_input: PublicGdprDeleteInput + :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.purge_with_http_info(public_gdpr_delete_input, **kwargs) # noqa: E501 + + def purge_with_http_info(self, public_gdpr_delete_input, **kwargs): # noqa: E501 + """Permanently delete a contact (GDPR-compliant) # noqa: E501 + + Permanently delete a contact and all associated content to follow GDPR. Use optional property `idProperty` set to `email` to identify contact by email address. If email address is not found, the email address will be added to a blocklist and prevent it from being used in the future. Learn more about [permanently deleting contacts](https://knowledge.hubspot.com/privacy-and-consent/how-do-i-perform-a-gdpr-delete-in-hubspot). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.purge_with_http_info(public_gdpr_delete_input, async_req=True) + >>> result = thread.get() + + :param public_gdpr_delete_input: (required) + :type public_gdpr_delete_input: PublicGdprDeleteInput + :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 = ["public_gdpr_delete_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 purge" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'public_gdpr_delete_input' is set + if self.api_client.client_side_validation and local_var_params.get("public_gdpr_delete_input") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `public_gdpr_delete_input` when calling `purge`") # 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_gdpr_delete_input" in local_var_params: + body_params = local_var_params["public_gdpr_delete_input"] + # 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/contacts/gdpr-delete", + "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, contact_id, simple_public_object_input, **kwargs): # noqa: E501 - """Update # noqa: E501 + """Update a contact # noqa: E501 - Perform a partial update of an Object identified by `{contactId}`. `{contactId}` refers to the internal object ID. Provided property values will be overwritten. Read-only and non-existent properties result in an error. Properties values can be cleared by passing an empty string. # noqa: E501 + Update a contact by ID (`contactId`) or unique property value (`idProperty`). 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(contact_id, simple_public_object_input, async_req=True) >>> result = thread.get() - :param contact_id: (required) + :param contact_id: The ID of the contact to update. (required) :type contact_id: str :param simple_public_object_input: (required) :type simple_public_object_input: SimplePublicObjectInput @@ -626,16 +880,16 @@ def update(self, contact_id, simple_public_object_input, **kwargs): # noqa: E50 return self.update_with_http_info(contact_id, simple_public_object_input, **kwargs) # noqa: E501 def update_with_http_info(self, contact_id, simple_public_object_input, **kwargs): # noqa: E501 - """Update # noqa: E501 + """Update a contact # noqa: E501 - Perform a partial update of an Object identified by `{contactId}`. `{contactId}` refers to the internal object ID. Provided property values will be overwritten. Read-only and non-existent properties result in an error. Properties values can be cleared by passing an empty string. # noqa: E501 + Update a contact by ID (`contactId`) or unique property value (`idProperty`). 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(contact_id, simple_public_object_input, async_req=True) >>> result = thread.get() - :param contact_id: (required) + :param contact_id: The ID of the contact to update. (required) :type contact_id: str :param simple_public_object_input: (required) :type simple_public_object_input: SimplePublicObjectInput diff --git a/hubspot/crm/contacts/api/batch_api.py b/hubspot/crm/contacts/api/batch_api.py index 03178ada..cc382830 100644 --- a/hubspot/crm/contacts/api/batch_api.py +++ b/hubspot/crm/contacts/api/batch_api.py @@ -34,8 +34,9 @@ def __init__(self, api_client=None): self.api_client = api_client def archive(self, batch_input_simple_public_object_id, **kwargs): # noqa: E501 - """Archive a batch of contacts by ID # noqa: E501 + """Archive a batch of contacts # noqa: E501 + Archive a batch of contacts by ID. Archived contacts can be restored within 90 days of deletion. Learn more about the [data impacted by contact deletions](https://knowledge.hubspot.com/privacy-and-consent/understand-restorable-and-permanent-contact-deletions) and how to [restore archived records](https://knowledge.hubspot.com/records/restore-deleted-records). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -63,8 +64,9 @@ def archive(self, batch_input_simple_public_object_id, **kwargs): # noqa: E501 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 contacts by ID # noqa: E501 + """Archive a batch of contacts # noqa: E501 + Archive a batch of contacts by ID. Archived contacts can be restored within 90 days of deletion. Learn more about the [data impacted by contact deletions](https://knowledge.hubspot.com/privacy-and-consent/understand-restorable-and-permanent-contact-deletions) and how to [restore archived records](https://knowledge.hubspot.com/records/restore-deleted-records). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -157,17 +159,18 @@ def archive_with_http_info(self, batch_input_simple_public_object_id, **kwargs): _request_auth=local_var_params.get("_request_auth"), ) - def create(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of contacts # noqa: E501 + Create a batch of contacts. The `inputs` array can contain a `properties` object to define property values for each record, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records. # 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) + >>> thread = api.create(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -184,19 +187,20 @@ def create(self, batch_input_simple_public_object_input_for_create, **kwargs): :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 + return self.create_with_http_info(batch_input_simple_public_object_batch_input_for_create, **kwargs) # noqa: E501 - def create_with_http_info(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create_with_http_info(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of contacts # noqa: E501 + Create a batch of contacts. The `inputs` array can contain a `properties` object to define property values for each record, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records. # 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) + >>> thread = api.create_with_http_info(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :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 @@ -223,7 +227,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat local_var_params = locals() - all_params = ["batch_input_simple_public_object_input_for_create"] + all_params = ["batch_input_simple_public_object_batch_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"]): @@ -231,9 +235,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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 + # verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_for_create` when calling `create`") # noqa: E501 collection_formats = {} @@ -247,8 +251,8 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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"] + if "batch_input_simple_public_object_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_for_create"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -285,8 +289,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat ) def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 - """Read a batch of contacts by internal ID, or unique property values # noqa: E501 + """Retrieve a batch of contacts # noqa: E501 + Retrieve a batch of contacts by ID (`contactId`) or unique property value (`idProperty`). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -316,8 +321,9 @@ def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E50 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 contacts by internal ID, or unique property values # noqa: E501 + """Retrieve a batch of contacts # noqa: E501 + Retrieve a batch of contacts by ID (`contactId`) or unique property value (`idProperty`). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -418,8 +424,9 @@ def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs ) def update(self, batch_input_simple_public_object_batch_input, **kwargs): # noqa: E501 - """Update a batch of contacts by internal ID, or unique property values # noqa: E501 + """Update a batch of contacts # noqa: E501 + Update a batch of contacts by ID (`contactId`) or unique property value (`idProperty`). 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 @@ -447,8 +454,9 @@ def update(self, batch_input_simple_public_object_batch_input, **kwargs): # noq 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 contacts by internal ID, or unique property values # noqa: E501 + """Update a batch of contacts # noqa: E501 + Update a batch of contacts by ID (`contactId`) or unique property value (`idProperty`). 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 @@ -545,9 +553,9 @@ def update_with_http_info(self, batch_input_simple_public_object_batch_input, ** ) def upsert(self, batch_input_simple_public_object_batch_input_upsert, **kwargs): # noqa: E501 - """Create or update a batch of contacts by unique property values # noqa: E501 + """Create or update a batch of contacts # noqa: E501 - Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object. # noqa: E501 + Upsert a batch of contacts. The `inputs` array can contain a `properties` object to define property values for each record. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -575,9 +583,9 @@ def upsert(self, batch_input_simple_public_object_batch_input_upsert, **kwargs): 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 contacts by unique property values # noqa: E501 + """Create or update a batch of contacts # noqa: E501 - Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object. # noqa: E501 + Upsert a batch of contacts. The `inputs` array can contain a `properties` object to define property values for each record. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/contacts/api/gdpr_api.py b/hubspot/crm/contacts/api/gdpr_api.py deleted file mode 100644 index 9f54f2c6..00000000 --- a/hubspot/crm/contacts/api/gdpr_api.py +++ /dev/null @@ -1,160 +0,0 @@ -# coding: utf-8 - -""" - Contacts - - 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.contacts.api_client import ApiClient -from hubspot.crm.contacts.exceptions import ApiTypeError, ApiValueError # noqa: F401 - - -class GDPRApi(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 purge(self, public_gdpr_delete_input, **kwargs): # noqa: E501 - """GDPR DELETE # noqa: E501 - - Permanently delete a contact and all associated content to follow GDPR. Use optional property 'idProperty' set to 'email' to identify contact by email address. If email address is not found, the email address will be added to a blocklist and prevent it from being used in the future. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.purge(public_gdpr_delete_input, async_req=True) - >>> result = thread.get() - - :param public_gdpr_delete_input: (required) - :type public_gdpr_delete_input: PublicGdprDeleteInput - :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.purge_with_http_info(public_gdpr_delete_input, **kwargs) # noqa: E501 - - def purge_with_http_info(self, public_gdpr_delete_input, **kwargs): # noqa: E501 - """GDPR DELETE # noqa: E501 - - Permanently delete a contact and all associated content to follow GDPR. Use optional property 'idProperty' set to 'email' to identify contact by email address. If email address is not found, the email address will be added to a blocklist and prevent it from being used in the future. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.purge_with_http_info(public_gdpr_delete_input, async_req=True) - >>> result = thread.get() - - :param public_gdpr_delete_input: (required) - :type public_gdpr_delete_input: PublicGdprDeleteInput - :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 = ["public_gdpr_delete_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 purge" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'public_gdpr_delete_input' is set - if self.api_client.client_side_validation and local_var_params.get("public_gdpr_delete_input") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `public_gdpr_delete_input` when calling `purge`") # 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_gdpr_delete_input" in local_var_params: - body_params = local_var_params["public_gdpr_delete_input"] - # 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/contacts/gdpr-delete", - "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/contacts/api/merge_api.py b/hubspot/crm/contacts/api/merge_api.py deleted file mode 100644 index 3c4bb370..00000000 --- a/hubspot/crm/contacts/api/merge_api.py +++ /dev/null @@ -1,160 +0,0 @@ -# coding: utf-8 - -""" - Contacts - - 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.contacts.api_client import ApiClient -from hubspot.crm.contacts.exceptions import ApiTypeError, ApiValueError # noqa: F401 - - -class MergeApi(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 merge(self, public_merge_input, **kwargs): # noqa: E501 - """Merge two contacts with same type # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.merge(public_merge_input, async_req=True) - >>> result = thread.get() - - :param public_merge_input: (required) - :type public_merge_input: PublicMergeInput - :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.merge_with_http_info(public_merge_input, **kwargs) # noqa: E501 - - def merge_with_http_info(self, public_merge_input, **kwargs): # noqa: E501 - """Merge two contacts with same type # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.merge_with_http_info(public_merge_input, async_req=True) - >>> result = thread.get() - - :param public_merge_input: (required) - :type public_merge_input: PublicMergeInput - :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 = ["public_merge_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 merge" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'public_merge_input' is set - if self.api_client.client_side_validation and local_var_params.get("public_merge_input") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `public_merge_input` when calling `merge`") # 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_merge_input" in local_var_params: - body_params = local_var_params["public_merge_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: "SimplePublicObject", - } - - return self.api_client.call_api( - "/crm/v3/objects/contacts/merge", - "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/contacts/api/search_api.py b/hubspot/crm/contacts/api/search_api.py index 8be30f6d..da1a6c7c 100644 --- a/hubspot/crm/contacts/api/search_api.py +++ b/hubspot/crm/contacts/api/search_api.py @@ -34,8 +34,9 @@ def __init__(self, api_client=None): self.api_client = api_client def do_search(self, public_object_search_request, **kwargs): # noqa: E501 - """do_search # noqa: E501 + """Search for contacts # noqa: E501 + Search for contacts by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -63,8 +64,9 @@ def do_search(self, public_object_search_request, **kwargs): # noqa: E501 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 + """Search for contacts # noqa: E501 + Search for contacts by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/contacts/models/__init__.py b/hubspot/crm/contacts/models/__init__.py index 4c57204d..4719bc99 100644 --- a/hubspot/crm/contacts/models/__init__.py +++ b/hubspot/crm/contacts/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.contacts.models.associated_id import AssociatedId from hubspot.crm.contacts.models.association_spec import AssociationSpec from hubspot.crm.contacts.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.contacts.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.contacts.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.contacts.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.contacts.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.contacts.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.contacts.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.contacts.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -43,6 +43,7 @@ from hubspot.crm.contacts.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.contacts.models.simple_public_object import SimplePublicObject from hubspot.crm.contacts.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.contacts.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.contacts.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.contacts.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.contacts.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/contacts/models/association_spec.py b/hubspot/crm/contacts/models/association_spec.py index 7a6ea4ab..5f9d10bf 100644 --- a/hubspot/crm/contacts/models/association_spec.py +++ b/hubspot/crm/contacts/models/association_spec.py @@ -49,10 +49,8 @@ def __init__(self, association_category=None, association_type_id=None, local_va self._association_type_id = None self.discriminator = None - if association_category is not None: - self.association_category = association_category - if association_type_id is not None: - self.association_type_id = association_type_id + self.association_category = association_category + self.association_type_id = association_type_id @property def association_category(self): @@ -72,6 +70,8 @@ def association_category(self, association_category): :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 @@ -96,6 +96,8 @@ def association_type_id(self, association_type_id): :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 diff --git a/hubspot/crm/contacts/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/contacts/models/batch_input_simple_public_object_batch_input_for_create.py similarity index 80% rename from hubspot/crm/contacts/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/contacts/models/batch_input_simple_public_object_batch_input_for_create.py index ae3399bd..b759ad2d 100644 --- a/hubspot/crm/contacts/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/contacts/models/batch_input_simple_public_object_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.contacts.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectBatchInputForCreate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class BatchInputSimplePublicObjectInputForCreate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"inputs": "list[SimplePublicObjectInputForCreate]"} + openapi_types = {"inputs": "list[SimplePublicObjectBatchInputForCreate]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 @@ -52,21 +52,21 @@ def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 @property def inputs(self): - """Gets the inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + """Gets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] """ return self._inputs @inputs.setter def inputs(self, inputs): - """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/contacts/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/contacts/models/batch_read_input_simple_public_object_id.py index f0a21803..8eb73222 100644 --- a/hubspot/crm/contacts/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/contacts/models/batch_read_input_simple_public_object_id.py @@ -84,6 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -94,6 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/contacts/models/public_associations_for_object.py b/hubspot/crm/contacts/models/public_associations_for_object.py index 45326bae..215e3f74 100644 --- a/hubspot/crm/contacts/models/public_associations_for_object.py +++ b/hubspot/crm/contacts/models/public_associations_for_object.py @@ -49,10 +49,8 @@ def __init__(self, types=None, to=None, local_vars_configuration=None): # noqa: self._to = None self.discriminator = None - if types is not None: - self.types = types - if to is not None: - self.to = to + self.types = types + self.to = to @property def types(self): @@ -72,6 +70,8 @@ def types(self, types): :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 @@ -93,6 +93,8 @@ def to(self, to): :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 diff --git a/hubspot/crm/contacts/models/public_gdpr_delete_input.py b/hubspot/crm/contacts/models/public_gdpr_delete_input.py index 7787bbdf..4a881f03 100644 --- a/hubspot/crm/contacts/models/public_gdpr_delete_input.py +++ b/hubspot/crm/contacts/models/public_gdpr_delete_input.py @@ -57,6 +57,7 @@ def __init__(self, id_property=None, object_id=None, local_vars_configuration=No def id_property(self): """Gets the id_property of this PublicGdprDeleteInput. # noqa: E501 + The name of a property whose values are unique for this object. An alternative to identifying a contact by ID. # noqa: E501 :return: The id_property of this PublicGdprDeleteInput. # noqa: E501 :rtype: str @@ -67,6 +68,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this PublicGdprDeleteInput. + The name of a property whose values are unique for this object. An alternative to identifying a contact by ID. # noqa: E501 :param id_property: The id_property of this PublicGdprDeleteInput. # noqa: E501 :type id_property: str @@ -78,6 +80,7 @@ def id_property(self, id_property): def object_id(self): """Gets the object_id of this PublicGdprDeleteInput. # noqa: E501 + The ID of the contact to permanently delete. # noqa: E501 :return: The object_id of this PublicGdprDeleteInput. # noqa: E501 :rtype: str @@ -88,6 +91,7 @@ def object_id(self): def object_id(self, object_id): """Sets the object_id of this PublicGdprDeleteInput. + The ID of the contact to permanently delete. # noqa: E501 :param object_id: The object_id of this PublicGdprDeleteInput. # noqa: E501 :type object_id: str diff --git a/hubspot/crm/contacts/models/public_object_id.py b/hubspot/crm/contacts/models/public_object_id.py index 596430e2..16235f66 100644 --- a/hubspot/crm/contacts/models/public_object_id.py +++ b/hubspot/crm/contacts/models/public_object_id.py @@ -48,8 +48,7 @@ def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 self._id = None self.discriminator = None - if id is not None: - self.id = id + self.id = id @property def id(self): @@ -69,6 +68,8 @@ def id(self, id): :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 diff --git a/hubspot/crm/contacts/models/simple_public_object.py b/hubspot/crm/contacts/models/simple_public_object.py index fee4c7dc..82158997 100644 --- a/hubspot/crm/contacts/models/simple_public_object.py +++ b/hubspot/crm/contacts/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 diff --git a/hubspot/crm/contacts/models/simple_public_object_batch_input.py b/hubspot/crm/contacts/models/simple_public_object_batch_input.py index c048fc00..104ffca8 100644 --- a/hubspot/crm/contacts/models/simple_public_object_batch_input.py +++ b/hubspot/crm/contacts/models/simple_public_object_batch_input.py @@ -62,6 +62,7 @@ def __init__(self, id_property=None, object_write_trace_id=None, id=None, proper def id_property(self): """Gets the id_property of this SimplePublicObjectBatchInput. # noqa: E501 + The name of a unique property, when identifying records by property. # noqa: E501 :return: The id_property of this SimplePublicObjectBatchInput. # noqa: E501 :rtype: str @@ -72,6 +73,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this SimplePublicObjectBatchInput. + The name of a unique property, when identifying records by property. # noqa: E501 :param id_property: The id_property of this SimplePublicObjectBatchInput. # noqa: E501 :type id_property: str @@ -104,6 +106,7 @@ def object_write_trace_id(self, object_write_trace_id): def id(self): """Gets the id of this SimplePublicObjectBatchInput. # noqa: E501 + The ID of the contact to update. This can be the object ID, or the unique property value of the `idProperty` property. # noqa: E501 :return: The id of this SimplePublicObjectBatchInput. # noqa: E501 :rtype: str @@ -114,6 +117,7 @@ def id(self): def id(self, id): """Sets the id of this SimplePublicObjectBatchInput. + The ID of the contact to update. This can be the object ID, or the unique property value of the `idProperty` property. # noqa: E501 :param id: The id of this SimplePublicObjectBatchInput. # noqa: E501 :type id: str diff --git a/hubspot/crm/contacts/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/contacts/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..69293b35 --- /dev/null +++ b/hubspot/crm/contacts/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Contacts + + 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.contacts.configuration import Configuration + + +class SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/contacts/models/simple_public_object_batch_input_upsert.py b/hubspot/crm/contacts/models/simple_public_object_batch_input_upsert.py index ab5ef792..802adc7a 100644 --- a/hubspot/crm/contacts/models/simple_public_object_batch_input_upsert.py +++ b/hubspot/crm/contacts/models/simple_public_object_batch_input_upsert.py @@ -62,6 +62,7 @@ def __init__(self, id_property=None, object_write_trace_id=None, id=None, proper def id_property(self): """Gets the id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + The name of a property whose values are unique for this object # noqa: E501 :return: The id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :rtype: str @@ -72,6 +73,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this SimplePublicObjectBatchInputUpsert. + The name of a property whose values are unique for this object # noqa: E501 :param id_property: The id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/contacts/models/simple_public_object_input.py b/hubspot/crm/contacts/models/simple_public_object_input.py index 40f9a469..86b72138 100644 --- a/hubspot/crm/contacts/models/simple_public_object_input.py +++ b/hubspot/crm/contacts/models/simple_public_object_input.py @@ -35,45 +35,21 @@ class SimplePublicObjectInput(object): 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]"} + openapi_types = {"properties": "dict[str, str]"} - attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"properties": "properties"} - def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, 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 diff --git a/hubspot/crm/contacts/models/simple_public_object_input_for_create.py b/hubspot/crm/contacts/models/simple_public_object_input_for_create.py index fd365ec4..ace1dcb1 100644 --- a/hubspot/crm/contacts/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/contacts/models/simple_public_object_input_for_create.py @@ -35,25 +35,22 @@ class SimplePublicObjectInputForCreate(object): 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]"} + openapi_types = {"associations": "list[PublicAssociationsForObject]", "properties": "dict[str, str]"} - attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"associations": "associations", "properties": "properties"} - def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, associations=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 if associations is not 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 @@ -77,27 +74,6 @@ def associations(self, associations): 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 diff --git a/hubspot/crm/contacts/models/simple_public_object_with_associations.py b/hubspot/crm/contacts/models/simple_public_object_with_associations.py index b8b20681..cfea103b 100644 --- a/hubspot/crm/contacts/models/simple_public_object_with_associations.py +++ b/hubspot/crm/contacts/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -136,6 +151,7 @@ def created_at(self, created_at): def archived(self): """Gets the archived of this SimplePublicObjectWithAssociations. # noqa: E501 + # noqa: E501 :return: The archived of this SimplePublicObjectWithAssociations. # noqa: E501 :rtype: bool @@ -146,6 +162,7 @@ def archived(self): def archived(self, archived): """Sets the archived of this SimplePublicObjectWithAssociations. + # noqa: E501 :param archived: The archived of this SimplePublicObjectWithAssociations. # noqa: E501 :type archived: bool @@ -157,6 +174,7 @@ def archived(self, archived): def archived_at(self): """Gets the archived_at of this SimplePublicObjectWithAssociations. # noqa: E501 + # noqa: E501 :return: The archived_at of this SimplePublicObjectWithAssociations. # noqa: E501 :rtype: datetime @@ -167,6 +185,7 @@ def archived_at(self): def archived_at(self, archived_at): """Sets the archived_at of this SimplePublicObjectWithAssociations. + # noqa: E501 :param archived_at: The archived_at of this SimplePublicObjectWithAssociations. # noqa: E501 :type archived_at: datetime @@ -218,10 +237,32 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 + # noqa: E501 :return: The properties of this SimplePublicObjectWithAssociations. # noqa: E501 :rtype: dict[str, str] @@ -232,6 +273,7 @@ def properties(self): def properties(self, properties): """Sets the properties of this SimplePublicObjectWithAssociations. + # noqa: E501 :param properties: The properties of this SimplePublicObjectWithAssociations. # noqa: E501 :type properties: dict[str, str] diff --git a/hubspot/crm/contacts/models/simple_public_upsert_object.py b/hubspot/crm/contacts/models/simple_public_upsert_object.py index 947fcf47..aa7e5ee5 100644 --- a/hubspot/crm/contacts/models/simple_public_upsert_object.py +++ b/hubspot/crm/contacts/models/simple_public_upsert_object.py @@ -42,6 +42,7 @@ class SimplePublicUpsertObject(object): "new": "bool", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicUpsertObject(object): "new": "new", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._new = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -84,6 +97,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -219,6 +234,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. # noqa: E501 From 1cdaf85b71f1c280bf6600130e2138913ef819f4 Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 14 Apr 2025 11:16:41 +0300 Subject: [PATCH 30/49] Codegen Crm Objects Deals --- hubspot/crm/deals/__init__.py | 4 +- hubspot/crm/deals/api/__init__.py | 1 - hubspot/crm/deals/api/basic_api.py | 126 +++++++++++++ hubspot/crm/deals/api/batch_api.py | 32 ++-- hubspot/crm/deals/api/merge_api.py | 160 ----------------- hubspot/crm/deals/models/__init__.py | 3 +- hubspot/crm/deals/models/association_spec.py | 10 +- ...e_public_object_batch_input_for_create.py} | 22 +-- ...atch_read_input_simple_public_object_id.py | 2 + .../models/public_associations_for_object.py | 10 +- hubspot/crm/deals/models/public_object_id.py | 5 +- .../crm/deals/models/simple_public_object.py | 30 +++- .../simple_public_object_batch_input.py | 4 + ...le_public_object_batch_input_for_create.py | 170 ++++++++++++++++++ ...simple_public_object_batch_input_upsert.py | 2 + .../models/simple_public_object_input.py | 30 +--- .../simple_public_object_input_for_create.py | 30 +--- .../simple_public_object_with_associations.py | 38 +++- .../models/simple_public_upsert_object.py | 38 +++- 19 files changed, 460 insertions(+), 257 deletions(-) delete mode 100644 hubspot/crm/deals/api/merge_api.py rename hubspot/crm/deals/models/{batch_input_simple_public_object_input_for_create.py => batch_input_simple_public_object_batch_input_for_create.py} (80%) create mode 100644 hubspot/crm/deals/models/simple_public_object_batch_input_for_create.py diff --git a/hubspot/crm/deals/__init__.py b/hubspot/crm/deals/__init__.py index 6320104d..09daafcf 100644 --- a/hubspot/crm/deals/__init__.py +++ b/hubspot/crm/deals/__init__.py @@ -19,7 +19,6 @@ # import apis into sdk package from hubspot.crm.deals.api.basic_api import BasicApi from hubspot.crm.deals.api.batch_api import BatchApi -from hubspot.crm.deals.api.merge_api import MergeApi from hubspot.crm.deals.api.search_api import SearchApi # import ApiClient @@ -36,9 +35,9 @@ from hubspot.crm.deals.models.associated_id import AssociatedId from hubspot.crm.deals.models.association_spec import AssociationSpec from hubspot.crm.deals.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.deals.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.deals.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.deals.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.deals.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.deals.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.deals.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.deals.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -61,6 +60,7 @@ from hubspot.crm.deals.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.deals.models.simple_public_object import SimplePublicObject from hubspot.crm.deals.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.deals.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.deals.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.deals.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.deals.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/deals/api/__init__.py b/hubspot/crm/deals/api/__init__.py index 363c9422..c714cad4 100644 --- a/hubspot/crm/deals/api/__init__.py +++ b/hubspot/crm/deals/api/__init__.py @@ -5,5 +5,4 @@ # import apis into api package from hubspot.crm.deals.api.basic_api import BasicApi from hubspot.crm.deals.api.batch_api import BatchApi -from hubspot.crm.deals.api.merge_api import MergeApi from hubspot.crm.deals.api.search_api import SearchApi diff --git a/hubspot/crm/deals/api/basic_api.py b/hubspot/crm/deals/api/basic_api.py index 8fca4ae1..3830e0a3 100644 --- a/hubspot/crm/deals/api/basic_api.py +++ b/hubspot/crm/deals/api/basic_api.py @@ -591,6 +591,132 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501 _request_auth=local_var_params.get("_request_auth"), ) + def merge(self, public_merge_input, **kwargs): # noqa: E501 + """Merge two deals with same type # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.merge(public_merge_input, async_req=True) + >>> result = thread.get() + + :param public_merge_input: (required) + :type public_merge_input: PublicMergeInput + :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.merge_with_http_info(public_merge_input, **kwargs) # noqa: E501 + + def merge_with_http_info(self, public_merge_input, **kwargs): # noqa: E501 + """Merge two deals with same type # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.merge_with_http_info(public_merge_input, async_req=True) + >>> result = thread.get() + + :param public_merge_input: (required) + :type public_merge_input: PublicMergeInput + :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 = ["public_merge_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 merge" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'public_merge_input' is set + if self.api_client.client_side_validation and local_var_params.get("public_merge_input") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `public_merge_input` when calling `merge`") # 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_merge_input" in local_var_params: + body_params = local_var_params["public_merge_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: "SimplePublicObject", + } + + return self.api_client.call_api( + "/crm/v3/objects/deals/merge", + "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, deal_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 diff --git a/hubspot/crm/deals/api/batch_api.py b/hubspot/crm/deals/api/batch_api.py index c974496e..88f8d840 100644 --- a/hubspot/crm/deals/api/batch_api.py +++ b/hubspot/crm/deals/api/batch_api.py @@ -157,17 +157,17 @@ def archive_with_http_info(self, batch_input_simple_public_object_id, **kwargs): _request_auth=local_var_params.get("_request_auth"), ) - def create(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of deals # 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) + >>> thread = api.create(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -184,19 +184,19 @@ def create(self, batch_input_simple_public_object_input_for_create, **kwargs): :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 + return self.create_with_http_info(batch_input_simple_public_object_batch_input_for_create, **kwargs) # noqa: E501 - def create_with_http_info(self, batch_input_simple_public_object_input_for_create, **kwargs): # noqa: E501 + def create_with_http_info(self, batch_input_simple_public_object_batch_input_for_create, **kwargs): # noqa: E501 """Create a batch of deals # 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) + >>> thread = api.create_with_http_info(batch_input_simple_public_object_batch_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 batch_input_simple_public_object_batch_input_for_create: (required) + :type batch_input_simple_public_object_batch_input_for_create: BatchInputSimplePublicObjectBatchInputForCreate :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 @@ -223,7 +223,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat local_var_params = locals() - all_params = ["batch_input_simple_public_object_input_for_create"] + all_params = ["batch_input_simple_public_object_batch_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"]): @@ -231,9 +231,9 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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 + # verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set + if self.api_client.client_side_validation and local_var_params.get("batch_input_simple_public_object_batch_input_for_create") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_input_simple_public_object_batch_input_for_create` when calling `create`") # noqa: E501 collection_formats = {} @@ -247,8 +247,8 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat 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"] + if "batch_input_simple_public_object_batch_input_for_create" in local_var_params: + body_params = local_var_params["batch_input_simple_public_object_batch_input_for_create"] # HTTP header `Accept` header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 @@ -287,6 +287,7 @@ def create_with_http_info(self, batch_input_simple_public_object_input_for_creat def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of deals by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -318,6 +319,7 @@ def read(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E50 def read_with_http_info(self, batch_read_input_simple_public_object_id, **kwargs): # noqa: E501 """Read a batch of deals by internal ID, or unique property values # noqa: E501 + Retrieve records by record ID or include the `idProperty` parameter to retrieve records by a custom unique value property. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/hubspot/crm/deals/api/merge_api.py b/hubspot/crm/deals/api/merge_api.py deleted file mode 100644 index 25dc662c..00000000 --- a/hubspot/crm/deals/api/merge_api.py +++ /dev/null @@ -1,160 +0,0 @@ -# coding: utf-8 - -""" - Deals - - 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.deals.api_client import ApiClient -from hubspot.crm.deals.exceptions import ApiTypeError, ApiValueError # noqa: F401 - - -class MergeApi(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 merge(self, public_merge_input, **kwargs): # noqa: E501 - """Merge two deals # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.merge(public_merge_input, async_req=True) - >>> result = thread.get() - - :param public_merge_input: (required) - :type public_merge_input: PublicMergeInput - :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.merge_with_http_info(public_merge_input, **kwargs) # noqa: E501 - - def merge_with_http_info(self, public_merge_input, **kwargs): # noqa: E501 - """Merge two deals # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.merge_with_http_info(public_merge_input, async_req=True) - >>> result = thread.get() - - :param public_merge_input: (required) - :type public_merge_input: PublicMergeInput - :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 = ["public_merge_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 merge" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'public_merge_input' is set - if self.api_client.client_side_validation and local_var_params.get("public_merge_input") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `public_merge_input` when calling `merge`") # 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_merge_input" in local_var_params: - body_params = local_var_params["public_merge_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: "SimplePublicObject", - } - - return self.api_client.call_api( - "/crm/v3/objects/deals/merge", - "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/deals/models/__init__.py b/hubspot/crm/deals/models/__init__.py index 00fc7dfe..db6200eb 100644 --- a/hubspot/crm/deals/models/__init__.py +++ b/hubspot/crm/deals/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.deals.models.associated_id import AssociatedId from hubspot.crm.deals.models.association_spec import AssociationSpec from hubspot.crm.deals.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.deals.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.deals.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.deals.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.deals.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.deals.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.deals.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.deals.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -42,6 +42,7 @@ from hubspot.crm.deals.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.deals.models.simple_public_object import SimplePublicObject from hubspot.crm.deals.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.deals.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.deals.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.deals.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.deals.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/deals/models/association_spec.py b/hubspot/crm/deals/models/association_spec.py index a21857fd..89d6be58 100644 --- a/hubspot/crm/deals/models/association_spec.py +++ b/hubspot/crm/deals/models/association_spec.py @@ -49,10 +49,8 @@ def __init__(self, association_category=None, association_type_id=None, local_va self._association_type_id = None self.discriminator = None - if association_category is not None: - self.association_category = association_category - if association_type_id is not None: - self.association_type_id = association_type_id + self.association_category = association_category + self.association_type_id = association_type_id @property def association_category(self): @@ -72,6 +70,8 @@ def association_category(self, association_category): :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 @@ -96,6 +96,8 @@ def association_type_id(self, association_type_id): :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 diff --git a/hubspot/crm/deals/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/deals/models/batch_input_simple_public_object_batch_input_for_create.py similarity index 80% rename from hubspot/crm/deals/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/deals/models/batch_input_simple_public_object_batch_input_for_create.py index aa5ab46f..cb6e610d 100644 --- a/hubspot/crm/deals/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/deals/models/batch_input_simple_public_object_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.deals.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectBatchInputForCreate(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,12 +35,12 @@ class BatchInputSimplePublicObjectInputForCreate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"inputs": "list[SimplePublicObjectInputForCreate]"} + openapi_types = {"inputs": "list[SimplePublicObjectBatchInputForCreate]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # noqa: E501 + """BatchInputSimplePublicObjectBatchInputForCreate - 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 @@ -52,21 +52,21 @@ def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 @property def inputs(self): - """Gets the inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 + """Gets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :return: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[SimplePublicObjectBatchInputForCreate] """ return self._inputs @inputs.setter def inputs(self, inputs): - """Sets the inputs of this BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectBatchInputForCreate. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :param inputs: The inputs of this BatchInputSimplePublicObjectBatchInputForCreate. # noqa: E501 + :type inputs: list[SimplePublicObjectBatchInputForCreate] """ 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 @@ -109,14 +109,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): 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): + if not isinstance(other, BatchInputSimplePublicObjectBatchInputForCreate): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/deals/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/deals/models/batch_read_input_simple_public_object_id.py index 4f78dc31..a774eb2a 100644 --- a/hubspot/crm/deals/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/deals/models/batch_read_input_simple_public_object_id.py @@ -84,6 +84,7 @@ def properties_with_history(self, properties_with_history): def id_property(self): """Gets the id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :return: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :rtype: str @@ -94,6 +95,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this BatchReadInputSimplePublicObjectId. + When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. # noqa: E501 :param id_property: The id_property of this BatchReadInputSimplePublicObjectId. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/deals/models/public_associations_for_object.py b/hubspot/crm/deals/models/public_associations_for_object.py index a7027e89..19851dd1 100644 --- a/hubspot/crm/deals/models/public_associations_for_object.py +++ b/hubspot/crm/deals/models/public_associations_for_object.py @@ -49,10 +49,8 @@ def __init__(self, types=None, to=None, local_vars_configuration=None): # noqa: self._to = None self.discriminator = None - if types is not None: - self.types = types - if to is not None: - self.to = to + self.types = types + self.to = to @property def types(self): @@ -72,6 +70,8 @@ def types(self, types): :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 @@ -93,6 +93,8 @@ def to(self, to): :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 diff --git a/hubspot/crm/deals/models/public_object_id.py b/hubspot/crm/deals/models/public_object_id.py index 2621dc6a..c744b950 100644 --- a/hubspot/crm/deals/models/public_object_id.py +++ b/hubspot/crm/deals/models/public_object_id.py @@ -48,8 +48,7 @@ def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 self._id = None self.discriminator = None - if id is not None: - self.id = id + self.id = id @property def id(self): @@ -69,6 +68,8 @@ def id(self, id): :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 diff --git a/hubspot/crm/deals/models/simple_public_object.py b/hubspot/crm/deals/models/simple_public_object.py index f26e158e..fb658bf2 100644 --- a/hubspot/crm/deals/models/simple_public_object.py +++ b/hubspot/crm/deals/models/simple_public_object.py @@ -41,6 +41,7 @@ class SimplePublicObject(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -51,11 +52,14 @@ class SimplePublicObject(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + def __init__( + self, created_at=None, archived=None, archived_at=None, properties_with_history=None, id=None, object_write_trace_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() @@ -66,6 +70,7 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -78,6 +83,8 @@ def __init__(self, created_at=None, archived=None, archived_at=None, properties_ if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -190,6 +197,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObject. # 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 SimplePublicObject. # noqa: E501 diff --git a/hubspot/crm/deals/models/simple_public_object_batch_input.py b/hubspot/crm/deals/models/simple_public_object_batch_input.py index 003af9eb..1435b0e2 100644 --- a/hubspot/crm/deals/models/simple_public_object_batch_input.py +++ b/hubspot/crm/deals/models/simple_public_object_batch_input.py @@ -62,6 +62,7 @@ def __init__(self, id_property=None, object_write_trace_id=None, id=None, proper def id_property(self): """Gets the id_property of this SimplePublicObjectBatchInput. # noqa: E501 + The name of a property whose values are unique for this object # noqa: E501 :return: The id_property of this SimplePublicObjectBatchInput. # noqa: E501 :rtype: str @@ -72,6 +73,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this SimplePublicObjectBatchInput. + The name of a property whose values are unique for this object # noqa: E501 :param id_property: The id_property of this SimplePublicObjectBatchInput. # noqa: E501 :type id_property: str @@ -104,6 +106,7 @@ def object_write_trace_id(self, object_write_trace_id): def id(self): """Gets the id of this SimplePublicObjectBatchInput. # noqa: E501 + The id to be updated. This can be the object id, or the unique property value of the idProperty property # noqa: E501 :return: The id of this SimplePublicObjectBatchInput. # noqa: E501 :rtype: str @@ -114,6 +117,7 @@ def id(self): def id(self, id): """Sets the id of this SimplePublicObjectBatchInput. + The id to be updated. This can be the object id, or the unique property value of the idProperty property # noqa: E501 :param id: The id of this SimplePublicObjectBatchInput. # noqa: E501 :type id: str diff --git a/hubspot/crm/deals/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/deals/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..09af315b --- /dev/null +++ b/hubspot/crm/deals/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Deals + + 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.deals.configuration import Configuration + + +class SimplePublicObjectBatchInputForCreate(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 + """SimplePublicObjectBatchInputForCreate - 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 + + if associations is not 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: list[PublicAssociationsForObject] + """ + return self._associations + + @associations.setter + def associations(self, associations): + """Sets the associations of this SimplePublicObjectBatchInputForCreate. + + + :param associations: The associations of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :type associations: list[PublicAssociationsForObject] + """ + + self._associations = associations + + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectBatchInputForCreate. # 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 SimplePublicObjectBatchInputForCreate. # noqa: E501 + + + :return: The properties of this SimplePublicObjectBatchInputForCreate. # noqa: E501 + :rtype: dict[str, str] + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SimplePublicObjectBatchInputForCreate. + + + :param properties: The properties of this SimplePublicObjectBatchInputForCreate. # 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, SimplePublicObjectBatchInputForCreate): + 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, SimplePublicObjectBatchInputForCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/deals/models/simple_public_object_batch_input_upsert.py b/hubspot/crm/deals/models/simple_public_object_batch_input_upsert.py index 966c31d5..a0e46ebf 100644 --- a/hubspot/crm/deals/models/simple_public_object_batch_input_upsert.py +++ b/hubspot/crm/deals/models/simple_public_object_batch_input_upsert.py @@ -62,6 +62,7 @@ def __init__(self, id_property=None, object_write_trace_id=None, id=None, proper def id_property(self): """Gets the id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 + The name of a property whose values are unique for this object # noqa: E501 :return: The id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :rtype: str @@ -72,6 +73,7 @@ def id_property(self): def id_property(self, id_property): """Sets the id_property of this SimplePublicObjectBatchInputUpsert. + The name of a property whose values are unique for this object # noqa: E501 :param id_property: The id_property of this SimplePublicObjectBatchInputUpsert. # noqa: E501 :type id_property: str diff --git a/hubspot/crm/deals/models/simple_public_object_input.py b/hubspot/crm/deals/models/simple_public_object_input.py index 7576ff52..8823dd6e 100644 --- a/hubspot/crm/deals/models/simple_public_object_input.py +++ b/hubspot/crm/deals/models/simple_public_object_input.py @@ -35,45 +35,21 @@ class SimplePublicObjectInput(object): 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]"} + openapi_types = {"properties": "dict[str, str]"} - attribute_map = {"object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"properties": "properties"} - def __init__(self, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, 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 diff --git a/hubspot/crm/deals/models/simple_public_object_input_for_create.py b/hubspot/crm/deals/models/simple_public_object_input_for_create.py index 4440eb7c..2fa64d02 100644 --- a/hubspot/crm/deals/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/deals/models/simple_public_object_input_for_create.py @@ -35,25 +35,22 @@ class SimplePublicObjectInputForCreate(object): 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]"} + openapi_types = {"associations": "list[PublicAssociationsForObject]", "properties": "dict[str, str]"} - attribute_map = {"associations": "associations", "object_write_trace_id": "objectWriteTraceId", "properties": "properties"} + attribute_map = {"associations": "associations", "properties": "properties"} - def __init__(self, associations=None, object_write_trace_id=None, properties=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, associations=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 if associations is not 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 @@ -77,27 +74,6 @@ def associations(self, associations): 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 diff --git a/hubspot/crm/deals/models/simple_public_object_with_associations.py b/hubspot/crm/deals/models/simple_public_object_with_associations.py index d1c1004d..4694af65 100644 --- a/hubspot/crm/deals/models/simple_public_object_with_associations.py +++ b/hubspot/crm/deals/models/simple_public_object_with_associations.py @@ -42,6 +42,7 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "datetime", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicObjectWithAssociations(object): "archived_at": "archivedAt", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + associations=None, + created_at=None, + archived=None, + archived_at=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._archived_at = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -85,6 +98,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -218,6 +233,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicObjectWithAssociations. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicObjectWithAssociations. # 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 SimplePublicObjectWithAssociations. # noqa: E501 diff --git a/hubspot/crm/deals/models/simple_public_upsert_object.py b/hubspot/crm/deals/models/simple_public_upsert_object.py index 5373c08a..9e45e051 100644 --- a/hubspot/crm/deals/models/simple_public_upsert_object.py +++ b/hubspot/crm/deals/models/simple_public_upsert_object.py @@ -42,6 +42,7 @@ class SimplePublicUpsertObject(object): "new": "bool", "properties_with_history": "dict[str, list[ValueWithTimestamp]]", "id": "str", + "object_write_trace_id": "str", "properties": "dict[str, str]", "updated_at": "datetime", } @@ -53,12 +54,23 @@ class SimplePublicUpsertObject(object): "new": "new", "properties_with_history": "propertiesWithHistory", "id": "id", + "object_write_trace_id": "objectWriteTraceId", "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 + self, + created_at=None, + archived=None, + archived_at=None, + new=None, + properties_with_history=None, + id=None, + object_write_trace_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: @@ -71,6 +83,7 @@ def __init__( self._new = None self._properties_with_history = None self._id = None + self._object_write_trace_id = None self._properties = None self._updated_at = None self.discriminator = None @@ -84,6 +97,8 @@ def __init__( if properties_with_history is not None: self.properties_with_history = properties_with_history self.id = id + if object_write_trace_id is not None: + self.object_write_trace_id = object_write_trace_id self.properties = properties self.updated_at = updated_at @@ -219,6 +234,27 @@ def id(self, id): self._id = id + @property + def object_write_trace_id(self): + """Gets the object_write_trace_id of this SimplePublicUpsertObject. # noqa: E501 + + + :return: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. + + + :param object_write_trace_id: The object_write_trace_id of this SimplePublicUpsertObject. # 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 SimplePublicUpsertObject. # noqa: E501 From a4a5baef012d3b7fc40fd1db92f75372f6cb1ae8 Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 14 Apr 2025 11:47:13 +0300 Subject: [PATCH 31/49] Discovery Cms Blogs BlogPosts --- hubspot/discovery/cms/blogs/blog_posts/discovery.py | 10 ++++++++-- tests/spec/cms/blogs/blog_posts/test_blog_posts.py | 6 ++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/hubspot/discovery/cms/blogs/blog_posts/discovery.py b/hubspot/discovery/cms/blogs/blog_posts/discovery.py index c8b52862..4214f64e 100644 --- a/hubspot/discovery/cms/blogs/blog_posts/discovery.py +++ b/hubspot/discovery/cms/blogs/blog_posts/discovery.py @@ -4,5 +4,11 @@ class Discovery(DiscoveryBase): @property - def blog_post_api(self) -> api_client.BlogPostsApi: - return self._configure_api_client(api_client, "BlogPostsApi") + def basic_api(self) -> api_client.BasicApi: + return self._configure_api_client(api_client, "BasicApi") + @property + def batch_api(self) -> api_client.BatchApi: + return self._configure_api_client(api_client, "BatchApi") + @property + def multi_language_api(self) -> api_client.MultiLanguageApi: + return self._configure_api_client(api_client, "MultiLanguageApi") diff --git a/tests/spec/cms/blogs/blog_posts/test_blog_posts.py b/tests/spec/cms/blogs/blog_posts/test_blog_posts.py index 2b7dc049..fd670c39 100644 --- a/tests/spec/cms/blogs/blog_posts/test_blog_posts.py +++ b/tests/spec/cms/blogs/blog_posts/test_blog_posts.py @@ -1,7 +1,9 @@ from hubspot import HubSpot -from hubspot.cms.blogs.blog_posts import BlogPostsApi +from hubspot.cms.blogs.blog_posts import BasicApi, BatchApi, MultiLanguageApi def test_is_discoverable(): apis = HubSpot().cms.blogs.blog_posts - assert isinstance(apis.blog_post_api, BlogPostsApi) + assert isinstance(apis.basic_api, BasicApi) + assert isinstance(apis.batch_api, BatchApi) + assert isinstance(apis.multi_language_api, MultiLanguageApi) From 04244cea2a3b8cd64434e07d915992131bb0d4e4 Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 14 Apr 2025 12:13:13 +0300 Subject: [PATCH 32/49] Discovery Crm Associations V4 --- hubspot/discovery/crm/associations/v4/discovery.py | 4 ---- .../v4/schema/test_v4_associations_schema.py | 0 tests/spec/crm/{ => associations}/v4/test_v4_associations.py | 1 - 3 files changed, 5 deletions(-) rename tests/spec/crm/{ => associations}/v4/schema/test_v4_associations_schema.py (100%) rename tests/spec/crm/{ => associations}/v4/test_v4_associations.py (86%) diff --git a/hubspot/discovery/crm/associations/v4/discovery.py b/hubspot/discovery/crm/associations/v4/discovery.py index 26165033..4723613b 100644 --- a/hubspot/discovery/crm/associations/v4/discovery.py +++ b/hubspot/discovery/crm/associations/v4/discovery.py @@ -3,10 +3,6 @@ class Discovery(DiscoveryBase): - @property - def basic_api(self) -> api_client.BasicApi: - return self._configure_api_client(api_client, "BasicApi") - @property def batch_api(self) -> api_client.BatchApi: return self._configure_api_client(api_client, "BatchApi") diff --git a/tests/spec/crm/v4/schema/test_v4_associations_schema.py b/tests/spec/crm/associations/v4/schema/test_v4_associations_schema.py similarity index 100% rename from tests/spec/crm/v4/schema/test_v4_associations_schema.py rename to tests/spec/crm/associations/v4/schema/test_v4_associations_schema.py diff --git a/tests/spec/crm/v4/test_v4_associations.py b/tests/spec/crm/associations/v4/test_v4_associations.py similarity index 86% rename from tests/spec/crm/v4/test_v4_associations.py rename to tests/spec/crm/associations/v4/test_v4_associations.py index 28ffc633..7630353c 100644 --- a/tests/spec/crm/v4/test_v4_associations.py +++ b/tests/spec/crm/associations/v4/test_v4_associations.py @@ -5,6 +5,5 @@ def test_is_discoverable(): apis = HubSpot().crm.associations.v4 assert isinstance(apis.batch_api, BatchApi) - assert isinstance(apis.basic_api, BasicApi) assert isinstance(apis.report_api, ReportApi) assert hasattr(apis, "schema") From 4c24728fbe4c7ef705b59c8307eb53c940fc44e7 Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 14 Apr 2025 12:21:49 +0300 Subject: [PATCH 33/49] Discovery Marketing Emails --- hubspot/discovery/marketing/discovery.py | 5 +++++ hubspot/discovery/marketing/emails/__init__.py | 0 hubspot/discovery/marketing/emails/discovery.py | 12 ++++++++++++ tests/spec/marketing/test_marketing_emails.py | 8 ++++++++ 4 files changed, 25 insertions(+) create mode 100644 hubspot/discovery/marketing/emails/__init__.py create mode 100644 hubspot/discovery/marketing/emails/discovery.py create mode 100644 tests/spec/marketing/test_marketing_emails.py diff --git a/hubspot/discovery/marketing/discovery.py b/hubspot/discovery/marketing/discovery.py index 8b9517ba..a622ee4e 100644 --- a/hubspot/discovery/marketing/discovery.py +++ b/hubspot/discovery/marketing/discovery.py @@ -1,6 +1,11 @@ from ..discovery_base import DiscoveryBase class Discovery(DiscoveryBase): + @property + def emails(self): + from .emails.discovery import Discovery as EmailsDiscovery + return EmailsDiscovery(self.config) + @property def events(self): from .events.discovery import Discovery as EventsDiscovery diff --git a/hubspot/discovery/marketing/emails/__init__.py b/hubspot/discovery/marketing/emails/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/hubspot/discovery/marketing/emails/discovery.py b/hubspot/discovery/marketing/emails/discovery.py new file mode 100644 index 00000000..21ac6a11 --- /dev/null +++ b/hubspot/discovery/marketing/emails/discovery.py @@ -0,0 +1,12 @@ +import hubspot.marketing.emails as api_client +from ...discovery_base import DiscoveryBase + + +class Discovery(DiscoveryBase): + @property + def marketing_emails_api(self) -> api_client.MarketingEmailsApi: + return self._configure_api_client(api_client, "MarketingEmailsApi") + + @property + def statistics_api(self) -> api_client.StatisticsApi: + return self._configure_api_client(api_client, "StatisticsApi") diff --git a/tests/spec/marketing/test_marketing_emails.py b/tests/spec/marketing/test_marketing_emails.py new file mode 100644 index 00000000..6d3e2607 --- /dev/null +++ b/tests/spec/marketing/test_marketing_emails.py @@ -0,0 +1,8 @@ +from hubspot import HubSpot +from hubspot.marketing.emails import MarketingEmailsApi, StatisticsApi + + +def test_is_discoverable(): + apis = HubSpot().marketing.emails + assert isinstance(apis.marketing_emails_api, MarketingEmailsApi) + assert isinstance(apis.statistics_api, StatisticsApi) From 7c25f53e39077a9929d77722ad024dc895d366e9 Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 14 Apr 2025 14:27:06 +0300 Subject: [PATCH 34/49] Discovery Marketing Events --- .../discovery/marketing/events/discovery.py | 20 +++++++++++++++---- tests/spec/marketing/test_marketing_events.py | 14 +++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/hubspot/discovery/marketing/events/discovery.py b/hubspot/discovery/marketing/events/discovery.py index 0b12020d..53918f09 100644 --- a/hubspot/discovery/marketing/events/discovery.py +++ b/hubspot/discovery/marketing/events/discovery.py @@ -4,20 +4,32 @@ class Discovery(DiscoveryBase): @property - def attendance_subscriber_state_changes_api(self) -> api_client.AttendanceSubscriberStateChangesApi: - return self._configure_api_client(api_client, "AttendanceSubscriberStateChangesApi") + def add_event_attendees_api(self) -> api_client.AddEventAttendeesApi: + return self._configure_api_client(api_client, "AddEventAttendeesApi") @property def basic_api(self) -> api_client.BasicApi: return self._configure_api_client(api_client, "BasicApi") + @property + def batch_api(self) -> api_client.BatchApi: + return self._configure_api_client(api_client, "BatchApi") + + @property + def change_property_api(self) -> api_client.ChangePropertyApi: + return self._configure_api_client(api_client, "ChangePropertyApi") + + @property + def identifiers_api(self) -> api_client.IdentifiersApi: + return self._configure_api_client(api_client, "IdentifiersApi") + @property def list_associations_api(self) -> api_client.ListAssociationsApi: return self._configure_api_client(api_client, "ListAssociationsApi") @property - def participant_state_api(self) -> api_client.ParticipantStateApi: - return self._configure_api_client(api_client, "ParticipantStateApi") + def retrieve_participant_state_api(self) -> api_client.RetrieveParticipantStateApi: + return self._configure_api_client(api_client, "RetrieveParticipantStateApi") @property def settings_api(self) -> api_client.SettingsApi: diff --git a/tests/spec/marketing/test_marketing_events.py b/tests/spec/marketing/test_marketing_events.py index 6934f7a9..d2286dfa 100644 --- a/tests/spec/marketing/test_marketing_events.py +++ b/tests/spec/marketing/test_marketing_events.py @@ -1,9 +1,12 @@ from hubspot import HubSpot from hubspot.marketing.events import ( - AttendanceSubscriberStateChangesApi, + AddEventAttendeesApi, BasicApi, + BatchApi, + ChangePropertyApi, + IdentifiersApi, ListAssociationsApi, - ParticipantStateApi, + RetrieveParticipantStateApi, SettingsApi, SubscriberStateChangesApi ) @@ -11,9 +14,12 @@ def test_is_discoverable(): apis = HubSpot().marketing.events - assert isinstance(apis.attendance_subscriber_state_changes_api, AttendanceSubscriberStateChangesApi) + assert isinstance(apis.add_event_attendees_api, AddEventAttendeesApi) assert isinstance(apis.basic_api, BasicApi) + assert isinstance(apis.batch_api, BatchApi) + assert isinstance(apis.change_property_api, ChangePropertyApi) + assert isinstance(apis.identifiers_api, IdentifiersApi) assert isinstance(apis.list_associations_api, ListAssociationsApi) - assert isinstance(apis.participant_state_api, ParticipantStateApi) + assert isinstance(apis.retrieve_participant_state_api, RetrieveParticipantStateApi) assert isinstance(apis.settings_api, SettingsApi) assert isinstance(apis.subscriber_state_changes_api, SubscriberStateChangesApi) From 0c946c6935bf6b54f10a55def6e3cf11513e8b08 Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 14 Apr 2025 14:31:34 +0300 Subject: [PATCH 35/49] Discovery Marketing Transactional --- hubspot/discovery/marketing/transactional/discovery.py | 6 +++--- tests/spec/marketing/test_transactional.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hubspot/discovery/marketing/transactional/discovery.py b/hubspot/discovery/marketing/transactional/discovery.py index 945dc3fc..de3ad9e9 100644 --- a/hubspot/discovery/marketing/transactional/discovery.py +++ b/hubspot/discovery/marketing/transactional/discovery.py @@ -4,9 +4,9 @@ class Discovery(DiscoveryBase): @property - def public_smtp_tokens_api(self) -> api_client.PublicSmtpTokensApi: - return self._configure_api_client(api_client, "PublicSmtpTokensApi") - + def public_smtp_tokens_api(self) -> api_client.PublicSMTPTokensApi: + return self._configure_api_client(api_client, "PublicSMTPTokensApi") + @property def single_send_api(self) -> api_client.SingleSendApi: return self._configure_api_client(api_client, "SingleSendApi") diff --git a/tests/spec/marketing/test_transactional.py b/tests/spec/marketing/test_transactional.py index c3ea320a..35167b74 100644 --- a/tests/spec/marketing/test_transactional.py +++ b/tests/spec/marketing/test_transactional.py @@ -1,8 +1,8 @@ from hubspot import HubSpot -from hubspot.marketing.transactional import PublicSmtpTokensApi, SingleSendApi +from hubspot.marketing.transactional import PublicSMTPTokensApi, SingleSendApi def test_is_discoverable(): - apis = HubSpot().marketing.transactional - assert isinstance(apis.public_smtp_tokens_api, PublicSmtpTokensApi) + apis = HubSpot().marketing.transactional + assert isinstance(apis.public_smtp_tokens_api, PublicSMTPTokensApi) assert isinstance(apis.single_send_api, SingleSendApi) From 440afff761191a2bd58de0d4091415089003aded Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 14 Apr 2025 14:44:40 +0300 Subject: [PATCH 36/49] Discovery Crm Commerce Invoices --- hubspot/discovery/crm/commerce/__init__.py | 0 hubspot/discovery/crm/commerce/discovery.py | 8 ++++++++ .../crm/commerce/invoices/__init__.py | 0 .../crm/commerce/invoices/discovery.py | 20 +++++++++++++++++++ hubspot/discovery/crm/discovery.py | 5 +++++ tests/spec/crm/commerce/test_invoices.py | 10 ++++++++++ 6 files changed, 43 insertions(+) create mode 100644 hubspot/discovery/crm/commerce/__init__.py create mode 100644 hubspot/discovery/crm/commerce/discovery.py create mode 100644 hubspot/discovery/crm/commerce/invoices/__init__.py create mode 100644 hubspot/discovery/crm/commerce/invoices/discovery.py create mode 100644 tests/spec/crm/commerce/test_invoices.py diff --git a/hubspot/discovery/crm/commerce/__init__.py b/hubspot/discovery/crm/commerce/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/hubspot/discovery/crm/commerce/discovery.py b/hubspot/discovery/crm/commerce/discovery.py new file mode 100644 index 00000000..1cffe1a7 --- /dev/null +++ b/hubspot/discovery/crm/commerce/discovery.py @@ -0,0 +1,8 @@ +from ...discovery_base import DiscoveryBase + + +class Discovery(DiscoveryBase): + @property + def invoices(self): + from .invoices.discovery import Discovery as InvoicesDiscovery + return InvoicesDiscovery(self.config) diff --git a/hubspot/discovery/crm/commerce/invoices/__init__.py b/hubspot/discovery/crm/commerce/invoices/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/hubspot/discovery/crm/commerce/invoices/discovery.py b/hubspot/discovery/crm/commerce/invoices/discovery.py new file mode 100644 index 00000000..f94f3409 --- /dev/null +++ b/hubspot/discovery/crm/commerce/invoices/discovery.py @@ -0,0 +1,20 @@ +import hubspot.crm.commerce.invoices as api_client +from hubspot.utils.objects import fetch_all +from ....discovery_base import DiscoveryBase + + +class Discovery(DiscoveryBase): + @property + def basic_api(self) -> api_client.BasicApi: + return self._configure_api_client(api_client, "BasicApi") + + @property + def batch_api(self) -> api_client.BatchApi: + return self._configure_api_client(api_client, "BatchApi") + + @property + def search_api(self) -> api_client.SearchApi: + return self._configure_api_client(api_client, "SearchApi") + + def get_all(self, **kwargs): + return fetch_all(self.basic_api, **kwargs) diff --git a/hubspot/discovery/crm/discovery.py b/hubspot/discovery/crm/discovery.py index f20a0fdf..f2194f6c 100644 --- a/hubspot/discovery/crm/discovery.py +++ b/hubspot/discovery/crm/discovery.py @@ -6,6 +6,11 @@ def associations(self): from .associations.discovery import Discovery as AssociationsDiscovery return AssociationsDiscovery(self.config) + @property + def commerce(self): + from .commerce.discovery import Discovery as CommerceDiscovery + return CommerceDiscovery(self.config) + @property def contacts(self): from .contacts.discovery import Discovery as ContactsDiscovery diff --git a/tests/spec/crm/commerce/test_invoices.py b/tests/spec/crm/commerce/test_invoices.py new file mode 100644 index 00000000..912ae109 --- /dev/null +++ b/tests/spec/crm/commerce/test_invoices.py @@ -0,0 +1,10 @@ +from hubspot import HubSpot +from hubspot.crm.commerce.invoices import BasicApi, BatchApi, SearchApi + + +def test_is_discoverable(): + apis = HubSpot().crm.commerce.invoices + assert isinstance(apis.basic_api, BasicApi) + assert isinstance(apis.batch_api, BatchApi) + assert isinstance(apis.search_api, SearchApi) + assert hasattr(apis, "get_all") From 74a5e73ce18144bda7183d6caf0977dee038aded Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 14 Apr 2025 14:55:20 +0300 Subject: [PATCH 37/49] Discovery Crm Exports --- hubspot/discovery/crm/discovery.py | 5 +++++ hubspot/discovery/crm/exports/__init__.py | 0 hubspot/discovery/crm/exports/discovery.py | 8 ++++++++ tests/spec/crm/test_exports.py | 7 +++++++ 4 files changed, 20 insertions(+) create mode 100644 hubspot/discovery/crm/exports/__init__.py create mode 100644 hubspot/discovery/crm/exports/discovery.py create mode 100644 tests/spec/crm/test_exports.py diff --git a/hubspot/discovery/crm/discovery.py b/hubspot/discovery/crm/discovery.py index f20a0fdf..cb476ca3 100644 --- a/hubspot/discovery/crm/discovery.py +++ b/hubspot/discovery/crm/discovery.py @@ -21,6 +21,11 @@ def deals(self): from .deals.discovery import Discovery as DealsDiscovery return DealsDiscovery(self.config) + @property + def exports(self): + from .exports.discovery import Discovery as ExportsDiscovery + return ExportsDiscovery(self.config) + @property def extensions(self): from .extensions.discovery import Discovery as ExtensionsDiscovery diff --git a/hubspot/discovery/crm/exports/__init__.py b/hubspot/discovery/crm/exports/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/hubspot/discovery/crm/exports/discovery.py b/hubspot/discovery/crm/exports/discovery.py new file mode 100644 index 00000000..43b55109 --- /dev/null +++ b/hubspot/discovery/crm/exports/discovery.py @@ -0,0 +1,8 @@ +import hubspot.crm.exports as api_client +from ...discovery_base import DiscoveryBase + + +class Discovery(DiscoveryBase): + @property + def public_exports_api(self) -> api_client.PublicExportsApi: + return self._configure_api_client(api_client, "PublicExportsApi") diff --git a/tests/spec/crm/test_exports.py b/tests/spec/crm/test_exports.py new file mode 100644 index 00000000..34eb9bd8 --- /dev/null +++ b/tests/spec/crm/test_exports.py @@ -0,0 +1,7 @@ +from hubspot import HubSpot +from hubspot.crm.exports import PublicExportsApi + + +def test_is_discoverable(): + apis = HubSpot().crm.exports + assert isinstance(apis.public_exports_api, PublicExportsApi) From 7de4d83a149d87fed5dfce41de0bc4c0e713d6dc Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 14 Apr 2025 15:37:52 +0300 Subject: [PATCH 38/49] Discovery Crm Extansions Calling --- hubspot/discovery/crm/extensions/calling/discovery.py | 4 ++++ tests/spec/crm/extensions/test_calling.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hubspot/discovery/crm/extensions/calling/discovery.py b/hubspot/discovery/crm/extensions/calling/discovery.py index 84a985ba..4e0a225f 100644 --- a/hubspot/discovery/crm/extensions/calling/discovery.py +++ b/hubspot/discovery/crm/extensions/calling/discovery.py @@ -4,6 +4,10 @@ class Discovery(DiscoveryBase): + @property + def channel_connection_settings_api(self) -> api_client.ChannelConnectionSettingsApi: + return self._configure_api_client(api_client, "ChannelConnectionSettingsApi") + @property def recording_settings_api(self) -> api_client.RecordingSettingsApi: return self._configure_api_client(api_client, "RecordingSettingsApi") diff --git a/tests/spec/crm/extensions/test_calling.py b/tests/spec/crm/extensions/test_calling.py index 8f9b081e..9b56b2fb 100644 --- a/tests/spec/crm/extensions/test_calling.py +++ b/tests/spec/crm/extensions/test_calling.py @@ -1,8 +1,9 @@ from hubspot import HubSpot -from hubspot.crm.extensions.calling import SettingsApi, RecordingSettingsApi +from hubspot.crm.extensions.calling import ChannelConnectionSettingsApi, SettingsApi, RecordingSettingsApi def test_is_discoverable(): apis = HubSpot().crm.extensions.calling + assert isinstance(apis.channel_connection_settings_api, ChannelConnectionSettingsApi) assert isinstance(apis.settings_api, SettingsApi) assert isinstance(apis.recording_settings_api, RecordingSettingsApi) From 411e0843701910c803d395910d60c4f1776df148 Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 14 Apr 2025 16:20:39 +0300 Subject: [PATCH 39/49] Discovery Events --- hubspot/discovery/events/discovery.py | 3 --- hubspot/discovery/events/send/discovery.py | 8 ++++++-- tests/spec/events/send/test_send.py | 5 +++-- tests/spec/events/test_events.py | 3 +-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/hubspot/discovery/events/discovery.py b/hubspot/discovery/events/discovery.py index 97e63bbc..605019ef 100644 --- a/hubspot/discovery/events/discovery.py +++ b/hubspot/discovery/events/discovery.py @@ -3,9 +3,6 @@ class Discovery(DiscoveryBase): - @property - def default_api(self) -> api_client.DefaultApi: - return self._configure_api_client(api_client, "DefaultApi") @property def events_api(self) -> api_client.EventsApi: diff --git a/hubspot/discovery/events/send/discovery.py b/hubspot/discovery/events/send/discovery.py index 781c8341..bd084ee2 100644 --- a/hubspot/discovery/events/send/discovery.py +++ b/hubspot/discovery/events/send/discovery.py @@ -4,5 +4,9 @@ class Discovery(DiscoveryBase): @property - def custom_event_data_api(self) -> api_client.CustomEventDataApi: - return self._configure_api_client(api_client, "CustomEventDataApi") + def basic_api(self) -> api_client.BasicApi: + return self._configure_api_client(api_client, "BasicApi") + + @property + def batch_api(self) -> api_client.BatchApi: + return self._configure_api_client(api_client, "BatchApi") diff --git a/tests/spec/events/send/test_send.py b/tests/spec/events/send/test_send.py index de49f17c..3c197a84 100644 --- a/tests/spec/events/send/test_send.py +++ b/tests/spec/events/send/test_send.py @@ -1,7 +1,8 @@ from hubspot import HubSpot -from hubspot.events.send import CustomEventDataApi +from hubspot.events.send import BasicApi, BatchApi def test_is_discoverable(): apis = HubSpot().events.send - assert isinstance(apis.custom_event_data_api, CustomEventDataApi) + assert isinstance(apis.basic_api, BasicApi) + assert isinstance(apis.batch_api, BatchApi) diff --git a/tests/spec/events/test_events.py b/tests/spec/events/test_events.py index 1634dacd..87e31868 100644 --- a/tests/spec/events/test_events.py +++ b/tests/spec/events/test_events.py @@ -1,8 +1,7 @@ from hubspot import HubSpot -from hubspot.events import DefaultApi, EventsApi +from hubspot.events import EventsApi def test_is_discoverable(): apis = HubSpot().events - assert isinstance(apis.default_api, DefaultApi) assert isinstance(apis.events_api, EventsApi) From 5413e78321011ea52d0aab8012db5a64ebed4969 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 15 Apr 2025 09:16:59 +0300 Subject: [PATCH 40/49] Discovery Crm Objects Deal Splits --- hubspot/discovery/crm/objects/deal_splits/__init__.py | 0 hubspot/discovery/crm/objects/deal_splits/discovery.py | 8 ++++++++ hubspot/discovery/crm/objects/discovery.py | 5 +++++ tests/spec/crm/objects/test_deal_splits.py | 7 +++++++ 4 files changed, 20 insertions(+) create mode 100644 hubspot/discovery/crm/objects/deal_splits/__init__.py create mode 100644 hubspot/discovery/crm/objects/deal_splits/discovery.py create mode 100644 tests/spec/crm/objects/test_deal_splits.py diff --git a/hubspot/discovery/crm/objects/deal_splits/__init__.py b/hubspot/discovery/crm/objects/deal_splits/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/hubspot/discovery/crm/objects/deal_splits/discovery.py b/hubspot/discovery/crm/objects/deal_splits/discovery.py new file mode 100644 index 00000000..5de5e387 --- /dev/null +++ b/hubspot/discovery/crm/objects/deal_splits/discovery.py @@ -0,0 +1,8 @@ +import hubspot.crm.objects.deal_splits as api_client +from ....discovery_base import DiscoveryBase + + +class Discovery(DiscoveryBase): + @property + def batch_api(self) -> api_client.BatchApi: + return self._configure_api_client(api_client, "BatchApi") diff --git a/hubspot/discovery/crm/objects/discovery.py b/hubspot/discovery/crm/objects/discovery.py index 4075788e..df932807 100644 --- a/hubspot/discovery/crm/objects/discovery.py +++ b/hubspot/discovery/crm/objects/discovery.py @@ -25,6 +25,11 @@ def communications(self): from .communications.discovery import Discovery as CommunicationsDiscovery return CommunicationsDiscovery(self.config) + @property + def deal_splits(self): + from .deal_splits.discovery import Discovery as DealSplitsDiscovery + return DealSplitsDiscovery(self.config) + @property def emails(self): from .emails.discovery import Discovery as EmailsDiscovery diff --git a/tests/spec/crm/objects/test_deal_splits.py b/tests/spec/crm/objects/test_deal_splits.py new file mode 100644 index 00000000..2f1009d2 --- /dev/null +++ b/tests/spec/crm/objects/test_deal_splits.py @@ -0,0 +1,7 @@ +from hubspot import HubSpot +from hubspot.crm.objects.deal_splits import BatchApi + + +def test_is_discoverable(): + apis = HubSpot().crm.objects.deal_splits + assert isinstance(apis.batch_api, BatchApi) From 8f20bb809c6d5a38d9c3e138cd3765dfad168453 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 15 Apr 2025 09:19:56 +0300 Subject: [PATCH 41/49] Discovery Crm Objects Feedback Submissions --- .../crm/objects/feedback_submissions/discovery.py | 8 -------- tests/spec/crm/objects/test_feedback_submissions.py | 4 +--- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/hubspot/discovery/crm/objects/feedback_submissions/discovery.py b/hubspot/discovery/crm/objects/feedback_submissions/discovery.py index 69a74c76..76d95bf3 100644 --- a/hubspot/discovery/crm/objects/feedback_submissions/discovery.py +++ b/hubspot/discovery/crm/objects/feedback_submissions/discovery.py @@ -11,14 +11,6 @@ def basic_api(self) -> api_client.BasicApi: def batch_api(self) -> api_client.BatchApi: return self._configure_api_client(api_client, "BatchApi") - @property - def gdpr_api(self) -> api_client.GDPRApi: - return self._configure_api_client(api_client, "GDPRApi") - - @property - def public_object_api(self) -> api_client.PublicObjectApi: - return self._configure_api_client(api_client, "PublicObjectApi") - @property def search_api(self) -> api_client.SearchApi: return self._configure_api_client(api_client, "SearchApi") diff --git a/tests/spec/crm/objects/test_feedback_submissions.py b/tests/spec/crm/objects/test_feedback_submissions.py index 14b60c97..b1540e35 100644 --- a/tests/spec/crm/objects/test_feedback_submissions.py +++ b/tests/spec/crm/objects/test_feedback_submissions.py @@ -1,11 +1,9 @@ from hubspot import HubSpot -from hubspot.crm.objects.feedback_submissions import BasicApi, BatchApi, GDPRApi, PublicObjectApi, SearchApi +from hubspot.crm.objects.feedback_submissions import BasicApi, BatchApi, SearchApi def test_is_discoverable(): apis = HubSpot().crm.objects.feedback_submissions assert isinstance(apis.basic_api, BasicApi) assert isinstance(apis.batch_api, BatchApi) - assert isinstance(apis.gdpr_api, GDPRApi) - assert isinstance(apis.public_object_api, PublicObjectApi) assert isinstance(apis.search_api, SearchApi) From e87a31750b9423fc435ba25a4acff186674721e4 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 15 Apr 2025 09:29:17 +0300 Subject: [PATCH 42/49] Discovery Crm Objects Companies --- hubspot/discovery/crm/companies/discovery.py | 4 ---- tests/spec/crm/test_companies.py | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/hubspot/discovery/crm/companies/discovery.py b/hubspot/discovery/crm/companies/discovery.py index cce43ebb..1c51344c 100644 --- a/hubspot/discovery/crm/companies/discovery.py +++ b/hubspot/discovery/crm/companies/discovery.py @@ -12,10 +12,6 @@ def basic_api(self) -> api_client.BasicApi: def batch_api(self) -> api_client.BatchApi: return self._configure_api_client(api_client, "BatchApi") - @property - def merge_api(self) -> api_client.MergeApi: - return self._configure_api_client(api_client, "MergeApi") - @property def search_api(self) -> api_client.SearchApi: return self._configure_api_client(api_client, "SearchApi") diff --git a/tests/spec/crm/test_companies.py b/tests/spec/crm/test_companies.py index 0f1b82cc..3d0d2927 100644 --- a/tests/spec/crm/test_companies.py +++ b/tests/spec/crm/test_companies.py @@ -1,11 +1,10 @@ from hubspot import HubSpot -from hubspot.crm.companies import BasicApi, BatchApi, MergeApi, SearchApi +from hubspot.crm.companies import BasicApi, BatchApi, SearchApi def test_is_discoverable(): apis = HubSpot().crm.companies assert isinstance(apis.basic_api, BasicApi) assert isinstance(apis.batch_api, BatchApi) - assert isinstance(apis.merge_api, MergeApi) assert isinstance(apis.search_api, SearchApi) assert hasattr(apis, "get_all") From 6b619f84bcb2be23b67af2ddde0b2e15a5c0e6ed Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 15 Apr 2025 09:31:30 +0300 Subject: [PATCH 43/49] Discovery Crm Objects Contacts --- hubspot/discovery/crm/contacts/discovery.py | 8 -------- tests/spec/crm/test_contacts.py | 4 +--- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/hubspot/discovery/crm/contacts/discovery.py b/hubspot/discovery/crm/contacts/discovery.py index 8d39ee14..4938ece4 100644 --- a/hubspot/discovery/crm/contacts/discovery.py +++ b/hubspot/discovery/crm/contacts/discovery.py @@ -12,14 +12,6 @@ def basic_api(self) -> api_client.BasicApi: def batch_api(self) -> api_client.BatchApi: return self._configure_api_client(api_client, "BatchApi") - @property - def gdpr_api(self) -> api_client.GDPRApi: - return self._configure_api_client(api_client, "GDPRApi") - - @property - def merge_api(self) -> api_client.MergeApi: - return self._configure_api_client(api_client, "MergeApi") - @property def search_api(self) -> api_client.SearchApi: return self._configure_api_client(api_client, "SearchApi") diff --git a/tests/spec/crm/test_contacts.py b/tests/spec/crm/test_contacts.py index eb45c0f8..bb0faada 100644 --- a/tests/spec/crm/test_contacts.py +++ b/tests/spec/crm/test_contacts.py @@ -1,12 +1,10 @@ from hubspot import HubSpot -from hubspot.crm.contacts import BasicApi, BatchApi, GDPRApi, MergeApi, SearchApi +from hubspot.crm.contacts import BasicApi, BatchApi, SearchApi def test_is_discoverable(): apis = HubSpot().crm.contacts assert isinstance(apis.basic_api, BasicApi) assert isinstance(apis.batch_api, BatchApi) - assert isinstance(apis.gdpr_api, GDPRApi) - assert isinstance(apis.merge_api, MergeApi) assert isinstance(apis.search_api, SearchApi) assert hasattr(apis, "get_all") From 40d6f0bb5c5ab6082fc824098969ad1889300bad Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 15 Apr 2025 09:33:20 +0300 Subject: [PATCH 44/49] Crm Objects Deals --- hubspot/discovery/crm/deals/discovery.py | 4 ---- tests/spec/crm/test_deals.py | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/hubspot/discovery/crm/deals/discovery.py b/hubspot/discovery/crm/deals/discovery.py index 1c813447..026d7cc2 100644 --- a/hubspot/discovery/crm/deals/discovery.py +++ b/hubspot/discovery/crm/deals/discovery.py @@ -12,10 +12,6 @@ def basic_api(self) -> api_client.BasicApi: def batch_api(self) -> api_client.BatchApi: return self._configure_api_client(api_client, "BatchApi") - @property - def merge_api(self) -> api_client.MergeApi: - return self._configure_api_client(api_client, "MergeApi") - @property def search_api(self) -> api_client.SearchApi: return self._configure_api_client(api_client, "SearchApi") diff --git a/tests/spec/crm/test_deals.py b/tests/spec/crm/test_deals.py index c506c57f..c32a80cc 100644 --- a/tests/spec/crm/test_deals.py +++ b/tests/spec/crm/test_deals.py @@ -1,11 +1,10 @@ from hubspot import HubSpot -from hubspot.crm.deals import BasicApi, BatchApi, MergeApi, SearchApi +from hubspot.crm.deals import BasicApi, BatchApi, SearchApi def test_is_discoverable(): apis = HubSpot().crm.deals assert isinstance(apis.basic_api, BasicApi) assert isinstance(apis.batch_api, BatchApi) - assert isinstance(apis.merge_api, MergeApi) assert isinstance(apis.search_api, SearchApi) assert hasattr(apis, "get_all") From a12f20777cdbc113fd7f471f582d16af5e3dd61f Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 15 Apr 2025 11:18:34 +0300 Subject: [PATCH 45/49] Update Discovery --- hubspot/discovery/crm/associations/v4/discovery.py | 4 ++++ tests/spec/crm/associations/v4/test_v4_associations.py | 1 + 2 files changed, 5 insertions(+) diff --git a/hubspot/discovery/crm/associations/v4/discovery.py b/hubspot/discovery/crm/associations/v4/discovery.py index 4723613b..26165033 100644 --- a/hubspot/discovery/crm/associations/v4/discovery.py +++ b/hubspot/discovery/crm/associations/v4/discovery.py @@ -3,6 +3,10 @@ class Discovery(DiscoveryBase): + @property + def basic_api(self) -> api_client.BasicApi: + return self._configure_api_client(api_client, "BasicApi") + @property def batch_api(self) -> api_client.BatchApi: return self._configure_api_client(api_client, "BatchApi") diff --git a/tests/spec/crm/associations/v4/test_v4_associations.py b/tests/spec/crm/associations/v4/test_v4_associations.py index 7630353c..2484eeeb 100644 --- a/tests/spec/crm/associations/v4/test_v4_associations.py +++ b/tests/spec/crm/associations/v4/test_v4_associations.py @@ -4,6 +4,7 @@ def test_is_discoverable(): apis = HubSpot().crm.associations.v4 + assert isinstance(apis.basic_api, BasicApi) assert isinstance(apis.batch_api, BatchApi) assert isinstance(apis.report_api, ReportApi) assert hasattr(apis, "schema") From 02da95512f9761253de3f032736e4cc808bc19c4 Mon Sep 17 00:00:00 2001 From: alexey Date: Wed, 16 Apr 2025 09:39:56 +0300 Subject: [PATCH 46/49] Changelog 12.0.0-beta.1 --- CHANGELOG.md | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2095060b..bee796b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,87 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/HubSpot/hubspot-api-python/compare/v11.1.0...HEAD) +## [Unreleased](https://github.com/HubSpot/hubspot-api-python/compare/v12.0.0-beta.1...HEAD) + +## [12.0.0-beta.1](https://github.com/HubSpot/hubspot-api-python/compare/v11.1.0...v12.0.0-beta.1) - 2025-05-16 + +## CRM Objects + +- Renamed `BatchInputSimplePublicObjectInputForCreate` to `BatchInputSimplePublicObjectBatchInputForCreate` for `crm.contacts`, `crm.companies`, `crm.deals`, `crm.objects`, `crm.objects.taxes`, `crm.objects.tasks`, `crm.objects.postal_mail`, `crm.objects.notes`, `crm.objects.meetings`, `crm.objects.leads`, `crm.objects.emails`, `crm.objects.communications`, `crm.objects.line_items`, `crm.objects.quotes`, `crm.objects.calls`. +- Removed methods `archive()`, `create()` and `update()` from `crm.objects.feedback_submissions.basic_api`. +- Removed methods `archive()`, `create()` and `update()` from `crm.objects.feedback_submissions.batch_api`. +- Added parameters `uses_remote` and `uses_calling_window` to `crm.extensions.calling.models.settings_patch_request`, `crm.extensions.calling.models.settings_request` and `crm.extensions.calling.models.settings_response`. +- Added parameter `object_write_trace_id` to models: `simple_public_object`, `simple_public_object_with_associations`, `simple_public_upsert_object` for `crm.contacts`, `crm.companies`, `crm.deals`, `crm.objects`, `crm.objects.taxes`, `crm.objects.tasks`, `crm.objects.postal_mail`, `crm.objects.notes`, `crm.objects.meetings`, `crm.objects.leads`, `crm.objects.emails`, `crm.objects.communications`, `crm.objects.line_items`, `crm.objects.quotes`, `crm.objects.calls`. +- Removed parameter `object_write_trace_id` from models: `simple_public_object_input`, `simple_public_object_input_for_create` for `crm.contacts`, `crm.companies`, `crm.deals`, `crm.objects`, `crm.objects.taxes`, `crm.objects.tasks`, `crm.objects.postal_mail`, `crm.objects.notes`, `crm.objects.meetings`, `crm.objects.leads`, `crm.objects.emails`, `crm.objects.communications`, `crm.objects.line_items`, `crm.objects.quotes`, `crm.objects.calls`. + +## CRM Extensions, Imports and Owners + +- Added parameters `uses_remote` and `uses_calling_window` to `crm.extensions.calling.models.settings_patch_request`, `crm.extensions.calling.models.settings_request` and `crm.extensions.calling.models.settings_response`. +- Added parameters `include_error_message` and `include_row_data` to `crm.imports.public_imports_api`. +- Added parameter `contains_encrypted_properties` to `crm.imports.models.import_row_core`. +- Added parameters `invalid_property_value`, `error_message` and `invalid_value_to_display` to `crm.imports.models.public_import_error`. +- Added parameter `mapped_object_type_ids` to `crm.imports.models.public_import_response`. +- Added parameter `user_id_including_inactive` and `type` to `crm.owners.models.public_owner`. + +## Marketing + +- Added parameter `object_id` to `marketing.events.models.marketing_event_default_response`, `marketing.events.models.marketing_event_default_response` and `marketing.events.models.marketing_event_public_read_response`. +- Added methods `archive_by_object_id()`, `get_all()`, `get_by_object_id()` and `update_by_object_id()` to `marketing.events.basic_api`. +- Renamed from `marketing.transactional.api.PublicSmtpTokensApi` to `marketing.transactional.api.PublicSMTPTokensApi`. +- Renamed from `marketing.events.participant_state_api` to `marketing.events.retrieve_participant_state_api`. +- Renamed from `CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging` to `CollectionResponseSearchPublicResponseWrapperNoPaging`. +- Moved and renamed methods from `basic_api.batch_archive()` and `basic_api.batch_upsert()` to `batch_api.archive()` and `batch_api.upsert()`. +- Moved methods from `basic_api.compelte()` and `basic_api.cancel()` to `change_property_api.compelte()` and `change_property_api.cancel()`. +- Moved method from `basic_api.do_search()` to `identifiers_api.do_search()`. + +## Webhooks + +- Added parameter `object_type_id` to `webhooks.models.subscription_create_request` and `webhooks.models.subscription_response`. +- Removed parameter `period` from `webhooks.models.throttling_settings`. + +## Added new Client APIs + +- `crm.companies.api.merge_api` Api. +- `crm.extensions.calling.channel_connection_settings_api` Api. +- `marketing.events.add_event_attendees_api` Api. +- `marketing.events.batch_api` Api. +- `marketing.events.change_property_api` Api. +- `marketing.events.identifiers_api` Api. +- `cms.blogs.blog_posts.basic_api` Api. +- `cms.blogs.blog_posts.batch_api` Api. +- `cms.blogs.blog_posts.multi_language_api` Api. +- `events.send.basic_api` Api. +- `events.send.batch_api` Api. + +## Removed Client APIs + +- `cms.blogs.blog_posts.blog_posts_api` Api. +- `marketing.events.attendance_subscriber_state_changes_api` Api. +- `crm.objects.feedback_submissions.gdpr_api` Api. +- `crm.objects.feedback_submissions.public_object_api` Api. +- `crm.companies.api.merge_api` Api. +- `crm.contacts.api.merge_api` Api. +- `crm.deals.api.merge_api` Api. +- `crm.contacts.api.gdpr_api` Api. +- `events.send.custom_event_data_api` Api. +- `events.send.default_api` Api. + +## Added new Clients + +- `Marketing Emails` client. +- `Invoices` client. +- `Exports` client. +- `Deal Splits` client. + +## Added + +- Example how upload files. + +## Fix + +- Urlencoding `query_string` for `api_request`. +- Broken Contacts example in `README`. +- Oauth example. ## [11.1.0](https://github.com/HubSpot/hubspot-api-python/compare/v11.0.0...v11.1.0) - 2024-12-23 From d1c768cfe13cccc98084bb14b69896c755f1b396 Mon Sep 17 00:00:00 2001 From: alexey Date: Wed, 16 Apr 2025 09:45:39 +0300 Subject: [PATCH 47/49] Update version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 68d8f15e..caa73c71 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.1.0 +12.0.0-beta.1 From 34230a278c70bf19a96c44b36122b6e0e0bee2b2 Mon Sep 17 00:00:00 2001 From: alexey Date: Wed, 16 Apr 2025 14:50:24 +0300 Subject: [PATCH 48/49] Clean Up --- CHANGELOG.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bee796b1..979dc296 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,15 +77,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `Exports` client. - `Deal Splits` client. -## Added +## Updated -- Example how upload files. +- README. ## Fix - Urlencoding `query_string` for `api_request`. -- Broken Contacts example in `README`. -- Oauth example. ## [11.1.0](https://github.com/HubSpot/hubspot-api-python/compare/v11.0.0...v11.1.0) - 2024-12-23 From c4f4c13f8ae18b673133f9cae53dda76b6a378ce Mon Sep 17 00:00:00 2001 From: alexey Date: Wed, 16 Apr 2025 14:57:16 +0300 Subject: [PATCH 49/49] Clean Up --- CHANGELOG.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 979dc296..4ceead28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,13 +77,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `Exports` client. - `Deal Splits` client. -## Updated - -- README. - -## Fix +## Other updates -- Urlencoding `query_string` for `api_request`. +- Updated `README`. +- Fixed urlencoding `query_string` for `api_request`. ## [11.1.0](https://github.com/HubSpot/hubspot-api-python/compare/v11.0.0...v11.1.0) - 2024-12-23