Class: CandidApiClient::ImportInvoice::V1::Types::InvoiceItemInfoUpdate
- Inherits:
-
Object
- Object
- CandidApiClient::ImportInvoice::V1::Types::InvoiceItemInfoUpdate
- Defined in:
- lib/candidhealth/import_invoice/v_1/types/invoice_item_info_update.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #items ⇒ Array<CandidApiClient::Invoices::V2::Types::InvoiceItemCreate> readonly
-
#update_type ⇒ CandidApiClient::ImportInvoice::V1::Types::InvoiceItemUpdateType
readonly
The only supported update operations for invoice items is to either overwrite the entire list of invoice items or to append new invoice items.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::ImportInvoice::V1::Types::InvoiceItemInfoUpdate
Deserialize a JSON object to an instance of InvoiceItemInfoUpdate.
-
.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(update_type:, items:, additional_properties: nil) ⇒ CandidApiClient::ImportInvoice::V1::Types::InvoiceItemInfoUpdate constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of InvoiceItemInfoUpdate to a JSON object.
Constructor Details
#initialize(update_type:, items:, additional_properties: nil) ⇒ CandidApiClient::ImportInvoice::V1::Types::InvoiceItemInfoUpdate
33 34 35 36 37 38 |
# File 'lib/candidhealth/import_invoice/v_1/types/invoice_item_info_update.rb', line 33 def initialize(update_type:, items:, additional_properties: nil) @update_type = update_type @items = items @additional_properties = additional_properties @_field_set = { "update_type": update_type, "items": items } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
20 21 22 |
# File 'lib/candidhealth/import_invoice/v_1/types/invoice_item_info_update.rb', line 20 def additional_properties @additional_properties end |
#items ⇒ Array<CandidApiClient::Invoices::V2::Types::InvoiceItemCreate> (readonly)
18 19 20 |
# File 'lib/candidhealth/import_invoice/v_1/types/invoice_item_info_update.rb', line 18 def items @items end |
#update_type ⇒ CandidApiClient::ImportInvoice::V1::Types::InvoiceItemUpdateType (readonly)
Returns The only supported update operations for invoice items is to either overwrite the entire list of invoice items or to append new invoice items.
16 17 18 |
# File 'lib/candidhealth/import_invoice/v_1/types/invoice_item_info_update.rb', line 16 def update_type @update_type end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::ImportInvoice::V1::Types::InvoiceItemInfoUpdate
Deserialize a JSON object to an instance of InvoiceItemInfoUpdate
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/candidhealth/import_invoice/v_1/types/invoice_item_info_update.rb', line 44 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) update_type = struct["update_type"] items = parsed_json["items"]&.map do |item| item = item.to_json CandidApiClient::Invoices::V2::Types::InvoiceItemCreate.from_json(json_object: item) end new( update_type: update_type, items: 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.
72 73 74 75 |
# File 'lib/candidhealth/import_invoice/v_1/types/invoice_item_info_update.rb', line 72 def self.validate_raw(obj:) obj.update_type.is_a?(CandidApiClient::ImportInvoice::V1::Types::InvoiceItemUpdateType) != false || raise("Passed value for field obj.update_type is not the expected type, validation failed.") obj.items.is_a?(Array) != false || raise("Passed value for field obj.items is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of InvoiceItemInfoUpdate to a JSON object
62 63 64 |
# File 'lib/candidhealth/import_invoice/v_1/types/invoice_item_info_update.rb', line 62 def to_json(*_args) @_field_set&.to_json end |