Class: Twilio::REST::FrontlineApi::V1::UserInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::FrontlineApi::V1::UserInstance
- Defined in:
- lib/twilio-ruby/rest/frontline_api/v1/user.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#avatar ⇒ String
The avatar URL which will be shown in Frontline application.
-
#context ⇒ UserContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#fetch ⇒ UserInstance
Fetch the UserInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the User.
-
#identity ⇒ String
The string that identifies the resource’s User.
-
#initialize(version, payload, sid: nil) ⇒ UserInstance
constructor
Initialize the UserInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#state ⇒ user.StateType
Current state of this user.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, avatar: :unset, state: :unset) ⇒ UserInstance
Update the UserInstance.
-
#url ⇒ String
An absolute URL for this user.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ UserInstance
Initialize the UserInstance
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/twilio-ruby/rest/frontline_api/v1/user.rb', line 132 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'identity' => payload['identity'], 'friendly_name' => payload['friendly_name'], 'avatar' => payload['avatar'], 'state' => payload['state'], 'url' => payload['url'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#avatar ⇒ String
Returns The avatar URL which will be shown in Frontline application.
181 182 183 |
# File 'lib/twilio-ruby/rest/frontline_api/v1/user.rb', line 181 def avatar @properties['avatar'] end |
#context ⇒ UserContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
154 155 156 157 158 159 |
# File 'lib/twilio-ruby/rest/frontline_api/v1/user.rb', line 154 def context unless @instance_context @instance_context = UserContext.new(@version, @params['sid'], ) end @instance_context end |
#fetch ⇒ UserInstance
Fetch the UserInstance
200 201 202 |
# File 'lib/twilio-ruby/rest/frontline_api/v1/user.rb', line 200 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the User.
175 176 177 |
# File 'lib/twilio-ruby/rest/frontline_api/v1/user.rb', line 175 def friendly_name @properties['friendly_name'] end |
#identity ⇒ String
Returns The string that identifies the resource’s User.
169 170 171 |
# File 'lib/twilio-ruby/rest/frontline_api/v1/user.rb', line 169 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
225 226 227 228 |
# File 'lib/twilio-ruby/rest/frontline_api/v1/user.rb', line 225 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FrontlineApi.V1.UserInstance #{values}>" end |
#sid ⇒ String
Returns The unique string that identifies the resource.
163 164 165 |
# File 'lib/twilio-ruby/rest/frontline_api/v1/user.rb', line 163 def sid @properties['sid'] end |
#state ⇒ user.StateType
Returns Current state of this user.
187 188 189 |
# File 'lib/twilio-ruby/rest/frontline_api/v1/user.rb', line 187 def state @properties['state'] end |
#to_s ⇒ Object
Provide a user friendly representation
218 219 220 221 |
# File 'lib/twilio-ruby/rest/frontline_api/v1/user.rb', line 218 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FrontlineApi.V1.UserInstance #{values}>" end |
#update(friendly_name: :unset, avatar: :unset, state: :unset) ⇒ UserInstance
Update the UserInstance
212 213 214 |
# File 'lib/twilio-ruby/rest/frontline_api/v1/user.rb', line 212 def update(friendly_name: :unset, avatar: :unset, state: :unset) context.update(friendly_name: friendly_name, avatar: avatar, state: state, ) end |
#url ⇒ String
Returns An absolute URL for this user.
193 194 195 |
# File 'lib/twilio-ruby/rest/frontline_api/v1/user.rb', line 193 def url @properties['url'] end |