Class: ChartMogul::CustomerInvoices

Inherits:
APIResource show all
Extended by:
Forwardable
Includes:
API::Actions::All, API::Actions::Create, ChartMogul::Concerns::Pageable2, ChartMogul::Concerns::PageableWithCursor, Enumerable
Defined in:
lib/chartmogul/customer_invoices.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

Instance Method Summary collapse

Methods included from ChartMogul::Concerns::PageableWithCursor

included

Methods included from ChartMogul::Concerns::Pageable2

included

Methods included from API::Actions::Create

#create!, included

Methods included from API::Actions::All

included

Methods inherited from APIResource

connection, handle_other_error, handle_request_error, handling_errors, immutable_keys, set_immutable_keys, set_resource_name, set_resource_path, set_resource_root_key

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(customer_uuid, options = {}) ⇒ Object



26
27
28
# File 'lib/chartmogul/customer_invoices.rb', line 26

def self.all(customer_uuid, options = {})
  super(options.merge(customer_uuid: customer_uuid))
end

.destroy_all!(data_source_uuid, customer_uuid) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/chartmogul/customer_invoices.rb', line 34

def self.destroy_all!(data_source_uuid, customer_uuid)
  path = ChartMogul::ResourcePath.new('v1/data_sources/:data_source_uuid/customers/:customer_uuid/invoices')
  handling_errors do
    connection.delete(path.apply(data_source_uuid: data_source_uuid, customer_uuid: customer_uuid))
  end
  true
end

Instance Method Details

#next(options = {}) ⇒ Object



30
31
32
# File 'lib/chartmogul/customer_invoices.rb', line 30

def next(options = {})
  CustomerInvoices.all(customer_uuid, options.merge(cursor: cursor))
end

#serialize_invoicesObject



22
23
24
# File 'lib/chartmogul/customer_invoices.rb', line 22

def serialize_invoices
  map(&:serialize_for_write)
end