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


                    # Provide a user friendly representation
                    def to_s
                        '#<Twilio.Insights.V1.SettingList>'
                    end
                end


                class SettingContext < InstanceContext
                    ##
                    # Initialize the SettingContext
                    # @param [Version] version Version that contains the resource
                    # @return [SettingContext] SettingContext
                    def initialize(version)
                        super(version)

                        # Path Solution
                        @solution = {  }
                        @uri = "/Voice/Settings"

                        
                    end
                    ##
                    # Fetch the SettingInstance
                    # @param [String] subaccount_sid The unique SID identifier of the Subaccount.
                    # @return [SettingInstance] Fetched SettingInstance
                    def fetch(
                        subaccount_sid: :unset
                    )

                        params = Twilio::Values.of({
                            'SubaccountSid' => subaccount_sid,
                        })
                        payload = @version.fetch('GET', @uri, params: params)
                        SettingInstance.new(
                            @version,
                            payload,
                        )
                    end

                    ##
                    # Update the SettingInstance
                    # @param [Boolean] advanced_features A boolean flag to enable Advanced Features for Voice Insights.
                    # @param [Boolean] voice_trace A boolean flag to enable Voice Trace.
                    # @param [String] subaccount_sid The unique SID identifier of the Subaccount.
                    # @return [SettingInstance] Updated SettingInstance
                    def update(
                        advanced_features: :unset, 
                        voice_trace: :unset, 
                        subaccount_sid: :unset
                    )

                        data = Twilio::Values.of({
                            'AdvancedFeatures' => advanced_features,
                            'VoiceTrace' => voice_trace,
                            'SubaccountSid' => subaccount_sid,
                        })

                        payload = @version.update('POST', @uri, data: data)
                        SettingInstance.new(
                            @version,
                            payload,
                        )
                    end


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

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

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

                        # Path Solution
                        @solution = solution
                    end

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

                    ##
                    # Provide a user friendly representation
                    def to_s
                        '<Twilio.Insights.V1.SettingPage>'
                    end
                end
                class SettingInstance < InstanceResource
                    ##
                    # Initialize the SettingInstance
                    # @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 Setting
                    #   resource.
                    # @param [String] sid The SID of the Call resource to fetch.
                    # @return [SettingInstance] SettingInstance
                    def initialize(version, payload )
                        super(version)
                        
                        # Marshaled Properties
                        @properties = { 
                            'account_sid' => payload['account_sid'],
                            'advanced_features' => payload['advanced_features'],
                            'voice_trace' => payload['voice_trace'],
                            'url' => payload['url'],
                        }

                        # Context
                        @instance_context = nil
                        @params = {  }
                    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 [SettingContext] CallContext for this CallInstance
                    def context
                        unless @instance_context
                            @instance_context = SettingContext.new(@version )
                        end
                        @instance_context
                    end
                    
                    ##
                    # @return [String] The unique SID identifier of the Account.
                    def account_sid
                        @properties['account_sid']
                    end
                    
                    ##
                    # @return [Boolean] A boolean flag indicating whether Advanced Features for Voice Insights are enabled.
                    def advanced_features
                        @properties['advanced_features']
                    end
                    
                    ##
                    # @return [Boolean] A boolean flag indicating whether Voice Trace is enabled.
                    def voice_trace
                        @properties['voice_trace']
                    end
                    
                    ##
                    # @return [String] The URL of this resource.
                    def url
                        @properties['url']
                    end
                    
                    ##
                    # Fetch the SettingInstance
                    # @param [String] subaccount_sid The unique SID identifier of the Subaccount.
                    # @return [SettingInstance] Fetched SettingInstance
                    def fetch(
                        subaccount_sid: :unset
                    )

                        context.fetch(
                            subaccount_sid: subaccount_sid, 
                        )
                    end

                    ##
                    # Update the SettingInstance
                    # @param [Boolean] advanced_features A boolean flag to enable Advanced Features for Voice Insights.
                    # @param [Boolean] voice_trace A boolean flag to enable Voice Trace.
                    # @param [String] subaccount_sid The unique SID identifier of the Subaccount.
                    # @return [SettingInstance] Updated SettingInstance
                    def update(
                        advanced_features: :unset, 
                        voice_trace: :unset, 
                        subaccount_sid: :unset
                    )

                        context.update(
                            advanced_features: advanced_features, 
                            voice_trace: voice_trace, 
                            subaccount_sid: subaccount_sid, 
                        )
                    end

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

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

            end
        end
    end
end
