hubspot-api-client 10.1.1 → 11.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +2 -2
- data/lib/hubspot/codegen/cms/audit-logs/api/{default_api.rb → audit_logs_api.rb} +3 -3
- data/lib/hubspot/codegen/cms/blogs/authors/api/{default_api.rb → author_api.rb} +28 -28
- data/lib/hubspot/codegen/cms/blogs/blog-posts/api/{default_api.rb → blog_post_api.rb} +62 -62
- data/lib/hubspot/codegen/cms/blogs/tags/api/{default_api.rb → tag_api.rb} +28 -28
- data/lib/hubspot/codegen/cms/domains/api/domains_api.rb +2 -2
- data/lib/hubspot/codegen/cms/domains/configuration.rb +0 -7
- data/lib/hubspot/codegen/cms/hubdb/api/rows_api.rb +102 -102
- data/lib/hubspot/codegen/cms/hubdb/api/rows_batch_api.rb +21 -21
- data/lib/hubspot/codegen/cms/hubdb/api/tables_api.rb +100 -108
- data/lib/hubspot/codegen/cms/hubdb/api_client.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/api_error.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/configuration.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/{batch_input_hub_db_table_row_v3.rb → batch_input_hub_db_table_row_v3_request.rb} +5 -5
- data/lib/hubspot/codegen/cms/hubdb/models/batch_input_json_node.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/batch_input_string.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/batch_response_hub_db_table_row_v3_with_errors.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_row_v3_forward_paging.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_v3_forward_paging.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/column.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/{column_input.rb → column_request.rb} +71 -47
- data/lib/hubspot/codegen/cms/hubdb/models/error.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/error_detail.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/foreign_id.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/forward_paging.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_clone_request.rb +4 -9
- data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_row_v3.rb +12 -27
- data/lib/hubspot/codegen/cms/hubdb/models/{hub_db_table_row_v3_input.rb → hub_db_table_row_v3_request.rb} +25 -20
- data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_v3.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/{hub_db_table_v3_input.rb → hub_db_table_v3_request.rb} +53 -53
- data/lib/hubspot/codegen/cms/hubdb/models/import_result.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/next_page.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/option.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/simple_user.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/models/standard_error.rb +1 -1
- data/lib/hubspot/codegen/cms/performance/api/{default_api.rb → public_performance_api.rb} +5 -5
- data/lib/hubspot/codegen/cms/site-search/api/{default_api.rb → public_api.rb} +7 -7
- data/lib/hubspot/codegen/cms/site-search/models/search_hit_field.rb +15 -15
- data/lib/hubspot/codegen/crm/companies/api/batch_api.rb +0 -8
- data/lib/hubspot/codegen/crm/companies/api/search_api.rb +0 -4
- data/lib/hubspot/codegen/crm/companies/models/filter.rb +3 -2
- data/lib/hubspot/codegen/crm/contacts/api/batch_api.rb +0 -8
- data/lib/hubspot/codegen/crm/contacts/api/gdpr_api.rb +150 -0
- data/lib/hubspot/codegen/crm/contacts/api/search_api.rb +0 -4
- data/lib/hubspot/codegen/crm/contacts/models/filter.rb +3 -2
- data/lib/hubspot/codegen/crm/deals/api/batch_api.rb +0 -8
- data/lib/hubspot/codegen/crm/deals/api/search_api.rb +0 -4
- data/lib/hubspot/codegen/crm/deals/models/filter.rb +3 -2
- data/lib/hubspot/codegen/crm/imports/api/core_api.rb +2 -2
- data/lib/hubspot/codegen/crm/imports/api/{default_api.rb → public_imports_api.rb} +8 -8
- data/lib/hubspot/codegen/crm/imports/models/public_import_error.rb +4 -4
- data/lib/hubspot/codegen/crm/line_items/api/batch_api.rb +0 -8
- data/lib/hubspot/codegen/crm/line_items/api/search_api.rb +0 -4
- data/lib/hubspot/codegen/crm/line_items/models/filter.rb +3 -2
- data/lib/hubspot/codegen/crm/objects/api/batch_api.rb +0 -8
- data/lib/hubspot/codegen/crm/objects/api/gdpr_api.rb +162 -0
- data/lib/hubspot/codegen/crm/objects/api/search_api.rb +0 -4
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/batch_api.rb +0 -2
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/search_api.rb +0 -4
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/filter.rb +3 -2
- data/lib/hubspot/codegen/crm/objects/models/filter.rb +3 -2
- data/lib/hubspot/codegen/crm/owners/api/{default_api.rb → owners_api.rb} +6 -6
- data/lib/hubspot/codegen/crm/products/api/batch_api.rb +0 -8
- data/lib/hubspot/codegen/crm/products/api/search_api.rb +0 -4
- data/lib/hubspot/codegen/crm/products/models/filter.rb +3 -2
- data/lib/hubspot/codegen/crm/quotes/api/batch_api.rb +0 -2
- data/lib/hubspot/codegen/crm/quotes/api/search_api.rb +0 -4
- data/lib/hubspot/codegen/crm/quotes/models/filter.rb +3 -2
- data/lib/hubspot/codegen/crm/schemas/api/core_api.rb +3 -3
- data/lib/hubspot/codegen/crm/schemas/api/{default_api.rb → public_object_schemas_api.rb} +4 -4
- data/lib/hubspot/codegen/crm/tickets/api/batch_api.rb +0 -8
- data/lib/hubspot/codegen/crm/tickets/api/search_api.rb +0 -4
- data/lib/hubspot/codegen/crm/tickets/models/filter.rb +3 -2
- data/lib/hubspot/codegen/crm/timeline/api/templates_api.rb +3 -3
- data/lib/hubspot/codegen/crm/timeline/models/{collection_response_timeline_event_template.rb → collection_response_timeline_event_template_no_paging.rb} +7 -17
- data/lib/hubspot/codegen/files/files/api/files_api.rb +12 -6
- data/lib/hubspot/codegen/files/files/api/folders_api.rb +12 -0
- data/lib/hubspot/codegen/files/files/models/error_category.rb +18 -18
- data/lib/hubspot/codegen/marketing/transactional/api/{default_api.rb → public_smtp_tokens_api.rb} +14 -74
- data/lib/hubspot/codegen/marketing/transactional/api/single_send_api.rb +86 -0
- data/lib/hubspot/codegen/oauth/api/access_tokens_api.rb +82 -0
- data/lib/hubspot/codegen/oauth/api/refresh_tokens_api.rb +140 -0
- data/lib/hubspot/codegen/oauth/api/tokens_api.rb +100 -0
- data/lib/hubspot/codegen/oauth/models/access_token_info_response.rb +33 -1
- data/lib/hubspot/codegen/oauth/models/token_response_if.rb +27 -4
- data/lib/hubspot/version.rb +1 -1
- data/pkg/hubspot-api-client-10.1.1.gem +0 -0
- data/spec/codegen/cms/audit-logs/api/{default_api_spec.rb → audit_logs_api_spec.rb} +6 -6
- data/spec/codegen/cms/blogs/authors/api/{default_api_spec.rb → author_api_spec.rb} +6 -6
- data/spec/codegen/cms/blogs/blog-posts/api/{default_api_spec.rb → blog_post_api_spec.rb} +6 -6
- data/spec/codegen/cms/blogs/tags/api/{default_api_spec.rb → tag_api_spec.rb} +6 -6
- data/spec/codegen/cms/hubdb/api/rows_api_spec.rb +18 -18
- data/spec/codegen/cms/hubdb/api/rows_batch_api_spec.rb +4 -4
- data/spec/codegen/cms/hubdb/api/tables_api_spec.rb +35 -36
- data/spec/codegen/cms/hubdb/models/{batch_input_hub_db_table_row_v3_spec.rb → batch_input_hub_db_table_row_v3_request_spec.rb} +7 -7
- data/spec/codegen/cms/hubdb/models/batch_input_json_node_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/batch_input_string_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/batch_response_hub_db_table_row_v3_with_errors_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_row_v3_forward_paging_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_v3_forward_paging_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/{column_input_spec.rb → column_request_spec.rb} +14 -22
- data/spec/codegen/cms/hubdb/models/column_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/error_detail_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/error_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/foreign_id_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/forward_paging_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/hub_db_table_clone_request_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/{hub_db_table_row_v3_input_spec.rb → hub_db_table_row_v3_request_spec.rb} +10 -10
- data/spec/codegen/cms/hubdb/models/hub_db_table_row_v3_spec.rb +7 -1
- data/spec/codegen/cms/hubdb/models/{hub_db_table_v3_input_spec.rb → hub_db_table_v3_request_spec.rb} +13 -13
- data/spec/codegen/cms/hubdb/models/hub_db_table_v3_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/import_result_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/next_page_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/option_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/simple_user_spec.rb +1 -1
- data/spec/codegen/cms/hubdb/models/standard_error_spec.rb +1 -1
- data/spec/codegen/cms/performance/api/{default_api_spec.rb → public_performance_api_spec.rb} +6 -6
- data/spec/codegen/cms/site-search/api/{default_api_spec.rb → public_api_spec.rb} +6 -6
- data/spec/codegen/cms/site-search/models/search_hit_field_spec.rb +2 -2
- data/spec/codegen/crm/companies/api/batch_api_spec.rb +0 -4
- data/spec/codegen/crm/companies/api/search_api_spec.rb +0 -2
- data/spec/codegen/crm/companies/models/filter_spec.rb +1 -1
- data/spec/codegen/crm/contacts/api/batch_api_spec.rb +0 -4
- data/spec/codegen/crm/contacts/api/gdpr_api_spec.rb +59 -0
- data/spec/codegen/crm/contacts/api/search_api_spec.rb +0 -2
- data/spec/codegen/crm/contacts/models/filter_spec.rb +1 -1
- data/spec/codegen/crm/deals/api/batch_api_spec.rb +0 -4
- data/spec/codegen/crm/deals/api/search_api_spec.rb +0 -2
- data/spec/codegen/crm/deals/models/filter_spec.rb +1 -1
- data/spec/codegen/crm/imports/api/{default_api_spec.rb → public_imports_api_spec.rb} +8 -8
- data/spec/codegen/crm/imports/models/public_import_error_spec.rb +2 -2
- data/spec/codegen/crm/line_items/api/batch_api_spec.rb +0 -4
- data/spec/codegen/crm/line_items/api/search_api_spec.rb +0 -2
- data/spec/codegen/crm/line_items/models/filter_spec.rb +1 -1
- data/spec/codegen/crm/objects/api/batch_api_spec.rb +0 -4
- data/spec/codegen/crm/objects/api/gdpr_api_spec.rb +61 -0
- data/spec/codegen/crm/objects/api/search_api_spec.rb +0 -2
- data/spec/codegen/crm/objects/feedback_submissions/api/batch_api_spec.rb +0 -1
- data/spec/codegen/crm/objects/feedback_submissions/api/search_api_spec.rb +0 -2
- data/spec/codegen/crm/objects/feedback_submissions/models/filter_spec.rb +1 -1
- data/spec/codegen/crm/objects/models/filter_spec.rb +1 -1
- data/spec/codegen/crm/owners/api/{default_api_spec.rb → owners_api_spec.rb} +6 -6
- data/spec/codegen/crm/products/api/batch_api_spec.rb +0 -4
- data/spec/codegen/crm/products/api/search_api_spec.rb +0 -2
- data/spec/codegen/crm/products/models/filter_spec.rb +1 -1
- data/spec/codegen/crm/quotes/api/batch_api_spec.rb +0 -1
- data/spec/codegen/crm/quotes/api/search_api_spec.rb +0 -2
- data/spec/codegen/crm/quotes/models/filter_spec.rb +1 -1
- data/spec/codegen/crm/schemas/api/{default_api_spec.rb → public_object_schemas_api_spec.rb} +6 -6
- data/spec/codegen/crm/tickets/api/batch_api_spec.rb +0 -4
- data/spec/codegen/crm/tickets/api/search_api_spec.rb +0 -2
- data/spec/codegen/crm/tickets/models/filter_spec.rb +1 -1
- data/spec/codegen/crm/timeline/api/templates_api_spec.rb +1 -1
- data/spec/codegen/crm/timeline/models/{collection_response_timeline_event_template_spec.rb → collection_response_timeline_event_template_no_paging_spec.rb} +6 -12
- data/spec/codegen/files/files/api/files_api_spec.rb +4 -2
- data/spec/codegen/files/files/api/folders_api_spec.rb +4 -0
- data/spec/codegen/files/files/models/error_category_spec.rb +6 -6
- data/spec/codegen/marketing/transactional/api/{default_api_spec.rb → public_smtp_tokens_api_spec.rb} +6 -18
- data/spec/codegen/marketing/transactional/api/single_send_api_spec.rb +47 -0
- data/spec/codegen/oauth/api/access_tokens_api_spec.rb +45 -0
- data/spec/codegen/oauth/api/{default_api_spec.rb → refresh_tokens_api_spec.rb} +6 -31
- data/spec/codegen/oauth/api/tokens_api_spec.rb +50 -0
- data/spec/codegen/oauth/models/access_token_info_response_spec.rb +12 -0
- data/spec/codegen/oauth/models/token_response_if_spec.rb +12 -0
- data/spec/features/cms/audit-logs/{default_api_spec.rb → audit_logs_api_spec.rb} +4 -4
- data/spec/features/cms/blogs/authors/{default_api_spec.rb → author_api_spec.rb} +28 -28
- data/spec/features/cms/blogs/blog-posts/{default_api_spec.rb → blog_post_api_spec.rb} +2 -2
- data/spec/features/cms/blogs/tags/{default_api_spec.rb → tag_api_spec.rb} +2 -2
- data/spec/features/cms/hubdb/tables_api_spec.rb +1 -1
- data/spec/features/cms/perfomance/public_perfomance_api_spec.rb +8 -0
- data/spec/features/cms/site-search/{default_api_spec.rb → public_api_spec.rb} +2 -2
- data/spec/features/crm/contacts/gdpr_api_spec.rb +8 -0
- data/spec/features/crm/objects/gdpr_api_spec.rb +8 -0
- data/spec/features/crm/owners/{default_api_spec.rb → owners_api_spec.rb} +2 -2
- data/spec/features/crm/schemas/public_object_schemas_api_spec.rb +7 -0
- data/spec/features/marketing/transactional/{default_api_spec.rb → public_smtp_tokens_api_spec.rb} +2 -3
- data/spec/features/marketing/transactional/single_send_api_spec.rb +7 -0
- data/spec/features/oauth/access_tokens_api_spec.rb +7 -0
- data/spec/features/oauth/refresh_tokens_api_spec.rb +8 -0
- data/spec/features/oauth/tokens_api_spec.rb +7 -0
- metadata +96 -82
- data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_v3_live_input.rb +0 -241
- data/lib/hubspot/codegen/crm/timeline/models/next_page.rb +0 -224
- data/lib/hubspot/codegen/crm/timeline/models/paging.rb +0 -219
- data/lib/hubspot/codegen/crm/timeline/models/previous_page.rb +0 -224
- data/lib/hubspot/codegen/oauth/api/default_api.rb +0 -270
- data/spec/codegen/cms/hubdb/models/hub_db_table_v3_live_input_spec.rb +0 -59
- data/spec/codegen/crm/timeline/models/next_page_spec.rb +0 -47
- data/spec/codegen/crm/timeline/models/paging_spec.rb +0 -47
- data/spec/codegen/crm/timeline/models/previous_page_spec.rb +0 -47
- data/spec/features/cms/perfomance/default_api_spec.rb +0 -8
- data/spec/features/crm/schemas/default_api_spec.rb +0 -7
- data/spec/features/oauth/default_api_spec.rb +0 -10
@@ -0,0 +1,86 @@
|
|
1
|
+
=begin
|
2
|
+
#Transactional Email
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module Hubspot
|
16
|
+
module Marketing
|
17
|
+
module Transactional
|
18
|
+
class SingleSendApi
|
19
|
+
attr_accessor :api_client
|
20
|
+
|
21
|
+
def initialize(api_client = ApiClient.default)
|
22
|
+
@api_client = api_client
|
23
|
+
end
|
24
|
+
# Send a single transactional email asynchronously.
|
25
|
+
# Asynchronously send a transactional email. Returns the status of the email send with a statusId that can be used to continuously query for the status using the Email Send Status API.
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @option opts [PublicSingleSendRequestEgg] :public_single_send_request_egg A request object describing the email to send.
|
28
|
+
# @return [EmailSendStatusView]
|
29
|
+
def send_email(opts = {})
|
30
|
+
data, _status_code, _headers = send_email_with_http_info(opts)
|
31
|
+
data
|
32
|
+
end
|
33
|
+
|
34
|
+
# Send a single transactional email asynchronously.
|
35
|
+
# Asynchronously send a transactional email. Returns the status of the email send with a statusId that can be used to continuously query for the status using the Email Send Status API.
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @option opts [PublicSingleSendRequestEgg] :public_single_send_request_egg A request object describing the email to send.
|
38
|
+
# @return [Array<(EmailSendStatusView, Integer, Hash)>] EmailSendStatusView data, response status code and response headers
|
39
|
+
def send_email_with_http_info(opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: SingleSendApi.send_email ...'
|
42
|
+
end
|
43
|
+
# resource path
|
44
|
+
local_var_path = '/marketing/v3/transactional/single-email/send'
|
45
|
+
|
46
|
+
# query parameters
|
47
|
+
query_params = opts[:query_params] || {}
|
48
|
+
|
49
|
+
# header parameters
|
50
|
+
header_params = opts[:header_params] || {}
|
51
|
+
# HTTP header 'Accept' (if needed)
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
|
53
|
+
# HTTP header 'Content-Type'
|
54
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
55
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = opts[:form_params] || {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'public_single_send_request_egg'])
|
61
|
+
|
62
|
+
# return_type
|
63
|
+
return_type = opts[:return_type] || 'EmailSendStatusView'
|
64
|
+
|
65
|
+
# auth_names
|
66
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
67
|
+
|
68
|
+
new_options = opts.merge(
|
69
|
+
:header_params => header_params,
|
70
|
+
:query_params => query_params,
|
71
|
+
:form_params => form_params,
|
72
|
+
:body => post_body,
|
73
|
+
:auth_names => auth_names,
|
74
|
+
:return_type => return_type
|
75
|
+
)
|
76
|
+
|
77
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
78
|
+
if @api_client.config.debugging
|
79
|
+
@api_client.config.logger.debug "API called: SingleSendApi#send_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
80
|
+
end
|
81
|
+
return data, status_code, headers
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
=begin
|
2
|
+
#OAuthService
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module Hubspot
|
16
|
+
module OAuth
|
17
|
+
class AccessTokensApi
|
18
|
+
attr_accessor :api_client
|
19
|
+
|
20
|
+
def initialize(api_client = ApiClient.default)
|
21
|
+
@api_client = api_client
|
22
|
+
end
|
23
|
+
# @param token [String]
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [AccessTokenInfoResponse]
|
26
|
+
def get_access_token(token, opts = {})
|
27
|
+
data, _status_code, _headers = get_access_token_with_http_info(token, opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# @param token [String]
|
32
|
+
# @param [Hash] opts the optional parameters
|
33
|
+
# @return [Array<(AccessTokenInfoResponse, Integer, Hash)>] AccessTokenInfoResponse data, response status code and response headers
|
34
|
+
def get_access_token_with_http_info(token, opts = {})
|
35
|
+
if @api_client.config.debugging
|
36
|
+
@api_client.config.logger.debug 'Calling API: AccessTokensApi.get_access_token ...'
|
37
|
+
end
|
38
|
+
# verify the required parameter 'token' is set
|
39
|
+
if @api_client.config.client_side_validation && token.nil?
|
40
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling AccessTokensApi.get_access_token"
|
41
|
+
end
|
42
|
+
# resource path
|
43
|
+
local_var_path = '/oauth/v1/access-tokens/{token}'.sub('{' + 'token' + '}', CGI.escape(token.to_s))
|
44
|
+
|
45
|
+
# query parameters
|
46
|
+
query_params = opts[:query_params] || {}
|
47
|
+
|
48
|
+
# header parameters
|
49
|
+
header_params = opts[:header_params] || {}
|
50
|
+
# HTTP header 'Accept' (if needed)
|
51
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
|
52
|
+
|
53
|
+
# form parameters
|
54
|
+
form_params = opts[:form_params] || {}
|
55
|
+
|
56
|
+
# http body (model)
|
57
|
+
post_body = opts[:body]
|
58
|
+
|
59
|
+
# return_type
|
60
|
+
return_type = opts[:return_type] || 'AccessTokenInfoResponse'
|
61
|
+
|
62
|
+
# auth_names
|
63
|
+
auth_names = opts[:auth_names] || []
|
64
|
+
|
65
|
+
new_options = opts.merge(
|
66
|
+
:header_params => header_params,
|
67
|
+
:query_params => query_params,
|
68
|
+
:form_params => form_params,
|
69
|
+
:body => post_body,
|
70
|
+
:auth_names => auth_names,
|
71
|
+
:return_type => return_type
|
72
|
+
)
|
73
|
+
|
74
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
75
|
+
if @api_client.config.debugging
|
76
|
+
@api_client.config.logger.debug "API called: AccessTokensApi#get_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
77
|
+
end
|
78
|
+
return data, status_code, headers
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
=begin
|
2
|
+
#OAuthService
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module Hubspot
|
16
|
+
module OAuth
|
17
|
+
class RefreshTokensApi
|
18
|
+
attr_accessor :api_client
|
19
|
+
|
20
|
+
def initialize(api_client = ApiClient.default)
|
21
|
+
@api_client = api_client
|
22
|
+
end
|
23
|
+
# @param token [String]
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [Error]
|
26
|
+
def archive_refresh_token(token, opts = {})
|
27
|
+
data, _status_code, _headers = archive_refresh_token_with_http_info(token, opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# @param token [String]
|
32
|
+
# @param [Hash] opts the optional parameters
|
33
|
+
# @return [Array<(Error, Integer, Hash)>] Error data, response status code and response headers
|
34
|
+
def archive_refresh_token_with_http_info(token, opts = {})
|
35
|
+
if @api_client.config.debugging
|
36
|
+
@api_client.config.logger.debug 'Calling API: RefreshTokensApi.archive_refresh_token ...'
|
37
|
+
end
|
38
|
+
# verify the required parameter 'token' is set
|
39
|
+
if @api_client.config.client_side_validation && token.nil?
|
40
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling RefreshTokensApi.archive_refresh_token"
|
41
|
+
end
|
42
|
+
# resource path
|
43
|
+
local_var_path = '/oauth/v1/refresh-tokens/{token}'.sub('{' + 'token' + '}', CGI.escape(token.to_s))
|
44
|
+
|
45
|
+
# query parameters
|
46
|
+
query_params = opts[:query_params] || {}
|
47
|
+
|
48
|
+
# header parameters
|
49
|
+
header_params = opts[:header_params] || {}
|
50
|
+
# HTTP header 'Accept' (if needed)
|
51
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
52
|
+
|
53
|
+
# form parameters
|
54
|
+
form_params = opts[:form_params] || {}
|
55
|
+
|
56
|
+
# http body (model)
|
57
|
+
post_body = opts[:body]
|
58
|
+
|
59
|
+
# return_type
|
60
|
+
return_type = opts[:return_type] || 'Error'
|
61
|
+
|
62
|
+
# auth_names
|
63
|
+
auth_names = opts[:auth_names] || []
|
64
|
+
|
65
|
+
new_options = opts.merge(
|
66
|
+
:header_params => header_params,
|
67
|
+
:query_params => query_params,
|
68
|
+
:form_params => form_params,
|
69
|
+
:body => post_body,
|
70
|
+
:auth_names => auth_names,
|
71
|
+
:return_type => return_type
|
72
|
+
)
|
73
|
+
|
74
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
75
|
+
if @api_client.config.debugging
|
76
|
+
@api_client.config.logger.debug "API called: RefreshTokensApi#archive_refresh_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
77
|
+
end
|
78
|
+
return data, status_code, headers
|
79
|
+
end
|
80
|
+
|
81
|
+
# @param token [String]
|
82
|
+
# @param [Hash] opts the optional parameters
|
83
|
+
# @return [RefreshTokenInfoResponse]
|
84
|
+
def get_refresh_token(token, opts = {})
|
85
|
+
data, _status_code, _headers = get_refresh_token_with_http_info(token, opts)
|
86
|
+
data
|
87
|
+
end
|
88
|
+
|
89
|
+
# @param token [String]
|
90
|
+
# @param [Hash] opts the optional parameters
|
91
|
+
# @return [Array<(RefreshTokenInfoResponse, Integer, Hash)>] RefreshTokenInfoResponse data, response status code and response headers
|
92
|
+
def get_refresh_token_with_http_info(token, opts = {})
|
93
|
+
if @api_client.config.debugging
|
94
|
+
@api_client.config.logger.debug 'Calling API: RefreshTokensApi.get_refresh_token ...'
|
95
|
+
end
|
96
|
+
# verify the required parameter 'token' is set
|
97
|
+
if @api_client.config.client_side_validation && token.nil?
|
98
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling RefreshTokensApi.get_refresh_token"
|
99
|
+
end
|
100
|
+
# resource path
|
101
|
+
local_var_path = '/oauth/v1/refresh-tokens/{token}'.sub('{' + 'token' + '}', CGI.escape(token.to_s))
|
102
|
+
|
103
|
+
# query parameters
|
104
|
+
query_params = opts[:query_params] || {}
|
105
|
+
|
106
|
+
# header parameters
|
107
|
+
header_params = opts[:header_params] || {}
|
108
|
+
# HTTP header 'Accept' (if needed)
|
109
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
|
110
|
+
|
111
|
+
# form parameters
|
112
|
+
form_params = opts[:form_params] || {}
|
113
|
+
|
114
|
+
# http body (model)
|
115
|
+
post_body = opts[:body]
|
116
|
+
|
117
|
+
# return_type
|
118
|
+
return_type = opts[:return_type] || 'RefreshTokenInfoResponse'
|
119
|
+
|
120
|
+
# auth_names
|
121
|
+
auth_names = opts[:auth_names] || []
|
122
|
+
|
123
|
+
new_options = opts.merge(
|
124
|
+
:header_params => header_params,
|
125
|
+
:query_params => query_params,
|
126
|
+
:form_params => form_params,
|
127
|
+
:body => post_body,
|
128
|
+
:auth_names => auth_names,
|
129
|
+
:return_type => return_type
|
130
|
+
)
|
131
|
+
|
132
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
133
|
+
if @api_client.config.debugging
|
134
|
+
@api_client.config.logger.debug "API called: RefreshTokensApi#get_refresh_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
135
|
+
end
|
136
|
+
return data, status_code, headers
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
=begin
|
2
|
+
#OAuthService
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module Hubspot
|
16
|
+
module OAuth
|
17
|
+
class TokensApi
|
18
|
+
attr_accessor :api_client
|
19
|
+
|
20
|
+
def initialize(api_client = ApiClient.default)
|
21
|
+
@api_client = api_client
|
22
|
+
end
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @option opts [String] :grant_type
|
25
|
+
# @option opts [String] :code
|
26
|
+
# @option opts [String] :redirect_uri
|
27
|
+
# @option opts [String] :client_id
|
28
|
+
# @option opts [String] :client_secret
|
29
|
+
# @option opts [String] :refresh_token
|
30
|
+
# @return [TokenResponseIF]
|
31
|
+
def create_token(opts = {})
|
32
|
+
data, _status_code, _headers = create_token_with_http_info(opts)
|
33
|
+
data
|
34
|
+
end
|
35
|
+
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @option opts [String] :grant_type
|
38
|
+
# @option opts [String] :code
|
39
|
+
# @option opts [String] :redirect_uri
|
40
|
+
# @option opts [String] :client_id
|
41
|
+
# @option opts [String] :client_secret
|
42
|
+
# @option opts [String] :refresh_token
|
43
|
+
# @return [Array<(TokenResponseIF, Integer, Hash)>] TokenResponseIF data, response status code and response headers
|
44
|
+
def create_token_with_http_info(opts = {})
|
45
|
+
if @api_client.config.debugging
|
46
|
+
@api_client.config.logger.debug 'Calling API: TokensApi.create_token ...'
|
47
|
+
end
|
48
|
+
allowable_values = ["authorization_code", "refresh_token"]
|
49
|
+
if @api_client.config.client_side_validation && opts[:'grant_type'] && !allowable_values.include?(opts[:'grant_type'])
|
50
|
+
fail ArgumentError, "invalid value for \"grant_type\", must be one of #{allowable_values}"
|
51
|
+
end
|
52
|
+
# resource path
|
53
|
+
local_var_path = '/oauth/v1/token'
|
54
|
+
|
55
|
+
# query parameters
|
56
|
+
query_params = opts[:query_params] || {}
|
57
|
+
|
58
|
+
# header parameters
|
59
|
+
header_params = opts[:header_params] || {}
|
60
|
+
# HTTP header 'Accept' (if needed)
|
61
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
|
62
|
+
# HTTP header 'Content-Type'
|
63
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
64
|
+
|
65
|
+
# form parameters
|
66
|
+
form_params = opts[:form_params] || {}
|
67
|
+
form_params['grant_type'] = opts[:'grant_type'] if !opts[:'grant_type'].nil?
|
68
|
+
form_params['code'] = opts[:'code'] if !opts[:'code'].nil?
|
69
|
+
form_params['redirect_uri'] = opts[:'redirect_uri'] if !opts[:'redirect_uri'].nil?
|
70
|
+
form_params['client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil?
|
71
|
+
form_params['client_secret'] = opts[:'client_secret'] if !opts[:'client_secret'].nil?
|
72
|
+
form_params['refresh_token'] = opts[:'refresh_token'] if !opts[:'refresh_token'].nil?
|
73
|
+
|
74
|
+
# http body (model)
|
75
|
+
post_body = opts[:body]
|
76
|
+
|
77
|
+
# return_type
|
78
|
+
return_type = opts[:return_type] || 'TokenResponseIF'
|
79
|
+
|
80
|
+
# auth_names
|
81
|
+
auth_names = opts[:auth_names] || []
|
82
|
+
|
83
|
+
new_options = opts.merge(
|
84
|
+
:header_params => header_params,
|
85
|
+
:query_params => query_params,
|
86
|
+
:form_params => form_params,
|
87
|
+
:body => post_body,
|
88
|
+
:auth_names => auth_names,
|
89
|
+
:return_type => return_type
|
90
|
+
)
|
91
|
+
|
92
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
93
|
+
if @api_client.config.debugging
|
94
|
+
@api_client.config.logger.debug "API called: TokensApi#create_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
95
|
+
end
|
96
|
+
return data, status_code, headers
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -25,6 +25,10 @@ module Hubspot
|
|
25
25
|
|
26
26
|
attr_accessor :scope_to_scope_group_pks
|
27
27
|
|
28
|
+
attr_accessor :trial_scopes
|
29
|
+
|
30
|
+
attr_accessor :trial_scope_to_scope_group_pks
|
31
|
+
|
28
32
|
attr_accessor :hub_id
|
29
33
|
|
30
34
|
attr_accessor :app_id
|
@@ -43,6 +47,8 @@ module Hubspot
|
|
43
47
|
:'hub_domain' => :'hub_domain',
|
44
48
|
:'scopes' => :'scopes',
|
45
49
|
:'scope_to_scope_group_pks' => :'scope_to_scope_group_pks',
|
50
|
+
:'trial_scopes' => :'trial_scopes',
|
51
|
+
:'trial_scope_to_scope_group_pks' => :'trial_scope_to_scope_group_pks',
|
46
52
|
:'hub_id' => :'hub_id',
|
47
53
|
:'app_id' => :'app_id',
|
48
54
|
:'expires_in' => :'expires_in',
|
@@ -59,6 +65,8 @@ module Hubspot
|
|
59
65
|
:'hub_domain' => :'String',
|
60
66
|
:'scopes' => :'Array<String>',
|
61
67
|
:'scope_to_scope_group_pks' => :'Array<Integer>',
|
68
|
+
:'trial_scopes' => :'Array<String>',
|
69
|
+
:'trial_scope_to_scope_group_pks' => :'Array<Integer>',
|
62
70
|
:'hub_id' => :'Integer',
|
63
71
|
:'app_id' => :'Integer',
|
64
72
|
:'expires_in' => :'Integer',
|
@@ -112,6 +120,18 @@ module Hubspot
|
|
112
120
|
end
|
113
121
|
end
|
114
122
|
|
123
|
+
if attributes.key?(:'trial_scopes')
|
124
|
+
if (value = attributes[:'trial_scopes']).is_a?(Array)
|
125
|
+
self.trial_scopes = value
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.key?(:'trial_scope_to_scope_group_pks')
|
130
|
+
if (value = attributes[:'trial_scope_to_scope_group_pks']).is_a?(Array)
|
131
|
+
self.trial_scope_to_scope_group_pks = value
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
115
135
|
if attributes.key?(:'hub_id')
|
116
136
|
self.hub_id = attributes[:'hub_id']
|
117
137
|
end
|
@@ -149,6 +169,14 @@ module Hubspot
|
|
149
169
|
invalid_properties.push('invalid value for "scope_to_scope_group_pks", scope_to_scope_group_pks cannot be nil.')
|
150
170
|
end
|
151
171
|
|
172
|
+
if @trial_scopes.nil?
|
173
|
+
invalid_properties.push('invalid value for "trial_scopes", trial_scopes cannot be nil.')
|
174
|
+
end
|
175
|
+
|
176
|
+
if @trial_scope_to_scope_group_pks.nil?
|
177
|
+
invalid_properties.push('invalid value for "trial_scope_to_scope_group_pks", trial_scope_to_scope_group_pks cannot be nil.')
|
178
|
+
end
|
179
|
+
|
152
180
|
if @hub_id.nil?
|
153
181
|
invalid_properties.push('invalid value for "hub_id", hub_id cannot be nil.')
|
154
182
|
end
|
@@ -178,6 +206,8 @@ module Hubspot
|
|
178
206
|
return false if @token.nil?
|
179
207
|
return false if @scopes.nil?
|
180
208
|
return false if @scope_to_scope_group_pks.nil?
|
209
|
+
return false if @trial_scopes.nil?
|
210
|
+
return false if @trial_scope_to_scope_group_pks.nil?
|
181
211
|
return false if @hub_id.nil?
|
182
212
|
return false if @app_id.nil?
|
183
213
|
return false if @expires_in.nil?
|
@@ -196,6 +226,8 @@ module Hubspot
|
|
196
226
|
hub_domain == o.hub_domain &&
|
197
227
|
scopes == o.scopes &&
|
198
228
|
scope_to_scope_group_pks == o.scope_to_scope_group_pks &&
|
229
|
+
trial_scopes == o.trial_scopes &&
|
230
|
+
trial_scope_to_scope_group_pks == o.trial_scope_to_scope_group_pks &&
|
199
231
|
hub_id == o.hub_id &&
|
200
232
|
app_id == o.app_id &&
|
201
233
|
expires_in == o.expires_in &&
|
@@ -212,7 +244,7 @@ module Hubspot
|
|
212
244
|
# Calculates hash code according to all attributes.
|
213
245
|
# @return [Integer] Hash code
|
214
246
|
def hash
|
215
|
-
[token, user, hub_domain, scopes, scope_to_scope_group_pks, hub_id, app_id, expires_in, user_id, token_type].hash
|
247
|
+
[token, user, hub_domain, scopes, scope_to_scope_group_pks, trial_scopes, trial_scope_to_scope_group_pks, hub_id, app_id, expires_in, user_id, token_type].hash
|
216
248
|
end
|
217
249
|
|
218
250
|
# Builds the object from hash
|