## # This code was generated by # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ # # Twilio - Flex # This is the public Twilio REST API. # # NOTE: This class is auto generated by OpenAPI Generator. # https://openapi-generator.tech # Do not edit the class manually. # module Twilio module REST class FlexApi < FlexApiBase class V1 < Version class PluginConfigurationArchiveList < ListResource ## # Initialize the PluginConfigurationArchiveList # @param [Version] version Version that contains the resource # @return [PluginConfigurationArchiveList] PluginConfigurationArchiveList def initialize(version) super(version) # Path Solution @solution = { } end # Provide a user friendly representation def to_s '#' end end class PluginConfigurationArchiveContext < InstanceContext ## # Initialize the PluginConfigurationArchiveContext # @param [Version] version Version that contains the resource # @param [String] sid The SID of the Flex Plugin Configuration resource to archive. # @return [PluginConfigurationArchiveContext] PluginConfigurationArchiveContext def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/PluginService/Configurations/#{@solution[:sid]}/Archive" end ## # Update the PluginConfigurationArchiveInstance # @param [String] flex_metadata The Flex-Metadata HTTP request header # @return [PluginConfigurationArchiveInstance] Updated PluginConfigurationArchiveInstance def update( flex_metadata: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Flex-Metadata' => flex_metadata, }) payload = @version.update('POST', @uri, headers: headers) PluginConfigurationArchiveInstance.new( @version, payload, sid: @solution[:sid], ) end ## # Provide a user friendly representation def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#" end ## # Provide a detailed, user friendly representation def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#" end end class PluginConfigurationArchivePage < Page ## # Initialize the PluginConfigurationArchivePage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [PluginConfigurationArchivePage] PluginConfigurationArchivePage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of PluginConfigurationArchiveInstance # @param [Hash] payload Payload response from the API # @return [PluginConfigurationArchiveInstance] PluginConfigurationArchiveInstance def get_instance(payload) PluginConfigurationArchiveInstance.new(@version, payload) end ## # Provide a user friendly representation def to_s '' end end class PluginConfigurationArchiveInstance < InstanceResource ## # Initialize the PluginConfigurationArchiveInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] account_sid The SID of the # {Account}[https://www.twilio.com/docs/iam/api/account] that created this PluginConfigurationArchive # resource. # @param [String] sid The SID of the Call resource to fetch. # @return [PluginConfigurationArchiveInstance] PluginConfigurationArchiveInstance def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'name' => payload['name'], 'description' => payload['description'], 'archived' => payload['archived'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'url' => payload['url'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end ## # Generate an instance context for the instance, the context is capable of # performing various actions. All instance actions are proxied to the context # @return [PluginConfigurationArchiveContext] CallContext for this CallInstance def context unless @instance_context @instance_context = PluginConfigurationArchiveContext.new(@version , @params['sid']) end @instance_context end ## # @return [String] The unique string that we created to identify the Flex Plugin Configuration resource. def sid @properties['sid'] end ## # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Plugin Configuration resource and owns this resource. def account_sid @properties['account_sid'] end ## # @return [String] The name of this Flex Plugin Configuration. def name @properties['name'] end ## # @return [String] The description of the Flex Plugin Configuration resource. def description @properties['description'] end ## # @return [Boolean] Whether the Flex Plugin Configuration is archived. The default value is false. def archived @properties['archived'] end ## # @return [Time] The date and time in GMT when the Flex Plugin Configuration was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. def date_created @properties['date_created'] end ## # @return [String] The absolute URL of the Flex Plugin Configuration resource. def url @properties['url'] end ## # Update the PluginConfigurationArchiveInstance # @param [String] flex_metadata The Flex-Metadata HTTP request header # @return [PluginConfigurationArchiveInstance] Updated PluginConfigurationArchiveInstance def update( flex_metadata: :unset ) context.update( flex_metadata: flex_metadata, ) end ## # Provide a user friendly representation def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "" end ## # Provide a detailed, user friendly representation def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "" end end end end end end