Class: Telnyx::Resources::Dir::Comments

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

Overview

Read messages from the Telnyx vetting team and reply with clarifying information.

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:



75
76
77
# File 'lib/telnyx/resources/dir/comments.rb', line 75

def initialize(client:)
  @client = client
end

Instance Method Details

#create(dir_id, content:, parent_comment_id: nil, request_options: {}) ⇒ Telnyx::Models::Dir::CommentCreateResponse

Post a customer comment on a DIR (for example, to respond to reviewer notes). Send only ‘content` (1–5000 chars) and an optional `parent_comment_id`; the server sets the comment type, visibility, and author automatically. The enterprise is resolved server-side from the DIR id.

Parameters:

  • dir_id (String)

    The DIR id. Lowercase UUID.

  • content (String)

    Comment body. 1–5000 characters.

  • parent_comment_id (String)

    Optional parent comment id to thread this reply under.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



27
28
29
30
31
32
33
34
35
36
# File 'lib/telnyx/resources/dir/comments.rb', line 27

def create(dir_id, params)
  parsed, options = Telnyx::Dir::CommentCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["dir/%1$s/comments", dir_id],
    body: parsed,
    model: Telnyx::Models::Dir::CommentCreateResponse,
    options: options
  )
end

#list(dir_id, comment_type: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Dir::CommentListResponse>

Some parameter documentations has been truncated, see Models::Dir::CommentListParams for more details.

List the comments on a DIR. The enterprise is resolved server-side from the DIR id.

Parameters:

  • dir_id (String)

    The DIR id. Lowercase UUID.

  • comment_type (Symbol, Telnyx::Models::Dir::CommentListParams::CommentType)

    Restrict to comments of this category. Customer-visible categories only: interna

  • page_number (Integer)

    1-based page number. Out-of-range values return an empty page with correct meta.

  • page_size (Integer)

    Items per page. Maximum 250; values above are clamped to 250.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/telnyx/resources/dir/comments.rb', line 59

def list(dir_id, params = {})
  parsed, options = Telnyx::Dir::CommentListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["dir/%1$s/comments", dir_id],
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::Models::Dir::CommentListResponse,
    options: options
  )
end