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

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, 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

  • service_sid (String) (defaults to: nil)

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

  • function_sid (String) (defaults to: nil)

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

  • sid (String) (defaults to: nil)

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


144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 144

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, 'function_sid' => function_sid, 'sid' => sid, }
end

Instance Method Details

#account_sidString

Returns The SID of the Account that created the Function Version resource.

Returns:

  • (String)

    The SID of the Account that created the Function Version resource


186
187
188
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 186

def 
  @properties['account_sid']
end

#contentString

Returns The content of the Function Version resource.

Returns:

  • (String)

    The content of the Function Version resource


204
205
206
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 204

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:


166
167
168
169
170
171
172
173
174
175
176
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 166

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:


217
218
219
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 217

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


198
199
200
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 198

def function_sid
  @properties['function_sid']
end

#inspectObject

Provide a detailed, user friendly representation


230
231
232
233
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 230

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


192
193
194
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 192

def service_sid
  @properties['service_sid']
end

#sidString

Returns The unique string that identifies the Function Version resource.

Returns:

  • (String)

    The unique string that identifies the Function Version resource


180
181
182
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 180

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation


223
224
225
226
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 223

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

#urlString

Returns The url.

Returns:

  • (String)

    The url


210
211
212
# File 'lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb', line 210

def url
  @properties['url']
end