Class: Telnyx::Resources::Invoices
- Inherits:
-
Object
- Object
- Telnyx::Resources::Invoices
- Defined in:
- lib/telnyx/resources/invoices.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Invoices
constructor
private
A new instance of Invoices.
-
#list(page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::InvoiceListResponse>
Retrieve a paginated list of invoices.
-
#retrieve(id, action: nil, request_options: {}) ⇒ Telnyx::Models::InvoiceRetrieveResponse
Retrieve a single invoice by its unique identifier.
Constructor Details
#initialize(client:) ⇒ Invoices
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Invoices.
62 63 64 |
# File 'lib/telnyx/resources/invoices.rb', line 62 def initialize(client:) @client = client end |
Instance Method Details
#list(page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::InvoiceListResponse>
Retrieve a paginated list of invoices.
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/telnyx/resources/invoices.rb', line 46 def list(params = {}) parsed, = Telnyx::InvoiceListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "invoices", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::InvoiceListResponse, options: ) end |
#retrieve(id, action: nil, request_options: {}) ⇒ Telnyx::Models::InvoiceRetrieveResponse
Retrieve a single invoice by its unique identifier.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/telnyx/resources/invoices.rb', line 19 def retrieve(id, params = {}) parsed, = Telnyx::InvoiceRetrieveParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["invoices/%1$s", id], query: query, model: Telnyx::Models::InvoiceRetrieveResponse, options: ) end |