Class: Telnyx::Resources::PortingOrders::Comments

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

Overview

Endpoints related to porting orders management.

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:



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.

Parameters:

  • id (String)

    Porting Order id

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

Returns:

See Also:



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, options = 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: 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.

Parameters:

  • id (String)

    Porting Order id

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

Returns:

See Also:



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, options = 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: options
  )
end