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,41 @@
|
|
1
|
+
# merged_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module MergedApi
|
7
|
+
# Quotes500Error1 class.
|
8
|
+
class Quotes500Error1Exception < APIException
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [List of Errors1]
|
14
|
+
attr_accessor :errors
|
15
|
+
|
16
|
+
# The constructor.
|
17
|
+
# @param [String] The reason for raising an exception.
|
18
|
+
# @param [HttpResponse] The HttpReponse of the API call.
|
19
|
+
def initialize(reason, response)
|
20
|
+
super(reason, response)
|
21
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
22
|
+
unbox(hash)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Populates this object by extracting properties from a hash.
|
26
|
+
# @param [Hash] The deserialized response sent by the server in the
|
27
|
+
# response body.
|
28
|
+
def unbox(hash)
|
29
|
+
# Parameter is an array, so we need to iterate through it
|
30
|
+
@errors = nil
|
31
|
+
unless hash['errors'].nil?
|
32
|
+
@errors = []
|
33
|
+
hash['errors'].each do |structure|
|
34
|
+
@errors << (Errors1.from_hash(structure) if structure)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
@errors = SKIP unless hash.key?('errors')
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# merged_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module MergedApi
|
7
|
+
# Utility class for OAuth 2 authorization and token management.
|
8
|
+
class OAuth2 < CoreLibrary::HeaderAuth
|
9
|
+
# Display error message on occurrence of authentication failure.
|
10
|
+
# @returns [String] The oAuth error message.
|
11
|
+
def error_message
|
12
|
+
'ClientCredentialsAuth: o_auth_token.access_token is undefined or expired.'
|
13
|
+
end
|
14
|
+
|
15
|
+
# Initialization constructor.
|
16
|
+
def initialize(o_auth_client_id, o_auth_client_secret, o_auth_token, config,
|
17
|
+
o_auth_scopes = nil)
|
18
|
+
auth_params = {}
|
19
|
+
@_o_auth_client_id = o_auth_client_id
|
20
|
+
@_o_auth_client_secret = o_auth_client_secret
|
21
|
+
@_o_auth_token = o_auth_token
|
22
|
+
@_o_auth_scopes = o_auth_scopes
|
23
|
+
@_o_auth_api = OAuthAuthorizationController.new(config)
|
24
|
+
auth_params['Authorization'] = "Bearer #{@_o_auth_token.access_token}" unless @_o_auth_token.nil?
|
25
|
+
|
26
|
+
super auth_params
|
27
|
+
end
|
28
|
+
|
29
|
+
# Validates the oAuth token.
|
30
|
+
# @return [Boolean] true if the token is present and not expired.
|
31
|
+
def valid
|
32
|
+
!@_o_auth_token.nil? && !token_expired?(@_o_auth_token)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Builds the basic auth header for endpoints in the OAuth Authorization Controller.
|
36
|
+
# @return [String] The value of the Authentication header.
|
37
|
+
def build_basic_auth_header
|
38
|
+
"Basic #{AuthHelper.get_base64_encoded_value(@_o_auth_client_id, @_o_auth_client_secret)}"
|
39
|
+
end
|
40
|
+
|
41
|
+
# Fetches the token.
|
42
|
+
# @param [Hash] additional_params Any additional form parameters.
|
43
|
+
# @return [OAuthToken] The oAuth token instance.
|
44
|
+
def fetch_token(additional_params: nil)
|
45
|
+
token = @_o_auth_api.request_token(
|
46
|
+
build_basic_auth_header,
|
47
|
+
scope: !@_o_auth_scopes.nil? ? Array(@_o_auth_scopes).compact.join(' ') : @_o_auth_scopes,
|
48
|
+
_field_parameters: additional_params
|
49
|
+
)
|
50
|
+
if token.respond_to?('expires_in') && !token.expires_in.nil?
|
51
|
+
token.expiry = AuthHelper.get_token_expiry(token.expires_in, Time.now.utc.to_i)
|
52
|
+
end
|
53
|
+
token
|
54
|
+
end
|
55
|
+
|
56
|
+
# Checks if OAuth token has expired.
|
57
|
+
# @param [OAuthToken] token The oAuth token instance.
|
58
|
+
# @return [Boolean] true if the token's expiry exist and also the token is expired, false otherwise.
|
59
|
+
def token_expired?(token)
|
60
|
+
token.respond_to?('expiry') && AuthHelper.token_expired?(token.expiry)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
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
|
+
# Accept.
|
8
|
+
class AcceptEnum
|
9
|
+
ACCEPT_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,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 additional insured for this policy.
|
8
|
+
class AdditionalInsured < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# List of additional insured.
|
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
|
+
AdditionalInsured.new(data,
|
65
|
+
meta)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
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 additional interests for this policy.
|
8
|
+
class AdditionalInterests < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# List of additional interests.
|
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
|
+
AdditionalInterests.new(data,
|
65
|
+
meta)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
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 of the agent.
|
8
|
+
class Agent < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Provided data for this agent relationship.
|
13
|
+
# @return [Data1]
|
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 = Data1.from_hash(hash['data']) if hash['data']
|
43
|
+
|
44
|
+
# Create object from extracted values.
|
45
|
+
Agent.new(data)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
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 agent.
|
8
|
+
class Agent3 < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Provided data for this agent relationship.
|
13
|
+
# @return [Data1]
|
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 = Data1.from_hash(hash['data']) if hash['data']
|
43
|
+
|
44
|
+
# Create object from extracted values.
|
45
|
+
Agent3.new(data)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
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
|
+
# The Boost UUID of the agent.
|
8
|
+
class Agent6 < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Provided data for this product relationship.
|
13
|
+
# @return [Data43]
|
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 = Data43.from_hash(hash['data']) if hash['data']
|
43
|
+
|
44
|
+
# Create object from extracted values.
|
45
|
+
Agent6.new(data)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,87 @@
|
|
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 that describe an Insured Risk.
|
9
|
+
class Attributes < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# Date time when this resource was created in our system.
|
14
|
+
# @return [DateTime]
|
15
|
+
attr_accessor :created_date
|
16
|
+
|
17
|
+
# Date time when this resource was last modified in our system.
|
18
|
+
# @return [DateTime]
|
19
|
+
attr_accessor :modified_date
|
20
|
+
|
21
|
+
# Specific ratable factors that apply to this Insured Risk. The content must
|
22
|
+
# fully adhere to a product-specific, pre-defined schema.
|
23
|
+
# @return [Object]
|
24
|
+
attr_accessor :factors
|
25
|
+
|
26
|
+
# A mapping from model property names to API property names.
|
27
|
+
def self.names
|
28
|
+
@_hash = {} if @_hash.nil?
|
29
|
+
@_hash['created_date'] = 'created_date'
|
30
|
+
@_hash['modified_date'] = 'modified_date'
|
31
|
+
@_hash['factors'] = 'factors'
|
32
|
+
@_hash
|
33
|
+
end
|
34
|
+
|
35
|
+
# An array for optional fields
|
36
|
+
def self.optionals
|
37
|
+
%w[
|
38
|
+
created_date
|
39
|
+
modified_date
|
40
|
+
]
|
41
|
+
end
|
42
|
+
|
43
|
+
# An array for nullable fields
|
44
|
+
def self.nullables
|
45
|
+
[]
|
46
|
+
end
|
47
|
+
|
48
|
+
def initialize(factors = nil,
|
49
|
+
created_date = SKIP,
|
50
|
+
modified_date = SKIP)
|
51
|
+
@created_date = created_date unless created_date == SKIP
|
52
|
+
@modified_date = modified_date unless modified_date == SKIP
|
53
|
+
@factors = factors
|
54
|
+
end
|
55
|
+
|
56
|
+
# Creates an instance of the object from a hash.
|
57
|
+
def self.from_hash(hash)
|
58
|
+
return nil unless hash
|
59
|
+
|
60
|
+
# Extract variables from the hash.
|
61
|
+
factors = hash.key?('factors') ? hash['factors'] : nil
|
62
|
+
created_date = if hash.key?('created_date')
|
63
|
+
(DateTimeHelper.from_rfc3339(hash['created_date']) if hash['created_date'])
|
64
|
+
else
|
65
|
+
SKIP
|
66
|
+
end
|
67
|
+
modified_date = if hash.key?('modified_date')
|
68
|
+
(DateTimeHelper.from_rfc3339(hash['modified_date']) if hash['modified_date'])
|
69
|
+
else
|
70
|
+
SKIP
|
71
|
+
end
|
72
|
+
|
73
|
+
# Create object from extracted values.
|
74
|
+
Attributes.new(factors,
|
75
|
+
created_date,
|
76
|
+
modified_date)
|
77
|
+
end
|
78
|
+
|
79
|
+
def to_created_date
|
80
|
+
DateTimeHelper.to_rfc3339(created_date)
|
81
|
+
end
|
82
|
+
|
83
|
+
def to_modified_date
|
84
|
+
DateTimeHelper.to_rfc3339(modified_date)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,80 @@
|
|
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 that describe an Insured Risk.
|
9
|
+
class Attributes1 < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# Date time when this resource was created in our system.
|
14
|
+
# @return [DateTime]
|
15
|
+
attr_accessor :created_date
|
16
|
+
|
17
|
+
# Date time when this resource was last modified in our system.
|
18
|
+
# @return [DateTime]
|
19
|
+
attr_accessor :modified_date
|
20
|
+
|
21
|
+
# Specific ratable factors that apply to this Insured Risk. The content must
|
22
|
+
# fully adhere to a product-specific, pre-defined schema.
|
23
|
+
# @return [Object]
|
24
|
+
attr_accessor :factors
|
25
|
+
|
26
|
+
# A mapping from model property names to API property names.
|
27
|
+
def self.names
|
28
|
+
@_hash = {} if @_hash.nil?
|
29
|
+
@_hash['created_date'] = 'created_date'
|
30
|
+
@_hash['modified_date'] = 'modified_date'
|
31
|
+
@_hash['factors'] = 'factors'
|
32
|
+
@_hash
|
33
|
+
end
|
34
|
+
|
35
|
+
# An array for optional fields
|
36
|
+
def self.optionals
|
37
|
+
[]
|
38
|
+
end
|
39
|
+
|
40
|
+
# An array for nullable fields
|
41
|
+
def self.nullables
|
42
|
+
[]
|
43
|
+
end
|
44
|
+
|
45
|
+
def initialize(created_date = nil,
|
46
|
+
modified_date = nil,
|
47
|
+
factors = nil)
|
48
|
+
@created_date = created_date
|
49
|
+
@modified_date = modified_date
|
50
|
+
@factors = factors
|
51
|
+
end
|
52
|
+
|
53
|
+
# Creates an instance of the object from a hash.
|
54
|
+
def self.from_hash(hash)
|
55
|
+
return nil unless hash
|
56
|
+
|
57
|
+
# Extract variables from the hash.
|
58
|
+
created_date = if hash.key?('created_date')
|
59
|
+
(DateTimeHelper.from_rfc3339(hash['created_date']) if hash['created_date'])
|
60
|
+
end
|
61
|
+
modified_date = if hash.key?('modified_date')
|
62
|
+
(DateTimeHelper.from_rfc3339(hash['modified_date']) if hash['modified_date'])
|
63
|
+
end
|
64
|
+
factors = hash.key?('factors') ? hash['factors'] : nil
|
65
|
+
|
66
|
+
# Create object from extracted values.
|
67
|
+
Attributes1.new(created_date,
|
68
|
+
modified_date,
|
69
|
+
factors)
|
70
|
+
end
|
71
|
+
|
72
|
+
def to_created_date
|
73
|
+
DateTimeHelper.to_rfc3339(created_date)
|
74
|
+
end
|
75
|
+
|
76
|
+
def to_modified_date
|
77
|
+
DateTimeHelper.to_rfc3339(modified_date)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
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
|
+
# Attributes for this object.
|
8
|
+
class Attributes10 < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# A value from the set denoting the user-selected deductible of coverage.
|
13
|
+
# This is dependent
|
14
|
+
# on the product's configuration.
|
15
|
+
# @return [String]
|
16
|
+
attr_accessor :deductible
|
17
|
+
|
18
|
+
# A value from the set denoting the user-selected limit of coverage. This is
|
19
|
+
# dependent
|
20
|
+
# on the product's configuration.
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :limit
|
23
|
+
|
24
|
+
# Calculated premium for this coverage which is included in the policy's
|
25
|
+
# term premium.
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :premium
|
28
|
+
|
29
|
+
# Additional data about the policy. The required metadata fields are
|
30
|
+
# specific to the product.
|
31
|
+
# @return [Object]
|
32
|
+
attr_accessor :metadata
|
33
|
+
|
34
|
+
# A mapping from model property names to API property names.
|
35
|
+
def self.names
|
36
|
+
@_hash = {} if @_hash.nil?
|
37
|
+
@_hash['deductible'] = 'deductible'
|
38
|
+
@_hash['limit'] = 'limit'
|
39
|
+
@_hash['premium'] = 'premium'
|
40
|
+
@_hash['metadata'] = 'metadata'
|
41
|
+
@_hash
|
42
|
+
end
|
43
|
+
|
44
|
+
# An array for optional fields
|
45
|
+
def self.optionals
|
46
|
+
%w[
|
47
|
+
deductible
|
48
|
+
limit
|
49
|
+
premium
|
50
|
+
metadata
|
51
|
+
]
|
52
|
+
end
|
53
|
+
|
54
|
+
# An array for nullable fields
|
55
|
+
def self.nullables
|
56
|
+
[]
|
57
|
+
end
|
58
|
+
|
59
|
+
def initialize(deductible = SKIP,
|
60
|
+
limit = SKIP,
|
61
|
+
premium = SKIP,
|
62
|
+
metadata = SKIP)
|
63
|
+
@deductible = deductible unless deductible == SKIP
|
64
|
+
@limit = limit unless limit == SKIP
|
65
|
+
@premium = premium unless premium == SKIP
|
66
|
+
@metadata = metadata unless metadata == SKIP
|
67
|
+
end
|
68
|
+
|
69
|
+
# Creates an instance of the object from a hash.
|
70
|
+
def self.from_hash(hash)
|
71
|
+
return nil unless hash
|
72
|
+
|
73
|
+
# Extract variables from the hash.
|
74
|
+
deductible = hash.key?('deductible') ? hash['deductible'] : SKIP
|
75
|
+
limit = hash.key?('limit') ? hash['limit'] : SKIP
|
76
|
+
premium = hash.key?('premium') ? hash['premium'] : SKIP
|
77
|
+
metadata = hash.key?('metadata') ? hash['metadata'] : SKIP
|
78
|
+
|
79
|
+
# Create object from extracted values.
|
80
|
+
Attributes10.new(deductible,
|
81
|
+
limit,
|
82
|
+
premium,
|
83
|
+
metadata)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|