Class: Twilio::REST::Serverless::V1::ServiceContext::BuildContext::BuildStatusInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the BuildStatusInstance

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 BuildStatus 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
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 213

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'],
        'url' => payload['url'],
    }

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

Instance Method Details

#account_sid ⇒ String

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

Returns:

  • (String) —

    The SID of the Account that created the Build resource.



250
251
252
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 250

def 
    @properties['account_sid']
end

#context ⇒ BuildStatusContext

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

Returns:



235
236
237
238
239
240
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 235

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

#fetch ⇒ BuildStatusInstance

Fetch the BuildStatusInstance

Returns:



275
276
277
278
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 275

def fetch

    context.fetch
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



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

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

#service_sid ⇒ String

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.



256
257
258
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 256

def service_sid
    @properties['service_sid']
end

#sid ⇒ String

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.



244
245
246
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 244

def sid
    @properties['sid']
end

#status ⇒ Status

Returns:

  • (Status)


262
263
264
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 262

def status
    @properties['status']
end

#to_s ⇒ Object

Provide a user friendly representation



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

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

#url ⇒ String

Returns The absolute URL of the Build Status resource.

Returns:

  • (String) —

    The absolute URL of the Build Status resource.



268
269
270
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 268

def url
    @properties['url']
end