Class: Twilio::REST::Serverless::V1::ServiceContext::AssetContext::AssetVersionInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Serverless::V1::ServiceContext::AssetContext::AssetVersionInstance
- Defined in:
- lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Asset Version resource.
-
#asset_sid ⇒ String
The SID of the Asset resource that is the parent of the Asset Version.
-
#context ⇒ AssetVersionContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the Asset Version resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#fetch ⇒ AssetVersionInstance
Fetch the AssetVersionInstance.
-
#initialize(version, payload, service_sid: nil, asset_sid: nil, sid: nil) ⇒ AssetVersionInstance
constructor
Initialize the AssetVersionInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#path ⇒ String
The URL-friendly string by which the Asset Version can be referenced.
-
#service_sid ⇒ String
The SID of the Service that the Asset Version resource is associated with.
-
#sid ⇒ String
The unique string that we created to identify the Asset Version resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the Asset Version resource.
- #visibility ⇒ Visibility
Constructor Details
#initialize(version, payload, service_sid: nil, asset_sid: nil, sid: nil) ⇒ AssetVersionInstance
Initialize the AssetVersionInstance
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb', line 217 def initialize(version, payload , service_sid: nil, asset_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'asset_sid' => payload['asset_sid'], 'path' => payload['path'], 'visibility' => payload['visibility'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'url' => payload['url'], } # Context @instance_context = nil @params = { 'service_sid' => service_sid || @properties['service_sid'] ,'asset_sid' => asset_sid || @properties['asset_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Asset Version resource.
256 257 258 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb', line 256 def account_sid @properties['account_sid'] end |
#asset_sid ⇒ String
Returns The SID of the Asset resource that is the parent of the Asset Version.
268 269 270 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb', line 268 def asset_sid @properties['asset_sid'] end |
#context ⇒ AssetVersionContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
241 242 243 244 245 246 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb', line 241 def context unless @instance_context @instance_context = AssetVersionContext.new(@version , @params['service_sid'], @params['asset_sid'], @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the Asset Version resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
286 287 288 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb', line 286 def date_created @properties['date_created'] end |
#fetch ⇒ AssetVersionInstance
Fetch the AssetVersionInstance
299 300 301 302 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb', line 299 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
313 314 315 316 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb', line 313 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.AssetVersionInstance #{values}>" end |
#path ⇒ String
Returns The URL-friendly string by which the Asset Version can be referenced. It can be a maximum of 255 characters. All paths begin with a forward slash (‘/’). If an Asset Version creation request is submitted with a path not containing a leading slash, the path will automatically be prepended with one.
274 275 276 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb', line 274 def path @properties['path'] end |
#service_sid ⇒ String
Returns The SID of the Service that the Asset Version resource is associated with.
262 263 264 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb', line 262 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns The unique string that we created to identify the Asset Version resource.
250 251 252 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb', line 250 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
306 307 308 309 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb', line 306 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.AssetVersionInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the Asset Version resource.
292 293 294 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb', line 292 def url @properties['url'] end |
#visibility ⇒ Visibility
280 281 282 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb', line 280 def visibility @properties['visibility'] end |