class Twilio::REST::Serverless::V1::ServiceInstance
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the ServiceInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] sid The `sid` or `unique_name` of the Service resource to fetch. @return [ServiceInstance] ServiceInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/serverless/v1/service.rb 327 def initialize(version, payload, sid: nil) 328 super(version) 329 330 # Marshaled Properties 331 @properties = { 332 'sid' => payload['sid'], 333 'account_sid' => payload['account_sid'], 334 'friendly_name' => payload['friendly_name'], 335 'unique_name' => payload['unique_name'], 336 'include_credentials' => payload['include_credentials'], 337 'ui_editable' => payload['ui_editable'], 338 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 339 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 340 'url' => payload['url'], 341 'links' => payload['links'], 342 } 343 344 # Context 345 @instance_context = nil 346 @params = {'sid' => sid || @properties['sid'], } 347 end
Public Instance Methods
@return [String] The SID of the Account that created the Service resource
# File lib/twilio-ruby/rest/serverless/v1/service.rb 368 def account_sid 369 @properties['account_sid'] 370 end
Access the assets @return [assets] assets
# File lib/twilio-ruby/rest/serverless/v1/service.rb 468 def assets 469 context.assets 470 end
Access the builds @return [builds] builds
# File lib/twilio-ruby/rest/serverless/v1/service.rb 475 def builds 476 context.builds 477 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ServiceContext] ServiceContext
for this ServiceInstance
# File lib/twilio-ruby/rest/serverless/v1/service.rb 353 def context 354 unless @instance_context 355 @instance_context = ServiceContext.new(@version, @params['sid'], ) 356 end 357 @instance_context 358 end
@return [Time] The ISO 8601 date and time in GMT when the Service resource was created
# File lib/twilio-ruby/rest/serverless/v1/service.rb 398 def date_created 399 @properties['date_created'] 400 end
@return [Time] The ISO 8601 date and time in GMT when the Service resource was last updated
# File lib/twilio-ruby/rest/serverless/v1/service.rb 404 def date_updated 405 @properties['date_updated'] 406 end
Delete the ServiceInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/serverless/v1/service.rb 430 def delete 431 context.delete 432 end
Access the environments @return [environments] environments
# File lib/twilio-ruby/rest/serverless/v1/service.rb 454 def environments 455 context.environments 456 end
Fetch the ServiceInstance
@return [ServiceInstance] Fetched ServiceInstance
# File lib/twilio-ruby/rest/serverless/v1/service.rb 423 def fetch 424 context.fetch 425 end
@return [String] The string that you assigned to describe the Service resource
# File lib/twilio-ruby/rest/serverless/v1/service.rb 374 def friendly_name 375 @properties['friendly_name'] 376 end
Access the functions @return [functions] functions
# File lib/twilio-ruby/rest/serverless/v1/service.rb 461 def functions 462 context.functions 463 end
@return [Boolean] Whether to inject Account credentials into a function invocation context
# File lib/twilio-ruby/rest/serverless/v1/service.rb 386 def include_credentials 387 @properties['include_credentials'] 388 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/serverless/v1/service.rb 488 def inspect 489 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 490 "<Twilio.Serverless.V1.ServiceInstance #{values}>" 491 end
@return [String] The URLs of the Service's nested resources
# File lib/twilio-ruby/rest/serverless/v1/service.rb 416 def links 417 @properties['links'] 418 end
@return [String] The unique string that identifies the Service resource
# File lib/twilio-ruby/rest/serverless/v1/service.rb 362 def sid 363 @properties['sid'] 364 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/serverless/v1/service.rb 481 def to_s 482 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 483 "<Twilio.Serverless.V1.ServiceInstance #{values}>" 484 end
@return [Boolean] Whether the Service resource's properties and subresources can be edited via the UI
# File lib/twilio-ruby/rest/serverless/v1/service.rb 392 def ui_editable 393 @properties['ui_editable'] 394 end
@return [String] A user-defined string that uniquely identifies the Service resource
# File lib/twilio-ruby/rest/serverless/v1/service.rb 380 def unique_name 381 @properties['unique_name'] 382 end
Update the ServiceInstance
@param [Boolean] include_credentials
Whether to inject Account credentials into
a function invocation context.
@param [String] friendly_name
A descriptive string that you create to describe
the Service resource. It can be a maximum of 255 characters.
@param [Boolean] ui_editable
Whether the Service resource's properties and
subresources can be edited via the UI. The default value is `false`.
@return [ServiceInstance] Updated ServiceInstance
# File lib/twilio-ruby/rest/serverless/v1/service.rb 443 def update(include_credentials: :unset, friendly_name: :unset, ui_editable: :unset) 444 context.update( 445 include_credentials: include_credentials, 446 friendly_name: friendly_name, 447 ui_editable: ui_editable, 448 ) 449 end
@return [String] The absolute URL of the Service resource
# File lib/twilio-ruby/rest/serverless/v1/service.rb 410 def url 411 @properties['url'] 412 end