Class: Telnyx::Resources::Comments
- Inherits:
-
Object
- Object
- Telnyx::Resources::Comments
- Defined in:
- lib/telnyx/resources/comments.rb
Instance Method Summary collapse
-
#create(body: nil, comment_record_id: nil, comment_record_type: nil, request_options: {}) ⇒ Telnyx::Models::CommentCreateResponse
Create a comment.
-
#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
Mark a comment as read.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::CommentRetrieveResponse
Retrieve a comment.
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.
97 98 99 |
# File 'lib/telnyx/resources/comments.rb', line 97 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
Create a comment
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/telnyx/resources/comments.rb', line 18 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.
Retrieve all comments
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/telnyx/resources/comments.rb', line 63 def list(params = {}) parsed, = Telnyx::CommentListParams.dump_request(params) @client.request( method: :get, path: "comments", query: parsed, model: Telnyx::Models::CommentListResponse, options: ) end |
#mark_as_read(id, request_options: {}) ⇒ Telnyx::Models::CommentMarkAsReadResponse
Mark a comment as read
85 86 87 88 89 90 91 92 |
# File 'lib/telnyx/resources/comments.rb', line 85 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
Retrieve a comment
40 41 42 43 44 45 46 47 |
# File 'lib/telnyx/resources/comments.rb', line 40 def retrieve(id, params = {}) @client.request( method: :get, path: ["comments/%1$s", id], model: Telnyx::Models::CommentRetrieveResponse, options: params[:request_options] ) end |