Class: CandidApiClient::PatientPayments::V3::Types::PatientPayment
- Inherits:
-
Object
- Object
- CandidApiClient::PatientPayments::V3::Types::PatientPayment
- Defined in:
- lib/candidhealth/patient_payments/v_3/types/patient_payment.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
- #encounter_external_id ⇒ String readonly
- #organization_id ⇒ String readonly
- #patient_external_id ⇒ String readonly
- #patient_payment_id ⇒ String readonly
- #payment_name ⇒ String readonly
- #payment_note ⇒ String readonly
- #payment_timestamp ⇒ DateTime readonly
- #service_line_id ⇒ String readonly
- #source ⇒ CandidApiClient::PatientPayments::V3::Types::PatientPaymentSource readonly
- #source_internal_id ⇒ String readonly
- #status ⇒ CandidApiClient::PatientPayments::V3::Types::PatientPaymentStatus readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::PatientPayments::V3::Types::PatientPayment
Deserialize a JSON object to an instance of PatientPayment.
-
.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(patient_payment_id:, organization_id:, source_internal_id:, source:, amount_cents:, payment_timestamp: OMIT, status: OMIT, payment_name: OMIT, payment_note: OMIT, patient_external_id: OMIT, encounter_external_id: OMIT, service_line_id: OMIT, additional_properties: nil) ⇒ CandidApiClient::PatientPayments::V3::Types::PatientPayment constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of PatientPayment to a JSON object.
Constructor Details
#initialize(patient_payment_id:, organization_id:, source_internal_id:, source:, amount_cents:, payment_timestamp: OMIT, status: OMIT, payment_name: OMIT, payment_note: OMIT, patient_external_id: OMIT, encounter_external_id: OMIT, service_line_id: OMIT, additional_properties: nil) ⇒ CandidApiClient::PatientPayments::V3::Types::PatientPayment
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 60 def initialize(patient_payment_id:, organization_id:, source_internal_id:, source:, amount_cents:, payment_timestamp: OMIT, status: OMIT, payment_name: OMIT, payment_note: OMIT, patient_external_id: OMIT, encounter_external_id: OMIT, service_line_id: OMIT, additional_properties: nil) @patient_payment_id = patient_payment_id @organization_id = organization_id @source_internal_id = source_internal_id @source = source @amount_cents = amount_cents @payment_timestamp = if != OMIT @status = status if status != OMIT @payment_name = payment_name if payment_name != OMIT @payment_note = payment_note if payment_note != OMIT @patient_external_id = patient_external_id if patient_external_id != OMIT @encounter_external_id = encounter_external_id if encounter_external_id != OMIT @service_line_id = service_line_id if service_line_id != OMIT @additional_properties = additional_properties @_field_set = { "patient_payment_id": patient_payment_id, "organization_id": organization_id, "source_internal_id": source_internal_id, "source": source, "amount_cents": amount_cents, "payment_timestamp": , "status": status, "payment_name": payment_name, "payment_note": payment_note, "patient_external_id": patient_external_id, "encounter_external_id": encounter_external_id, "service_line_id": service_line_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.
39 40 41 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 39 def additional_properties @additional_properties end |
#amount_cents ⇒ Integer (readonly)
23 24 25 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 23 def amount_cents @amount_cents end |
#encounter_external_id ⇒ String (readonly)
35 36 37 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 35 def encounter_external_id @encounter_external_id end |
#organization_id ⇒ String (readonly)
17 18 19 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 17 def organization_id @organization_id end |
#patient_external_id ⇒ String (readonly)
33 34 35 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 33 def patient_external_id @patient_external_id end |
#patient_payment_id ⇒ String (readonly)
15 16 17 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 15 def patient_payment_id @patient_payment_id end |
#payment_name ⇒ String (readonly)
29 30 31 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 29 def payment_name @payment_name end |
#payment_note ⇒ String (readonly)
31 32 33 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 31 def payment_note @payment_note end |
#payment_timestamp ⇒ DateTime (readonly)
25 26 27 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 25 def @payment_timestamp end |
#service_line_id ⇒ String (readonly)
37 38 39 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 37 def service_line_id @service_line_id end |
#source ⇒ CandidApiClient::PatientPayments::V3::Types::PatientPaymentSource (readonly)
21 22 23 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 21 def source @source end |
#source_internal_id ⇒ String (readonly)
19 20 21 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 19 def source_internal_id @source_internal_id end |
#status ⇒ CandidApiClient::PatientPayments::V3::Types::PatientPaymentStatus (readonly)
27 28 29 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 27 def status @status end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::PatientPayments::V3::Types::PatientPayment
Deserialize a JSON object to an instance of PatientPayment
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 97 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) patient_payment_id = struct["patient_payment_id"] organization_id = struct["organization_id"] source_internal_id = struct["source_internal_id"] source = struct["source"] amount_cents = struct["amount_cents"] = unless parsed_json["payment_timestamp"].nil? DateTime.parse(parsed_json["payment_timestamp"]) end status = struct["status"] payment_name = struct["payment_name"] payment_note = struct["payment_note"] patient_external_id = struct["patient_external_id"] encounter_external_id = struct["encounter_external_id"] service_line_id = struct["service_line_id"] new( patient_payment_id: patient_payment_id, organization_id: organization_id, source_internal_id: source_internal_id, source: source, amount_cents: amount_cents, payment_timestamp: , status: status, payment_name: payment_name, payment_note: payment_note, patient_external_id: patient_external_id, encounter_external_id: encounter_external_id, service_line_id: service_line_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.
144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 144 def self.validate_raw(obj:) obj.patient_payment_id.is_a?(String) != false || raise("Passed value for field obj.patient_payment_id is not the expected type, validation failed.") obj.organization_id.is_a?(String) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.") obj.source_internal_id.is_a?(String) != false || raise("Passed value for field obj.source_internal_id is not the expected type, validation failed.") obj.source.is_a?(CandidApiClient::PatientPayments::V3::Types::PatientPaymentSource) != false || raise("Passed value for field obj.source 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.status&.is_a?(CandidApiClient::PatientPayments::V3::Types::PatientPaymentStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.") obj.payment_name&.is_a?(String) != false || raise("Passed value for field obj.payment_name 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.patient_external_id&.is_a?(String) != false || raise("Passed value for field obj.patient_external_id is not the expected type, validation failed.") obj.encounter_external_id&.is_a?(String) != false || raise("Passed value for field obj.encounter_external_id is not the expected type, validation failed.") obj.service_line_id&.is_a?(String) != false || raise("Passed value for field obj.service_line_id is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of PatientPayment to a JSON object
134 135 136 |
# File 'lib/candidhealth/patient_payments/v_3/types/patient_payment.rb', line 134 def to_json(*_args) @_field_set&.to_json end |