class Twilio::REST::FrontlineApi::V1::UserContext
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
new(version, sid)
click to toggle source
Initialize the UserContext
@param [Version] version Version
that contains the resource @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 [UserContext] UserContext
Calls superclass method
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/frontline_api/v1/user.rb 74 def initialize(version, sid) 75 super(version) 76 77 # Path Solution 78 @solution = {sid: sid, } 79 @uri = "/Users/#{@solution[:sid]}" 80 end
Public Instance Methods
fetch()
click to toggle source
Fetch the UserInstance
@return [UserInstance] Fetched UserInstance
# File lib/twilio-ruby/rest/frontline_api/v1/user.rb 85 def fetch 86 payload = @version.fetch('GET', @uri) 87 88 UserInstance.new(@version, payload, sid: @solution[:sid], ) 89 end
inspect()
click to toggle source
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/frontline_api/v1/user.rb 116 def inspect 117 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 118 "#<Twilio.FrontlineApi.V1.UserContext #{context}>" 119 end
to_s()
click to toggle source
Provide a user friendly representation
# File lib/twilio-ruby/rest/frontline_api/v1/user.rb 109 def to_s 110 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 111 "#<Twilio.FrontlineApi.V1.UserContext #{context}>" 112 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 99 def update(friendly_name: :unset, avatar: :unset, state: :unset) 100 data = Twilio::Values.of({'FriendlyName' => friendly_name, 'Avatar' => avatar, 'State' => state, }) 101 102 payload = @version.update('POST', @uri, data: data) 103 104 UserInstance.new(@version, payload, sid: @solution[:sid], ) 105 end