Class: Twilio::REST::FrontlineApi::V1

Inherits:
Version
  • Object
show all
Defined in:
lib/twilio-ruby/rest/frontline_api/v1.rb,
lib/twilio-ruby/rest/frontline_api/v1/user.rb

Defined Under Namespace

Classes: UserContext, UserInstance, UserList, UserPage

Instance Attribute Summary

Attributes inherited from Version

#domain

Instance Method Summary collapse

Methods inherited from Version

#absolute_url, #create, #delete, #exception, #fetch, #page, #read_limits, #relative_uri, #request, #stream, #update

Constructor Details

#initialize(domain) ⇒ V1

Initialize the V1 version of FrontlineApi


15
16
17
18
19
# File 'lib/twilio-ruby/rest/frontline_api/v1.rb', line 15

def initialize(domain)
  super
  @version = 'v1'
  @users = nil
end

Instance Method Details

#to_sObject

Provide a user friendly representation


39
40
41
# File 'lib/twilio-ruby/rest/frontline_api/v1.rb', line 39

def to_s
  '<Twilio::REST::FrontlineApi::V1>'
end

#users(sid = :unset) ⇒ Twilio::REST::Frontline_api::V1::UserContext, Twilio::REST::Frontline_api::V1::UserList

Parameters:

  • sid (String) (defaults to: :unset)

    The SID of the User resource to fetch. This value can be either the `sid` or the `identity` of the User resource to fetch.

Returns:

  • (Twilio::REST::Frontline_api::V1::UserContext)

    if sid was passed.

  • (Twilio::REST::Frontline_api::V1::UserList)

26
27
28
29
30
31
32
33
34
35
# File 'lib/twilio-ruby/rest/frontline_api/v1.rb', line 26

def users(sid=:unset)
  if sid.nil?
      raise ArgumentError, 'sid cannot be nil'
  end
  if sid == :unset
      @users ||= UserList.new self
  else
      UserContext.new(self, sid)
  end
end