Class: Telnyx::Resources::Portouts::Events

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

Overview

Number portout operations

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Events

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 Events.

Parameters:



82
83
84
# File 'lib/telnyx/resources/portouts/events.rb', line 82

def initialize(client:)
  @client = client
end

Instance Method Details

#list(filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Portouts::WebhookPortoutStatusChanged, Telnyx::Models::Portouts::WebhookPortoutNewComment, Telnyx::Models::Portouts::WebhookPortoutFocDateChanged>

Some parameter documentations has been truncated, see Models::Portouts::EventListParams for more details.

Returns a list of all port-out events.

Parameters:

Returns:

See Also:



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/telnyx/resources/portouts/events.rb', line 46

def list(params = {})
  parsed, options = Telnyx::Portouts::EventListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "portouts/events",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::Models::Portouts::EventListResponse,
    options: options
  )
end

#republish(id, request_options: {}) ⇒ nil

Republish a specific port-out event.

Parameters:

  • id (String)

    Identifies the port-out event.

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

Returns:

  • (nil)

See Also:



70
71
72
73
74
75
76
77
# File 'lib/telnyx/resources/portouts/events.rb', line 70

def republish(id, params = {})
  @client.request(
    method: :post,
    path: ["portouts/events/%1$s/republish", id],
    model: NilClass,
    options: params[:request_options]
  )
end

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::Portouts::EventRetrieveResponse

Show a specific port-out event.

Parameters:

  • id (String)

    Identifies the port-out event.

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

Returns:

See Also:



19
20
21
22
23
24
25
26
# File 'lib/telnyx/resources/portouts/events.rb', line 19

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