class Twilio::REST::FrontlineApi::V1::UserInstance

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Public Class Methods

new(version, payload, sid: nil) click to toggle source

Initialize the UserInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid The SID of the User resource to fetch. This value can be

either the `sid` or the `identity` of the User resource to fetch.

@return [UserInstance] UserInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/frontline_api/v1/user.rb
132 def initialize(version, payload, sid: nil)
133   super(version)
134 
135   # Marshaled Properties
136   @properties = {
137       'sid' => payload['sid'],
138       'identity' => payload['identity'],
139       'friendly_name' => payload['friendly_name'],
140       'avatar' => payload['avatar'],
141       'state' => payload['state'],
142       'url' => payload['url'],
143   }
144 
145   # Context
146   @instance_context = nil
147   @params = {'sid' => sid || @properties['sid'], }
148 end

Public Instance Methods

avatar() click to toggle source

@return [String] The avatar URL which will be shown in Frontline application

    # File lib/twilio-ruby/rest/frontline_api/v1/user.rb
181 def avatar
182   @properties['avatar']
183 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [UserContext] UserContext for this UserInstance

    # File lib/twilio-ruby/rest/frontline_api/v1/user.rb
154 def context
155   unless @instance_context
156     @instance_context = UserContext.new(@version, @params['sid'], )
157   end
158   @instance_context
159 end
fetch() click to toggle source

Fetch the UserInstance @return [UserInstance] Fetched UserInstance

    # File lib/twilio-ruby/rest/frontline_api/v1/user.rb
200 def fetch
201   context.fetch
202 end
friendly_name() click to toggle source

@return [String] The string that you assigned to describe the User

    # File lib/twilio-ruby/rest/frontline_api/v1/user.rb
175 def friendly_name
176   @properties['friendly_name']
177 end
identity() click to toggle source

@return [String] The string that identifies the resource's User

    # File lib/twilio-ruby/rest/frontline_api/v1/user.rb
169 def identity
170   @properties['identity']
171 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/frontline_api/v1/user.rb
225 def inspect
226   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
227   "<Twilio.FrontlineApi.V1.UserInstance #{values}>"
228 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/frontline_api/v1/user.rb
163 def sid
164   @properties['sid']
165 end
state() click to toggle source

@return [user.StateType] Current state of this user

    # File lib/twilio-ruby/rest/frontline_api/v1/user.rb
187 def state
188   @properties['state']
189 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/frontline_api/v1/user.rb
218 def to_s
219   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
220   "<Twilio.FrontlineApi.V1.UserInstance #{values}>"
221 end
update(friendly_name: :unset, avatar: :unset, state: :unset) click to toggle source

Update the UserInstance @param [String] friendly_name The string that you assigned to describe the User. @param [String] avatar The avatar URL which will be shown in Frontline

application.

@param [user.StateType] state Current state of this user. Can be either `active`

or `deactivated` and defaults to `active`

@return [UserInstance] Updated UserInstance

    # File lib/twilio-ruby/rest/frontline_api/v1/user.rb
212 def update(friendly_name: :unset, avatar: :unset, state: :unset)
213   context.update(friendly_name: friendly_name, avatar: avatar, state: state, )
214 end
url() click to toggle source

@return [String] An absolute URL for this user.

    # File lib/twilio-ruby/rest/frontline_api/v1/user.rb
193 def url
194   @properties['url']
195 end