Class: Telnyx::Resources::Rcs::Agents::TestDevices

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/rcs/agents/test_devices.rb,
sig/telnyx/resources/rcs/agents/test_devices.rbs

Overview

Manage RCS agent registration, testing, verification, and launch.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ TestDevices

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

Parameters:



85
86
87
# File 'lib/telnyx/resources/rcs/agents/test_devices.rb', line 85

def initialize(client:)
  @client = client
end

Instance Method Details

#create(id, phone_number:, request_options: {}) ⇒ Telnyx::Models::Rcs::Agents::TestDeviceResponse

Adds an RCS-capable test number after provider agent creation. Repeating the request for a number already attached to the agent returns the existing test device.

Parameters:

  • id (String)

    The Telnyx-assigned agent identifier.

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

Returns:

See Also:



24
25
26
27
28
29
30
31
32
33
# File 'lib/telnyx/resources/rcs/agents/test_devices.rb', line 24

def create(id, params)
  parsed, options = Telnyx::Rcs::Agents::TestDeviceCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["rcs/agents/%1$s/test_devices", id],
    body: parsed,
    model: Telnyx::Rcs::Agents::TestDeviceResponse,
    options: options
  )
end

#delete(test_device_id, id:, request_options: {}) ⇒ nil

Removes a test device from an RCS agent and its provider registration.

Parameters:

  • test_device_id (String)

    The Telnyx-assigned test device identifier.

  • id (String)

    The Telnyx-assigned agent identifier.

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

Returns:

  • (nil)

See Also:



68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/telnyx/resources/rcs/agents/test_devices.rb', line 68

def delete(test_device_id, params)
  parsed, options = Telnyx::Rcs::Agents::TestDeviceDeleteParams.dump_request(params)
  id =
    parsed.delete(:id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["rcs/agents/%1$s/test_devices/%2$s", id, test_device_id],
    model: NilClass,
    options: options
  )
end

#list(id, request_options: {}) ⇒ Array<Telnyx::Models::Rcs::Agents::TestDeviceResponse>

Lists test devices attached to an RCS agent.

Parameters:

  • id (String)

    The Telnyx-assigned agent identifier.

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

Returns:

See Also:



46
47
48
49
50
51
52
53
# File 'lib/telnyx/resources/rcs/agents/test_devices.rb', line 46

def list(id, params = {})
  @client.request(
    method: :get,
    path: ["rcs/agents/%1$s/test_devices", id],
    model: Telnyx::Internal::Type::ArrayOf[Telnyx::Rcs::Agents::TestDeviceResponse],
    options: params[:request_options]
  )
end