hubspot-api-client 20.0.0 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ee0f134bcb5fd133a077e86f5853808a1401a19adca17a111851952cf7d73a7
4
- data.tar.gz: 62674fd3da3da53040440e3d6e0d7a28405295c648e284aeb621b5fcd4dc7d33
3
+ metadata.gz: 1c4afe89bf606532f2b13cae4d69ca2e1f80df7ef1494fa2d0fefa353928f14e
4
+ data.tar.gz: 5a58910eb844420ff294be50a30756d7d028714fd70f1602039c1ef276ffc043
5
5
  SHA512:
6
- metadata.gz: 718ff3c137d0dc5a3f6009a426d5da1b0925fb6124966ef6829e01c6114feeb2f4307e9211f8a6c97e5e0f17000605cd47da80de59ba42d93a04a8f387040c47
7
- data.tar.gz: 1c58837bf3e12672c0c0f8413da6af61a737addcd18edb409331f3cfabcce824a89e8b444310ac51a7be54bbe51479918b2b098bb9dbb772b2d999a9cc3b3431
6
+ metadata.gz: 28cb9b7d21ae02bb022980366ffc1b3e756e7e29c7a07aef49e68a77e5a62d71faee97e9e3a8770a2286334586b002fa327fe15f23d04e56cfc8a2fa1b0464e5
7
+ data.tar.gz: 445e9caa575fdd847eb1fda8c63883936fc05e493fe0bd4493269be4a34b798d3d01987efb4e95135079ed77355377fcf9a52f5a6ec206a7a9e178f9c8d9d5fb
data/CHANGELOG.md CHANGED
@@ -5,7 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [Unreleased](https://github.com/HubSpot/hubspot-api-ruby/compare/v20.0.0...HEAD)
8
+ ## [Unreleased](https://github.com/HubSpot/hubspot-api-ruby/compare/v20.1.0...HEAD)
9
+
10
+ ## [20.1.0] - 2026-10-27
11
+
12
+ ## OAuth
13
+
14
+ - Added OAuth v3 client, available as `oauth.v3`.
15
+ - Added `oauth.v3.advanced_api` with methods `get_token()`, `introspect_token()` and `revoke_token()`.
16
+ - Added models `AccessTokenResponse`, `ClientCredentialsTokenResponse`, `PublicAccessTokenInfoResponse`, `PublicRefreshTokenInfoResponse`, `SignedAccessToken`, `Error` and `ErrorDetail`.
17
+ - Added polymorphic base models `TokenResponseIF` and `TokenInfoResponseBaseIF`, which deserialize to the matching token response type.
9
18
 
10
19
  ## [20.0.0] - 2025-05-08
11
20
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hubspot-api-client (20.0.0)
4
+ hubspot-api-client (20.1.0)
5
5
  json (~> 2.1, >= 2.1.0)
6
6
  typhoeus (~> 1.4.0)
7
7
 
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.license = "Apache-2.0"
14
14
  s.required_ruby_version = ">= 2.7"
15
15
 
16
- s.add_runtime_dependency 'typhoeus', '~> 1.4.0'
16
+ s.add_runtime_dependency 'typhoeus', '>= 1.4.0'
17
17
  s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
18
18
 
19
19
  s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
@@ -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