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.



146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 146

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:



165
166
167
168
169
170
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 165

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

#fetchFlowTestUserInstance

Fetch the FlowTestUserInstance

Returns:



193
194
195
196
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 193

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



220
221
222
223
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 220

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.



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

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.



180
181
182
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 180

def test_users
    @properties['test_users']
end

#to_sObject

Provide a user friendly representation



213
214
215
216
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 213

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:



202
203
204
205
206
207
208
209
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 202

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.



186
187
188
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb', line 186

def url
    @properties['url']
end