Class: CandidApiClient::WriteOffs::V1::Types::InsuranceWriteOffCreate
- Inherits:
-
Object
- Object
- CandidApiClient::WriteOffs::V1::Types::InsuranceWriteOffCreate
- Defined in:
- lib/candidhealth/write_offs/v_1/types/insurance_write_off_create.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #amount_cents ⇒ Integer readonly
- #payer_identifier ⇒ CandidApiClient::Payers::V3::Types::PayerIdentifier readonly
- #write_off_note ⇒ String readonly
- #write_off_reason ⇒ CandidApiClient::WriteOffs::V1::Types::InsuranceWriteOffReason readonly
- #write_off_target ⇒ CandidApiClient::WriteOffs::V1::Types::InsuranceWriteOffTarget readonly
- #write_off_timestamp ⇒ DateTime readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::WriteOffs::V1::Types::InsuranceWriteOffCreate
Deserialize a JSON object to an instance of InsuranceWriteOffCreate.
-
.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:, write_off_target:, write_off_timestamp:, write_off_reason:, amount_cents:, write_off_note: OMIT, additional_properties: nil) ⇒ CandidApiClient::WriteOffs::V1::Types::InsuranceWriteOffCreate constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of InsuranceWriteOffCreate to a JSON object.
Constructor Details
#initialize(payer_identifier:, write_off_target:, write_off_timestamp:, write_off_reason:, amount_cents:, write_off_note: OMIT, additional_properties: nil) ⇒ CandidApiClient::WriteOffs::V1::Types::InsuranceWriteOffCreate
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/candidhealth/write_offs/v_1/types/insurance_write_off_create.rb', line 43 def initialize(payer_identifier:, write_off_target:, write_off_timestamp:, write_off_reason:, amount_cents:, write_off_note: OMIT, additional_properties: nil) @payer_identifier = payer_identifier @write_off_target = write_off_target @write_off_timestamp = @write_off_note = write_off_note if write_off_note != OMIT @write_off_reason = write_off_reason @amount_cents = amount_cents @additional_properties = additional_properties @_field_set = { "payer_identifier": payer_identifier, "write_off_target": write_off_target, "write_off_timestamp": , "write_off_note": write_off_note, "write_off_reason": write_off_reason, "amount_cents": amount_cents }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
28 29 30 |
# File 'lib/candidhealth/write_offs/v_1/types/insurance_write_off_create.rb', line 28 def additional_properties @additional_properties end |
#amount_cents ⇒ Integer (readonly)
26 27 28 |
# File 'lib/candidhealth/write_offs/v_1/types/insurance_write_off_create.rb', line 26 def amount_cents @amount_cents end |
#payer_identifier ⇒ CandidApiClient::Payers::V3::Types::PayerIdentifier (readonly)
16 17 18 |
# File 'lib/candidhealth/write_offs/v_1/types/insurance_write_off_create.rb', line 16 def payer_identifier @payer_identifier end |
#write_off_note ⇒ String (readonly)
22 23 24 |
# File 'lib/candidhealth/write_offs/v_1/types/insurance_write_off_create.rb', line 22 def write_off_note @write_off_note end |
#write_off_reason ⇒ CandidApiClient::WriteOffs::V1::Types::InsuranceWriteOffReason (readonly)
24 25 26 |
# File 'lib/candidhealth/write_offs/v_1/types/insurance_write_off_create.rb', line 24 def write_off_reason @write_off_reason end |
#write_off_target ⇒ CandidApiClient::WriteOffs::V1::Types::InsuranceWriteOffTarget (readonly)
18 19 20 |
# File 'lib/candidhealth/write_offs/v_1/types/insurance_write_off_create.rb', line 18 def write_off_target @write_off_target end |
#write_off_timestamp ⇒ DateTime (readonly)
20 21 22 |
# File 'lib/candidhealth/write_offs/v_1/types/insurance_write_off_create.rb', line 20 def @write_off_timestamp end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::WriteOffs::V1::Types::InsuranceWriteOffCreate
Deserialize a JSON object to an instance of InsuranceWriteOffCreate
68 69 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 96 97 98 |
# File 'lib/candidhealth/write_offs/v_1/types/insurance_write_off_create.rb', line 68 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["write_off_target"].nil? write_off_target = nil else write_off_target = parsed_json["write_off_target"].to_json write_off_target = CandidApiClient::WriteOffs::V1::Types::InsuranceWriteOffTarget.from_json(json_object: write_off_target) end = unless parsed_json["write_off_timestamp"].nil? DateTime.parse(parsed_json["write_off_timestamp"]) end write_off_note = struct["write_off_note"] write_off_reason = struct["write_off_reason"] amount_cents = struct["amount_cents"] new( payer_identifier: payer_identifier, write_off_target: write_off_target, write_off_timestamp: , write_off_note: write_off_note, write_off_reason: write_off_reason, amount_cents: amount_cents, 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.
113 114 115 116 117 118 119 120 |
# File 'lib/candidhealth/write_offs/v_1/types/insurance_write_off_create.rb', line 113 def self.validate_raw(obj:) CandidApiClient::Payers::V3::Types::PayerIdentifier.validate_raw(obj: obj.payer_identifier) CandidApiClient::WriteOffs::V1::Types::InsuranceWriteOffTarget.validate_raw(obj: obj.write_off_target) obj..is_a?(DateTime) != false || raise("Passed value for field obj.write_off_timestamp is not the expected type, validation failed.") obj.write_off_note&.is_a?(String) != false || raise("Passed value for field obj.write_off_note is not the expected type, validation failed.") obj.write_off_reason.is_a?(CandidApiClient::WriteOffs::V1::Types::InsuranceWriteOffReason) != false || raise("Passed value for field obj.write_off_reason is not the expected type, validation failed.") obj.amount_cents.is_a?(Integer) != false || raise("Passed value for field obj.amount_cents is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of InsuranceWriteOffCreate to a JSON object
103 104 105 |
# File 'lib/candidhealth/write_offs/v_1/types/insurance_write_off_create.rb', line 103 def to_json(*_args) @_field_set&.to_json end |