Class: Telnyx::Resources::Comments
- Inherits:
-
Object
- Object
- Telnyx::Resources::Comments
- Defined in:
- lib/telnyx/resources/comments.rb,
sig/telnyx/resources/comments.rbs
Overview
Number orders
Instance Method Summary collapse
-
#create(body: nil, comment_record_id: nil, comment_record_type: nil, request_options: {}) ⇒ Telnyx::Models::CommentCreateResponse
Creates a comment associated with a supported number-order record.
-
#initialize(client:) ⇒ Comments
constructor
private
A new instance of Comments.
-
#list(filter: nil, request_options: {}) ⇒ Telnyx::Models::CommentListResponse
Some parameter documentations has been truncated, see Models::CommentListParams for more details.
-
#mark_as_read(id, request_options: {}) ⇒ Telnyx::Models::CommentMarkAsReadResponse
Marks the specified comment as read.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::CommentRetrieveResponse
Returns the comment identified by
id, including its associated record and comment metadata.
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.
103 104 105 |
# File 'lib/telnyx/resources/comments.rb', line 103 def initialize(client:) @client = client end |
Instance Method Details
#create(body: nil, comment_record_id: nil, comment_record_type: nil, request_options: {}) ⇒ Telnyx::Models::CommentCreateResponse
Creates a comment associated with a supported number-order record. The response contains the created comment.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/telnyx/resources/comments.rb', line 20 def create(params = {}) parsed, = Telnyx::CommentCreateParams.dump_request(params) @client.request( method: :post, path: "comments", body: parsed, model: Telnyx::Models::CommentCreateResponse, options: ) end |
#list(filter: nil, request_options: {}) ⇒ Telnyx::Models::CommentListResponse
Some parameter documentations has been truncated, see Models::CommentListParams for more details.
Returns comments associated with number-order records. Results can be filtered by record type and record ID and include pagination metadata.
67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/telnyx/resources/comments.rb', line 67 def list(params = {}) parsed, = Telnyx::CommentListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "comments", query: query, model: Telnyx::Models::CommentListResponse, options: ) end |
#mark_as_read(id, request_options: {}) ⇒ Telnyx::Models::CommentMarkAsReadResponse
Marks the specified comment as read. The response contains the updated read state for the comment.
91 92 93 94 95 96 97 98 |
# File 'lib/telnyx/resources/comments.rb', line 91 def mark_as_read(id, params = {}) @client.request( method: :patch, path: ["comments/%1$s/read", id], model: Telnyx::Models::CommentMarkAsReadResponse, options: params[:request_options] ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::CommentRetrieveResponse
Returns the comment identified by id, including its associated record and
comment metadata.
43 44 45 46 47 48 49 50 |
# File 'lib/telnyx/resources/comments.rb', line 43 def retrieve(id, params = {}) @client.request( method: :get, path: ["comments/%1$s", id], model: Telnyx::Models::CommentRetrieveResponse, options: params[:request_options] ) end |