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.


92
93
94
95
96
97
98
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 92

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:


103
104
105
106
107
108
109
110
111
112
113
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 103

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


124
125
126
127
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 124

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

#to_sObject

Provide a user friendly representation


117
118
119
120
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 117

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