class Twilio::REST::Serverless::V1::ServiceContext::AssetInstance
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the AssetInstance
@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 Asset resource is
associated with.
@param [String] sid The SID that identifies the Asset resource to fetch. @return [AssetInstance] AssetInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/serverless/v1/service/asset.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
@return [String] The SID of the Account that created the Asset resource
# File lib/twilio-ruby/rest/serverless/v1/service/asset.rb 299 def account_sid 300 @properties['account_sid'] 301 end
Access the asset_versions
@return [asset_versions] asset_versions
# File lib/twilio-ruby/rest/serverless/v1/service/asset.rb 365 def asset_versions 366 context.asset_versions 367 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 [AssetContext] AssetContext
for this AssetInstance
# File lib/twilio-ruby/rest/serverless/v1/service/asset.rb 284 def context 285 unless @instance_context 286 @instance_context = AssetContext.new(@version, @params['service_sid'], @params['sid'], ) 287 end 288 @instance_context 289 end
@return [Time] The ISO 8601 date and time in GMT when the Asset resource was created
# File lib/twilio-ruby/rest/serverless/v1/service/asset.rb 317 def date_created 318 @properties['date_created'] 319 end
@return [Time] The ISO 8601 date and time in GMT when the Asset resource was last updated
# File lib/twilio-ruby/rest/serverless/v1/service/asset.rb 323 def date_updated 324 @properties['date_updated'] 325 end
Delete the AssetInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/serverless/v1/service/asset.rb 349 def delete 350 context.delete 351 end
Fetch the AssetInstance
@return [AssetInstance] Fetched AssetInstance
# File lib/twilio-ruby/rest/serverless/v1/service/asset.rb 342 def fetch 343 context.fetch 344 end
@return [String] The string that you assigned to describe the Asset resource
# File lib/twilio-ruby/rest/serverless/v1/service/asset.rb 311 def friendly_name 312 @properties['friendly_name'] 313 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/serverless/v1/service/asset.rb 378 def inspect 379 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 380 "<Twilio.Serverless.V1.AssetInstance #{values}>" 381 end
@return [String] The URLs of the Asset resource's nested resources
# File lib/twilio-ruby/rest/serverless/v1/service/asset.rb 335 def links 336 @properties['links'] 337 end
@return [String] The SID of the Service that the Asset resource is associated with
# File lib/twilio-ruby/rest/serverless/v1/service/asset.rb 305 def service_sid 306 @properties['service_sid'] 307 end
@return [String] The unique string that identifies the Asset resource
# File lib/twilio-ruby/rest/serverless/v1/service/asset.rb 293 def sid 294 @properties['sid'] 295 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/serverless/v1/service/asset.rb 371 def to_s 372 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 373 "<Twilio.Serverless.V1.AssetInstance #{values}>" 374 end
Update the AssetInstance
@param [String] friendly_name
A descriptive string that you create to describe
the Asset resource. It can be a maximum of 255 characters.
@return [AssetInstance] Updated AssetInstance
# File lib/twilio-ruby/rest/serverless/v1/service/asset.rb 358 def update(friendly_name: nil) 359 context.update(friendly_name: friendly_name, ) 360 end
@return [String] The absolute URL of the Asset resource
# File lib/twilio-ruby/rest/serverless/v1/service/asset.rb 329 def url 330 @properties['url'] 331 end