Class: Twilio::REST::Studio::V2::FlowInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Studio::V2::FlowInstance
- Defined in:
- lib/twilio-ruby/rest/studio/v2/flow.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the resource.
-
#commit_message ⇒ String
Description on change made in the revision.
-
#context ⇒ FlowContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The ISO 8601 date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The ISO 8601 date and time in GMT when the resource was last updated.
-
#definition ⇒ Hash
JSON representation of flow definition.
-
#delete ⇒ Boolean
Delete the FlowInstance.
-
#errors ⇒ Hash
List of error in the flow definition.
-
#executions ⇒ executions
Access the executions.
-
#fetch ⇒ FlowInstance
Fetch the FlowInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the Flow.
-
#initialize(version, payload, sid: nil) ⇒ FlowInstance
constructor
Initialize the FlowInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
Nested resource URLs.
-
#revision ⇒ String
The latest revision number of the Flow’s definition.
-
#revisions ⇒ revisions
Access the revisions.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#status ⇒ flow.Status
The status of the Flow.
-
#test_users ⇒ test_users
Access the test_users.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: nil, friendly_name: :unset, definition: :unset, commit_message: :unset) ⇒ FlowInstance
Update the FlowInstance.
-
#url ⇒ String
The absolute URL of the resource.
-
#valid ⇒ Boolean
Boolean if the flow definition is valid.
-
#warnings ⇒ Hash
List of warnings in the flow definition.
-
#webhook_url ⇒ String
The webhook_url.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ FlowInstance
Initialize the FlowInstance
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 293 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'friendly_name' => payload['friendly_name'], 'definition' => payload['definition'], 'status' => payload['status'], 'revision' => payload['revision'].to_i, 'commit_message' => payload['commit_message'], 'valid' => payload['valid'], 'errors' => payload['errors'], 'warnings' => payload['warnings'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'webhook_url' => payload['webhook_url'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the Account that created the resource.
339 340 341 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 339 def account_sid @properties['account_sid'] end |
#commit_message ⇒ String
Returns Description on change made in the revision.
369 370 371 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 369 def @properties['commit_message'] end |
#context ⇒ FlowContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
324 325 326 327 328 329 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 324 def context unless @instance_context @instance_context = FlowContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was created.
393 394 395 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 393 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was last updated.
399 400 401 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 399 def date_updated @properties['date_updated'] end |
#definition ⇒ Hash
Returns JSON representation of flow definition.
351 352 353 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 351 def definition @properties['definition'] end |
#delete ⇒ Boolean
Delete the FlowInstance
448 449 450 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 448 def delete context.delete end |
#errors ⇒ Hash
Returns List of error in the flow definition.
381 382 383 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 381 def errors @properties['errors'] end |
#executions ⇒ executions
Access the executions
469 470 471 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 469 def executions context.executions end |
#fetch ⇒ FlowInstance
Fetch the FlowInstance
441 442 443 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 441 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the Flow.
345 346 347 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 345 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
482 483 484 485 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 482 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Studio.V2.FlowInstance #{values}>" end |
#links ⇒ String
Returns Nested resource URLs.
417 418 419 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 417 def links @properties['links'] end |
#revision ⇒ String
Returns The latest revision number of the Flow’s definition.
363 364 365 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 363 def revision @properties['revision'] end |
#revisions ⇒ revisions
Access the revisions
455 456 457 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 455 def revisions context.revisions end |
#sid ⇒ String
Returns The unique string that identifies the resource.
333 334 335 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 333 def sid @properties['sid'] end |
#status ⇒ flow.Status
Returns The status of the Flow.
357 358 359 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 357 def status @properties['status'] end |
#test_users ⇒ test_users
Access the test_users
462 463 464 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 462 def test_users context.test_users end |
#to_s ⇒ Object
Provide a user friendly representation
475 476 477 478 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 475 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Studio.V2.FlowInstance #{values}>" end |
#update(status: nil, friendly_name: :unset, definition: :unset, commit_message: :unset) ⇒ FlowInstance
Update the FlowInstance
429 430 431 432 433 434 435 436 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 429 def update(status: nil, friendly_name: :unset, definition: :unset, commit_message: :unset) context.update( status: status, friendly_name: friendly_name, definition: definition, commit_message: , ) end |
#url ⇒ String
Returns The absolute URL of the resource.
411 412 413 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 411 def url @properties['url'] end |
#valid ⇒ Boolean
Returns Boolean if the flow definition is valid.
375 376 377 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 375 def valid @properties['valid'] end |
#warnings ⇒ Hash
Returns List of warnings in the flow definition.
387 388 389 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 387 def warnings @properties['warnings'] end |
#webhook_url ⇒ String
Returns The webhook_url.
405 406 407 |
# File 'lib/twilio-ruby/rest/studio/v2/flow.rb', line 405 def webhook_url @properties['webhook_url'] end |