Class: Twilio::REST::Studio::V2::FlowContext::FlowTestUserContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ FlowTestUserContext

Initialize the FlowTestUserContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    Unique identifier of the flow.


69
70
71
72
73
74
75
# File 'lib/twilio-ruby/rest/studio/v2/flow/test_user.rb', line 69

def initialize(version, sid)
  super(version)

  # Path Solution
  @solution = {sid: sid, }
  @uri = "/Flows/#{@solution[:sid]}/TestUsers"
end

Instance Method Details

#fetchFlowTestUserInstance

Fetch the FlowTestUserInstance

Returns:


80
81
82
83
84
# File 'lib/twilio-ruby/rest/studio/v2/flow/test_user.rb', line 80

def fetch
  payload = @version.fetch('GET', @uri)

  FlowTestUserInstance.new(@version, payload, sid: @solution[:sid], )
end

#inspectObject

Provide a detailed, user friendly representation


108
109
110
111
# File 'lib/twilio-ruby/rest/studio/v2/flow/test_user.rb', line 108

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Studio.V2.FlowTestUserContext #{context}>"
end

#to_sObject

Provide a user friendly representation


101
102
103
104
# File 'lib/twilio-ruby/rest/studio/v2/flow/test_user.rb', line 101

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Studio.V2.FlowTestUserContext #{context}>"
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:


91
92
93
94
95
96
97
# File 'lib/twilio-ruby/rest/studio/v2/flow/test_user.rb', line 91

def update(test_users: nil)
  data = Twilio::Values.of({'TestUsers' => Twilio.serialize_list(test_users) { |e| e }, })

  payload = @version.update('POST', @uri, data: data)

  FlowTestUserInstance.new(@version, payload, sid: @solution[:sid], )
end