Class: Telnyx::Resources::SubNumberOrdersReport
- Inherits:
-
Object
- Object
- Telnyx::Resources::SubNumberOrdersReport
- Defined in:
- lib/telnyx/resources/sub_number_orders_report.rb
Overview
Number orders
Instance Method Summary collapse
-
#create(country_code: nil, created_at_gt: nil, created_at_lt: nil, customer_reference: nil, order_request_id: nil, status: nil, request_options: {}) ⇒ Telnyx::Models::SubNumberOrdersReportCreateResponse
Create a CSV report for sub number orders.
-
#download(report_id, request_options: {}) ⇒ StringIO
Download the CSV file for a completed sub number orders report.
-
#initialize(client:) ⇒ SubNumberOrdersReport
constructor
private
A new instance of SubNumberOrdersReport.
-
#retrieve(report_id, request_options: {}) ⇒ Telnyx::Models::SubNumberOrdersReportRetrieveResponse
Get the status and details of a sub number orders report.
Constructor Details
#initialize(client:) ⇒ SubNumberOrdersReport
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 SubNumberOrdersReport.
85 86 87 |
# File 'lib/telnyx/resources/sub_number_orders_report.rb', line 85 def initialize(client:) @client = client end |
Instance Method Details
#create(country_code: nil, created_at_gt: nil, created_at_lt: nil, customer_reference: nil, order_request_id: nil, status: nil, request_options: {}) ⇒ Telnyx::Models::SubNumberOrdersReportCreateResponse
Create a CSV report for sub number orders. The report will be generated asynchronously and can be downloaded once complete.
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/telnyx/resources/sub_number_orders_report.rb', line 29 def create(params = {}) parsed, = Telnyx::SubNumberOrdersReportCreateParams.dump_request(params) @client.request( method: :post, path: "sub_number_orders_report", body: parsed, model: Telnyx::Models::SubNumberOrdersReportCreateResponse, options: ) end |
#download(report_id, request_options: {}) ⇒ StringIO
Download the CSV file for a completed sub number orders report. The report status must be ‘success’ before the file can be downloaded.
72 73 74 75 76 77 78 79 80 |
# File 'lib/telnyx/resources/sub_number_orders_report.rb', line 72 def download(report_id, params = {}) @client.request( method: :get, path: ["sub_number_orders_report/%1$s/download", report_id], headers: {"accept" => "text/csv"}, model: Telnyx::Internal::Type::FileInput, options: params[:request_options] ) end |
#retrieve(report_id, request_options: {}) ⇒ Telnyx::Models::SubNumberOrdersReportRetrieveResponse
Get the status and details of a sub number orders report.
51 52 53 54 55 56 57 58 |
# File 'lib/telnyx/resources/sub_number_orders_report.rb', line 51 def retrieve(report_id, params = {}) @client.request( method: :get, path: ["sub_number_orders_report/%1$s", report_id], model: Telnyx::Models::SubNumberOrdersReportRetrieveResponse, options: params[:request_options] ) end |