Class: Telnyx::Resources::Comments

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/comments.rb

Overview

Number orders

Instance Method Summary collapse

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.

Parameters:



99
100
101
# File 'lib/telnyx/resources/comments.rb', line 99

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

Parameters:

Returns:

See Also:



19
20
21
22
23
24
25
26
27
28
# File 'lib/telnyx/resources/comments.rb', line 19

def create(params = {})
  parsed, options = Telnyx::CommentCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "comments",
    body: parsed,
    model: Telnyx::Models::CommentCreateResponse,
    options: 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

Parameters:

Returns:

See Also:



64
65
66
67
68
69
70
71
72
73
74
# File 'lib/telnyx/resources/comments.rb', line 64

def list(params = {})
  parsed, options = 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: options
  )
end

#mark_as_read(id, request_options: {}) ⇒ Telnyx::Models::CommentMarkAsReadResponse

Mark a comment as read

Parameters:

Returns:

See Also:



87
88
89
90
91
92
93
94
# File 'lib/telnyx/resources/comments.rb', line 87

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

Parameters:

Returns:

See Also:



41
42
43
44
45
46
47
48
# File 'lib/telnyx/resources/comments.rb', line 41

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["comments/%1$s", id],
    model: Telnyx::Models::CommentRetrieveResponse,
    options: params[:request_options]
  )
end