Class: ChartMogul::Invoice
- Inherits:
-
APIResource
- Object
- Object
- APIResource
- ChartMogul::Invoice
- Includes:
- API::Actions::Destroy, API::Actions::Retrieve, API::Actions::Update, Concerns::ExternalIdOperations, Concerns::ToggleDisabled
- Defined in:
- lib/chartmogul/invoice.rb
Constant Summary
Constants inherited from APIResource
APIResource::BACKOFF_FACTOR, APIResource::INTERVAL, APIResource::INTERVAL_RANDOMNESS, APIResource::MAX_INTERVAL, APIResource::RETRY_EXCEPTIONS, APIResource::RETRY_STATUSES, APIResource::THREAD_CONNECTION_KEY
Class Method Summary collapse
- .all(options = {}) ⇒ Object
-
.update_status!(data_source_uuid:, invoice_external_id:, status:) ⇒ Object
Update the status of an invoice by external_id.
Instance Method Summary collapse
Methods included from Concerns::ExternalIdOperations
Methods included from Concerns::ToggleDisabled
Methods included from API::Actions::Destroy
Methods included from API::Actions::Update
Methods included from API::Actions::Retrieve
Methods inherited from APIResource
build_connection, build_query_path, connection, #custom_with_query_params!, custom_with_query_params!, extract_query_params, #extract_query_params, handle_other_error, handle_request_error, handling_errors, immutable_keys, json_patch, json_post, json_put, #path_with_query_params, query_params, set_immutable_keys, set_resource_name, set_resource_path, set_resource_root_key, writeable_query_param
Methods inherited from Object
#allowed_for_write?, #assign_all_attributes, #assign_writeable_attributes, attributes, define_private_writer, define_reader, define_writer, #initialize, #instance_attributes, new_from_json, readonly_attr, #serialize_for_write, #serialized_value_for_attr, writeable_attr, writeable_attributes
Constructor Details
This class inherits a constructor from ChartMogul::Object
Class Method Details
.all(options = {}) ⇒ Object
46 47 48 |
# File 'lib/chartmogul/invoice.rb', line 46 def self.all( = {}) Invoices.all() end |
.update_status!(data_source_uuid:, invoice_external_id:, status:) ⇒ Object
Update the status of an invoice by external_id
32 33 34 35 36 |
# File 'lib/chartmogul/invoice.rb', line 32 def self.update_status!(data_source_uuid:, invoice_external_id:, status:) path = "/v1/data_sources/#{CGI.escape(data_source_uuid)}/invoices/#{CGI.escape(invoice_external_id)}/status" handling_errors { json_put(path, { status: status }) } true end |
Instance Method Details
#serialize_line_items ⇒ Object
38 39 40 |
# File 'lib/chartmogul/invoice.rb', line 38 def serialize_line_items line_items.map(&:serialize_for_write) end |
#serialize_transactions ⇒ Object
42 43 44 |
# File 'lib/chartmogul/invoice.rb', line 42 def serialize_transactions transactions.map(&:serialize_for_write) end |