Class: CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudication
- Inherits:
-
Object
- Object
- CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudication
- Defined in:
- lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #check_date ⇒ Date readonly
- #check_number ⇒ String readonly
- #claims ⇒ Hash{String => Array} readonly
- #insurance_adjudication_id ⇒ String readonly
- #note ⇒ String readonly
- #payer_uuid ⇒ String readonly
- #post_date ⇒ Date readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudication
Deserialize a JSON object to an instance of InsuranceAdjudication.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(insurance_adjudication_id:, payer_uuid:, check_date:, claims:, post_date: OMIT, check_number: OMIT, note: OMIT, additional_properties: nil) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudication constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of InsuranceAdjudication to a JSON object.
Constructor Details
#initialize(insurance_adjudication_id:, payer_uuid:, check_date:, claims:, post_date: OMIT, check_number: OMIT, note: OMIT, additional_properties: nil) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudication
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 43 def initialize(insurance_adjudication_id:, payer_uuid:, check_date:, claims:, post_date: OMIT, check_number: OMIT, note: OMIT, additional_properties: nil) @insurance_adjudication_id = insurance_adjudication_id @payer_uuid = payer_uuid @post_date = post_date if post_date != OMIT @check_number = check_number if check_number != OMIT @check_date = check_date @note = note if note != OMIT @claims = claims @additional_properties = additional_properties @_field_set = { "insurance_adjudication_id": insurance_adjudication_id, "payer_uuid": payer_uuid, "post_date": post_date, "check_number": check_number, "check_date": check_date, "note": note, "claims": claims }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
27 28 29 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 27 def additional_properties @additional_properties end |
#check_date ⇒ Date (readonly)
21 22 23 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 21 def check_date @check_date end |
#check_number ⇒ String (readonly)
19 20 21 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 19 def check_number @check_number end |
#claims ⇒ Hash{String => Array} (readonly)
25 26 27 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 25 def claims @claims end |
#insurance_adjudication_id ⇒ String (readonly)
13 14 15 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 13 def insurance_adjudication_id @insurance_adjudication_id end |
#note ⇒ String (readonly)
23 24 25 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 23 def note @note end |
#payer_uuid ⇒ String (readonly)
15 16 17 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 15 def payer_uuid @payer_uuid end |
#post_date ⇒ Date (readonly)
17 18 19 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 17 def post_date @post_date end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudication
Deserialize a JSON object to an instance of InsuranceAdjudication
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 70 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) insurance_adjudication_id = struct["insurance_adjudication_id"] payer_uuid = struct["payer_uuid"] post_date = (Date.parse(parsed_json["post_date"]) unless parsed_json["post_date"].nil?) check_number = struct["check_number"] check_date = (Date.parse(parsed_json["check_date"]) unless parsed_json["check_date"].nil?) note = struct["note"] claims = parsed_json["claims"]&.transform_values do |value| value&.map do |item| item = item.to_json CandidApiClient::InsuranceAdjudications::V1::Types::ClaimAdjudication.from_json(json_object: item) end end new( insurance_adjudication_id: insurance_adjudication_id, payer_uuid: payer_uuid, post_date: post_date, check_number: check_number, check_date: check_date, note: note, claims: claims, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
110 111 112 113 114 115 116 117 118 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 110 def self.validate_raw(obj:) obj.insurance_adjudication_id.is_a?(String) != false || raise("Passed value for field obj.insurance_adjudication_id is not the expected type, validation failed.") obj.payer_uuid.is_a?(String) != false || raise("Passed value for field obj.payer_uuid is not the expected type, validation failed.") obj.post_date&.is_a?(Date) != false || raise("Passed value for field obj.post_date is not the expected type, validation failed.") obj.check_number&.is_a?(String) != false || raise("Passed value for field obj.check_number is not the expected type, validation failed.") obj.check_date.is_a?(Date) != false || raise("Passed value for field obj.check_date is not the expected type, validation failed.") obj.note&.is_a?(String) != false || raise("Passed value for field obj.note is not the expected type, validation failed.") obj.claims.is_a?(Hash) != false || raise("Passed value for field obj.claims is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of InsuranceAdjudication to a JSON object
100 101 102 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 100 def to_json(*_args) @_field_set&.to_json end |