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,126 @@
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 of this coverage.
9
+ class Attributes4 < 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
+ # A value from the set denoting the user-selected deductible of coverage.
22
+ # This is dependent
23
+ # on the product's configuration.
24
+ # @return [String]
25
+ attr_accessor :deductible
26
+
27
+ # A value from the set denoting the user-selected limit of coverage. This is
28
+ # dependent
29
+ # on the product's configuration.
30
+ # @return [String]
31
+ attr_accessor :limit
32
+
33
+ # Term premium for this coverage
34
+ # @return [String]
35
+ attr_accessor :premium
36
+
37
+ # Additional fees relating to this coverage.
38
+ # @return [String]
39
+ attr_accessor :additional_fees
40
+
41
+ # Date for when this coverage goes into effect on the policy.
42
+ # @return [DateTime]
43
+ attr_accessor :revision_date
44
+
45
+ # A mapping from model property names to API property names.
46
+ def self.names
47
+ @_hash = {} if @_hash.nil?
48
+ @_hash['created_date'] = 'created_date'
49
+ @_hash['modified_date'] = 'modified_date'
50
+ @_hash['deductible'] = 'deductible'
51
+ @_hash['limit'] = 'limit'
52
+ @_hash['premium'] = 'premium'
53
+ @_hash['additional_fees'] = 'additional_fees'
54
+ @_hash['revision_date'] = 'revision_date'
55
+ @_hash
56
+ end
57
+
58
+ # An array for optional fields
59
+ def self.optionals
60
+ []
61
+ end
62
+
63
+ # An array for nullable fields
64
+ def self.nullables
65
+ []
66
+ end
67
+
68
+ def initialize(created_date = nil,
69
+ modified_date = nil,
70
+ deductible = nil,
71
+ limit = nil,
72
+ premium = nil,
73
+ additional_fees = nil,
74
+ revision_date = nil)
75
+ @created_date = created_date
76
+ @modified_date = modified_date
77
+ @deductible = deductible
78
+ @limit = limit
79
+ @premium = premium
80
+ @additional_fees = additional_fees
81
+ @revision_date = revision_date
82
+ end
83
+
84
+ # Creates an instance of the object from a hash.
85
+ def self.from_hash(hash)
86
+ return nil unless hash
87
+
88
+ # Extract variables from the hash.
89
+ created_date = if hash.key?('created_date')
90
+ (DateTimeHelper.from_rfc3339(hash['created_date']) if hash['created_date'])
91
+ end
92
+ modified_date = if hash.key?('modified_date')
93
+ (DateTimeHelper.from_rfc3339(hash['modified_date']) if hash['modified_date'])
94
+ end
95
+ deductible = hash.key?('deductible') ? hash['deductible'] : nil
96
+ limit = hash.key?('limit') ? hash['limit'] : nil
97
+ premium = hash.key?('premium') ? hash['premium'] : nil
98
+ additional_fees =
99
+ hash.key?('additional_fees') ? hash['additional_fees'] : nil
100
+ revision_date = if hash.key?('revision_date')
101
+ (DateTimeHelper.from_rfc3339(hash['revision_date']) if hash['revision_date'])
102
+ end
103
+
104
+ # Create object from extracted values.
105
+ Attributes4.new(created_date,
106
+ modified_date,
107
+ deductible,
108
+ limit,
109
+ premium,
110
+ additional_fees,
111
+ revision_date)
112
+ end
113
+
114
+ def to_created_date
115
+ DateTimeHelper.to_rfc3339(created_date)
116
+ end
117
+
118
+ def to_modified_date
119
+ DateTimeHelper.to_rfc3339(modified_date)
120
+ end
121
+
122
+ def to_revision_date
123
+ DateTimeHelper.to_rfc3339(revision_date)
124
+ end
125
+ end
126
+ 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 of this insured risk.
9
+ class Attributes5 < 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
+ Attributes5.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,422 @@
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 Attributes6 < 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
+ # UUID that identifies the document for this policy.
23
+ # @return [UUID | String]
24
+ attr_accessor :document_id
25
+
26
+ # The end date for this policy if it has been ended.
27
+ # @return [DateTime]
28
+ attr_accessor :actual_end_date
29
+
30
+ # The status of the policy.
31
+ # @return [StatusEnum]
32
+ attr_accessor :status
33
+
34
+ # Our calculated earned premium thus far for this policy.
35
+ # @return [String]
36
+ attr_accessor :earned_premium
37
+
38
+ # Our calculated earned tax thus far for this policy.
39
+ # @return [String]
40
+ attr_accessor :earned_tax
41
+
42
+ # Our calculated earned fees thus far for this policy.
43
+ # @return [String]
44
+ attr_accessor :earned_fees
45
+
46
+ # A value from the set denoting the reason for policy cancellation.
47
+ # @return [String]
48
+ attr_accessor :cancel_reason
49
+
50
+ # User provided description for why policy was cancelled.
51
+ # @return [String]
52
+ attr_accessor :cancel_description
53
+
54
+ # A unique alphanumeric string used as a human-readable value for the
55
+ # Policy.
56
+ # @return [String]
57
+ attr_accessor :policy_number
58
+
59
+ # The date and time this policy went into effect.
60
+ # @return [DateTime]
61
+ attr_accessor :effective_date
62
+
63
+ # Any value you wish to associate with this policy such as an ID from your
64
+ # system.
65
+ # @return [String]
66
+ attr_accessor :external_reference
67
+
68
+ # A value from the set denoting the user-selected limit of coverage. This is
69
+ # dependent on your product's configuration.
70
+ # @return [String]
71
+ attr_accessor :limit
72
+
73
+ # A value from the set denoting the user-selected deductible of coverage.
74
+ # This is dependent on your product's configuration.
75
+ # @return [String]
76
+ attr_accessor :deductible
77
+
78
+ # The two letter state code (including Washington DC) for the state in which
79
+ # the issured entity resides.
80
+ # @return [PolicyStateEnum]
81
+ attr_accessor :policy_state
82
+
83
+ # Additional data about the policy. The required metadata fields are
84
+ # specific to your product.
85
+ # @return [Object]
86
+ attr_accessor :metadata
87
+
88
+ # The policy's natural term end date and time.
89
+ # @return [DateTime]
90
+ attr_accessor :term_end_date
91
+
92
+ # The installment plan schedule that determines invoicing and/or automatic
93
+ # payment dates.
94
+ # @return [String]
95
+ attr_accessor :installment_plan
96
+
97
+ # The written premium for this policy.
98
+ # @return [String]
99
+ attr_accessor :written_premium
100
+
101
+ # The date and time that the policy was issued.
102
+ # @return [DateTime]
103
+ attr_accessor :issue_date
104
+
105
+ # The most recently set date and time that a non-renewal notice was set to
106
+ # be sent.
107
+ # @return [DateTime]
108
+ attr_accessor :non_renewal_notice_date
109
+
110
+ # The most recently set date and time that a cancellation notice was set to
111
+ # be sent.
112
+ # @return [DateTime]
113
+ attr_accessor :cancellation_notice_date
114
+
115
+ # The most recently set date and time that an allowed party requested a
116
+ # policy to be cancelled.
117
+ # @return [DateTime]
118
+ attr_accessor :requested_cancellation_date
119
+
120
+ # The term state tax
121
+ # @return [String]
122
+ attr_accessor :state_tax
123
+
124
+ # The aggregate term state fees.
125
+ # @return [String]
126
+ attr_accessor :state_fees
127
+
128
+ # The term aggregate service fees
129
+ # @return [String]
130
+ attr_accessor :service_fees
131
+
132
+ # This term premium . This value includes taxes only for admitted products
133
+ # @return [String]
134
+ attr_accessor :term_premium
135
+
136
+ # The term aggregate billing fees
137
+ # @return [String]
138
+ attr_accessor :billing_fees
139
+
140
+ # A mapping from model property names to API property names.
141
+ def self.names
142
+ @_hash = {} if @_hash.nil?
143
+ @_hash['created_date'] = 'created_date'
144
+ @_hash['modified_date'] = 'modified_date'
145
+ @_hash['document_id'] = 'document_id'
146
+ @_hash['actual_end_date'] = 'actual_end_date'
147
+ @_hash['status'] = 'status'
148
+ @_hash['earned_premium'] = 'earned_premium'
149
+ @_hash['earned_tax'] = 'earned_tax'
150
+ @_hash['earned_fees'] = 'earned_fees'
151
+ @_hash['cancel_reason'] = 'cancel_reason'
152
+ @_hash['cancel_description'] = 'cancel_description'
153
+ @_hash['policy_number'] = 'policy_number'
154
+ @_hash['effective_date'] = 'effective_date'
155
+ @_hash['external_reference'] = 'external_reference'
156
+ @_hash['limit'] = 'limit'
157
+ @_hash['deductible'] = 'deductible'
158
+ @_hash['policy_state'] = 'policy_state'
159
+ @_hash['metadata'] = 'metadata'
160
+ @_hash['term_end_date'] = 'term_end_date'
161
+ @_hash['installment_plan'] = 'installment_plan'
162
+ @_hash['written_premium'] = 'written_premium'
163
+ @_hash['issue_date'] = 'issue_date'
164
+ @_hash['non_renewal_notice_date'] = 'non_renewal_notice_date'
165
+ @_hash['cancellation_notice_date'] = 'cancellation_notice_date'
166
+ @_hash['requested_cancellation_date'] = 'requested_cancellation_date'
167
+ @_hash['state_tax'] = 'state_tax'
168
+ @_hash['state_fees'] = 'state_fees'
169
+ @_hash['service_fees'] = 'service_fees'
170
+ @_hash['term_premium'] = 'term_premium'
171
+ @_hash['billing_fees'] = 'billing_fees'
172
+ @_hash
173
+ end
174
+
175
+ # An array for optional fields
176
+ def self.optionals
177
+ %w[
178
+ created_date
179
+ modified_date
180
+ document_id
181
+ actual_end_date
182
+ status
183
+ earned_premium
184
+ earned_tax
185
+ earned_fees
186
+ cancel_reason
187
+ cancel_description
188
+ policy_number
189
+ effective_date
190
+ external_reference
191
+ limit
192
+ deductible
193
+ policy_state
194
+ metadata
195
+ term_end_date
196
+ installment_plan
197
+ written_premium
198
+ issue_date
199
+ non_renewal_notice_date
200
+ cancellation_notice_date
201
+ requested_cancellation_date
202
+ state_tax
203
+ state_fees
204
+ service_fees
205
+ term_premium
206
+ billing_fees
207
+ ]
208
+ end
209
+
210
+ # An array for nullable fields
211
+ def self.nullables
212
+ []
213
+ end
214
+
215
+ def initialize(created_date = SKIP,
216
+ modified_date = SKIP,
217
+ document_id = SKIP,
218
+ actual_end_date = SKIP,
219
+ status = SKIP,
220
+ earned_premium = SKIP,
221
+ earned_tax = SKIP,
222
+ earned_fees = SKIP,
223
+ cancel_reason = SKIP,
224
+ cancel_description = SKIP,
225
+ policy_number = SKIP,
226
+ effective_date = SKIP,
227
+ external_reference = SKIP,
228
+ limit = SKIP,
229
+ deductible = SKIP,
230
+ policy_state = SKIP,
231
+ metadata = SKIP,
232
+ term_end_date = SKIP,
233
+ installment_plan = SKIP,
234
+ written_premium = SKIP,
235
+ issue_date = SKIP,
236
+ non_renewal_notice_date = SKIP,
237
+ cancellation_notice_date = SKIP,
238
+ requested_cancellation_date = SKIP,
239
+ state_tax = SKIP,
240
+ state_fees = SKIP,
241
+ service_fees = SKIP,
242
+ term_premium = SKIP,
243
+ billing_fees = SKIP)
244
+ @created_date = created_date unless created_date == SKIP
245
+ @modified_date = modified_date unless modified_date == SKIP
246
+ @document_id = document_id unless document_id == SKIP
247
+ @actual_end_date = actual_end_date unless actual_end_date == SKIP
248
+ @status = status unless status == SKIP
249
+ @earned_premium = earned_premium unless earned_premium == SKIP
250
+ @earned_tax = earned_tax unless earned_tax == SKIP
251
+ @earned_fees = earned_fees unless earned_fees == SKIP
252
+ @cancel_reason = cancel_reason unless cancel_reason == SKIP
253
+ @cancel_description = cancel_description unless cancel_description == SKIP
254
+ @policy_number = policy_number unless policy_number == SKIP
255
+ @effective_date = effective_date unless effective_date == SKIP
256
+ @external_reference = external_reference unless external_reference == SKIP
257
+ @limit = limit unless limit == SKIP
258
+ @deductible = deductible unless deductible == SKIP
259
+ @policy_state = policy_state unless policy_state == SKIP
260
+ @metadata = metadata unless metadata == SKIP
261
+ @term_end_date = term_end_date unless term_end_date == SKIP
262
+ @installment_plan = installment_plan unless installment_plan == SKIP
263
+ @written_premium = written_premium unless written_premium == SKIP
264
+ @issue_date = issue_date unless issue_date == SKIP
265
+ @non_renewal_notice_date = non_renewal_notice_date unless non_renewal_notice_date == SKIP
266
+ @cancellation_notice_date = cancellation_notice_date unless cancellation_notice_date == SKIP
267
+ unless requested_cancellation_date == SKIP
268
+ @requested_cancellation_date =
269
+ requested_cancellation_date
270
+ end
271
+ @state_tax = state_tax unless state_tax == SKIP
272
+ @state_fees = state_fees unless state_fees == SKIP
273
+ @service_fees = service_fees unless service_fees == SKIP
274
+ @term_premium = term_premium unless term_premium == SKIP
275
+ @billing_fees = billing_fees unless billing_fees == SKIP
276
+ end
277
+
278
+ # Creates an instance of the object from a hash.
279
+ def self.from_hash(hash)
280
+ return nil unless hash
281
+
282
+ # Extract variables from the hash.
283
+ created_date = if hash.key?('created_date')
284
+ (DateTimeHelper.from_rfc3339(hash['created_date']) if hash['created_date'])
285
+ else
286
+ SKIP
287
+ end
288
+ modified_date = if hash.key?('modified_date')
289
+ (DateTimeHelper.from_rfc3339(hash['modified_date']) if hash['modified_date'])
290
+ else
291
+ SKIP
292
+ end
293
+ document_id = hash.key?('document_id') ? hash['document_id'] : SKIP
294
+ actual_end_date = if hash.key?('actual_end_date')
295
+ (DateTimeHelper.from_rfc3339(hash['actual_end_date']) if hash['actual_end_date'])
296
+ else
297
+ SKIP
298
+ end
299
+ status = hash.key?('status') ? hash['status'] : SKIP
300
+ earned_premium =
301
+ hash.key?('earned_premium') ? hash['earned_premium'] : SKIP
302
+ earned_tax = hash.key?('earned_tax') ? hash['earned_tax'] : SKIP
303
+ earned_fees = hash.key?('earned_fees') ? hash['earned_fees'] : SKIP
304
+ cancel_reason = hash.key?('cancel_reason') ? hash['cancel_reason'] : SKIP
305
+ cancel_description =
306
+ hash.key?('cancel_description') ? hash['cancel_description'] : SKIP
307
+ policy_number = hash.key?('policy_number') ? hash['policy_number'] : SKIP
308
+ effective_date = if hash.key?('effective_date')
309
+ (DateTimeHelper.from_rfc3339(hash['effective_date']) if hash['effective_date'])
310
+ else
311
+ SKIP
312
+ end
313
+ external_reference =
314
+ hash.key?('external_reference') ? hash['external_reference'] : SKIP
315
+ limit = hash.key?('limit') ? hash['limit'] : SKIP
316
+ deductible = hash.key?('deductible') ? hash['deductible'] : SKIP
317
+ policy_state = hash.key?('policy_state') ? hash['policy_state'] : SKIP
318
+ metadata = hash.key?('metadata') ? hash['metadata'] : SKIP
319
+ term_end_date = if hash.key?('term_end_date')
320
+ (DateTimeHelper.from_rfc3339(hash['term_end_date']) if hash['term_end_date'])
321
+ else
322
+ SKIP
323
+ end
324
+ installment_plan =
325
+ hash.key?('installment_plan') ? hash['installment_plan'] : SKIP
326
+ written_premium =
327
+ hash.key?('written_premium') ? hash['written_premium'] : SKIP
328
+ issue_date = if hash.key?('issue_date')
329
+ (DateTimeHelper.from_rfc3339(hash['issue_date']) if hash['issue_date'])
330
+ else
331
+ SKIP
332
+ end
333
+ non_renewal_notice_date = if hash.key?('non_renewal_notice_date')
334
+ (DateTimeHelper.from_rfc3339(hash['non_renewal_notice_date']) if hash['non_renewal_notice_date'])
335
+ else
336
+ SKIP
337
+ end
338
+ cancellation_notice_date = if hash.key?('cancellation_notice_date')
339
+ (DateTimeHelper.from_rfc3339(hash['cancellation_notice_date']) if hash['cancellation_notice_date'])
340
+ else
341
+ SKIP
342
+ end
343
+ requested_cancellation_date = if hash.key?('requested_cancellation_date')
344
+ (DateTimeHelper.from_rfc3339(hash['requested_cancellation_date']) if hash['requested_cancellation_date'])
345
+ else
346
+ SKIP
347
+ end
348
+ state_tax = hash.key?('state_tax') ? hash['state_tax'] : SKIP
349
+ state_fees = hash.key?('state_fees') ? hash['state_fees'] : SKIP
350
+ service_fees = hash.key?('service_fees') ? hash['service_fees'] : SKIP
351
+ term_premium = hash.key?('term_premium') ? hash['term_premium'] : SKIP
352
+ billing_fees = hash.key?('billing_fees') ? hash['billing_fees'] : SKIP
353
+
354
+ # Create object from extracted values.
355
+ Attributes6.new(created_date,
356
+ modified_date,
357
+ document_id,
358
+ actual_end_date,
359
+ status,
360
+ earned_premium,
361
+ earned_tax,
362
+ earned_fees,
363
+ cancel_reason,
364
+ cancel_description,
365
+ policy_number,
366
+ effective_date,
367
+ external_reference,
368
+ limit,
369
+ deductible,
370
+ policy_state,
371
+ metadata,
372
+ term_end_date,
373
+ installment_plan,
374
+ written_premium,
375
+ issue_date,
376
+ non_renewal_notice_date,
377
+ cancellation_notice_date,
378
+ requested_cancellation_date,
379
+ state_tax,
380
+ state_fees,
381
+ service_fees,
382
+ term_premium,
383
+ billing_fees)
384
+ end
385
+
386
+ def to_created_date
387
+ DateTimeHelper.to_rfc3339(created_date)
388
+ end
389
+
390
+ def to_modified_date
391
+ DateTimeHelper.to_rfc3339(modified_date)
392
+ end
393
+
394
+ def to_actual_end_date
395
+ DateTimeHelper.to_rfc3339(actual_end_date)
396
+ end
397
+
398
+ def to_effective_date
399
+ DateTimeHelper.to_rfc3339(effective_date)
400
+ end
401
+
402
+ def to_term_end_date
403
+ DateTimeHelper.to_rfc3339(term_end_date)
404
+ end
405
+
406
+ def to_issue_date
407
+ DateTimeHelper.to_rfc3339(issue_date)
408
+ end
409
+
410
+ def to_non_renewal_notice_date
411
+ DateTimeHelper.to_rfc3339(non_renewal_notice_date)
412
+ end
413
+
414
+ def to_cancellation_notice_date
415
+ DateTimeHelper.to_rfc3339(cancellation_notice_date)
416
+ end
417
+
418
+ def to_requested_cancellation_date
419
+ DateTimeHelper.to_rfc3339(requested_cancellation_date)
420
+ end
421
+ end
422
+ end