class Twilio::REST::Serverless::V1::ServiceContext::AssetContext::AssetVersionInstance
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the AssetVersionInstance
@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 Version
resource is associated with.
@param [String] asset_sid
The SID of the Asset resource that is the parent of
the Asset Version.
@param [String] sid The SID of the Asset Version
resource to fetch. @return [AssetVersionInstance] AssetVersionInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb 220 def initialize(version, payload, service_sid: nil, asset_sid: nil, sid: nil) 221 super(version) 222 223 # Marshaled Properties 224 @properties = { 225 'sid' => payload['sid'], 226 'account_sid' => payload['account_sid'], 227 'service_sid' => payload['service_sid'], 228 'asset_sid' => payload['asset_sid'], 229 'path' => payload['path'], 230 'visibility' => payload['visibility'], 231 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 232 'url' => payload['url'], 233 } 234 235 # Context 236 @instance_context = nil 237 @params = { 238 'service_sid' => service_sid, 239 'asset_sid' => asset_sid, 240 'sid' => sid || @properties['sid'], 241 } 242 end
Public Instance Methods
@return [String] The SID of the Account that created the Asset Version
resource
# File lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb 268 def account_sid 269 @properties['account_sid'] 270 end
@return [String] The SID of the Asset resource that is the parent of the Asset Version
# File lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb 280 def asset_sid 281 @properties['asset_sid'] 282 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 [AssetVersionContext] AssetVersionContext
for this AssetVersionInstance
# File lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb 248 def context 249 unless @instance_context 250 @instance_context = AssetVersionContext.new( 251 @version, 252 @params['service_sid'], 253 @params['asset_sid'], 254 @params['sid'], 255 ) 256 end 257 @instance_context 258 end
@return [Time] The ISO 8601 date and time in GMT when the Asset Version
resource was created
# File lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb 298 def date_created 299 @properties['date_created'] 300 end
Fetch the AssetVersionInstance
@return [AssetVersionInstance] Fetched AssetVersionInstance
# File lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb 311 def fetch 312 context.fetch 313 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb 324 def inspect 325 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 326 "<Twilio.Serverless.V1.AssetVersionInstance #{values}>" 327 end
@return [String] The URL-friendly string by which the Asset Version
can be referenced
# File lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb 286 def path 287 @properties['path'] 288 end
@return [String] The SID of the Service that the Asset Version
resource is associated with
# File lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb 274 def service_sid 275 @properties['service_sid'] 276 end
@return [String] The unique string that identifies the Asset Version
resource
# File lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb 262 def sid 263 @properties['sid'] 264 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb 317 def to_s 318 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 319 "<Twilio.Serverless.V1.AssetVersionInstance #{values}>" 320 end
@return [String] The absolute URL of the Asset Version
resource
# File lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb 304 def url 305 @properties['url'] 306 end
@return [asset_version.Visibility] The access control that determines how the Asset Version
can be accessed
# File lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb 292 def visibility 293 @properties['visibility'] 294 end