Class: Telnyx::Resources::SubNumberOrdersReport
- Inherits:
-
Object
- Object
- Telnyx::Resources::SubNumberOrdersReport
- Defined in:
- lib/telnyx/resources/sub_number_orders_report.rb
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.
84 85 86 |
# File 'lib/telnyx/resources/sub_number_orders_report.rb', line 84 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.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/telnyx/resources/sub_number_orders_report.rb', line 28 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.
71 72 73 74 75 76 77 78 79 |
# File 'lib/telnyx/resources/sub_number_orders_report.rb', line 71 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.
50 51 52 53 54 55 56 57 |
# File 'lib/telnyx/resources/sub_number_orders_report.rb', line 50 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 |