Class: CandidApiClient::Invoices::V2::Types::InvoiceItemInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/invoices/v_2/types/invoice_item_info.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(claim_invoice_items:, unattributed_items:, additional_properties: nil) ⇒ CandidApiClient::Invoices::V2::Types::InvoiceItemInfo

Parameters:



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_itemsHash{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_itemsArray<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

Parameters:

  • json_object (String)

Returns:



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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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

Returns:

  • (String)


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