Class: Twilio::REST::Serverless::V1

Inherits:
Version
  • Object
show all
Defined in:
lib/twilio-ruby/rest/serverless/v1.rb,
lib/twilio-ruby/rest/serverless/v1/service.rb,
lib/twilio-ruby/rest/serverless/v1/service/asset.rb,
lib/twilio-ruby/rest/serverless/v1/service/build.rb,
lib/twilio-ruby/rest/serverless/v1/service/function.rb,
lib/twilio-ruby/rest/serverless/v1/service/environment.rb,
lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb,
lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb,
lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb,
lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb,
lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb,
lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb,
lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb

Defined Under Namespace

Classes: ServiceContext, ServiceInstance, ServiceList, ServicePage

Instance Attribute Summary

Attributes inherited from Version

#domain

Instance Method Summary collapse

Methods inherited from Version

#absolute_url, #create, #delete, #exception, #fetch, #page, #read_limits, #relative_uri, #request, #stream, #update

Constructor Details

#initialize(domain) ⇒ V1

Initialize the V1 version of Serverless


15
16
17
18
19
# File 'lib/twilio-ruby/rest/serverless/v1.rb', line 15

def initialize(domain)
  super
  @version = 'v1'
  @services = nil
end

Instance Method Details

#services(sid = :unset) ⇒ Twilio::REST::Serverless::V1::ServiceContext, Twilio::REST::Serverless::V1::ServiceList

Parameters:

  • sid (String) (defaults to: :unset)

    The `sid` or `unique_name` of the Service resource to fetch.

Returns:


25
26
27
28
29
30
31
32
33
34
# File 'lib/twilio-ruby/rest/serverless/v1.rb', line 25

def services(sid=:unset)
  if sid.nil?
      raise ArgumentError, 'sid cannot be nil'
  end
  if sid == :unset
      @services ||= ServiceList.new self
  else
      ServiceContext.new(self, sid)
  end
end

#to_sObject

Provide a user friendly representation


38
39
40
# File 'lib/twilio-ruby/rest/serverless/v1.rb', line 38

def to_s
  '<Twilio::REST::Serverless::V1>'
end