##
#    This code was generated by
#    ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
#     |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
#     |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \
#
#    Twilio - Numbers
#    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 Numbers < NumbersBase
            class V1 < Version
                class PortingWebhookConfigurationDeleteList < ListResource
                
                    ##
                    # Initialize the PortingWebhookConfigurationDeleteList
                    # @param [Version] version Version that contains the resource
                    # @return [PortingWebhookConfigurationDeleteList] PortingWebhookConfigurationDeleteList
                    def initialize(version)
                        super(version)
                        # Path Solution
                        @solution = {  }
                        
                        
                    end
                


                    # Provide a user friendly representation
                    def to_s
                        '#<Twilio.Numbers.V1.PortingWebhookConfigurationDeleteList>'
                    end
                end


                class PortingWebhookConfigurationDeleteContext < InstanceContext
                    ##
                    # Initialize the PortingWebhookConfigurationDeleteContext
                    # @param [Version] version Version that contains the resource
                    # @param [WebhookType] webhook_type The webhook type for the configuration to be delete. `PORT_IN`, `PORT_OUT`
                    # @return [PortingWebhookConfigurationDeleteContext] PortingWebhookConfigurationDeleteContext
                    def initialize(version, webhook_type)
                        super(version)

                        # Path Solution
                        @solution = { webhook_type: webhook_type,  }
                        @uri = "/Porting/Configuration/Webhook/#{@solution[:webhook_type]}"

                        
                    end
                    ##
                    # Delete the PortingWebhookConfigurationDeleteInstance
                    # @return [Boolean] True if delete succeeds, false otherwise
                    def delete

                        headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
                        
                        
                        
                        @version.delete('DELETE', @uri, headers: headers)
                    end


                    ##
                    # Provide a user friendly representation
                    def to_s
                        context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
                        "#<Twilio.Numbers.V1.PortingWebhookConfigurationDeleteContext #{context}>"
                    end

                    ##
                    # Provide a detailed, user friendly representation
                    def inspect
                        context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
                        "#<Twilio.Numbers.V1.PortingWebhookConfigurationDeleteContext #{context}>"
                    end
                end

                class PortingWebhookConfigurationDeletePage < Page
                    ##
                    # Initialize the PortingWebhookConfigurationDeletePage
                    # @param [Version] version Version that contains the resource
                    # @param [Response] response Response from the API
                    # @param [Hash] solution Path solution for the resource
                    # @return [PortingWebhookConfigurationDeletePage] PortingWebhookConfigurationDeletePage
                    def initialize(version, response, solution)
                        super(version, response)

                        # Path Solution
                        @solution = solution
                    end

                    ##
                    # Build an instance of PortingWebhookConfigurationDeleteInstance
                    # @param [Hash] payload Payload response from the API
                    # @return [PortingWebhookConfigurationDeleteInstance] PortingWebhookConfigurationDeleteInstance
                    def get_instance(payload)
                        PortingWebhookConfigurationDeleteInstance.new(@version, payload)
                    end

                    ##
                    # Provide a user friendly representation
                    def to_s
                        '<Twilio.Numbers.V1.PortingWebhookConfigurationDeletePage>'
                    end
                end
                class PortingWebhookConfigurationDeleteInstance < InstanceResource
                    ##
                    # Initialize the PortingWebhookConfigurationDeleteInstance
                    # @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 PortingWebhookConfigurationDelete
                    #   resource.
                    # @param [String] sid The SID of the Call resource to fetch.
                    # @return [PortingWebhookConfigurationDeleteInstance] PortingWebhookConfigurationDeleteInstance
                    def initialize(version , webhook_type: nil)
                        super(version)
                        

                        # Context
                        @instance_context = nil
                        @params = { 'webhook_type' => webhook_type  || @properties['webhook_type']  , }
                    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 [PortingWebhookConfigurationDeleteContext] CallContext for this CallInstance
                    def context
                        unless @instance_context
                            @instance_context = PortingWebhookConfigurationDeleteContext.new(@version , @params['webhook_type'])
                        end
                        @instance_context
                    end
                    
                    ##
                    # Delete the PortingWebhookConfigurationDeleteInstance
                    # @return [Boolean] True if delete succeeds, false otherwise
                    def delete

                        context.delete
                    end

                    ##
                    # Provide a user friendly representation
                    def to_s
                        values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
                        "<Twilio.Numbers.V1.PortingWebhookConfigurationDeleteInstance #{values}>"
                    end

                    ##
                    # Provide a detailed, user friendly representation
                    def inspect
                        values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
                        "<Twilio.Numbers.V1.PortingWebhookConfigurationDeleteInstance #{values}>"
                    end
                end

            end
        end
    end
end
