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

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

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid, function_sid, sid) ⇒ FunctionVersionContentContext

Initialize the FunctionVersionContentContext

Parameters:

  • version (Version)

    Version that contains the resource

  • service_sid (String)

    The SID of the Service to fetch the Function Version content from.

  • function_sid (String)

    The SID of the Function that is the parent of the Function Version content to fetch.

  • sid (String)

    The SID of the Function Version content to fetch.



56
57
58
59
60
61
62
63
64
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 56

def initialize(version, service_sid, function_sid, sid)
    super(version)

    # Path Solution
    @solution = { service_sid: service_sid, function_sid: function_sid, sid: sid,  }
    @uri = "/Services/#{@solution[:service_sid]}/Functions/#{@solution[:function_sid]}/Versions/#{@solution[:sid]}/Content"

    
end

Instance Method Details

#fetchFunctionVersionContentInstance

Fetch the FunctionVersionContentInstance

Returns:



68
69
70
71
72
73
74
75
76
77
78
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 68

def fetch

    payload = @version.fetch('GET', @uri)
    FunctionVersionContentInstance.new(
        @version,
        payload,
        service_sid: @solution[:service_sid],
        function_sid: @solution[:function_sid],
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



90
91
92
93
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 90

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Serverless.V1.FunctionVersionContentContext #{context}>"
end

#to_sObject

Provide a user friendly representation



83
84
85
86
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 83

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Serverless.V1.FunctionVersionContentContext #{context}>"
end