diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ceead28..68aa1bde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,32 @@ 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/v12.0.0-beta.1...HEAD) +## [Unreleased](https://github.com/HubSpot/hubspot-api-python/compare/v12.0.0...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 +## [12.0.0](https://github.com/HubSpot/hubspot-api-python/compare/v12.0.0-beta.1...v12.0.0) - 2025-05-07 + +## Files + +- Changed incomining parameters list in `files.files_api.do_search()`. +- Renamed method `archive_gdpr()` to `delete()` in `files.files_api`. +- Renamed method `update_properties()` to `update_properties_recursively()` in `files.folders_api`. +- Added new method `update_properties()` to `files.folders_api`. +- Changed incomining parameters list in `files.folders_api.do_search()`. +- Added properties `source_group` and `file_md5` to `File`. +- Added property `clear_expires` to `FileUpdateInput`. +- Changed property type from `"expires_at": "int"` to `"expires_at": "datetime"` in `FileUpdateInput`. +- Added property `expires_at` to `ImportFromUrlInput`. +- Removed property `id` from `FolderUpdateInput`. + +## Other changes + +- Added parameter `object_write_trace_id` to models: `simple_public_object`, `simple_public_object_with_associations`, `simple_public_upsert_object` for `crm.products`, `crm.objects.goals`, `crm.tickets`. +- Removed parameter `object_write_trace_id` from models: `simple_public_object_input`, `simple_public_object_input_for_create` for `crm.products`, `crm.objects.goals`, `crm.tickets`. +- Added method `merge()` to `crm.tickets.basic_api`. +- Removed `crm.tickets.merge_api` Api. +- Removed `CMS Performance` Client. + +## [12.0.0-beta.1](https://github.com/HubSpot/hubspot-api-python/compare/v11.1.0...v12.0.0-beta.1) - 2025-04-16 ## CRM Objects @@ -45,7 +68,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Added new Client APIs -- `crm.companies.api.merge_api` Api. +- `crm.companies.merge_api` Api. - `crm.extensions.calling.channel_connection_settings_api` Api. - `marketing.events.add_event_attendees_api` Api. - `marketing.events.batch_api` Api. @@ -63,10 +86,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `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. +- `crm.companies.merge_api` Api. +- `crm.contacts.merge_api` Api. +- `crm.deals.merge_api` Api. +- `crm.contacts.gdpr_api` Api. - `events.send.custom_event_data_api` Api. - `events.send.default_api` Api. diff --git a/VERSION b/VERSION index caa73c71..4044f908 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -12.0.0-beta.1 +12.0.0 diff --git a/hubspot/cms/performance/__init__.py b/hubspot/cms/performance/__init__.py deleted file mode 100644 index b232f74a..00000000 --- a/hubspot/cms/performance/__init__.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" - CMS Performance - - Use these endpoints to get a time series view of your website's performance. # 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.cms.performance.api.public_performance_api import PublicPerformanceApi - -# import ApiClient -from hubspot.cms.performance.api_client import ApiClient -from hubspot.cms.performance.configuration import Configuration -from hubspot.cms.performance.exceptions import OpenApiException -from hubspot.cms.performance.exceptions import ApiTypeError -from hubspot.cms.performance.exceptions import ApiValueError -from hubspot.cms.performance.exceptions import ApiKeyError -from hubspot.cms.performance.exceptions import ApiAttributeError -from hubspot.cms.performance.exceptions import ApiException - -# import models into sdk package -from hubspot.cms.performance.models.error import Error -from hubspot.cms.performance.models.error_detail import ErrorDetail -from hubspot.cms.performance.models.performance_view import PerformanceView -from hubspot.cms.performance.models.public_performance_response import PublicPerformanceResponse diff --git a/hubspot/cms/performance/api/__init__.py b/hubspot/cms/performance/api/__init__.py deleted file mode 100644 index f40e3095..00000000 --- a/hubspot/cms/performance/api/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from hubspot.cms.performance.api.public_performance_api import PublicPerformanceApi diff --git a/hubspot/cms/performance/api/public_performance_api.py b/hubspot/cms/performance/api/public_performance_api.py deleted file mode 100644 index 6e934577..00000000 --- a/hubspot/cms/performance/api/public_performance_api.py +++ /dev/null @@ -1,358 +0,0 @@ -# coding: utf-8 - -""" - CMS Performance - - Use these endpoints to get a time series view of your website's performance. # 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.performance.api_client import ApiClient -from hubspot.cms.performance.exceptions import ApiTypeError, ApiValueError # noqa: F401 - - -class PublicPerformanceApi(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_page(self, **kwargs): # noqa: E501 - """View your website's performance. # noqa: E501 - - Returns time series data website performance data for the given domain and/or 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_page(async_req=True) - >>> result = thread.get() - - :param domain: The domain to search return data for. - :type domain: str - :param path: The url path of the domain to return data for. - :type path: str - :param pad: Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. - :type pad: bool - :param sum: Specifies whether the time series data should be summated for the given period. Defaults to false. - :type sum: bool - :param period: A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] - :type period: str - :param interval: The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] - :type interval: str - :param start: A timestamp in milliseconds that indicates the start of the time period. - :type start: int - :param end: A timestamp in milliseconds that indicates the end of the time period. - :type end: 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: PublicPerformanceResponse - """ - 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 - """View your website's performance. # noqa: E501 - - Returns time series data website performance data for the given domain and/or 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_page_with_http_info(async_req=True) - >>> result = thread.get() - - :param domain: The domain to search return data for. - :type domain: str - :param path: The url path of the domain to return data for. - :type path: str - :param pad: Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. - :type pad: bool - :param sum: Specifies whether the time series data should be summated for the given period. Defaults to false. - :type sum: bool - :param period: A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] - :type period: str - :param interval: The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] - :type interval: str - :param start: A timestamp in milliseconds that indicates the start of the time period. - :type start: int - :param end: A timestamp in milliseconds that indicates the end of the time period. - :type end: 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(PublicPerformanceResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = ["domain", "path", "pad", "sum", "period", "interval", "start", "end"] - 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("domain") is not None: # noqa: E501 - query_params.append(("domain", local_var_params["domain"])) # noqa: E501 - if local_var_params.get("path") is not None: # noqa: E501 - query_params.append(("path", local_var_params["path"])) # noqa: E501 - if local_var_params.get("pad") is not None: # noqa: E501 - query_params.append(("pad", local_var_params["pad"])) # noqa: E501 - if local_var_params.get("sum") is not None: # noqa: E501 - query_params.append(("sum", local_var_params["sum"])) # noqa: E501 - if local_var_params.get("period") is not None: # noqa: E501 - query_params.append(("period", local_var_params["period"])) # noqa: E501 - 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") is not None: # noqa: E501 - query_params.append(("start", local_var_params["start"])) # noqa: E501 - if local_var_params.get("end") is not None: # noqa: E501 - query_params.append(("end", local_var_params["end"])) # 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: "PublicPerformanceResponse", - } - - return self.api_client.call_api( - "/cms/v3/performance/", - "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_uptime(self, **kwargs): # noqa: E501 - """View your website's uptime. # noqa: E501 - - Returns uptime time series website performance data for the given domain. # 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_uptime(async_req=True) - >>> result = thread.get() - - :param domain: The domain to search return data for. - :type domain: str - :param path: - :type path: str - :param pad: Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. - :type pad: bool - :param sum: Specifies whether the time series data should be summated for the given period. Defaults to false. - :type sum: bool - :param period: A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] - :type period: str - :param interval: The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] - :type interval: str - :param start: A timestamp in milliseconds that indicates the start of the time period. - :type start: int - :param end: A timestamp in milliseconds that indicates the end of the time period. - :type end: 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: PublicPerformanceResponse - """ - kwargs["_return_http_data_only"] = True - return self.get_uptime_with_http_info(**kwargs) # noqa: E501 - - def get_uptime_with_http_info(self, **kwargs): # noqa: E501 - """View your website's uptime. # noqa: E501 - - Returns uptime time series website performance data for the given domain. # 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_uptime_with_http_info(async_req=True) - >>> result = thread.get() - - :param domain: The domain to search return data for. - :type domain: str - :param path: - :type path: str - :param pad: Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set. - :type pad: bool - :param sum: Specifies whether the time series data should be summated for the given period. Defaults to false. - :type sum: bool - :param period: A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w] - :type period: str - :param interval: The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w] - :type interval: str - :param start: A timestamp in milliseconds that indicates the start of the time period. - :type start: int - :param end: A timestamp in milliseconds that indicates the end of the time period. - :type end: 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(PublicPerformanceResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = ["domain", "path", "pad", "sum", "period", "interval", "start", "end"] - 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_uptime" % key) - local_var_params[key] = val - del local_var_params["kwargs"] - - collection_formats = {} - - path_params = {} - - query_params = [] - if local_var_params.get("domain") is not None: # noqa: E501 - query_params.append(("domain", local_var_params["domain"])) # noqa: E501 - if local_var_params.get("path") is not None: # noqa: E501 - query_params.append(("path", local_var_params["path"])) # noqa: E501 - if local_var_params.get("pad") is not None: # noqa: E501 - query_params.append(("pad", local_var_params["pad"])) # noqa: E501 - if local_var_params.get("sum") is not None: # noqa: E501 - query_params.append(("sum", local_var_params["sum"])) # noqa: E501 - if local_var_params.get("period") is not None: # noqa: E501 - query_params.append(("period", local_var_params["period"])) # noqa: E501 - 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") is not None: # noqa: E501 - query_params.append(("start", local_var_params["start"])) # noqa: E501 - if local_var_params.get("end") is not None: # noqa: E501 - query_params.append(("end", local_var_params["end"])) # 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: "PublicPerformanceResponse", - } - - return self.api_client.call_api( - "/cms/v3/performance/uptime", - "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/cms/performance/api_client.py b/hubspot/cms/performance/api_client.py deleted file mode 100644 index c91b907f..00000000 --- a/hubspot/cms/performance/api_client.py +++ /dev/null @@ -1,664 +0,0 @@ -# coding: utf-8 -""" - CMS Performance - - Use these endpoints to get a time series view of your website's performance. # 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.cms.performance.configuration import Configuration -import hubspot.cms.performance.models -from hubspot.cms.performance import rest -from hubspot.cms.performance.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.cms.performance.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/cms/performance/configuration.py b/hubspot/cms/performance/configuration.py deleted file mode 100644 index 98c463a3..00000000 --- a/hubspot/cms/performance/configuration.py +++ /dev/null @@ -1,439 +0,0 @@ -# coding: utf-8 - -""" - CMS Performance - - Use these endpoints to get a time series view of your website's performance. # 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.cms.performance.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.cms.performance") - 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/cms/performance/exceptions.py b/hubspot/cms/performance/exceptions.py deleted file mode 100644 index 1675b92c..00000000 --- a/hubspot/cms/performance/exceptions.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding: utf-8 - -""" - CMS Performance - - Use these endpoints to get a time series view of your website's performance. # 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/cms/performance/models/__init__.py b/hubspot/cms/performance/models/__init__.py deleted file mode 100644 index 0d4675fa..00000000 --- a/hubspot/cms/performance/models/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -""" - CMS Performance - - Use these endpoints to get a time series view of your website's performance. # 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.cms.performance.models.error import Error -from hubspot.cms.performance.models.error_detail import ErrorDetail -from hubspot.cms.performance.models.performance_view import PerformanceView -from hubspot.cms.performance.models.public_performance_response import PublicPerformanceResponse diff --git a/hubspot/cms/performance/models/error.py b/hubspot/cms/performance/models/error.py deleted file mode 100644 index f8ead3ed..00000000 --- a/hubspot/cms/performance/models/error.py +++ /dev/null @@ -1,282 +0,0 @@ -# coding: utf-8 - -""" - CMS Performance - - Use these endpoints to get a time series view of your website's performance. # 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.cms.performance.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/cms/performance/models/error_detail.py b/hubspot/cms/performance/models/error_detail.py deleted file mode 100644 index 4e993373..00000000 --- a/hubspot/cms/performance/models/error_detail.py +++ /dev/null @@ -1,228 +0,0 @@ -# coding: utf-8 - -""" - CMS Performance - - Use these endpoints to get a time series view of your website's performance. # 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.cms.performance.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/cms/performance/models/performance_view.py b/hubspot/cms/performance/models/performance_view.py deleted file mode 100644 index 3222308f..00000000 --- a/hubspot/cms/performance/models/performance_view.py +++ /dev/null @@ -1,753 +0,0 @@ -# coding: utf-8 - -""" - CMS Performance - - Use these endpoints to get a time series view of your website's performance. # 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.cms.performance.configuration import Configuration - - -class PerformanceView(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 = { - "_403": "int", - "_404": "int", - "_500": "int", - "_504": "int", - "start_datetime": "str", - "response_time_ms": "int", - "_95th": "int", - "total_requests": "int", - "cache_hit_rate": "float", - "_99th": "int", - "total_request_time": "int", - "_100_x": "int", - "_50th": "int", - "cache_hits": "int", - "_20_x": "int", - "_30_x": "int", - "_40_x": "int", - "end_timestamp": "int", - "_50_x": "int", - "start_timestamp": "int", - "end_datetime": "str", - "avg_origin_response_time": "int", - } - - attribute_map = { - "_403": "403", - "_404": "404", - "_500": "500", - "_504": "504", - "start_datetime": "startDatetime", - "response_time_ms": "responseTimeMs", - "_95th": "95th", - "total_requests": "totalRequests", - "cache_hit_rate": "cacheHitRate", - "_99th": "99th", - "total_request_time": "totalRequestTime", - "_100_x": "100X", - "_50th": "50th", - "cache_hits": "cacheHits", - "_20_x": "20X", - "_30_x": "30X", - "_40_x": "40X", - "end_timestamp": "endTimestamp", - "_50_x": "50X", - "start_timestamp": "startTimestamp", - "end_datetime": "endDatetime", - "avg_origin_response_time": "avgOriginResponseTime", - } - - def __init__( - self, - _403=None, - _404=None, - _500=None, - _504=None, - start_datetime=None, - response_time_ms=None, - _95th=None, - total_requests=None, - cache_hit_rate=None, - _99th=None, - total_request_time=None, - _100_x=None, - _50th=None, - cache_hits=None, - _20_x=None, - _30_x=None, - _40_x=None, - end_timestamp=None, - _50_x=None, - start_timestamp=None, - end_datetime=None, - avg_origin_response_time=None, - local_vars_configuration=None, - ): # noqa: E501 - """PerformanceView - 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.__403 = None - self.__404 = None - self.__500 = None - self.__504 = None - self._start_datetime = None - self._response_time_ms = None - self.__95th = None - self._total_requests = None - self._cache_hit_rate = None - self.__99th = None - self._total_request_time = None - self.__100_x = None - self.__50th = None - self._cache_hits = None - self.__20_x = None - self.__30_x = None - self.__40_x = None - self._end_timestamp = None - self.__50_x = None - self._start_timestamp = None - self._end_datetime = None - self._avg_origin_response_time = None - self.discriminator = None - - self._403 = _403 - self._404 = _404 - self._500 = _500 - self._504 = _504 - if start_datetime is not None: - self.start_datetime = start_datetime - self.response_time_ms = response_time_ms - self._95th = _95th - self.total_requests = total_requests - self.cache_hit_rate = cache_hit_rate - self._99th = _99th - if total_request_time is not None: - self.total_request_time = total_request_time - self._100_x = _100_x - self._50th = _50th - self.cache_hits = cache_hits - self._20_x = _20_x - self._30_x = _30_x - self._40_x = _40_x - self.end_timestamp = end_timestamp - self._50_x = _50_x - self.start_timestamp = start_timestamp - if end_datetime is not None: - self.end_datetime = end_datetime - self.avg_origin_response_time = avg_origin_response_time - - @property - def _403(self): - """Gets the _403 of this PerformanceView. # noqa: E501 - - The number of responses that had an http status code of 403. # noqa: E501 - - :return: The _403 of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self.__403 - - @_403.setter - def _403(self, _403): - """Sets the _403 of this PerformanceView. - - The number of responses that had an http status code of 403. # noqa: E501 - - :param _403: The _403 of this PerformanceView. # noqa: E501 - :type _403: int - """ - if self.local_vars_configuration.client_side_validation and _403 is None: # noqa: E501 - raise ValueError("Invalid value for `_403`, must not be `None`") # noqa: E501 - - self.__403 = _403 - - @property - def _404(self): - """Gets the _404 of this PerformanceView. # noqa: E501 - - The number of responses that had an http status code of 404. # noqa: E501 - - :return: The _404 of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self.__404 - - @_404.setter - def _404(self, _404): - """Sets the _404 of this PerformanceView. - - The number of responses that had an http status code of 404. # noqa: E501 - - :param _404: The _404 of this PerformanceView. # noqa: E501 - :type _404: int - """ - if self.local_vars_configuration.client_side_validation and _404 is None: # noqa: E501 - raise ValueError("Invalid value for `_404`, must not be `None`") # noqa: E501 - - self.__404 = _404 - - @property - def _500(self): - """Gets the _500 of this PerformanceView. # noqa: E501 - - The number of responses that had an http status code of 500. # noqa: E501 - - :return: The _500 of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self.__500 - - @_500.setter - def _500(self, _500): - """Sets the _500 of this PerformanceView. - - The number of responses that had an http status code of 500. # noqa: E501 - - :param _500: The _500 of this PerformanceView. # noqa: E501 - :type _500: int - """ - if self.local_vars_configuration.client_side_validation and _500 is None: # noqa: E501 - raise ValueError("Invalid value for `_500`, must not be `None`") # noqa: E501 - - self.__500 = _500 - - @property - def _504(self): - """Gets the _504 of this PerformanceView. # noqa: E501 - - The number of responses that had an http status code of 504. # noqa: E501 - - :return: The _504 of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self.__504 - - @_504.setter - def _504(self, _504): - """Sets the _504 of this PerformanceView. - - The number of responses that had an http status code of 504. # noqa: E501 - - :param _504: The _504 of this PerformanceView. # noqa: E501 - :type _504: int - """ - if self.local_vars_configuration.client_side_validation and _504 is None: # noqa: E501 - raise ValueError("Invalid value for `_504`, must not be `None`") # noqa: E501 - - self.__504 = _504 - - @property - def start_datetime(self): - """Gets the start_datetime of this PerformanceView. # noqa: E501 - - - :return: The start_datetime of this PerformanceView. # noqa: E501 - :rtype: str - """ - return self._start_datetime - - @start_datetime.setter - def start_datetime(self, start_datetime): - """Sets the start_datetime of this PerformanceView. - - - :param start_datetime: The start_datetime of this PerformanceView. # noqa: E501 - :type start_datetime: str - """ - - self._start_datetime = start_datetime - - @property - def response_time_ms(self): - """Gets the response_time_ms of this PerformanceView. # noqa: E501 - - The average response time in milliseconds. # noqa: E501 - - :return: The response_time_ms of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self._response_time_ms - - @response_time_ms.setter - def response_time_ms(self, response_time_ms): - """Sets the response_time_ms of this PerformanceView. - - The average response time in milliseconds. # noqa: E501 - - :param response_time_ms: The response_time_ms of this PerformanceView. # noqa: E501 - :type response_time_ms: int - """ - if self.local_vars_configuration.client_side_validation and response_time_ms is None: # noqa: E501 - raise ValueError("Invalid value for `response_time_ms`, must not be `None`") # noqa: E501 - - self._response_time_ms = response_time_ms - - @property - def _95th(self): - """Gets the _95th of this PerformanceView. # noqa: E501 - - The 95th percentile response time. # noqa: E501 - - :return: The _95th of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self.__95th - - @_95th.setter - def _95th(self, _95th): - """Sets the _95th of this PerformanceView. - - The 95th percentile response time. # noqa: E501 - - :param _95th: The _95th of this PerformanceView. # noqa: E501 - :type _95th: int - """ - if self.local_vars_configuration.client_side_validation and _95th is None: # noqa: E501 - raise ValueError("Invalid value for `_95th`, must not be `None`") # noqa: E501 - - self.__95th = _95th - - @property - def total_requests(self): - """Gets the total_requests of this PerformanceView. # noqa: E501 - - The total number of requests received in this period. # noqa: E501 - - :return: The total_requests of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self._total_requests - - @total_requests.setter - def total_requests(self, total_requests): - """Sets the total_requests of this PerformanceView. - - The total number of requests received in this period. # noqa: E501 - - :param total_requests: The total_requests of this PerformanceView. # noqa: E501 - :type total_requests: int - """ - if self.local_vars_configuration.client_side_validation and total_requests is None: # noqa: E501 - raise ValueError("Invalid value for `total_requests`, must not be `None`") # noqa: E501 - - self._total_requests = total_requests - - @property - def cache_hit_rate(self): - """Gets the cache_hit_rate of this PerformanceView. # noqa: E501 - - The percentage of requests that were served cached responses. # noqa: E501 - - :return: The cache_hit_rate of this PerformanceView. # noqa: E501 - :rtype: float - """ - return self._cache_hit_rate - - @cache_hit_rate.setter - def cache_hit_rate(self, cache_hit_rate): - """Sets the cache_hit_rate of this PerformanceView. - - The percentage of requests that were served cached responses. # noqa: E501 - - :param cache_hit_rate: The cache_hit_rate of this PerformanceView. # noqa: E501 - :type cache_hit_rate: float - """ - if self.local_vars_configuration.client_side_validation and cache_hit_rate is None: # noqa: E501 - raise ValueError("Invalid value for `cache_hit_rate`, must not be `None`") # noqa: E501 - - self._cache_hit_rate = cache_hit_rate - - @property - def _99th(self): - """Gets the _99th of this PerformanceView. # noqa: E501 - - The 99th percentile response time. # noqa: E501 - - :return: The _99th of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self.__99th - - @_99th.setter - def _99th(self, _99th): - """Sets the _99th of this PerformanceView. - - The 99th percentile response time. # noqa: E501 - - :param _99th: The _99th of this PerformanceView. # noqa: E501 - :type _99th: int - """ - if self.local_vars_configuration.client_side_validation and _99th is None: # noqa: E501 - raise ValueError("Invalid value for `_99th`, must not be `None`") # noqa: E501 - - self.__99th = _99th - - @property - def total_request_time(self): - """Gets the total_request_time of this PerformanceView. # noqa: E501 - - - :return: The total_request_time of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self._total_request_time - - @total_request_time.setter - def total_request_time(self, total_request_time): - """Sets the total_request_time of this PerformanceView. - - - :param total_request_time: The total_request_time of this PerformanceView. # noqa: E501 - :type total_request_time: int - """ - - self._total_request_time = total_request_time - - @property - def _100_x(self): - """Gets the _100_x of this PerformanceView. # noqa: E501 - - The number of responses that had an http status code between 1000-1999. # noqa: E501 - - :return: The _100_x of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self.__100_x - - @_100_x.setter - def _100_x(self, _100_x): - """Sets the _100_x of this PerformanceView. - - The number of responses that had an http status code between 1000-1999. # noqa: E501 - - :param _100_x: The _100_x of this PerformanceView. # noqa: E501 - :type _100_x: int - """ - if self.local_vars_configuration.client_side_validation and _100_x is None: # noqa: E501 - raise ValueError("Invalid value for `_100_x`, must not be `None`") # noqa: E501 - - self.__100_x = _100_x - - @property - def _50th(self): - """Gets the _50th of this PerformanceView. # noqa: E501 - - The 50th percentile response time. # noqa: E501 - - :return: The _50th of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self.__50th - - @_50th.setter - def _50th(self, _50th): - """Sets the _50th of this PerformanceView. - - The 50th percentile response time. # noqa: E501 - - :param _50th: The _50th of this PerformanceView. # noqa: E501 - :type _50th: int - """ - if self.local_vars_configuration.client_side_validation and _50th is None: # noqa: E501 - raise ValueError("Invalid value for `_50th`, must not be `None`") # noqa: E501 - - self.__50th = _50th - - @property - def cache_hits(self): - """Gets the cache_hits of this PerformanceView. # noqa: E501 - - The total number of requests that were served cached responses. # noqa: E501 - - :return: The cache_hits of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self._cache_hits - - @cache_hits.setter - def cache_hits(self, cache_hits): - """Sets the cache_hits of this PerformanceView. - - The total number of requests that were served cached responses. # noqa: E501 - - :param cache_hits: The cache_hits of this PerformanceView. # noqa: E501 - :type cache_hits: int - """ - if self.local_vars_configuration.client_side_validation and cache_hits is None: # noqa: E501 - raise ValueError("Invalid value for `cache_hits`, must not be `None`") # noqa: E501 - - self._cache_hits = cache_hits - - @property - def _20_x(self): - """Gets the _20_x of this PerformanceView. # noqa: E501 - - The number of responses that had an http status code between 200-299. # noqa: E501 - - :return: The _20_x of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self.__20_x - - @_20_x.setter - def _20_x(self, _20_x): - """Sets the _20_x of this PerformanceView. - - The number of responses that had an http status code between 200-299. # noqa: E501 - - :param _20_x: The _20_x of this PerformanceView. # noqa: E501 - :type _20_x: int - """ - if self.local_vars_configuration.client_side_validation and _20_x is None: # noqa: E501 - raise ValueError("Invalid value for `_20_x`, must not be `None`") # noqa: E501 - - self.__20_x = _20_x - - @property - def _30_x(self): - """Gets the _30_x of this PerformanceView. # noqa: E501 - - The number of responses that had an http status code between 300-399. # noqa: E501 - - :return: The _30_x of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self.__30_x - - @_30_x.setter - def _30_x(self, _30_x): - """Sets the _30_x of this PerformanceView. - - The number of responses that had an http status code between 300-399. # noqa: E501 - - :param _30_x: The _30_x of this PerformanceView. # noqa: E501 - :type _30_x: int - """ - if self.local_vars_configuration.client_side_validation and _30_x is None: # noqa: E501 - raise ValueError("Invalid value for `_30_x`, must not be `None`") # noqa: E501 - - self.__30_x = _30_x - - @property - def _40_x(self): - """Gets the _40_x of this PerformanceView. # noqa: E501 - - The number of responses that had an http status code between 400-499. # noqa: E501 - - :return: The _40_x of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self.__40_x - - @_40_x.setter - def _40_x(self, _40_x): - """Sets the _40_x of this PerformanceView. - - The number of responses that had an http status code between 400-499. # noqa: E501 - - :param _40_x: The _40_x of this PerformanceView. # noqa: E501 - :type _40_x: int - """ - if self.local_vars_configuration.client_side_validation and _40_x is None: # noqa: E501 - raise ValueError("Invalid value for `_40_x`, must not be `None`") # noqa: E501 - - self.__40_x = _40_x - - @property - def end_timestamp(self): - """Gets the end_timestamp of this PerformanceView. # noqa: E501 - - The timestamp in milliseconds of the end of this interval. # noqa: E501 - - :return: The end_timestamp of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self._end_timestamp - - @end_timestamp.setter - def end_timestamp(self, end_timestamp): - """Sets the end_timestamp of this PerformanceView. - - The timestamp in milliseconds of the end of this interval. # noqa: E501 - - :param end_timestamp: The end_timestamp of this PerformanceView. # noqa: E501 - :type end_timestamp: int - """ - if self.local_vars_configuration.client_side_validation and end_timestamp is None: # noqa: E501 - raise ValueError("Invalid value for `end_timestamp`, must not be `None`") # noqa: E501 - - self._end_timestamp = end_timestamp - - @property - def _50_x(self): - """Gets the _50_x of this PerformanceView. # noqa: E501 - - The number of responses that had an http status code between 500-599. # noqa: E501 - - :return: The _50_x of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self.__50_x - - @_50_x.setter - def _50_x(self, _50_x): - """Sets the _50_x of this PerformanceView. - - The number of responses that had an http status code between 500-599. # noqa: E501 - - :param _50_x: The _50_x of this PerformanceView. # noqa: E501 - :type _50_x: int - """ - if self.local_vars_configuration.client_side_validation and _50_x is None: # noqa: E501 - raise ValueError("Invalid value for `_50_x`, must not be `None`") # noqa: E501 - - self.__50_x = _50_x - - @property - def start_timestamp(self): - """Gets the start_timestamp of this PerformanceView. # noqa: E501 - - The timestamp in milliseconds of the start of this interval. # noqa: E501 - - :return: The start_timestamp of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self._start_timestamp - - @start_timestamp.setter - def start_timestamp(self, start_timestamp): - """Sets the start_timestamp of this PerformanceView. - - The timestamp in milliseconds of the start of this interval. # noqa: E501 - - :param start_timestamp: The start_timestamp of this PerformanceView. # noqa: E501 - :type start_timestamp: int - """ - if self.local_vars_configuration.client_side_validation and start_timestamp is None: # noqa: E501 - raise ValueError("Invalid value for `start_timestamp`, must not be `None`") # noqa: E501 - - self._start_timestamp = start_timestamp - - @property - def end_datetime(self): - """Gets the end_datetime of this PerformanceView. # noqa: E501 - - - :return: The end_datetime of this PerformanceView. # noqa: E501 - :rtype: str - """ - return self._end_datetime - - @end_datetime.setter - def end_datetime(self, end_datetime): - """Sets the end_datetime of this PerformanceView. - - - :param end_datetime: The end_datetime of this PerformanceView. # noqa: E501 - :type end_datetime: str - """ - - self._end_datetime = end_datetime - - @property - def avg_origin_response_time(self): - """Gets the avg_origin_response_time of this PerformanceView. # noqa: E501 - - The average response time in milliseconds from the origin to the edge. # noqa: E501 - - :return: The avg_origin_response_time of this PerformanceView. # noqa: E501 - :rtype: int - """ - return self._avg_origin_response_time - - @avg_origin_response_time.setter - def avg_origin_response_time(self, avg_origin_response_time): - """Sets the avg_origin_response_time of this PerformanceView. - - The average response time in milliseconds from the origin to the edge. # noqa: E501 - - :param avg_origin_response_time: The avg_origin_response_time of this PerformanceView. # noqa: E501 - :type avg_origin_response_time: int - """ - if self.local_vars_configuration.client_side_validation and avg_origin_response_time is None: # noqa: E501 - raise ValueError("Invalid value for `avg_origin_response_time`, must not be `None`") # noqa: E501 - - self._avg_origin_response_time = avg_origin_response_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, PerformanceView): - 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, PerformanceView): - return True - - return self.to_dict() != other.to_dict() diff --git a/hubspot/cms/performance/models/public_performance_response.py b/hubspot/cms/performance/models/public_performance_response.py deleted file mode 100644 index 93c69fbf..00000000 --- a/hubspot/cms/performance/models/public_performance_response.py +++ /dev/null @@ -1,275 +0,0 @@ -# coding: utf-8 - -""" - CMS Performance - - Use these endpoints to get a time series view of your website's performance. # 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.cms.performance.configuration import Configuration - - -class PublicPerformanceResponse(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 = {"path": "str", "period": "str", "start_interval": "int", "data": "list[PerformanceView]", "domain": "str", "interval": "str", "end_interval": "int"} - - attribute_map = {"path": "path", "period": "period", "start_interval": "startInterval", "data": "data", "domain": "domain", "interval": "interval", "end_interval": "endInterval"} - - def __init__(self, path=None, period=None, start_interval=None, data=None, domain=None, interval=None, end_interval=None, local_vars_configuration=None): # noqa: E501 - """PublicPerformanceResponse - 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._path = None - self._period = None - self._start_interval = None - self._data = None - self._domain = None - self._interval = None - self._end_interval = None - self.discriminator = None - - if path is not None: - self.path = path - if period is not None: - self.period = period - self.start_interval = start_interval - self.data = data - if domain is not None: - self.domain = domain - self.interval = interval - self.end_interval = end_interval - - @property - def path(self): - """Gets the path of this PublicPerformanceResponse. # noqa: E501 - - - :return: The path of this PublicPerformanceResponse. # noqa: E501 - :rtype: str - """ - return self._path - - @path.setter - def path(self, path): - """Sets the path of this PublicPerformanceResponse. - - - :param path: The path of this PublicPerformanceResponse. # noqa: E501 - :type path: str - """ - - self._path = path - - @property - def period(self): - """Gets the period of this PublicPerformanceResponse. # noqa: E501 - - - :return: The period of this PublicPerformanceResponse. # noqa: E501 - :rtype: str - """ - return self._period - - @period.setter - def period(self, period): - """Sets the period of this PublicPerformanceResponse. - - - :param period: The period of this PublicPerformanceResponse. # noqa: E501 - :type period: str - """ - allowed_values = ["ONE_MINUTE", "FIVE_MINUTES", "TEN_MINUTES", "FIFTEEN_MINUTES", "THIRTY_MINUTES", "ONE_HOUR", "FOUR_HOURS", "TWELVE_HOURS", "ONE_DAY", "ONE_WEEK"] # 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 start_interval(self): - """Gets the start_interval of this PublicPerformanceResponse. # noqa: E501 - - - :return: The start_interval of this PublicPerformanceResponse. # noqa: E501 - :rtype: int - """ - return self._start_interval - - @start_interval.setter - def start_interval(self, start_interval): - """Sets the start_interval of this PublicPerformanceResponse. - - - :param start_interval: The start_interval of this PublicPerformanceResponse. # noqa: E501 - :type start_interval: int - """ - if self.local_vars_configuration.client_side_validation and start_interval is None: # noqa: E501 - raise ValueError("Invalid value for `start_interval`, must not be `None`") # noqa: E501 - - self._start_interval = start_interval - - @property - def data(self): - """Gets the data of this PublicPerformanceResponse. # noqa: E501 - - - :return: The data of this PublicPerformanceResponse. # noqa: E501 - :rtype: list[PerformanceView] - """ - return self._data - - @data.setter - def data(self, data): - """Sets the data of this PublicPerformanceResponse. - - - :param data: The data of this PublicPerformanceResponse. # noqa: E501 - :type data: list[PerformanceView] - """ - if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 - - self._data = data - - @property - def domain(self): - """Gets the domain of this PublicPerformanceResponse. # noqa: E501 - - - :return: The domain of this PublicPerformanceResponse. # noqa: E501 - :rtype: str - """ - return self._domain - - @domain.setter - def domain(self, domain): - """Sets the domain of this PublicPerformanceResponse. - - - :param domain: The domain of this PublicPerformanceResponse. # noqa: E501 - :type domain: str - """ - - self._domain = domain - - @property - def interval(self): - """Gets the interval of this PublicPerformanceResponse. # noqa: E501 - - - :return: The interval of this PublicPerformanceResponse. # noqa: E501 - :rtype: str - """ - return self._interval - - @interval.setter - def interval(self, interval): - """Sets the interval of this PublicPerformanceResponse. - - - :param interval: The interval of this PublicPerformanceResponse. # noqa: E501 - :type interval: str - """ - if self.local_vars_configuration.client_side_validation and interval is None: # noqa: E501 - raise ValueError("Invalid value for `interval`, must not be `None`") # noqa: E501 - allowed_values = ["ONE_MINUTE", "FIVE_MINUTES", "TEN_MINUTES", "FIFTEEN_MINUTES", "THIRTY_MINUTES", "ONE_HOUR", "FOUR_HOURS", "TWELVE_HOURS", "ONE_DAY", "ONE_WEEK"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and interval not in allowed_values: # noqa: E501 - raise ValueError("Invalid value for `interval` ({0}), must be one of {1}".format(interval, allowed_values)) # noqa: E501 - - self._interval = interval - - @property - def end_interval(self): - """Gets the end_interval of this PublicPerformanceResponse. # noqa: E501 - - - :return: The end_interval of this PublicPerformanceResponse. # noqa: E501 - :rtype: int - """ - return self._end_interval - - @end_interval.setter - def end_interval(self, end_interval): - """Sets the end_interval of this PublicPerformanceResponse. - - - :param end_interval: The end_interval of this PublicPerformanceResponse. # noqa: E501 - :type end_interval: int - """ - if self.local_vars_configuration.client_side_validation and end_interval is None: # noqa: E501 - raise ValueError("Invalid value for `end_interval`, must not be `None`") # noqa: E501 - - self._end_interval = end_interval - - 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, PublicPerformanceResponse): - 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, PublicPerformanceResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/hubspot/cms/performance/rest.py b/hubspot/cms/performance/rest.py deleted file mode 100644 index f04ccba2..00000000 --- a/hubspot/cms/performance/rest.py +++ /dev/null @@ -1,213 +0,0 @@ -# coding: utf-8 - -""" - CMS Performance - - Use these endpoints to get a time series view of your website's performance. # 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.cms.performance.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) diff --git a/hubspot/crm/objects/goals/__init__.py b/hubspot/crm/objects/goals/__init__.py index aa8040e5..ab9229bb 100644 --- a/hubspot/crm/objects/goals/__init__.py +++ b/hubspot/crm/objects/goals/__init__.py @@ -33,9 +33,16 @@ # import models into sdk package from hubspot.crm.objects.goals.models.associated_id import AssociatedId +from hubspot.crm.objects.goals.models.association_spec import AssociationSpec +from hubspot.crm.objects.goals.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.goals.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate +from hubspot.crm.objects.goals.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert +from hubspot.crm.objects.goals.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId from hubspot.crm.objects.goals.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.goals.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.goals.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors +from hubspot.crm.objects.goals.models.batch_response_simple_public_upsert_object import BatchResponseSimplePublicUpsertObject +from hubspot.crm.objects.goals.models.batch_response_simple_public_upsert_object_with_errors import BatchResponseSimplePublicUpsertObjectWithErrors from hubspot.crm.objects.goals.models.collection_response_associated_id import CollectionResponseAssociatedId from hubspot.crm.objects.goals.models.collection_response_simple_public_object_with_associations_forward_paging import CollectionResponseSimplePublicObjectWithAssociationsForwardPaging from hubspot.crm.objects.goals.models.collection_response_with_total_simple_public_object_forward_paging import CollectionResponseWithTotalSimplePublicObjectForwardPaging @@ -47,9 +54,17 @@ from hubspot.crm.objects.goals.models.next_page import NextPage from hubspot.crm.objects.goals.models.paging import Paging from hubspot.crm.objects.goals.models.previous_page import PreviousPage +from hubspot.crm.objects.goals.models.public_associations_for_object import PublicAssociationsForObject +from hubspot.crm.objects.goals.models.public_object_id import PublicObjectId from hubspot.crm.objects.goals.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.goals.models.simple_public_object import SimplePublicObject +from hubspot.crm.objects.goals.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.goals.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate +from hubspot.crm.objects.goals.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.goals.models.simple_public_object_id import SimplePublicObjectId +from hubspot.crm.objects.goals.models.simple_public_object_input import SimplePublicObjectInput +from hubspot.crm.objects.goals.models.simple_public_object_input_for_create import SimplePublicObjectInputForCreate from hubspot.crm.objects.goals.models.simple_public_object_with_associations import SimplePublicObjectWithAssociations +from hubspot.crm.objects.goals.models.simple_public_upsert_object import SimplePublicUpsertObject from hubspot.crm.objects.goals.models.standard_error import StandardError from hubspot.crm.objects.goals.models.value_with_timestamp import ValueWithTimestamp diff --git a/hubspot/crm/objects/goals/api/basic_api.py b/hubspot/crm/objects/goals/api/basic_api.py index cd2adac4..4763d7f8 100644 --- a/hubspot/crm/objects/goals/api/basic_api.py +++ b/hubspot/crm/objects/goals/api/basic_api.py @@ -33,6 +33,255 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client + def archive(self, goal_target_id, **kwargs): # noqa: E501 + """Archive # noqa: E501 + + Move an Object identified by `{goalTargetId}` 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(goal_target_id, async_req=True) + >>> result = thread.get() + + :param goal_target_id: (required) + :type goal_target_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(goal_target_id, **kwargs) # noqa: E501 + + def archive_with_http_info(self, goal_target_id, **kwargs): # noqa: E501 + """Archive # noqa: E501 + + Move an Object identified by `{goalTargetId}` 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(goal_target_id, async_req=True) + >>> result = thread.get() + + :param goal_target_id: (required) + :type goal_target_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 = ["goal_target_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 'goal_target_id' is set + if self.api_client.client_side_validation and local_var_params.get("goal_target_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `goal_target_id` when calling `archive`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if "goal_target_id" in local_var_params: + path_params["goalTargetId"] = local_var_params["goal_target_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/goal_targets/{goalTargetId}", + "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 goal target with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard goal targets 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 goal target with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard goal targets 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/goal_targets", + "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, goal_target_id, **kwargs): # noqa: E501 """Read # noqa: E501 @@ -341,3 +590,146 @@ 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, goal_target_id, simple_public_object_input, **kwargs): # noqa: E501 + """Update # noqa: E501 + + Perform a partial update of an Object identified by `{goalTargetId}`or optionally a unique property value as specified by the `idProperty` query param. `{goalTargetId}` 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(goal_target_id, simple_public_object_input, async_req=True) + >>> result = thread.get() + + :param goal_target_id: (required) + :type goal_target_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(goal_target_id, simple_public_object_input, **kwargs) # noqa: E501 + + def update_with_http_info(self, goal_target_id, simple_public_object_input, **kwargs): # noqa: E501 + """Update # noqa: E501 + + Perform a partial update of an Object identified by `{goalTargetId}`or optionally a unique property value as specified by the `idProperty` query param. `{goalTargetId}` 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(goal_target_id, simple_public_object_input, async_req=True) + >>> result = thread.get() + + :param goal_target_id: (required) + :type goal_target_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 = ["goal_target_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 'goal_target_id' is set + if self.api_client.client_side_validation and local_var_params.get("goal_target_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `goal_target_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 "goal_target_id" in local_var_params: + path_params["goalTargetId"] = local_var_params["goal_target_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/goal_targets/{goalTargetId}", + "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/goals/api/batch_api.py b/hubspot/crm/objects/goals/api/batch_api.py index 6f25340e..1d5c3d0a 100644 --- a/hubspot/crm/objects/goals/api/batch_api.py +++ b/hubspot/crm/objects/goals/api/batch_api.py @@ -33,9 +33,261 @@ 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 goal targets 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 goal targets 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/goal_targets/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 goal targets # 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 goal targets # 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/goal_targets/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 goal targets 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 @@ -67,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 goal targets 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 @@ -165,3 +418,259 @@ 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 goal targets 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 goal targets 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/goal_targets/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 goal targets 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 goal targets 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/goal_targets/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/goals/models/__init__.py b/hubspot/crm/objects/goals/models/__init__.py index 3c1fbea0..a143a52f 100644 --- a/hubspot/crm/objects/goals/models/__init__.py +++ b/hubspot/crm/objects/goals/models/__init__.py @@ -15,9 +15,16 @@ # import models into model package from hubspot.crm.objects.goals.models.associated_id import AssociatedId +from hubspot.crm.objects.goals.models.association_spec import AssociationSpec +from hubspot.crm.objects.goals.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.objects.goals.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate +from hubspot.crm.objects.goals.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert +from hubspot.crm.objects.goals.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId from hubspot.crm.objects.goals.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.objects.goals.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.objects.goals.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors +from hubspot.crm.objects.goals.models.batch_response_simple_public_upsert_object import BatchResponseSimplePublicUpsertObject +from hubspot.crm.objects.goals.models.batch_response_simple_public_upsert_object_with_errors import BatchResponseSimplePublicUpsertObjectWithErrors from hubspot.crm.objects.goals.models.collection_response_associated_id import CollectionResponseAssociatedId from hubspot.crm.objects.goals.models.collection_response_simple_public_object_with_associations_forward_paging import CollectionResponseSimplePublicObjectWithAssociationsForwardPaging from hubspot.crm.objects.goals.models.collection_response_with_total_simple_public_object_forward_paging import CollectionResponseWithTotalSimplePublicObjectForwardPaging @@ -29,9 +36,17 @@ from hubspot.crm.objects.goals.models.next_page import NextPage from hubspot.crm.objects.goals.models.paging import Paging from hubspot.crm.objects.goals.models.previous_page import PreviousPage +from hubspot.crm.objects.goals.models.public_associations_for_object import PublicAssociationsForObject +from hubspot.crm.objects.goals.models.public_object_id import PublicObjectId from hubspot.crm.objects.goals.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.objects.goals.models.simple_public_object import SimplePublicObject +from hubspot.crm.objects.goals.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.objects.goals.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate +from hubspot.crm.objects.goals.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.objects.goals.models.simple_public_object_id import SimplePublicObjectId +from hubspot.crm.objects.goals.models.simple_public_object_input import SimplePublicObjectInput +from hubspot.crm.objects.goals.models.simple_public_object_input_for_create import SimplePublicObjectInputForCreate from hubspot.crm.objects.goals.models.simple_public_object_with_associations import SimplePublicObjectWithAssociations +from hubspot.crm.objects.goals.models.simple_public_upsert_object import SimplePublicUpsertObject from hubspot.crm.objects.goals.models.standard_error import StandardError from hubspot.crm.objects.goals.models.value_with_timestamp import ValueWithTimestamp diff --git a/hubspot/crm/objects/goals/models/association_spec.py b/hubspot/crm/objects/goals/models/association_spec.py new file mode 100644 index 00000000..f5be9310 --- /dev/null +++ b/hubspot/crm/objects/goals/models/association_spec.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Goal Targets + + 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.goals.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/goals/models/batch_input_simple_public_object_batch_input.py b/hubspot/crm/objects/goals/models/batch_input_simple_public_object_batch_input.py new file mode 100644 index 00000000..d1d90a99 --- /dev/null +++ b/hubspot/crm/objects/goals/models/batch_input_simple_public_object_batch_input.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Goal Targets + + 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.goals.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/goals/models/batch_input_simple_public_object_batch_input_for_create.py b/hubspot/crm/objects/goals/models/batch_input_simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..edd91864 --- /dev/null +++ b/hubspot/crm/objects/goals/models/batch_input_simple_public_object_batch_input_for_create.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Goal Targets + + 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.goals.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/objects/goals/models/batch_input_simple_public_object_batch_input_upsert.py b/hubspot/crm/objects/goals/models/batch_input_simple_public_object_batch_input_upsert.py new file mode 100644 index 00000000..4fd848e7 --- /dev/null +++ b/hubspot/crm/objects/goals/models/batch_input_simple_public_object_batch_input_upsert.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Goal Targets + + 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.goals.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/tickets/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/objects/goals/models/batch_input_simple_public_object_id.py similarity index 82% rename from hubspot/crm/tickets/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/objects/goals/models/batch_input_simple_public_object_id.py index f1979e10..f1d040e3 100644 --- a/hubspot/crm/tickets/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/objects/goals/models/batch_input_simple_public_object_id.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Tickets + Goal Targets No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 @@ -18,10 +18,10 @@ import re # noqa: F401 import six -from hubspot.crm.tickets.configuration import Configuration +from hubspot.crm.objects.goals.configuration import Configuration -class BatchInputSimplePublicObjectInputForCreate(object): +class BatchInputSimplePublicObjectId(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[SimplePublicObjectId]"} attribute_map = {"inputs": "inputs"} def __init__(self, inputs=None, local_vars_configuration=None): # noqa: E501 - """BatchInputSimplePublicObjectInputForCreate - a model defined in OpenAPI""" # 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 @@ -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 BatchInputSimplePublicObjectId. # noqa: E501 - :return: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :rtype: list[SimplePublicObjectInputForCreate] + :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 BatchInputSimplePublicObjectInputForCreate. + """Sets the inputs of this BatchInputSimplePublicObjectId. - :param inputs: The inputs of this BatchInputSimplePublicObjectInputForCreate. # noqa: E501 - :type inputs: list[SimplePublicObjectInputForCreate] + :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 @@ -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, 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, BatchInputSimplePublicObjectInputForCreate): + if not isinstance(other, BatchInputSimplePublicObjectId): return True return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/goals/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/objects/goals/models/batch_read_input_simple_public_object_id.py index 0f4c4f5a..9f9b9719 100644 --- a/hubspot/crm/objects/goals/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/objects/goals/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/goals/models/batch_response_simple_public_upsert_object.py b/hubspot/crm/objects/goals/models/batch_response_simple_public_upsert_object.py new file mode 100644 index 00000000..506e70c1 --- /dev/null +++ b/hubspot/crm/objects/goals/models/batch_response_simple_public_upsert_object.py @@ -0,0 +1,248 @@ +# coding: utf-8 + +""" + Goal Targets + + 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.goals.configuration import Configuration + + +class BatchResponseSimplePublicUpsertObject(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"completed_at": "datetime", "requested_at": "datetime", "started_at": "datetime", "links": "dict[str, str]", "results": "list[SimplePublicUpsertObject]", "status": "str"} + + attribute_map = {"completed_at": "completedAt", "requested_at": "requestedAt", "started_at": "startedAt", "links": "links", "results": "results", "status": "status"} + + def __init__(self, completed_at=None, requested_at=None, started_at=None, links=None, results=None, status=None, local_vars_configuration=None): # noqa: E501 + """BatchResponseSimplePublicUpsertObject - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._completed_at = None + self._requested_at = None + self._started_at = None + self._links = None + self._results = None + self._status = None + self.discriminator = None + + self.completed_at = completed_at + if requested_at is not None: + self.requested_at = requested_at + self.started_at = started_at + if links is not None: + self.links = links + self.results = results + self.status = status + + @property + def completed_at(self): + """Gets the completed_at of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + + + :return: The completed_at of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :rtype: datetime + """ + return self._completed_at + + @completed_at.setter + def completed_at(self, completed_at): + """Sets the completed_at of this BatchResponseSimplePublicUpsertObject. + + + :param completed_at: The completed_at of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :type completed_at: datetime + """ + if self.local_vars_configuration.client_side_validation and completed_at is None: # noqa: E501 + raise ValueError("Invalid value for `completed_at`, must not be `None`") # noqa: E501 + + self._completed_at = completed_at + + @property + def requested_at(self): + """Gets the requested_at of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + + + :return: The requested_at of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :rtype: datetime + """ + return self._requested_at + + @requested_at.setter + def requested_at(self, requested_at): + """Sets the requested_at of this BatchResponseSimplePublicUpsertObject. + + + :param requested_at: The requested_at of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :type requested_at: datetime + """ + + self._requested_at = requested_at + + @property + def started_at(self): + """Gets the started_at of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + + + :return: The started_at of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this BatchResponseSimplePublicUpsertObject. + + + :param started_at: The started_at of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :type started_at: datetime + """ + if self.local_vars_configuration.client_side_validation and started_at is None: # noqa: E501 + raise ValueError("Invalid value for `started_at`, must not be `None`") # noqa: E501 + + self._started_at = started_at + + @property + def links(self): + """Gets the links of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + + + :return: The links of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this BatchResponseSimplePublicUpsertObject. + + + :param links: The links of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def results(self): + """Gets the results of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + + + :return: The results of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :rtype: list[SimplePublicUpsertObject] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this BatchResponseSimplePublicUpsertObject. + + + :param results: The results of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :type results: list[SimplePublicUpsertObject] + """ + if self.local_vars_configuration.client_side_validation and results is None: # noqa: E501 + raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 + + self._results = results + + @property + def status(self): + """Gets the status of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + + + :return: The status of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this BatchResponseSimplePublicUpsertObject. + + + :param status: The status of this BatchResponseSimplePublicUpsertObject. # noqa: E501 + :type status: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = ["PENDING", "PROCESSING", "CANCELED", "COMPLETE"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `status` ({0}), must be one of {1}".format(status, allowed_values)) # noqa: E501 + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchResponseSimplePublicUpsertObject): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BatchResponseSimplePublicUpsertObject): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/goals/models/batch_response_simple_public_upsert_object_with_errors.py b/hubspot/crm/objects/goals/models/batch_response_simple_public_upsert_object_with_errors.py new file mode 100644 index 00000000..c7631a1c --- /dev/null +++ b/hubspot/crm/objects/goals/models/batch_response_simple_public_upsert_object_with_errors.py @@ -0,0 +1,314 @@ +# coding: utf-8 + +""" + Goal Targets + + 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.goals.configuration import Configuration + + +class BatchResponseSimplePublicUpsertObjectWithErrors(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + "completed_at": "datetime", + "num_errors": "int", + "requested_at": "datetime", + "started_at": "datetime", + "links": "dict[str, str]", + "results": "list[SimplePublicUpsertObject]", + "errors": "list[StandardError]", + "status": "str", + } + + attribute_map = { + "completed_at": "completedAt", + "num_errors": "numErrors", + "requested_at": "requestedAt", + "started_at": "startedAt", + "links": "links", + "results": "results", + "errors": "errors", + "status": "status", + } + + def __init__(self, completed_at=None, num_errors=None, requested_at=None, started_at=None, links=None, results=None, errors=None, status=None, local_vars_configuration=None): # noqa: E501 + """BatchResponseSimplePublicUpsertObjectWithErrors - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._completed_at = None + self._num_errors = None + self._requested_at = None + self._started_at = None + self._links = None + self._results = None + self._errors = None + self._status = None + self.discriminator = None + + self.completed_at = completed_at + if num_errors is not None: + self.num_errors = num_errors + if requested_at is not None: + self.requested_at = requested_at + self.started_at = started_at + if links is not None: + self.links = links + self.results = results + if errors is not None: + self.errors = errors + self.status = status + + @property + def completed_at(self): + """Gets the completed_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The completed_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._completed_at + + @completed_at.setter + def completed_at(self, completed_at): + """Sets the completed_at of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param completed_at: The completed_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :type completed_at: datetime + """ + if self.local_vars_configuration.client_side_validation and completed_at is None: # noqa: E501 + raise ValueError("Invalid value for `completed_at`, must not be `None`") # noqa: E501 + + self._completed_at = completed_at + + @property + def num_errors(self): + """Gets the num_errors of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The num_errors of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: int + """ + return self._num_errors + + @num_errors.setter + def num_errors(self, num_errors): + """Sets the num_errors of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param num_errors: The num_errors of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :type num_errors: int + """ + + self._num_errors = num_errors + + @property + def requested_at(self): + """Gets the requested_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The requested_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._requested_at + + @requested_at.setter + def requested_at(self, requested_at): + """Sets the requested_at of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param requested_at: The requested_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :type requested_at: datetime + """ + + self._requested_at = requested_at + + @property + def started_at(self): + """Gets the started_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The started_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param started_at: The started_at of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :type started_at: datetime + """ + if self.local_vars_configuration.client_side_validation and started_at is None: # noqa: E501 + raise ValueError("Invalid value for `started_at`, must not be `None`") # noqa: E501 + + self._started_at = started_at + + @property + def links(self): + """Gets the links of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The links of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: dict[str, str] + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param links: The links of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :type links: dict[str, str] + """ + + self._links = links + + @property + def results(self): + """Gets the results of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The results of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: list[SimplePublicUpsertObject] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param results: The results of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :type results: list[SimplePublicUpsertObject] + """ + if self.local_vars_configuration.client_side_validation and results is None: # noqa: E501 + raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 + + self._results = results + + @property + def errors(self): + """Gets the errors of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The errors of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: list[StandardError] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param errors: The errors of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :type errors: list[StandardError] + """ + + self._errors = errors + + @property + def status(self): + """Gets the status of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + + + :return: The status of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this BatchResponseSimplePublicUpsertObjectWithErrors. + + + :param status: The status of this BatchResponseSimplePublicUpsertObjectWithErrors. # noqa: E501 + :type status: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = ["PENDING", "PROCESSING", "CANCELED", "COMPLETE"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 + raise ValueError("Invalid value for `status` ({0}), must be one of {1}".format(status, allowed_values)) # noqa: E501 + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items())) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchResponseSimplePublicUpsertObjectWithErrors): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BatchResponseSimplePublicUpsertObjectWithErrors): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/crm/objects/goals/models/public_associations_for_object.py b/hubspot/crm/objects/goals/models/public_associations_for_object.py new file mode 100644 index 00000000..73df3f7a --- /dev/null +++ b/hubspot/crm/objects/goals/models/public_associations_for_object.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Goal Targets + + 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.goals.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/goals/models/public_object_id.py b/hubspot/crm/objects/goals/models/public_object_id.py new file mode 100644 index 00000000..dafb8287 --- /dev/null +++ b/hubspot/crm/objects/goals/models/public_object_id.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Goal Targets + + 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.goals.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/goals/models/simple_public_object.py b/hubspot/crm/objects/goals/models/simple_public_object.py index 7d31ed97..b670b657 100644 --- a/hubspot/crm/objects/goals/models/simple_public_object.py +++ b/hubspot/crm/objects/goals/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/goals/models/simple_public_object_batch_input.py b/hubspot/crm/objects/goals/models/simple_public_object_batch_input.py new file mode 100644 index 00000000..27d954c7 --- /dev/null +++ b/hubspot/crm/objects/goals/models/simple_public_object_batch_input.py @@ -0,0 +1,199 @@ +# coding: utf-8 + +""" + Goal Targets + + 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.goals.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/objects/goals/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/objects/goals/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..1937e056 --- /dev/null +++ b/hubspot/crm/objects/goals/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Goal Targets + + 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.goals.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/goals/models/simple_public_object_batch_input_upsert.py b/hubspot/crm/objects/goals/models/simple_public_object_batch_input_upsert.py new file mode 100644 index 00000000..7df230fb --- /dev/null +++ b/hubspot/crm/objects/goals/models/simple_public_object_batch_input_upsert.py @@ -0,0 +1,197 @@ +# coding: utf-8 + +""" + Goal Targets + + 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.goals.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/objects/goals/models/simple_public_object_input.py b/hubspot/crm/objects/goals/models/simple_public_object_input.py new file mode 100644 index 00000000..675673c3 --- /dev/null +++ b/hubspot/crm/objects/goals/models/simple_public_object_input.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Goal Targets + + 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.goals.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/goals/models/simple_public_object_input_for_create.py b/hubspot/crm/objects/goals/models/simple_public_object_input_for_create.py new file mode 100644 index 00000000..a3bd29f5 --- /dev/null +++ b/hubspot/crm/objects/goals/models/simple_public_object_input_for_create.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Goal Targets + + 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.goals.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/objects/goals/models/simple_public_object_with_associations.py b/hubspot/crm/objects/goals/models/simple_public_object_with_associations.py index 47315df8..5c6d53cc 100644 --- a/hubspot/crm/objects/goals/models/simple_public_object_with_associations.py +++ b/hubspot/crm/objects/goals/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/goals/models/simple_public_upsert_object.py b/hubspot/crm/objects/goals/models/simple_public_upsert_object.py new file mode 100644 index 00000000..8ca6384f --- /dev/null +++ b/hubspot/crm/objects/goals/models/simple_public_upsert_object.py @@ -0,0 +1,350 @@ +# coding: utf-8 + +""" + Goal Targets + + 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.goals.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/products/__init__.py b/hubspot/crm/products/__init__.py index a664b25e..5071bdb1 100644 --- a/hubspot/crm/products/__init__.py +++ b/hubspot/crm/products/__init__.py @@ -35,9 +35,9 @@ from hubspot.crm.products.models.associated_id import AssociatedId from hubspot.crm.products.models.association_spec import AssociationSpec from hubspot.crm.products.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.products.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.products.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.products.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.products.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.products.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.products.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.products.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -59,6 +59,7 @@ from hubspot.crm.products.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.products.models.simple_public_object import SimplePublicObject from hubspot.crm.products.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.products.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.products.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.products.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.products.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/products/api/basic_api.py b/hubspot/crm/products/api/basic_api.py index 275a42bd..f75ba95e 100644 --- a/hubspot/crm/products/api/basic_api.py +++ b/hubspot/crm/products/api/basic_api.py @@ -594,7 +594,7 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501 def update(self, product_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{productId}`. `{productId}` 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 result in an error. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{productId}`or optionally a unique property value as specified by the `idProperty` query param. `{productId}` 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, product_id, simple_public_object_input, **kwargs): # noqa: E50 :type product_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. + :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, product_id, simple_public_object_input, **kwargs): # noqa: E50 def update_with_http_info(self, product_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 - Perform a partial update of an Object identified by `{productId}`. `{productId}` 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 result in an error. Properties values can be cleared by passing an empty string. # noqa: E501 + Perform a partial update of an Object identified by `{productId}`or optionally a unique property value as specified by the `idProperty` query param. `{productId}` 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, product_id, simple_public_object_input, **kwargs :type product_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. + :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/products/api/batch_api.py b/hubspot/crm/products/api/batch_api.py index 9c705074..3e2f7acf 100644 --- a/hubspot/crm/products/api/batch_api.py +++ b/hubspot/crm/products/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 products # 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 products # 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 products 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 products 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/products/models/__init__.py b/hubspot/crm/products/models/__init__.py index 8e10f41b..7ab6de61 100644 --- a/hubspot/crm/products/models/__init__.py +++ b/hubspot/crm/products/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.products.models.associated_id import AssociatedId from hubspot.crm.products.models.association_spec import AssociationSpec from hubspot.crm.products.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.products.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.products.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.products.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.products.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.products.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.products.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.products.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -41,6 +41,7 @@ from hubspot.crm.products.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.products.models.simple_public_object import SimplePublicObject from hubspot.crm.products.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.products.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.products.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.products.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.products.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/products/models/batch_input_simple_public_object_input_for_create.py b/hubspot/crm/products/models/batch_input_simple_public_object_batch_input_for_create.py similarity index 80% rename from hubspot/crm/products/models/batch_input_simple_public_object_input_for_create.py rename to hubspot/crm/products/models/batch_input_simple_public_object_batch_input_for_create.py index 5b4e8638..0cb1df1c 100644 --- a/hubspot/crm/products/models/batch_input_simple_public_object_input_for_create.py +++ b/hubspot/crm/products/models/batch_input_simple_public_object_batch_input_for_create.py @@ -21,7 +21,7 @@ from hubspot.crm.products.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/products/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/products/models/batch_read_input_simple_public_object_id.py index 79dfd82e..2ba18e8b 100644 --- a/hubspot/crm/products/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/products/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/products/models/simple_public_object.py b/hubspot/crm/products/models/simple_public_object.py index 0ba1aa4e..6c262571 100644 --- a/hubspot/crm/products/models/simple_public_object.py +++ b/hubspot/crm/products/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/products/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/products/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..b156d812 --- /dev/null +++ b/hubspot/crm/products/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Products + + 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.products.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/products/models/simple_public_object_input.py b/hubspot/crm/products/models/simple_public_object_input.py index 360679bd..eb0df3b0 100644 --- a/hubspot/crm/products/models/simple_public_object_input.py +++ b/hubspot/crm/products/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/products/models/simple_public_object_input_for_create.py b/hubspot/crm/products/models/simple_public_object_input_for_create.py index efaf9dca..420c2f83 100644 --- a/hubspot/crm/products/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/products/models/simple_public_object_input_for_create.py @@ -35,27 +35,23 @@ 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 - if properties is not None: - self.properties = properties + self.properties = properties @property def associations(self): @@ -78,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 @@ -117,6 +92,8 @@ def properties(self, properties): :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 diff --git a/hubspot/crm/products/models/simple_public_object_with_associations.py b/hubspot/crm/products/models/simple_public_object_with_associations.py index a9b4c8f1..83ba66c5 100644 --- a/hubspot/crm/products/models/simple_public_object_with_associations.py +++ b/hubspot/crm/products/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/products/models/simple_public_upsert_object.py b/hubspot/crm/products/models/simple_public_upsert_object.py index 05ad7b4b..a5f1d758 100644 --- a/hubspot/crm/products/models/simple_public_upsert_object.py +++ b/hubspot/crm/products/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 diff --git a/hubspot/crm/tickets/__init__.py b/hubspot/crm/tickets/__init__.py index a2b6d134..1b9f0279 100644 --- a/hubspot/crm/tickets/__init__.py +++ b/hubspot/crm/tickets/__init__.py @@ -19,7 +19,6 @@ # import apis into sdk package from hubspot.crm.tickets.api.basic_api import BasicApi from hubspot.crm.tickets.api.batch_api import BatchApi -from hubspot.crm.tickets.api.merge_api import MergeApi from hubspot.crm.tickets.api.search_api import SearchApi # import ApiClient @@ -36,9 +35,9 @@ from hubspot.crm.tickets.models.associated_id import AssociatedId from hubspot.crm.tickets.models.association_spec import AssociationSpec from hubspot.crm.tickets.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.tickets.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.tickets.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.tickets.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.tickets.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.tickets.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.tickets.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.tickets.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -61,6 +60,7 @@ from hubspot.crm.tickets.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.tickets.models.simple_public_object import SimplePublicObject from hubspot.crm.tickets.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.tickets.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.tickets.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.tickets.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.tickets.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/tickets/api/__init__.py b/hubspot/crm/tickets/api/__init__.py index ff45fd70..eb68c83e 100644 --- a/hubspot/crm/tickets/api/__init__.py +++ b/hubspot/crm/tickets/api/__init__.py @@ -5,5 +5,4 @@ # import apis into api package from hubspot.crm.tickets.api.basic_api import BasicApi from hubspot.crm.tickets.api.batch_api import BatchApi -from hubspot.crm.tickets.api.merge_api import MergeApi from hubspot.crm.tickets.api.search_api import SearchApi diff --git a/hubspot/crm/tickets/api/basic_api.py b/hubspot/crm/tickets/api/basic_api.py index 4873a14d..dc959919 100644 --- a/hubspot/crm/tickets/api/basic_api.py +++ b/hubspot/crm/tickets/api/basic_api.py @@ -43,7 +43,7 @@ def archive(self, ticket_id, **kwargs): # noqa: E501 >>> thread = api.archive(ticket_id, async_req=True) >>> result = thread.get() - :param ticket_id: (required) + :param ticket_id: The ID of the ticket to delete. (required) :type ticket_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, ticket_id, **kwargs): # noqa: E501 >>> thread = api.archive_with_http_info(ticket_id, async_req=True) >>> result = thread.get() - :param ticket_id: (required) + :param ticket_id: The ID of the ticket to delete. (required) :type ticket_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, ticket_id, **kwargs): # noqa: E501 >>> thread = api.get_by_id(ticket_id, async_req=True) >>> result = thread.get() - :param ticket_id: (required) + :param ticket_id: The ID of the ticket. (required) :type ticket_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, ticket_id, **kwargs): # noqa: E501 >>> thread = api.get_by_id_with_http_info(ticket_id, async_req=True) >>> result = thread.get() - :param ticket_id: (required) + :param ticket_id: The ID of the ticket. (required) :type ticket_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] @@ -591,6 +591,134 @@ 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 tickets # noqa: E501 + + Merge two tickets, combining them into one ticket record. # 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 tickets # noqa: E501 + + Merge two tickets, combining them into one ticket record. # 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/tickets/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, ticket_id, simple_public_object_input, **kwargs): # noqa: E501 """Update # noqa: E501 diff --git a/hubspot/crm/tickets/api/batch_api.py b/hubspot/crm/tickets/api/batch_api.py index 80590cdc..8cd28893 100644 --- a/hubspot/crm/tickets/api/batch_api.py +++ b/hubspot/crm/tickets/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 tickets by ID # noqa: E501 + Delete a batch of tickets by ID. Deleted tickets 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 @@ -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 tickets by ID # noqa: E501 + Delete a batch of tickets by ID. Deleted tickets 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 tickets # noqa: E501 + Create a batch of tickets. The `inputs` array can contain a `properties` object to define property values for the ticket, 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 tickets # noqa: E501 + Create a batch of tickets. The `inputs` array can contain a `properties` object to define property values for the ticket, 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 tickets by internal ID, or unique property values # noqa: E501 + Retrieve a batch of tickets by ID (`ticketId`) 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 tickets by internal ID, or unique property values # noqa: E501 + Retrieve a batch of tickets by ID (`ticketId`) 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 tickets by internal ID, or unique property values # noqa: E501 + Update a batch of tickets by ID (`ticketId`) 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 tickets by internal ID, or unique property values # noqa: E501 + Update a batch of tickets by ID (`ticketId`) 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/tickets/api/merge_api.py b/hubspot/crm/tickets/api/merge_api.py deleted file mode 100644 index f344a201..00000000 --- a/hubspot/crm/tickets/api/merge_api.py +++ /dev/null @@ -1,160 +0,0 @@ -# coding: utf-8 - -""" - Tickets - - 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.tickets.api_client import ApiClient -from hubspot.crm.tickets.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 tickets 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 tickets 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/tickets/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/tickets/api/search_api.py b/hubspot/crm/tickets/api/search_api.py index f8b6e108..85b36bac 100644 --- a/hubspot/crm/tickets/api/search_api.py +++ b/hubspot/crm/tickets/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 tickets # noqa: E501 + Search for tickets 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 tickets # noqa: E501 + Search for tickets 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/tickets/models/__init__.py b/hubspot/crm/tickets/models/__init__.py index 83ee20af..67989cb0 100644 --- a/hubspot/crm/tickets/models/__init__.py +++ b/hubspot/crm/tickets/models/__init__.py @@ -17,9 +17,9 @@ from hubspot.crm.tickets.models.associated_id import AssociatedId from hubspot.crm.tickets.models.association_spec import AssociationSpec from hubspot.crm.tickets.models.batch_input_simple_public_object_batch_input import BatchInputSimplePublicObjectBatchInput +from hubspot.crm.tickets.models.batch_input_simple_public_object_batch_input_for_create import BatchInputSimplePublicObjectBatchInputForCreate from hubspot.crm.tickets.models.batch_input_simple_public_object_batch_input_upsert import BatchInputSimplePublicObjectBatchInputUpsert from hubspot.crm.tickets.models.batch_input_simple_public_object_id import BatchInputSimplePublicObjectId -from hubspot.crm.tickets.models.batch_input_simple_public_object_input_for_create import BatchInputSimplePublicObjectInputForCreate from hubspot.crm.tickets.models.batch_read_input_simple_public_object_id import BatchReadInputSimplePublicObjectId from hubspot.crm.tickets.models.batch_response_simple_public_object import BatchResponseSimplePublicObject from hubspot.crm.tickets.models.batch_response_simple_public_object_with_errors import BatchResponseSimplePublicObjectWithErrors @@ -42,6 +42,7 @@ from hubspot.crm.tickets.models.public_object_search_request import PublicObjectSearchRequest from hubspot.crm.tickets.models.simple_public_object import SimplePublicObject from hubspot.crm.tickets.models.simple_public_object_batch_input import SimplePublicObjectBatchInput +from hubspot.crm.tickets.models.simple_public_object_batch_input_for_create import SimplePublicObjectBatchInputForCreate from hubspot.crm.tickets.models.simple_public_object_batch_input_upsert import SimplePublicObjectBatchInputUpsert from hubspot.crm.tickets.models.simple_public_object_id import SimplePublicObjectId from hubspot.crm.tickets.models.simple_public_object_input import SimplePublicObjectInput diff --git a/hubspot/crm/tickets/models/association_spec.py b/hubspot/crm/tickets/models/association_spec.py index 01ae7f6c..98c11c74 100644 --- a/hubspot/crm/tickets/models/association_spec.py +++ b/hubspot/crm/tickets/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/tickets/models/batch_input_simple_public_object_batch_input_for_create.py b/hubspot/crm/tickets/models/batch_input_simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..2fe2c622 --- /dev/null +++ b/hubspot/crm/tickets/models/batch_input_simple_public_object_batch_input_for_create.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Tickets + + 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.tickets.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/tickets/models/batch_read_input_simple_public_object_id.py b/hubspot/crm/tickets/models/batch_read_input_simple_public_object_id.py index 56dcffc3..4a9415cc 100644 --- a/hubspot/crm/tickets/models/batch_read_input_simple_public_object_id.py +++ b/hubspot/crm/tickets/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/tickets/models/public_associations_for_object.py b/hubspot/crm/tickets/models/public_associations_for_object.py index 45501581..f43a74a2 100644 --- a/hubspot/crm/tickets/models/public_associations_for_object.py +++ b/hubspot/crm/tickets/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/tickets/models/public_object_id.py b/hubspot/crm/tickets/models/public_object_id.py index 753103a5..5e5a6af9 100644 --- a/hubspot/crm/tickets/models/public_object_id.py +++ b/hubspot/crm/tickets/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/tickets/models/simple_public_object.py b/hubspot/crm/tickets/models/simple_public_object.py index 5251035f..f77eb628 100644 --- a/hubspot/crm/tickets/models/simple_public_object.py +++ b/hubspot/crm/tickets/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/tickets/models/simple_public_object_batch_input.py b/hubspot/crm/tickets/models/simple_public_object_batch_input.py index 2b9ca4c4..3dbf4a73 100644 --- a/hubspot/crm/tickets/models/simple_public_object_batch_input.py +++ b/hubspot/crm/tickets/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/tickets/models/simple_public_object_batch_input_for_create.py b/hubspot/crm/tickets/models/simple_public_object_batch_input_for_create.py new file mode 100644 index 00000000..40379a65 --- /dev/null +++ b/hubspot/crm/tickets/models/simple_public_object_batch_input_for_create.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Tickets + + 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.tickets.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/tickets/models/simple_public_object_batch_input_upsert.py b/hubspot/crm/tickets/models/simple_public_object_batch_input_upsert.py index 9353a761..2e19e737 100644 --- a/hubspot/crm/tickets/models/simple_public_object_batch_input_upsert.py +++ b/hubspot/crm/tickets/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/tickets/models/simple_public_object_input.py b/hubspot/crm/tickets/models/simple_public_object_input.py index 3080cfdf..1e040ec9 100644 --- a/hubspot/crm/tickets/models/simple_public_object_input.py +++ b/hubspot/crm/tickets/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/tickets/models/simple_public_object_input_for_create.py b/hubspot/crm/tickets/models/simple_public_object_input_for_create.py index 3fa498b1..b86552f6 100644 --- a/hubspot/crm/tickets/models/simple_public_object_input_for_create.py +++ b/hubspot/crm/tickets/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/tickets/models/simple_public_object_with_associations.py b/hubspot/crm/tickets/models/simple_public_object_with_associations.py index 8e9818bc..478d0db3 100644 --- a/hubspot/crm/tickets/models/simple_public_object_with_associations.py +++ b/hubspot/crm/tickets/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/tickets/models/simple_public_upsert_object.py b/hubspot/crm/tickets/models/simple_public_upsert_object.py index 24bbe175..e3f81d93 100644 --- a/hubspot/crm/tickets/models/simple_public_upsert_object.py +++ b/hubspot/crm/tickets/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 diff --git a/hubspot/discovery/cms/discovery.py b/hubspot/discovery/cms/discovery.py index f93d9034..71a17d81 100644 --- a/hubspot/discovery/cms/discovery.py +++ b/hubspot/discovery/cms/discovery.py @@ -26,11 +26,6 @@ def pages(self): from .pages.discovery import Discovery as PagesDiscovery return PagesDiscovery(self.config) - @property - def performance(self): - from .performance.discovery import Discovery as PerformanceDiscovery - return PerformanceDiscovery(self.config) - @property def site_search(self): from .site_search.discovery import Discovery as SiteSearchDiscovery diff --git a/hubspot/discovery/cms/performance/__init__.py b/hubspot/discovery/cms/performance/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/hubspot/discovery/cms/performance/discovery.py b/hubspot/discovery/cms/performance/discovery.py deleted file mode 100644 index 3b068ad4..00000000 --- a/hubspot/discovery/cms/performance/discovery.py +++ /dev/null @@ -1,8 +0,0 @@ -import hubspot.cms.performance as api_client -from ...discovery_base import DiscoveryBase - - -class Discovery(DiscoveryBase): - @property - def public_performance_api(self) -> api_client.PublicPerformanceApi: - return self._configure_api_client(api_client, "PublicPerformanceApi") diff --git a/hubspot/discovery/crm/tickets/discovery.py b/hubspot/discovery/crm/tickets/discovery.py index 2af56323..b45964ae 100644 --- a/hubspot/discovery/crm/tickets/discovery.py +++ b/hubspot/discovery/crm/tickets/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/hubspot/files/__init__.py b/hubspot/files/__init__.py index e32feaa2..edca4e60 100644 --- a/hubspot/files/__init__.py +++ b/hubspot/files/__init__.py @@ -3,7 +3,7 @@ # flake8: noqa """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -43,6 +43,7 @@ from hubspot.files.models.folder_action_response import FolderActionResponse from hubspot.files.models.folder_input import FolderInput from hubspot.files.models.folder_update_input import FolderUpdateInput +from hubspot.files.models.folder_update_input_with_id import FolderUpdateInputWithId from hubspot.files.models.folder_update_task_locator import FolderUpdateTaskLocator from hubspot.files.models.import_from_url_input import ImportFromUrlInput from hubspot.files.models.import_from_url_task_locator import ImportFromUrlTaskLocator diff --git a/hubspot/files/api/files_api.py b/hubspot/files/api/files_api.py index 0b477279..32296a88 100644 --- a/hubspot/files/api/files_api.py +++ b/hubspot/files/api/files_api.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -34,9 +34,9 @@ def __init__(self, api_client=None): self.api_client = api_client def archive(self, file_id, **kwargs): # noqa: E501 - """Delete file # noqa: E501 + """Delete file by ID # noqa: E501 - Delete file by ID # noqa: E501 + Delete a file by ID # 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, file_id, **kwargs): # noqa: E501 return self.archive_with_http_info(file_id, **kwargs) # noqa: E501 def archive_with_http_info(self, file_id, **kwargs): # noqa: E501 - """Delete file # noqa: E501 + """Delete file by ID # noqa: E501 - Delete file by ID # noqa: E501 + Delete a file by ID # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -156,18 +156,18 @@ def archive_with_http_info(self, file_id, **kwargs): # noqa: E501 _request_auth=local_var_params.get("_request_auth"), ) - def archive_gdpr(self, file_id, **kwargs): # noqa: E501 - """GDPR delete # noqa: E501 + def check_import(self, task_id, **kwargs): # noqa: E501 + """Check import status # noqa: E501 - GDRP delete file # noqa: E501 + Check the status of requested import. # 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_gdpr(file_id, async_req=True) + >>> thread = api.check_import(task_id, async_req=True) >>> result = thread.get() - :param file_id: ID of file to GDPR delete (required) - :type file_id: str + :param task_id: Import by URL task ID (required) + :type task_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 @@ -181,23 +181,23 @@ def archive_gdpr(self, file_id, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: FileActionResponse """ kwargs["_return_http_data_only"] = True - return self.archive_gdpr_with_http_info(file_id, **kwargs) # noqa: E501 + return self.check_import_with_http_info(task_id, **kwargs) # noqa: E501 - def archive_gdpr_with_http_info(self, file_id, **kwargs): # noqa: E501 - """GDPR delete # noqa: E501 + def check_import_with_http_info(self, task_id, **kwargs): # noqa: E501 + """Check import status # noqa: E501 - GDRP delete file # noqa: E501 + Check the status of requested import. # 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_gdpr_with_http_info(file_id, async_req=True) + >>> thread = api.check_import_with_http_info(task_id, async_req=True) >>> result = thread.get() - :param file_id: ID of file to GDPR delete (required) - :type file_id: str + :param task_id: Import by URL task ID (required) + :type task_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 @@ -219,30 +219,28 @@ def archive_gdpr_with_http_info(self, file_id, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: None + :rtype: tuple(FileActionResponse, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["file_id"] + 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 archive_gdpr" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method check_import" % key) local_var_params[key] = val del local_var_params["kwargs"] - # verify the required parameter 'file_id' is set - if self.api_client.client_side_validation and local_var_params.get("file_id") is None: # noqa: E501 - raise ApiValueError("Missing the required parameter `file_id` when calling `archive_gdpr`") # noqa: E501 + # 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 `check_import`") # noqa: E501 - if self.api_client.client_side_validation and "file_id" in local_var_params and not re.search(r"\d+", local_var_params["file_id"]): # noqa: E501 - raise ApiValueError("Invalid value for parameter `file_id` when calling `archive_gdpr`, must conform to the pattern `/\d+/`") # noqa: E501 collection_formats = {} path_params = {} - if "file_id" in local_var_params: - path_params["fileId"] = local_var_params["file_id"] # noqa: E501 + if "task_id" in local_var_params: + path_params["taskId"] = local_var_params["task_id"] # noqa: E501 query_params = [] @@ -253,16 +251,18 @@ def archive_gdpr_with_http_info(self, file_id, **kwargs): # noqa: E501 body_params = None # 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 # Authentication setting auth_settings = ["oauth2"] # noqa: E501 - response_types_map = {} + response_types_map = { + 200: "FileActionResponse", + } return self.api_client.call_api( - "/files/v3/files/{fileId}/gdpr-delete", - "DELETE", + "/files/v3/files/import-from-url/async/tasks/{taskId}/status", + "GET", path_params, query_params, header_params, @@ -279,18 +279,18 @@ def archive_gdpr_with_http_info(self, file_id, **kwargs): # noqa: E501 _request_auth=local_var_params.get("_request_auth"), ) - def check_import(self, task_id, **kwargs): # noqa: E501 - """Check import status. # noqa: E501 + def delete(self, file_id, **kwargs): # noqa: E501 + """GDPR-delete file # noqa: E501 - Check the status of requested import. # noqa: E501 + Delete a file in accordance with GDPR regulations. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.check_import(task_id, async_req=True) + >>> thread = api.delete(file_id, async_req=True) >>> result = thread.get() - :param task_id: Import by URL task ID (required) - :type task_id: str + :param file_id: ID of file to GDPR delete (required) + :type file_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 @@ -304,23 +304,23 @@ def check_import(self, task_id, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: FileActionResponse + :rtype: None """ kwargs["_return_http_data_only"] = True - return self.check_import_with_http_info(task_id, **kwargs) # noqa: E501 + return self.delete_with_http_info(file_id, **kwargs) # noqa: E501 - def check_import_with_http_info(self, task_id, **kwargs): # noqa: E501 - """Check import status. # noqa: E501 + def delete_with_http_info(self, file_id, **kwargs): # noqa: E501 + """GDPR-delete file # noqa: E501 - Check the status of requested import. # noqa: E501 + Delete a file in accordance with GDPR regulations. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.check_import_with_http_info(task_id, async_req=True) + >>> thread = api.delete_with_http_info(file_id, async_req=True) >>> result = thread.get() - :param task_id: Import by URL task ID (required) - :type task_id: str + :param file_id: ID of file to GDPR delete (required) + :type file_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 @@ -342,28 +342,30 @@ def check_import_with_http_info(self, task_id, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(FileActionResponse, status_code(int), headers(HTTPHeaderDict)) + :rtype: None """ local_var_params = locals() - all_params = ["task_id"] + all_params = ["file_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 check_import" % key) + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method delete" % 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 `check_import`") # noqa: E501 + # verify the required parameter 'file_id' is set + if self.api_client.client_side_validation and local_var_params.get("file_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `file_id` when calling `delete`") # noqa: E501 + if self.api_client.client_side_validation and "file_id" in local_var_params and not re.search(r"\d+", local_var_params["file_id"]): # noqa: E501 + raise ApiValueError("Invalid value for parameter `file_id` when calling `delete`, must conform to the pattern `/\d+/`") # noqa: E501 collection_formats = {} path_params = {} - if "task_id" in local_var_params: - path_params["taskId"] = local_var_params["task_id"] # noqa: E501 + if "file_id" in local_var_params: + path_params["fileId"] = local_var_params["file_id"] # noqa: E501 query_params = [] @@ -374,18 +376,16 @@ def check_import_with_http_info(self, task_id, **kwargs): # noqa: E501 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: "FileActionResponse", - } + response_types_map = {} return self.api_client.call_api( - "/files/v3/files/import-from-url/async/tasks/{taskId}/status", - "GET", + "/files/v3/files/{fileId}/gdpr-delete", + "DELETE", path_params, query_params, header_params, @@ -412,54 +412,78 @@ def do_search(self, **kwargs): # noqa: E501 >>> thread = api.do_search(async_req=True) >>> result = thread.get() - :param properties: Desired file properties in the return object. + :param properties: A list of file properties to return. :type properties: list[str] - :param after: The maximum offset of items for a given search is 10000. Narrow your search down if you are reaching this limit. + :param after: Offset search results by this value. The default offset is 0 and the maximum offset of items for a given search is 10,000. Narrow your search down if you are reaching this limit. :type after: str :param before: :type before: str - :param limit: Number of items to return. Maximum limit is 100. + :param limit: Number of items to return. Default limit is 10, maximum limit is 100. :type limit: int :param sort: Sort files by a given field. :type sort: list[str] - :param id: Search files by given ID. - :type id: str + :param ids: Search by a list of file IDs. + :type ids: list[int] + :param id_lte: + :type id_lte: int + :param id_gte: + :type id_gte: int :param created_at: Search files by time of creation. :type created_at: datetime - :param created_at_lte: + :param created_at_lte: Search files by less than or equal to time of creation. Can be used with `createdAtGte` to create a range. :type created_at_lte: datetime - :param created_at_gte: + :param created_at_gte: Search files by greater than or equal to time of creation. Can be used with `createdAtLte` to create a range. :type created_at_gte: datetime :param updated_at: Search files by time of latest updated. :type updated_at: datetime - :param updated_at_lte: + :param updated_at_lte: Search files by less than or equal to time of latest update. Can be used with `updatedAtGte` to create a range. :type updated_at_lte: datetime - :param updated_at_gte: + :param updated_at_gte: Search files by greater than or equal to time of latest update. Can be used with `updatedAtLte` to create a range. :type updated_at_gte: datetime :param name: Search for files containing the given name. :type name: str :param path: Search files by path. :type path: str - :param parent_folder_id: Search files within given folderId. - :type parent_folder_id: int - :param size: Query by file size. + :param parent_folder_ids: Search files within given `folderId`. + :type parent_folder_ids: list[int] + :param size: Search files by exact file size in bytes. :type size: int + :param size_lte: Search files by less than or equal to file size. Can be used with `sizeGte` to create a range. + :type size_lte: int + :param size_gte: Search files by greater than or equal to file size. Can be used with `sizeLte` to create a range. + :type size_gte: int :param height: Search files by height of image or video. :type height: int + :param height_lte: Search files by less than or equal to height of image or video. Can be used with `heightGte` to create a range. + :type height_lte: int + :param height_gte: Search files by greater than or equal to height of image or video. Can be used with `heightLte` to create a range. + :type height_gte: int :param width: Search files by width of image or video. :type width: int - :param encoding: Search files with specified encoding. + :param width_lte: Search files by less than or equal to width of image or video. Can be used with `widthGte` to create a range. + :type width_lte: int + :param width_gte: Search files by greater than or equal to width of image or video. Can be used with `widthLte` to create a range. + :type width_gte: int + :param encoding: Search files by specified encoding. :type encoding: str :param type: Filter by provided file type. :type type: str :param extension: Search files by given extension. :type extension: str - :param url: Search for given URL + :param url: Search by file URL. :type url: str - :param is_usable_in_content: If true shows files that have been marked to be used in new content. It false shows files that should not be used in new content. + :param is_usable_in_content: If `true`, shows files that have been marked to be used in new content. If `false`, shows files that should not be used in new content. :type is_usable_in_content: bool - :param allows_anonymous_access: If 'true' will show private files; if 'false' will show public files + :param allows_anonymous_access: Search files by access. If `true`, will show only public files. If `false`, will show only private files. :type allows_anonymous_access: bool + :param file_md5: Search files by a specific md5 hash. + :type file_md5: str + :param expires_at: Search files by exact expires time. Time must be epoch time in milliseconds. + :type expires_at: datetime + :param expires_at_lte: Search files by less than or equal to expires time. Can be used with `expiresAtGte` to create a range. + :type expires_at_lte: datetime + :param expires_at_gte: Search files by greater than or equal to expires time. Can be used with `expiresAtLte` to create a range. + :type expires_at_gte: datetime :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -488,54 +512,78 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 >>> thread = api.do_search_with_http_info(async_req=True) >>> result = thread.get() - :param properties: Desired file properties in the return object. + :param properties: A list of file properties to return. :type properties: list[str] - :param after: The maximum offset of items for a given search is 10000. Narrow your search down if you are reaching this limit. + :param after: Offset search results by this value. The default offset is 0 and the maximum offset of items for a given search is 10,000. Narrow your search down if you are reaching this limit. :type after: str :param before: :type before: str - :param limit: Number of items to return. Maximum limit is 100. + :param limit: Number of items to return. Default limit is 10, maximum limit is 100. :type limit: int :param sort: Sort files by a given field. :type sort: list[str] - :param id: Search files by given ID. - :type id: str + :param ids: Search by a list of file IDs. + :type ids: list[int] + :param id_lte: + :type id_lte: int + :param id_gte: + :type id_gte: int :param created_at: Search files by time of creation. :type created_at: datetime - :param created_at_lte: + :param created_at_lte: Search files by less than or equal to time of creation. Can be used with `createdAtGte` to create a range. :type created_at_lte: datetime - :param created_at_gte: + :param created_at_gte: Search files by greater than or equal to time of creation. Can be used with `createdAtLte` to create a range. :type created_at_gte: datetime :param updated_at: Search files by time of latest updated. :type updated_at: datetime - :param updated_at_lte: + :param updated_at_lte: Search files by less than or equal to time of latest update. Can be used with `updatedAtGte` to create a range. :type updated_at_lte: datetime - :param updated_at_gte: + :param updated_at_gte: Search files by greater than or equal to time of latest update. Can be used with `updatedAtLte` to create a range. :type updated_at_gte: datetime :param name: Search for files containing the given name. :type name: str :param path: Search files by path. :type path: str - :param parent_folder_id: Search files within given folderId. - :type parent_folder_id: int - :param size: Query by file size. + :param parent_folder_ids: Search files within given `folderId`. + :type parent_folder_ids: list[int] + :param size: Search files by exact file size in bytes. :type size: int + :param size_lte: Search files by less than or equal to file size. Can be used with `sizeGte` to create a range. + :type size_lte: int + :param size_gte: Search files by greater than or equal to file size. Can be used with `sizeLte` to create a range. + :type size_gte: int :param height: Search files by height of image or video. :type height: int + :param height_lte: Search files by less than or equal to height of image or video. Can be used with `heightGte` to create a range. + :type height_lte: int + :param height_gte: Search files by greater than or equal to height of image or video. Can be used with `heightLte` to create a range. + :type height_gte: int :param width: Search files by width of image or video. :type width: int - :param encoding: Search files with specified encoding. + :param width_lte: Search files by less than or equal to width of image or video. Can be used with `widthGte` to create a range. + :type width_lte: int + :param width_gte: Search files by greater than or equal to width of image or video. Can be used with `widthLte` to create a range. + :type width_gte: int + :param encoding: Search files by specified encoding. :type encoding: str :param type: Filter by provided file type. :type type: str :param extension: Search files by given extension. :type extension: str - :param url: Search for given URL + :param url: Search by file URL. :type url: str - :param is_usable_in_content: If true shows files that have been marked to be used in new content. It false shows files that should not be used in new content. + :param is_usable_in_content: If `true`, shows files that have been marked to be used in new content. If `false`, shows files that should not be used in new content. :type is_usable_in_content: bool - :param allows_anonymous_access: If 'true' will show private files; if 'false' will show public files + :param allows_anonymous_access: Search files by access. If `true`, will show only public files. If `false`, will show only private files. :type allows_anonymous_access: bool + :param file_md5: Search files by a specific md5 hash. + :type file_md5: str + :param expires_at: Search files by exact expires time. Time must be epoch time in milliseconds. + :type expires_at: datetime + :param expires_at_lte: Search files by less than or equal to expires time. Can be used with `expiresAtGte` to create a range. + :type expires_at_lte: datetime + :param expires_at_gte: Search files by greater than or equal to expires time. Can be used with `expiresAtLte` to create a range. + :type expires_at_gte: datetime :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 @@ -568,7 +616,9 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 "before", "limit", "sort", - "id", + "ids", + "id_lte", + "id_gte", "created_at", "created_at_lte", "created_at_gte", @@ -577,16 +627,26 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 "updated_at_gte", "name", "path", - "parent_folder_id", + "parent_folder_ids", "size", + "size_lte", + "size_gte", "height", + "height_lte", + "height_gte", "width", + "width_lte", + "width_gte", "encoding", "type", "extension", "url", "is_usable_in_content", "allows_anonymous_access", + "file_md5", + "expires_at", + "expires_at_lte", + "expires_at_gte", ] all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) @@ -613,8 +673,13 @@ def do_search_with_http_info(self, **kwargs): # 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("id") is not None: # noqa: E501 - query_params.append(("id", local_var_params["id"])) # noqa: E501 + if local_var_params.get("ids") is not None: # noqa: E501 + query_params.append(("ids", local_var_params["ids"])) # noqa: E501 + collection_formats["ids"] = "multi" # noqa: E501 + if local_var_params.get("id_lte") is not None: # noqa: E501 + query_params.append(("idLte", local_var_params["id_lte"])) # noqa: E501 + if local_var_params.get("id_gte") is not None: # noqa: E501 + query_params.append(("idGte", local_var_params["id_gte"])) # noqa: E501 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_at_lte") is not None: # noqa: E501 @@ -631,14 +696,27 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 query_params.append(("name", local_var_params["name"])) # noqa: E501 if local_var_params.get("path") is not None: # noqa: E501 query_params.append(("path", local_var_params["path"])) # noqa: E501 - if local_var_params.get("parent_folder_id") is not None: # noqa: E501 - query_params.append(("parentFolderId", local_var_params["parent_folder_id"])) # noqa: E501 + if local_var_params.get("parent_folder_ids") is not None: # noqa: E501 + query_params.append(("parentFolderIds", local_var_params["parent_folder_ids"])) # noqa: E501 + collection_formats["parentFolderIds"] = "multi" # noqa: E501 if local_var_params.get("size") is not None: # noqa: E501 query_params.append(("size", local_var_params["size"])) # noqa: E501 + if local_var_params.get("size_lte") is not None: # noqa: E501 + query_params.append(("sizeLte", local_var_params["size_lte"])) # noqa: E501 + if local_var_params.get("size_gte") is not None: # noqa: E501 + query_params.append(("sizeGte", local_var_params["size_gte"])) # noqa: E501 if local_var_params.get("height") is not None: # noqa: E501 query_params.append(("height", local_var_params["height"])) # noqa: E501 + if local_var_params.get("height_lte") is not None: # noqa: E501 + query_params.append(("heightLte", local_var_params["height_lte"])) # noqa: E501 + if local_var_params.get("height_gte") is not None: # noqa: E501 + query_params.append(("heightGte", local_var_params["height_gte"])) # noqa: E501 if local_var_params.get("width") is not None: # noqa: E501 query_params.append(("width", local_var_params["width"])) # noqa: E501 + if local_var_params.get("width_lte") is not None: # noqa: E501 + query_params.append(("widthLte", local_var_params["width_lte"])) # noqa: E501 + if local_var_params.get("width_gte") is not None: # noqa: E501 + query_params.append(("widthGte", local_var_params["width_gte"])) # noqa: E501 if local_var_params.get("encoding") is not None: # noqa: E501 query_params.append(("encoding", local_var_params["encoding"])) # noqa: E501 if local_var_params.get("type") is not None: # noqa: E501 @@ -651,6 +729,14 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 query_params.append(("isUsableInContent", local_var_params["is_usable_in_content"])) # noqa: E501 if local_var_params.get("allows_anonymous_access") is not None: # noqa: E501 query_params.append(("allowsAnonymousAccess", local_var_params["allows_anonymous_access"])) # noqa: E501 + if local_var_params.get("file_md5") is not None: # noqa: E501 + query_params.append(("fileMd5", local_var_params["file_md5"])) # noqa: E501 + if local_var_params.get("expires_at") is not None: # noqa: E501 + query_params.append(("expiresAt", local_var_params["expires_at"])) # noqa: E501 + if local_var_params.get("expires_at_lte") is not None: # noqa: E501 + query_params.append(("expiresAtLte", local_var_params["expires_at_lte"])) # noqa: E501 + if local_var_params.get("expires_at_gte") is not None: # noqa: E501 + query_params.append(("expiresAtGte", local_var_params["expires_at_gte"])) # noqa: E501 header_params = dict(local_var_params.get("_headers", {})) @@ -688,9 +774,9 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 ) def get_by_id(self, file_id, **kwargs): # noqa: E501 - """Get file. # noqa: E501 + """Retrieve file by ID # noqa: E501 - Get file by ID. # noqa: E501 + Retrieve a file by its ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -699,7 +785,7 @@ def get_by_id(self, file_id, **kwargs): # noqa: E501 :param file_id: ID of the desired file. (required) :type file_id: str - :param properties: + :param properties: null :type properties: list[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -720,9 +806,9 @@ def get_by_id(self, file_id, **kwargs): # noqa: E501 return self.get_by_id_with_http_info(file_id, **kwargs) # noqa: E501 def get_by_id_with_http_info(self, file_id, **kwargs): # noqa: E501 - """Get file. # noqa: E501 + """Retrieve file by ID # noqa: E501 - Get file by ID. # noqa: E501 + Retrieve a file by its ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -731,7 +817,7 @@ def get_by_id_with_http_info(self, file_id, **kwargs): # noqa: E501 :param file_id: ID of the desired file. (required) :type file_id: str - :param properties: + :param properties: null :type properties: list[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -820,17 +906,18 @@ def get_by_id_with_http_info(self, file_id, **kwargs): # noqa: E501 ) def get_metadata(self, path, **kwargs): # noqa: E501 - """get_metadata # noqa: E501 + """Retrieve file by path # noqa: E501 + Retrieve a file by its 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_metadata(path, async_req=True) >>> result = thread.get() - :param path: (required) + :param path: The path of the file. (required) :type path: str - :param properties: + :param properties: Properties to return in the response. :type properties: list[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -851,17 +938,18 @@ def get_metadata(self, path, **kwargs): # noqa: E501 return self.get_metadata_with_http_info(path, **kwargs) # noqa: E501 def get_metadata_with_http_info(self, path, **kwargs): # noqa: E501 - """get_metadata # noqa: E501 + """Retrieve file by path # noqa: E501 + Retrieve a file by its 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_metadata_with_http_info(path, async_req=True) >>> result = thread.get() - :param path: (required) + :param path: The path of the file. (required) :type path: str - :param properties: + :param properties: Properties to return in the response. :type properties: list[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -950,7 +1038,7 @@ def get_metadata_with_http_info(self, path, **kwargs): # noqa: E501 ) def get_signed_url(self, file_id, **kwargs): # noqa: E501 - """Get signed URL to access private file. # noqa: E501 + """Get signed URL to access private file # noqa: E501 Generates signed URL that allows temporary access to a private file. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -986,7 +1074,7 @@ def get_signed_url(self, file_id, **kwargs): # noqa: E501 return self.get_signed_url_with_http_info(file_id, **kwargs) # noqa: E501 def get_signed_url_with_http_info(self, file_id, **kwargs): # noqa: E501 - """Get signed URL to access private file. # noqa: E501 + """Get signed URL to access private file # noqa: E501 Generates signed URL that allows temporary access to a private file. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1093,7 +1181,7 @@ def get_signed_url_with_http_info(self, file_id, **kwargs): # noqa: E501 ) def import_from_url(self, import_from_url_input, **kwargs): # noqa: E501 - """Import a file from a URL into the file manager. # noqa: E501 + """Import file from URL # noqa: E501 Asynchronously imports the file at the given URL into the file manager. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1123,7 +1211,7 @@ def import_from_url(self, import_from_url_input, **kwargs): # noqa: E501 return self.import_from_url_with_http_info(import_from_url_input, **kwargs) # noqa: E501 def import_from_url_with_http_info(self, import_from_url_input, **kwargs): # noqa: E501 - """Import a file from a URL into the file manager. # noqa: E501 + """Import file from URL # noqa: E501 Asynchronously imports the file at the given URL into the file manager. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1221,7 +1309,7 @@ def import_from_url_with_http_info(self, import_from_url_input, **kwargs): # no ) def replace(self, file_id, **kwargs): # noqa: E501 - """Replace file. # noqa: E501 + """Replace file # noqa: E501 Replace existing file data with new file data. Can be used to change image content without having to upload a new file and update all references. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1236,7 +1324,7 @@ def replace(self, file_id, **kwargs): # noqa: E501 :type file: file :param charset_hunch: Character set of given file data. :type charset_hunch: str - :param options: JSON String representing FileReplaceOptions + :param options: JSON string representing FileReplaceOptions. Includes options to set the access and expiresAt properties, which will automatically update when the file is replaced. :type options: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -1257,7 +1345,7 @@ def replace(self, file_id, **kwargs): # noqa: E501 return self.replace_with_http_info(file_id, **kwargs) # noqa: E501 def replace_with_http_info(self, file_id, **kwargs): # noqa: E501 - """Replace file. # noqa: E501 + """Replace file # noqa: E501 Replace existing file data with new file data. Can be used to change image content without having to upload a new file and update all references. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1272,7 +1360,7 @@ def replace_with_http_info(self, file_id, **kwargs): # noqa: E501 :type file: file :param charset_hunch: Character set of given file data. :type charset_hunch: str - :param options: JSON String representing FileReplaceOptions + :param options: JSON string representing FileReplaceOptions. Includes options to set the access and expiresAt properties, which will automatically update when the file is replaced. :type options: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -1369,7 +1457,7 @@ def replace_with_http_info(self, file_id, **kwargs): # noqa: E501 ) def update_properties(self, file_id, file_update_input, **kwargs): # noqa: E501 - """update file properties # noqa: E501 + """Update file properties # noqa: E501 Update properties of file by ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1380,7 +1468,7 @@ def update_properties(self, file_id, file_update_input, **kwargs): # noqa: E501 :param file_id: ID of file to update (required) :type file_id: str - :param file_update_input: Options to update. (required) + :param file_update_input: (required) :type file_update_input: FileUpdateInput :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -1401,7 +1489,7 @@ def update_properties(self, file_id, file_update_input, **kwargs): # noqa: E501 return self.update_properties_with_http_info(file_id, file_update_input, **kwargs) # noqa: E501 def update_properties_with_http_info(self, file_id, file_update_input, **kwargs): # noqa: E501 - """update file properties # noqa: E501 + """Update file properties # noqa: E501 Update properties of file by ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1412,7 +1500,7 @@ def update_properties_with_http_info(self, file_id, file_update_input, **kwargs) :param file_id: ID of file to update (required) :type file_id: str - :param file_update_input: Options to update. (required) + :param file_update_input: (required) :type file_update_input: FileUpdateInput :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional diff --git a/hubspot/files/api/folders_api.py b/hubspot/files/api/folders_api.py index 5d9e6994..320d9fe7 100644 --- a/hubspot/files/api/folders_api.py +++ b/hubspot/files/api/folders_api.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -34,7 +34,7 @@ def __init__(self, api_client=None): self.api_client = api_client def archive(self, folder_id, **kwargs): # noqa: E501 - """Delete folder. # noqa: E501 + """Delete folder by ID # noqa: E501 Delete folder by ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -64,7 +64,7 @@ def archive(self, folder_id, **kwargs): # noqa: E501 return self.archive_with_http_info(folder_id, **kwargs) # noqa: E501 def archive_with_http_info(self, folder_id, **kwargs): # noqa: E501 - """Delete folder. # noqa: E501 + """Delete folder by ID # noqa: E501 Delete folder by ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -157,9 +157,9 @@ def archive_with_http_info(self, folder_id, **kwargs): # noqa: E501 ) def archive_by_path(self, folder_path, **kwargs): # noqa: E501 - """Delete folder. # noqa: E501 + """Delete folder by path # noqa: E501 - Delete folder by path. # noqa: E501 + Delete a folder, identified by its path. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -187,9 +187,9 @@ def archive_by_path(self, folder_path, **kwargs): # noqa: E501 return self.archive_by_path_with_http_info(folder_path, **kwargs) # noqa: E501 def archive_by_path_with_http_info(self, folder_path, **kwargs): # noqa: E501 - """Delete folder. # noqa: E501 + """Delete folder by path # noqa: E501 - Delete folder by path. # noqa: E501 + Delete a folder, identified by its path. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -280,7 +280,7 @@ def archive_by_path_with_http_info(self, folder_path, **kwargs): # noqa: E501 ) def check_update_status(self, task_id, **kwargs): # noqa: E501 - """Check folder update status. # noqa: E501 + """Check folder update status # noqa: E501 Check status of folder update. Folder updates happen asynchronously. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -289,7 +289,7 @@ def check_update_status(self, task_id, **kwargs): # noqa: E501 >>> thread = api.check_update_status(task_id, async_req=True) >>> result = thread.get() - :param task_id: TaskId of folder update (required) + :param task_id: The ID of the folder update task. (required) :type task_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -310,7 +310,7 @@ def check_update_status(self, task_id, **kwargs): # noqa: E501 return self.check_update_status_with_http_info(task_id, **kwargs) # noqa: E501 def check_update_status_with_http_info(self, task_id, **kwargs): # noqa: E501 - """Check folder update status. # noqa: E501 + """Check folder update status # noqa: E501 Check status of folder update. Folder updates happen asynchronously. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -319,7 +319,7 @@ def check_update_status_with_http_info(self, task_id, **kwargs): # noqa: E501 >>> thread = api.check_update_status_with_http_info(task_id, async_req=True) >>> result = thread.get() - :param task_id: TaskId of folder update (required) + :param task_id: The ID of the folder update task. (required) :type task_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -403,7 +403,7 @@ def check_update_status_with_http_info(self, task_id, **kwargs): # noqa: E501 ) def create(self, folder_input, **kwargs): # noqa: E501 - """Create folder. # noqa: E501 + """Create folder # noqa: E501 Creates a folder. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -433,7 +433,7 @@ def create(self, folder_input, **kwargs): # noqa: E501 return self.create_with_http_info(folder_input, **kwargs) # noqa: E501 def create_with_http_info(self, folder_input, **kwargs): # noqa: E501 - """Create folder. # noqa: E501 + """Create folder # noqa: E501 Creates a folder. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -542,34 +542,38 @@ def do_search(self, **kwargs): # noqa: E501 :param properties: Properties that should be included in the returned folders. :type properties: list[str] - :param after: The maximum offset of items for a given search is 10000. Narrow your search down if you are reaching this limit. + :param after: Offset search results by this value. The default offset is 0 and the maximum offset of items for a given search is 10,000. Narrow your search down if you are reaching this limit. :type after: str :param before: :type before: str - :param limit: Limit of results to return. Max limit is 100. + :param limit: Number of items to return. Default limit is 10, maximum limit is 100. :type limit: int :param sort: Sort results by given property. For example -name sorts by name field descending, name sorts by name field ascending. :type sort: list[str] - :param id: Search folder by given ID. - :type id: str - :param created_at: Search for folders with the given creation timestamp. + :param ids: + :type ids: list[int] + :param id_lte: + :type id_lte: int + :param id_gte: + :type id_gte: int + :param created_at: Search folders by exact time of creation. Time must be epoch time in milliseconds. :type created_at: datetime - :param created_at_lte: + :param created_at_lte: Search folders by less than or equal to time of creation. Can be used with createdAtGte to create a range. :type created_at_lte: datetime - :param created_at_gte: + :param created_at_gte: Search folders by greater than or equal to time of creation. Can be used with createdAtLte to create a range. :type created_at_gte: datetime - :param updated_at: Search for folder at given update timestamp. + :param updated_at: Search folders by exact time of latest updated. Time must be epoch time in milliseconds. :type updated_at: datetime - :param updated_at_lte: + :param updated_at_lte: Search folders by less than or equal to time of latest update. Can be used with updatedAtGte to create a range. :type updated_at_lte: datetime - :param updated_at_gte: + :param updated_at_gte: Search folders by greater than or equal to time of latest update. Can be used with updatedAtLte to create a range. :type updated_at_gte: datetime :param name: Search for folders containing the specified name. :type name: str - :param path: Search for folders by path. + :param path: Search folders by path. :type path: str - :param parent_folder_id: Search for folders with the given parent folderId. - :type parent_folder_id: int + :param parent_folder_ids: Search folders with the given parent folderId. + :type parent_folder_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 @@ -600,34 +604,38 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 :param properties: Properties that should be included in the returned folders. :type properties: list[str] - :param after: The maximum offset of items for a given search is 10000. Narrow your search down if you are reaching this limit. + :param after: Offset search results by this value. The default offset is 0 and the maximum offset of items for a given search is 10,000. Narrow your search down if you are reaching this limit. :type after: str :param before: :type before: str - :param limit: Limit of results to return. Max limit is 100. + :param limit: Number of items to return. Default limit is 10, maximum limit is 100. :type limit: int :param sort: Sort results by given property. For example -name sorts by name field descending, name sorts by name field ascending. :type sort: list[str] - :param id: Search folder by given ID. - :type id: str - :param created_at: Search for folders with the given creation timestamp. + :param ids: + :type ids: list[int] + :param id_lte: + :type id_lte: int + :param id_gte: + :type id_gte: int + :param created_at: Search folders by exact time of creation. Time must be epoch time in milliseconds. :type created_at: datetime - :param created_at_lte: + :param created_at_lte: Search folders by less than or equal to time of creation. Can be used with createdAtGte to create a range. :type created_at_lte: datetime - :param created_at_gte: + :param created_at_gte: Search folders by greater than or equal to time of creation. Can be used with createdAtLte to create a range. :type created_at_gte: datetime - :param updated_at: Search for folder at given update timestamp. + :param updated_at: Search folders by exact time of latest updated. Time must be epoch time in milliseconds. :type updated_at: datetime - :param updated_at_lte: + :param updated_at_lte: Search folders by less than or equal to time of latest update. Can be used with updatedAtGte to create a range. :type updated_at_lte: datetime - :param updated_at_gte: + :param updated_at_gte: Search folders by greater than or equal to time of latest update. Can be used with updatedAtLte to create a range. :type updated_at_gte: datetime :param name: Search for folders containing the specified name. :type name: str - :param path: Search for folders by path. + :param path: Search folders by path. :type path: str - :param parent_folder_id: Search for folders with the given parent folderId. - :type parent_folder_id: int + :param parent_folder_ids: Search folders with the given parent folderId. + :type parent_folder_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 @@ -660,7 +668,9 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 "before", "limit", "sort", - "id", + "ids", + "id_lte", + "id_gte", "created_at", "created_at_lte", "created_at_gte", @@ -669,7 +679,7 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 "updated_at_gte", "name", "path", - "parent_folder_id", + "parent_folder_ids", ] all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"]) @@ -696,8 +706,13 @@ def do_search_with_http_info(self, **kwargs): # 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("id") is not None: # noqa: E501 - query_params.append(("id", local_var_params["id"])) # noqa: E501 + if local_var_params.get("ids") is not None: # noqa: E501 + query_params.append(("ids", local_var_params["ids"])) # noqa: E501 + collection_formats["ids"] = "multi" # noqa: E501 + if local_var_params.get("id_lte") is not None: # noqa: E501 + query_params.append(("idLte", local_var_params["id_lte"])) # noqa: E501 + if local_var_params.get("id_gte") is not None: # noqa: E501 + query_params.append(("idGte", local_var_params["id_gte"])) # noqa: E501 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_at_lte") is not None: # noqa: E501 @@ -714,8 +729,9 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 query_params.append(("name", local_var_params["name"])) # noqa: E501 if local_var_params.get("path") is not None: # noqa: E501 query_params.append(("path", local_var_params["path"])) # noqa: E501 - if local_var_params.get("parent_folder_id") is not None: # noqa: E501 - query_params.append(("parentFolderId", local_var_params["parent_folder_id"])) # noqa: E501 + if local_var_params.get("parent_folder_ids") is not None: # noqa: E501 + query_params.append(("parentFolderIds", local_var_params["parent_folder_ids"])) # noqa: E501 + collection_formats["parentFolderIds"] = "multi" # noqa: E501 header_params = dict(local_var_params.get("_headers", {})) @@ -753,9 +769,9 @@ def do_search_with_http_info(self, **kwargs): # noqa: E501 ) def get_by_id(self, folder_id, **kwargs): # noqa: E501 - """Get folder # noqa: E501 + """Retrieve folder by ID # noqa: E501 - Get folder by ID # noqa: E501 + Retrieve a folder by its ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -785,9 +801,9 @@ def get_by_id(self, folder_id, **kwargs): # noqa: E501 return self.get_by_id_with_http_info(folder_id, **kwargs) # noqa: E501 def get_by_id_with_http_info(self, folder_id, **kwargs): # noqa: E501 - """Get folder # noqa: E501 + """Retrieve folder by ID # noqa: E501 - Get folder by ID # noqa: E501 + Retrieve a folder by its ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -885,9 +901,9 @@ def get_by_id_with_http_info(self, folder_id, **kwargs): # noqa: E501 ) def get_by_path(self, folder_path, **kwargs): # noqa: E501 - """Get folder. # noqa: E501 + """Retrieve folder by path # noqa: E501 - Get folder by path. # noqa: E501 + Retrieve a folder, identified by its path. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -917,9 +933,9 @@ def get_by_path(self, folder_path, **kwargs): # noqa: E501 return self.get_by_path_with_http_info(folder_path, **kwargs) # noqa: E501 def get_by_path_with_http_info(self, folder_path, **kwargs): # noqa: E501 - """Get folder. # noqa: E501 + """Retrieve folder by path # noqa: E501 - Get folder by path. # noqa: E501 + Retrieve a folder, identified by its path. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1016,17 +1032,19 @@ def get_by_path_with_http_info(self, folder_path, **kwargs): # noqa: E501 _request_auth=local_var_params.get("_request_auth"), ) - def update_properties(self, folder_update_input, **kwargs): # noqa: E501 - """Update folder properties # noqa: E501 + def update_properties(self, folder_id, folder_update_input, **kwargs): # noqa: E501 + """Update folder properties by folder ID # noqa: E501 - Update properties of folder by given ID. This action happens asynchronously and will update all of the folder's children as well. # noqa: E501 + Update a folder's properties, identified by folder 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_properties(folder_update_input, async_req=True) + >>> thread = api.update_properties(folder_id, folder_update_input, async_req=True) >>> result = thread.get() - :param folder_update_input: Properties to change in the folder (required) + :param folder_id: ID of folder to update (required) + :type folder_id: str + :param folder_update_input: (required) :type folder_update_input: FolderUpdateInput :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -1041,22 +1059,24 @@ def update_properties(self, folder_update_input, **kwargs): # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: FolderUpdateTaskLocator + :rtype: Folder """ kwargs["_return_http_data_only"] = True - return self.update_properties_with_http_info(folder_update_input, **kwargs) # noqa: E501 + return self.update_properties_with_http_info(folder_id, folder_update_input, **kwargs) # noqa: E501 - def update_properties_with_http_info(self, folder_update_input, **kwargs): # noqa: E501 - """Update folder properties # noqa: E501 + def update_properties_with_http_info(self, folder_id, folder_update_input, **kwargs): # noqa: E501 + """Update folder properties by folder ID # noqa: E501 - Update properties of folder by given ID. This action happens asynchronously and will update all of the folder's children as well. # noqa: E501 + Update a folder's properties, identified by folder 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_properties_with_http_info(folder_update_input, async_req=True) + >>> thread = api.update_properties_with_http_info(folder_id, folder_update_input, async_req=True) >>> result = thread.get() - :param folder_update_input: Properties to change in the folder (required) + :param folder_id: ID of folder to update (required) + :type folder_id: str + :param folder_update_input: (required) :type folder_update_input: FolderUpdateInput :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -1079,12 +1099,12 @@ def update_properties_with_http_info(self, folder_update_input, **kwargs): # no :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(FolderUpdateTaskLocator, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(Folder, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() - all_params = ["folder_update_input"] + all_params = ["folder_id", "folder_update_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"]): @@ -1092,13 +1112,20 @@ def update_properties_with_http_info(self, folder_update_input, **kwargs): # no raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method update_properties" % key) local_var_params[key] = val del local_var_params["kwargs"] + # verify the required parameter 'folder_id' is set + if self.api_client.client_side_validation and local_var_params.get("folder_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `folder_id` when calling `update_properties`") # noqa: E501 # verify the required parameter 'folder_update_input' is set if self.api_client.client_side_validation and local_var_params.get("folder_update_input") is None: # noqa: E501 raise ApiValueError("Missing the required parameter `folder_update_input` when calling `update_properties`") # noqa: E501 + if self.api_client.client_side_validation and "folder_id" in local_var_params and not re.search(r"\d+", local_var_params["folder_id"]): # noqa: E501 + raise ApiValueError("Invalid value for parameter `folder_id` when calling `update_properties`, must conform to the pattern `/\d+/`") # noqa: E501 collection_formats = {} path_params = {} + if "folder_id" in local_var_params: + path_params["folderId"] = local_var_params["folder_id"] # noqa: E501 query_params = [] @@ -1113,6 +1140,134 @@ def update_properties_with_http_info(self, folder_update_input, **kwargs): # no # 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: "Folder", + } + + return self.api_client.call_api( + "/files/v3/folders/{folderId}", + "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 update_properties_recursively(self, folder_update_input_with_id, **kwargs): # noqa: E501 + """Update folder properties # noqa: E501 + + Update properties of folder by given ID. This action happens asynchronously and will update all of the folder's children as well. # 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_properties_recursively(folder_update_input_with_id, async_req=True) + >>> result = thread.get() + + :param folder_update_input_with_id: (required) + :type folder_update_input_with_id: FolderUpdateInputWithId + :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: FolderUpdateTaskLocator + """ + kwargs["_return_http_data_only"] = True + return self.update_properties_recursively_with_http_info(folder_update_input_with_id, **kwargs) # noqa: E501 + + def update_properties_recursively_with_http_info(self, folder_update_input_with_id, **kwargs): # noqa: E501 + """Update folder properties # noqa: E501 + + Update properties of folder by given ID. This action happens asynchronously and will update all of the folder's children as well. # 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_properties_recursively_with_http_info(folder_update_input_with_id, async_req=True) + >>> result = thread.get() + + :param folder_update_input_with_id: (required) + :type folder_update_input_with_id: FolderUpdateInputWithId + :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(FolderUpdateTaskLocator, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = ["folder_update_input_with_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_properties_recursively" % key) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'folder_update_input_with_id' is set + if self.api_client.client_side_validation and local_var_params.get("folder_update_input_with_id") is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `folder_update_input_with_id` when calling `update_properties_recursively`") # 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 "folder_update_input_with_id" in local_var_params: + body_params = local_var_params["folder_update_input_with_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: diff --git a/hubspot/files/api_client.py b/hubspot/files/api_client.py index f1c50a73..1be493c8 100644 --- a/hubspot/files/api_client.py +++ b/hubspot/files/api_client.py @@ -1,6 +1,6 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/configuration.py b/hubspot/files/configuration.py index ddb9e5c4..5242c1a3 100644 --- a/hubspot/files/configuration.py +++ b/hubspot/files/configuration.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/exceptions.py b/hubspot/files/exceptions.py index 01c9f916..2a9ca5a1 100644 --- a/hubspot/files/exceptions.py +++ b/hubspot/files/exceptions.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/__init__.py b/hubspot/files/models/__init__.py index c90bdbcb..f2f46aaa 100644 --- a/hubspot/files/models/__init__.py +++ b/hubspot/files/models/__init__.py @@ -2,7 +2,7 @@ # flake8: noqa """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -26,6 +26,7 @@ from hubspot.files.models.folder_action_response import FolderActionResponse from hubspot.files.models.folder_input import FolderInput from hubspot.files.models.folder_update_input import FolderUpdateInput +from hubspot.files.models.folder_update_input_with_id import FolderUpdateInputWithId from hubspot.files.models.folder_update_task_locator import FolderUpdateTaskLocator from hubspot.files.models.import_from_url_input import ImportFromUrlInput from hubspot.files.models.import_from_url_task_locator import ImportFromUrlTaskLocator diff --git a/hubspot/files/models/collection_response_file.py b/hubspot/files/models/collection_response_file.py index 18adaaf1..26e1f072 100644 --- a/hubspot/files/models/collection_response_file.py +++ b/hubspot/files/models/collection_response_file.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/collection_response_folder.py b/hubspot/files/models/collection_response_folder.py index 3242ef00..04af80d7 100644 --- a/hubspot/files/models/collection_response_folder.py +++ b/hubspot/files/models/collection_response_folder.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/error.py b/hubspot/files/models/error.py index 691cec95..fe734699 100644 --- a/hubspot/files/models/error.py +++ b/hubspot/files/models/error.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/error_detail.py b/hubspot/files/models/error_detail.py index 0c387436..5562884f 100644 --- a/hubspot/files/models/error_detail.py +++ b/hubspot/files/models/error_detail.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/file.py b/hubspot/files/models/file.py index 4b067ff6..1179ab54 100644 --- a/hubspot/files/models/file.py +++ b/hubspot/files/models/file.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -39,6 +39,8 @@ class File(object): "extension": "str", "access": "str", "parent_folder_id": "str", + "source_group": "str", + "file_md5": "str", "encoding": "str", "type": "str", "is_usable_in_content": "bool", @@ -46,8 +48,8 @@ class File(object): "expires_at": "int", "created_at": "datetime", "archived_at": "datetime", - "archived": "bool", "path": "str", + "archived": "bool", "size": "int", "name": "str", "width": "int", @@ -61,6 +63,8 @@ class File(object): "extension": "extension", "access": "access", "parent_folder_id": "parentFolderId", + "source_group": "sourceGroup", + "file_md5": "fileMd5", "encoding": "encoding", "type": "type", "is_usable_in_content": "isUsableInContent", @@ -68,8 +72,8 @@ class File(object): "expires_at": "expiresAt", "created_at": "createdAt", "archived_at": "archivedAt", - "archived": "archived", "path": "path", + "archived": "archived", "size": "size", "name": "name", "width": "width", @@ -84,6 +88,8 @@ def __init__( extension=None, access=None, parent_folder_id=None, + source_group=None, + file_md5=None, encoding=None, type=None, is_usable_in_content=None, @@ -91,8 +97,8 @@ def __init__( expires_at=None, created_at=None, archived_at=None, - archived=None, path=None, + archived=None, size=None, name=None, width=None, @@ -110,6 +116,8 @@ def __init__( self._extension = None self._access = None self._parent_folder_id = None + self._source_group = None + self._file_md5 = None self._encoding = None self._type = None self._is_usable_in_content = None @@ -117,8 +125,8 @@ def __init__( self._expires_at = None self._created_at = None self._archived_at = None - self._archived = None self._path = None + self._archived = None self._size = None self._name = None self._width = None @@ -133,6 +141,10 @@ def __init__( self.access = access if parent_folder_id is not None: self.parent_folder_id = parent_folder_id + if source_group is not None: + self.source_group = source_group + if file_md5 is not None: + self.file_md5 = file_md5 if encoding is not None: self.encoding = encoding if type is not None: @@ -146,9 +158,9 @@ def __init__( self.created_at = created_at if archived_at is not None: self.archived_at = archived_at - self.archived = archived if path is not None: self.path = path + self.archived = archived if size is not None: self.size = size if name is not None: @@ -207,7 +219,7 @@ def access(self, access): """ if self.local_vars_configuration.client_side_validation and access is None: # noqa: E501 raise ValueError("Invalid value for `access`, must not be `None`") # noqa: E501 - allowed_values = ["PUBLIC_INDEXABLE", "PUBLIC_NOT_INDEXABLE", "HIDDEN_INDEXABLE", "HIDDEN_NOT_INDEXABLE", "HIDDEN_PRIVATE", "PRIVATE"] # noqa: E501 + allowed_values = ["PUBLIC_INDEXABLE", "PUBLIC_NOT_INDEXABLE", "HIDDEN_INDEXABLE", "HIDDEN_NOT_INDEXABLE", "HIDDEN_PRIVATE", "PRIVATE", "HIDDEN_SENSITIVE", "SENSITIVE"] # noqa: E501 if self.local_vars_configuration.client_side_validation and access not in allowed_values: # noqa: E501 raise ValueError("Invalid value for `access` ({0}), must be one of {1}".format(access, allowed_values)) # noqa: E501 @@ -236,6 +248,48 @@ def parent_folder_id(self, parent_folder_id): self._parent_folder_id = parent_folder_id + @property + def source_group(self): + """Gets the source_group of this File. # noqa: E501 + + + :return: The source_group of this File. # noqa: E501 + :rtype: str + """ + return self._source_group + + @source_group.setter + def source_group(self, source_group): + """Sets the source_group of this File. + + + :param source_group: The source_group of this File. # noqa: E501 + :type source_group: str + """ + + self._source_group = source_group + + @property + def file_md5(self): + """Gets the file_md5 of this File. # noqa: E501 + + + :return: The file_md5 of this File. # noqa: E501 + :rtype: str + """ + return self._file_md5 + + @file_md5.setter + def file_md5(self, file_md5): + """Sets the file_md5 of this File. + + + :param file_md5: The file_md5 of this File. # noqa: E501 + :type file_md5: str + """ + + self._file_md5 = file_md5 + @property def encoding(self): """Gets the encoding of this File. # noqa: E501 @@ -397,6 +451,29 @@ def archived_at(self, archived_at): self._archived_at = archived_at + @property + def path(self): + """Gets the path of this File. # noqa: E501 + + Path of the file in the file manager. # noqa: E501 + + :return: The path of this File. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this File. + + Path of the file in the file manager. # noqa: E501 + + :param path: The path of this File. # noqa: E501 + :type path: str + """ + + self._path = path + @property def archived(self): """Gets the archived of this File. # noqa: E501 @@ -422,29 +499,6 @@ def archived(self, archived): self._archived = archived - @property - def path(self): - """Gets the path of this File. # noqa: E501 - - Path of the file in the file manager. # noqa: E501 - - :return: The path of this File. # noqa: E501 - :rtype: str - """ - return self._path - - @path.setter - def path(self, path): - """Sets the path of this File. - - Path of the file in the file manager. # noqa: E501 - - :param path: The path of this File. # noqa: E501 - :type path: str - """ - - self._path = path - @property def size(self): """Gets the size of this File. # noqa: E501 diff --git a/hubspot/files/models/file_action_response.py b/hubspot/files/models/file_action_response.py index 97b51446..b1e87430 100644 --- a/hubspot/files/models/file_action_response.py +++ b/hubspot/files/models/file_action_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/file_stat.py b/hubspot/files/models/file_stat.py index 70b49fb3..e88dc685 100644 --- a/hubspot/files/models/file_stat.py +++ b/hubspot/files/models/file_stat.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/file_update_input.py b/hubspot/files/models/file_update_input.py index ec4a6382..f52b4aec 100644 --- a/hubspot/files/models/file_update_input.py +++ b/hubspot/files/models/file_update_input.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -35,18 +35,21 @@ class FileUpdateInput(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"access": "str", "parent_folder_id": "str", "name": "str", "parent_folder_path": "str", "is_usable_in_content": "bool", "expires_at": "int"} + openapi_types = {"access": "str", "parent_folder_id": "str", "name": "str", "parent_folder_path": "str", "clear_expires": "bool", "is_usable_in_content": "bool", "expires_at": "datetime"} attribute_map = { "access": "access", "parent_folder_id": "parentFolderId", "name": "name", "parent_folder_path": "parentFolderPath", + "clear_expires": "clearExpires", "is_usable_in_content": "isUsableInContent", "expires_at": "expiresAt", } - def __init__(self, access=None, parent_folder_id=None, name=None, parent_folder_path=None, is_usable_in_content=None, expires_at=None, local_vars_configuration=None): # noqa: E501 + def __init__( + self, access=None, parent_folder_id=None, name=None, parent_folder_path=None, clear_expires=None, is_usable_in_content=None, expires_at=None, local_vars_configuration=None + ): # noqa: E501 """FileUpdateInput - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() @@ -56,6 +59,7 @@ def __init__(self, access=None, parent_folder_id=None, name=None, parent_folder_ self._parent_folder_id = None self._name = None self._parent_folder_path = None + self._clear_expires = None self._is_usable_in_content = None self._expires_at = None self.discriminator = None @@ -68,6 +72,8 @@ def __init__(self, access=None, parent_folder_id=None, name=None, parent_folder_ self.name = name if parent_folder_path is not None: self.parent_folder_path = parent_folder_path + if clear_expires is not None: + self.clear_expires = clear_expires if is_usable_in_content is not None: self.is_usable_in_content = is_usable_in_content if expires_at is not None: @@ -93,7 +99,7 @@ def access(self, access): :param access: The access of this FileUpdateInput. # noqa: E501 :type access: str """ - allowed_values = ["PUBLIC_INDEXABLE", "PUBLIC_NOT_INDEXABLE", "HIDDEN_INDEXABLE", "HIDDEN_NOT_INDEXABLE", "HIDDEN_PRIVATE", "PRIVATE"] # noqa: E501 + allowed_values = ["PUBLIC_INDEXABLE", "PUBLIC_NOT_INDEXABLE", "HIDDEN_INDEXABLE", "HIDDEN_NOT_INDEXABLE", "HIDDEN_PRIVATE", "PRIVATE", "HIDDEN_SENSITIVE", "SENSITIVE"] # noqa: E501 if self.local_vars_configuration.client_side_validation and access not in allowed_values: # noqa: E501 raise ValueError("Invalid value for `access` ({0}), must be one of {1}".format(access, allowed_values)) # noqa: E501 @@ -168,6 +174,27 @@ def parent_folder_path(self, parent_folder_path): self._parent_folder_path = parent_folder_path + @property + def clear_expires(self): + """Gets the clear_expires of this FileUpdateInput. # noqa: E501 + + + :return: The clear_expires of this FileUpdateInput. # noqa: E501 + :rtype: bool + """ + return self._clear_expires + + @clear_expires.setter + def clear_expires(self, clear_expires): + """Sets the clear_expires of this FileUpdateInput. + + + :param clear_expires: The clear_expires of this FileUpdateInput. # noqa: E501 + :type clear_expires: bool + """ + + self._clear_expires = clear_expires + @property def is_usable_in_content(self): """Gets the is_usable_in_content of this FileUpdateInput. # noqa: E501 @@ -197,7 +224,7 @@ def expires_at(self): :return: The expires_at of this FileUpdateInput. # noqa: E501 - :rtype: int + :rtype: datetime """ return self._expires_at @@ -207,7 +234,7 @@ def expires_at(self, expires_at): :param expires_at: The expires_at of this FileUpdateInput. # noqa: E501 - :type expires_at: int + :type expires_at: datetime """ self._expires_at = expires_at diff --git a/hubspot/files/models/folder.py b/hubspot/files/models/folder.py index a27e5040..308ec89d 100644 --- a/hubspot/files/models/folder.py +++ b/hubspot/files/models/folder.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -35,20 +35,20 @@ class Folder(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"created_at": "datetime", "archived_at": "datetime", "archived": "bool", "path": "str", "parent_folder_id": "str", "name": "str", "id": "str", "updated_at": "datetime"} + openapi_types = {"created_at": "datetime", "archived_at": "datetime", "path": "str", "archived": "bool", "parent_folder_id": "str", "name": "str", "id": "str", "updated_at": "datetime"} attribute_map = { "created_at": "createdAt", "archived_at": "archivedAt", - "archived": "archived", "path": "path", + "archived": "archived", "parent_folder_id": "parentFolderId", "name": "name", "id": "id", "updated_at": "updatedAt", } - def __init__(self, created_at=None, archived_at=None, archived=None, path=None, parent_folder_id=None, name=None, id=None, updated_at=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, created_at=None, archived_at=None, path=None, archived=None, parent_folder_id=None, name=None, id=None, updated_at=None, local_vars_configuration=None): # noqa: E501 """Folder - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() @@ -56,8 +56,8 @@ def __init__(self, created_at=None, archived_at=None, archived=None, path=None, self._created_at = None self._archived_at = None - self._archived = None self._path = None + self._archived = None self._parent_folder_id = None self._name = None self._id = None @@ -67,9 +67,9 @@ def __init__(self, created_at=None, archived_at=None, archived=None, path=None, self.created_at = created_at if archived_at is not None: self.archived_at = archived_at - self.archived = archived if path is not None: self.path = path + self.archived = archived if parent_folder_id is not None: self.parent_folder_id = parent_folder_id if name is not None: @@ -125,6 +125,29 @@ def archived_at(self, archived_at): self._archived_at = archived_at + @property + def path(self): + """Gets the path of this Folder. # noqa: E501 + + Path of the folder in the file manager. # noqa: E501 + + :return: The path of this Folder. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this Folder. + + Path of the folder in the file manager. # noqa: E501 + + :param path: The path of this Folder. # noqa: E501 + :type path: str + """ + + self._path = path + @property def archived(self): """Gets the archived of this Folder. # noqa: E501 @@ -150,29 +173,6 @@ def archived(self, archived): self._archived = archived - @property - def path(self): - """Gets the path of this Folder. # noqa: E501 - - Path of the folder in the file manager. # noqa: E501 - - :return: The path of this Folder. # noqa: E501 - :rtype: str - """ - return self._path - - @path.setter - def path(self, path): - """Sets the path of this Folder. - - Path of the folder in the file manager. # noqa: E501 - - :param path: The path of this Folder. # noqa: E501 - :type path: str - """ - - self._path = path - @property def parent_folder_id(self): """Gets the parent_folder_id of this Folder. # noqa: E501 diff --git a/hubspot/files/models/folder_action_response.py b/hubspot/files/models/folder_action_response.py index 55b8f5ff..a53787b6 100644 --- a/hubspot/files/models/folder_action_response.py +++ b/hubspot/files/models/folder_action_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/folder_input.py b/hubspot/files/models/folder_input.py index 6bf2601a..7d8f9707 100644 --- a/hubspot/files/models/folder_input.py +++ b/hubspot/files/models/folder_input.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/folder_update_input.py b/hubspot/files/models/folder_update_input.py index a4b2068a..9c7c70c5 100644 --- a/hubspot/files/models/folder_update_input.py +++ b/hubspot/files/models/folder_update_input.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -35,11 +35,11 @@ class FolderUpdateInput(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"parent_folder_id": "int", "name": "str", "id": "str"} + openapi_types = {"parent_folder_id": "int", "name": "str"} - attribute_map = {"parent_folder_id": "parentFolderId", "name": "name", "id": "id"} + attribute_map = {"parent_folder_id": "parentFolderId", "name": "name"} - def __init__(self, parent_folder_id=None, name=None, id=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, parent_folder_id=None, name=None, local_vars_configuration=None): # noqa: E501 """FolderUpdateInput - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() @@ -47,14 +47,12 @@ def __init__(self, parent_folder_id=None, name=None, id=None, local_vars_configu self._parent_folder_id = None self._name = None - self._id = None self.discriminator = None if parent_folder_id is not None: self.parent_folder_id = parent_folder_id if name is not None: self.name = name - self.id = id @property def parent_folder_id(self): @@ -102,31 +100,6 @@ def name(self, name): self._name = name - @property - def id(self): - """Gets the id of this FolderUpdateInput. # noqa: E501 - - ID of the folder to change. # noqa: E501 - - :return: The id of this FolderUpdateInput. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this FolderUpdateInput. - - ID of the folder to change. # noqa: E501 - - :param id: The id of this FolderUpdateInput. # 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 = {} diff --git a/hubspot/files/models/folder_update_input_with_id.py b/hubspot/files/models/folder_update_input_with_id.py new file mode 100644 index 00000000..b7244fd8 --- /dev/null +++ b/hubspot/files/models/folder_update_input_with_id.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Files + + Upload and manage files. # 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.files.configuration import Configuration + + +class FolderUpdateInputWithId(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 = {"parent_folder_id": "int", "name": "str", "id": "str"} + + attribute_map = {"parent_folder_id": "parentFolderId", "name": "name", "id": "id"} + + def __init__(self, parent_folder_id=None, name=None, id=None, local_vars_configuration=None): # noqa: E501 + """FolderUpdateInputWithId - 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._parent_folder_id = None + self._name = None + self._id = None + self.discriminator = None + + if parent_folder_id is not None: + self.parent_folder_id = parent_folder_id + if name is not None: + self.name = name + self.id = id + + @property + def parent_folder_id(self): + """Gets the parent_folder_id of this FolderUpdateInputWithId. # noqa: E501 + + + :return: The parent_folder_id of this FolderUpdateInputWithId. # noqa: E501 + :rtype: int + """ + return self._parent_folder_id + + @parent_folder_id.setter + def parent_folder_id(self, parent_folder_id): + """Sets the parent_folder_id of this FolderUpdateInputWithId. + + + :param parent_folder_id: The parent_folder_id of this FolderUpdateInputWithId. # noqa: E501 + :type parent_folder_id: int + """ + + self._parent_folder_id = parent_folder_id + + @property + def name(self): + """Gets the name of this FolderUpdateInputWithId. # noqa: E501 + + + :return: The name of this FolderUpdateInputWithId. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this FolderUpdateInputWithId. + + + :param name: The name of this FolderUpdateInputWithId. # noqa: E501 + :type name: str + """ + + self._name = name + + @property + def id(self): + """Gets the id of this FolderUpdateInputWithId. # noqa: E501 + + + :return: The id of this FolderUpdateInputWithId. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this FolderUpdateInputWithId. + + + :param id: The id of this FolderUpdateInputWithId. # 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, FolderUpdateInputWithId): + 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, FolderUpdateInputWithId): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/files/models/folder_update_task_locator.py b/hubspot/files/models/folder_update_task_locator.py index f25f9e50..82923b2b 100644 --- a/hubspot/files/models/folder_update_task_locator.py +++ b/hubspot/files/models/folder_update_task_locator.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/import_from_url_input.py b/hubspot/files/models/import_from_url_input.py index b7a6a835..49279340 100644 --- a/hubspot/files/models/import_from_url_input.py +++ b/hubspot/files/models/import_from_url_input.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -43,6 +43,7 @@ class ImportFromUrlInput(object): "duplicate_validation_strategy": "str", "ttl": "str", "overwrite": "bool", + "expires_at": "datetime", "url": "str", "folder_id": "str", } @@ -55,6 +56,7 @@ class ImportFromUrlInput(object): "duplicate_validation_strategy": "duplicateValidationStrategy", "ttl": "ttl", "overwrite": "overwrite", + "expires_at": "expiresAt", "url": "url", "folder_id": "folderId", } @@ -68,6 +70,7 @@ def __init__( duplicate_validation_strategy=None, ttl=None, overwrite=None, + expires_at=None, url=None, folder_id=None, local_vars_configuration=None, @@ -84,6 +87,7 @@ def __init__( self._duplicate_validation_strategy = None self._ttl = None self._overwrite = None + self._expires_at = None self._url = None self._folder_id = None self.discriminator = None @@ -101,6 +105,8 @@ def __init__( self.ttl = ttl if overwrite is not None: self.overwrite = overwrite + if expires_at is not None: + self.expires_at = expires_at self.url = url if folder_id is not None: self.folder_id = folder_id @@ -150,7 +156,7 @@ def access(self, access): """ if self.local_vars_configuration.client_side_validation and access is None: # noqa: E501 raise ValueError("Invalid value for `access`, must not be `None`") # noqa: E501 - allowed_values = ["PUBLIC_INDEXABLE", "PUBLIC_NOT_INDEXABLE", "HIDDEN_INDEXABLE", "HIDDEN_NOT_INDEXABLE", "HIDDEN_PRIVATE", "PRIVATE"] # noqa: E501 + allowed_values = ["PUBLIC_INDEXABLE", "PUBLIC_NOT_INDEXABLE", "HIDDEN_INDEXABLE", "HIDDEN_NOT_INDEXABLE", "HIDDEN_PRIVATE", "PRIVATE", "HIDDEN_SENSITIVE", "SENSITIVE"] # noqa: E501 if self.local_vars_configuration.client_side_validation and access not in allowed_values: # noqa: E501 raise ValueError("Invalid value for `access` ({0}), must be one of {1}".format(access, allowed_values)) # noqa: E501 @@ -277,6 +283,27 @@ def overwrite(self, overwrite): self._overwrite = overwrite + @property + def expires_at(self): + """Gets the expires_at of this ImportFromUrlInput. # noqa: E501 + + + :return: The expires_at of this ImportFromUrlInput. # noqa: E501 + :rtype: datetime + """ + return self._expires_at + + @expires_at.setter + def expires_at(self, expires_at): + """Sets the expires_at of this ImportFromUrlInput. + + + :param expires_at: The expires_at of this ImportFromUrlInput. # noqa: E501 + :type expires_at: datetime + """ + + self._expires_at = expires_at + @property def url(self): """Gets the url of this ImportFromUrlInput. # noqa: E501 diff --git a/hubspot/files/models/import_from_url_task_locator.py b/hubspot/files/models/import_from_url_task_locator.py index e82d1b96..3b1f345f 100644 --- a/hubspot/files/models/import_from_url_task_locator.py +++ b/hubspot/files/models/import_from_url_task_locator.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/next_page.py b/hubspot/files/models/next_page.py index aaaebb5f..3e774e2a 100644 --- a/hubspot/files/models/next_page.py +++ b/hubspot/files/models/next_page.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/paging.py b/hubspot/files/models/paging.py index 60cb97d1..f9a2f26c 100644 --- a/hubspot/files/models/paging.py +++ b/hubspot/files/models/paging.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/previous_page.py b/hubspot/files/models/previous_page.py index a5295312..a8f922a4 100644 --- a/hubspot/files/models/previous_page.py +++ b/hubspot/files/models/previous_page.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/models/signed_url.py b/hubspot/files/models/signed_url.py index 208162a5..44413ffb 100644 --- a/hubspot/files/models/signed_url.py +++ b/hubspot/files/models/signed_url.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 @@ -35,11 +35,11 @@ class SignedUrl(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"extension": "str", "size": "int", "name": "str", "width": "int", "type": "str", "expires_at": "datetime", "url": "str", "height": "int"} + openapi_types = {"extension": "str", "size": "int", "name": "str", "width": "int", "type": "str", "url": "str", "expires_at": "datetime", "height": "int"} - attribute_map = {"extension": "extension", "size": "size", "name": "name", "width": "width", "type": "type", "expires_at": "expiresAt", "url": "url", "height": "height"} + attribute_map = {"extension": "extension", "size": "size", "name": "name", "width": "width", "type": "type", "url": "url", "expires_at": "expiresAt", "height": "height"} - def __init__(self, extension=None, size=None, name=None, width=None, type=None, expires_at=None, url=None, height=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, extension=None, size=None, name=None, width=None, type=None, url=None, expires_at=None, height=None, local_vars_configuration=None): # noqa: E501 """SignedUrl - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() @@ -50,8 +50,8 @@ def __init__(self, extension=None, size=None, name=None, width=None, type=None, self._name = None self._width = None self._type = None - self._expires_at = None self._url = None + self._expires_at = None self._height = None self.discriminator = None @@ -61,8 +61,8 @@ def __init__(self, extension=None, size=None, name=None, width=None, type=None, if width is not None: self.width = width self.type = type - self.expires_at = expires_at self.url = url + self.expires_at = expires_at if height is not None: self.height = height @@ -189,31 +189,6 @@ def type(self, type): self._type = type - @property - def expires_at(self): - """Gets the expires_at of this SignedUrl. # noqa: E501 - - Timestamp of when the URL will no longer grant access to the file. # noqa: E501 - - :return: The expires_at of this SignedUrl. # noqa: E501 - :rtype: datetime - """ - return self._expires_at - - @expires_at.setter - def expires_at(self, expires_at): - """Sets the expires_at of this SignedUrl. - - Timestamp of when the URL will no longer grant access to the file. # noqa: E501 - - :param expires_at: The expires_at of this SignedUrl. # noqa: E501 - :type expires_at: datetime - """ - if self.local_vars_configuration.client_side_validation and expires_at is None: # noqa: E501 - raise ValueError("Invalid value for `expires_at`, must not be `None`") # noqa: E501 - - self._expires_at = expires_at - @property def url(self): """Gets the url of this SignedUrl. # noqa: E501 @@ -239,6 +214,31 @@ def url(self, url): self._url = url + @property + def expires_at(self): + """Gets the expires_at of this SignedUrl. # noqa: E501 + + Timestamp of when the URL will no longer grant access to the file. # noqa: E501 + + :return: The expires_at of this SignedUrl. # noqa: E501 + :rtype: datetime + """ + return self._expires_at + + @expires_at.setter + def expires_at(self, expires_at): + """Sets the expires_at of this SignedUrl. + + Timestamp of when the URL will no longer grant access to the file. # noqa: E501 + + :param expires_at: The expires_at of this SignedUrl. # noqa: E501 + :type expires_at: datetime + """ + if self.local_vars_configuration.client_side_validation and expires_at is None: # noqa: E501 + raise ValueError("Invalid value for `expires_at`, must not be `None`") # noqa: E501 + + self._expires_at = expires_at + @property def height(self): """Gets the height of this SignedUrl. # noqa: E501 diff --git a/hubspot/files/models/standard_error.py b/hubspot/files/models/standard_error.py index ed74bdf4..3a610d12 100644 --- a/hubspot/files/models/standard_error.py +++ b/hubspot/files/models/standard_error.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/hubspot/files/rest.py b/hubspot/files/rest.py index 9cb72f2f..f15bfddd 100644 --- a/hubspot/files/rest.py +++ b/hubspot/files/rest.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Files Files + Files Upload and manage files. # noqa: E501 diff --git a/tests/spec/cms/test_performance.py b/tests/spec/cms/test_performance.py deleted file mode 100644 index 1bf632c0..00000000 --- a/tests/spec/cms/test_performance.py +++ /dev/null @@ -1,7 +0,0 @@ -from hubspot import HubSpot -from hubspot.cms.performance import PublicPerformanceApi - - -def test_is_discoverable(): - apis = HubSpot().cms.performance - assert isinstance(apis.public_performance_api, PublicPerformanceApi) diff --git a/tests/spec/crm/test_tickets.py b/tests/spec/crm/test_tickets.py index 888ea1a8..e57b00d0 100644 --- a/tests/spec/crm/test_tickets.py +++ b/tests/spec/crm/test_tickets.py @@ -1,11 +1,10 @@ from hubspot import HubSpot -from hubspot.crm.tickets import BasicApi, BatchApi, MergeApi, SearchApi +from hubspot.crm.tickets import BasicApi, BatchApi, SearchApi def test_is_discoverable(): apis = HubSpot().crm.tickets assert isinstance(apis.basic_api, BasicApi) assert isinstance(apis.batch_api, BatchApi) - assert isinstance(apis.merge_api, MergeApi) assert isinstance(apis.search_api, SearchApi) assert hasattr(apis, "get_all")