hubspot-api-client 16.2.1 → 16.4.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 +15 -1
- data/Gemfile.lock +1 -1
- data/README.md +33 -1
- data/lib/hubspot/codegen/crm/associations/v4/api/batch_api.rb +428 -0
- data/lib/hubspot/codegen/crm/associations/v4/api/definitions_api.rb +332 -0
- data/lib/hubspot/codegen/crm/associations/v4/api_client.rb +412 -0
- data/lib/hubspot/codegen/crm/associations/v4/api_error.rb +63 -0
- data/lib/hubspot/codegen/crm/associations/v4/configuration.rb +296 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/association_spec.rb +278 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/association_spec_with_label.rb +287 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_association_multi_archive.rb +232 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_association_multi_post.rb +232 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_default_association_multi_post.rb +232 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_fetch_associations_batch_request.rb +232 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_labels_between_object_pair.rb +328 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_labels_between_object_pair_with_errors.rb +348 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_public_association_multi_with_label.rb +328 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_public_association_multi_with_label_with_errors.rb +348 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_public_default_association.rb +348 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/collection_response_association_spec_with_label_no_paging.rb +232 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/error.rb +307 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/error_category.rb +278 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/error_detail.rb +273 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/labels_between_object_pair.rb +288 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/multi_associated_object_with_label.rb +246 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/next_page.rb +239 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/paging.rb +234 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/previous_page.rb +239 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_association_definition_create_request.rb +244 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_association_definition_update_request.rb +244 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_association_multi_archive.rb +246 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_association_multi_post.rb +260 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_association_multi_with_label.rb +255 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_default_association.rb +258 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_default_association_multi_post.rb +244 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_fetch_associations_batch_request.rb +239 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_object_id.rb +230 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/standard_error.rb +324 -0
- data/lib/hubspot/codegen/crm/properties/models/property.rb +14 -4
- data/lib/hubspot/codegen/crm/properties/models/property_create.rb +38 -8
- data/lib/hubspot/codegen/crm/properties/models/property_update.rb +18 -8
- data/lib/hubspot/codegen/oauth/api/access_tokens_api.rb +0 -2
- data/lib/hubspot/codegen/oauth/api/refresh_tokens_api.rb +5 -7
- data/lib/hubspot/codegen/oauth/api/tokens_api.rb +0 -2
- data/lib/hubspot/codegen/oauth/api_client.rb +0 -2
- data/lib/hubspot/codegen/oauth/api_error.rb +0 -2
- data/lib/hubspot/codegen/oauth/configuration.rb +0 -2
- data/lib/hubspot/codegen/oauth/models/access_token_info_response.rb +0 -2
- data/lib/hubspot/codegen/oauth/models/error.rb +0 -2
- data/lib/hubspot/codegen/oauth/models/error_detail.rb +0 -2
- data/lib/hubspot/codegen/oauth/models/refresh_token_info_response.rb +0 -2
- data/lib/hubspot/codegen/oauth/models/token_response_if.rb +31 -33
- data/lib/hubspot/discovery/crm/associations/client.rb +3 -1
- data/lib/hubspot/discovery/crm/associations/v4/api/batch_api.rb +15 -0
- data/lib/hubspot/discovery/crm/associations/v4/api/definitions_api.rb +15 -0
- data/lib/hubspot/discovery/crm/associations/v4/client.rb +21 -0
- data/lib/hubspot/helpers/get_all_helper.rb +2 -1
- data/lib/hubspot/version.rb +1 -1
- data/spec/discovery/cms/blogs/client_spec.rb +9 -0
- data/spec/discovery/cms/client_spec.rb +13 -0
- data/spec/discovery/crm/associations/client_spec.rb +7 -0
- data/spec/discovery/crm/associations/v4/batch_api_spec.rb +11 -0
- data/spec/discovery/crm/associations/v4/definitions_api_spec.rb +10 -0
- data/spec/discovery/crm/client_spec.rb +21 -0
- data/spec/discovery/crm/extensions/client_spec.rb +11 -0
- data/spec/discovery/crm/objects/client_spec.rb +13 -0
- data/spec/discovery/marketing/client_spec.rb +9 -0
- metadata +58 -2
@@ -50,6 +50,15 @@ module Hubspot
|
|
50
50
|
# Whether or not the property can be used in a HubSpot form.
|
51
51
|
attr_accessor :form_field
|
52
52
|
|
53
|
+
# Applicable only for 'enumeration' type properties. Should be set to true in conjunction with a 'referencedObjectType' of 'OWNER'. Otherwise false.
|
54
|
+
attr_accessor :external_options
|
55
|
+
|
56
|
+
# Should be set to 'OWNER' when 'externalOptions' is true, which causes the property to dynamically pull option values from the current HubSpot users.
|
57
|
+
attr_accessor :referenced_object_type
|
58
|
+
|
59
|
+
# Represents a formula that is used to compute a calculated property.
|
60
|
+
attr_accessor :calculation_formula
|
61
|
+
|
53
62
|
class EnumAttributeValidator
|
54
63
|
attr_reader :datatype
|
55
64
|
attr_reader :allowable_values
|
@@ -85,7 +94,10 @@ module Hubspot
|
|
85
94
|
:'display_order' => :'displayOrder',
|
86
95
|
:'has_unique_value' => :'hasUniqueValue',
|
87
96
|
:'hidden' => :'hidden',
|
88
|
-
:'form_field' => :'formField'
|
97
|
+
:'form_field' => :'formField',
|
98
|
+
:'external_options' => :'externalOptions',
|
99
|
+
:'referenced_object_type' => :'referencedObjectType',
|
100
|
+
:'calculation_formula' => :'calculationFormula'
|
89
101
|
}
|
90
102
|
end
|
91
103
|
|
@@ -107,7 +119,10 @@ module Hubspot
|
|
107
119
|
:'display_order' => :'Integer',
|
108
120
|
:'has_unique_value' => :'Boolean',
|
109
121
|
:'hidden' => :'Boolean',
|
110
|
-
:'form_field' => :'Boolean'
|
122
|
+
:'form_field' => :'Boolean',
|
123
|
+
:'external_options' => :'Boolean',
|
124
|
+
:'referenced_object_type' => :'String',
|
125
|
+
:'calculation_formula' => :'String'
|
111
126
|
}
|
112
127
|
end
|
113
128
|
|
@@ -177,6 +192,18 @@ module Hubspot
|
|
177
192
|
if attributes.key?(:'form_field')
|
178
193
|
self.form_field = attributes[:'form_field']
|
179
194
|
end
|
195
|
+
|
196
|
+
if attributes.key?(:'external_options')
|
197
|
+
self.external_options = attributes[:'external_options']
|
198
|
+
end
|
199
|
+
|
200
|
+
if attributes.key?(:'referenced_object_type')
|
201
|
+
self.referenced_object_type = attributes[:'referenced_object_type']
|
202
|
+
end
|
203
|
+
|
204
|
+
if attributes.key?(:'calculation_formula')
|
205
|
+
self.calculation_formula = attributes[:'calculation_formula']
|
206
|
+
end
|
180
207
|
end
|
181
208
|
|
182
209
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -212,10 +239,10 @@ module Hubspot
|
|
212
239
|
return false if @name.nil?
|
213
240
|
return false if @label.nil?
|
214
241
|
return false if @type.nil?
|
215
|
-
type_validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration"])
|
242
|
+
type_validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration", "bool"])
|
216
243
|
return false unless type_validator.valid?(@type)
|
217
244
|
return false if @field_type.nil?
|
218
|
-
field_type_validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox"])
|
245
|
+
field_type_validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox", "calculation_equation"])
|
219
246
|
return false unless field_type_validator.valid?(@field_type)
|
220
247
|
return false if @group_name.nil?
|
221
248
|
true
|
@@ -224,7 +251,7 @@ module Hubspot
|
|
224
251
|
# Custom attribute writer method checking allowed values (enum).
|
225
252
|
# @param [Object] type Object to be assigned
|
226
253
|
def type=(type)
|
227
|
-
validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration"])
|
254
|
+
validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration", "bool"])
|
228
255
|
unless validator.valid?(type)
|
229
256
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
230
257
|
end
|
@@ -234,7 +261,7 @@ module Hubspot
|
|
234
261
|
# Custom attribute writer method checking allowed values (enum).
|
235
262
|
# @param [Object] field_type Object to be assigned
|
236
263
|
def field_type=(field_type)
|
237
|
-
validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox"])
|
264
|
+
validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox", "calculation_equation"])
|
238
265
|
unless validator.valid?(field_type)
|
239
266
|
fail ArgumentError, "invalid value for \"field_type\", must be one of #{validator.allowable_values}."
|
240
267
|
end
|
@@ -256,7 +283,10 @@ module Hubspot
|
|
256
283
|
display_order == o.display_order &&
|
257
284
|
has_unique_value == o.has_unique_value &&
|
258
285
|
hidden == o.hidden &&
|
259
|
-
form_field == o.form_field
|
286
|
+
form_field == o.form_field &&
|
287
|
+
external_options == o.external_options &&
|
288
|
+
referenced_object_type == o.referenced_object_type &&
|
289
|
+
calculation_formula == o.calculation_formula
|
260
290
|
end
|
261
291
|
|
262
292
|
# @see the `==` method
|
@@ -268,7 +298,7 @@ module Hubspot
|
|
268
298
|
# Calculates hash code according to all attributes.
|
269
299
|
# @return [Integer] Hash code
|
270
300
|
def hash
|
271
|
-
[name, label, type, field_type, group_name, description, options, display_order, has_unique_value, hidden, form_field].hash
|
301
|
+
[name, label, type, field_type, group_name, description, options, display_order, has_unique_value, hidden, form_field, external_options, referenced_object_type, calculation_formula].hash
|
272
302
|
end
|
273
303
|
|
274
304
|
# Builds the object from hash
|
@@ -44,6 +44,9 @@ module Hubspot
|
|
44
44
|
# Whether or not the property can be used in a HubSpot form.
|
45
45
|
attr_accessor :form_field
|
46
46
|
|
47
|
+
# Represents a formula that is used to compute a calculated property.
|
48
|
+
attr_accessor :calculation_formula
|
49
|
+
|
47
50
|
class EnumAttributeValidator
|
48
51
|
attr_reader :datatype
|
49
52
|
attr_reader :allowable_values
|
@@ -77,7 +80,8 @@ module Hubspot
|
|
77
80
|
:'options' => :'options',
|
78
81
|
:'display_order' => :'displayOrder',
|
79
82
|
:'hidden' => :'hidden',
|
80
|
-
:'form_field' => :'formField'
|
83
|
+
:'form_field' => :'formField',
|
84
|
+
:'calculation_formula' => :'calculationFormula'
|
81
85
|
}
|
82
86
|
end
|
83
87
|
|
@@ -97,7 +101,8 @@ module Hubspot
|
|
97
101
|
:'options' => :'Array<OptionInput>',
|
98
102
|
:'display_order' => :'Integer',
|
99
103
|
:'hidden' => :'Boolean',
|
100
|
-
:'form_field' => :'Boolean'
|
104
|
+
:'form_field' => :'Boolean',
|
105
|
+
:'calculation_formula' => :'String'
|
101
106
|
}
|
102
107
|
end
|
103
108
|
|
@@ -159,6 +164,10 @@ module Hubspot
|
|
159
164
|
if attributes.key?(:'form_field')
|
160
165
|
self.form_field = attributes[:'form_field']
|
161
166
|
end
|
167
|
+
|
168
|
+
if attributes.key?(:'calculation_formula')
|
169
|
+
self.calculation_formula = attributes[:'calculation_formula']
|
170
|
+
end
|
162
171
|
end
|
163
172
|
|
164
173
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -171,9 +180,9 @@ module Hubspot
|
|
171
180
|
# Check to see if the all the properties in the model are valid
|
172
181
|
# @return true if the model is valid
|
173
182
|
def valid?
|
174
|
-
type_validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration"])
|
183
|
+
type_validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration", "bool"])
|
175
184
|
return false unless type_validator.valid?(@type)
|
176
|
-
field_type_validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox"])
|
185
|
+
field_type_validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox", "calculation_equation"])
|
177
186
|
return false unless field_type_validator.valid?(@field_type)
|
178
187
|
true
|
179
188
|
end
|
@@ -181,7 +190,7 @@ module Hubspot
|
|
181
190
|
# Custom attribute writer method checking allowed values (enum).
|
182
191
|
# @param [Object] type Object to be assigned
|
183
192
|
def type=(type)
|
184
|
-
validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration"])
|
193
|
+
validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration", "bool"])
|
185
194
|
unless validator.valid?(type)
|
186
195
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
187
196
|
end
|
@@ -191,7 +200,7 @@ module Hubspot
|
|
191
200
|
# Custom attribute writer method checking allowed values (enum).
|
192
201
|
# @param [Object] field_type Object to be assigned
|
193
202
|
def field_type=(field_type)
|
194
|
-
validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox"])
|
203
|
+
validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox", "calculation_equation"])
|
195
204
|
unless validator.valid?(field_type)
|
196
205
|
fail ArgumentError, "invalid value for \"field_type\", must be one of #{validator.allowable_values}."
|
197
206
|
end
|
@@ -211,7 +220,8 @@ module Hubspot
|
|
211
220
|
options == o.options &&
|
212
221
|
display_order == o.display_order &&
|
213
222
|
hidden == o.hidden &&
|
214
|
-
form_field == o.form_field
|
223
|
+
form_field == o.form_field &&
|
224
|
+
calculation_formula == o.calculation_formula
|
215
225
|
end
|
216
226
|
|
217
227
|
# @see the `==` method
|
@@ -223,7 +233,7 @@ module Hubspot
|
|
223
233
|
# Calculates hash code according to all attributes.
|
224
234
|
# @return [Integer] Hash code
|
225
235
|
def hash
|
226
|
-
[label, type, field_type, group_name, description, options, display_order, hidden, form_field].hash
|
236
|
+
[label, type, field_type, group_name, description, options, display_order, hidden, form_field, calculation_formula].hash
|
227
237
|
end
|
228
238
|
|
229
239
|
# Builds the object from hash
|
@@ -1,6 +1,4 @@
|
|
1
1
|
=begin
|
2
|
-
#OAuthService
|
3
|
-
|
4
2
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
3
|
|
6
4
|
The version of the OpenAPI document: v1
|
@@ -22,15 +20,15 @@ module Hubspot
|
|
22
20
|
end
|
23
21
|
# @param token [String]
|
24
22
|
# @param [Hash] opts the optional parameters
|
25
|
-
# @return [
|
23
|
+
# @return [nil]
|
26
24
|
def archive_refresh_token(token, opts = {})
|
27
|
-
|
28
|
-
|
25
|
+
archive_refresh_token_with_http_info(token, opts)
|
26
|
+
nil
|
29
27
|
end
|
30
28
|
|
31
29
|
# @param token [String]
|
32
30
|
# @param [Hash] opts the optional parameters
|
33
|
-
# @return [Array<(
|
31
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
34
32
|
def archive_refresh_token_with_http_info(token, opts = {})
|
35
33
|
if @api_client.config.debugging
|
36
34
|
@api_client.config.logger.debug 'Calling API: RefreshTokensApi.archive_refresh_token ...'
|
@@ -57,7 +55,7 @@ module Hubspot
|
|
57
55
|
post_body = opts[:debug_body]
|
58
56
|
|
59
57
|
# return_type
|
60
|
-
return_type = opts[:debug_return_type]
|
58
|
+
return_type = opts[:debug_return_type]
|
61
59
|
|
62
60
|
# auth_names
|
63
61
|
auth_names = opts[:debug_auth_names] || []
|
@@ -1,6 +1,4 @@
|
|
1
1
|
=begin
|
2
|
-
#OAuthService
|
3
|
-
|
4
2
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
3
|
|
6
4
|
The version of the OpenAPI document: v1
|
@@ -16,24 +14,24 @@ require 'time'
|
|
16
14
|
module Hubspot
|
17
15
|
module OAuth
|
18
16
|
class TokenResponseIF
|
19
|
-
attr_accessor :
|
17
|
+
attr_accessor :access_token
|
20
18
|
|
21
19
|
attr_accessor :expires_in
|
22
20
|
|
23
|
-
attr_accessor :
|
24
|
-
|
25
|
-
attr_accessor :id_token
|
21
|
+
attr_accessor :refresh_token
|
26
22
|
|
27
23
|
attr_accessor :token_type
|
28
24
|
|
25
|
+
attr_accessor :id_token
|
26
|
+
|
29
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
30
28
|
def self.attribute_map
|
31
29
|
{
|
32
|
-
:'refresh_token' => :'refresh_token',
|
33
|
-
:'expires_in' => :'expires_in',
|
34
30
|
:'access_token' => :'access_token',
|
35
|
-
:'
|
36
|
-
:'
|
31
|
+
:'expires_in' => :'expires_in',
|
32
|
+
:'refresh_token' => :'refresh_token',
|
33
|
+
:'token_type' => :'token_type',
|
34
|
+
:'id_token' => :'id_token'
|
37
35
|
}
|
38
36
|
end
|
39
37
|
|
@@ -45,11 +43,11 @@ module Hubspot
|
|
45
43
|
# Attribute type mapping.
|
46
44
|
def self.openapi_types
|
47
45
|
{
|
48
|
-
:'refresh_token' => :'String',
|
49
|
-
:'expires_in' => :'Integer',
|
50
46
|
:'access_token' => :'String',
|
51
|
-
:'
|
52
|
-
:'
|
47
|
+
:'expires_in' => :'Integer',
|
48
|
+
:'refresh_token' => :'String',
|
49
|
+
:'token_type' => :'String',
|
50
|
+
:'id_token' => :'String'
|
53
51
|
}
|
54
52
|
end
|
55
53
|
|
@@ -74,41 +72,41 @@ module Hubspot
|
|
74
72
|
h[k.to_sym] = v
|
75
73
|
}
|
76
74
|
|
77
|
-
if attributes.key?(:'
|
78
|
-
self.
|
75
|
+
if attributes.key?(:'access_token')
|
76
|
+
self.access_token = attributes[:'access_token']
|
79
77
|
end
|
80
78
|
|
81
79
|
if attributes.key?(:'expires_in')
|
82
80
|
self.expires_in = attributes[:'expires_in']
|
83
81
|
end
|
84
82
|
|
85
|
-
if attributes.key?(:'
|
86
|
-
self.
|
87
|
-
end
|
88
|
-
|
89
|
-
if attributes.key?(:'id_token')
|
90
|
-
self.id_token = attributes[:'id_token']
|
83
|
+
if attributes.key?(:'refresh_token')
|
84
|
+
self.refresh_token = attributes[:'refresh_token']
|
91
85
|
end
|
92
86
|
|
93
87
|
if attributes.key?(:'token_type')
|
94
88
|
self.token_type = attributes[:'token_type']
|
95
89
|
end
|
90
|
+
|
91
|
+
if attributes.key?(:'id_token')
|
92
|
+
self.id_token = attributes[:'id_token']
|
93
|
+
end
|
96
94
|
end
|
97
95
|
|
98
96
|
# Show invalid properties with the reasons. Usually used together with valid?
|
99
97
|
# @return Array for valid properties with the reasons
|
100
98
|
def list_invalid_properties
|
101
99
|
invalid_properties = Array.new
|
102
|
-
if @
|
103
|
-
invalid_properties.push('invalid value for "
|
100
|
+
if @access_token.nil?
|
101
|
+
invalid_properties.push('invalid value for "access_token", access_token cannot be nil.')
|
104
102
|
end
|
105
103
|
|
106
104
|
if @expires_in.nil?
|
107
105
|
invalid_properties.push('invalid value for "expires_in", expires_in cannot be nil.')
|
108
106
|
end
|
109
107
|
|
110
|
-
if @
|
111
|
-
invalid_properties.push('invalid value for "
|
108
|
+
if @refresh_token.nil?
|
109
|
+
invalid_properties.push('invalid value for "refresh_token", refresh_token cannot be nil.')
|
112
110
|
end
|
113
111
|
|
114
112
|
if @token_type.nil?
|
@@ -121,9 +119,9 @@ module Hubspot
|
|
121
119
|
# Check to see if the all the properties in the model are valid
|
122
120
|
# @return true if the model is valid
|
123
121
|
def valid?
|
124
|
-
return false if @refresh_token.nil?
|
125
|
-
return false if @expires_in.nil?
|
126
122
|
return false if @access_token.nil?
|
123
|
+
return false if @expires_in.nil?
|
124
|
+
return false if @refresh_token.nil?
|
127
125
|
return false if @token_type.nil?
|
128
126
|
true
|
129
127
|
end
|
@@ -133,11 +131,11 @@ module Hubspot
|
|
133
131
|
def ==(o)
|
134
132
|
return true if self.equal?(o)
|
135
133
|
self.class == o.class &&
|
136
|
-
refresh_token == o.refresh_token &&
|
137
|
-
expires_in == o.expires_in &&
|
138
134
|
access_token == o.access_token &&
|
139
|
-
|
140
|
-
|
135
|
+
expires_in == o.expires_in &&
|
136
|
+
refresh_token == o.refresh_token &&
|
137
|
+
token_type == o.token_type &&
|
138
|
+
id_token == o.id_token
|
141
139
|
end
|
142
140
|
|
143
141
|
# @see the `==` method
|
@@ -149,7 +147,7 @@ module Hubspot
|
|
149
147
|
# Calculates hash code according to all attributes.
|
150
148
|
# @return [Integer] Hash code
|
151
149
|
def hash
|
152
|
-
[
|
150
|
+
[access_token, expires_in, refresh_token, token_type, id_token].hash
|
153
151
|
end
|
154
152
|
|
155
153
|
# Builds the object from hash
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative '../../../base_module_client'
|
2
|
+
|
3
|
+
module Hubspot
|
4
|
+
module Discovery
|
5
|
+
module Crm
|
6
|
+
module Associations
|
7
|
+
module V4
|
8
|
+
class Client
|
9
|
+
include Hubspot::Discovery::BaseModuleClient
|
10
|
+
def api_classes
|
11
|
+
%i[
|
12
|
+
batch
|
13
|
+
definitions
|
14
|
+
].freeze
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -12,8 +12,9 @@ module Hubspot
|
|
12
12
|
def get_all(opts = {})
|
13
13
|
after = nil
|
14
14
|
objects = []
|
15
|
+
opts[:limit] ||= MAX_PAGE_SIZE
|
15
16
|
loop do
|
16
|
-
page_opts = opts.merge(
|
17
|
+
page_opts = opts.merge(after: after)
|
17
18
|
page = get_page(page_opts)
|
18
19
|
objects.concat(page.results)
|
19
20
|
break objects if page.paging.nil?
|
data/lib/hubspot/version.rb
CHANGED
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Hubspot::Client' do
|
4
|
+
subject(:client) { Hubspot::Client.new(access_token: 'test').cms.blogs }
|
5
|
+
|
6
|
+
it { is_expected.to respond_to(:authors) }
|
7
|
+
it { is_expected.to respond_to(:blog_posts) }
|
8
|
+
it { is_expected.to respond_to(:tags) }
|
9
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Hubspot::Client' do
|
4
|
+
subject(:client) { Hubspot::Client.new(access_token: 'test').cms }
|
5
|
+
|
6
|
+
it { is_expected.to respond_to(:audit_logs) }
|
7
|
+
it { is_expected.to respond_to(:blogs) }
|
8
|
+
it { is_expected.to respond_to(:domains) }
|
9
|
+
it { is_expected.to respond_to(:hubdb) }
|
10
|
+
it { is_expected.to respond_to(:performance) }
|
11
|
+
it { is_expected.to respond_to(:site_search) }
|
12
|
+
it { is_expected.to respond_to(:url_redirects) }
|
13
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Hubspot::Discovery::Crm::Associations::V4::BatchApi' do
|
4
|
+
subject(:batch_api) { Hubspot::Client.new(access_token: 'test').crm.associations.v4.batch_api }
|
5
|
+
|
6
|
+
it { is_expected.to respond_to(:archive) }
|
7
|
+
it { is_expected.to respond_to(:archive_labels) }
|
8
|
+
it { is_expected.to respond_to(:create_default) }
|
9
|
+
it { is_expected.to respond_to(:create) }
|
10
|
+
it { is_expected.to respond_to(:get_page) }
|
11
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Hubspot::Discovery::Crm::Associations::V4::DefinitionsApi' do
|
4
|
+
subject(:definitions_api) { Hubspot::Client.new(access_token: 'test').crm.associations.v4.definitions_api }
|
5
|
+
|
6
|
+
it { is_expected.to respond_to(:get_all) }
|
7
|
+
it { is_expected.to respond_to(:archive) }
|
8
|
+
it { is_expected.to respond_to(:create) }
|
9
|
+
it { is_expected.to respond_to(:update) }
|
10
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Hubspot::Client' do
|
4
|
+
subject(:client) { Hubspot::Client.new(access_token: 'test').crm }
|
5
|
+
|
6
|
+
it { is_expected.to respond_to(:associations) }
|
7
|
+
it { is_expected.to respond_to(:companies) }
|
8
|
+
it { is_expected.to respond_to(:contacts) }
|
9
|
+
it { is_expected.to respond_to(:deals) }
|
10
|
+
it { is_expected.to respond_to(:extensions) }
|
11
|
+
it { is_expected.to respond_to(:imports) }
|
12
|
+
it { is_expected.to respond_to(:line_items) }
|
13
|
+
it { is_expected.to respond_to(:objects) }
|
14
|
+
it { is_expected.to respond_to(:owners) }
|
15
|
+
it { is_expected.to respond_to(:pipelines) }
|
16
|
+
it { is_expected.to respond_to(:products) }
|
17
|
+
it { is_expected.to respond_to(:quotes) }
|
18
|
+
it { is_expected.to respond_to(:schemas) }
|
19
|
+
it { is_expected.to respond_to(:tickets) }
|
20
|
+
it { is_expected.to respond_to(:timeline) }
|
21
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Hubspot::Client' do
|
4
|
+
subject(:client) { Hubspot::Client.new(access_token: 'test').crm.extensions }
|
5
|
+
|
6
|
+
it { is_expected.to respond_to(:accounting) }
|
7
|
+
it { is_expected.to respond_to(:calling) }
|
8
|
+
it { is_expected.to respond_to(:cards) }
|
9
|
+
it { is_expected.to respond_to(:videoconferencing) }
|
10
|
+
|
11
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Hubspot::Client' do
|
4
|
+
subject(:client) { Hubspot::Client.new(access_token: 'test').crm.objects }
|
5
|
+
|
6
|
+
it { is_expected.to respond_to(:calls) }
|
7
|
+
it { is_expected.to respond_to(:emails) }
|
8
|
+
it { is_expected.to respond_to(:feedback_submissions) }
|
9
|
+
it { is_expected.to respond_to(:meetings) }
|
10
|
+
it { is_expected.to respond_to(:notes) }
|
11
|
+
it { is_expected.to respond_to(:postal_mail) }
|
12
|
+
it { is_expected.to respond_to(:tasks) }
|
13
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Hubspot::Client' do
|
4
|
+
subject(:client) { Hubspot::Client.new(access_token: 'test').marketing }
|
5
|
+
|
6
|
+
it { is_expected.to respond_to(:events) }
|
7
|
+
it { is_expected.to respond_to(:forms) }
|
8
|
+
it { is_expected.to respond_to(:transactional) }
|
9
|
+
end
|