Class: Twilio::REST::Studio::V2::FlowContext::FlowRevisionInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil, revision: nil) ⇒ FlowRevisionInstance

Initialize the FlowRevisionInstance

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 FlowRevision resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 388

def initialize(version, payload , sid: nil, revision: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'author_sid' => payload['author_sid'],
        'friendly_name' => payload['friendly_name'],
        'definition' => payload['definition'],
        'status' => payload['status'],
        'revision' => payload['revision'] == nil ? payload['revision'] : payload['revision'].to_i,
        'commit_message' => payload['commit_message'],
        'valid' => payload['valid'],
        'errors' => payload['errors'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'sid' => sid  || @properties['sid']  ,'revision' => revision  || @properties['revision']  , }
end

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Flow resource.

Returns:



433
434
435
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 433

def 
    @properties['account_sid']
end

#author_sidString

Returns The SID of the User that created or last updated the Flow.

Returns:

  • (String)

    The SID of the User that created or last updated the Flow.



439
440
441
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 439

def author_sid
    @properties['author_sid']
end

#commit_messageString

Returns Description of change made in the revision.

Returns:

  • (String)

    Description of change made in the revision.



469
470
471
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 469

def commit_message
    @properties['commit_message']
end

#contextFlowRevisionContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



418
419
420
421
422
423
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 418

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

#date_createdTime

Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



487
488
489
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 487

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



493
494
495
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 493

def date_updated
    @properties['date_updated']
end

#definitionHash

Returns JSON representation of flow definition.

Returns:

  • (Hash)

    JSON representation of flow definition.



451
452
453
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 451

def definition
    @properties['definition']
end

#errorsArray<Hash>

Returns List of error in the flow definition.

Returns:

  • (Array<Hash>)

    List of error in the flow definition.



481
482
483
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 481

def errors
    @properties['errors']
end

#fetchFlowRevisionInstance

Fetch the FlowRevisionInstance

Returns:



506
507
508
509
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 506

def fetch

    context.fetch
end

#friendly_nameString

Returns The string that you assigned to describe the Flow.

Returns:

  • (String)

    The string that you assigned to describe the Flow.



445
446
447
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 445

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



520
521
522
523
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 520

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

#revisionString

Returns The latest revision number of the Flow’s definition.

Returns:

  • (String)

    The latest revision number of the Flow’s definition.



463
464
465
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 463

def revision
    @properties['revision']
end

#sidString

Returns The unique string that we created to identify the Flow resource.

Returns:

  • (String)

    The unique string that we created to identify the Flow resource.



427
428
429
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 427

def sid
    @properties['sid']
end

#statusStatus

Returns:

  • (Status)


457
458
459
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 457

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



513
514
515
516
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 513

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

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource.



499
500
501
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 499

def url
    @properties['url']
end

#validBoolean

Returns Boolean if the flow definition is valid.

Returns:

  • (Boolean)

    Boolean if the flow definition is valid.



475
476
477
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 475

def valid
    @properties['valid']
end