Class: Twilio::REST::Studio::V2::FlowContext::ExecutionContext::ExecutionContextInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, flow_sid: nil, execution_sid: nil) ⇒ ExecutionContextInstance

Initialize the ExecutionContextInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • flow_sid (String) (defaults to: nil)

    The SID of the Flow.

  • execution_sid (String) (defaults to: nil)

    The SID of the context's Execution resource.


123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 123

def initialize(version, payload, flow_sid: nil, execution_sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'context' => payload['context'],
      'flow_sid' => payload['flow_sid'],
      'execution_sid' => payload['execution_sid'],
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {'flow_sid' => flow_sid, 'execution_sid' => execution_sid, }
end

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource


157
158
159
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 157

def 
  @properties['account_sid']
end

#contextHash

Returns The current state of the flow.

Returns:

  • (Hash)

    The current state of the flow


144
145
146
147
148
149
150
151
152
153
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 144

def context
  unless @instance_context
    @instance_context = ExecutionContextContext.new(
        @version,
        @params['flow_sid'],
        @params['execution_sid'],
    )
  end
  @instance_context
end

#execution_sidString

Returns The SID of the Execution.

Returns:

  • (String)

    The SID of the Execution


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

def execution_sid
  @properties['execution_sid']
end

#fetchExecutionContextInstance

Fetch the ExecutionContextInstance

Returns:


188
189
190
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 188

def fetch
  context.fetch
end

#flow_sidString

Returns The SID of the Flow.

Returns:

  • (String)

    The SID of the Flow


169
170
171
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 169

def flow_sid
  @properties['flow_sid']
end

#inspectObject

Provide a detailed, user friendly representation


201
202
203
204
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 201

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

#to_sObject

Provide a user friendly representation


194
195
196
197
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 194

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

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource


181
182
183
# File 'lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb', line 181

def url
  @properties['url']
end