Class: Twilio::REST::Studio::V2::FlowContext::FlowTestUserInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ FlowTestUserInstance

Initialize the FlowTestUserInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this FlowTestUser resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 326

def initialize(version, payload , sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'test_users' => payload['test_users'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#contextFlowTestUserContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



346
347
348
349
350
351
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 346

def context
    unless @instance_context
        @instance_context = FlowTestUserContext.new(@version , @params['sid'])
    end
    @instance_context
end

#fetchFlowTestUserInstance

Fetch the FlowTestUserInstance

Returns:



374
375
376
377
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 374

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



401
402
403
404
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 401

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Studio.V2.FlowTestUserInstance #{values}>"
end

#sidString

Returns Unique identifier of the flow.

Returns:

  • (String)

    Unique identifier of the flow.



355
356
357
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 355

def sid
    @properties['sid']
end

#test_usersArray<String>

Returns List of test user identities that can test draft versions of the flow.

Returns:

  • (Array<String>)

    List of test user identities that can test draft versions of the flow.



361
362
363
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 361

def test_users
    @properties['test_users']
end

#to_sObject

Provide a user friendly representation



394
395
396
397
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 394

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Studio.V2.FlowTestUserInstance #{values}>"
end

#update(test_users: nil) ⇒ FlowTestUserInstance

Update the FlowTestUserInstance

Parameters:

  • test_users (Array[String]) (defaults to: nil)

    List of test user identities that can test draft versions of the flow.

Returns:



383
384
385
386
387
388
389
390
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 383

def update(
    test_users: nil
)

    context.update(
        test_users: test_users, 
    )
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



367
368
369
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 367

def url
    @properties['url']
end