Class: Twilio::REST::FlexApi::V1::PluginVersionArchiveContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/flex_api/v1/plugin_version_archive.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, plugin_sid, sid) ⇒ PluginVersionArchiveContext

Initialize the PluginVersionArchiveContext

Parameters:

  • version (Version)

    Version that contains the resource

  • plugin_sid (String)

    The SID of the Flex Plugin the resource to belongs to.

  • sid (String)

    The SID of the Flex Plugin Version resource to archive.



50
51
52
53
54
55
56
57
58
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_version_archive.rb', line 50

def initialize(version, plugin_sid, sid)
    super(version)

    # Path Solution
    @solution = { plugin_sid: plugin_sid, sid: sid,  }
    @uri = "/PluginService/Plugins/#{@solution[:plugin_sid]}/Versions/#{@solution[:sid]}/Archive"

    
end

Instance Method Details

#inspectObject

Provide a detailed, user friendly representation



92
93
94
95
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_version_archive.rb', line 92

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

#to_sObject

Provide a user friendly representation



85
86
87
88
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_version_archive.rb', line 85

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

#update(flex_metadata: :unset) ⇒ PluginVersionArchiveInstance

Update the PluginVersionArchiveInstance

Parameters:

  • flex_metadata (String) (defaults to: :unset)

    The Flex-Metadata HTTP request header

Returns:



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_version_archive.rb', line 63

def update(
    flex_metadata: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Flex-Metadata' => , })
    
    
    
    
    
    payload = @version.update('POST', @uri, headers: headers)
    PluginVersionArchiveInstance.new(
        @version,
        payload,
        plugin_sid: @solution[:plugin_sid],
        sid: @solution[:sid],
    )
end