From e7b1ae058641bb0f3ddab5a6d80790f9858160dd Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 23 Feb 2026 12:58:29 +0300 Subject: [PATCH] Codegen: Oauth --- hubspot/oauth/__init__.py | 9 +- hubspot/oauth/api/access_tokens_api.py | 12 +- hubspot/oauth/api/refresh_tokens_api.py | 16 +- hubspot/oauth/api/tokens_api.py | 22 +- hubspot/oauth/api_client.py | 9 +- hubspot/oauth/configuration.py | 8 +- hubspot/oauth/exceptions.py | 13 +- hubspot/oauth/models/__init__.py | 9 +- .../models/access_token_info_response.py | 322 ++++++---- hubspot/oauth/models/error.py | 128 ++-- hubspot/oauth/models/error_detail.py | 118 ++-- .../models/refresh_token_info_response.py | 206 ++++--- hubspot/oauth/models/signed_access_token.py | 552 ++++++++++++++++++ hubspot/oauth/models/token_response_if.py | 140 +++-- hubspot/oauth/rest.py | 10 +- 15 files changed, 1156 insertions(+), 418 deletions(-) create mode 100644 hubspot/oauth/models/signed_access_token.py diff --git a/hubspot/oauth/__init__.py b/hubspot/oauth/__init__.py index 8c45ad85..2f022be6 100644 --- a/hubspot/oauth/__init__.py +++ b/hubspot/oauth/__init__.py @@ -3,12 +3,12 @@ # flake8: noqa """ - Auth Oauth +Auth Oauth - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - The version of the OpenAPI document: v1 - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: v1 +Generated by: https://openapi-generator.tech """ @@ -36,4 +36,5 @@ from hubspot.oauth.models.error import Error from hubspot.oauth.models.error_detail import ErrorDetail from hubspot.oauth.models.refresh_token_info_response import RefreshTokenInfoResponse +from hubspot.oauth.models.signed_access_token import SignedAccessToken from hubspot.oauth.models.token_response_if import TokenResponseIF diff --git a/hubspot/oauth/api/access_tokens_api.py b/hubspot/oauth/api/access_tokens_api.py index 21cbc35a..0df48223 100644 --- a/hubspot/oauth/api/access_tokens_api.py +++ b/hubspot/oauth/api/access_tokens_api.py @@ -1,12 +1,12 @@ # coding: utf-8 """ - Auth Oauth +Auth Oauth - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - The version of the OpenAPI document: v1 - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: v1 +Generated by: https://openapi-generator.tech """ @@ -43,7 +43,7 @@ def get(self, token, **kwargs): # noqa: E501 >>> thread = api.get(token, async_req=True) >>> result = thread.get() - :param token: The access token that you want to retrieve information about. (required) + :param token: (required) :type token: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -73,7 +73,7 @@ def get_with_http_info(self, token, **kwargs): # noqa: E501 >>> thread = api.get_with_http_info(token, async_req=True) >>> result = thread.get() - :param token: The access token that you want to retrieve information about. (required) + :param token: (required) :type token: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional diff --git a/hubspot/oauth/api/refresh_tokens_api.py b/hubspot/oauth/api/refresh_tokens_api.py index 4aace850..1811b52e 100644 --- a/hubspot/oauth/api/refresh_tokens_api.py +++ b/hubspot/oauth/api/refresh_tokens_api.py @@ -1,12 +1,12 @@ # coding: utf-8 """ - Auth Oauth +Auth Oauth - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - The version of the OpenAPI document: v1 - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: v1 +Generated by: https://openapi-generator.tech """ @@ -43,7 +43,7 @@ def archive(self, token, **kwargs): # noqa: E501 >>> thread = api.archive(token, async_req=True) >>> result = thread.get() - :param token: The refresh token to delete. (required) + :param token: (required) :type token: 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, token, **kwargs): # noqa: E501 >>> thread = api.archive_with_http_info(token, async_req=True) >>> result = thread.get() - :param token: The refresh token to delete. (required) + :param token: (required) :type token: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -164,7 +164,7 @@ def get(self, token, **kwargs): # noqa: E501 >>> thread = api.get(token, async_req=True) >>> result = thread.get() - :param token: The refresh token to retrieve information about. (required) + :param token: (required) :type token: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -194,7 +194,7 @@ def get_with_http_info(self, token, **kwargs): # noqa: E501 >>> thread = api.get_with_http_info(token, async_req=True) >>> result = thread.get() - :param token: The refresh token to retrieve information about. (required) + :param token: (required) :type token: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional diff --git a/hubspot/oauth/api/tokens_api.py b/hubspot/oauth/api/tokens_api.py index bce38ca4..653a9492 100644 --- a/hubspot/oauth/api/tokens_api.py +++ b/hubspot/oauth/api/tokens_api.py @@ -1,12 +1,12 @@ # coding: utf-8 """ - Auth Oauth +Auth Oauth - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - The version of the OpenAPI document: v1 - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: v1 +Generated by: https://openapi-generator.tech """ @@ -55,6 +55,10 @@ def create(self, **kwargs): # noqa: E501 :type client_secret: str :param refresh_token: :type refresh_token: str + :param code_verifier: + :type code_verifier: str + :param scope: + :type scope: 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 @@ -95,6 +99,10 @@ def create_with_http_info(self, **kwargs): # noqa: E501 :type client_secret: str :param refresh_token: :type refresh_token: str + :param code_verifier: + :type code_verifier: str + :param scope: + :type scope: 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 @@ -121,7 +129,7 @@ def create_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ["grant_type", "code", "redirect_uri", "client_id", "client_secret", "refresh_token"] + all_params = ["grant_type", "code", "redirect_uri", "client_id", "client_secret", "refresh_token", "code_verifier", "scope"] 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"]): @@ -152,6 +160,10 @@ def create_with_http_info(self, **kwargs): # noqa: E501 form_params.append(("client_secret", local_var_params["client_secret"])) # noqa: E501 if "refresh_token" in local_var_params: form_params.append(("refresh_token", local_var_params["refresh_token"])) # noqa: E501 + if "code_verifier" in local_var_params: + form_params.append(("code_verifier", local_var_params["code_verifier"])) # noqa: E501 + if "scope" in local_var_params: + form_params.append(("scope", local_var_params["scope"])) # noqa: E501 body_params = None # HTTP header `Accept` diff --git a/hubspot/oauth/api_client.py b/hubspot/oauth/api_client.py index 4e7c5cd4..81969655 100644 --- a/hubspot/oauth/api_client.py +++ b/hubspot/oauth/api_client.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Auth Oauth +Auth Oauth - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - The version of the OpenAPI document: v1 - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: v1 +Generated by: https://openapi-generator.tech """ from __future__ import absolute_import @@ -135,6 +135,7 @@ def __call_api( _host=None, _request_auth=None, ): + config = self.configuration # header parameters diff --git a/hubspot/oauth/configuration.py b/hubspot/oauth/configuration.py index 0ceb15dd..cba10d6c 100644 --- a/hubspot/oauth/configuration.py +++ b/hubspot/oauth/configuration.py @@ -1,12 +1,12 @@ # coding: utf-8 """ - Auth Oauth +Auth Oauth - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - The version of the OpenAPI document: v1 - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: v1 +Generated by: https://openapi-generator.tech """ diff --git a/hubspot/oauth/exceptions.py b/hubspot/oauth/exceptions.py index 38f53b9f..615759f2 100644 --- a/hubspot/oauth/exceptions.py +++ b/hubspot/oauth/exceptions.py @@ -1,12 +1,12 @@ # coding: utf-8 """ - Auth Oauth +Auth Oauth - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - The version of the OpenAPI document: v1 - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: v1 +Generated by: https://openapi-generator.tech """ @@ -100,6 +100,7 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): + def __init__(self, status=None, reason=None, http_resp=None): if http_resp: self.status = http_resp.status @@ -125,21 +126,25 @@ def __str__(self): 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) diff --git a/hubspot/oauth/models/__init__.py b/hubspot/oauth/models/__init__.py index e0ff7132..0f0b6c2b 100644 --- a/hubspot/oauth/models/__init__.py +++ b/hubspot/oauth/models/__init__.py @@ -2,12 +2,12 @@ # flake8: noqa """ - Auth Oauth +Auth Oauth - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - The version of the OpenAPI document: v1 - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: v1 +Generated by: https://openapi-generator.tech """ @@ -18,4 +18,5 @@ from hubspot.oauth.models.error import Error from hubspot.oauth.models.error_detail import ErrorDetail from hubspot.oauth.models.refresh_token_info_response import RefreshTokenInfoResponse +from hubspot.oauth.models.signed_access_token import SignedAccessToken from hubspot.oauth.models.token_response_if import TokenResponseIF diff --git a/hubspot/oauth/models/access_token_info_response.py b/hubspot/oauth/models/access_token_info_response.py index f4cb42d1..5d27fa0a 100644 --- a/hubspot/oauth/models/access_token_info_response.py +++ b/hubspot/oauth/models/access_token_info_response.py @@ -1,12 +1,12 @@ # coding: utf-8 """ - Auth Oauth +Auth Oauth - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - The version of the OpenAPI document: v1 - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: v1 +Generated by: https://openapi-generator.tech """ @@ -35,53 +35,161 @@ class AccessTokenInfoResponse(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"hub_id": "int", "user_id": "int", "scopes": "list[str]", "token_type": "str", "user": "str", "hub_domain": "str", "app_id": "int", "expires_in": "int", "token": "str"} + openapi_types = { + "app_id": "int", + "expires_in": "int", + "hub_domain": "str", + "hub_id": "int", + "is_private_distribution": "bool", + "scopes": "list[str]", + "signed_access_token": "SignedAccessToken", + "token": "str", + "token_type": "str", + "user": "str", + "user_id": "int", + } attribute_map = { + "app_id": "app_id", + "expires_in": "expires_in", + "hub_domain": "hub_domain", "hub_id": "hub_id", - "user_id": "user_id", + "is_private_distribution": "is_private_distribution", "scopes": "scopes", + "signed_access_token": "signed_access_token", + "token": "token", "token_type": "token_type", "user": "user", - "hub_domain": "hub_domain", - "app_id": "app_id", - "expires_in": "expires_in", - "token": "token", + "user_id": "user_id", } - def __init__(self, hub_id=None, user_id=None, scopes=None, token_type=None, user=None, hub_domain=None, app_id=None, expires_in=None, token=None, local_vars_configuration=None): # noqa: E501 + def __init__( + self, + app_id=None, + expires_in=None, + hub_domain=None, + hub_id=None, + is_private_distribution=None, + scopes=None, + signed_access_token=None, + token=None, + token_type=None, + user=None, + user_id=None, + local_vars_configuration=None, + ): # noqa: E501 """AccessTokenInfoResponse - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration + self._app_id = None + self._expires_in = None + self._hub_domain = None self._hub_id = None - self._user_id = None + self._is_private_distribution = None self._scopes = None + self._signed_access_token = None + self._token = None self._token_type = None self._user = None - self._hub_domain = None - self._app_id = None - self._expires_in = None - self._token = None + self._user_id = None self.discriminator = None + self.app_id = app_id + self.expires_in = expires_in + if hub_domain is not None: + self.hub_domain = hub_domain self.hub_id = hub_id - self.user_id = user_id + if is_private_distribution is not None: + self.is_private_distribution = is_private_distribution self.scopes = scopes + if signed_access_token is not None: + self.signed_access_token = signed_access_token + self.token = token self.token_type = token_type if user is not None: self.user = user - if hub_domain is not None: - self.hub_domain = hub_domain - self.app_id = app_id - self.expires_in = expires_in - self.token = token + self.user_id = user_id + + @property + def app_id(self): + """Gets the app_id of this AccessTokenInfoResponse. # noqa: E501 + + The ID of the application associated with the access token. # noqa: E501 + + :return: The app_id of this AccessTokenInfoResponse. # noqa: E501 + :rtype: int + """ + return self._app_id + + @app_id.setter + def app_id(self, app_id): + """Sets the app_id of this AccessTokenInfoResponse. + + The ID of the application associated with the access token. # noqa: E501 + + :param app_id: The app_id of this AccessTokenInfoResponse. # noqa: E501 + :type app_id: int + """ + if self.local_vars_configuration.client_side_validation and app_id is None: # noqa: E501 + raise ValueError("Invalid value for `app_id`, must not be `None`") # noqa: E501 + + self._app_id = app_id + + @property + def expires_in(self): + """Gets the expires_in of this AccessTokenInfoResponse. # noqa: E501 + + The time in seconds until the access token expires. # noqa: E501 + + :return: The expires_in of this AccessTokenInfoResponse. # noqa: E501 + :rtype: int + """ + return self._expires_in + + @expires_in.setter + def expires_in(self, expires_in): + """Sets the expires_in of this AccessTokenInfoResponse. + + The time in seconds until the access token expires. # noqa: E501 + + :param expires_in: The expires_in of this AccessTokenInfoResponse. # noqa: E501 + :type expires_in: int + """ + if self.local_vars_configuration.client_side_validation and expires_in is None: # noqa: E501 + raise ValueError("Invalid value for `expires_in`, must not be `None`") # noqa: E501 + + self._expires_in = expires_in + + @property + def hub_domain(self): + """Gets the hub_domain of this AccessTokenInfoResponse. # noqa: E501 + + The domain of the HubSpot account associated with the access token. # noqa: E501 + + :return: The hub_domain of this AccessTokenInfoResponse. # noqa: E501 + :rtype: str + """ + return self._hub_domain + + @hub_domain.setter + def hub_domain(self, hub_domain): + """Sets the hub_domain of this AccessTokenInfoResponse. + + The domain of the HubSpot account associated with the access token. # noqa: E501 + + :param hub_domain: The hub_domain of this AccessTokenInfoResponse. # noqa: E501 + :type hub_domain: str + """ + + self._hub_domain = hub_domain @property def hub_id(self): """Gets the hub_id of this AccessTokenInfoResponse. # noqa: E501 + The ID of the HubSpot account associated with the access token. # noqa: E501 :return: The hub_id of this AccessTokenInfoResponse. # noqa: E501 :rtype: int @@ -92,6 +200,7 @@ def hub_id(self): def hub_id(self, hub_id): """Sets the hub_id of this AccessTokenInfoResponse. + The ID of the HubSpot account associated with the access token. # noqa: E501 :param hub_id: The hub_id of this AccessTokenInfoResponse. # noqa: E501 :type hub_id: int @@ -102,27 +211,27 @@ def hub_id(self, hub_id): self._hub_id = hub_id @property - def user_id(self): - """Gets the user_id of this AccessTokenInfoResponse. # noqa: E501 + def is_private_distribution(self): + """Gets the is_private_distribution of this AccessTokenInfoResponse. # noqa: E501 + Indicates whether the token is for a privately distributed application. If false, it is marketplace distributed. # noqa: E501 - :return: The user_id of this AccessTokenInfoResponse. # noqa: E501 - :rtype: int + :return: The is_private_distribution of this AccessTokenInfoResponse. # noqa: E501 + :rtype: bool """ - return self._user_id + return self._is_private_distribution - @user_id.setter - def user_id(self, user_id): - """Sets the user_id of this AccessTokenInfoResponse. + @is_private_distribution.setter + def is_private_distribution(self, is_private_distribution): + """Sets the is_private_distribution of this AccessTokenInfoResponse. + Indicates whether the token is for a privately distributed application. If false, it is marketplace distributed. # noqa: E501 - :param user_id: The user_id of this AccessTokenInfoResponse. # noqa: E501 - :type user_id: int + :param is_private_distribution: The is_private_distribution of this AccessTokenInfoResponse. # noqa: E501 + :type is_private_distribution: bool """ - if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 - raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 - self._user_id = user_id + self._is_private_distribution = is_private_distribution @property def scopes(self): @@ -147,10 +256,57 @@ def scopes(self, scopes): self._scopes = scopes + @property + def signed_access_token(self): + """Gets the signed_access_token of this AccessTokenInfoResponse. # noqa: E501 + + + :return: The signed_access_token of this AccessTokenInfoResponse. # noqa: E501 + :rtype: SignedAccessToken + """ + return self._signed_access_token + + @signed_access_token.setter + def signed_access_token(self, signed_access_token): + """Sets the signed_access_token of this AccessTokenInfoResponse. + + + :param signed_access_token: The signed_access_token of this AccessTokenInfoResponse. # noqa: E501 + :type signed_access_token: SignedAccessToken + """ + + self._signed_access_token = signed_access_token + + @property + def token(self): + """Gets the token of this AccessTokenInfoResponse. # noqa: E501 + + The access token string used to make API calls. # noqa: E501 + + :return: The token of this AccessTokenInfoResponse. # noqa: E501 + :rtype: str + """ + return self._token + + @token.setter + def token(self, token): + """Sets the token of this AccessTokenInfoResponse. + + The access token string used to make API calls. # noqa: E501 + + :param token: The token of this AccessTokenInfoResponse. # noqa: E501 + :type token: str + """ + if self.local_vars_configuration.client_side_validation and token is None: # noqa: E501 + raise ValueError("Invalid value for `token`, must not be `None`") # noqa: E501 + + self._token = token + @property def token_type(self): """Gets the token_type of this AccessTokenInfoResponse. # noqa: E501 + The type of token, typically indicating the authentication scheme. Typically `bearer`. # noqa: E501 :return: The token_type of this AccessTokenInfoResponse. # noqa: E501 :rtype: str @@ -161,6 +317,7 @@ def token_type(self): def token_type(self, token_type): """Sets the token_type of this AccessTokenInfoResponse. + The type of token, typically indicating the authentication scheme. Typically `bearer`. # noqa: E501 :param token_type: The token_type of this AccessTokenInfoResponse. # noqa: E501 :type token_type: str @@ -174,6 +331,7 @@ def token_type(self, token_type): def user(self): """Gets the user of this AccessTokenInfoResponse. # noqa: E501 + The email address of the hubspot user for whom the access token was created. # noqa: E501 :return: The user of this AccessTokenInfoResponse. # noqa: E501 :rtype: str @@ -184,6 +342,7 @@ def user(self): def user(self, user): """Sets the user of this AccessTokenInfoResponse. + The email address of the hubspot user for whom the access token was created. # noqa: E501 :param user: The user of this AccessTokenInfoResponse. # noqa: E501 :type user: str @@ -192,94 +351,29 @@ def user(self, user): self._user = user @property - def hub_domain(self): - """Gets the hub_domain of this AccessTokenInfoResponse. # noqa: E501 - - - :return: The hub_domain of this AccessTokenInfoResponse. # noqa: E501 - :rtype: str - """ - return self._hub_domain - - @hub_domain.setter - def hub_domain(self, hub_domain): - """Sets the hub_domain of this AccessTokenInfoResponse. - - - :param hub_domain: The hub_domain of this AccessTokenInfoResponse. # noqa: E501 - :type hub_domain: str - """ - - self._hub_domain = hub_domain - - @property - def app_id(self): - """Gets the app_id of this AccessTokenInfoResponse. # noqa: E501 - - - :return: The app_id of this AccessTokenInfoResponse. # noqa: E501 - :rtype: int - """ - return self._app_id - - @app_id.setter - def app_id(self, app_id): - """Sets the app_id of this AccessTokenInfoResponse. - - - :param app_id: The app_id of this AccessTokenInfoResponse. # noqa: E501 - :type app_id: int - """ - if self.local_vars_configuration.client_side_validation and app_id is None: # noqa: E501 - raise ValueError("Invalid value for `app_id`, must not be `None`") # noqa: E501 - - self._app_id = app_id - - @property - def expires_in(self): - """Gets the expires_in of this AccessTokenInfoResponse. # noqa: E501 + def user_id(self): + """Gets the user_id of this AccessTokenInfoResponse. # noqa: E501 + The ID of the hubspot user for whom the access token was created. # noqa: E501 - :return: The expires_in of this AccessTokenInfoResponse. # noqa: E501 + :return: The user_id of this AccessTokenInfoResponse. # noqa: E501 :rtype: int """ - return self._expires_in - - @expires_in.setter - def expires_in(self, expires_in): - """Sets the expires_in of this AccessTokenInfoResponse. - - - :param expires_in: The expires_in of this AccessTokenInfoResponse. # noqa: E501 - :type expires_in: int - """ - if self.local_vars_configuration.client_side_validation and expires_in is None: # noqa: E501 - raise ValueError("Invalid value for `expires_in`, must not be `None`") # noqa: E501 - - self._expires_in = expires_in - - @property - def token(self): - """Gets the token of this AccessTokenInfoResponse. # noqa: E501 - - - :return: The token of this AccessTokenInfoResponse. # noqa: E501 - :rtype: str - """ - return self._token + return self._user_id - @token.setter - def token(self, token): - """Sets the token of this AccessTokenInfoResponse. + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this AccessTokenInfoResponse. + The ID of the hubspot user for whom the access token was created. # noqa: E501 - :param token: The token of this AccessTokenInfoResponse. # noqa: E501 - :type token: str + :param user_id: The user_id of this AccessTokenInfoResponse. # noqa: E501 + :type user_id: int """ - if self.local_vars_configuration.client_side_validation and token is None: # noqa: E501 - raise ValueError("Invalid value for `token`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 - self._token = token + self._user_id = user_id def to_dict(self, serialize=False): """Returns the model properties as a dict""" diff --git a/hubspot/oauth/models/error.py b/hubspot/oauth/models/error.py index a41052e1..7b0d8628 100644 --- a/hubspot/oauth/models/error.py +++ b/hubspot/oauth/models/error.py @@ -1,12 +1,12 @@ # coding: utf-8 """ - Auth Oauth +Auth Oauth - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - The version of the OpenAPI document: v1 - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: v1 +Generated by: https://openapi-generator.tech """ @@ -35,59 +35,61 @@ class Error(object): 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]"} + openapi_types = {"category": "str", "context": "dict[str, list[str]]", "correlation_id": "str", "errors": "list[ErrorDetail]", "links": "dict[str, str]", "message": "str", "sub_category": "str"} - attribute_map = {"sub_category": "subCategory", "context": "context", "correlation_id": "correlationId", "links": "links", "message": "message", "category": "category", "errors": "errors"} + attribute_map = {"category": "category", "context": "context", "correlation_id": "correlationId", "errors": "errors", "links": "links", "message": "message", "sub_category": "subCategory"} - 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 + def __init__(self, category=None, context=None, correlation_id=None, errors=None, links=None, message=None, sub_category=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._category = None self._context = None self._correlation_id = None + self._errors = None self._links = None self._message = None - self._category = None - self._errors = None + self._sub_category = None self.discriminator = None - if sub_category is not None: - self.sub_category = sub_category + self.category = category if context is not None: self.context = context self.correlation_id = correlation_id + if errors is not None: + self.errors = errors if links is not None: self.links = links self.message = message - self.category = category - if errors is not None: - self.errors = errors + if sub_category is not None: + self.sub_category = sub_category @property - def sub_category(self): - """Gets the sub_category of this Error. # noqa: E501 + def category(self): + """Gets the category of this Error. # noqa: E501 - A specific category that contains more specific detail about the error # noqa: E501 + The error category # noqa: E501 - :return: The sub_category of this Error. # noqa: E501 + :return: The category of this Error. # noqa: E501 :rtype: str """ - return self._sub_category + return self._category - @sub_category.setter - def sub_category(self, sub_category): - """Sets the sub_category of this Error. + @category.setter + def category(self, category): + """Sets the category of this Error. - A specific category that contains more specific detail about the error # noqa: E501 + The error category # noqa: E501 - :param sub_category: The sub_category of this Error. # noqa: E501 - :type sub_category: str + :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._sub_category = sub_category + self._category = category @property def context(self): @@ -137,6 +139,29 @@ def correlation_id(self, correlation_id): self._correlation_id = correlation_id + @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 + @property def links(self): """Gets the links of this Error. # noqa: E501 @@ -186,52 +211,27 @@ def message(self, message): self._message = message @property - def category(self): - """Gets the category of this Error. # noqa: E501 + def sub_category(self): + """Gets the sub_category of this Error. # noqa: E501 - The error category # noqa: E501 + A specific category that contains more specific detail about the error # noqa: E501 - :return: The category of this Error. # noqa: E501 + :return: The sub_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 + return self._sub_category - @errors.setter - def errors(self, errors): - """Sets the errors of this Error. + @sub_category.setter + def sub_category(self, sub_category): + """Sets the sub_category of this Error. - further information about the error # noqa: E501 + A specific category that contains more specific detail about the error # noqa: E501 - :param errors: The errors of this Error. # noqa: E501 - :type errors: list[ErrorDetail] + :param sub_category: The sub_category of this Error. # noqa: E501 + :type sub_category: str """ - self._errors = errors + self._sub_category = sub_category def to_dict(self, serialize=False): """Returns the model properties as a dict""" diff --git a/hubspot/oauth/models/error_detail.py b/hubspot/oauth/models/error_detail.py index 0beecbb2..11f1a6ae 100644 --- a/hubspot/oauth/models/error_detail.py +++ b/hubspot/oauth/models/error_detail.py @@ -1,12 +1,12 @@ # coding: utf-8 """ - Auth Oauth +Auth Oauth - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - The version of the OpenAPI document: v1 - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: v1 +Generated by: https://openapi-generator.tech """ @@ -35,55 +35,32 @@ class ErrorDetail(object): 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"} + openapi_types = {"code": "str", "context": "dict[str, list[str]]", "_in": "str", "message": "str", "sub_category": "str"} - attribute_map = {"sub_category": "subCategory", "code": "code", "_in": "in", "context": "context", "message": "message"} + attribute_map = {"code": "code", "context": "context", "_in": "in", "message": "message", "sub_category": "subCategory"} - def __init__(self, sub_category=None, code=None, _in=None, context=None, message=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, code=None, context=None, _in=None, message=None, sub_category=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.__in = None self._message = None + self._sub_category = 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 + if _in is not None: + self._in = _in 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 + if sub_category is not None: + self.sub_category = sub_category @property def code(self): @@ -108,29 +85,6 @@ def code(self, code): 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 @@ -154,6 +108,29 @@ def context(self, context): self._context = context + @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 message(self): """Gets the message of this ErrorDetail. # noqa: E501 @@ -179,6 +156,29 @@ def message(self, message): 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 + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} diff --git a/hubspot/oauth/models/refresh_token_info_response.py b/hubspot/oauth/models/refresh_token_info_response.py index fb15becc..205cd350 100644 --- a/hubspot/oauth/models/refresh_token_info_response.py +++ b/hubspot/oauth/models/refresh_token_info_response.py @@ -1,12 +1,12 @@ # coding: utf-8 """ - Auth Oauth +Auth Oauth - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - The version of the OpenAPI document: v1 - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: v1 +Generated by: https://openapi-generator.tech """ @@ -35,41 +35,90 @@ class RefreshTokenInfoResponse(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"hub_id": "int", "user_id": "int", "scopes": "list[str]", "token_type": "str", "user": "str", "hub_domain": "str", "client_id": "str", "token": "str"} + openapi_types = {"client_id": "str", "hub_domain": "str", "hub_id": "int", "scopes": "list[str]", "token": "str", "token_type": "str", "user": "str", "user_id": "int"} - attribute_map = {"hub_id": "hub_id", "user_id": "user_id", "scopes": "scopes", "token_type": "token_type", "user": "user", "hub_domain": "hub_domain", "client_id": "client_id", "token": "token"} + attribute_map = {"client_id": "client_id", "hub_domain": "hub_domain", "hub_id": "hub_id", "scopes": "scopes", "token": "token", "token_type": "token_type", "user": "user", "user_id": "user_id"} - def __init__(self, hub_id=None, user_id=None, scopes=None, token_type=None, user=None, hub_domain=None, client_id=None, token=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, client_id=None, hub_domain=None, hub_id=None, scopes=None, token=None, token_type=None, user=None, user_id=None, local_vars_configuration=None): # noqa: E501 """RefreshTokenInfoResponse - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration + self._client_id = None + self._hub_domain = None self._hub_id = None - self._user_id = None self._scopes = None + self._token = None self._token_type = None self._user = None - self._hub_domain = None - self._client_id = None - self._token = None + self._user_id = None self.discriminator = None + self.client_id = client_id + if hub_domain is not None: + self.hub_domain = hub_domain self.hub_id = hub_id - self.user_id = user_id self.scopes = scopes + self.token = token self.token_type = token_type if user is not None: self.user = user - if hub_domain is not None: - self.hub_domain = hub_domain - self.client_id = client_id - self.token = token + self.user_id = user_id + + @property + def client_id(self): + """Gets the client_id of this RefreshTokenInfoResponse. # noqa: E501 + + The client ID of the application that the refresh token was issued for. # noqa: E501 + + :return: The client_id of this RefreshTokenInfoResponse. # noqa: E501 + :rtype: str + """ + return self._client_id + + @client_id.setter + def client_id(self, client_id): + """Sets the client_id of this RefreshTokenInfoResponse. + + The client ID of the application that the refresh token was issued for. # noqa: E501 + + :param client_id: The client_id of this RefreshTokenInfoResponse. # noqa: E501 + :type client_id: str + """ + if self.local_vars_configuration.client_side_validation and client_id is None: # noqa: E501 + raise ValueError("Invalid value for `client_id`, must not be `None`") # noqa: E501 + + self._client_id = client_id + + @property + def hub_domain(self): + """Gets the hub_domain of this RefreshTokenInfoResponse. # noqa: E501 + + The domain of the HubSpot account associated with the refresh token. # noqa: E501 + + :return: The hub_domain of this RefreshTokenInfoResponse. # noqa: E501 + :rtype: str + """ + return self._hub_domain + + @hub_domain.setter + def hub_domain(self, hub_domain): + """Sets the hub_domain of this RefreshTokenInfoResponse. + + The domain of the HubSpot account associated with the refresh token. # noqa: E501 + + :param hub_domain: The hub_domain of this RefreshTokenInfoResponse. # noqa: E501 + :type hub_domain: str + """ + + self._hub_domain = hub_domain @property def hub_id(self): """Gets the hub_id of this RefreshTokenInfoResponse. # noqa: E501 + The ID of the HubSpot account associated with the refresh token. # noqa: E501 :return: The hub_id of this RefreshTokenInfoResponse. # noqa: E501 :rtype: int @@ -80,6 +129,7 @@ def hub_id(self): def hub_id(self, hub_id): """Sets the hub_id of this RefreshTokenInfoResponse. + The ID of the HubSpot account associated with the refresh token. # noqa: E501 :param hub_id: The hub_id of this RefreshTokenInfoResponse. # noqa: E501 :type hub_id: int @@ -89,29 +139,6 @@ def hub_id(self, hub_id): self._hub_id = hub_id - @property - def user_id(self): - """Gets the user_id of this RefreshTokenInfoResponse. # noqa: E501 - - - :return: The user_id of this RefreshTokenInfoResponse. # noqa: E501 - :rtype: int - """ - return self._user_id - - @user_id.setter - def user_id(self, user_id): - """Sets the user_id of this RefreshTokenInfoResponse. - - - :param user_id: The user_id of this RefreshTokenInfoResponse. # noqa: E501 - :type user_id: int - """ - if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 - raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 - - self._user_id = user_id - @property def scopes(self): """Gets the scopes of this RefreshTokenInfoResponse. # noqa: E501 @@ -135,10 +162,36 @@ def scopes(self, scopes): self._scopes = scopes + @property + def token(self): + """Gets the token of this RefreshTokenInfoResponse. # noqa: E501 + + The access token string used to make API calls. # noqa: E501 + + :return: The token of this RefreshTokenInfoResponse. # noqa: E501 + :rtype: str + """ + return self._token + + @token.setter + def token(self, token): + """Sets the token of this RefreshTokenInfoResponse. + + The access token string used to make API calls. # noqa: E501 + + :param token: The token of this RefreshTokenInfoResponse. # noqa: E501 + :type token: str + """ + if self.local_vars_configuration.client_side_validation and token is None: # noqa: E501 + raise ValueError("Invalid value for `token`, must not be `None`") # noqa: E501 + + self._token = token + @property def token_type(self): """Gets the token_type of this RefreshTokenInfoResponse. # noqa: E501 + The type of token, typically indicating the OAuth token type. Typically `bearer`. # noqa: E501 :return: The token_type of this RefreshTokenInfoResponse. # noqa: E501 :rtype: str @@ -149,6 +202,7 @@ def token_type(self): def token_type(self, token_type): """Sets the token_type of this RefreshTokenInfoResponse. + The type of token, typically indicating the OAuth token type. Typically `bearer`. # noqa: E501 :param token_type: The token_type of this RefreshTokenInfoResponse. # noqa: E501 :type token_type: str @@ -162,6 +216,7 @@ def token_type(self, token_type): def user(self): """Gets the user of this RefreshTokenInfoResponse. # noqa: E501 + The email address of the hubspot user associated with the refresh token. # noqa: E501 :return: The user of this RefreshTokenInfoResponse. # noqa: E501 :rtype: str @@ -172,6 +227,7 @@ def user(self): def user(self, user): """Sets the user of this RefreshTokenInfoResponse. + The email address of the hubspot user associated with the refresh token. # noqa: E501 :param user: The user of this RefreshTokenInfoResponse. # noqa: E501 :type user: str @@ -180,71 +236,29 @@ def user(self, user): self._user = user @property - def hub_domain(self): - """Gets the hub_domain of this RefreshTokenInfoResponse. # noqa: E501 - - - :return: The hub_domain of this RefreshTokenInfoResponse. # noqa: E501 - :rtype: str - """ - return self._hub_domain - - @hub_domain.setter - def hub_domain(self, hub_domain): - """Sets the hub_domain of this RefreshTokenInfoResponse. - - - :param hub_domain: The hub_domain of this RefreshTokenInfoResponse. # noqa: E501 - :type hub_domain: str - """ - - self._hub_domain = hub_domain - - @property - def client_id(self): - """Gets the client_id of this RefreshTokenInfoResponse. # noqa: E501 - - - :return: The client_id of this RefreshTokenInfoResponse. # noqa: E501 - :rtype: str - """ - return self._client_id - - @client_id.setter - def client_id(self, client_id): - """Sets the client_id of this RefreshTokenInfoResponse. - - - :param client_id: The client_id of this RefreshTokenInfoResponse. # noqa: E501 - :type client_id: str - """ - if self.local_vars_configuration.client_side_validation and client_id is None: # noqa: E501 - raise ValueError("Invalid value for `client_id`, must not be `None`") # noqa: E501 - - self._client_id = client_id - - @property - def token(self): - """Gets the token of this RefreshTokenInfoResponse. # noqa: E501 + def user_id(self): + """Gets the user_id of this RefreshTokenInfoResponse. # noqa: E501 + The ID of the hubspot user associated with the refresh token. # noqa: E501 - :return: The token of this RefreshTokenInfoResponse. # noqa: E501 - :rtype: str + :return: The user_id of this RefreshTokenInfoResponse. # noqa: E501 + :rtype: int """ - return self._token + return self._user_id - @token.setter - def token(self, token): - """Sets the token of this RefreshTokenInfoResponse. + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this RefreshTokenInfoResponse. + The ID of the hubspot user associated with the refresh token. # noqa: E501 - :param token: The token of this RefreshTokenInfoResponse. # noqa: E501 - :type token: str + :param user_id: The user_id of this RefreshTokenInfoResponse. # noqa: E501 + :type user_id: int """ - if self.local_vars_configuration.client_side_validation and token is None: # noqa: E501 - raise ValueError("Invalid value for `token`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 - self._token = token + self._user_id = user_id def to_dict(self, serialize=False): """Returns the model properties as a dict""" diff --git a/hubspot/oauth/models/signed_access_token.py b/hubspot/oauth/models/signed_access_token.py new file mode 100644 index 00000000..54bdbc58 --- /dev/null +++ b/hubspot/oauth/models/signed_access_token.py @@ -0,0 +1,552 @@ +# coding: utf-8 + +""" +Auth Oauth + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + +The version of the OpenAPI document: v1 +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.oauth.configuration import Configuration + + +class SignedAccessToken(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 = { + "app_id": "int", + "expires_at": "int", + "hub_id": "int", + "hublet": "str", + "installing_user_id": "int", + "is_private_distribution": "bool", + "is_service_account": "bool", + "is_user_level": "bool", + "new_signature": "str", + "scope_to_scope_group_pks": "str", + "scopes": "str", + "signature": "str", + "trial_scope_to_scope_group_pks": "str", + "trial_scopes": "str", + "user_id": "int", + } + + attribute_map = { + "app_id": "appId", + "expires_at": "expiresAt", + "hub_id": "hubId", + "hublet": "hublet", + "installing_user_id": "installingUserId", + "is_private_distribution": "isPrivateDistribution", + "is_service_account": "isServiceAccount", + "is_user_level": "isUserLevel", + "new_signature": "newSignature", + "scope_to_scope_group_pks": "scopeToScopeGroupPks", + "scopes": "scopes", + "signature": "signature", + "trial_scope_to_scope_group_pks": "trialScopeToScopeGroupPks", + "trial_scopes": "trialScopes", + "user_id": "userId", + } + + def __init__( + self, + app_id=None, + expires_at=None, + hub_id=None, + hublet=None, + installing_user_id=None, + is_private_distribution=None, + is_service_account=None, + is_user_level=None, + new_signature=None, + scope_to_scope_group_pks=None, + scopes=None, + signature=None, + trial_scope_to_scope_group_pks=None, + trial_scopes=None, + user_id=None, + local_vars_configuration=None, + ): # noqa: E501 + """SignedAccessToken - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._app_id = None + self._expires_at = None + self._hub_id = None + self._hublet = None + self._installing_user_id = None + self._is_private_distribution = None + self._is_service_account = None + self._is_user_level = None + self._new_signature = None + self._scope_to_scope_group_pks = None + self._scopes = None + self._signature = None + self._trial_scope_to_scope_group_pks = None + self._trial_scopes = None + self._user_id = None + self.discriminator = None + + self.app_id = app_id + self.expires_at = expires_at + self.hub_id = hub_id + self.hublet = hublet + self.installing_user_id = installing_user_id + self.is_private_distribution = is_private_distribution + self.is_service_account = is_service_account + self.is_user_level = is_user_level + self.new_signature = new_signature + self.scope_to_scope_group_pks = scope_to_scope_group_pks + self.scopes = scopes + self.signature = signature + self.trial_scope_to_scope_group_pks = trial_scope_to_scope_group_pks + self.trial_scopes = trial_scopes + self.user_id = user_id + + @property + def app_id(self): + """Gets the app_id of this SignedAccessToken. # noqa: E501 + + The ID of the application associated with the access token. # noqa: E501 + + :return: The app_id of this SignedAccessToken. # noqa: E501 + :rtype: int + """ + return self._app_id + + @app_id.setter + def app_id(self, app_id): + """Sets the app_id of this SignedAccessToken. + + The ID of the application associated with the access token. # noqa: E501 + + :param app_id: The app_id of this SignedAccessToken. # noqa: E501 + :type app_id: int + """ + if self.local_vars_configuration.client_side_validation and app_id is None: # noqa: E501 + raise ValueError("Invalid value for `app_id`, must not be `None`") # noqa: E501 + + self._app_id = app_id + + @property + def expires_at(self): + """Gets the expires_at of this SignedAccessToken. # noqa: E501 + + The timestamp indicating when the access token will expire. # noqa: E501 + + :return: The expires_at of this SignedAccessToken. # noqa: E501 + :rtype: int + """ + return self._expires_at + + @expires_at.setter + def expires_at(self, expires_at): + """Sets the expires_at of this SignedAccessToken. + + The timestamp indicating when the access token will expire. # noqa: E501 + + :param expires_at: The expires_at of this SignedAccessToken. # noqa: E501 + :type expires_at: int + """ + 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 hub_id(self): + """Gets the hub_id of this SignedAccessToken. # noqa: E501 + + The ID of the HubSpot account associated with the access token. # noqa: E501 + + :return: The hub_id of this SignedAccessToken. # noqa: E501 + :rtype: int + """ + return self._hub_id + + @hub_id.setter + def hub_id(self, hub_id): + """Sets the hub_id of this SignedAccessToken. + + The ID of the HubSpot account associated with the access token. # noqa: E501 + + :param hub_id: The hub_id of this SignedAccessToken. # noqa: E501 + :type hub_id: int + """ + if self.local_vars_configuration.client_side_validation and hub_id is None: # noqa: E501 + raise ValueError("Invalid value for `hub_id`, must not be `None`") # noqa: E501 + + self._hub_id = hub_id + + @property + def hublet(self): + """Gets the hublet of this SignedAccessToken. # noqa: E501 + + The specific regional data center where the account is hosted. # noqa: E501 + + :return: The hublet of this SignedAccessToken. # noqa: E501 + :rtype: str + """ + return self._hublet + + @hublet.setter + def hublet(self, hublet): + """Sets the hublet of this SignedAccessToken. + + The specific regional data center where the account is hosted. # noqa: E501 + + :param hublet: The hublet of this SignedAccessToken. # noqa: E501 + :type hublet: str + """ + if self.local_vars_configuration.client_side_validation and hublet is None: # noqa: E501 + raise ValueError("Invalid value for `hublet`, must not be `None`") # noqa: E501 + + self._hublet = hublet + + @property + def installing_user_id(self): + """Gets the installing_user_id of this SignedAccessToken. # noqa: E501 + + The ID of the user who installed the application. # noqa: E501 + + :return: The installing_user_id of this SignedAccessToken. # noqa: E501 + :rtype: int + """ + return self._installing_user_id + + @installing_user_id.setter + def installing_user_id(self, installing_user_id): + """Sets the installing_user_id of this SignedAccessToken. + + The ID of the user who installed the application. # noqa: E501 + + :param installing_user_id: The installing_user_id of this SignedAccessToken. # noqa: E501 + :type installing_user_id: int + """ + if self.local_vars_configuration.client_side_validation and installing_user_id is None: # noqa: E501 + raise ValueError("Invalid value for `installing_user_id`, must not be `None`") # noqa: E501 + + self._installing_user_id = installing_user_id + + @property + def is_private_distribution(self): + """Gets the is_private_distribution of this SignedAccessToken. # noqa: E501 + + Indicates whether the token is for a privately distributed application. If false, it is marketplace distributed. # noqa: E501 + + :return: The is_private_distribution of this SignedAccessToken. # noqa: E501 + :rtype: bool + """ + return self._is_private_distribution + + @is_private_distribution.setter + def is_private_distribution(self, is_private_distribution): + """Sets the is_private_distribution of this SignedAccessToken. + + Indicates whether the token is for a privately distributed application. If false, it is marketplace distributed. # noqa: E501 + + :param is_private_distribution: The is_private_distribution of this SignedAccessToken. # noqa: E501 + :type is_private_distribution: bool + """ + if self.local_vars_configuration.client_side_validation and is_private_distribution is None: # noqa: E501 + raise ValueError("Invalid value for `is_private_distribution`, must not be `None`") # noqa: E501 + + self._is_private_distribution = is_private_distribution + + @property + def is_service_account(self): + """Gets the is_service_account of this SignedAccessToken. # noqa: E501 + + Indicates whether the access token is associated with a service account. Meaning it is decoupled from the user who installed it. # noqa: E501 + + :return: The is_service_account of this SignedAccessToken. # noqa: E501 + :rtype: bool + """ + return self._is_service_account + + @is_service_account.setter + def is_service_account(self, is_service_account): + """Sets the is_service_account of this SignedAccessToken. + + Indicates whether the access token is associated with a service account. Meaning it is decoupled from the user who installed it. # noqa: E501 + + :param is_service_account: The is_service_account of this SignedAccessToken. # noqa: E501 + :type is_service_account: bool + """ + if self.local_vars_configuration.client_side_validation and is_service_account is None: # noqa: E501 + raise ValueError("Invalid value for `is_service_account`, must not be `None`") # noqa: E501 + + self._is_service_account = is_service_account + + @property + def is_user_level(self): + """Gets the is_user_level of this SignedAccessToken. # noqa: E501 + + Indicates whether the access token is issued at the user level. Meaning the app is configured to allow multiple installs of the same app on a hub. # noqa: E501 + + :return: The is_user_level of this SignedAccessToken. # noqa: E501 + :rtype: bool + """ + return self._is_user_level + + @is_user_level.setter + def is_user_level(self, is_user_level): + """Sets the is_user_level of this SignedAccessToken. + + Indicates whether the access token is issued at the user level. Meaning the app is configured to allow multiple installs of the same app on a hub. # noqa: E501 + + :param is_user_level: The is_user_level of this SignedAccessToken. # noqa: E501 + :type is_user_level: bool + """ + if self.local_vars_configuration.client_side_validation and is_user_level is None: # noqa: E501 + raise ValueError("Invalid value for `is_user_level`, must not be `None`") # noqa: E501 + + self._is_user_level = is_user_level + + @property + def new_signature(self): + """Gets the new_signature of this SignedAccessToken. # noqa: E501 + + The updated cryptographic signature for the access token. # noqa: E501 + + :return: The new_signature of this SignedAccessToken. # noqa: E501 + :rtype: str + """ + return self._new_signature + + @new_signature.setter + def new_signature(self, new_signature): + """Sets the new_signature of this SignedAccessToken. + + The updated cryptographic signature for the access token. # noqa: E501 + + :param new_signature: The new_signature of this SignedAccessToken. # noqa: E501 + :type new_signature: str + """ + if self.local_vars_configuration.client_side_validation and new_signature is None: # noqa: E501 + raise ValueError("Invalid value for `new_signature`, must not be `None`") # noqa: E501 + + self._new_signature = new_signature + + @property + def scope_to_scope_group_pks(self): + """Gets the scope_to_scope_group_pks of this SignedAccessToken. # noqa: E501 + + A mapping of scopes to their corresponding scope group primary keys. # noqa: E501 + + :return: The scope_to_scope_group_pks of this SignedAccessToken. # noqa: E501 + :rtype: str + """ + return self._scope_to_scope_group_pks + + @scope_to_scope_group_pks.setter + def scope_to_scope_group_pks(self, scope_to_scope_group_pks): + """Sets the scope_to_scope_group_pks of this SignedAccessToken. + + A mapping of scopes to their corresponding scope group primary keys. # noqa: E501 + + :param scope_to_scope_group_pks: The scope_to_scope_group_pks of this SignedAccessToken. # noqa: E501 + :type scope_to_scope_group_pks: str + """ + if self.local_vars_configuration.client_side_validation and scope_to_scope_group_pks is None: # noqa: E501 + raise ValueError("Invalid value for `scope_to_scope_group_pks`, must not be `None`") # noqa: E501 + + self._scope_to_scope_group_pks = scope_to_scope_group_pks + + @property + def scopes(self): + """Gets the scopes of this SignedAccessToken. # noqa: E501 + + The permissions granted to the access token. # noqa: E501 + + :return: The scopes of this SignedAccessToken. # noqa: E501 + :rtype: str + """ + return self._scopes + + @scopes.setter + def scopes(self, scopes): + """Sets the scopes of this SignedAccessToken. + + The permissions granted to the access token. # noqa: E501 + + :param scopes: The scopes of this SignedAccessToken. # noqa: E501 + :type scopes: str + """ + if self.local_vars_configuration.client_side_validation and scopes is None: # noqa: E501 + raise ValueError("Invalid value for `scopes`, must not be `None`") # noqa: E501 + + self._scopes = scopes + + @property + def signature(self): + """Gets the signature of this SignedAccessToken. # noqa: E501 + + The cryptographic signature used to verify the integrity of the access token. # noqa: E501 + + :return: The signature of this SignedAccessToken. # noqa: E501 + :rtype: str + """ + return self._signature + + @signature.setter + def signature(self, signature): + """Sets the signature of this SignedAccessToken. + + The cryptographic signature used to verify the integrity of the access token. # noqa: E501 + + :param signature: The signature of this SignedAccessToken. # noqa: E501 + :type signature: str + """ + if self.local_vars_configuration.client_side_validation and signature is None: # noqa: E501 + raise ValueError("Invalid value for `signature`, must not be `None`") # noqa: E501 + + self._signature = signature + + @property + def trial_scope_to_scope_group_pks(self): + """Gets the trial_scope_to_scope_group_pks of this SignedAccessToken. # noqa: E501 + + A mapping of trial scopes to their corresponding scope group primary keys. # noqa: E501 + + :return: The trial_scope_to_scope_group_pks of this SignedAccessToken. # noqa: E501 + :rtype: str + """ + return self._trial_scope_to_scope_group_pks + + @trial_scope_to_scope_group_pks.setter + def trial_scope_to_scope_group_pks(self, trial_scope_to_scope_group_pks): + """Sets the trial_scope_to_scope_group_pks of this SignedAccessToken. + + A mapping of trial scopes to their corresponding scope group primary keys. # noqa: E501 + + :param trial_scope_to_scope_group_pks: The trial_scope_to_scope_group_pks of this SignedAccessToken. # noqa: E501 + :type trial_scope_to_scope_group_pks: str + """ + if self.local_vars_configuration.client_side_validation and trial_scope_to_scope_group_pks is None: # noqa: E501 + raise ValueError("Invalid value for `trial_scope_to_scope_group_pks`, must not be `None`") # noqa: E501 + + self._trial_scope_to_scope_group_pks = trial_scope_to_scope_group_pks + + @property + def trial_scopes(self): + """Gets the trial_scopes of this SignedAccessToken. # noqa: E501 + + The trial scopes included in the access token. # noqa: E501 + + :return: The trial_scopes of this SignedAccessToken. # noqa: E501 + :rtype: str + """ + return self._trial_scopes + + @trial_scopes.setter + def trial_scopes(self, trial_scopes): + """Sets the trial_scopes of this SignedAccessToken. + + The trial scopes included in the access token. # noqa: E501 + + :param trial_scopes: The trial_scopes of this SignedAccessToken. # noqa: E501 + :type trial_scopes: str + """ + if self.local_vars_configuration.client_side_validation and trial_scopes is None: # noqa: E501 + raise ValueError("Invalid value for `trial_scopes`, must not be `None`") # noqa: E501 + + self._trial_scopes = trial_scopes + + @property + def user_id(self): + """Gets the user_id of this SignedAccessToken. # noqa: E501 + + The ID of the hubspot user associated with the access token. # noqa: E501 + + :return: The user_id of this SignedAccessToken. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this SignedAccessToken. + + The ID of the hubspot user associated with the access token. # noqa: E501 + + :param user_id: The user_id of this SignedAccessToken. # noqa: E501 + :type user_id: int + """ + if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + 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, SignedAccessToken): + 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, SignedAccessToken): + return True + + return self.to_dict() != other.to_dict() diff --git a/hubspot/oauth/models/token_response_if.py b/hubspot/oauth/models/token_response_if.py index 38a0dd4f..c3fd8d25 100644 --- a/hubspot/oauth/models/token_response_if.py +++ b/hubspot/oauth/models/token_response_if.py @@ -1,12 +1,12 @@ # coding: utf-8 """ - Auth Oauth +Auth Oauth - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - The version of the OpenAPI document: v1 - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: v1 +Generated by: https://openapi-generator.tech """ @@ -35,34 +35,45 @@ class TokenResponseIF(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"access_token": "str", "refresh_token": "str", "id_token": "str", "token_type": "str", "expires_in": "int"} + openapi_types = {"access_token": "str", "expires_in": "int", "hub_id": "int", "id_token": "str", "scopes": "list[str]", "token_type": "str", "user_id": "int"} - attribute_map = {"access_token": "access_token", "refresh_token": "refresh_token", "id_token": "id_token", "token_type": "token_type", "expires_in": "expires_in"} + attribute_map = {"access_token": "accessToken", "expires_in": "expiresIn", "hub_id": "hubId", "id_token": "idToken", "scopes": "scopes", "token_type": "tokenType", "user_id": "userId"} - def __init__(self, access_token=None, refresh_token=None, id_token=None, token_type=None, expires_in=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, access_token=None, expires_in=None, hub_id=None, id_token=None, scopes=None, token_type=None, user_id=None, local_vars_configuration=None): # noqa: E501 """TokenResponseIF - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration self._access_token = None - self._refresh_token = None + self._expires_in = None + self._hub_id = None self._id_token = None + self._scopes = None self._token_type = None - self._expires_in = None + self._user_id = None self.discriminator = None - self.access_token = access_token - self.refresh_token = refresh_token + if access_token is not None: + self.access_token = access_token + if expires_in is not None: + self.expires_in = expires_in + if hub_id is not None: + self.hub_id = hub_id if id_token is not None: self.id_token = id_token - self.token_type = token_type - self.expires_in = expires_in + if scopes is not None: + self.scopes = scopes + if token_type is not None: + self.token_type = token_type + if user_id is not None: + self.user_id = user_id @property def access_token(self): """Gets the access_token of this TokenResponseIF. # noqa: E501 + The access token used for authentication in API requests. # noqa: E501 :return: The access_token of this TokenResponseIF. # noqa: E501 :rtype: str @@ -73,42 +84,65 @@ def access_token(self): def access_token(self, access_token): """Sets the access_token of this TokenResponseIF. + The access token used for authentication in API requests. # noqa: E501 :param access_token: The access_token of this TokenResponseIF. # noqa: E501 :type access_token: str """ - if self.local_vars_configuration.client_side_validation and access_token is None: # noqa: E501 - raise ValueError("Invalid value for `access_token`, must not be `None`") # noqa: E501 self._access_token = access_token @property - def refresh_token(self): - """Gets the refresh_token of this TokenResponseIF. # noqa: E501 + def expires_in(self): + """Gets the expires_in of this TokenResponseIF. # noqa: E501 + The duration in seconds for which the access token is valid. # noqa: E501 - :return: The refresh_token of this TokenResponseIF. # noqa: E501 - :rtype: str + :return: The expires_in of this TokenResponseIF. # noqa: E501 + :rtype: int """ - return self._refresh_token + return self._expires_in - @refresh_token.setter - def refresh_token(self, refresh_token): - """Sets the refresh_token of this TokenResponseIF. + @expires_in.setter + def expires_in(self, expires_in): + """Sets the expires_in of this TokenResponseIF. + The duration in seconds for which the access token is valid. # noqa: E501 - :param refresh_token: The refresh_token of this TokenResponseIF. # noqa: E501 - :type refresh_token: str + :param expires_in: The expires_in of this TokenResponseIF. # noqa: E501 + :type expires_in: int """ - if self.local_vars_configuration.client_side_validation and refresh_token is None: # noqa: E501 - raise ValueError("Invalid value for `refresh_token`, must not be `None`") # noqa: E501 - self._refresh_token = refresh_token + self._expires_in = expires_in + + @property + def hub_id(self): + """Gets the hub_id of this TokenResponseIF. # noqa: E501 + + The ID of the HubSpot account associated with the token. # noqa: E501 + + :return: The hub_id of this TokenResponseIF. # noqa: E501 + :rtype: int + """ + return self._hub_id + + @hub_id.setter + def hub_id(self, hub_id): + """Sets the hub_id of this TokenResponseIF. + + The ID of the HubSpot account associated with the token. # noqa: E501 + + :param hub_id: The hub_id of this TokenResponseIF. # noqa: E501 + :type hub_id: int + """ + + self._hub_id = hub_id @property def id_token(self): """Gets the id_token of this TokenResponseIF. # noqa: E501 + The ID token that contains identity claims about the user. # noqa: E501 :return: The id_token of this TokenResponseIF. # noqa: E501 :rtype: str @@ -119,6 +153,7 @@ def id_token(self): def id_token(self, id_token): """Sets the id_token of this TokenResponseIF. + The ID token that contains identity claims about the user. # noqa: E501 :param id_token: The id_token of this TokenResponseIF. # noqa: E501 :type id_token: str @@ -126,10 +161,32 @@ def id_token(self, id_token): self._id_token = id_token + @property + def scopes(self): + """Gets the scopes of this TokenResponseIF. # noqa: E501 + + + :return: The scopes of this TokenResponseIF. # noqa: E501 + :rtype: list[str] + """ + return self._scopes + + @scopes.setter + def scopes(self, scopes): + """Sets the scopes of this TokenResponseIF. + + + :param scopes: The scopes of this TokenResponseIF. # noqa: E501 + :type scopes: list[str] + """ + + self._scopes = scopes + @property def token_type(self): """Gets the token_type of this TokenResponseIF. # noqa: E501 + The type of token, typically indicating the authentication scheme. Typically `bearer`. # noqa: E501 :return: The token_type of this TokenResponseIF. # noqa: E501 :rtype: str @@ -140,37 +197,36 @@ def token_type(self): def token_type(self, token_type): """Sets the token_type of this TokenResponseIF. + The type of token, typically indicating the authentication scheme. Typically `bearer`. # noqa: E501 :param token_type: The token_type of this TokenResponseIF. # noqa: E501 :type token_type: str """ - if self.local_vars_configuration.client_side_validation and token_type is None: # noqa: E501 - raise ValueError("Invalid value for `token_type`, must not be `None`") # noqa: E501 self._token_type = token_type @property - def expires_in(self): - """Gets the expires_in of this TokenResponseIF. # noqa: E501 + def user_id(self): + """Gets the user_id of this TokenResponseIF. # noqa: E501 + The ID of the hubspot user for whom the token was created. # noqa: E501 - :return: The expires_in of this TokenResponseIF. # noqa: E501 + :return: The user_id of this TokenResponseIF. # noqa: E501 :rtype: int """ - return self._expires_in + return self._user_id - @expires_in.setter - def expires_in(self, expires_in): - """Sets the expires_in of this TokenResponseIF. + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this TokenResponseIF. + The ID of the hubspot user for whom the token was created. # noqa: E501 - :param expires_in: The expires_in of this TokenResponseIF. # noqa: E501 - :type expires_in: int + :param user_id: The user_id of this TokenResponseIF. # noqa: E501 + :type user_id: int """ - if self.local_vars_configuration.client_side_validation and expires_in is None: # noqa: E501 - raise ValueError("Invalid value for `expires_in`, must not be `None`") # noqa: E501 - self._expires_in = expires_in + self._user_id = user_id def to_dict(self, serialize=False): """Returns the model properties as a dict""" diff --git a/hubspot/oauth/rest.py b/hubspot/oauth/rest.py index 1dc47433..e2c8478b 100644 --- a/hubspot/oauth/rest.py +++ b/hubspot/oauth/rest.py @@ -1,12 +1,12 @@ # coding: utf-8 """ - Auth Oauth +Auth Oauth - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - The version of the OpenAPI document: v1 - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: v1 +Generated by: https://openapi-generator.tech """ @@ -30,6 +30,7 @@ class RESTResponse(io.IOBase): + def __init__(self, resp): self.urllib3_response = resp self.status = resp.status @@ -46,6 +47,7 @@ def getheader(self, name, default=None): 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