candidhealth 0.40.2 → 0.40.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,380 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../requests"
4
+ require_relative "../../commons/types/source_of_payment_code"
5
+ require_relative "types/payer_plan_group_sort_field"
6
+ require_relative "../../commons/types/sort_direction"
7
+ require_relative "types/payer_plan_group_page"
8
+ require_relative "types/payer_plan_group"
9
+ require_relative "types/mutable_payer_plan_group"
10
+ require "async"
11
+
12
+ module CandidApiClient
13
+ module PayerPlanGroups
14
+ module V1
15
+ class V1Client
16
+ # @return [CandidApiClient::RequestClient]
17
+ attr_reader :request_client
18
+
19
+ # @param request_client [CandidApiClient::RequestClient]
20
+ # @return [CandidApiClient::PayerPlanGroups::V1::V1Client]
21
+ def initialize(request_client:)
22
+ @request_client = request_client
23
+ end
24
+
25
+ # Returns all payer plan groups matching filter criteria.
26
+ #
27
+ # @param plan_group_name [String]
28
+ # @param payer_uuid [String]
29
+ # @param payer_id [String]
30
+ # @param plan_type [CandidApiClient::Commons::Types::SourceOfPaymentCode]
31
+ # @param is_active [Boolean]
32
+ # @param payer_plan_group_id [String]
33
+ # @param limit [Integer] Defaults to 100. Cannot exc
34
+ # @param sort_by_similarity [String] If this property is passed, the results will be ordered by those that contain a
35
+ # payer_id, payer_name, plan_group_name, or
36
+ # payer_address most similar to the value passed. This will take precedence over
37
+ # the sort and sort_direction properties. This
38
+ # will always sort in order of most similar to least similar.
39
+ # @param sort [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroupSortField] Defaults to plan_group_name. If sort_by_similarity is passed, that sort will
40
+ # takes precedence over this property.
41
+ # @param sort_direction [CandidApiClient::Commons::Types::SortDirection] Sort direction. Defaults to ascending order if not provided.
42
+ # @param page_token [String]
43
+ # @param request_options [CandidApiClient::RequestOptions]
44
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroupPage]
45
+ # @example
46
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
47
+ # api.payer_plan_groups.v_1.get_multi(
48
+ # plan_group_name: "string",
49
+ # payer_uuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
50
+ # payer_id: "string",
51
+ # plan_type: SELF_PAY,
52
+ # is_active: true,
53
+ # payer_plan_group_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
54
+ # limit: 1,
55
+ # sort_by_similarity: "string",
56
+ # sort: PLAN_GROUP_NAME,
57
+ # sort_direction: ASC,
58
+ # page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"
59
+ # )
60
+ def get_multi(plan_group_name: nil, payer_uuid: nil, payer_id: nil, plan_type: nil, is_active: nil,
61
+ payer_plan_group_id: nil, limit: nil, sort_by_similarity: nil, sort: nil, sort_direction: nil, page_token: nil, request_options: nil)
62
+ response = @request_client.conn.get do |req|
63
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
64
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
65
+ req.headers = {
66
+ **(req.headers || {}),
67
+ **@request_client.get_headers,
68
+ **(request_options&.additional_headers || {})
69
+ }.compact
70
+ req.params = {
71
+ **(request_options&.additional_query_parameters || {}),
72
+ "plan_group_name": plan_group_name,
73
+ "payer_uuid": payer_uuid,
74
+ "payer_id": payer_id,
75
+ "plan_type": plan_type,
76
+ "is_active": is_active,
77
+ "payer_plan_group_id": payer_plan_group_id,
78
+ "limit": limit,
79
+ "sort_by_similarity": sort_by_similarity,
80
+ "sort": sort,
81
+ "sort_direction": sort_direction,
82
+ "page_token": page_token
83
+ }.compact
84
+ req.url "#{@request_client.get_url(environment: CandidApi,
85
+ request_options: request_options)}/api/payer-plan-groups/v1"
86
+ end
87
+ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroupPage.from_json(json_object: response.body)
88
+ end
89
+
90
+ # Return a plan group with a given ID.
91
+ #
92
+ # @param payer_plan_group_id [String]
93
+ # @param request_options [CandidApiClient::RequestOptions]
94
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup]
95
+ # @example
96
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
97
+ # api.payer_plan_groups.v_1.get(payer_plan_group_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
98
+ def get(payer_plan_group_id:, request_options: nil)
99
+ response = @request_client.conn.get do |req|
100
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
101
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
102
+ req.headers = {
103
+ **(req.headers || {}),
104
+ **@request_client.get_headers,
105
+ **(request_options&.additional_headers || {})
106
+ }.compact
107
+ req.url "#{@request_client.get_url(environment: CandidApi,
108
+ request_options: request_options)}/api/payer-plan-groups/v1/#{payer_plan_group_id}"
109
+ end
110
+ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup.from_json(json_object: response.body)
111
+ end
112
+
113
+ # Create a payer plan group
114
+ #
115
+ # @param request [Hash] Request of type CandidApiClient::PayerPlanGroups::V1::Types::MutablePayerPlanGroup, as a Hash
116
+ # * :plan_group_name (String)
117
+ # * :payer_uuid (String)
118
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
119
+ # @param request_options [CandidApiClient::RequestOptions]
120
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup]
121
+ # @example
122
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
123
+ # api.payer_plan_groups.v_1.create(request: { plan_group_name: "string", payer_uuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", plan_type: SELF_PAY })
124
+ def create(request:, request_options: nil)
125
+ response = @request_client.conn.post do |req|
126
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
127
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
128
+ req.headers = {
129
+ **(req.headers || {}),
130
+ **@request_client.get_headers,
131
+ **(request_options&.additional_headers || {})
132
+ }.compact
133
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
134
+ req.url "#{@request_client.get_url(environment: CandidApi,
135
+ request_options: request_options)}/api/payer-plan-groups/v1"
136
+ end
137
+ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup.from_json(json_object: response.body)
138
+ end
139
+
140
+ # Update any of the fields on a payer plan group
141
+ #
142
+ # @param payer_plan_group_id [String]
143
+ # @param request [Hash] Request of type CandidApiClient::PayerPlanGroups::V1::Types::MutablePayerPlanGroup, as a Hash
144
+ # * :plan_group_name (String)
145
+ # * :payer_uuid (String)
146
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
147
+ # @param request_options [CandidApiClient::RequestOptions]
148
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup]
149
+ # @example
150
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
151
+ # api.payer_plan_groups.v_1.update(payer_plan_group_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { plan_group_name: "string", payer_uuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", plan_type: SELF_PAY })
152
+ def update(payer_plan_group_id:, request:, request_options: nil)
153
+ response = @request_client.conn.put do |req|
154
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
155
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
156
+ req.headers = {
157
+ **(req.headers || {}),
158
+ **@request_client.get_headers,
159
+ **(request_options&.additional_headers || {})
160
+ }.compact
161
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
162
+ req.url "#{@request_client.get_url(environment: CandidApi,
163
+ request_options: request_options)}/api/payer-plan-groups/v1/#{payer_plan_group_id}"
164
+ end
165
+ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup.from_json(json_object: response.body)
166
+ end
167
+
168
+ # Marks the payer plan group as deactivated
169
+ #
170
+ # @param payer_plan_group_id [String]
171
+ # @param request_options [CandidApiClient::RequestOptions]
172
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup]
173
+ # @example
174
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
175
+ # api.payer_plan_groups.v_1.deactivate(payer_plan_group_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
176
+ def deactivate(payer_plan_group_id:, request_options: nil)
177
+ response = @request_client.conn.patch do |req|
178
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
179
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
180
+ req.headers = {
181
+ **(req.headers || {}),
182
+ **@request_client.get_headers,
183
+ **(request_options&.additional_headers || {})
184
+ }.compact
185
+ req.url "#{@request_client.get_url(environment: CandidApi,
186
+ request_options: request_options)}/api/payer-plan-groups/v1/#{payer_plan_group_id}"
187
+ end
188
+ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup.from_json(json_object: response.body)
189
+ end
190
+ end
191
+
192
+ class AsyncV1Client
193
+ # @return [CandidApiClient::AsyncRequestClient]
194
+ attr_reader :request_client
195
+
196
+ # @param request_client [CandidApiClient::AsyncRequestClient]
197
+ # @return [CandidApiClient::PayerPlanGroups::V1::AsyncV1Client]
198
+ def initialize(request_client:)
199
+ @request_client = request_client
200
+ end
201
+
202
+ # Returns all payer plan groups matching filter criteria.
203
+ #
204
+ # @param plan_group_name [String]
205
+ # @param payer_uuid [String]
206
+ # @param payer_id [String]
207
+ # @param plan_type [CandidApiClient::Commons::Types::SourceOfPaymentCode]
208
+ # @param is_active [Boolean]
209
+ # @param payer_plan_group_id [String]
210
+ # @param limit [Integer] Defaults to 100. Cannot exc
211
+ # @param sort_by_similarity [String] If this property is passed, the results will be ordered by those that contain a
212
+ # payer_id, payer_name, plan_group_name, or
213
+ # payer_address most similar to the value passed. This will take precedence over
214
+ # the sort and sort_direction properties. This
215
+ # will always sort in order of most similar to least similar.
216
+ # @param sort [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroupSortField] Defaults to plan_group_name. If sort_by_similarity is passed, that sort will
217
+ # takes precedence over this property.
218
+ # @param sort_direction [CandidApiClient::Commons::Types::SortDirection] Sort direction. Defaults to ascending order if not provided.
219
+ # @param page_token [String]
220
+ # @param request_options [CandidApiClient::RequestOptions]
221
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroupPage]
222
+ # @example
223
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
224
+ # api.payer_plan_groups.v_1.get_multi(
225
+ # plan_group_name: "string",
226
+ # payer_uuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
227
+ # payer_id: "string",
228
+ # plan_type: SELF_PAY,
229
+ # is_active: true,
230
+ # payer_plan_group_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
231
+ # limit: 1,
232
+ # sort_by_similarity: "string",
233
+ # sort: PLAN_GROUP_NAME,
234
+ # sort_direction: ASC,
235
+ # page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"
236
+ # )
237
+ def get_multi(plan_group_name: nil, payer_uuid: nil, payer_id: nil, plan_type: nil, is_active: nil,
238
+ payer_plan_group_id: nil, limit: nil, sort_by_similarity: nil, sort: nil, sort_direction: nil, page_token: nil, request_options: nil)
239
+ Async do
240
+ response = @request_client.conn.get do |req|
241
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
242
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
243
+ req.headers = {
244
+ **(req.headers || {}),
245
+ **@request_client.get_headers,
246
+ **(request_options&.additional_headers || {})
247
+ }.compact
248
+ req.params = {
249
+ **(request_options&.additional_query_parameters || {}),
250
+ "plan_group_name": plan_group_name,
251
+ "payer_uuid": payer_uuid,
252
+ "payer_id": payer_id,
253
+ "plan_type": plan_type,
254
+ "is_active": is_active,
255
+ "payer_plan_group_id": payer_plan_group_id,
256
+ "limit": limit,
257
+ "sort_by_similarity": sort_by_similarity,
258
+ "sort": sort,
259
+ "sort_direction": sort_direction,
260
+ "page_token": page_token
261
+ }.compact
262
+ req.url "#{@request_client.get_url(environment: CandidApi,
263
+ request_options: request_options)}/api/payer-plan-groups/v1"
264
+ end
265
+ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroupPage.from_json(json_object: response.body)
266
+ end
267
+ end
268
+
269
+ # Return a plan group with a given ID.
270
+ #
271
+ # @param payer_plan_group_id [String]
272
+ # @param request_options [CandidApiClient::RequestOptions]
273
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup]
274
+ # @example
275
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
276
+ # api.payer_plan_groups.v_1.get(payer_plan_group_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
277
+ def get(payer_plan_group_id:, request_options: nil)
278
+ Async do
279
+ response = @request_client.conn.get do |req|
280
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
281
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
282
+ req.headers = {
283
+ **(req.headers || {}),
284
+ **@request_client.get_headers,
285
+ **(request_options&.additional_headers || {})
286
+ }.compact
287
+ req.url "#{@request_client.get_url(environment: CandidApi,
288
+ request_options: request_options)}/api/payer-plan-groups/v1/#{payer_plan_group_id}"
289
+ end
290
+ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup.from_json(json_object: response.body)
291
+ end
292
+ end
293
+
294
+ # Create a payer plan group
295
+ #
296
+ # @param request [Hash] Request of type CandidApiClient::PayerPlanGroups::V1::Types::MutablePayerPlanGroup, as a Hash
297
+ # * :plan_group_name (String)
298
+ # * :payer_uuid (String)
299
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
300
+ # @param request_options [CandidApiClient::RequestOptions]
301
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup]
302
+ # @example
303
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
304
+ # api.payer_plan_groups.v_1.create(request: { plan_group_name: "string", payer_uuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", plan_type: SELF_PAY })
305
+ def create(request:, request_options: nil)
306
+ Async do
307
+ response = @request_client.conn.post do |req|
308
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
309
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
310
+ req.headers = {
311
+ **(req.headers || {}),
312
+ **@request_client.get_headers,
313
+ **(request_options&.additional_headers || {})
314
+ }.compact
315
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
316
+ req.url "#{@request_client.get_url(environment: CandidApi,
317
+ request_options: request_options)}/api/payer-plan-groups/v1"
318
+ end
319
+ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup.from_json(json_object: response.body)
320
+ end
321
+ end
322
+
323
+ # Update any of the fields on a payer plan group
324
+ #
325
+ # @param payer_plan_group_id [String]
326
+ # @param request [Hash] Request of type CandidApiClient::PayerPlanGroups::V1::Types::MutablePayerPlanGroup, as a Hash
327
+ # * :plan_group_name (String)
328
+ # * :payer_uuid (String)
329
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
330
+ # @param request_options [CandidApiClient::RequestOptions]
331
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup]
332
+ # @example
333
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
334
+ # api.payer_plan_groups.v_1.update(payer_plan_group_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { plan_group_name: "string", payer_uuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", plan_type: SELF_PAY })
335
+ def update(payer_plan_group_id:, request:, request_options: nil)
336
+ Async do
337
+ response = @request_client.conn.put do |req|
338
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
339
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
340
+ req.headers = {
341
+ **(req.headers || {}),
342
+ **@request_client.get_headers,
343
+ **(request_options&.additional_headers || {})
344
+ }.compact
345
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
346
+ req.url "#{@request_client.get_url(environment: CandidApi,
347
+ request_options: request_options)}/api/payer-plan-groups/v1/#{payer_plan_group_id}"
348
+ end
349
+ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup.from_json(json_object: response.body)
350
+ end
351
+ end
352
+
353
+ # Marks the payer plan group as deactivated
354
+ #
355
+ # @param payer_plan_group_id [String]
356
+ # @param request_options [CandidApiClient::RequestOptions]
357
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup]
358
+ # @example
359
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
360
+ # api.payer_plan_groups.v_1.deactivate(payer_plan_group_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
361
+ def deactivate(payer_plan_group_id:, request_options: nil)
362
+ Async do
363
+ response = @request_client.conn.patch do |req|
364
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
365
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
366
+ req.headers = {
367
+ **(req.headers || {}),
368
+ **@request_client.get_headers,
369
+ **(request_options&.additional_headers || {})
370
+ }.compact
371
+ req.url "#{@request_client.get_url(environment: CandidApi,
372
+ request_options: request_options)}/api/payer-plan-groups/v1/#{payer_plan_group_id}"
373
+ end
374
+ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup.from_json(json_object: response.body)
375
+ end
376
+ end
377
+ end
378
+ end
379
+ end
380
+ end
@@ -0,0 +1,78 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../commons/types/source_of_payment_code"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module PayerPlanGroups
9
+ module V1
10
+ module Types
11
+ class MutablePayerPlanGroup
12
+ # @return [String]
13
+ attr_reader :plan_group_name
14
+ # @return [String]
15
+ attr_reader :payer_uuid
16
+ # @return [CandidApiClient::Commons::Types::SourceOfPaymentCode]
17
+ attr_reader :plan_type
18
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
19
+ attr_reader :additional_properties
20
+ # @return [Object]
21
+ attr_reader :_field_set
22
+ protected :_field_set
23
+
24
+ OMIT = Object.new
25
+
26
+ # @param plan_group_name [String]
27
+ # @param payer_uuid [String]
28
+ # @param plan_type [CandidApiClient::Commons::Types::SourceOfPaymentCode]
29
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::MutablePayerPlanGroup]
31
+ def initialize(plan_group_name:, payer_uuid:, plan_type:, additional_properties: nil)
32
+ @plan_group_name = plan_group_name
33
+ @payer_uuid = payer_uuid
34
+ @plan_type = plan_type
35
+ @additional_properties = additional_properties
36
+ @_field_set = { "plan_group_name": plan_group_name, "payer_uuid": payer_uuid, "plan_type": plan_type }
37
+ end
38
+
39
+ # Deserialize a JSON object to an instance of MutablePayerPlanGroup
40
+ #
41
+ # @param json_object [String]
42
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::MutablePayerPlanGroup]
43
+ def self.from_json(json_object:)
44
+ struct = JSON.parse(json_object, object_class: OpenStruct)
45
+ plan_group_name = struct["plan_group_name"]
46
+ payer_uuid = struct["payer_uuid"]
47
+ plan_type = struct["plan_type"]
48
+ new(
49
+ plan_group_name: plan_group_name,
50
+ payer_uuid: payer_uuid,
51
+ plan_type: plan_type,
52
+ additional_properties: struct
53
+ )
54
+ end
55
+
56
+ # Serialize an instance of MutablePayerPlanGroup to a JSON object
57
+ #
58
+ # @return [String]
59
+ def to_json(*_args)
60
+ @_field_set&.to_json
61
+ end
62
+
63
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
64
+ # hash and check each fields type against the current object's property
65
+ # definitions.
66
+ #
67
+ # @param obj [Object]
68
+ # @return [Void]
69
+ def self.validate_raw(obj:)
70
+ obj.plan_group_name.is_a?(String) != false || raise("Passed value for field obj.plan_group_name is not the expected type, validation failed.")
71
+ obj.payer_uuid.is_a?(String) != false || raise("Passed value for field obj.payer_uuid is not the expected type, validation failed.")
72
+ obj.plan_type.is_a?(CandidApiClient::Commons::Types::SourceOfPaymentCode) != false || raise("Passed value for field obj.plan_type is not the expected type, validation failed.")
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,114 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../payers/v_3/types/payer"
4
+ require_relative "../../../commons/types/source_of_payment_code"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module CandidApiClient
9
+ module PayerPlanGroups
10
+ module V1
11
+ module Types
12
+ class PayerPlanGroup
13
+ # @return [String]
14
+ attr_reader :payer_plan_group_id
15
+ # @return [CandidApiClient::Payers::V3::Types::Payer]
16
+ attr_reader :payer
17
+ # @return [Boolean]
18
+ attr_reader :is_active
19
+ # @return [String]
20
+ attr_reader :plan_group_name
21
+ # @return [String]
22
+ attr_reader :payer_uuid
23
+ # @return [CandidApiClient::Commons::Types::SourceOfPaymentCode]
24
+ attr_reader :plan_type
25
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
26
+ attr_reader :additional_properties
27
+ # @return [Object]
28
+ attr_reader :_field_set
29
+ protected :_field_set
30
+
31
+ OMIT = Object.new
32
+
33
+ # @param payer_plan_group_id [String]
34
+ # @param payer [CandidApiClient::Payers::V3::Types::Payer]
35
+ # @param is_active [Boolean]
36
+ # @param plan_group_name [String]
37
+ # @param payer_uuid [String]
38
+ # @param plan_type [CandidApiClient::Commons::Types::SourceOfPaymentCode]
39
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
40
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup]
41
+ def initialize(payer_plan_group_id:, payer:, is_active:, plan_group_name:, payer_uuid:, plan_type:,
42
+ additional_properties: nil)
43
+ @payer_plan_group_id = payer_plan_group_id
44
+ @payer = payer
45
+ @is_active = is_active
46
+ @plan_group_name = plan_group_name
47
+ @payer_uuid = payer_uuid
48
+ @plan_type = plan_type
49
+ @additional_properties = additional_properties
50
+ @_field_set = {
51
+ "payer_plan_group_id": payer_plan_group_id,
52
+ "payer": payer,
53
+ "is_active": is_active,
54
+ "plan_group_name": plan_group_name,
55
+ "payer_uuid": payer_uuid,
56
+ "plan_type": plan_type
57
+ }
58
+ end
59
+
60
+ # Deserialize a JSON object to an instance of PayerPlanGroup
61
+ #
62
+ # @param json_object [String]
63
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup]
64
+ def self.from_json(json_object:)
65
+ struct = JSON.parse(json_object, object_class: OpenStruct)
66
+ parsed_json = JSON.parse(json_object)
67
+ payer_plan_group_id = struct["payer_plan_group_id"]
68
+ if parsed_json["payer"].nil?
69
+ payer = nil
70
+ else
71
+ payer = parsed_json["payer"].to_json
72
+ payer = CandidApiClient::Payers::V3::Types::Payer.from_json(json_object: payer)
73
+ end
74
+ is_active = struct["is_active"]
75
+ plan_group_name = struct["plan_group_name"]
76
+ payer_uuid = struct["payer_uuid"]
77
+ plan_type = struct["plan_type"]
78
+ new(
79
+ payer_plan_group_id: payer_plan_group_id,
80
+ payer: payer,
81
+ is_active: is_active,
82
+ plan_group_name: plan_group_name,
83
+ payer_uuid: payer_uuid,
84
+ plan_type: plan_type,
85
+ additional_properties: struct
86
+ )
87
+ end
88
+
89
+ # Serialize an instance of PayerPlanGroup to a JSON object
90
+ #
91
+ # @return [String]
92
+ def to_json(*_args)
93
+ @_field_set&.to_json
94
+ end
95
+
96
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
97
+ # hash and check each fields type against the current object's property
98
+ # definitions.
99
+ #
100
+ # @param obj [Object]
101
+ # @return [Void]
102
+ def self.validate_raw(obj:)
103
+ obj.payer_plan_group_id.is_a?(String) != false || raise("Passed value for field obj.payer_plan_group_id is not the expected type, validation failed.")
104
+ CandidApiClient::Payers::V3::Types::Payer.validate_raw(obj: obj.payer)
105
+ obj.is_active.is_a?(Boolean) != false || raise("Passed value for field obj.is_active is not the expected type, validation failed.")
106
+ obj.plan_group_name.is_a?(String) != false || raise("Passed value for field obj.plan_group_name is not the expected type, validation failed.")
107
+ obj.payer_uuid.is_a?(String) != false || raise("Passed value for field obj.payer_uuid is not the expected type, validation failed.")
108
+ obj.plan_type.is_a?(CandidApiClient::Commons::Types::SourceOfPaymentCode) != false || raise("Passed value for field obj.plan_type is not the expected type, validation failed.")
109
+ end
110
+ end
111
+ end
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module CandidApiClient
7
+ module PayerPlanGroups
8
+ module V1
9
+ module Types
10
+ class PayerPlanGroupAlreadyExistsError
11
+ # @return [String]
12
+ attr_reader :message
13
+ # @return [String]
14
+ attr_reader :id
15
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
16
+ attr_reader :additional_properties
17
+ # @return [Object]
18
+ attr_reader :_field_set
19
+ protected :_field_set
20
+
21
+ OMIT = Object.new
22
+
23
+ # @param message [String]
24
+ # @param id [String]
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroupAlreadyExistsError]
27
+ def initialize(message:, id:, additional_properties: nil)
28
+ @message = message
29
+ @id = id
30
+ @additional_properties = additional_properties
31
+ @_field_set = { "message": message, "id": id }
32
+ end
33
+
34
+ # Deserialize a JSON object to an instance of PayerPlanGroupAlreadyExistsError
35
+ #
36
+ # @param json_object [String]
37
+ # @return [CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroupAlreadyExistsError]
38
+ def self.from_json(json_object:)
39
+ struct = JSON.parse(json_object, object_class: OpenStruct)
40
+ message = struct["message"]
41
+ id = struct["id"]
42
+ new(
43
+ message: message,
44
+ id: id,
45
+ additional_properties: struct
46
+ )
47
+ end
48
+
49
+ # Serialize an instance of PayerPlanGroupAlreadyExistsError to a JSON object
50
+ #
51
+ # @return [String]
52
+ def to_json(*_args)
53
+ @_field_set&.to_json
54
+ end
55
+
56
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
57
+ # hash and check each fields type against the current object's property
58
+ # definitions.
59
+ #
60
+ # @param obj [Object]
61
+ # @return [Void]
62
+ def self.validate_raw(obj:)
63
+ obj.message.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
64
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end