candidhealth 0.25.0 → 0.26.1

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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/service_lines/v_2/client.rb +4 -40
  3. data/lib/candidhealth/service_lines/v_2/types/service_line.rb +1 -43
  4. data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone.rb +2 -82
  5. data/lib/candidhealth/service_lines/v_2/types/service_line_update.rb +2 -82
  6. data/lib/candidhealth/third_party_payer_payments/client.rb +30 -0
  7. data/lib/candidhealth/third_party_payer_payments/v_1/client.rb +360 -0
  8. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment.rb +138 -0
  9. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment_create.rb +124 -0
  10. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment_sort_field.rb +14 -0
  11. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payments_page.rb +88 -0
  12. data/lib/candidhealth/third_party_payer_refunds/client.rb +30 -0
  13. data/lib/candidhealth/third_party_payer_refunds/v_1/client.rb +385 -0
  14. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund.rb +139 -0
  15. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund_create.rb +125 -0
  16. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund_sort_field.rb +14 -0
  17. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refunds_page.rb +88 -0
  18. data/lib/candidhealth/third_party_payers/client.rb +30 -0
  19. data/lib/candidhealth/third_party_payers/v_1/client.rb +375 -0
  20. data/lib/candidhealth/third_party_payers/v_1/types/create_third_party_payer_request.rb +79 -0
  21. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer.rb +100 -0
  22. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_category_update.rb +97 -0
  23. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_description_update.rb +97 -0
  24. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_page.rb +88 -0
  25. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_sort_field.rb +16 -0
  26. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_update_request.rb +92 -0
  27. data/lib/candidhealth/third_party_payers/v_1/types/toggle_third_party_payer_enablement_request.rb +61 -0
  28. data/lib/candidhealth.rb +21 -0
  29. data/lib/requests.rb +2 -2
  30. data/lib/types_export.rb +16 -4
  31. metadata +23 -5
  32. data/lib/candidhealth/invoices/types/invoice.rb +0 -169
  33. data/lib/candidhealth/invoices/types/invoice_item.rb +0 -68
  34. data/lib/candidhealth/invoices/types/invoice_status.rb +0 -16
  35. data/lib/candidhealth/service_lines/v_2/types/service_line_era_data.rb +0 -78
@@ -0,0 +1,88 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "third_party_payer_refund"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module ThirdPartyPayerRefunds
9
+ module V1
10
+ module Types
11
+ class ThirdPartyPayerRefundsPage
12
+ # @return [Array<CandidApiClient::ThirdPartyPayerRefunds::V1::Types::ThirdPartyPayerRefund>]
13
+ attr_reader :items
14
+ # @return [String]
15
+ attr_reader :prev_page_token
16
+ # @return [String]
17
+ attr_reader :next_page_token
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 items [Array<CandidApiClient::ThirdPartyPayerRefunds::V1::Types::ThirdPartyPayerRefund>]
27
+ # @param prev_page_token [String]
28
+ # @param next_page_token [String]
29
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
+ # @return [CandidApiClient::ThirdPartyPayerRefunds::V1::Types::ThirdPartyPayerRefundsPage]
31
+ def initialize(items:, prev_page_token: OMIT, next_page_token: OMIT, additional_properties: nil)
32
+ @items = items
33
+ @prev_page_token = prev_page_token if prev_page_token != OMIT
34
+ @next_page_token = next_page_token if next_page_token != OMIT
35
+ @additional_properties = additional_properties
36
+ @_field_set = {
37
+ "items": items,
38
+ "prev_page_token": prev_page_token,
39
+ "next_page_token": next_page_token
40
+ }.reject do |_k, v|
41
+ v == OMIT
42
+ end
43
+ end
44
+
45
+ # Deserialize a JSON object to an instance of ThirdPartyPayerRefundsPage
46
+ #
47
+ # @param json_object [String]
48
+ # @return [CandidApiClient::ThirdPartyPayerRefunds::V1::Types::ThirdPartyPayerRefundsPage]
49
+ def self.from_json(json_object:)
50
+ struct = JSON.parse(json_object, object_class: OpenStruct)
51
+ parsed_json = JSON.parse(json_object)
52
+ items = parsed_json["items"]&.map do |item|
53
+ item = item.to_json
54
+ CandidApiClient::ThirdPartyPayerRefunds::V1::Types::ThirdPartyPayerRefund.from_json(json_object: item)
55
+ end
56
+ prev_page_token = struct["prev_page_token"]
57
+ next_page_token = struct["next_page_token"]
58
+ new(
59
+ items: items,
60
+ prev_page_token: prev_page_token,
61
+ next_page_token: next_page_token,
62
+ additional_properties: struct
63
+ )
64
+ end
65
+
66
+ # Serialize an instance of ThirdPartyPayerRefundsPage to a JSON object
67
+ #
68
+ # @return [String]
69
+ def to_json(*_args)
70
+ @_field_set&.to_json
71
+ end
72
+
73
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
74
+ # hash and check each fields type against the current object's property
75
+ # definitions.
76
+ #
77
+ # @param obj [Object]
78
+ # @return [Void]
79
+ def self.validate_raw(obj:)
80
+ obj.items.is_a?(Array) != false || raise("Passed value for field obj.items is not the expected type, validation failed.")
81
+ obj.prev_page_token&.is_a?(String) != false || raise("Passed value for field obj.prev_page_token is not the expected type, validation failed.")
82
+ obj.next_page_token&.is_a?(String) != false || raise("Passed value for field obj.next_page_token is not the expected type, validation failed.")
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../requests"
4
+ require_relative "v_1/client"
5
+
6
+ module CandidApiClient
7
+ module ThirdPartyPayers
8
+ class Client
9
+ # @return [CandidApiClient::ThirdPartyPayers::V1::V1Client]
10
+ attr_reader :v_1
11
+
12
+ # @param request_client [CandidApiClient::RequestClient]
13
+ # @return [CandidApiClient::ThirdPartyPayers::Client]
14
+ def initialize(request_client:)
15
+ @v_1 = CandidApiClient::ThirdPartyPayers::V1::V1Client.new(request_client: request_client)
16
+ end
17
+ end
18
+
19
+ class AsyncClient
20
+ # @return [CandidApiClient::ThirdPartyPayers::V1::AsyncV1Client]
21
+ attr_reader :v_1
22
+
23
+ # @param request_client [CandidApiClient::AsyncRequestClient]
24
+ # @return [CandidApiClient::ThirdPartyPayers::AsyncClient]
25
+ def initialize(request_client:)
26
+ @v_1 = CandidApiClient::ThirdPartyPayers::V1::AsyncV1Client.new(request_client: request_client)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,375 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../requests"
4
+ require_relative "types/create_third_party_payer_request"
5
+ require_relative "types/third_party_payer"
6
+ require_relative "types/toggle_third_party_payer_enablement_request"
7
+ require_relative "types/third_party_payer_sort_field"
8
+ require_relative "../../commons/types/sort_direction"
9
+ require_relative "types/third_party_payer_page"
10
+ require_relative "types/third_party_payer_update_request"
11
+ require "async"
12
+
13
+ module CandidApiClient
14
+ module ThirdPartyPayers
15
+ module V1
16
+ class V1Client
17
+ # @return [CandidApiClient::RequestClient]
18
+ attr_reader :request_client
19
+
20
+ # @param request_client [CandidApiClient::RequestClient]
21
+ # @return [CandidApiClient::ThirdPartyPayers::V1::V1Client]
22
+ def initialize(request_client:)
23
+ @request_client = request_client
24
+ end
25
+
26
+ # @param request [Hash] Request of type CandidApiClient::ThirdPartyPayers::V1::Types::CreateThirdPartyPayerRequest, as a Hash
27
+ # * :name (String)
28
+ # * :description (String)
29
+ # * :category (String)
30
+ # @param request_options [CandidApiClient::RequestOptions]
31
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
32
+ # @example
33
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
34
+ # api.third_party_payers.v_1.create(request: { name: "string", description: "string", category: "string" })
35
+ def create(request:, request_options: nil)
36
+ response = @request_client.conn.post do |req|
37
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
38
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
39
+ req.headers = {
40
+ **(req.headers || {}),
41
+ **@request_client.get_headers,
42
+ **(request_options&.additional_headers || {})
43
+ }.compact
44
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
45
+ req.url "#{@request_client.get_url(environment: CandidApi,
46
+ request_options: request_options)}/api/third-party-payers/v1"
47
+ end
48
+ CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
49
+ end
50
+
51
+ # @param third_party_payer_id [String]
52
+ # @param request [Hash] Request of type CandidApiClient::ThirdPartyPayers::V1::Types::ToggleThirdPartyPayerEnablementRequest, as a Hash
53
+ # * :enabled (Boolean)
54
+ # @param request_options [CandidApiClient::RequestOptions]
55
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
56
+ # @example
57
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
58
+ # api.third_party_payers.v_1.toggle_enablement(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { enabled: true })
59
+ def toggle_enablement(third_party_payer_id:, request:, request_options: nil)
60
+ response = @request_client.conn.patch do |req|
61
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
62
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
63
+ req.headers = {
64
+ **(req.headers || {}),
65
+ **@request_client.get_headers,
66
+ **(request_options&.additional_headers || {})
67
+ }.compact
68
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
69
+ req.url "#{@request_client.get_url(environment: CandidApi,
70
+ request_options: request_options)}/api/third-party-payers/v1/#{third_party_payer_id}/toggle_enablement"
71
+ end
72
+ CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
73
+ end
74
+
75
+ # @param name [String]
76
+ # @param category [String]
77
+ # @param enabled [Boolean]
78
+ # @param sort [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerSortField]
79
+ # @param sort_direction [CandidApiClient::Commons::Types::SortDirection]
80
+ # @param limit [Integer] Defaults to 100
81
+ # @param page_token [String]
82
+ # @param request_options [CandidApiClient::RequestOptions]
83
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerPage]
84
+ # @example
85
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
86
+ # api.third_party_payers.v_1.get_multi(
87
+ # name: "string",
88
+ # category: "string",
89
+ # enabled: true,
90
+ # sort: NAME,
91
+ # sort_direction: ASC,
92
+ # limit: 1,
93
+ # page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"
94
+ # )
95
+ def get_multi(name: nil, category: nil, enabled: nil, sort: nil, sort_direction: nil, limit: nil,
96
+ page_token: nil, request_options: nil)
97
+ response = @request_client.conn.get do |req|
98
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
99
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
100
+ req.headers = {
101
+ **(req.headers || {}),
102
+ **@request_client.get_headers,
103
+ **(request_options&.additional_headers || {})
104
+ }.compact
105
+ req.params = {
106
+ **(request_options&.additional_query_parameters || {}),
107
+ "name": name,
108
+ "category": category,
109
+ "enabled": enabled,
110
+ "sort": sort,
111
+ "sort_direction": sort_direction,
112
+ "limit": limit,
113
+ "page_token": page_token
114
+ }.compact
115
+ req.url "#{@request_client.get_url(environment: CandidApi,
116
+ request_options: request_options)}/api/third-party-payers/v1"
117
+ end
118
+ CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerPage.from_json(json_object: response.body)
119
+ end
120
+
121
+ # @param third_party_payer_id [String]
122
+ # @param request_options [CandidApiClient::RequestOptions]
123
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
124
+ # @example
125
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
126
+ # api.third_party_payers.v_1.get(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
127
+ def get(third_party_payer_id:, request_options: nil)
128
+ response = @request_client.conn.get do |req|
129
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
130
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
131
+ req.headers = {
132
+ **(req.headers || {}),
133
+ **@request_client.get_headers,
134
+ **(request_options&.additional_headers || {})
135
+ }.compact
136
+ req.url "#{@request_client.get_url(environment: CandidApi,
137
+ request_options: request_options)}/api/third-party-payers/v1/#{third_party_payer_id}"
138
+ end
139
+ CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
140
+ end
141
+
142
+ # @param third_party_payer_id [String]
143
+ # @param request [Hash] Request of type CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerUpdateRequest, as a Hash
144
+ # * :name (String)
145
+ # * :description (Hash)
146
+ # * :category (Hash)
147
+ # @param request_options [CandidApiClient::RequestOptions]
148
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
149
+ # @example
150
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
151
+ # api.third_party_payers.v_1.update(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { name: "string" })
152
+ def update(third_party_payer_id:, request:, request_options: nil)
153
+ response = @request_client.conn.patch 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/third-party-payers/v1/#{third_party_payer_id}"
164
+ end
165
+ CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
166
+ end
167
+
168
+ # @param third_party_payer_id [String]
169
+ # @param request_options [CandidApiClient::RequestOptions]
170
+ # @return [Void]
171
+ # @example
172
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
173
+ # api.third_party_payers.v_1.delete(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
174
+ def delete(third_party_payer_id:, request_options: nil)
175
+ @request_client.conn.delete do |req|
176
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
177
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
178
+ req.headers = {
179
+ **(req.headers || {}),
180
+ **@request_client.get_headers,
181
+ **(request_options&.additional_headers || {})
182
+ }.compact
183
+ req.url "#{@request_client.get_url(environment: CandidApi,
184
+ request_options: request_options)}/api/third-party-payers/v1/#{third_party_payer_id}"
185
+ end
186
+ end
187
+ end
188
+
189
+ class AsyncV1Client
190
+ # @return [CandidApiClient::AsyncRequestClient]
191
+ attr_reader :request_client
192
+
193
+ # @param request_client [CandidApiClient::AsyncRequestClient]
194
+ # @return [CandidApiClient::ThirdPartyPayers::V1::AsyncV1Client]
195
+ def initialize(request_client:)
196
+ @request_client = request_client
197
+ end
198
+
199
+ # @param request [Hash] Request of type CandidApiClient::ThirdPartyPayers::V1::Types::CreateThirdPartyPayerRequest, as a Hash
200
+ # * :name (String)
201
+ # * :description (String)
202
+ # * :category (String)
203
+ # @param request_options [CandidApiClient::RequestOptions]
204
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
205
+ # @example
206
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
207
+ # api.third_party_payers.v_1.create(request: { name: "string", description: "string", category: "string" })
208
+ def create(request:, request_options: nil)
209
+ Async do
210
+ response = @request_client.conn.post do |req|
211
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
212
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
213
+ req.headers = {
214
+ **(req.headers || {}),
215
+ **@request_client.get_headers,
216
+ **(request_options&.additional_headers || {})
217
+ }.compact
218
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
219
+ req.url "#{@request_client.get_url(environment: CandidApi,
220
+ request_options: request_options)}/api/third-party-payers/v1"
221
+ end
222
+ CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
223
+ end
224
+ end
225
+
226
+ # @param third_party_payer_id [String]
227
+ # @param request [Hash] Request of type CandidApiClient::ThirdPartyPayers::V1::Types::ToggleThirdPartyPayerEnablementRequest, as a Hash
228
+ # * :enabled (Boolean)
229
+ # @param request_options [CandidApiClient::RequestOptions]
230
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
231
+ # @example
232
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
233
+ # api.third_party_payers.v_1.toggle_enablement(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { enabled: true })
234
+ def toggle_enablement(third_party_payer_id:, request:, request_options: nil)
235
+ Async do
236
+ response = @request_client.conn.patch do |req|
237
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
238
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
239
+ req.headers = {
240
+ **(req.headers || {}),
241
+ **@request_client.get_headers,
242
+ **(request_options&.additional_headers || {})
243
+ }.compact
244
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
245
+ req.url "#{@request_client.get_url(environment: CandidApi,
246
+ request_options: request_options)}/api/third-party-payers/v1/#{third_party_payer_id}/toggle_enablement"
247
+ end
248
+ CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
249
+ end
250
+ end
251
+
252
+ # @param name [String]
253
+ # @param category [String]
254
+ # @param enabled [Boolean]
255
+ # @param sort [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerSortField]
256
+ # @param sort_direction [CandidApiClient::Commons::Types::SortDirection]
257
+ # @param limit [Integer] Defaults to 100
258
+ # @param page_token [String]
259
+ # @param request_options [CandidApiClient::RequestOptions]
260
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerPage]
261
+ # @example
262
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
263
+ # api.third_party_payers.v_1.get_multi(
264
+ # name: "string",
265
+ # category: "string",
266
+ # enabled: true,
267
+ # sort: NAME,
268
+ # sort_direction: ASC,
269
+ # limit: 1,
270
+ # page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"
271
+ # )
272
+ def get_multi(name: nil, category: nil, enabled: nil, sort: nil, sort_direction: nil, limit: nil,
273
+ page_token: nil, request_options: nil)
274
+ Async do
275
+ response = @request_client.conn.get do |req|
276
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
277
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
278
+ req.headers = {
279
+ **(req.headers || {}),
280
+ **@request_client.get_headers,
281
+ **(request_options&.additional_headers || {})
282
+ }.compact
283
+ req.params = {
284
+ **(request_options&.additional_query_parameters || {}),
285
+ "name": name,
286
+ "category": category,
287
+ "enabled": enabled,
288
+ "sort": sort,
289
+ "sort_direction": sort_direction,
290
+ "limit": limit,
291
+ "page_token": page_token
292
+ }.compact
293
+ req.url "#{@request_client.get_url(environment: CandidApi,
294
+ request_options: request_options)}/api/third-party-payers/v1"
295
+ end
296
+ CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerPage.from_json(json_object: response.body)
297
+ end
298
+ end
299
+
300
+ # @param third_party_payer_id [String]
301
+ # @param request_options [CandidApiClient::RequestOptions]
302
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
303
+ # @example
304
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
305
+ # api.third_party_payers.v_1.get(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
306
+ def get(third_party_payer_id:, request_options: nil)
307
+ Async do
308
+ response = @request_client.conn.get do |req|
309
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
310
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
311
+ req.headers = {
312
+ **(req.headers || {}),
313
+ **@request_client.get_headers,
314
+ **(request_options&.additional_headers || {})
315
+ }.compact
316
+ req.url "#{@request_client.get_url(environment: CandidApi,
317
+ request_options: request_options)}/api/third-party-payers/v1/#{third_party_payer_id}"
318
+ end
319
+ CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
320
+ end
321
+ end
322
+
323
+ # @param third_party_payer_id [String]
324
+ # @param request [Hash] Request of type CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerUpdateRequest, as a Hash
325
+ # * :name (String)
326
+ # * :description (Hash)
327
+ # * :category (Hash)
328
+ # @param request_options [CandidApiClient::RequestOptions]
329
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
330
+ # @example
331
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
332
+ # api.third_party_payers.v_1.update(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { name: "string" })
333
+ def update(third_party_payer_id:, request:, request_options: nil)
334
+ Async do
335
+ response = @request_client.conn.patch do |req|
336
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
337
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
338
+ req.headers = {
339
+ **(req.headers || {}),
340
+ **@request_client.get_headers,
341
+ **(request_options&.additional_headers || {})
342
+ }.compact
343
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
344
+ req.url "#{@request_client.get_url(environment: CandidApi,
345
+ request_options: request_options)}/api/third-party-payers/v1/#{third_party_payer_id}"
346
+ end
347
+ CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
348
+ end
349
+ end
350
+
351
+ # @param third_party_payer_id [String]
352
+ # @param request_options [CandidApiClient::RequestOptions]
353
+ # @return [Void]
354
+ # @example
355
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
356
+ # api.third_party_payers.v_1.delete(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
357
+ def delete(third_party_payer_id:, request_options: nil)
358
+ Async do
359
+ @request_client.conn.delete do |req|
360
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
361
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
362
+ req.headers = {
363
+ **(req.headers || {}),
364
+ **@request_client.get_headers,
365
+ **(request_options&.additional_headers || {})
366
+ }.compact
367
+ req.url "#{@request_client.get_url(environment: CandidApi,
368
+ request_options: request_options)}/api/third-party-payers/v1/#{third_party_payer_id}"
369
+ end
370
+ end
371
+ end
372
+ end
373
+ end
374
+ end
375
+ end
@@ -0,0 +1,79 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module CandidApiClient
7
+ module ThirdPartyPayers
8
+ module V1
9
+ module Types
10
+ class CreateThirdPartyPayerRequest
11
+ # @return [String] Max 50 characters allowed
12
+ attr_reader :name
13
+ # @return [String] Max 255 characters allowed
14
+ attr_reader :description
15
+ # @return [String] Max 255 characters allowed
16
+ attr_reader :category
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param name [String] Max 50 characters allowed
26
+ # @param description [String] Max 255 characters allowed
27
+ # @param category [String] Max 255 characters allowed
28
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
29
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::CreateThirdPartyPayerRequest]
30
+ def initialize(name:, description: OMIT, category: OMIT, additional_properties: nil)
31
+ @name = name
32
+ @description = description if description != OMIT
33
+ @category = category if category != OMIT
34
+ @additional_properties = additional_properties
35
+ @_field_set = { "name": name, "description": description, "category": category }.reject do |_k, v|
36
+ v == OMIT
37
+ end
38
+ end
39
+
40
+ # Deserialize a JSON object to an instance of CreateThirdPartyPayerRequest
41
+ #
42
+ # @param json_object [String]
43
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::CreateThirdPartyPayerRequest]
44
+ def self.from_json(json_object:)
45
+ struct = JSON.parse(json_object, object_class: OpenStruct)
46
+ name = struct["name"]
47
+ description = struct["description"]
48
+ category = struct["category"]
49
+ new(
50
+ name: name,
51
+ description: description,
52
+ category: category,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+
57
+ # Serialize an instance of CreateThirdPartyPayerRequest to a JSON object
58
+ #
59
+ # @return [String]
60
+ def to_json(*_args)
61
+ @_field_set&.to_json
62
+ end
63
+
64
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
65
+ # hash and check each fields type against the current object's property
66
+ # definitions.
67
+ #
68
+ # @param obj [Object]
69
+ # @return [Void]
70
+ def self.validate_raw(obj:)
71
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
72
+ obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
73
+ obj.category&.is_a?(String) != false || raise("Passed value for field obj.category is not the expected type, validation failed.")
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,100 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module CandidApiClient
7
+ module ThirdPartyPayers
8
+ module V1
9
+ module Types
10
+ class ThirdPartyPayer
11
+ # @return [String]
12
+ attr_reader :third_party_payer_id
13
+ # @return [String]
14
+ attr_reader :name
15
+ # @return [String]
16
+ attr_reader :description
17
+ # @return [String]
18
+ attr_reader :category
19
+ # @return [Boolean]
20
+ attr_reader :enabled
21
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
22
+ attr_reader :additional_properties
23
+ # @return [Object]
24
+ attr_reader :_field_set
25
+ protected :_field_set
26
+
27
+ OMIT = Object.new
28
+
29
+ # @param third_party_payer_id [String]
30
+ # @param name [String]
31
+ # @param description [String]
32
+ # @param category [String]
33
+ # @param enabled [Boolean]
34
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
35
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
36
+ def initialize(third_party_payer_id:, name:, enabled:, description: OMIT, category: OMIT,
37
+ additional_properties: nil)
38
+ @third_party_payer_id = third_party_payer_id
39
+ @name = name
40
+ @description = description if description != OMIT
41
+ @category = category if category != OMIT
42
+ @enabled = enabled
43
+ @additional_properties = additional_properties
44
+ @_field_set = {
45
+ "third_party_payer_id": third_party_payer_id,
46
+ "name": name,
47
+ "description": description,
48
+ "category": category,
49
+ "enabled": enabled
50
+ }.reject do |_k, v|
51
+ v == OMIT
52
+ end
53
+ end
54
+
55
+ # Deserialize a JSON object to an instance of ThirdPartyPayer
56
+ #
57
+ # @param json_object [String]
58
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
59
+ def self.from_json(json_object:)
60
+ struct = JSON.parse(json_object, object_class: OpenStruct)
61
+ third_party_payer_id = struct["third_party_payer_id"]
62
+ name = struct["name"]
63
+ description = struct["description"]
64
+ category = struct["category"]
65
+ enabled = struct["enabled"]
66
+ new(
67
+ third_party_payer_id: third_party_payer_id,
68
+ name: name,
69
+ description: description,
70
+ category: category,
71
+ enabled: enabled,
72
+ additional_properties: struct
73
+ )
74
+ end
75
+
76
+ # Serialize an instance of ThirdPartyPayer to a JSON object
77
+ #
78
+ # @return [String]
79
+ def to_json(*_args)
80
+ @_field_set&.to_json
81
+ end
82
+
83
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
84
+ # hash and check each fields type against the current object's property
85
+ # definitions.
86
+ #
87
+ # @param obj [Object]
88
+ # @return [Void]
89
+ def self.validate_raw(obj:)
90
+ obj.third_party_payer_id.is_a?(String) != false || raise("Passed value for field obj.third_party_payer_id is not the expected type, validation failed.")
91
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
92
+ obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
93
+ obj.category&.is_a?(String) != false || raise("Passed value for field obj.category is not the expected type, validation failed.")
94
+ obj.enabled.is_a?(Boolean) != false || raise("Passed value for field obj.enabled is not the expected type, validation failed.")
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end