Class: Telnyx::Resources::PortingOrders::Comments
- Inherits:
-
Object
- Object
- Telnyx::Resources::PortingOrders::Comments
- Defined in:
- lib/telnyx/resources/porting_orders/comments.rb
Overview
Endpoints related to porting orders management.
Instance Method Summary collapse
-
#create(id, body: nil, request_options: {}) ⇒ Telnyx::Models::PortingOrders::CommentCreateResponse
Creates a new comment for a porting order.
-
#initialize(client:) ⇒ Comments
constructor
private
A new instance of Comments.
-
#list(id, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::PortingOrders::CommentListResponse>
Returns a list of all comments of a porting order.
Constructor Details
#initialize(client:) ⇒ Comments
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 Comments.
63 64 65 |
# File 'lib/telnyx/resources/porting_orders/comments.rb', line 63 def initialize(client:) @client = client end |
Instance Method Details
#create(id, body: nil, request_options: {}) ⇒ Telnyx::Models::PortingOrders::CommentCreateResponse
Creates a new comment for a porting order.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/telnyx/resources/porting_orders/comments.rb', line 21 def create(id, params = {}) parsed, = Telnyx::PortingOrders::CommentCreateParams.dump_request(params) @client.request( method: :post, path: ["porting_orders/%1$s/comments", id], body: parsed, model: Telnyx::Models::PortingOrders::CommentCreateResponse, options: ) end |
#list(id, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::PortingOrders::CommentListResponse>
Returns a list of all comments of a porting order.
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/telnyx/resources/porting_orders/comments.rb', line 47 def list(id, params = {}) parsed, = Telnyx::PortingOrders::CommentListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["porting_orders/%1$s/comments", id], query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::PortingOrders::CommentListResponse, options: ) end |