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.
Files changed (149) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +193 -0
  4. data/lib/merged_api/api_helper.rb +10 -0
  5. data/lib/merged_api/client.rb +97 -0
  6. data/lib/merged_api/configuration.rb +127 -0
  7. data/lib/merged_api/controllers/authentication_controller.rb +36 -0
  8. data/lib/merged_api/controllers/base_controller.rb +65 -0
  9. data/lib/merged_api/controllers/insured_risk_controller.rb +47 -0
  10. data/lib/merged_api/controllers/o_auth_authorization_controller.rb +42 -0
  11. data/lib/merged_api/controllers/policy_controller.rb +66 -0
  12. data/lib/merged_api/controllers/quoting_controller.rb +41 -0
  13. data/lib/merged_api/controllers/simple_calculator_controller.rb +33 -0
  14. data/lib/merged_api/exceptions/api_exception.rb +10 -0
  15. data/lib/merged_api/exceptions/auth_oauth2_token400_error1_exception.rb +32 -0
  16. data/lib/merged_api/exceptions/insured_risks400_error1_exception.rb +41 -0
  17. data/lib/merged_api/exceptions/insured_risks401_error1_exception.rb +32 -0
  18. data/lib/merged_api/exceptions/insured_risks403_error1_exception.rb +41 -0
  19. data/lib/merged_api/exceptions/insured_risks415_error1_exception.rb +41 -0
  20. data/lib/merged_api/exceptions/insured_risks500_error1_exception.rb +41 -0
  21. data/lib/merged_api/exceptions/o_auth_provider_exception.rb +48 -0
  22. data/lib/merged_api/exceptions/policies400_error1_exception.rb +41 -0
  23. data/lib/merged_api/exceptions/policies401_error1_exception.rb +32 -0
  24. data/lib/merged_api/exceptions/policies403_error1_exception.rb +41 -0
  25. data/lib/merged_api/exceptions/policies500_error1_exception.rb +41 -0
  26. data/lib/merged_api/exceptions/quotes400_error1_exception.rb +41 -0
  27. data/lib/merged_api/exceptions/quotes401_error1_exception.rb +32 -0
  28. data/lib/merged_api/exceptions/quotes500_error1_exception.rb +41 -0
  29. data/lib/merged_api/http/auth/o_auth2.rb +63 -0
  30. data/lib/merged_api/http/http_call_back.rb +10 -0
  31. data/lib/merged_api/http/http_method_enum.rb +10 -0
  32. data/lib/merged_api/http/http_request.rb +10 -0
  33. data/lib/merged_api/http/http_response.rb +10 -0
  34. data/lib/merged_api/models/accept_enum.rb +14 -0
  35. data/lib/merged_api/models/additional_insured.rb +68 -0
  36. data/lib/merged_api/models/additional_interests.rb +68 -0
  37. data/lib/merged_api/models/agent.rb +48 -0
  38. data/lib/merged_api/models/agent3.rb +48 -0
  39. data/lib/merged_api/models/agent6.rb +48 -0
  40. data/lib/merged_api/models/attributes.rb +87 -0
  41. data/lib/merged_api/models/attributes1.rb +80 -0
  42. data/lib/merged_api/models/attributes10.rb +86 -0
  43. data/lib/merged_api/models/attributes11.rb +137 -0
  44. data/lib/merged_api/models/attributes12.rb +48 -0
  45. data/lib/merged_api/models/attributes2.rb +80 -0
  46. data/lib/merged_api/models/attributes3.rb +412 -0
  47. data/lib/merged_api/models/attributes4.rb +126 -0
  48. data/lib/merged_api/models/attributes5.rb +80 -0
  49. data/lib/merged_api/models/attributes6.rb +422 -0
  50. data/lib/merged_api/models/attributes9.rb +284 -0
  51. data/lib/merged_api/models/auth_oauth2_token_response.rb +70 -0
  52. data/lib/merged_api/models/base_model.rb +58 -0
  53. data/lib/merged_api/models/billing_address.rb +86 -0
  54. data/lib/merged_api/models/content_type1_enum.rb +14 -0
  55. data/lib/merged_api/models/content_type_enum.rb +14 -0
  56. data/lib/merged_api/models/coverage.rb +48 -0
  57. data/lib/merged_api/models/coverages.rb +68 -0
  58. data/lib/merged_api/models/coverages2.rb +57 -0
  59. data/lib/merged_api/models/coverages3.rb +57 -0
  60. data/lib/merged_api/models/customer.rb +48 -0
  61. data/lib/merged_api/models/customer2.rb +48 -0
  62. data/lib/merged_api/models/customer3.rb +48 -0
  63. data/lib/merged_api/models/data.rb +77 -0
  64. data/lib/merged_api/models/data1.rb +57 -0
  65. data/lib/merged_api/models/data11.rb +57 -0
  66. data/lib/merged_api/models/data12.rb +57 -0
  67. data/lib/merged_api/models/data18.rb +57 -0
  68. data/lib/merged_api/models/data19.rb +57 -0
  69. data/lib/merged_api/models/data2.rb +57 -0
  70. data/lib/merged_api/models/data20.rb +57 -0
  71. data/lib/merged_api/models/data21.rb +57 -0
  72. data/lib/merged_api/models/data24.rb +87 -0
  73. data/lib/merged_api/models/data3.rb +75 -0
  74. data/lib/merged_api/models/data39.rb +66 -0
  75. data/lib/merged_api/models/data40.rb +58 -0
  76. data/lib/merged_api/models/data41.rb +58 -0
  77. data/lib/merged_api/models/data42.rb +58 -0
  78. data/lib/merged_api/models/data43.rb +57 -0
  79. data/lib/merged_api/models/data44.rb +57 -0
  80. data/lib/merged_api/models/data45.rb +76 -0
  81. data/lib/merged_api/models/data46.rb +57 -0
  82. data/lib/merged_api/models/data47.rb +57 -0
  83. data/lib/merged_api/models/data6.rb +66 -0
  84. data/lib/merged_api/models/data7.rb +57 -0
  85. data/lib/merged_api/models/data8.rb +57 -0
  86. data/lib/merged_api/models/data9.rb +76 -0
  87. data/lib/merged_api/models/endorsement.rb +48 -0
  88. data/lib/merged_api/models/entity_type_enum.rb +17 -0
  89. data/lib/merged_api/models/errors.rb +61 -0
  90. data/lib/merged_api/models/errors1.rb +60 -0
  91. data/lib/merged_api/models/expires_in_enum.rb +14 -0
  92. data/lib/merged_api/models/grant_type_enum.rb +14 -0
  93. data/lib/merged_api/models/included.rb +75 -0
  94. data/lib/merged_api/models/included1.rb +75 -0
  95. data/lib/merged_api/models/included3.rb +76 -0
  96. data/lib/merged_api/models/included31.rb +67 -0
  97. data/lib/merged_api/models/included32.rb +67 -0
  98. data/lib/merged_api/models/included4.rb +85 -0
  99. data/lib/merged_api/models/included41.rb +85 -0
  100. data/lib/merged_api/models/included42.rb +85 -0
  101. data/lib/merged_api/models/installment_plan.rb +49 -0
  102. data/lib/merged_api/models/installment_plan2.rb +85 -0
  103. data/lib/merged_api/models/insured_risk.rb +48 -0
  104. data/lib/merged_api/models/insured_risk2.rb +48 -0
  105. data/lib/merged_api/models/insured_risk3.rb +48 -0
  106. data/lib/merged_api/models/insured_risks_request.rb +48 -0
  107. data/lib/merged_api/models/insured_risks_response.rb +48 -0
  108. data/lib/merged_api/models/mailing_address.rb +86 -0
  109. data/lib/merged_api/models/meta.rb +50 -0
  110. data/lib/merged_api/models/o_auth_provider_error_enum.rb +39 -0
  111. data/lib/merged_api/models/o_auth_token.rb +100 -0
  112. data/lib/merged_api/models/operation_type_enum.rb +23 -0
  113. data/lib/merged_api/models/parent.rb +48 -0
  114. data/lib/merged_api/models/policies_request.rb +48 -0
  115. data/lib/merged_api/models/policies_response.rb +59 -0
  116. data/lib/merged_api/models/policies_response1.rb +57 -0
  117. data/lib/merged_api/models/policy.rb +48 -0
  118. data/lib/merged_api/models/policy_state2_enum.rb +164 -0
  119. data/lib/merged_api/models/policy_state_enum.rb +165 -0
  120. data/lib/merged_api/models/product.rb +49 -0
  121. data/lib/merged_api/models/product2.rb +49 -0
  122. data/lib/merged_api/models/product3.rb +48 -0
  123. data/lib/merged_api/models/product6.rb +50 -0
  124. data/lib/merged_api/models/product_coverage.rb +48 -0
  125. data/lib/merged_api/models/quotes_request.rb +57 -0
  126. data/lib/merged_api/models/quotes_response.rb +57 -0
  127. data/lib/merged_api/models/relationships.rb +61 -0
  128. data/lib/merged_api/models/relationships1.rb +59 -0
  129. data/lib/merged_api/models/relationships10.rb +49 -0
  130. data/lib/merged_api/models/relationships11.rb +90 -0
  131. data/lib/merged_api/models/relationships13.rb +48 -0
  132. data/lib/merged_api/models/relationships14.rb +60 -0
  133. data/lib/merged_api/models/relationships2.rb +61 -0
  134. data/lib/merged_api/models/relationships3.rb +127 -0
  135. data/lib/merged_api/models/relationships4.rb +66 -0
  136. data/lib/merged_api/models/relationships5.rb +57 -0
  137. data/lib/merged_api/models/relationships9.rb +81 -0
  138. data/lib/merged_api/models/state_enum.rb +164 -0
  139. data/lib/merged_api/models/status2_enum.rb +26 -0
  140. data/lib/merged_api/models/status_enum.rb +32 -0
  141. data/lib/merged_api/models/token_type_enum.rb +14 -0
  142. data/lib/merged_api/utilities/date_time_helper.rb +11 -0
  143. data/lib/merged_api/utilities/file_wrapper.rb +16 -0
  144. data/lib/merged_api.rb +165 -0
  145. data/test/controllers/controller_test_base.rb +33 -0
  146. data/test/controllers/test_policy_controller.rb +36 -0
  147. data/test/controllers/test_simple_calculator_controller.rb +34 -0
  148. data/test/http_response_catcher.rb +19 -0
  149. metadata +267 -0
@@ -0,0 +1,137 @@
1
+ # merged_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module MergedApi
7
+ # The insured entity.
8
+ class Attributes11 < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # A reference that can be used to identify this customer in your system.
13
+ # @return [String]
14
+ attr_accessor :external_reference
15
+
16
+ # The kind of customer this is.
17
+ # @return [EntityTypeEnum]
18
+ attr_accessor :entity_type
19
+
20
+ # The legal name of the business.
21
+ # @return [String]
22
+ attr_accessor :business_name
23
+
24
+ # The first name of the contact.
25
+ # @return [String]
26
+ attr_accessor :first_name
27
+
28
+ # The last name of the contact.
29
+ # @return [String]
30
+ attr_accessor :last_name
31
+
32
+ # The email address of the contact.
33
+ # @return [String]
34
+ attr_accessor :email
35
+
36
+ # The primary phone number of the contact.
37
+ # @return [String]
38
+ attr_accessor :phone
39
+
40
+ # The website of the contact.
41
+ # @return [String]
42
+ attr_accessor :website
43
+
44
+ # The mailing address of this customer.
45
+ # @return [MailingAddress]
46
+ attr_accessor :mailing_address
47
+
48
+ # The billing address of this customer.
49
+ # @return [BillingAddress]
50
+ attr_accessor :billing_address
51
+
52
+ # A mapping from model property names to API property names.
53
+ def self.names
54
+ @_hash = {} if @_hash.nil?
55
+ @_hash['external_reference'] = 'external_reference'
56
+ @_hash['entity_type'] = 'entity_type'
57
+ @_hash['business_name'] = 'business_name'
58
+ @_hash['first_name'] = 'first_name'
59
+ @_hash['last_name'] = 'last_name'
60
+ @_hash['email'] = 'email'
61
+ @_hash['phone'] = 'phone'
62
+ @_hash['website'] = 'website'
63
+ @_hash['mailing_address'] = 'mailing_address'
64
+ @_hash['billing_address'] = 'billing_address'
65
+ @_hash
66
+ end
67
+
68
+ # An array for optional fields
69
+ def self.optionals
70
+ %w[
71
+ external_reference
72
+ business_name
73
+ website
74
+ billing_address
75
+ ]
76
+ end
77
+
78
+ # An array for nullable fields
79
+ def self.nullables
80
+ []
81
+ end
82
+
83
+ def initialize(entity_type = nil,
84
+ first_name = nil,
85
+ last_name = nil,
86
+ email = nil,
87
+ phone = nil,
88
+ mailing_address = nil,
89
+ external_reference = SKIP,
90
+ business_name = SKIP,
91
+ website = SKIP,
92
+ billing_address = SKIP)
93
+ @external_reference = external_reference unless external_reference == SKIP
94
+ @entity_type = entity_type
95
+ @business_name = business_name unless business_name == SKIP
96
+ @first_name = first_name
97
+ @last_name = last_name
98
+ @email = email
99
+ @phone = phone
100
+ @website = website unless website == SKIP
101
+ @mailing_address = mailing_address
102
+ @billing_address = billing_address unless billing_address == SKIP
103
+ end
104
+
105
+ # Creates an instance of the object from a hash.
106
+ def self.from_hash(hash)
107
+ return nil unless hash
108
+
109
+ # Extract variables from the hash.
110
+ entity_type = hash.key?('entity_type') ? hash['entity_type'] : nil
111
+ first_name = hash.key?('first_name') ? hash['first_name'] : nil
112
+ last_name = hash.key?('last_name') ? hash['last_name'] : nil
113
+ email = hash.key?('email') ? hash['email'] : nil
114
+ phone = hash.key?('phone') ? hash['phone'] : nil
115
+ mailing_address = MailingAddress.from_hash(hash['mailing_address']) if
116
+ hash['mailing_address']
117
+ external_reference =
118
+ hash.key?('external_reference') ? hash['external_reference'] : SKIP
119
+ business_name = hash.key?('business_name') ? hash['business_name'] : SKIP
120
+ website = hash.key?('website') ? hash['website'] : SKIP
121
+ billing_address = BillingAddress.from_hash(hash['billing_address']) if
122
+ hash['billing_address']
123
+
124
+ # Create object from extracted values.
125
+ Attributes11.new(entity_type,
126
+ first_name,
127
+ last_name,
128
+ email,
129
+ phone,
130
+ mailing_address,
131
+ external_reference,
132
+ business_name,
133
+ website,
134
+ billing_address)
135
+ end
136
+ end
137
+ 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 insured risk.
8
+ class Attributes12 < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Object representation of the insured risk.
13
+ # @return [Object]
14
+ attr_accessor :factors
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['factors'] = 'factors'
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(factors = nil)
34
+ @factors = factors
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
+ factors = hash.key?('factors') ? hash['factors'] : nil
43
+
44
+ # Create object from extracted values.
45
+ Attributes12.new(factors)
46
+ end
47
+ end
48
+ 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
+ module MergedApi
7
+ # Attributes for this policy.
8
+ class Attributes2 < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Quote number received from quote creation.
13
+ # @return [String]
14
+ attr_accessor :quote_number
15
+
16
+ # Value from the set which controls invoicing and billing. This is dependent
17
+ # on your product's configuration.
18
+ # @return [String]
19
+ attr_accessor :installment_plan
20
+
21
+ # Stripe credit card token that will be used for charge authorization.
22
+ # @return [String]
23
+ attr_accessor :stripe_token
24
+
25
+ # Any value you wish to associate with this resource such as an ID from your
26
+ # system.
27
+ # @return [String]
28
+ attr_accessor :external_id
29
+
30
+ # A mapping from model property names to API property names.
31
+ def self.names
32
+ @_hash = {} if @_hash.nil?
33
+ @_hash['quote_number'] = 'quote_number'
34
+ @_hash['installment_plan'] = 'installment_plan'
35
+ @_hash['stripe_token'] = 'stripe_token'
36
+ @_hash['external_id'] = 'external_id'
37
+ @_hash
38
+ end
39
+
40
+ # An array for optional fields
41
+ def self.optionals
42
+ %w[
43
+ external_id
44
+ ]
45
+ end
46
+
47
+ # An array for nullable fields
48
+ def self.nullables
49
+ []
50
+ end
51
+
52
+ def initialize(quote_number = nil,
53
+ installment_plan = nil,
54
+ stripe_token = nil,
55
+ external_id = SKIP)
56
+ @quote_number = quote_number
57
+ @installment_plan = installment_plan
58
+ @stripe_token = stripe_token
59
+ @external_id = external_id unless external_id == SKIP
60
+ end
61
+
62
+ # Creates an instance of the object from a hash.
63
+ def self.from_hash(hash)
64
+ return nil unless hash
65
+
66
+ # Extract variables from the hash.
67
+ quote_number = hash.key?('quote_number') ? hash['quote_number'] : nil
68
+ installment_plan =
69
+ hash.key?('installment_plan') ? hash['installment_plan'] : nil
70
+ stripe_token = hash.key?('stripe_token') ? hash['stripe_token'] : nil
71
+ external_id = hash.key?('external_id') ? hash['external_id'] : SKIP
72
+
73
+ # Create object from extracted values.
74
+ Attributes2.new(quote_number,
75
+ installment_plan,
76
+ stripe_token,
77
+ external_id)
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,412 @@
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 a policy resource with optional writeable money
9
+ # fields.
10
+ class Attributes3 < BaseModel
11
+ SKIP = Object.new
12
+ private_constant :SKIP
13
+
14
+ # Date time when this resource was created in our system.
15
+ # @return [DateTime]
16
+ attr_accessor :created_date
17
+
18
+ # Date time when this resource was last modified in our system.
19
+ # @return [DateTime]
20
+ attr_accessor :modified_date
21
+
22
+ # The end date for this policy if it has been ended.
23
+ # @return [DateTime]
24
+ attr_accessor :actual_end_date
25
+
26
+ # The status of the policy.
27
+ # @return [StatusEnum]
28
+ attr_accessor :status
29
+
30
+ # Our calculated earned premium thus far for this policy.
31
+ # @return [String]
32
+ attr_accessor :earned_premium
33
+
34
+ # Our calculated earned tax thus far for this policy.
35
+ # @return [String]
36
+ attr_accessor :earned_tax
37
+
38
+ # Our calculated earned fees thus far for this policy.
39
+ # @return [String]
40
+ attr_accessor :earned_fees
41
+
42
+ # A value from the set denoting the reason for policy cancellation.
43
+ # @return [String]
44
+ attr_accessor :cancel_reason
45
+
46
+ # User provided description for why policy was cancelled.
47
+ # @return [String]
48
+ attr_accessor :cancel_description
49
+
50
+ # A unique alphanumeric string used as a human-readable value for the
51
+ # Policy.
52
+ # @return [String]
53
+ attr_accessor :policy_number
54
+
55
+ # The date and time this policy went into effect.
56
+ # @return [DateTime]
57
+ attr_accessor :effective_date
58
+
59
+ # Any value you wish to associate with this policy such as an ID from your
60
+ # system.
61
+ # @return [String]
62
+ attr_accessor :external_reference
63
+
64
+ # A value from the set denoting the user-selected limit of coverage. This is
65
+ # dependent on your product's configuration.
66
+ # @return [String]
67
+ attr_accessor :limit
68
+
69
+ # A value from the set denoting the user-selected deductible of coverage.
70
+ # This is dependent on your product's configuration.
71
+ # @return [String]
72
+ attr_accessor :deductible
73
+
74
+ # The two letter state code (including Washington DC) for the state in which
75
+ # the issured entity resides.
76
+ # @return [PolicyStateEnum]
77
+ attr_accessor :policy_state
78
+
79
+ # Additional data about the policy. The required metadata fields are
80
+ # specific to your product.
81
+ # @return [Object]
82
+ attr_accessor :metadata
83
+
84
+ # The policy's natural term end date and time.
85
+ # @return [DateTime]
86
+ attr_accessor :term_end_date
87
+
88
+ # The installment plan schedule that determines invoicing and/or automatic
89
+ # payment dates.
90
+ # @return [String]
91
+ attr_accessor :installment_plan
92
+
93
+ # The written premium for this policy.
94
+ # @return [String]
95
+ attr_accessor :written_premium
96
+
97
+ # The date and time that the policy was issued.
98
+ # @return [DateTime]
99
+ attr_accessor :issue_date
100
+
101
+ # The most recently set date and time that a non-renewal notice was set to
102
+ # be sent.
103
+ # @return [DateTime]
104
+ attr_accessor :non_renewal_notice_date
105
+
106
+ # The most recently set date and time that a cancellation notice was set to
107
+ # be sent.
108
+ # @return [DateTime]
109
+ attr_accessor :cancellation_notice_date
110
+
111
+ # The most recently set date and time that an allowed party requested a
112
+ # policy to be cancelled.
113
+ # @return [DateTime]
114
+ attr_accessor :requested_cancellation_date
115
+
116
+ # The term state tax
117
+ # @return [String]
118
+ attr_accessor :state_tax
119
+
120
+ # The aggregate term state fees.
121
+ # @return [String]
122
+ attr_accessor :state_fees
123
+
124
+ # The term aggregate service fees
125
+ # @return [String]
126
+ attr_accessor :service_fees
127
+
128
+ # This term premium . This value includes taxes only for admitted products
129
+ # @return [String]
130
+ attr_accessor :term_premium
131
+
132
+ # The term aggregate billing fees
133
+ # @return [String]
134
+ attr_accessor :billing_fees
135
+
136
+ # A mapping from model property names to API property names.
137
+ def self.names
138
+ @_hash = {} if @_hash.nil?
139
+ @_hash['created_date'] = 'created_date'
140
+ @_hash['modified_date'] = 'modified_date'
141
+ @_hash['actual_end_date'] = 'actual_end_date'
142
+ @_hash['status'] = 'status'
143
+ @_hash['earned_premium'] = 'earned_premium'
144
+ @_hash['earned_tax'] = 'earned_tax'
145
+ @_hash['earned_fees'] = 'earned_fees'
146
+ @_hash['cancel_reason'] = 'cancel_reason'
147
+ @_hash['cancel_description'] = 'cancel_description'
148
+ @_hash['policy_number'] = 'policy_number'
149
+ @_hash['effective_date'] = 'effective_date'
150
+ @_hash['external_reference'] = 'external_reference'
151
+ @_hash['limit'] = 'limit'
152
+ @_hash['deductible'] = 'deductible'
153
+ @_hash['policy_state'] = 'policy_state'
154
+ @_hash['metadata'] = 'metadata'
155
+ @_hash['term_end_date'] = 'term_end_date'
156
+ @_hash['installment_plan'] = 'installment_plan'
157
+ @_hash['written_premium'] = 'written_premium'
158
+ @_hash['issue_date'] = 'issue_date'
159
+ @_hash['non_renewal_notice_date'] = 'non_renewal_notice_date'
160
+ @_hash['cancellation_notice_date'] = 'cancellation_notice_date'
161
+ @_hash['requested_cancellation_date'] = 'requested_cancellation_date'
162
+ @_hash['state_tax'] = 'state_tax'
163
+ @_hash['state_fees'] = 'state_fees'
164
+ @_hash['service_fees'] = 'service_fees'
165
+ @_hash['term_premium'] = 'term_premium'
166
+ @_hash['billing_fees'] = 'billing_fees'
167
+ @_hash
168
+ end
169
+
170
+ # An array for optional fields
171
+ def self.optionals
172
+ %w[
173
+ created_date
174
+ modified_date
175
+ actual_end_date
176
+ status
177
+ earned_premium
178
+ earned_tax
179
+ earned_fees
180
+ cancel_reason
181
+ cancel_description
182
+ policy_number
183
+ effective_date
184
+ external_reference
185
+ limit
186
+ deductible
187
+ policy_state
188
+ metadata
189
+ term_end_date
190
+ installment_plan
191
+ written_premium
192
+ issue_date
193
+ non_renewal_notice_date
194
+ cancellation_notice_date
195
+ requested_cancellation_date
196
+ state_tax
197
+ state_fees
198
+ service_fees
199
+ term_premium
200
+ billing_fees
201
+ ]
202
+ end
203
+
204
+ # An array for nullable fields
205
+ def self.nullables
206
+ []
207
+ end
208
+
209
+ def initialize(created_date = SKIP,
210
+ modified_date = SKIP,
211
+ actual_end_date = SKIP,
212
+ status = SKIP,
213
+ earned_premium = SKIP,
214
+ earned_tax = SKIP,
215
+ earned_fees = SKIP,
216
+ cancel_reason = SKIP,
217
+ cancel_description = SKIP,
218
+ policy_number = SKIP,
219
+ effective_date = SKIP,
220
+ external_reference = SKIP,
221
+ limit = SKIP,
222
+ deductible = SKIP,
223
+ policy_state = SKIP,
224
+ metadata = SKIP,
225
+ term_end_date = SKIP,
226
+ installment_plan = SKIP,
227
+ written_premium = SKIP,
228
+ issue_date = SKIP,
229
+ non_renewal_notice_date = SKIP,
230
+ cancellation_notice_date = SKIP,
231
+ requested_cancellation_date = SKIP,
232
+ state_tax = SKIP,
233
+ state_fees = SKIP,
234
+ service_fees = SKIP,
235
+ term_premium = SKIP,
236
+ billing_fees = SKIP)
237
+ @created_date = created_date unless created_date == SKIP
238
+ @modified_date = modified_date unless modified_date == SKIP
239
+ @actual_end_date = actual_end_date unless actual_end_date == SKIP
240
+ @status = status unless status == SKIP
241
+ @earned_premium = earned_premium unless earned_premium == SKIP
242
+ @earned_tax = earned_tax unless earned_tax == SKIP
243
+ @earned_fees = earned_fees unless earned_fees == SKIP
244
+ @cancel_reason = cancel_reason unless cancel_reason == SKIP
245
+ @cancel_description = cancel_description unless cancel_description == SKIP
246
+ @policy_number = policy_number unless policy_number == SKIP
247
+ @effective_date = effective_date unless effective_date == SKIP
248
+ @external_reference = external_reference unless external_reference == SKIP
249
+ @limit = limit unless limit == SKIP
250
+ @deductible = deductible unless deductible == SKIP
251
+ @policy_state = policy_state unless policy_state == SKIP
252
+ @metadata = metadata unless metadata == SKIP
253
+ @term_end_date = term_end_date unless term_end_date == SKIP
254
+ @installment_plan = installment_plan unless installment_plan == SKIP
255
+ @written_premium = written_premium unless written_premium == SKIP
256
+ @issue_date = issue_date unless issue_date == SKIP
257
+ @non_renewal_notice_date = non_renewal_notice_date unless non_renewal_notice_date == SKIP
258
+ @cancellation_notice_date = cancellation_notice_date unless cancellation_notice_date == SKIP
259
+ unless requested_cancellation_date == SKIP
260
+ @requested_cancellation_date =
261
+ requested_cancellation_date
262
+ end
263
+ @state_tax = state_tax unless state_tax == SKIP
264
+ @state_fees = state_fees unless state_fees == SKIP
265
+ @service_fees = service_fees unless service_fees == SKIP
266
+ @term_premium = term_premium unless term_premium == SKIP
267
+ @billing_fees = billing_fees unless billing_fees == SKIP
268
+ end
269
+
270
+ # Creates an instance of the object from a hash.
271
+ def self.from_hash(hash)
272
+ return nil unless hash
273
+
274
+ # Extract variables from the hash.
275
+ created_date = if hash.key?('created_date')
276
+ (DateTimeHelper.from_rfc3339(hash['created_date']) if hash['created_date'])
277
+ else
278
+ SKIP
279
+ end
280
+ modified_date = if hash.key?('modified_date')
281
+ (DateTimeHelper.from_rfc3339(hash['modified_date']) if hash['modified_date'])
282
+ else
283
+ SKIP
284
+ end
285
+ actual_end_date = if hash.key?('actual_end_date')
286
+ (DateTimeHelper.from_rfc3339(hash['actual_end_date']) if hash['actual_end_date'])
287
+ else
288
+ SKIP
289
+ end
290
+ status = hash.key?('status') ? hash['status'] : SKIP
291
+ earned_premium =
292
+ hash.key?('earned_premium') ? hash['earned_premium'] : SKIP
293
+ earned_tax = hash.key?('earned_tax') ? hash['earned_tax'] : SKIP
294
+ earned_fees = hash.key?('earned_fees') ? hash['earned_fees'] : SKIP
295
+ cancel_reason = hash.key?('cancel_reason') ? hash['cancel_reason'] : SKIP
296
+ cancel_description =
297
+ hash.key?('cancel_description') ? hash['cancel_description'] : SKIP
298
+ policy_number = hash.key?('policy_number') ? hash['policy_number'] : SKIP
299
+ effective_date = if hash.key?('effective_date')
300
+ (DateTimeHelper.from_rfc3339(hash['effective_date']) if hash['effective_date'])
301
+ else
302
+ SKIP
303
+ end
304
+ external_reference =
305
+ hash.key?('external_reference') ? hash['external_reference'] : SKIP
306
+ limit = hash.key?('limit') ? hash['limit'] : SKIP
307
+ deductible = hash.key?('deductible') ? hash['deductible'] : SKIP
308
+ policy_state = hash.key?('policy_state') ? hash['policy_state'] : SKIP
309
+ metadata = hash.key?('metadata') ? hash['metadata'] : SKIP
310
+ term_end_date = if hash.key?('term_end_date')
311
+ (DateTimeHelper.from_rfc3339(hash['term_end_date']) if hash['term_end_date'])
312
+ else
313
+ SKIP
314
+ end
315
+ installment_plan =
316
+ hash.key?('installment_plan') ? hash['installment_plan'] : SKIP
317
+ written_premium =
318
+ hash.key?('written_premium') ? hash['written_premium'] : SKIP
319
+ issue_date = if hash.key?('issue_date')
320
+ (DateTimeHelper.from_rfc3339(hash['issue_date']) if hash['issue_date'])
321
+ else
322
+ SKIP
323
+ end
324
+ non_renewal_notice_date = if hash.key?('non_renewal_notice_date')
325
+ (DateTimeHelper.from_rfc3339(hash['non_renewal_notice_date']) if hash['non_renewal_notice_date'])
326
+ else
327
+ SKIP
328
+ end
329
+ cancellation_notice_date = if hash.key?('cancellation_notice_date')
330
+ (DateTimeHelper.from_rfc3339(hash['cancellation_notice_date']) if hash['cancellation_notice_date'])
331
+ else
332
+ SKIP
333
+ end
334
+ requested_cancellation_date = if hash.key?('requested_cancellation_date')
335
+ (DateTimeHelper.from_rfc3339(hash['requested_cancellation_date']) if hash['requested_cancellation_date'])
336
+ else
337
+ SKIP
338
+ end
339
+ state_tax = hash.key?('state_tax') ? hash['state_tax'] : SKIP
340
+ state_fees = hash.key?('state_fees') ? hash['state_fees'] : SKIP
341
+ service_fees = hash.key?('service_fees') ? hash['service_fees'] : SKIP
342
+ term_premium = hash.key?('term_premium') ? hash['term_premium'] : SKIP
343
+ billing_fees = hash.key?('billing_fees') ? hash['billing_fees'] : SKIP
344
+
345
+ # Create object from extracted values.
346
+ Attributes3.new(created_date,
347
+ modified_date,
348
+ actual_end_date,
349
+ status,
350
+ earned_premium,
351
+ earned_tax,
352
+ earned_fees,
353
+ cancel_reason,
354
+ cancel_description,
355
+ policy_number,
356
+ effective_date,
357
+ external_reference,
358
+ limit,
359
+ deductible,
360
+ policy_state,
361
+ metadata,
362
+ term_end_date,
363
+ installment_plan,
364
+ written_premium,
365
+ issue_date,
366
+ non_renewal_notice_date,
367
+ cancellation_notice_date,
368
+ requested_cancellation_date,
369
+ state_tax,
370
+ state_fees,
371
+ service_fees,
372
+ term_premium,
373
+ billing_fees)
374
+ end
375
+
376
+ def to_created_date
377
+ DateTimeHelper.to_rfc3339(created_date)
378
+ end
379
+
380
+ def to_modified_date
381
+ DateTimeHelper.to_rfc3339(modified_date)
382
+ end
383
+
384
+ def to_actual_end_date
385
+ DateTimeHelper.to_rfc3339(actual_end_date)
386
+ end
387
+
388
+ def to_effective_date
389
+ DateTimeHelper.to_rfc3339(effective_date)
390
+ end
391
+
392
+ def to_term_end_date
393
+ DateTimeHelper.to_rfc3339(term_end_date)
394
+ end
395
+
396
+ def to_issue_date
397
+ DateTimeHelper.to_rfc3339(issue_date)
398
+ end
399
+
400
+ def to_non_renewal_notice_date
401
+ DateTimeHelper.to_rfc3339(non_renewal_notice_date)
402
+ end
403
+
404
+ def to_cancellation_notice_date
405
+ DateTimeHelper.to_rfc3339(cancellation_notice_date)
406
+ end
407
+
408
+ def to_requested_cancellation_date
409
+ DateTimeHelper.to_rfc3339(requested_cancellation_date)
410
+ end
411
+ end
412
+ end