Class: Sendly::RcsAgentsResource

Inherits:
Object
  • Object
show all
Defined in:
lib/sendly/rcs_resource.rb

Overview

List the RCS agents registered for your workspace.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ RcsAgentsResource

Returns a new instance of RcsAgentsResource.



140
141
142
# File 'lib/sendly/rcs_resource.rb', line 140

def initialize(client)
  @client = client
end

Instance Method Details

#listHash

List your RCS agents, newest first. An empty list means no agent is set up yet — contact support to register an RCS agent for your brand.

Examples:

client.rcs.agents.list[:agents].each do |a|
  puts "#{a.name}#{a.status}#{a.sendable? ? ' (sendable)' : ''}"
end

Returns:

  • (Hash)

    { agents: Array<RcsAgent> }



153
154
155
156
157
# File 'lib/sendly/rcs_resource.rb', line 153

def list
  response = @client.get("/rcs/agents")
  agents = (response["agents"] || []).map { |a| RcsAgent.new(a) }
  { agents: agents }
end