candidhealth 0.24.7 → 0.26.0

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/financials/types/allocation_target.rb +13 -0
  3. data/lib/candidhealth/financials/types/allocation_target_create.rb +12 -0
  4. data/lib/candidhealth/financials/types/appointment_allocation_target.rb +58 -0
  5. data/lib/candidhealth/service_lines/client.rb +30 -0
  6. data/lib/candidhealth/service_lines/v_2/client.rb +229 -0
  7. data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone.rb +279 -0
  8. data/lib/candidhealth/service_lines/v_2/types/service_line_update.rb +281 -0
  9. data/lib/candidhealth/third_party_payer_payments/client.rb +30 -0
  10. data/lib/candidhealth/third_party_payer_payments/v_1/client.rb +360 -0
  11. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment.rb +138 -0
  12. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment_create.rb +124 -0
  13. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment_sort_field.rb +14 -0
  14. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payments_page.rb +88 -0
  15. data/lib/candidhealth/third_party_payer_refunds/client.rb +30 -0
  16. data/lib/candidhealth/third_party_payer_refunds/v_1/client.rb +385 -0
  17. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund.rb +139 -0
  18. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund_create.rb +125 -0
  19. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund_sort_field.rb +14 -0
  20. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refunds_page.rb +88 -0
  21. data/lib/candidhealth/third_party_payers/client.rb +30 -0
  22. data/lib/candidhealth/third_party_payers/v_1/client.rb +375 -0
  23. data/lib/candidhealth/third_party_payers/v_1/types/create_third_party_payer_request.rb +79 -0
  24. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer.rb +100 -0
  25. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_category_update.rb +97 -0
  26. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_description_update.rb +97 -0
  27. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_page.rb +88 -0
  28. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_sort_field.rb +16 -0
  29. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_update_request.rb +92 -0
  30. data/lib/candidhealth/third_party_payers/v_1/types/toggle_third_party_payer_enablement_request.rb +61 -0
  31. data/lib/candidhealth/write_offs/v_1/types/patient_write_off.rb +18 -2
  32. data/lib/candidhealth.rb +28 -0
  33. data/lib/requests.rb +2 -2
  34. data/lib/types_export.rb +19 -0
  35. metadata +29 -2
@@ -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
@@ -0,0 +1,97 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ module CandidApiClient
6
+ module ThirdPartyPayers
7
+ module V1
8
+ module Types
9
+ class ThirdPartyPayerCategoryUpdate
10
+ # @return [Object]
11
+ attr_reader :member
12
+ # @return [String]
13
+ attr_reader :discriminant
14
+
15
+ private_class_method :new
16
+ alias kind_of? is_a?
17
+
18
+ # @param member [Object]
19
+ # @param discriminant [String]
20
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerCategoryUpdate]
21
+ def initialize(member:, discriminant:)
22
+ @member = member
23
+ @discriminant = discriminant
24
+ end
25
+
26
+ # Deserialize a JSON object to an instance of ThirdPartyPayerCategoryUpdate
27
+ #
28
+ # @param json_object [String]
29
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerCategoryUpdate]
30
+ def self.from_json(json_object:)
31
+ struct = JSON.parse(json_object, object_class: OpenStruct)
32
+ member = case struct.type
33
+ when "remove"
34
+ nil
35
+ when "set"
36
+ json_object.value
37
+ else
38
+ json_object
39
+ end
40
+ new(member: member, discriminant: struct.type)
41
+ end
42
+
43
+ # For Union Types, to_json functionality is delegated to the wrapped member.
44
+ #
45
+ # @return [String]
46
+ def to_json(*_args)
47
+ case @discriminant
48
+ when "remove"
49
+ { type: @discriminant }.to_json
50
+ when "set"
51
+ { "type": @discriminant, "value": @member }.to_json
52
+ else
53
+ { "type": @discriminant, value: @member }.to_json
54
+ end
55
+ @member.to_json
56
+ end
57
+
58
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
59
+ # hash and check each fields type against the current object's property
60
+ # definitions.
61
+ #
62
+ # @param obj [Object]
63
+ # @return [Void]
64
+ def self.validate_raw(obj:)
65
+ case obj.type
66
+ when "remove"
67
+ # noop
68
+ when "set"
69
+ obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.")
70
+ else
71
+ raise("Passed value matched no type within the union, validation failed.")
72
+ end
73
+ end
74
+
75
+ # For Union Types, is_a? functionality is delegated to the wrapped member.
76
+ #
77
+ # @param obj [Object]
78
+ # @return [Boolean]
79
+ def is_a?(obj)
80
+ @member.is_a?(obj)
81
+ end
82
+
83
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerCategoryUpdate]
84
+ def self.remove
85
+ new(member: nil, discriminant: "remove")
86
+ end
87
+
88
+ # @param member [String]
89
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerCategoryUpdate]
90
+ def self.set(member:)
91
+ new(member: member, discriminant: "set")
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,97 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ module CandidApiClient
6
+ module ThirdPartyPayers
7
+ module V1
8
+ module Types
9
+ class ThirdPartyPayerDescriptionUpdate
10
+ # @return [Object]
11
+ attr_reader :member
12
+ # @return [String]
13
+ attr_reader :discriminant
14
+
15
+ private_class_method :new
16
+ alias kind_of? is_a?
17
+
18
+ # @param member [Object]
19
+ # @param discriminant [String]
20
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerDescriptionUpdate]
21
+ def initialize(member:, discriminant:)
22
+ @member = member
23
+ @discriminant = discriminant
24
+ end
25
+
26
+ # Deserialize a JSON object to an instance of ThirdPartyPayerDescriptionUpdate
27
+ #
28
+ # @param json_object [String]
29
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerDescriptionUpdate]
30
+ def self.from_json(json_object:)
31
+ struct = JSON.parse(json_object, object_class: OpenStruct)
32
+ member = case struct.type
33
+ when "remove"
34
+ nil
35
+ when "set"
36
+ json_object.value
37
+ else
38
+ json_object
39
+ end
40
+ new(member: member, discriminant: struct.type)
41
+ end
42
+
43
+ # For Union Types, to_json functionality is delegated to the wrapped member.
44
+ #
45
+ # @return [String]
46
+ def to_json(*_args)
47
+ case @discriminant
48
+ when "remove"
49
+ { type: @discriminant }.to_json
50
+ when "set"
51
+ { "type": @discriminant, "value": @member }.to_json
52
+ else
53
+ { "type": @discriminant, value: @member }.to_json
54
+ end
55
+ @member.to_json
56
+ end
57
+
58
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
59
+ # hash and check each fields type against the current object's property
60
+ # definitions.
61
+ #
62
+ # @param obj [Object]
63
+ # @return [Void]
64
+ def self.validate_raw(obj:)
65
+ case obj.type
66
+ when "remove"
67
+ # noop
68
+ when "set"
69
+ obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.")
70
+ else
71
+ raise("Passed value matched no type within the union, validation failed.")
72
+ end
73
+ end
74
+
75
+ # For Union Types, is_a? functionality is delegated to the wrapped member.
76
+ #
77
+ # @param obj [Object]
78
+ # @return [Boolean]
79
+ def is_a?(obj)
80
+ @member.is_a?(obj)
81
+ end
82
+
83
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerDescriptionUpdate]
84
+ def self.remove
85
+ new(member: nil, discriminant: "remove")
86
+ end
87
+
88
+ # @param member [String]
89
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerDescriptionUpdate]
90
+ def self.set(member:)
91
+ new(member: member, discriminant: "set")
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,88 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "third_party_payer"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module ThirdPartyPayers
9
+ module V1
10
+ module Types
11
+ class ThirdPartyPayerPage
12
+ # @return [Array<CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer>]
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::ThirdPartyPayers::V1::Types::ThirdPartyPayer>]
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::ThirdPartyPayers::V1::Types::ThirdPartyPayerPage]
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 ThirdPartyPayerPage
46
+ #
47
+ # @param json_object [String]
48
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerPage]
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::ThirdPartyPayers::V1::Types::ThirdPartyPayer.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 ThirdPartyPayerPage 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,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CandidApiClient
4
+ module ThirdPartyPayers
5
+ module V1
6
+ module Types
7
+ class ThirdPartyPayerSortField
8
+ NAME = "NAME"
9
+ CATEGORY = "CATEGORY"
10
+ ENABLED = "ENABLED"
11
+ UPDATED_AT = "UPDATED_AT"
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,92 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "third_party_payer_description_update"
4
+ require_relative "third_party_payer_category_update"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module CandidApiClient
9
+ module ThirdPartyPayers
10
+ module V1
11
+ module Types
12
+ class ThirdPartyPayerUpdateRequest
13
+ # @return [String] Max 50 characters allowed
14
+ attr_reader :name
15
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerDescriptionUpdate]
16
+ attr_reader :description
17
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerCategoryUpdate]
18
+ attr_reader :category
19
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
20
+ attr_reader :additional_properties
21
+ # @return [Object]
22
+ attr_reader :_field_set
23
+ protected :_field_set
24
+
25
+ OMIT = Object.new
26
+
27
+ # @param name [String] Max 50 characters allowed
28
+ # @param description [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerDescriptionUpdate]
29
+ # @param category [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerCategoryUpdate]
30
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
31
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerUpdateRequest]
32
+ def initialize(name: OMIT, description: OMIT, category: OMIT, additional_properties: nil)
33
+ @name = name if name != OMIT
34
+ @description = description if description != OMIT
35
+ @category = category if category != OMIT
36
+ @additional_properties = additional_properties
37
+ @_field_set = { "name": name, "description": description, "category": category }.reject do |_k, v|
38
+ v == OMIT
39
+ end
40
+ end
41
+
42
+ # Deserialize a JSON object to an instance of ThirdPartyPayerUpdateRequest
43
+ #
44
+ # @param json_object [String]
45
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerUpdateRequest]
46
+ def self.from_json(json_object:)
47
+ struct = JSON.parse(json_object, object_class: OpenStruct)
48
+ parsed_json = JSON.parse(json_object)
49
+ name = struct["name"]
50
+ if parsed_json["description"].nil?
51
+ description = nil
52
+ else
53
+ description = parsed_json["description"].to_json
54
+ description = CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerDescriptionUpdate.from_json(json_object: description)
55
+ end
56
+ if parsed_json["category"].nil?
57
+ category = nil
58
+ else
59
+ category = parsed_json["category"].to_json
60
+ category = CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerCategoryUpdate.from_json(json_object: category)
61
+ end
62
+ new(
63
+ name: name,
64
+ description: description,
65
+ category: category,
66
+ additional_properties: struct
67
+ )
68
+ end
69
+
70
+ # Serialize an instance of ThirdPartyPayerUpdateRequest to a JSON object
71
+ #
72
+ # @return [String]
73
+ def to_json(*_args)
74
+ @_field_set&.to_json
75
+ end
76
+
77
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
78
+ # hash and check each fields type against the current object's property
79
+ # definitions.
80
+ #
81
+ # @param obj [Object]
82
+ # @return [Void]
83
+ def self.validate_raw(obj:)
84
+ obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
85
+ obj.description.nil? || CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerDescriptionUpdate.validate_raw(obj: obj.description)
86
+ obj.category.nil? || CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerCategoryUpdate.validate_raw(obj: obj.category)
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,61 @@
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 ToggleThirdPartyPayerEnablementRequest
11
+ # @return [Boolean]
12
+ attr_reader :enabled
13
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
14
+ attr_reader :additional_properties
15
+ # @return [Object]
16
+ attr_reader :_field_set
17
+ protected :_field_set
18
+
19
+ OMIT = Object.new
20
+
21
+ # @param enabled [Boolean]
22
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
23
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ToggleThirdPartyPayerEnablementRequest]
24
+ def initialize(enabled:, additional_properties: nil)
25
+ @enabled = enabled
26
+ @additional_properties = additional_properties
27
+ @_field_set = { "enabled": enabled }
28
+ end
29
+
30
+ # Deserialize a JSON object to an instance of
31
+ # ToggleThirdPartyPayerEnablementRequest
32
+ #
33
+ # @param json_object [String]
34
+ # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ToggleThirdPartyPayerEnablementRequest]
35
+ def self.from_json(json_object:)
36
+ struct = JSON.parse(json_object, object_class: OpenStruct)
37
+ enabled = struct["enabled"]
38
+ new(enabled: enabled, additional_properties: struct)
39
+ end
40
+
41
+ # Serialize an instance of ToggleThirdPartyPayerEnablementRequest to a JSON object
42
+ #
43
+ # @return [String]
44
+ def to_json(*_args)
45
+ @_field_set&.to_json
46
+ end
47
+
48
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
49
+ # hash and check each fields type against the current object's property
50
+ # definitions.
51
+ #
52
+ # @param obj [Object]
53
+ # @return [Void]
54
+ def self.validate_raw(obj:)
55
+ obj.enabled.is_a?(Boolean) != false || raise("Passed value for field obj.enabled is not the expected type, validation failed.")
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end