petstore-test-18052023 1.0.1.pre.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +193 -0
- data/lib/merged_api/api_helper.rb +10 -0
- data/lib/merged_api/client.rb +97 -0
- data/lib/merged_api/configuration.rb +127 -0
- data/lib/merged_api/controllers/authentication_controller.rb +36 -0
- data/lib/merged_api/controllers/base_controller.rb +65 -0
- data/lib/merged_api/controllers/insured_risk_controller.rb +47 -0
- data/lib/merged_api/controllers/o_auth_authorization_controller.rb +42 -0
- data/lib/merged_api/controllers/policy_controller.rb +66 -0
- data/lib/merged_api/controllers/quoting_controller.rb +41 -0
- data/lib/merged_api/controllers/simple_calculator_controller.rb +33 -0
- data/lib/merged_api/exceptions/api_exception.rb +10 -0
- data/lib/merged_api/exceptions/auth_oauth2_token400_error1_exception.rb +32 -0
- data/lib/merged_api/exceptions/insured_risks400_error1_exception.rb +41 -0
- data/lib/merged_api/exceptions/insured_risks401_error1_exception.rb +32 -0
- data/lib/merged_api/exceptions/insured_risks403_error1_exception.rb +41 -0
- data/lib/merged_api/exceptions/insured_risks415_error1_exception.rb +41 -0
- data/lib/merged_api/exceptions/insured_risks500_error1_exception.rb +41 -0
- data/lib/merged_api/exceptions/o_auth_provider_exception.rb +48 -0
- data/lib/merged_api/exceptions/policies400_error1_exception.rb +41 -0
- data/lib/merged_api/exceptions/policies401_error1_exception.rb +32 -0
- data/lib/merged_api/exceptions/policies403_error1_exception.rb +41 -0
- data/lib/merged_api/exceptions/policies500_error1_exception.rb +41 -0
- data/lib/merged_api/exceptions/quotes400_error1_exception.rb +41 -0
- data/lib/merged_api/exceptions/quotes401_error1_exception.rb +32 -0
- data/lib/merged_api/exceptions/quotes500_error1_exception.rb +41 -0
- data/lib/merged_api/http/auth/o_auth2.rb +63 -0
- data/lib/merged_api/http/http_call_back.rb +10 -0
- data/lib/merged_api/http/http_method_enum.rb +10 -0
- data/lib/merged_api/http/http_request.rb +10 -0
- data/lib/merged_api/http/http_response.rb +10 -0
- data/lib/merged_api/models/accept_enum.rb +14 -0
- data/lib/merged_api/models/additional_insured.rb +68 -0
- data/lib/merged_api/models/additional_interests.rb +68 -0
- data/lib/merged_api/models/agent.rb +48 -0
- data/lib/merged_api/models/agent3.rb +48 -0
- data/lib/merged_api/models/agent6.rb +48 -0
- data/lib/merged_api/models/attributes.rb +87 -0
- data/lib/merged_api/models/attributes1.rb +80 -0
- data/lib/merged_api/models/attributes10.rb +86 -0
- data/lib/merged_api/models/attributes11.rb +137 -0
- data/lib/merged_api/models/attributes12.rb +48 -0
- data/lib/merged_api/models/attributes2.rb +80 -0
- data/lib/merged_api/models/attributes3.rb +412 -0
- data/lib/merged_api/models/attributes4.rb +126 -0
- data/lib/merged_api/models/attributes5.rb +80 -0
- data/lib/merged_api/models/attributes6.rb +422 -0
- data/lib/merged_api/models/attributes9.rb +284 -0
- data/lib/merged_api/models/auth_oauth2_token_response.rb +70 -0
- data/lib/merged_api/models/base_model.rb +58 -0
- data/lib/merged_api/models/billing_address.rb +86 -0
- data/lib/merged_api/models/content_type1_enum.rb +14 -0
- data/lib/merged_api/models/content_type_enum.rb +14 -0
- data/lib/merged_api/models/coverage.rb +48 -0
- data/lib/merged_api/models/coverages.rb +68 -0
- data/lib/merged_api/models/coverages2.rb +57 -0
- data/lib/merged_api/models/coverages3.rb +57 -0
- data/lib/merged_api/models/customer.rb +48 -0
- data/lib/merged_api/models/customer2.rb +48 -0
- data/lib/merged_api/models/customer3.rb +48 -0
- data/lib/merged_api/models/data.rb +77 -0
- data/lib/merged_api/models/data1.rb +57 -0
- data/lib/merged_api/models/data11.rb +57 -0
- data/lib/merged_api/models/data12.rb +57 -0
- data/lib/merged_api/models/data18.rb +57 -0
- data/lib/merged_api/models/data19.rb +57 -0
- data/lib/merged_api/models/data2.rb +57 -0
- data/lib/merged_api/models/data20.rb +57 -0
- data/lib/merged_api/models/data21.rb +57 -0
- data/lib/merged_api/models/data24.rb +87 -0
- data/lib/merged_api/models/data3.rb +75 -0
- data/lib/merged_api/models/data39.rb +66 -0
- data/lib/merged_api/models/data40.rb +58 -0
- data/lib/merged_api/models/data41.rb +58 -0
- data/lib/merged_api/models/data42.rb +58 -0
- data/lib/merged_api/models/data43.rb +57 -0
- data/lib/merged_api/models/data44.rb +57 -0
- data/lib/merged_api/models/data45.rb +76 -0
- data/lib/merged_api/models/data46.rb +57 -0
- data/lib/merged_api/models/data47.rb +57 -0
- data/lib/merged_api/models/data6.rb +66 -0
- data/lib/merged_api/models/data7.rb +57 -0
- data/lib/merged_api/models/data8.rb +57 -0
- data/lib/merged_api/models/data9.rb +76 -0
- data/lib/merged_api/models/endorsement.rb +48 -0
- data/lib/merged_api/models/entity_type_enum.rb +17 -0
- data/lib/merged_api/models/errors.rb +61 -0
- data/lib/merged_api/models/errors1.rb +60 -0
- data/lib/merged_api/models/expires_in_enum.rb +14 -0
- data/lib/merged_api/models/grant_type_enum.rb +14 -0
- data/lib/merged_api/models/included.rb +75 -0
- data/lib/merged_api/models/included1.rb +75 -0
- data/lib/merged_api/models/included3.rb +76 -0
- data/lib/merged_api/models/included31.rb +67 -0
- data/lib/merged_api/models/included32.rb +67 -0
- data/lib/merged_api/models/included4.rb +85 -0
- data/lib/merged_api/models/included41.rb +85 -0
- data/lib/merged_api/models/included42.rb +85 -0
- data/lib/merged_api/models/installment_plan.rb +49 -0
- data/lib/merged_api/models/installment_plan2.rb +85 -0
- data/lib/merged_api/models/insured_risk.rb +48 -0
- data/lib/merged_api/models/insured_risk2.rb +48 -0
- data/lib/merged_api/models/insured_risk3.rb +48 -0
- data/lib/merged_api/models/insured_risks_request.rb +48 -0
- data/lib/merged_api/models/insured_risks_response.rb +48 -0
- data/lib/merged_api/models/mailing_address.rb +86 -0
- data/lib/merged_api/models/meta.rb +50 -0
- data/lib/merged_api/models/o_auth_provider_error_enum.rb +39 -0
- data/lib/merged_api/models/o_auth_token.rb +100 -0
- data/lib/merged_api/models/operation_type_enum.rb +23 -0
- data/lib/merged_api/models/parent.rb +48 -0
- data/lib/merged_api/models/policies_request.rb +48 -0
- data/lib/merged_api/models/policies_response.rb +59 -0
- data/lib/merged_api/models/policies_response1.rb +57 -0
- data/lib/merged_api/models/policy.rb +48 -0
- data/lib/merged_api/models/policy_state2_enum.rb +164 -0
- data/lib/merged_api/models/policy_state_enum.rb +165 -0
- data/lib/merged_api/models/product.rb +49 -0
- data/lib/merged_api/models/product2.rb +49 -0
- data/lib/merged_api/models/product3.rb +48 -0
- data/lib/merged_api/models/product6.rb +50 -0
- data/lib/merged_api/models/product_coverage.rb +48 -0
- data/lib/merged_api/models/quotes_request.rb +57 -0
- data/lib/merged_api/models/quotes_response.rb +57 -0
- data/lib/merged_api/models/relationships.rb +61 -0
- data/lib/merged_api/models/relationships1.rb +59 -0
- data/lib/merged_api/models/relationships10.rb +49 -0
- data/lib/merged_api/models/relationships11.rb +90 -0
- data/lib/merged_api/models/relationships13.rb +48 -0
- data/lib/merged_api/models/relationships14.rb +60 -0
- data/lib/merged_api/models/relationships2.rb +61 -0
- data/lib/merged_api/models/relationships3.rb +127 -0
- data/lib/merged_api/models/relationships4.rb +66 -0
- data/lib/merged_api/models/relationships5.rb +57 -0
- data/lib/merged_api/models/relationships9.rb +81 -0
- data/lib/merged_api/models/state_enum.rb +164 -0
- data/lib/merged_api/models/status2_enum.rb +26 -0
- data/lib/merged_api/models/status_enum.rb +32 -0
- data/lib/merged_api/models/token_type_enum.rb +14 -0
- data/lib/merged_api/utilities/date_time_helper.rb +11 -0
- data/lib/merged_api/utilities/file_wrapper.rb +16 -0
- data/lib/merged_api.rb +165 -0
- data/test/controllers/controller_test_base.rb +33 -0
- data/test/controllers/test_policy_controller.rb +36 -0
- data/test/controllers/test_simple_calculator_controller.rb +34 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +267 -0
@@ -0,0 +1,284 @@
|
|
1
|
+
# merged_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
require 'date'
|
7
|
+
module MergedApi
|
8
|
+
# Attributes for this object.
|
9
|
+
class Attributes9 < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# A value from the set denoting the user-selected limit of coverage. This is
|
14
|
+
# dependent
|
15
|
+
# on the product's configuration.
|
16
|
+
# @return [String]
|
17
|
+
attr_accessor :limit
|
18
|
+
|
19
|
+
# A value from the set denoting the user-selected deductible of coverage.
|
20
|
+
# This is dependent
|
21
|
+
# on the product's configuration.
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :deductible
|
24
|
+
|
25
|
+
# The two letter state code (including Washington DC).
|
26
|
+
# @return [PolicyState2Enum]
|
27
|
+
attr_accessor :policy_state
|
28
|
+
|
29
|
+
# Effective date for when the resulting policy would go into effective
|
30
|
+
# should it be generated.
|
31
|
+
# @return [DateTime]
|
32
|
+
attr_accessor :effective_date
|
33
|
+
|
34
|
+
# The desired end date for the policy that results from this quote. The span
|
35
|
+
# from effective_date to this term_end_date must be allowable by the
|
36
|
+
# product's terms.
|
37
|
+
# @return [DateTime]
|
38
|
+
attr_accessor :term_end_date
|
39
|
+
|
40
|
+
# Any value you wish to associate with this policy such as an ID from your
|
41
|
+
# system.
|
42
|
+
# @return [String]
|
43
|
+
attr_accessor :external_reference
|
44
|
+
|
45
|
+
# Additional data about the policy. The required metadata fields are
|
46
|
+
# specific to the product.
|
47
|
+
# @return [Object]
|
48
|
+
attr_accessor :metadata
|
49
|
+
|
50
|
+
# The date this quote was rated and set to bindable.
|
51
|
+
# @return [DateTime]
|
52
|
+
attr_accessor :bindable_on
|
53
|
+
|
54
|
+
# Boost generated term premium for this quote.
|
55
|
+
# @return [String]
|
56
|
+
attr_accessor :term_premium
|
57
|
+
|
58
|
+
# The date this quote is valid until after which point a new quote will need
|
59
|
+
# to be generated.
|
60
|
+
# @return [DateTime]
|
61
|
+
attr_accessor :valid_until
|
62
|
+
|
63
|
+
# The date this quote satisfied all its dependencies to become a policy.
|
64
|
+
# @return [DateTime]
|
65
|
+
attr_accessor :convertable_on
|
66
|
+
|
67
|
+
# The date this quote was converted into a policy.
|
68
|
+
# @return [DateTime]
|
69
|
+
attr_accessor :converted_on
|
70
|
+
|
71
|
+
# The status of the quote.
|
72
|
+
# @return [Status2Enum]
|
73
|
+
attr_accessor :status
|
74
|
+
|
75
|
+
# Payment installment plans that are available for this quote
|
76
|
+
# @return [Hash of Object]
|
77
|
+
attr_accessor :installment_plans
|
78
|
+
|
79
|
+
# Boost generated minimum premium for this product.
|
80
|
+
# @return [String]
|
81
|
+
attr_accessor :min_premium
|
82
|
+
|
83
|
+
# Any state taxes that apply to this quote.
|
84
|
+
# @return [String]
|
85
|
+
attr_accessor :state_tax
|
86
|
+
|
87
|
+
# Any state fees that apply to this quote.
|
88
|
+
# @return [String]
|
89
|
+
attr_accessor :state_fees
|
90
|
+
|
91
|
+
# Any service fees that apply to this quote.
|
92
|
+
# @return [String]
|
93
|
+
attr_accessor :service_fees
|
94
|
+
|
95
|
+
# Any billing fees that apply to this quote.
|
96
|
+
# @return [String]
|
97
|
+
attr_accessor :billing_fees
|
98
|
+
|
99
|
+
# A mapping from model property names to API property names.
|
100
|
+
def self.names
|
101
|
+
@_hash = {} if @_hash.nil?
|
102
|
+
@_hash['limit'] = 'limit'
|
103
|
+
@_hash['deductible'] = 'deductible'
|
104
|
+
@_hash['policy_state'] = 'policy_state'
|
105
|
+
@_hash['effective_date'] = 'effective_date'
|
106
|
+
@_hash['term_end_date'] = 'term_end_date'
|
107
|
+
@_hash['external_reference'] = 'external_reference'
|
108
|
+
@_hash['metadata'] = 'metadata'
|
109
|
+
@_hash['bindable_on'] = 'bindable_on'
|
110
|
+
@_hash['term_premium'] = 'term_premium'
|
111
|
+
@_hash['valid_until'] = 'valid_until'
|
112
|
+
@_hash['convertable_on'] = 'convertable_on'
|
113
|
+
@_hash['converted_on'] = 'converted_on'
|
114
|
+
@_hash['status'] = 'status'
|
115
|
+
@_hash['installment_plans'] = 'installment_plans'
|
116
|
+
@_hash['min_premium'] = 'min_premium'
|
117
|
+
@_hash['state_tax'] = 'state_tax'
|
118
|
+
@_hash['state_fees'] = 'state_fees'
|
119
|
+
@_hash['service_fees'] = 'service_fees'
|
120
|
+
@_hash['billing_fees'] = 'billing_fees'
|
121
|
+
@_hash
|
122
|
+
end
|
123
|
+
|
124
|
+
# An array for optional fields
|
125
|
+
def self.optionals
|
126
|
+
%w[
|
127
|
+
limit
|
128
|
+
deductible
|
129
|
+
external_reference
|
130
|
+
metadata
|
131
|
+
bindable_on
|
132
|
+
term_premium
|
133
|
+
valid_until
|
134
|
+
convertable_on
|
135
|
+
converted_on
|
136
|
+
status
|
137
|
+
installment_plans
|
138
|
+
min_premium
|
139
|
+
state_tax
|
140
|
+
state_fees
|
141
|
+
service_fees
|
142
|
+
billing_fees
|
143
|
+
]
|
144
|
+
end
|
145
|
+
|
146
|
+
# An array for nullable fields
|
147
|
+
def self.nullables
|
148
|
+
[]
|
149
|
+
end
|
150
|
+
|
151
|
+
def initialize(policy_state = nil,
|
152
|
+
effective_date = nil,
|
153
|
+
term_end_date = nil,
|
154
|
+
limit = SKIP,
|
155
|
+
deductible = SKIP,
|
156
|
+
external_reference = SKIP,
|
157
|
+
metadata = SKIP,
|
158
|
+
bindable_on = SKIP,
|
159
|
+
term_premium = SKIP,
|
160
|
+
valid_until = SKIP,
|
161
|
+
convertable_on = SKIP,
|
162
|
+
converted_on = SKIP,
|
163
|
+
status = SKIP,
|
164
|
+
installment_plans = SKIP,
|
165
|
+
min_premium = SKIP,
|
166
|
+
state_tax = SKIP,
|
167
|
+
state_fees = SKIP,
|
168
|
+
service_fees = SKIP,
|
169
|
+
billing_fees = SKIP)
|
170
|
+
@limit = limit unless limit == SKIP
|
171
|
+
@deductible = deductible unless deductible == SKIP
|
172
|
+
@policy_state = policy_state
|
173
|
+
@effective_date = effective_date
|
174
|
+
@term_end_date = term_end_date
|
175
|
+
@external_reference = external_reference unless external_reference == SKIP
|
176
|
+
@metadata = metadata unless metadata == SKIP
|
177
|
+
@bindable_on = bindable_on unless bindable_on == SKIP
|
178
|
+
@term_premium = term_premium unless term_premium == SKIP
|
179
|
+
@valid_until = valid_until unless valid_until == SKIP
|
180
|
+
@convertable_on = convertable_on unless convertable_on == SKIP
|
181
|
+
@converted_on = converted_on unless converted_on == SKIP
|
182
|
+
@status = status unless status == SKIP
|
183
|
+
@installment_plans = installment_plans unless installment_plans == SKIP
|
184
|
+
@min_premium = min_premium unless min_premium == SKIP
|
185
|
+
@state_tax = state_tax unless state_tax == SKIP
|
186
|
+
@state_fees = state_fees unless state_fees == SKIP
|
187
|
+
@service_fees = service_fees unless service_fees == SKIP
|
188
|
+
@billing_fees = billing_fees unless billing_fees == SKIP
|
189
|
+
end
|
190
|
+
|
191
|
+
# Creates an instance of the object from a hash.
|
192
|
+
def self.from_hash(hash)
|
193
|
+
return nil unless hash
|
194
|
+
|
195
|
+
# Extract variables from the hash.
|
196
|
+
policy_state = hash.key?('policy_state') ? hash['policy_state'] : nil
|
197
|
+
effective_date = if hash.key?('effective_date')
|
198
|
+
(DateTimeHelper.from_rfc3339(hash['effective_date']) if hash['effective_date'])
|
199
|
+
end
|
200
|
+
term_end_date = if hash.key?('term_end_date')
|
201
|
+
(DateTimeHelper.from_rfc3339(hash['term_end_date']) if hash['term_end_date'])
|
202
|
+
end
|
203
|
+
limit = hash.key?('limit') ? hash['limit'] : SKIP
|
204
|
+
deductible = hash.key?('deductible') ? hash['deductible'] : SKIP
|
205
|
+
external_reference =
|
206
|
+
hash.key?('external_reference') ? hash['external_reference'] : SKIP
|
207
|
+
metadata = hash.key?('metadata') ? hash['metadata'] : SKIP
|
208
|
+
bindable_on = if hash.key?('bindable_on')
|
209
|
+
(DateTimeHelper.from_rfc3339(hash['bindable_on']) if hash['bindable_on'])
|
210
|
+
else
|
211
|
+
SKIP
|
212
|
+
end
|
213
|
+
term_premium = hash.key?('term_premium') ? hash['term_premium'] : SKIP
|
214
|
+
valid_until = if hash.key?('valid_until')
|
215
|
+
(DateTimeHelper.from_rfc3339(hash['valid_until']) if hash['valid_until'])
|
216
|
+
else
|
217
|
+
SKIP
|
218
|
+
end
|
219
|
+
convertable_on = if hash.key?('convertable_on')
|
220
|
+
(DateTimeHelper.from_rfc3339(hash['convertable_on']) if hash['convertable_on'])
|
221
|
+
else
|
222
|
+
SKIP
|
223
|
+
end
|
224
|
+
converted_on = if hash.key?('converted_on')
|
225
|
+
(DateTimeHelper.from_rfc3339(hash['converted_on']) if hash['converted_on'])
|
226
|
+
else
|
227
|
+
SKIP
|
228
|
+
end
|
229
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
230
|
+
installment_plans =
|
231
|
+
hash.key?('installment_plans') ? hash['installment_plans'] : SKIP
|
232
|
+
min_premium = hash.key?('min_premium') ? hash['min_premium'] : SKIP
|
233
|
+
state_tax = hash.key?('state_tax') ? hash['state_tax'] : SKIP
|
234
|
+
state_fees = hash.key?('state_fees') ? hash['state_fees'] : SKIP
|
235
|
+
service_fees = hash.key?('service_fees') ? hash['service_fees'] : SKIP
|
236
|
+
billing_fees = hash.key?('billing_fees') ? hash['billing_fees'] : SKIP
|
237
|
+
|
238
|
+
# Create object from extracted values.
|
239
|
+
Attributes9.new(policy_state,
|
240
|
+
effective_date,
|
241
|
+
term_end_date,
|
242
|
+
limit,
|
243
|
+
deductible,
|
244
|
+
external_reference,
|
245
|
+
metadata,
|
246
|
+
bindable_on,
|
247
|
+
term_premium,
|
248
|
+
valid_until,
|
249
|
+
convertable_on,
|
250
|
+
converted_on,
|
251
|
+
status,
|
252
|
+
installment_plans,
|
253
|
+
min_premium,
|
254
|
+
state_tax,
|
255
|
+
state_fees,
|
256
|
+
service_fees,
|
257
|
+
billing_fees)
|
258
|
+
end
|
259
|
+
|
260
|
+
def to_effective_date
|
261
|
+
DateTimeHelper.to_rfc3339(effective_date)
|
262
|
+
end
|
263
|
+
|
264
|
+
def to_term_end_date
|
265
|
+
DateTimeHelper.to_rfc3339(term_end_date)
|
266
|
+
end
|
267
|
+
|
268
|
+
def to_bindable_on
|
269
|
+
DateTimeHelper.to_rfc3339(bindable_on)
|
270
|
+
end
|
271
|
+
|
272
|
+
def to_valid_until
|
273
|
+
DateTimeHelper.to_rfc3339(valid_until)
|
274
|
+
end
|
275
|
+
|
276
|
+
def to_convertable_on
|
277
|
+
DateTimeHelper.to_rfc3339(convertable_on)
|
278
|
+
end
|
279
|
+
|
280
|
+
def to_converted_on
|
281
|
+
DateTimeHelper.to_rfc3339(converted_on)
|
282
|
+
end
|
283
|
+
end
|
284
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# merged_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module MergedApi
|
7
|
+
# AuthOauth2TokenResponse Model.
|
8
|
+
class AuthOauth2TokenResponse < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Type of token.
|
13
|
+
# @return [TokenTypeEnum]
|
14
|
+
attr_accessor :token_type
|
15
|
+
|
16
|
+
# The token to be used in future API calls.
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :access_token
|
19
|
+
|
20
|
+
# How long this token is valid for.
|
21
|
+
# @return [ExpiresInEnum]
|
22
|
+
attr_accessor :expires_in
|
23
|
+
|
24
|
+
# A mapping from model property names to API property names.
|
25
|
+
def self.names
|
26
|
+
@_hash = {} if @_hash.nil?
|
27
|
+
@_hash['token_type'] = 'token_type'
|
28
|
+
@_hash['access_token'] = 'access_token'
|
29
|
+
@_hash['expires_in'] = 'expires_in'
|
30
|
+
@_hash
|
31
|
+
end
|
32
|
+
|
33
|
+
# An array for optional fields
|
34
|
+
def self.optionals
|
35
|
+
%w[
|
36
|
+
token_type
|
37
|
+
access_token
|
38
|
+
expires_in
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
# An array for nullable fields
|
43
|
+
def self.nullables
|
44
|
+
[]
|
45
|
+
end
|
46
|
+
|
47
|
+
def initialize(token_type = SKIP,
|
48
|
+
access_token = SKIP,
|
49
|
+
expires_in = SKIP)
|
50
|
+
@token_type = token_type unless token_type == SKIP
|
51
|
+
@access_token = access_token unless access_token == SKIP
|
52
|
+
@expires_in = expires_in unless expires_in == SKIP
|
53
|
+
end
|
54
|
+
|
55
|
+
# Creates an instance of the object from a hash.
|
56
|
+
def self.from_hash(hash)
|
57
|
+
return nil unless hash
|
58
|
+
|
59
|
+
# Extract variables from the hash.
|
60
|
+
token_type = hash.key?('token_type') ? hash['token_type'] : SKIP
|
61
|
+
access_token = hash.key?('access_token') ? hash['access_token'] : SKIP
|
62
|
+
expires_in = hash.key?('expires_in') ? hash['expires_in'] : SKIP
|
63
|
+
|
64
|
+
# Create object from extracted values.
|
65
|
+
AuthOauth2TokenResponse.new(token_type,
|
66
|
+
access_token,
|
67
|
+
expires_in)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# merged_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module MergedApi
|
7
|
+
# Base model.
|
8
|
+
class BaseModel < CoreLibrary::BaseModel
|
9
|
+
# Returns a Hash representation of the current object.
|
10
|
+
def to_hash
|
11
|
+
hash = {}
|
12
|
+
instance_variables.each do |name|
|
13
|
+
value = instance_variable_get(name)
|
14
|
+
name = name[1..]
|
15
|
+
key = self.class.names.key?(name) ? self.class.names[name] : name
|
16
|
+
|
17
|
+
optional_fields = self.class.optionals
|
18
|
+
nullable_fields = self.class.nullables
|
19
|
+
if value.nil?
|
20
|
+
next unless nullable_fields.include?(name)
|
21
|
+
|
22
|
+
if !optional_fields.include?(name) && !nullable_fields.include?(name)
|
23
|
+
raise ArgumentError,
|
24
|
+
"`#{name}` cannot be nil in `#{self.class}`. Please specify a valid value."
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
hash[key] = nil
|
29
|
+
unless value.nil?
|
30
|
+
if respond_to?("to_#{name}")
|
31
|
+
if (value.instance_of? Array) || (value.instance_of? Hash)
|
32
|
+
params = [hash, key]
|
33
|
+
hash[key] = send("to_#{name}", *params)
|
34
|
+
else
|
35
|
+
hash[key] = send("to_#{name}")
|
36
|
+
end
|
37
|
+
elsif value.instance_of? Array
|
38
|
+
hash[key] = value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
|
39
|
+
elsif value.instance_of? Hash
|
40
|
+
hash[key] = {}
|
41
|
+
value.each do |k, v|
|
42
|
+
hash[key][k] = v.is_a?(BaseModel) ? v.to_hash : v
|
43
|
+
end
|
44
|
+
else
|
45
|
+
hash[key] = value.is_a?(BaseModel) ? value.to_hash : value
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
hash
|
50
|
+
end
|
51
|
+
|
52
|
+
# Returns a JSON representation of the curent object.
|
53
|
+
def to_json(options = {})
|
54
|
+
hash = to_hash
|
55
|
+
hash.to_json(options)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# merged_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module MergedApi
|
7
|
+
# The billing address of this customer.
|
8
|
+
class BillingAddress < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The first line of the address.
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :address1
|
15
|
+
|
16
|
+
# The second line of the address.
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :address2
|
19
|
+
|
20
|
+
# The city of the address.
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :city
|
23
|
+
|
24
|
+
# Two letter state code of the address.
|
25
|
+
# @return [StateEnum]
|
26
|
+
attr_accessor :state
|
27
|
+
|
28
|
+
# 5 or 10 character postal code of the address.
|
29
|
+
# @return [String]
|
30
|
+
attr_accessor :zip
|
31
|
+
|
32
|
+
# A mapping from model property names to API property names.
|
33
|
+
def self.names
|
34
|
+
@_hash = {} if @_hash.nil?
|
35
|
+
@_hash['address1'] = 'address1'
|
36
|
+
@_hash['address2'] = 'address2'
|
37
|
+
@_hash['city'] = 'city'
|
38
|
+
@_hash['state'] = 'state'
|
39
|
+
@_hash['zip'] = 'zip'
|
40
|
+
@_hash
|
41
|
+
end
|
42
|
+
|
43
|
+
# An array for optional fields
|
44
|
+
def self.optionals
|
45
|
+
%w[
|
46
|
+
address2
|
47
|
+
]
|
48
|
+
end
|
49
|
+
|
50
|
+
# An array for nullable fields
|
51
|
+
def self.nullables
|
52
|
+
[]
|
53
|
+
end
|
54
|
+
|
55
|
+
def initialize(address1 = nil,
|
56
|
+
city = nil,
|
57
|
+
state = nil,
|
58
|
+
zip = nil,
|
59
|
+
address2 = SKIP)
|
60
|
+
@address1 = address1
|
61
|
+
@address2 = address2 unless address2 == SKIP
|
62
|
+
@city = city
|
63
|
+
@state = state
|
64
|
+
@zip = zip
|
65
|
+
end
|
66
|
+
|
67
|
+
# Creates an instance of the object from a hash.
|
68
|
+
def self.from_hash(hash)
|
69
|
+
return nil unless hash
|
70
|
+
|
71
|
+
# Extract variables from the hash.
|
72
|
+
address1 = hash.key?('address1') ? hash['address1'] : nil
|
73
|
+
city = hash.key?('city') ? hash['city'] : nil
|
74
|
+
state = hash.key?('state') ? hash['state'] : nil
|
75
|
+
zip = hash.key?('zip') ? hash['zip'] : nil
|
76
|
+
address2 = hash.key?('address2') ? hash['address2'] : SKIP
|
77
|
+
|
78
|
+
# Create object from extracted values.
|
79
|
+
BillingAddress.new(address1,
|
80
|
+
city,
|
81
|
+
state,
|
82
|
+
zip,
|
83
|
+
address2)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# merged_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module MergedApi
|
7
|
+
# Content-Type1.
|
8
|
+
class ContentType1Enum
|
9
|
+
CONTENT_TYPE1_ENUM = [
|
10
|
+
# TODO: Write general description for ENUM_APPLICATIONVNDAPIJSON
|
11
|
+
ENUM_APPLICATIONVNDAPIJSON = 'application/vnd.api+json'.freeze
|
12
|
+
].freeze
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# merged_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module MergedApi
|
7
|
+
# Content-Type.
|
8
|
+
class ContentTypeEnum
|
9
|
+
CONTENT_TYPE_ENUM = [
|
10
|
+
# TODO: Write general description for ENUM_APPLICATIONXWWWFORMURLENCODED
|
11
|
+
ENUM_APPLICATIONXWWWFORMURLENCODED = 'application/x-www-form-urlencoded'.freeze
|
12
|
+
].freeze
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# merged_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module MergedApi
|
7
|
+
# UUID that identifies this product coverage.
|
8
|
+
class Coverage < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Provided data for this product coverage relationship.
|
13
|
+
# @return [Data21]
|
14
|
+
attr_accessor :data
|
15
|
+
|
16
|
+
# A mapping from model property names to API property names.
|
17
|
+
def self.names
|
18
|
+
@_hash = {} if @_hash.nil?
|
19
|
+
@_hash['data'] = 'data'
|
20
|
+
@_hash
|
21
|
+
end
|
22
|
+
|
23
|
+
# An array for optional fields
|
24
|
+
def self.optionals
|
25
|
+
[]
|
26
|
+
end
|
27
|
+
|
28
|
+
# An array for nullable fields
|
29
|
+
def self.nullables
|
30
|
+
[]
|
31
|
+
end
|
32
|
+
|
33
|
+
def initialize(data = nil)
|
34
|
+
@data = data
|
35
|
+
end
|
36
|
+
|
37
|
+
# Creates an instance of the object from a hash.
|
38
|
+
def self.from_hash(hash)
|
39
|
+
return nil unless hash
|
40
|
+
|
41
|
+
# Extract variables from the hash.
|
42
|
+
data = Data21.from_hash(hash['data']) if hash['data']
|
43
|
+
|
44
|
+
# Create object from extracted values.
|
45
|
+
Coverage.new(data)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# merged_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module MergedApi
|
7
|
+
# List of coverages that apply to this policy.
|
8
|
+
class Coverages < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# List of coverages.
|
13
|
+
# @return [List of Data7]
|
14
|
+
attr_accessor :data
|
15
|
+
|
16
|
+
# Additional meta information about this data.
|
17
|
+
# @return [Meta]
|
18
|
+
attr_accessor :meta
|
19
|
+
|
20
|
+
# A mapping from model property names to API property names.
|
21
|
+
def self.names
|
22
|
+
@_hash = {} if @_hash.nil?
|
23
|
+
@_hash['data'] = 'data'
|
24
|
+
@_hash['meta'] = 'meta'
|
25
|
+
@_hash
|
26
|
+
end
|
27
|
+
|
28
|
+
# An array for optional fields
|
29
|
+
def self.optionals
|
30
|
+
%w[
|
31
|
+
meta
|
32
|
+
]
|
33
|
+
end
|
34
|
+
|
35
|
+
# An array for nullable fields
|
36
|
+
def self.nullables
|
37
|
+
[]
|
38
|
+
end
|
39
|
+
|
40
|
+
def initialize(data = nil,
|
41
|
+
meta = SKIP)
|
42
|
+
@data = data
|
43
|
+
@meta = meta unless meta == SKIP
|
44
|
+
end
|
45
|
+
|
46
|
+
# Creates an instance of the object from a hash.
|
47
|
+
def self.from_hash(hash)
|
48
|
+
return nil unless hash
|
49
|
+
|
50
|
+
# Extract variables from the hash.
|
51
|
+
# Parameter is an array, so we need to iterate through it
|
52
|
+
data = nil
|
53
|
+
unless hash['data'].nil?
|
54
|
+
data = []
|
55
|
+
hash['data'].each do |structure|
|
56
|
+
data << (Data7.from_hash(structure) if structure)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
data = nil unless hash.key?('data')
|
61
|
+
meta = Meta.from_hash(hash['meta']) if hash['meta']
|
62
|
+
|
63
|
+
# Create object from extracted values.
|
64
|
+
Coverages.new(data,
|
65
|
+
meta)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# merged_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module MergedApi
|
7
|
+
# List of coverages that will be created at the same time as this resource.
|
8
|
+
class Coverages2 < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# List of objects with coverage local IDs.
|
13
|
+
# @return [List of Data40]
|
14
|
+
attr_accessor :data
|
15
|
+
|
16
|
+
# A mapping from model property names to API property names.
|
17
|
+
def self.names
|
18
|
+
@_hash = {} if @_hash.nil?
|
19
|
+
@_hash['data'] = 'data'
|
20
|
+
@_hash
|
21
|
+
end
|
22
|
+
|
23
|
+
# An array for optional fields
|
24
|
+
def self.optionals
|
25
|
+
[]
|
26
|
+
end
|
27
|
+
|
28
|
+
# An array for nullable fields
|
29
|
+
def self.nullables
|
30
|
+
[]
|
31
|
+
end
|
32
|
+
|
33
|
+
def initialize(data = nil)
|
34
|
+
@data = data
|
35
|
+
end
|
36
|
+
|
37
|
+
# Creates an instance of the object from a hash.
|
38
|
+
def self.from_hash(hash)
|
39
|
+
return nil unless hash
|
40
|
+
|
41
|
+
# Extract variables from the hash.
|
42
|
+
# Parameter is an array, so we need to iterate through it
|
43
|
+
data = nil
|
44
|
+
unless hash['data'].nil?
|
45
|
+
data = []
|
46
|
+
hash['data'].each do |structure|
|
47
|
+
data << (Data40.from_hash(structure) if structure)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
data = nil unless hash.key?('data')
|
52
|
+
|
53
|
+
# Create object from extracted values.
|
54
|
+
Coverages2.new(data)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|