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

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

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

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

  • service_sid (String) (defaults to: nil)

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

  • sid (String) (defaults to: nil)

    The SID of the Build resource to fetch.



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 242

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

Instance Method Details

#account_sidString

Returns The SID of the Account that created the Build resource.

Returns:

  • (String)

    The SID of the Account that created the Build resource



284
285
286
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 284

def 
  @properties['account_sid']
end

#asset_versionsHash

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

Returns:

  • (Hash)

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



302
303
304
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 302

def asset_versions
  @properties['asset_versions']
end

#build_statusbuild_status

Access the build_status

Returns:



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

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:



269
270
271
272
273
274
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 269

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

#date_createdTime

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

Returns:

  • (Time)

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



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

def date_created
  @properties['date_created']
end

#date_updatedTime

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

Returns:

  • (Time)

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



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

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Delete the BuildInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise



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

def delete
  context.delete
end

#dependenciesHash

Returns A list of objects that describe the Dependencies included in the Build.

Returns:

  • (Hash)

    A list of objects that describe the Dependencies included in the Build



314
315
316
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 314

def dependencies
  @properties['dependencies']
end

#fetchBuildInstance

Fetch the BuildInstance

Returns:



345
346
347
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 345

def fetch
  context.fetch
end

#function_versionsHash

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

Returns:

  • (Hash)

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



308
309
310
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 308

def function_versions
  @properties['function_versions']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

Returns The links.

Returns:

  • (String)

    The links



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

def links
  @properties['links']
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



290
291
292
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 290

def service_sid
  @properties['service_sid']
end

#sidString

Returns The unique string that identifies the Build resource.

Returns:

  • (String)

    The unique string that identifies the Build resource



278
279
280
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 278

def sid
  @properties['sid']
end

#statusbuild.Status

Returns The status of the Build.

Returns:

  • (build.Status)

    The status of the Build



296
297
298
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 296

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation



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

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



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

def url
  @properties['url']
end