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.



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 267

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

#context ⇒ FlowTestUserContext

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

Returns:



287
288
289
290
291
292
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 287

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

#fetch ⇒ FlowTestUserInstance

Fetch the FlowTestUserInstance

Returns:



315
316
317
318
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 315

def fetch

    context.fetch
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



342
343
344
345
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 342

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

#sid ⇒ String

Returns Unique identifier of the flow.

Returns:

  • (String) —

    Unique identifier of the flow.



296
297
298
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 296

def sid
    @properties['sid']
end

#test_users ⇒ Array<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.



302
303
304
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 302

def test_users
    @properties['test_users']
end

#to_s ⇒ Object

Provide a user friendly representation



335
336
337
338
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 335

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:



324
325
326
327
328
329
330
331
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 324

def update(
  test_users: nil
)

    context.update(
        test_users: test_users, 
    )
end

#url ⇒ String

Returns The URL of this resource.

Returns:

  • (String) —

    The URL of this resource.



308
309
310
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 308

def url
    @properties['url']
end