Class: Twilio::REST::FlexApi::V2::FlexUserInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::FlexApi::V2::FlexUserInstance
- Defined in:
- lib/twilio-ruby/rest/flex_api/v2/flex_user.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID of the account that created the resource.
-
#context ⇒ FlexUserContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#created_date ⇒ Time
The date that this user was created, given in ISO 8601 format.
-
#email ⇒ String
Email of the User.
-
#fetch ⇒ FlexUserInstance
Fetch the FlexUserInstance.
-
#first_name ⇒ String
First name of the User.
-
#flex_team_sid ⇒ String
The unique SID identifier of the Flex Team.
-
#flex_user_sid ⇒ String
The unique SID identifier of the Flex User.
-
#friendly_name ⇒ String
Friendly name of the User.
-
#initialize(version, payload, instance_sid: nil, flex_user_sid: nil) ⇒ FlexUserInstance
constructor
Initialize the FlexUserInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#instance_sid ⇒ String
The unique ID created by Twilio to identify a Flex instance.
-
#last_name ⇒ String
Last name of the User.
-
#locale ⇒ String
The locale preference of the user.
-
#roles ⇒ Array<String>
The roles of the user.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(first_name: :unset, last_name: :unset, email: :unset, friendly_name: :unset, user_sid: :unset, locale: :unset) ⇒ FlexUserInstance
Update the FlexUserInstance.
-
#updated_date ⇒ Time
The date that this user was updated, given in ISO 8601 format.
- #url ⇒ String
-
#user_sid ⇒ String
The unique SID identifier of the Twilio Unified User.
-
#username ⇒ String
Username of the User.
-
#version ⇒ String
The current version of the user.
-
#worker_sid ⇒ String
The unique SID identifier of the worker.
-
#workspace_sid ⇒ String
The unique SID identifier of the workspace.
Constructor Details
#initialize(version, payload, instance_sid: nil, flex_user_sid: nil) ⇒ FlexUserInstance
Initialize the FlexUserInstance
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 167 def initialize(version, payload , instance_sid: nil, flex_user_sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'instance_sid' => payload['instance_sid'], 'user_sid' => payload['user_sid'], 'flex_user_sid' => payload['flex_user_sid'], 'worker_sid' => payload['worker_sid'], 'workspace_sid' => payload['workspace_sid'], 'flex_team_sid' => payload['flex_team_sid'], 'first_name' => payload['first_name'], 'last_name' => payload['last_name'], 'username' => payload['username'], 'email' => payload['email'], 'friendly_name' => payload['friendly_name'], 'locale' => payload['locale'], 'roles' => payload['roles'], 'created_date' => Twilio.deserialize_iso8601_datetime(payload['created_date']), 'updated_date' => Twilio.deserialize_iso8601_datetime(payload['updated_date']), 'version' => payload['version'] == nil ? payload['version'] : payload['version'].to_i, 'url' => payload['url'], } # Context @instance_context = nil @params = { 'instance_sid' => instance_sid || @properties['instance_sid'] ,'flex_user_sid' => flex_user_sid || @properties['flex_user_sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique SID of the account that created the resource.
210 211 212 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 210 def account_sid @properties['account_sid'] end |
#context ⇒ FlexUserContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
201 202 203 204 205 206 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 201 def context unless @instance_context @instance_context = FlexUserContext.new(@version , @params['instance_sid'], @params['flex_user_sid']) end @instance_context end |
#created_date ⇒ Time
Returns The date that this user was created, given in ISO 8601 format.
294 295 296 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 294 def created_date @properties['created_date'] end |
#email ⇒ String
Returns Email of the User.
270 271 272 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 270 def email @properties['email'] end |
#fetch ⇒ FlexUserInstance
Fetch the FlexUserInstance
319 320 321 322 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 319 def fetch context.fetch end |
#first_name ⇒ String
Returns First name of the User.
252 253 254 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 252 def first_name @properties['first_name'] end |
#flex_team_sid ⇒ String
Returns The unique SID identifier of the Flex Team.
246 247 248 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 246 def flex_team_sid @properties['flex_team_sid'] end |
#flex_user_sid ⇒ String
Returns The unique SID identifier of the Flex User.
228 229 230 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 228 def flex_user_sid @properties['flex_user_sid'] end |
#friendly_name ⇒ String
Returns Friendly name of the User.
276 277 278 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 276 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
361 362 363 364 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 361 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V2.FlexUserInstance #{values}>" end |
#instance_sid ⇒ String
Returns The unique ID created by Twilio to identify a Flex instance.
216 217 218 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 216 def instance_sid @properties['instance_sid'] end |
#last_name ⇒ String
Returns Last name of the User.
258 259 260 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 258 def last_name @properties['last_name'] end |
#locale ⇒ String
Returns The locale preference of the user.
282 283 284 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 282 def locale @properties['locale'] end |
#roles ⇒ Array<String>
Returns The roles of the user.
288 289 290 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 288 def roles @properties['roles'] end |
#to_s ⇒ Object
Provide a user friendly representation
354 355 356 357 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 354 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V2.FlexUserInstance #{values}>" end |
#update(first_name: :unset, last_name: :unset, email: :unset, friendly_name: :unset, user_sid: :unset, locale: :unset) ⇒ FlexUserInstance
Update the FlexUserInstance
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 333 def update( first_name: :unset, last_name: :unset, email: :unset, friendly_name: :unset, user_sid: :unset, locale: :unset ) context.update( first_name: first_name, last_name: last_name, email: email, friendly_name: friendly_name, user_sid: user_sid, locale: locale, ) end |
#updated_date ⇒ Time
Returns The date that this user was updated, given in ISO 8601 format.
300 301 302 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 300 def updated_date @properties['updated_date'] end |
#url ⇒ String
312 313 314 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 312 def url @properties['url'] end |
#user_sid ⇒ String
Returns The unique SID identifier of the Twilio Unified User.
222 223 224 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 222 def user_sid @properties['user_sid'] end |
#username ⇒ String
Returns Username of the User.
264 265 266 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 264 def username @properties['username'] end |
#version ⇒ String
Returns The current version of the user.
306 307 308 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 306 def version @properties['version'] end |
#worker_sid ⇒ String
Returns The unique SID identifier of the worker.
234 235 236 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 234 def worker_sid @properties['worker_sid'] end |
#workspace_sid ⇒ String
Returns The unique SID identifier of the workspace.
240 241 242 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 240 def workspace_sid @properties['workspace_sid'] end |