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.
-
#flex_team_sid ⇒ String
The unique SID identifier of the Flex Team.
-
#flex_user_sid ⇒ String
The unique SID identifier of the Flex 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.
-
#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(email: :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
166 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 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 166 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'], 'username' => payload['username'], 'email' => payload['email'], '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.
206 207 208 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 206 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
197 198 199 200 201 202 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 197 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.
272 273 274 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 272 def created_date @properties['created_date'] end |
#email ⇒ String
Returns Email of the User.
254 255 256 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 254 def email @properties['email'] end |
#fetch ⇒ FlexUserInstance
Fetch the FlexUserInstance
297 298 299 300 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 297 def fetch context.fetch end |
#flex_team_sid ⇒ String
Returns The unique SID identifier of the Flex Team.
242 243 244 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 242 def flex_team_sid @properties['flex_team_sid'] end |
#flex_user_sid ⇒ String
Returns The unique SID identifier of the Flex User.
224 225 226 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 224 def flex_user_sid @properties['flex_user_sid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
330 331 332 333 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 330 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.
212 213 214 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 212 def instance_sid @properties['instance_sid'] end |
#locale ⇒ String
Returns The locale preference of the user.
260 261 262 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 260 def locale @properties['locale'] end |
#roles ⇒ Array<String>
Returns The roles of the user.
266 267 268 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 266 def roles @properties['roles'] end |
#to_s ⇒ Object
Provide a user friendly representation
323 324 325 326 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 323 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V2.FlexUserInstance #{values}>" end |
#update(email: :unset, user_sid: :unset, locale: :unset) ⇒ FlexUserInstance
Update the FlexUserInstance
308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 308 def update( email: :unset, user_sid: :unset, locale: :unset ) context.update( email: email, user_sid: user_sid, locale: locale, ) end |
#updated_date ⇒ Time
Returns The date that this user was updated, given in ISO 8601 format.
278 279 280 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 278 def updated_date @properties['updated_date'] end |
#url ⇒ String
290 291 292 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 290 def url @properties['url'] end |
#user_sid ⇒ String
Returns The unique SID identifier of the Twilio Unified User.
218 219 220 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 218 def user_sid @properties['user_sid'] end |
#username ⇒ String
Returns Username of the User.
248 249 250 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 248 def username @properties['username'] end |
#version ⇒ String
Returns The current version of the user.
284 285 286 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 284 def version @properties['version'] end |
#worker_sid ⇒ String
Returns The unique SID identifier of the worker.
230 231 232 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 230 def worker_sid @properties['worker_sid'] end |
#workspace_sid ⇒ String
Returns The unique SID identifier of the workspace.
236 237 238 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 236 def workspace_sid @properties['workspace_sid'] end |