Class: Twilio::REST::Serverless::V1::ServiceContext::BuildInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/serverless/v1/service/build.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, sid: nil) ⇒ BuildInstance

Initialize the BuildInstance

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

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 281

def initialize(version, payload , service_sid: nil, sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'service_sid' => payload['service_sid'],
        'status' => payload['status'],
        'asset_versions' => payload['asset_versions'],
        'function_versions' => payload['function_versions'],
        'dependencies' => payload['dependencies'],
        'runtime' => payload['runtime'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
        'links' => payload['links'],
    }

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

Instance Method Details

#account_sidString

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

Returns:



324
325
326
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 324

def 
    @properties['account_sid']
end

#asset_versionsArray<Hash>

Returns The list of Asset Version resource SIDs that are included in the Build.

Returns:

  • (Array<Hash>)

    The list of Asset Version resource SIDs that are included in the Build.



342
343
344
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 342

def asset_versions
    @properties['asset_versions']
end

#build_statusbuild_status

Access the build_status

Returns:



407
408
409
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 407

def build_status
    context.build_status
end

#contextBuildContext

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

Returns:



309
310
311
312
313
314
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 309

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

#date_createdTime

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

Returns:



366
367
368
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 366

def date_created
    @properties['date_created']
end

#date_updatedTime

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

Returns:



372
373
374
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 372

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the BuildInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



391
392
393
394
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 391

def delete

    context.delete
end

#dependenciesArray<Hash>

Returns A list of objects that describe the Dependencies included in the Build. Each object contains the ‘name` and `version` of the dependency.

Returns:

  • (Array<Hash>)

    A list of objects that describe the Dependencies included in the Build. Each object contains the ‘name` and `version` of the dependency.



354
355
356
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 354

def dependencies
    @properties['dependencies']
end

#fetchBuildInstance

Fetch the BuildInstance

Returns:



399
400
401
402
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 399

def fetch

    context.fetch
end

#function_versionsArray<Hash>

Returns The list of Function Version resource SIDs that are included in the Build.

Returns:

  • (Array<Hash>)

    The list of Function Version resource SIDs that are included in the Build.



348
349
350
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 348

def function_versions
    @properties['function_versions']
end

#inspectObject

Provide a detailed, user friendly representation



420
421
422
423
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 420

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

Returns:

  • (Hash)


384
385
386
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 384

def links
    @properties['links']
end

#runtimeRuntime

Returns:

  • (Runtime)


360
361
362
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 360

def runtime
    @properties['runtime']
end

#service_sidString

Returns The SID of the Service that the Build resource is associated with.

Returns:

  • (String)

    The SID of the Service that the Build resource is associated with.



330
331
332
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 330

def service_sid
    @properties['service_sid']
end

#sidString

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

Returns:

  • (String)

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



318
319
320
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 318

def sid
    @properties['sid']
end

#statusStatus

Returns:

  • (Status)


336
337
338
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 336

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



413
414
415
416
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 413

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

#urlString

Returns The absolute URL of the Build resource.

Returns:

  • (String)

    The absolute URL of the Build resource.



378
379
380
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 378

def url
    @properties['url']
end