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

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

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

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

  • sid (String) (defaults to: nil)

    The sid



128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/twilio-ruby/rest/studio/v2/flow/test_user.rb', line 128

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, }
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:



147
148
149
150
151
152
# File 'lib/twilio-ruby/rest/studio/v2/flow/test_user.rb', line 147

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

#fetchFlowTestUserInstance

Fetch the FlowTestUserInstance

Returns:



175
176
177
# File 'lib/twilio-ruby/rest/studio/v2/flow/test_user.rb', line 175

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



196
197
198
199
# File 'lib/twilio-ruby/rest/studio/v2/flow/test_user.rb', line 196

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

#sidString

Returns The sid.

Returns:

  • (String)

    The sid



156
157
158
# File 'lib/twilio-ruby/rest/studio/v2/flow/test_user.rb', line 156

def sid
  @properties['sid']
end

#test_usersString

Returns The test_users.

Returns:

  • (String)

    The test_users



162
163
164
# File 'lib/twilio-ruby/rest/studio/v2/flow/test_user.rb', line 162

def test_users
  @properties['test_users']
end

#to_sObject

Provide a user friendly representation



189
190
191
192
# File 'lib/twilio-ruby/rest/studio/v2/flow/test_user.rb', line 189

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 (String) (defaults to: nil)

    The test_users

Returns:



183
184
185
# File 'lib/twilio-ruby/rest/studio/v2/flow/test_user.rb', line 183

def update(test_users: nil)
  context.update(test_users: test_users, )
end

#urlString

Returns The url.

Returns:

  • (String)

    The url



168
169
170
# File 'lib/twilio-ruby/rest/studio/v2/flow/test_user.rb', line 168

def url
  @properties['url']
end