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

  • sid (String) (defaults to: nil) —

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

  • revision (String) (defaults to: nil) —

    Specific Revision number or can be LatestPublished and LatestRevision.



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 195

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, 'revision' => revision || @properties['revision'], }
end

Instance Method Details

#account_sid ⇒ String

Returns The SID of the Account that created the resource.

Returns:

  • (String) —

    The SID of the Account that created the resource



238
239
240
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 238

def 
  @properties['account_sid']
end

#commit_message ⇒ String

Returns Description of change made in the revision.

Returns:

  • (String) —

    Description of change made in the revision



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

def commit_message
  @properties['commit_message']
end

#context ⇒ FlowRevisionContext

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

Returns:



223
224
225
226
227
228
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 223

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

#date_created ⇒ Time

Returns The ISO 8601 date and time in GMT when the resource was created.

Returns:

  • (Time) —

    The ISO 8601 date and time in GMT when the resource was created



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

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.

Returns:

  • (Time) —

    The ISO 8601 date and time in GMT when the resource was last updated



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

def date_updated
  @properties['date_updated']
end

#definition ⇒ Hash

Returns JSON representation of flow definition.

Returns:

  • (Hash) —

    JSON representation of flow definition



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

def definition
  @properties['definition']
end

#errors ⇒ Array[Hash]

Returns List of error in the flow definition.

Returns:

  • (Array[Hash]) —

    List of error in the flow definition



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

def errors
  @properties['errors']
end

#fetch ⇒ FlowRevisionInstance

Fetch the FlowRevisionInstance

Returns:



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

def fetch
  context.fetch
end

#friendly_name ⇒ String

Returns The string that you assigned to describe the Flow.

Returns:

  • (String) —

    The string that you assigned to describe the Flow



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

def friendly_name
  @properties['friendly_name']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



318
319
320
321
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 318

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

#revision ⇒ String

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

Returns:

  • (String) —

    The latest revision number of the Flow's definition



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

def revision
  @properties['revision']
end

#sid ⇒ String

Returns The unique string that identifies the resource.

Returns:

  • (String) —

    The unique string that identifies the resource



232
233
234
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 232

def sid
  @properties['sid']
end

#status ⇒ flow_revision.Status

Returns The status of the Flow.

Returns:

  • (flow_revision.Status) —

    The status of the Flow



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

def status
  @properties['status']
end

#to_s ⇒ Object

Provide a user friendly representation



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

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

#url ⇒ String

Returns The absolute URL of the resource.

Returns:

  • (String) —

    The absolute URL of the resource



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

def url
  @properties['url']
end

#valid ⇒ Boolean

Returns Boolean if the flow definition is valid.

Returns:

  • (Boolean) —

    Boolean if the flow definition is valid



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

def valid
  @properties['valid']
end