Class: CandidApiClient::Invoices::V2::Types::InvoiceDestinationMetadata
- Inherits:
-
Object
- Object
- CandidApiClient::Invoices::V2::Types::InvoiceDestinationMetadata
- Defined in:
- lib/candidhealth/invoices/v_2/types/invoice_destination_metadata.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#destination_status ⇒ String
readonly
The status of the invoice in the third-party service.
-
#invoice_destination ⇒ CandidApiClient::Invoices::V2::Types::InvoiceDestination
readonly
Defines which third-party service this invoice was created in.
-
#source_customer_id ⇒ String
readonly
The id of the customer that the invoice is attributed to in the third-party service.
-
#source_id ⇒ String
readonly
The id of the invoice in the third-party service.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::Invoices::V2::Types::InvoiceDestinationMetadata
Deserialize a JSON object to an instance of InvoiceDestinationMetadata.
-
.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(invoice_destination:, source_id:, source_customer_id:, destination_status: OMIT, additional_properties: nil) ⇒ CandidApiClient::Invoices::V2::Types::InvoiceDestinationMetadata constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of InvoiceDestinationMetadata to a JSON object.
Constructor Details
#initialize(invoice_destination:, source_id:, source_customer_id:, destination_status: OMIT, additional_properties: nil) ⇒ CandidApiClient::Invoices::V2::Types::InvoiceDestinationMetadata
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_destination_metadata.rb', line 36 def initialize(invoice_destination:, source_id:, source_customer_id:, destination_status: OMIT, additional_properties: nil) @invoice_destination = invoice_destination @source_id = source_id @source_customer_id = source_customer_id @destination_status = destination_status if destination_status != OMIT @additional_properties = additional_properties @_field_set = { "invoice_destination": invoice_destination, "source_id": source_id, "source_customer_id": source_customer_id, "destination_status": destination_status }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
22 23 24 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_destination_metadata.rb', line 22 def additional_properties @additional_properties end |
#destination_status ⇒ String (readonly)
Returns The status of the invoice in the third-party service.
20 21 22 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_destination_metadata.rb', line 20 def destination_status @destination_status end |
#invoice_destination ⇒ CandidApiClient::Invoices::V2::Types::InvoiceDestination (readonly)
Returns Defines which third-party service this invoice was created in.
13 14 15 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_destination_metadata.rb', line 13 def invoice_destination @invoice_destination end |
#source_customer_id ⇒ String (readonly)
Returns The id of the customer that the invoice is attributed to in the third-party service.
18 19 20 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_destination_metadata.rb', line 18 def source_customer_id @source_customer_id end |
#source_id ⇒ String (readonly)
Returns The id of the invoice in the third-party service.
15 16 17 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_destination_metadata.rb', line 15 def source_id @source_id end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::Invoices::V2::Types::InvoiceDestinationMetadata
Deserialize a JSON object to an instance of InvoiceDestinationMetadata
57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_destination_metadata.rb', line 57 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) invoice_destination = struct["invoice_destination"] source_id = struct["source_id"] source_customer_id = struct["source_customer_id"] destination_status = struct["destination_status"] new( invoice_destination: invoice_destination, source_id: source_id, source_customer_id: source_customer_id, destination_status: destination_status, 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.
85 86 87 88 89 90 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_destination_metadata.rb', line 85 def self.validate_raw(obj:) obj.invoice_destination.is_a?(CandidApiClient::Invoices::V2::Types::InvoiceDestination) != false || raise("Passed value for field obj.invoice_destination is not the expected type, validation failed.") obj.source_id.is_a?(String) != false || raise("Passed value for field obj.source_id is not the expected type, validation failed.") obj.source_customer_id.is_a?(String) != false || raise("Passed value for field obj.source_customer_id is not the expected type, validation failed.") obj.destination_status&.is_a?(String) != false || raise("Passed value for field obj.destination_status is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of InvoiceDestinationMetadata to a JSON object
75 76 77 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_destination_metadata.rb', line 75 def to_json(*_args) @_field_set&.to_json end |