Class: CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentCreate
- Inherits:
-
Object
- Object
- CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentCreate
- Defined in:
- lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment_create.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #allocations ⇒ Array<CandidApiClient::Financials::Types::AllocationCreate> readonly
- #amount_cents ⇒ Integer readonly
- #check_number ⇒ String readonly
- #invoice_id ⇒ String readonly
- #non_insurance_payer_id ⇒ String readonly
- #payment_note ⇒ String readonly
- #payment_timestamp ⇒ DateTime readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentCreate
Deserialize a JSON object to an instance of NonInsurancePayerPaymentCreate.
-
.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(non_insurance_payer_id:, amount_cents:, allocations:, payment_timestamp: OMIT, payment_note: OMIT, check_number: OMIT, invoice_id: OMIT, additional_properties: nil) ⇒ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentCreate constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of NonInsurancePayerPaymentCreate to a JSON object.
Constructor Details
#initialize(non_insurance_payer_id:, amount_cents:, allocations:, payment_timestamp: OMIT, payment_note: OMIT, check_number: OMIT, invoice_id: OMIT, additional_properties: nil) ⇒ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentCreate
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment_create.rb', line 44 def initialize(non_insurance_payer_id:, amount_cents:, allocations:, payment_timestamp: OMIT, payment_note: OMIT, check_number: OMIT, invoice_id: OMIT, additional_properties: nil) @non_insurance_payer_id = non_insurance_payer_id @amount_cents = amount_cents @payment_timestamp = if != OMIT @payment_note = payment_note if payment_note != OMIT @check_number = check_number if check_number != OMIT @allocations = allocations @invoice_id = invoice_id if invoice_id != OMIT @additional_properties = additional_properties @_field_set = { "non_insurance_payer_id": non_insurance_payer_id, "amount_cents": amount_cents, "payment_timestamp": , "payment_note": payment_note, "check_number": check_number, "allocations": allocations, "invoice_id": invoice_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.
28 29 30 |
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment_create.rb', line 28 def additional_properties @additional_properties end |
#allocations ⇒ Array<CandidApiClient::Financials::Types::AllocationCreate> (readonly)
24 25 26 |
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment_create.rb', line 24 def allocations @allocations end |
#amount_cents ⇒ Integer (readonly)
16 17 18 |
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment_create.rb', line 16 def amount_cents @amount_cents end |
#check_number ⇒ String (readonly)
22 23 24 |
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment_create.rb', line 22 def check_number @check_number end |
#invoice_id ⇒ String (readonly)
26 27 28 |
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment_create.rb', line 26 def invoice_id @invoice_id end |
#non_insurance_payer_id ⇒ String (readonly)
14 15 16 |
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment_create.rb', line 14 def non_insurance_payer_id @non_insurance_payer_id end |
#payment_note ⇒ String (readonly)
20 21 22 |
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment_create.rb', line 20 def payment_note @payment_note end |
#payment_timestamp ⇒ DateTime (readonly)
18 19 20 |
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment_create.rb', line 18 def @payment_timestamp end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentCreate
Deserialize a JSON object to an instance of NonInsurancePayerPaymentCreate
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 |
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment_create.rb', line 71 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) non_insurance_payer_id = struct["non_insurance_payer_id"] amount_cents = struct["amount_cents"] = unless parsed_json["payment_timestamp"].nil? DateTime.parse(parsed_json["payment_timestamp"]) end payment_note = struct["payment_note"] check_number = struct["check_number"] allocations = parsed_json["allocations"]&.map do |item| item = item.to_json CandidApiClient::Financials::Types::AllocationCreate.from_json(json_object: item) end invoice_id = struct["invoice_id"] new( non_insurance_payer_id: non_insurance_payer_id, amount_cents: amount_cents, payment_timestamp: , payment_note: payment_note, check_number: check_number, allocations: allocations, invoice_id: invoice_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.
111 112 113 114 115 116 117 118 119 |
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment_create.rb', line 111 def self.validate_raw(obj:) obj.non_insurance_payer_id.is_a?(String) != false || raise("Passed value for field obj.non_insurance_payer_id 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.") obj.&.is_a?(DateTime) != false || raise("Passed value for field obj.payment_timestamp is not the expected type, validation failed.") obj.payment_note&.is_a?(String) != false || raise("Passed value for field obj.payment_note 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.allocations.is_a?(Array) != false || raise("Passed value for field obj.allocations is not the expected type, validation failed.") obj.invoice_id&.is_a?(String) != false || raise("Passed value for field obj.invoice_id is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of NonInsurancePayerPaymentCreate to a JSON object
101 102 103 |
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment_create.rb', line 101 def to_json(*_args) @_field_set&.to_json end |