Class: Twilio::REST::Serverless::V1::ServiceContext::FunctionContext::FunctionVersionContext::FunctionVersionContentInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, function_sid: nil, sid: nil) ⇒ FunctionVersionContentInstance

Initialize the FunctionVersionContentInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this FunctionVersionContent resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 276

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'],
        'content' => payload['content'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'service_sid' => service_sid  || @properties['service_sid']  ,'function_sid' => function_sid  || @properties['function_sid']  ,'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Function Version resource.

Returns:



314
315
316
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 314

def 
    @properties['account_sid']
end

#contentString

Returns The content of the Function Version resource.

Returns:

  • (String)

    The content of the Function Version resource.



332
333
334
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 332

def content
    @properties['content']
end

#contextFunctionVersionContentContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



299
300
301
302
303
304
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 299

def context
    unless @instance_context
        @instance_context = FunctionVersionContentContext.new(@version , @params['service_sid'], @params['function_sid'], @params['sid'])
    end
    @instance_context
end

#fetchFunctionVersionContentInstance

Fetch the FunctionVersionContentInstance

Returns:



345
346
347
348
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 345

def fetch

    context.fetch
end

#function_sidString

Returns The SID of the Function that is the parent of the Function Version.

Returns:

  • (String)

    The SID of the Function that is the parent of the Function Version.



326
327
328
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 326

def function_sid
    @properties['function_sid']
end

#inspectObject

Provide a detailed, user friendly representation



359
360
361
362
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 359

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Serverless.V1.FunctionVersionContentInstance #{values}>"
end

#service_sidString

Returns The SID of the Service that the Function Version resource is associated with.

Returns:

  • (String)

    The SID of the Service that the Function Version resource is associated with.



320
321
322
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 320

def service_sid
    @properties['service_sid']
end

#sidString

Returns The unique string that we created to identify the Function Version resource.

Returns:

  • (String)

    The unique string that we created to identify the Function Version resource.



308
309
310
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 308

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



352
353
354
355
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 352

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Serverless.V1.FunctionVersionContentInstance #{values}>"
end

#urlString

Returns:

  • (String)


338
339
340
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 338

def url
    @properties['url']
end