Class: CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudicationCreate
- Inherits:
-
Object
- Object
- CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudicationCreate
- Defined in:
- lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.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
- #note ⇒ String readonly
- #payee ⇒ CandidApiClient::Remits::V1::Types::Payee readonly
- #payer_identifier ⇒ CandidApiClient::Payers::V3::Types::PayerIdentifier readonly
- #post_date ⇒ Date readonly
- #remit_draft_id ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudicationCreate
Deserialize a JSON object to an instance of InsuranceAdjudicationCreate.
-
.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(payer_identifier:, payee:, check_date:, claims:, post_date: OMIT, check_number: OMIT, note: OMIT, remit_draft_id: OMIT, additional_properties: nil) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudicationCreate constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of InsuranceAdjudicationCreate to a JSON object.
Constructor Details
#initialize(payer_identifier:, payee:, check_date:, claims:, post_date: OMIT, check_number: OMIT, note: OMIT, remit_draft_id: OMIT, additional_properties: nil) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudicationCreate
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb', line 48 def initialize(payer_identifier:, payee:, check_date:, claims:, post_date: OMIT, check_number: OMIT, note: OMIT, remit_draft_id: OMIT, additional_properties: nil) @payer_identifier = payer_identifier @payee = payee @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 @remit_draft_id = remit_draft_id if remit_draft_id != OMIT @additional_properties = additional_properties @_field_set = { "payer_identifier": payer_identifier, "payee": payee, "post_date": post_date, "check_number": check_number, "check_date": check_date, "note": note, "claims": claims, "remit_draft_id": remit_draft_id }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
31 32 33 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb', line 31 def additional_properties @additional_properties end |
#check_date ⇒ Date (readonly)
23 24 25 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb', line 23 def check_date @check_date end |
#check_number ⇒ String (readonly)
21 22 23 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb', line 21 def check_number @check_number end |
#claims ⇒ Hash{String => Array} (readonly)
27 28 29 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb', line 27 def claims @claims end |
#note ⇒ String (readonly)
25 26 27 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb', line 25 def note @note end |
#payee ⇒ CandidApiClient::Remits::V1::Types::Payee (readonly)
17 18 19 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb', line 17 def payee @payee end |
#payer_identifier ⇒ CandidApiClient::Payers::V3::Types::PayerIdentifier (readonly)
15 16 17 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb', line 15 def payer_identifier @payer_identifier end |
#post_date ⇒ Date (readonly)
19 20 21 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb', line 19 def post_date @post_date end |
#remit_draft_id ⇒ String (readonly)
29 30 31 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb', line 29 def remit_draft_id @remit_draft_id end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudicationCreate
Deserialize a JSON object to an instance of InsuranceAdjudicationCreate
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb', line 77 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["payer_identifier"].nil? payer_identifier = nil else payer_identifier = parsed_json["payer_identifier"].to_json payer_identifier = CandidApiClient::Payers::V3::Types::PayerIdentifier.from_json(json_object: payer_identifier) end if parsed_json["payee"].nil? payee = nil else payee = parsed_json["payee"].to_json payee = CandidApiClient::Remits::V1::Types::Payee.from_json(json_object: payee) end 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::ClaimAdjudicationCreate.from_json(json_object: item) end end remit_draft_id = struct["remit_draft_id"] new( payer_identifier: payer_identifier, payee: payee, post_date: post_date, check_number: check_number, check_date: check_date, note: note, claims: claims, remit_draft_id: remit_draft_id, 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.
129 130 131 132 133 134 135 136 137 138 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb', line 129 def self.validate_raw(obj:) CandidApiClient::Payers::V3::Types::PayerIdentifier.validate_raw(obj: obj.payer_identifier) CandidApiClient::Remits::V1::Types::Payee.validate_raw(obj: obj.payee) 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.") obj.remit_draft_id&.is_a?(String) != false || raise("Passed value for field obj.remit_draft_id is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of InsuranceAdjudicationCreate to a JSON object
119 120 121 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb', line 119 def to_json(*_args) @_field_set&.to_json end |