Class: Telnyx::Resources::Messaging::Rcs::Agents

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/messaging/rcs/agents.rb

Overview

Send RCS messages

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Agents

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

Parameters:



84
85
86
# File 'lib/telnyx/resources/messaging/rcs/agents.rb', line 84

def initialize(client:)
  @client = client
end

Instance Method Details

#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::RcsAgent>

List all RCS agents

Parameters:

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

Returns:

See Also:



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

def list(params = {})
  parsed, options = Telnyx::Messaging::Rcs::AgentListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "messaging/rcs/agents",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::RcsAgent,
    options: options
  )
end

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

Retrieve an RCS agent

Parameters:

Returns:

See Also:



20
21
22
23
24
25
26
27
# File 'lib/telnyx/resources/messaging/rcs/agents.rb', line 20

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

#update(id, profile_id: nil, webhook_failover_url: nil, webhook_url: nil, request_options: {}) ⇒ Telnyx::Models::RcsAgentResponse

Modify an RCS agent

Parameters:

  • id (String)

    RCS agent ID

  • profile_id (String, nil)

    Messaging profile ID associated with the RCS Agent

  • webhook_failover_url (String, nil)

    Failover URL to receive RCS events

  • webhook_url (String, nil)

    URL to receive RCS events

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

Returns:

See Also:



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

def update(id, params = {})
  parsed, options = Telnyx::Messaging::Rcs::AgentUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["messaging/rcs/agents/%1$s", id],
    body: parsed,
    model: Telnyx::RcsAgentResponse,
    options: options
  )
end