hubspot-api-client 20.0.0.pre.beta.1 → 20.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +42 -1
- data/Gemfile.lock +2 -2
- data/hubspot-api-client.gemspec +1 -1
- data/lib/hubspot/codegen/crm/companies/api/basic_api.rb +91 -22
- data/lib/hubspot/codegen/crm/companies/api/batch_api.rb +25 -17
- data/lib/hubspot/codegen/crm/companies/api/search_api.rb +4 -0
- data/lib/hubspot/codegen/crm/companies/models/association_spec.rb +12 -0
- data/lib/hubspot/codegen/crm/companies/models/{batch_input_simple_public_object_input_for_create.rb → batch_input_simple_public_object_batch_input_for_create.rb} +4 -4
- data/lib/hubspot/codegen/crm/companies/models/batch_read_input_simple_public_object_id.rb +1 -0
- data/lib/hubspot/codegen/crm/companies/models/public_associations_for_object.rb +10 -0
- data/lib/hubspot/codegen/crm/companies/models/public_merge_input.rb +2 -0
- data/lib/hubspot/codegen/crm/companies/models/public_object_id.rb +6 -0
- data/lib/hubspot/codegen/crm/companies/models/simple_public_object.rb +10 -1
- data/lib/hubspot/codegen/crm/companies/models/simple_public_object_batch_input.rb +4 -0
- data/lib/hubspot/codegen/crm/companies/models/simple_public_object_batch_input_for_create.rb +250 -0
- data/lib/hubspot/codegen/crm/companies/models/simple_public_object_batch_input_upsert.rb +4 -0
- data/lib/hubspot/codegen/crm/companies/models/simple_public_object_input.rb +2 -10
- data/lib/hubspot/codegen/crm/companies/models/simple_public_object_input_for_create.rb +2 -10
- data/lib/hubspot/codegen/crm/companies/models/simple_public_object_with_associations.rb +10 -1
- data/lib/hubspot/codegen/crm/companies/models/simple_public_upsert_object.rb +10 -1
- data/lib/hubspot/codegen/crm/contacts/api/basic_api.rb +163 -26
- data/lib/hubspot/codegen/crm/contacts/api/batch_api.rb +27 -19
- data/lib/hubspot/codegen/crm/contacts/api/search_api.rb +4 -0
- data/lib/hubspot/codegen/crm/contacts/models/association_spec.rb +10 -0
- data/lib/hubspot/codegen/crm/contacts/models/{batch_input_simple_public_object_input_for_create.rb → batch_input_simple_public_object_batch_input_for_create.rb} +4 -4
- data/lib/hubspot/codegen/crm/contacts/models/batch_read_input_simple_public_object_id.rb +1 -0
- data/lib/hubspot/codegen/crm/contacts/models/public_associations_for_object.rb +10 -0
- data/lib/hubspot/codegen/crm/contacts/models/public_gdpr_delete_input.rb +2 -0
- data/lib/hubspot/codegen/crm/contacts/models/public_object_id.rb +5 -0
- data/lib/hubspot/codegen/crm/contacts/models/simple_public_object.rb +10 -1
- data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_batch_input.rb +2 -0
- data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_batch_input_for_create.rb +250 -0
- data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_batch_input_upsert.rb +1 -0
- data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_input.rb +1 -10
- data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_input_for_create.rb +1 -10
- data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_with_associations.rb +13 -1
- data/lib/hubspot/codegen/crm/contacts/models/simple_public_upsert_object.rb +10 -1
- data/lib/hubspot/codegen/crm/deals/api/basic_api.rb +67 -0
- data/lib/hubspot/codegen/crm/deals/api/batch_api.rb +11 -9
- data/lib/hubspot/codegen/crm/deals/models/association_spec.rb +10 -0
- data/lib/hubspot/codegen/crm/deals/models/{batch_input_simple_public_object_input_for_create.rb → batch_input_simple_public_object_batch_input_for_create.rb} +4 -4
- data/lib/hubspot/codegen/crm/deals/models/batch_read_input_simple_public_object_id.rb +1 -0
- data/lib/hubspot/codegen/crm/deals/models/public_associations_for_object.rb +10 -0
- data/lib/hubspot/codegen/crm/deals/models/public_object_id.rb +5 -0
- data/lib/hubspot/codegen/crm/deals/models/simple_public_object.rb +10 -1
- data/lib/hubspot/codegen/crm/deals/models/simple_public_object_batch_input.rb +2 -0
- data/lib/hubspot/codegen/crm/deals/models/simple_public_object_batch_input_for_create.rb +250 -0
- data/lib/hubspot/codegen/crm/deals/models/simple_public_object_batch_input_upsert.rb +1 -0
- data/lib/hubspot/codegen/crm/deals/models/simple_public_object_input.rb +1 -10
- data/lib/hubspot/codegen/crm/deals/models/simple_public_object_input_for_create.rb +1 -10
- data/lib/hubspot/codegen/crm/deals/models/simple_public_object_with_associations.rb +10 -1
- data/lib/hubspot/codegen/crm/deals/models/simple_public_upsert_object.rb +10 -1
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/basic_api.rb +3 -2
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/batch_api.rb +2 -0
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_read_input_simple_public_object_id.rb +1 -0
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object.rb +10 -1
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object_with_associations.rb +10 -1
- data/lib/hubspot/codegen/crm/objects/goals/api/basic_api.rb +1 -0
- data/lib/hubspot/codegen/crm/objects/goals/api/batch_api.rb +11 -9
- data/lib/hubspot/codegen/crm/objects/goals/models/{batch_input_simple_public_object_input_for_create.rb → batch_input_simple_public_object_batch_input_for_create.rb} +4 -4
- data/lib/hubspot/codegen/crm/objects/goals/models/batch_read_input_simple_public_object_id.rb +1 -0
- data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_object.rb +10 -1
- data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_object_batch_input.rb +2 -0
- data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_object_batch_input_for_create.rb +252 -0
- data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_object_batch_input_upsert.rb +1 -0
- data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_object_input.rb +1 -10
- data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_object_input_for_create.rb +1 -15
- data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_object_with_associations.rb +10 -1
- data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_upsert_object.rb +10 -1
- data/lib/hubspot/codegen/crm/products/api/basic_api.rb +5 -4
- data/lib/hubspot/codegen/crm/products/api/batch_api.rb +11 -9
- data/lib/hubspot/codegen/crm/products/models/{batch_input_simple_public_object_input_for_create.rb → batch_input_simple_public_object_batch_input_for_create.rb} +4 -4
- data/lib/hubspot/codegen/crm/products/models/batch_read_input_simple_public_object_id.rb +1 -1
- data/lib/hubspot/codegen/crm/products/models/simple_public_object.rb +10 -1
- data/lib/hubspot/codegen/crm/products/models/simple_public_object_batch_input_for_create.rb +250 -0
- data/lib/hubspot/codegen/crm/products/models/simple_public_object_input.rb +1 -10
- data/lib/hubspot/codegen/crm/products/models/simple_public_object_input_for_create.rb +6 -10
- data/lib/hubspot/codegen/crm/products/models/simple_public_object_with_associations.rb +10 -1
- data/lib/hubspot/codegen/crm/products/models/simple_public_upsert_object.rb +10 -1
- data/lib/hubspot/codegen/crm/tickets/api/basic_api.rb +73 -4
- data/lib/hubspot/codegen/crm/tickets/api/batch_api.rb +17 -9
- data/lib/hubspot/codegen/crm/tickets/api/search_api.rb +4 -0
- data/lib/hubspot/codegen/crm/tickets/models/association_spec.rb +10 -0
- data/lib/hubspot/codegen/crm/tickets/models/{batch_input_simple_public_object_input_for_create.rb → batch_input_simple_public_object_batch_input_for_create.rb} +4 -4
- data/lib/hubspot/codegen/crm/tickets/models/batch_read_input_simple_public_object_id.rb +1 -0
- data/lib/hubspot/codegen/crm/tickets/models/public_associations_for_object.rb +10 -0
- data/lib/hubspot/codegen/crm/tickets/models/public_object_id.rb +5 -0
- data/lib/hubspot/codegen/crm/tickets/models/simple_public_object.rb +10 -1
- data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_batch_input.rb +2 -0
- data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_batch_input_for_create.rb +250 -0
- data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_batch_input_upsert.rb +1 -0
- data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_input.rb +1 -10
- data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_input_for_create.rb +1 -10
- data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_with_associations.rb +10 -1
- data/lib/hubspot/codegen/crm/tickets/models/simple_public_upsert_object.rb +10 -1
- data/lib/hubspot/codegen/files/api/files_api.rb +144 -104
- data/lib/hubspot/codegen/files/api/folders_api.rb +142 -57
- data/lib/hubspot/codegen/files/api_client.rb +1 -1
- data/lib/hubspot/codegen/files/api_error.rb +1 -1
- data/lib/hubspot/codegen/files/configuration.rb +1 -1
- data/lib/hubspot/codegen/files/models/collection_response_file.rb +2 -1
- data/lib/hubspot/codegen/files/models/collection_response_folder.rb +1 -1
- data/lib/hubspot/codegen/files/models/error.rb +1 -1
- data/lib/hubspot/codegen/files/models/error_detail.rb +1 -1
- data/lib/hubspot/codegen/files/models/file.rb +33 -14
- data/lib/hubspot/codegen/files/models/file_action_response.rb +1 -1
- data/lib/hubspot/codegen/files/models/file_stat.rb +1 -1
- data/lib/hubspot/codegen/files/models/file_update_input.rb +15 -5
- data/lib/hubspot/codegen/files/models/folder.rb +12 -12
- data/lib/hubspot/codegen/files/models/folder_action_response.rb +1 -1
- data/lib/hubspot/codegen/files/models/folder_input.rb +2 -1
- data/lib/hubspot/codegen/files/models/folder_update_input.rb +6 -20
- data/lib/hubspot/codegen/files/models/folder_update_input_with_id.rb +244 -0
- data/lib/hubspot/codegen/files/models/folder_update_task_locator.rb +2 -1
- data/lib/hubspot/codegen/files/models/import_from_url_input.rb +13 -4
- data/lib/hubspot/codegen/files/models/import_from_url_task_locator.rb +2 -1
- data/lib/hubspot/codegen/files/models/next_page.rb +1 -1
- data/lib/hubspot/codegen/files/models/paging.rb +1 -1
- data/lib/hubspot/codegen/files/models/previous_page.rb +1 -1
- data/lib/hubspot/codegen/files/models/signed_url.rb +18 -17
- data/lib/hubspot/codegen/files/models/standard_error.rb +1 -1
- data/lib/hubspot/codegen/oauth/api/access_tokens_api.rb +7 -3
- data/lib/hubspot/codegen/oauth/api/refresh_tokens_api.rb +13 -5
- data/lib/hubspot/codegen/oauth/api/tokens_api.rb +5 -1
- data/lib/hubspot/codegen/oauth/api_client.rb +2 -2
- data/lib/hubspot/codegen/oauth/api_error.rb +1 -1
- data/lib/hubspot/codegen/oauth/configuration.rb +1 -1
- data/lib/hubspot/codegen/oauth/models/access_token_info_response.rb +4 -4
- data/lib/hubspot/codegen/oauth/models/error.rb +4 -4
- data/lib/hubspot/codegen/oauth/models/error_detail.rb +4 -4
- data/lib/hubspot/codegen/oauth/models/refresh_token_info_response.rb +4 -4
- data/lib/hubspot/codegen/oauth/models/token_response_if.rb +4 -4
- data/lib/hubspot/codegen/oauth/v3/api/advanced_api.rb +273 -0
- data/lib/hubspot/codegen/{cms/performance → oauth/v3}/api_client.rb +5 -5
- data/lib/hubspot/codegen/{cms/performance → oauth/v3}/api_error.rb +4 -4
- data/lib/hubspot/codegen/{cms/performance → oauth/v3}/configuration.rb +11 -4
- data/lib/hubspot/codegen/{cms/performance/models/public_performance_response.rb → oauth/v3/models/access_token_response.rb} +97 -84
- data/lib/hubspot/codegen/oauth/v3/models/client_credentials_token_response.rb +344 -0
- data/lib/hubspot/codegen/{cms/performance → oauth/v3}/models/error.rb +40 -39
- data/lib/hubspot/codegen/{cms/performance → oauth/v3}/models/error_detail.rb +32 -31
- data/lib/hubspot/codegen/oauth/v3/models/public_access_token_info_response.rb +438 -0
- data/lib/hubspot/codegen/oauth/v3/models/public_refresh_token_info_response.rb +396 -0
- data/lib/hubspot/codegen/oauth/v3/models/signed_access_token.rb +452 -0
- data/lib/hubspot/codegen/oauth/v3/models/token_info_response_base_if.rb +59 -0
- data/lib/hubspot/codegen/oauth/v3/models/token_response_if.rb +59 -0
- data/lib/hubspot/discovery/base_api_client.rb +1 -1
- data/lib/hubspot/discovery/cms/client.rb +0 -1
- data/lib/hubspot/discovery/crm/companies/client.rb +0 -1
- data/lib/hubspot/discovery/crm/contacts/client.rb +0 -2
- data/lib/hubspot/discovery/crm/deals/client.rb +0 -1
- data/lib/hubspot/discovery/crm/tickets/client.rb +0 -1
- data/lib/hubspot/discovery/oauth/api/access_tokens_api.rb +1 -1
- data/lib/hubspot/discovery/oauth/api/refresh_tokens_api.rb +1 -1
- data/lib/hubspot/discovery/oauth/api/tokens_api.rb +1 -1
- data/lib/hubspot/discovery/oauth/client.rb +7 -1
- data/lib/hubspot/discovery/{crm/deals/api/merge_api.rb → oauth/v3/api/advanced_api.rb} +3 -3
- data/lib/hubspot/discovery/{cms/performance → oauth/v3}/client.rb +4 -4
- data/lib/hubspot/helpers/association_type.rb +233 -2
- data/lib/hubspot/helpers/camel_case.rb +0 -4
- data/lib/hubspot/version.rb +1 -1
- data/spec/discovery/cms/client_spec.rb +0 -1
- data/spec/discovery/crm/companies/basic_api_spec.rb +1 -0
- data/spec/discovery/crm/contacts/basic_api_spec.rb +1 -0
- data/spec/discovery/crm/deals/basic_api_spec.rb +1 -0
- data/spec/discovery/crm/tickets/basic_api_spec.rb +1 -0
- data/spec/discovery/files/files_api_spec.rb +2 -1
- data/spec/discovery/files/folders_api_spec.rb +1 -0
- data/spec/discovery/oauth/access_tokens_api_spec.rb +1 -1
- data/spec/discovery/oauth/refresh_tokens_api_spec.rb +1 -1
- data/spec/discovery/oauth/tokens_api_spec.rb +1 -1
- data/spec/discovery/oauth/v3/advanced_api_spec.rb +36 -0
- data/spec/discovery/oauth/v3/client_spec.rb +7 -0
- metadata +160 -169
- data/lib/hubspot/codegen/cms/performance/api/public_performance_api.rb +0 -188
- data/lib/hubspot/codegen/cms/performance/models/performance_view.rb +0 -526
- data/lib/hubspot/codegen/crm/companies/api/merge_api.rb +0 -92
- data/lib/hubspot/codegen/crm/contacts/api/gdpr_api.rb +0 -94
- data/lib/hubspot/codegen/crm/contacts/api/merge_api.rb +0 -92
- data/lib/hubspot/codegen/crm/deals/api/merge_api.rb +0 -92
- data/lib/hubspot/codegen/crm/tickets/api/merge_api.rb +0 -92
- data/lib/hubspot/discovery/cms/performance/api/public_performance_api.rb +0 -13
- data/lib/hubspot/discovery/crm/companies/api/merge_api.rb +0 -13
- data/lib/hubspot/discovery/crm/contacts/api/gdpr_api.rb +0 -13
- data/lib/hubspot/discovery/crm/contacts/api/merge_api.rb +0 -13
- data/lib/hubspot/discovery/crm/tickets/api/merge_api.rb +0 -13
- data/spec/discovery/cms/performance/public_performance_api_spec.rb +0 -8
- data/spec/discovery/crm/companies/merge_api_spec.rb +0 -7
- data/spec/discovery/crm/contacts/gdpr_api_spec.rb +0 -7
- data/spec/discovery/crm/contacts/merge_api_spec.rb +0 -7
- data/spec/discovery/crm/deals/merge_api_spec.rb +0 -7
- data/spec/discovery/crm/tickets/merge_api_spec.rb +0 -7
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Auth Oauth
|
|
3
|
+
|
|
4
|
+
#Basepom for all HubSpot Projects
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v3
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 6.2.1
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Hubspot
|
|
16
|
+
module Oauth
|
|
17
|
+
module V3
|
|
18
|
+
class AdvancedApi
|
|
19
|
+
attr_accessor :api_client
|
|
20
|
+
|
|
21
|
+
def initialize(api_client = ApiClient.default)
|
|
22
|
+
@api_client = api_client
|
|
23
|
+
end
|
|
24
|
+
# OAuth token endpoint
|
|
25
|
+
# Authenticates a client and returns access and refresh tokens.
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @option opts [String] :assertion
|
|
28
|
+
# @option opts [String] :client_assertion
|
|
29
|
+
# @option opts [String] :client_assertion_type
|
|
30
|
+
# @option opts [String] :client_id
|
|
31
|
+
# @option opts [String] :client_secret
|
|
32
|
+
# @option opts [String] :code
|
|
33
|
+
# @option opts [String] :code_verifier
|
|
34
|
+
# @option opts [String] :grant_type
|
|
35
|
+
# @option opts [String] :redirect_uri
|
|
36
|
+
# @option opts [String] :refresh_token
|
|
37
|
+
# @option opts [String] :scope
|
|
38
|
+
# @return [TokenResponseIF]
|
|
39
|
+
def get_token(opts = {})
|
|
40
|
+
data, _status_code, _headers = get_token_with_http_info(opts)
|
|
41
|
+
data
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# OAuth token endpoint
|
|
45
|
+
# Authenticates a client and returns access and refresh tokens.
|
|
46
|
+
# @param [Hash] opts the optional parameters
|
|
47
|
+
# @option opts [String] :assertion
|
|
48
|
+
# @option opts [String] :client_assertion
|
|
49
|
+
# @option opts [String] :client_assertion_type
|
|
50
|
+
# @option opts [String] :client_id
|
|
51
|
+
# @option opts [String] :client_secret
|
|
52
|
+
# @option opts [String] :code
|
|
53
|
+
# @option opts [String] :code_verifier
|
|
54
|
+
# @option opts [String] :grant_type
|
|
55
|
+
# @option opts [String] :redirect_uri
|
|
56
|
+
# @option opts [String] :refresh_token
|
|
57
|
+
# @option opts [String] :scope
|
|
58
|
+
# @return [Array<(TokenResponseIF, Integer, Hash)>] TokenResponseIF data, response status code and response headers
|
|
59
|
+
def get_token_with_http_info(opts = {})
|
|
60
|
+
if @api_client.config.debugging
|
|
61
|
+
@api_client.config.logger.debug 'Calling API: AdvancedApi.get_token ...'
|
|
62
|
+
end
|
|
63
|
+
allowable_values = ["authorization_code", "client_credentials", "refresh_token", "urn:ietf:params:oauth:grant-type:jwt-bearer"]
|
|
64
|
+
if @api_client.config.client_side_validation && opts[:'grant_type'] && !allowable_values.include?(opts[:'grant_type'])
|
|
65
|
+
fail ArgumentError, "invalid value for \"grant_type\", must be one of #{allowable_values}"
|
|
66
|
+
end
|
|
67
|
+
# resource path
|
|
68
|
+
local_var_path = '/oauth/v3/token'
|
|
69
|
+
|
|
70
|
+
# query parameters
|
|
71
|
+
query_params = opts[:query_params] || {}
|
|
72
|
+
|
|
73
|
+
# header parameters
|
|
74
|
+
header_params = opts[:header_params] || {}
|
|
75
|
+
# HTTP header 'Accept' (if needed)
|
|
76
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
|
|
77
|
+
# HTTP header 'Content-Type'
|
|
78
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
79
|
+
if !content_type.nil?
|
|
80
|
+
header_params['Content-Type'] = content_type
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# form parameters
|
|
84
|
+
form_params = opts[:form_params] || {}
|
|
85
|
+
form_params['assertion'] = opts[:'assertion'] if !opts[:'assertion'].nil?
|
|
86
|
+
form_params['client_assertion'] = opts[:'client_assertion'] if !opts[:'client_assertion'].nil?
|
|
87
|
+
form_params['client_assertion_type'] = opts[:'client_assertion_type'] if !opts[:'client_assertion_type'].nil?
|
|
88
|
+
form_params['client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil?
|
|
89
|
+
form_params['client_secret'] = opts[:'client_secret'] if !opts[:'client_secret'].nil?
|
|
90
|
+
form_params['code'] = opts[:'code'] if !opts[:'code'].nil?
|
|
91
|
+
form_params['code_verifier'] = opts[:'code_verifier'] if !opts[:'code_verifier'].nil?
|
|
92
|
+
form_params['grant_type'] = opts[:'grant_type'] if !opts[:'grant_type'].nil?
|
|
93
|
+
form_params['redirect_uri'] = opts[:'redirect_uri'] if !opts[:'redirect_uri'].nil?
|
|
94
|
+
form_params['refresh_token'] = opts[:'refresh_token'] if !opts[:'refresh_token'].nil?
|
|
95
|
+
form_params['scope'] = opts[:'scope'] if !opts[:'scope'].nil?
|
|
96
|
+
|
|
97
|
+
# http body (model)
|
|
98
|
+
post_body = opts[:debug_body]
|
|
99
|
+
|
|
100
|
+
# return_type
|
|
101
|
+
return_type = opts[:debug_return_type] || 'TokenResponseIF'
|
|
102
|
+
|
|
103
|
+
# auth_names
|
|
104
|
+
auth_names = opts[:debug_auth_names] || []
|
|
105
|
+
|
|
106
|
+
new_options = opts.merge(
|
|
107
|
+
:operation => :"AdvancedApi.get_token",
|
|
108
|
+
:header_params => header_params,
|
|
109
|
+
:query_params => query_params,
|
|
110
|
+
:form_params => form_params,
|
|
111
|
+
:body => post_body,
|
|
112
|
+
:auth_names => auth_names,
|
|
113
|
+
:return_type => return_type
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
117
|
+
if @api_client.config.debugging
|
|
118
|
+
@api_client.config.logger.debug "API called: AdvancedApi#get_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
119
|
+
end
|
|
120
|
+
return data, status_code, headers
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Token introspection endpoint
|
|
124
|
+
# Returns validity and metadata for access and refresh tokens.
|
|
125
|
+
# @param [Hash] opts the optional parameters
|
|
126
|
+
# @option opts [String] :client_id
|
|
127
|
+
# @option opts [String] :client_secret
|
|
128
|
+
# @option opts [String] :token
|
|
129
|
+
# @option opts [String] :token_type_hint
|
|
130
|
+
# @return [TokenInfoResponseBaseIF]
|
|
131
|
+
def introspect_token(opts = {})
|
|
132
|
+
data, _status_code, _headers = introspect_token_with_http_info(opts)
|
|
133
|
+
data
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Token introspection endpoint
|
|
137
|
+
# Returns validity and metadata for access and refresh tokens.
|
|
138
|
+
# @param [Hash] opts the optional parameters
|
|
139
|
+
# @option opts [String] :client_id
|
|
140
|
+
# @option opts [String] :client_secret
|
|
141
|
+
# @option opts [String] :token
|
|
142
|
+
# @option opts [String] :token_type_hint
|
|
143
|
+
# @return [Array<(TokenInfoResponseBaseIF, Integer, Hash)>] TokenInfoResponseBaseIF data, response status code and response headers
|
|
144
|
+
def introspect_token_with_http_info(opts = {})
|
|
145
|
+
if @api_client.config.debugging
|
|
146
|
+
@api_client.config.logger.debug 'Calling API: AdvancedApi.introspect_token ...'
|
|
147
|
+
end
|
|
148
|
+
# resource path
|
|
149
|
+
local_var_path = '/oauth/v3/token/introspect'
|
|
150
|
+
|
|
151
|
+
# query parameters
|
|
152
|
+
query_params = opts[:query_params] || {}
|
|
153
|
+
|
|
154
|
+
# header parameters
|
|
155
|
+
header_params = opts[:header_params] || {}
|
|
156
|
+
# HTTP header 'Accept' (if needed)
|
|
157
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
|
|
158
|
+
# HTTP header 'Content-Type'
|
|
159
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
160
|
+
if !content_type.nil?
|
|
161
|
+
header_params['Content-Type'] = content_type
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# form parameters
|
|
165
|
+
form_params = opts[:form_params] || {}
|
|
166
|
+
form_params['client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil?
|
|
167
|
+
form_params['client_secret'] = opts[:'client_secret'] if !opts[:'client_secret'].nil?
|
|
168
|
+
form_params['token'] = opts[:'token'] if !opts[:'token'].nil?
|
|
169
|
+
form_params['token_type_hint'] = opts[:'token_type_hint'] if !opts[:'token_type_hint'].nil?
|
|
170
|
+
|
|
171
|
+
# http body (model)
|
|
172
|
+
post_body = opts[:debug_body]
|
|
173
|
+
|
|
174
|
+
# return_type
|
|
175
|
+
return_type = opts[:debug_return_type] || 'TokenInfoResponseBaseIF'
|
|
176
|
+
|
|
177
|
+
# auth_names
|
|
178
|
+
auth_names = opts[:debug_auth_names] || []
|
|
179
|
+
|
|
180
|
+
new_options = opts.merge(
|
|
181
|
+
:operation => :"AdvancedApi.introspect_token",
|
|
182
|
+
:header_params => header_params,
|
|
183
|
+
:query_params => query_params,
|
|
184
|
+
:form_params => form_params,
|
|
185
|
+
:body => post_body,
|
|
186
|
+
:auth_names => auth_names,
|
|
187
|
+
:return_type => return_type
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
191
|
+
if @api_client.config.debugging
|
|
192
|
+
@api_client.config.logger.debug "API called: AdvancedApi#introspect_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
193
|
+
end
|
|
194
|
+
return data, status_code, headers
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Token Revocation endpoint
|
|
198
|
+
# Deletes/Revokes provided Refresh Token
|
|
199
|
+
# @param [Hash] opts the optional parameters
|
|
200
|
+
# @option opts [String] :client_id
|
|
201
|
+
# @option opts [String] :client_secret
|
|
202
|
+
# @option opts [String] :token
|
|
203
|
+
# @option opts [String] :token_type_hint
|
|
204
|
+
# @return [nil]
|
|
205
|
+
def revoke_token(opts = {})
|
|
206
|
+
revoke_token_with_http_info(opts)
|
|
207
|
+
nil
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Token Revocation endpoint
|
|
211
|
+
# Deletes/Revokes provided Refresh Token
|
|
212
|
+
# @param [Hash] opts the optional parameters
|
|
213
|
+
# @option opts [String] :client_id
|
|
214
|
+
# @option opts [String] :client_secret
|
|
215
|
+
# @option opts [String] :token
|
|
216
|
+
# @option opts [String] :token_type_hint
|
|
217
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
218
|
+
def revoke_token_with_http_info(opts = {})
|
|
219
|
+
if @api_client.config.debugging
|
|
220
|
+
@api_client.config.logger.debug 'Calling API: AdvancedApi.revoke_token ...'
|
|
221
|
+
end
|
|
222
|
+
# resource path
|
|
223
|
+
local_var_path = '/oauth/v3/token/revoke'
|
|
224
|
+
|
|
225
|
+
# query parameters
|
|
226
|
+
query_params = opts[:query_params] || {}
|
|
227
|
+
|
|
228
|
+
# header parameters
|
|
229
|
+
header_params = opts[:header_params] || {}
|
|
230
|
+
# HTTP header 'Accept' (if needed)
|
|
231
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
|
232
|
+
# HTTP header 'Content-Type'
|
|
233
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
234
|
+
if !content_type.nil?
|
|
235
|
+
header_params['Content-Type'] = content_type
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# form parameters
|
|
239
|
+
form_params = opts[:form_params] || {}
|
|
240
|
+
form_params['client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil?
|
|
241
|
+
form_params['client_secret'] = opts[:'client_secret'] if !opts[:'client_secret'].nil?
|
|
242
|
+
form_params['token'] = opts[:'token'] if !opts[:'token'].nil?
|
|
243
|
+
form_params['token_type_hint'] = opts[:'token_type_hint'] if !opts[:'token_type_hint'].nil?
|
|
244
|
+
|
|
245
|
+
# http body (model)
|
|
246
|
+
post_body = opts[:debug_body]
|
|
247
|
+
|
|
248
|
+
# return_type
|
|
249
|
+
return_type = opts[:debug_return_type]
|
|
250
|
+
|
|
251
|
+
# auth_names
|
|
252
|
+
auth_names = opts[:debug_auth_names] || []
|
|
253
|
+
|
|
254
|
+
new_options = opts.merge(
|
|
255
|
+
:operation => :"AdvancedApi.revoke_token",
|
|
256
|
+
:header_params => header_params,
|
|
257
|
+
:query_params => query_params,
|
|
258
|
+
:form_params => form_params,
|
|
259
|
+
:body => post_body,
|
|
260
|
+
:auth_names => auth_names,
|
|
261
|
+
:return_type => return_type
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
265
|
+
if @api_client.config.debugging
|
|
266
|
+
@api_client.config.logger.debug "API called: AdvancedApi#revoke_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
267
|
+
end
|
|
268
|
+
return data, status_code, headers
|
|
269
|
+
end
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
|
-
#
|
|
2
|
+
#Auth Oauth
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#Basepom for all HubSpot Projects
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v3
|
|
7
7
|
|
|
@@ -18,8 +18,8 @@ require 'time'
|
|
|
18
18
|
require 'typhoeus'
|
|
19
19
|
|
|
20
20
|
module Hubspot
|
|
21
|
-
module
|
|
22
|
-
module
|
|
21
|
+
module Oauth
|
|
22
|
+
module V3
|
|
23
23
|
class ApiClient
|
|
24
24
|
# The Configuration object holding settings to be used in the API client.
|
|
25
25
|
attr_accessor :config
|
|
@@ -294,7 +294,7 @@ module Hubspot
|
|
|
294
294
|
end
|
|
295
295
|
else
|
|
296
296
|
# models (e.g. Pet) or oneOf
|
|
297
|
-
klass = Hubspot::
|
|
297
|
+
klass = Hubspot::Oauth::V3.const_get(return_type)
|
|
298
298
|
klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
|
|
299
299
|
end
|
|
300
300
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
|
-
#
|
|
2
|
+
#Auth Oauth
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#Basepom for all HubSpot Projects
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v3
|
|
7
7
|
|
|
@@ -11,8 +11,8 @@ OpenAPI Generator version: 6.2.1
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
13
|
module Hubspot
|
|
14
|
-
module
|
|
15
|
-
module
|
|
14
|
+
module Oauth
|
|
15
|
+
module V3
|
|
16
16
|
class ApiError < ::StandardError
|
|
17
17
|
attr_reader :code, :response_headers, :response_body
|
|
18
18
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
|
-
#
|
|
2
|
+
#Auth Oauth
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#Basepom for all HubSpot Projects
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v3
|
|
7
7
|
|
|
@@ -11,8 +11,8 @@ OpenAPI Generator version: 6.2.1
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
13
|
module Hubspot
|
|
14
|
-
module
|
|
15
|
-
module
|
|
14
|
+
module Oauth
|
|
15
|
+
module V3
|
|
16
16
|
class Configuration
|
|
17
17
|
# Defines url scheme
|
|
18
18
|
attr_accessor :scheme
|
|
@@ -222,6 +222,13 @@ module Hubspot
|
|
|
222
222
|
# Returns Auth Settings hash for api client.
|
|
223
223
|
def auth_settings
|
|
224
224
|
{
|
|
225
|
+
'developer_hapikey' =>
|
|
226
|
+
{
|
|
227
|
+
type: 'api_key',
|
|
228
|
+
in: 'query',
|
|
229
|
+
key: 'hapikey',
|
|
230
|
+
value: api_key_with_prefix('developer_hapikey')
|
|
231
|
+
},
|
|
225
232
|
'oauth2' =>
|
|
226
233
|
{
|
|
227
234
|
type: 'oauth2',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
|
-
#
|
|
2
|
+
#Auth Oauth
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#Basepom for all HubSpot Projects
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v3
|
|
7
7
|
|
|
@@ -14,22 +14,26 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Hubspot
|
|
17
|
-
module
|
|
18
|
-
module
|
|
19
|
-
class
|
|
20
|
-
attr_accessor :
|
|
17
|
+
module Oauth
|
|
18
|
+
module V3
|
|
19
|
+
class AccessTokenResponse
|
|
20
|
+
attr_accessor :access_token
|
|
21
21
|
|
|
22
|
-
attr_accessor :
|
|
22
|
+
attr_accessor :expires_in
|
|
23
23
|
|
|
24
|
-
attr_accessor :
|
|
24
|
+
attr_accessor :hub_id
|
|
25
25
|
|
|
26
|
-
attr_accessor :
|
|
26
|
+
attr_accessor :id_token
|
|
27
27
|
|
|
28
|
-
attr_accessor :
|
|
28
|
+
attr_accessor :refresh_token
|
|
29
29
|
|
|
30
|
-
attr_accessor :
|
|
30
|
+
attr_accessor :scopes
|
|
31
31
|
|
|
32
|
-
attr_accessor :
|
|
32
|
+
attr_accessor :token_type
|
|
33
|
+
|
|
34
|
+
attr_accessor :token_use
|
|
35
|
+
|
|
36
|
+
attr_accessor :user_id
|
|
33
37
|
|
|
34
38
|
class EnumAttributeValidator
|
|
35
39
|
attr_reader :datatype
|
|
@@ -56,13 +60,15 @@ module Hubspot
|
|
|
56
60
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
57
61
|
def self.attribute_map
|
|
58
62
|
{
|
|
59
|
-
:'
|
|
60
|
-
:'
|
|
61
|
-
:'
|
|
62
|
-
:'
|
|
63
|
-
:'
|
|
64
|
-
:'
|
|
65
|
-
:'
|
|
63
|
+
:'access_token' => :'access_token',
|
|
64
|
+
:'expires_in' => :'expires_in',
|
|
65
|
+
:'hub_id' => :'hub_id',
|
|
66
|
+
:'id_token' => :'id_token',
|
|
67
|
+
:'refresh_token' => :'refresh_token',
|
|
68
|
+
:'scopes' => :'scopes',
|
|
69
|
+
:'token_type' => :'token_type',
|
|
70
|
+
:'token_use' => :'token_use',
|
|
71
|
+
:'user_id' => :'user_id'
|
|
66
72
|
}
|
|
67
73
|
end
|
|
68
74
|
|
|
@@ -74,13 +80,15 @@ module Hubspot
|
|
|
74
80
|
# Attribute type mapping.
|
|
75
81
|
def self.openapi_types
|
|
76
82
|
{
|
|
77
|
-
:'
|
|
78
|
-
:'
|
|
79
|
-
:'
|
|
80
|
-
:'
|
|
81
|
-
:'
|
|
82
|
-
:'
|
|
83
|
-
:'
|
|
83
|
+
:'access_token' => :'String',
|
|
84
|
+
:'expires_in' => :'Integer',
|
|
85
|
+
:'hub_id' => :'Integer',
|
|
86
|
+
:'id_token' => :'String',
|
|
87
|
+
:'refresh_token' => :'String',
|
|
88
|
+
:'scopes' => :'Array<String>',
|
|
89
|
+
:'token_type' => :'String',
|
|
90
|
+
:'token_use' => :'String',
|
|
91
|
+
:'user_id' => :'Integer'
|
|
84
92
|
}
|
|
85
93
|
end
|
|
86
94
|
|
|
@@ -94,45 +102,55 @@ module Hubspot
|
|
|
94
102
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
95
103
|
def initialize(attributes = {})
|
|
96
104
|
if (!attributes.is_a?(Hash))
|
|
97
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::
|
|
105
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Oauth::V3::AccessTokenResponse` initialize method"
|
|
98
106
|
end
|
|
99
107
|
|
|
100
108
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
101
109
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
102
110
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
103
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::
|
|
111
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Oauth::V3::AccessTokenResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
104
112
|
end
|
|
105
113
|
h[k.to_sym] = v
|
|
106
114
|
}
|
|
107
115
|
|
|
108
|
-
if attributes.key?(:'
|
|
109
|
-
self.
|
|
116
|
+
if attributes.key?(:'access_token')
|
|
117
|
+
self.access_token = attributes[:'access_token']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'expires_in')
|
|
121
|
+
self.expires_in = attributes[:'expires_in']
|
|
110
122
|
end
|
|
111
123
|
|
|
112
|
-
if attributes.key?(:'
|
|
113
|
-
self.
|
|
124
|
+
if attributes.key?(:'hub_id')
|
|
125
|
+
self.hub_id = attributes[:'hub_id']
|
|
114
126
|
end
|
|
115
127
|
|
|
116
|
-
if attributes.key?(:'
|
|
117
|
-
self.
|
|
128
|
+
if attributes.key?(:'id_token')
|
|
129
|
+
self.id_token = attributes[:'id_token']
|
|
118
130
|
end
|
|
119
131
|
|
|
120
|
-
if attributes.key?(:'
|
|
121
|
-
|
|
122
|
-
|
|
132
|
+
if attributes.key?(:'refresh_token')
|
|
133
|
+
self.refresh_token = attributes[:'refresh_token']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'scopes')
|
|
137
|
+
if (value = attributes[:'scopes']).is_a?(Array)
|
|
138
|
+
self.scopes = value
|
|
123
139
|
end
|
|
124
140
|
end
|
|
125
141
|
|
|
126
|
-
if attributes.key?(:'
|
|
127
|
-
self.
|
|
142
|
+
if attributes.key?(:'token_type')
|
|
143
|
+
self.token_type = attributes[:'token_type']
|
|
128
144
|
end
|
|
129
145
|
|
|
130
|
-
if attributes.key?(:'
|
|
131
|
-
self.
|
|
146
|
+
if attributes.key?(:'token_use')
|
|
147
|
+
self.token_use = attributes[:'token_use']
|
|
148
|
+
else
|
|
149
|
+
self.token_use = 'access_token'
|
|
132
150
|
end
|
|
133
151
|
|
|
134
|
-
if attributes.key?(:'
|
|
135
|
-
self.
|
|
152
|
+
if attributes.key?(:'user_id')
|
|
153
|
+
self.user_id = attributes[:'user_id']
|
|
136
154
|
end
|
|
137
155
|
end
|
|
138
156
|
|
|
@@ -140,20 +158,24 @@ module Hubspot
|
|
|
140
158
|
# @return Array for valid properties with the reasons
|
|
141
159
|
def list_invalid_properties
|
|
142
160
|
invalid_properties = Array.new
|
|
143
|
-
if @
|
|
144
|
-
invalid_properties.push('invalid value for "
|
|
161
|
+
if @access_token.nil?
|
|
162
|
+
invalid_properties.push('invalid value for "access_token", access_token cannot be nil.')
|
|
145
163
|
end
|
|
146
164
|
|
|
147
|
-
if @
|
|
148
|
-
invalid_properties.push('invalid value for "
|
|
165
|
+
if @expires_in.nil?
|
|
166
|
+
invalid_properties.push('invalid value for "expires_in", expires_in cannot be nil.')
|
|
149
167
|
end
|
|
150
168
|
|
|
151
|
-
if @
|
|
152
|
-
invalid_properties.push('invalid value for "
|
|
169
|
+
if @refresh_token.nil?
|
|
170
|
+
invalid_properties.push('invalid value for "refresh_token", refresh_token cannot be nil.')
|
|
153
171
|
end
|
|
154
172
|
|
|
155
|
-
if @
|
|
156
|
-
invalid_properties.push('invalid value for "
|
|
173
|
+
if @token_type.nil?
|
|
174
|
+
invalid_properties.push('invalid value for "token_type", token_type cannot be nil.')
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if @token_use.nil?
|
|
178
|
+
invalid_properties.push('invalid value for "token_use", token_use cannot be nil.')
|
|
157
179
|
end
|
|
158
180
|
|
|
159
181
|
invalid_properties
|
|
@@ -162,35 +184,24 @@ module Hubspot
|
|
|
162
184
|
# Check to see if the all the properties in the model are valid
|
|
163
185
|
# @return true if the model is valid
|
|
164
186
|
def valid?
|
|
165
|
-
|
|
166
|
-
return false
|
|
167
|
-
return false if @
|
|
168
|
-
return false if @
|
|
169
|
-
return false if @
|
|
170
|
-
|
|
171
|
-
return false unless
|
|
172
|
-
return false if @end_interval.nil?
|
|
187
|
+
return false if @access_token.nil?
|
|
188
|
+
return false if @expires_in.nil?
|
|
189
|
+
return false if @refresh_token.nil?
|
|
190
|
+
return false if @token_type.nil?
|
|
191
|
+
return false if @token_use.nil?
|
|
192
|
+
token_use_validator = EnumAttributeValidator.new('String', ["access_token"])
|
|
193
|
+
return false unless token_use_validator.valid?(@token_use)
|
|
173
194
|
true
|
|
174
195
|
end
|
|
175
196
|
|
|
176
197
|
# Custom attribute writer method checking allowed values (enum).
|
|
177
|
-
# @param [Object]
|
|
178
|
-
def
|
|
179
|
-
validator = EnumAttributeValidator.new('String', ["
|
|
180
|
-
unless validator.valid?(
|
|
181
|
-
fail ArgumentError, "invalid value for \"
|
|
182
|
-
end
|
|
183
|
-
@period = period
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
# Custom attribute writer method checking allowed values (enum).
|
|
187
|
-
# @param [Object] interval Object to be assigned
|
|
188
|
-
def interval=(interval)
|
|
189
|
-
validator = EnumAttributeValidator.new('String', ["ONE_MINUTE", "FIVE_MINUTES", "TEN_MINUTES", "FIFTEEN_MINUTES", "THIRTY_MINUTES", "ONE_HOUR", "FOUR_HOURS", "TWELVE_HOURS", "ONE_DAY", "ONE_WEEK"])
|
|
190
|
-
unless validator.valid?(interval)
|
|
191
|
-
fail ArgumentError, "invalid value for \"interval\", must be one of #{validator.allowable_values}."
|
|
198
|
+
# @param [Object] token_use Object to be assigned
|
|
199
|
+
def token_use=(token_use)
|
|
200
|
+
validator = EnumAttributeValidator.new('String', ["access_token"])
|
|
201
|
+
unless validator.valid?(token_use)
|
|
202
|
+
fail ArgumentError, "invalid value for \"token_use\", must be one of #{validator.allowable_values}."
|
|
192
203
|
end
|
|
193
|
-
@
|
|
204
|
+
@token_use = token_use
|
|
194
205
|
end
|
|
195
206
|
|
|
196
207
|
# Checks equality by comparing each attribute.
|
|
@@ -198,13 +209,15 @@ module Hubspot
|
|
|
198
209
|
def ==(o)
|
|
199
210
|
return true if self.equal?(o)
|
|
200
211
|
self.class == o.class &&
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
212
|
+
access_token == o.access_token &&
|
|
213
|
+
expires_in == o.expires_in &&
|
|
214
|
+
hub_id == o.hub_id &&
|
|
215
|
+
id_token == o.id_token &&
|
|
216
|
+
refresh_token == o.refresh_token &&
|
|
217
|
+
scopes == o.scopes &&
|
|
218
|
+
token_type == o.token_type &&
|
|
219
|
+
token_use == o.token_use &&
|
|
220
|
+
user_id == o.user_id
|
|
208
221
|
end
|
|
209
222
|
|
|
210
223
|
# @see the `==` method
|
|
@@ -216,7 +229,7 @@ module Hubspot
|
|
|
216
229
|
# Calculates hash code according to all attributes.
|
|
217
230
|
# @return [Integer] Hash code
|
|
218
231
|
def hash
|
|
219
|
-
[
|
|
232
|
+
[access_token, expires_in, hub_id, id_token, refresh_token, scopes, token_type, token_use, user_id].hash
|
|
220
233
|
end
|
|
221
234
|
|
|
222
235
|
# Builds the object from hash
|
|
@@ -287,7 +300,7 @@ module Hubspot
|
|
|
287
300
|
end
|
|
288
301
|
else # model
|
|
289
302
|
# models (e.g. Pet) or oneOf
|
|
290
|
-
klass = Hubspot::
|
|
303
|
+
klass = Hubspot::Oauth::V3.const_get(type)
|
|
291
304
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
292
305
|
end
|
|
293
306
|
end
|