class Twilio::REST::Serverless::V1::ServiceContext::FunctionInstance

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

Public Class Methods

new(version, payload, service_sid: nil, sid: nil) click to toggle source

Initialize the FunctionInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] service_sid The SID of the Service that the Function resource is

associated with.

@param [String] sid The SID of the Function resource to fetch. @return [FunctionInstance] FunctionInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/serverless/v1/service/function.rb
260 def initialize(version, payload, service_sid: nil, sid: nil)
261   super(version)
262 
263   # Marshaled Properties
264   @properties = {
265       'sid' => payload['sid'],
266       'account_sid' => payload['account_sid'],
267       'service_sid' => payload['service_sid'],
268       'friendly_name' => payload['friendly_name'],
269       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
270       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
271       'url' => payload['url'],
272       'links' => payload['links'],
273   }
274 
275   # Context
276   @instance_context = nil
277   @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
278 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the Function resource

    # File lib/twilio-ruby/rest/serverless/v1/service/function.rb
299 def account_sid
300   @properties['account_sid']
301 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [FunctionContext] FunctionContext for this FunctionInstance

    # File lib/twilio-ruby/rest/serverless/v1/service/function.rb
284 def context
285   unless @instance_context
286     @instance_context = FunctionContext.new(@version, @params['service_sid'], @params['sid'], )
287   end
288   @instance_context
289 end
date_created() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the Function resource was created

    # File lib/twilio-ruby/rest/serverless/v1/service/function.rb
317 def date_created
318   @properties['date_created']
319 end
date_updated() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the Function resource was last updated

    # File lib/twilio-ruby/rest/serverless/v1/service/function.rb
323 def date_updated
324   @properties['date_updated']
325 end
delete() click to toggle source

Delete the FunctionInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/serverless/v1/service/function.rb
349 def delete
350   context.delete
351 end
fetch() click to toggle source

Fetch the FunctionInstance @return [FunctionInstance] Fetched FunctionInstance

    # File lib/twilio-ruby/rest/serverless/v1/service/function.rb
342 def fetch
343   context.fetch
344 end
friendly_name() click to toggle source

@return [String] The string that you assigned to describe the Function resource

    # File lib/twilio-ruby/rest/serverless/v1/service/function.rb
311 def friendly_name
312   @properties['friendly_name']
313 end
function_versions() click to toggle source

Access the function_versions @return [function_versions] function_versions

    # File lib/twilio-ruby/rest/serverless/v1/service/function.rb
365 def function_versions
366   context.function_versions
367 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/serverless/v1/service/function.rb
378 def inspect
379   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
380   "<Twilio.Serverless.V1.FunctionInstance #{values}>"
381 end
service_sid() click to toggle source

@return [String] The SID of the Service that the Function resource is associated with

    # File lib/twilio-ruby/rest/serverless/v1/service/function.rb
305 def service_sid
306   @properties['service_sid']
307 end
sid() click to toggle source

@return [String] The unique string that identifies the Function resource

    # File lib/twilio-ruby/rest/serverless/v1/service/function.rb
293 def sid
294   @properties['sid']
295 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/serverless/v1/service/function.rb
371 def to_s
372   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
373   "<Twilio.Serverless.V1.FunctionInstance #{values}>"
374 end
update(friendly_name: nil) click to toggle source

Update the FunctionInstance @param [String] friendly_name A descriptive string that you create to describe

the Function resource. It can be a maximum of 255 characters.

@return [FunctionInstance] Updated FunctionInstance

    # File lib/twilio-ruby/rest/serverless/v1/service/function.rb
358 def update(friendly_name: nil)
359   context.update(friendly_name: friendly_name, )
360 end
url() click to toggle source

@return [String] The absolute URL of the Function resource

    # File lib/twilio-ruby/rest/serverless/v1/service/function.rb
329 def url
330   @properties['url']
331 end