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.



213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 213

def initialize(version, payload , sid: nil, revision: 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'] == 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:



256
257
258
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 256

def 
    @properties['account_sid']
end

#commit_messageString

Returns Description of change made in the revision.

Returns:

  • (String)

    Description of change made in the revision.



286
287
288
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 286

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:



241
242
243
244
245
246
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 241

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:



304
305
306
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 304

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:



310
311
312
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 310

def date_updated
    @properties['date_updated']
end

#definitionHash

Returns JSON representation of flow definition.

Returns:

  • (Hash)

    JSON representation of flow definition.



268
269
270
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 268

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.



298
299
300
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 298

def errors
    @properties['errors']
end

#fetchFlowRevisionInstance

Fetch the FlowRevisionInstance

Returns:



323
324
325
326
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 323

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.



262
263
264
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 262

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



337
338
339
340
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 337

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.



280
281
282
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 280

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.



250
251
252
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 250

def sid
    @properties['sid']
end

#statusStatus

Returns:

  • (Status)


274
275
276
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 274

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



330
331
332
333
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 330

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.



316
317
318
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 316

def url
    @properties['url']
end

#validBoolean

Returns Boolean if the flow definition is valid.

Returns:

  • (Boolean)

    Boolean if the flow definition is valid.



292
293
294
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 292

def valid
    @properties['valid']
end