Class: Twilio::REST::Serverless::V1::ServiceContext::FunctionContext::FunctionVersionInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Serverless::V1::ServiceContext::FunctionContext::FunctionVersionInstance
- Defined in:
- lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the Function Version resource.
-
#context ⇒ FunctionVersionContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The ISO 8601 date and time in GMT when the Function Version resource was created.
-
#fetch ⇒ FunctionVersionInstance
Fetch a FunctionVersionInstance.
-
#function_sid ⇒ String
The SID of the function that is the parent of the function version.
-
#initialize(version, payload, service_sid: nil, function_sid: nil, sid: nil) ⇒ FunctionVersionInstance
constructor
Initialize the FunctionVersionInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#path ⇒ String
The URL-friendly string by which the function version can be referenced.
-
#service_sid ⇒ String
The SID of the Service that the Function Version resource is associated with.
-
#sid ⇒ String
The unique string that identifies the Function Version resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the Function Version resource.
-
#visibility ⇒ function_version.Visibility
The access control that determines how the function version can be accessed.
Constructor Details
#initialize(version, payload, service_sid: nil, function_sid: nil, sid: nil) ⇒ FunctionVersionInstance
Initialize the FunctionVersionInstance
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb', line 228 def initialize(version, payload, service_sid: nil, function_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'function_sid' => payload['function_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, 'function_sid' => function_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the Account that created the Function Version resource.
276 277 278 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb', line 276 def account_sid @properties['account_sid'] end |
#context ⇒ FunctionVersionContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
256 257 258 259 260 261 262 263 264 265 266 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb', line 256 def context unless @instance_context @instance_context = FunctionVersionContext.new( @version, @params['service_sid'], @params['function_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The ISO 8601 date and time in GMT when the Function Version resource was created.
306 307 308 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb', line 306 def date_created @properties['date_created'] end |
#fetch ⇒ FunctionVersionInstance
Fetch a FunctionVersionInstance
319 320 321 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb', line 319 def fetch context.fetch end |
#function_sid ⇒ String
Returns The SID of the function that is the parent of the function version.
288 289 290 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb', line 288 def function_sid @properties['function_sid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
332 333 334 335 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb', line 332 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.FunctionVersionInstance #{values}>" end |
#path ⇒ String
Returns The URL-friendly string by which the function version can be referenced.
294 295 296 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb', line 294 def path @properties['path'] end |
#service_sid ⇒ String
Returns The SID of the Service that the Function Version resource is associated with.
282 283 284 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb', line 282 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns The unique string that identifies the Function Version resource.
270 271 272 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb', line 270 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
325 326 327 328 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb', line 325 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.FunctionVersionInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the Function Version resource.
312 313 314 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb', line 312 def url @properties['url'] end |
#visibility ⇒ function_version.Visibility
Returns The access control that determines how the function version can be accessed.
300 301 302 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb', line 300 def visibility @properties['visibility'] end |