Class: CandidApiClient::Invoices::V2::Types::InvoiceItemInfo
- Inherits:
-
Object
- Object
- CandidApiClient::Invoices::V2::Types::InvoiceItemInfo
- Defined in:
- lib/candidhealth/invoices/v_2/types/invoice_item_info.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #claim_invoice_items ⇒ Hash{String => CandidApiClient::Invoices::V2::Types::ClaimInvoiceItemInfo} readonly
- #unattributed_items ⇒ Array<CandidApiClient::Invoices::V2::Types::UnattributedInvoiceItem> readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::Invoices::V2::Types::InvoiceItemInfo
Deserialize a JSON object to an instance of InvoiceItemInfo.
-
.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(claim_invoice_items:, unattributed_items:, additional_properties: nil) ⇒ CandidApiClient::Invoices::V2::Types::InvoiceItemInfo constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of InvoiceItemInfo to a JSON object.
Constructor Details
#initialize(claim_invoice_items:, unattributed_items:, additional_properties: nil) ⇒ CandidApiClient::Invoices::V2::Types::InvoiceItemInfo
28 29 30 31 32 33 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_item_info.rb', line 28 def initialize(claim_invoice_items:, unattributed_items:, additional_properties: nil) @claim_invoice_items = claim_invoice_items @unattributed_items = unattributed_items @additional_properties = additional_properties @_field_set = { "claim_invoice_items": claim_invoice_items, "unattributed_items": unattributed_items } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
17 18 19 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_item_info.rb', line 17 def additional_properties @additional_properties end |
#claim_invoice_items ⇒ Hash{String => CandidApiClient::Invoices::V2::Types::ClaimInvoiceItemInfo} (readonly)
13 14 15 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_item_info.rb', line 13 def claim_invoice_items @claim_invoice_items end |
#unattributed_items ⇒ Array<CandidApiClient::Invoices::V2::Types::UnattributedInvoiceItem> (readonly)
15 16 17 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_item_info.rb', line 15 def unattributed_items @unattributed_items end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::Invoices::V2::Types::InvoiceItemInfo
Deserialize a JSON object to an instance of InvoiceItemInfo
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_item_info.rb', line 39 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) claim_invoice_items = parsed_json["claim_invoice_items"]&.transform_values do |value| value = value.to_json CandidApiClient::Invoices::V2::Types::ClaimInvoiceItemInfo.from_json(json_object: value) end unattributed_items = parsed_json["unattributed_items"]&.map do |item| item = item.to_json CandidApiClient::Invoices::V2::Types::UnattributedInvoiceItem.from_json(json_object: item) end new( claim_invoice_items: claim_invoice_items, unattributed_items: unattributed_items, 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.
70 71 72 73 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_item_info.rb', line 70 def self.validate_raw(obj:) obj.claim_invoice_items.is_a?(Hash) != false || raise("Passed value for field obj.claim_invoice_items is not the expected type, validation failed.") obj.unattributed_items.is_a?(Array) != false || raise("Passed value for field obj.unattributed_items is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of InvoiceItemInfo to a JSON object
60 61 62 |
# File 'lib/candidhealth/invoices/v_2/types/invoice_item_info.rb', line 60 def to_json(*_args) @_field_set&.to_json end |