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


                    # Provide a user friendly representation
                    def to_s
                        '#<Twilio.Video.V1.RecordingSettingsList>'
                    end
                end


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

                        # Path Solution
                        @solution = {  }
                        @uri = "/RecordingSettings/Default"

                        
                    end
                    ##
                    # Create the RecordingSettingsInstance
                    # @param [String] friendly_name A descriptive string that you create to describe the resource and be shown to users in the console
                    # @param [String] aws_credentials_sid The SID of the stored Credential resource.
                    # @param [String] encryption_key_sid The SID of the Public Key resource to use for encryption.
                    # @param [String] aws_s3_url The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2).
                    # @param [Boolean] aws_storage_enabled Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud.
                    # @param [Boolean] encryption_enabled Whether all recordings should be stored in an encrypted form. The default is `false`.
                    # @return [RecordingSettingsInstance] Created RecordingSettingsInstance
                    def create(
                        friendly_name: nil, 
                        aws_credentials_sid: :unset, 
                        encryption_key_sid: :unset, 
                        aws_s3_url: :unset, 
                        aws_storage_enabled: :unset, 
                        encryption_enabled: :unset
                    )

                        data = Twilio::Values.of({
                            'FriendlyName' => friendly_name,
                            'AwsCredentialsSid' => aws_credentials_sid,
                            'EncryptionKeySid' => encryption_key_sid,
                            'AwsS3Url' => aws_s3_url,
                            'AwsStorageEnabled' => aws_storage_enabled,
                            'EncryptionEnabled' => encryption_enabled,
                        })

                        headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
                        
                        
                        
                        
                        
                        payload = @version.create('POST', @uri, data: data, headers: headers)
                        RecordingSettingsInstance.new(
                            @version,
                            payload,
                        )
                    end

                    ##
                    # Fetch the RecordingSettingsInstance
                    # @return [RecordingSettingsInstance] Fetched RecordingSettingsInstance
                    def fetch

                        headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
                        
                        
                        
                        
                        
                        payload = @version.fetch('GET', @uri, headers: headers)
                        RecordingSettingsInstance.new(
                            @version,
                            payload,
                        )
                    end


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

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

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

                        # Path Solution
                        @solution = solution
                    end

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

                    ##
                    # Provide a user friendly representation
                    def to_s
                        '<Twilio.Video.V1.RecordingSettingsPage>'
                    end
                end
                class RecordingSettingsInstance < InstanceResource
                    ##
                    # Initialize the RecordingSettingsInstance
                    # @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 RecordingSettings
                    #   resource.
                    # @param [String] sid The SID of the Call resource to fetch.
                    # @return [RecordingSettingsInstance] RecordingSettingsInstance
                    def initialize(version, payload )
                        super(version)
                        
                        # Marshaled Properties
                        @properties = { 
                            'account_sid' => payload['account_sid'],
                            'friendly_name' => payload['friendly_name'],
                            'aws_credentials_sid' => payload['aws_credentials_sid'],
                            'aws_s3_url' => payload['aws_s3_url'],
                            'aws_storage_enabled' => payload['aws_storage_enabled'],
                            'encryption_key_sid' => payload['encryption_key_sid'],
                            'encryption_enabled' => payload['encryption_enabled'],
                            '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 [RecordingSettingsContext] CallContext for this CallInstance
                    def context
                        unless @instance_context
                            @instance_context = RecordingSettingsContext.new(@version )
                        end
                        @instance_context
                    end
                    
                    ##
                    # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the RecordingSettings resource.
                    def account_sid
                        @properties['account_sid']
                    end
                    
                    ##
                    # @return [String] The string that you assigned to describe the resource and show the user in the console
                    def friendly_name
                        @properties['friendly_name']
                    end
                    
                    ##
                    # @return [String] The SID of the stored Credential resource.
                    def aws_credentials_sid
                        @properties['aws_credentials_sid']
                    end
                    
                    ##
                    # @return [String] The URL of the AWS S3 bucket where the recordings are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2).
                    def aws_s3_url
                        @properties['aws_s3_url']
                    end
                    
                    ##
                    # @return [Boolean] Whether all recordings are written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud.
                    def aws_storage_enabled
                        @properties['aws_storage_enabled']
                    end
                    
                    ##
                    # @return [String] The SID of the Public Key resource used for encryption.
                    def encryption_key_sid
                        @properties['encryption_key_sid']
                    end
                    
                    ##
                    # @return [Boolean] Whether all recordings are stored in an encrypted form. The default is `false`.
                    def encryption_enabled
                        @properties['encryption_enabled']
                    end
                    
                    ##
                    # @return [String] The absolute URL of the resource.
                    def url
                        @properties['url']
                    end
                    
                    ##
                    # Create the RecordingSettingsInstance
                    # @param [String] friendly_name A descriptive string that you create to describe the resource and be shown to users in the console
                    # @param [String] aws_credentials_sid The SID of the stored Credential resource.
                    # @param [String] encryption_key_sid The SID of the Public Key resource to use for encryption.
                    # @param [String] aws_s3_url The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2).
                    # @param [Boolean] aws_storage_enabled Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud.
                    # @param [Boolean] encryption_enabled Whether all recordings should be stored in an encrypted form. The default is `false`.
                    # @return [RecordingSettingsInstance] Created RecordingSettingsInstance
                    def create(
                        friendly_name: nil, 
                        aws_credentials_sid: :unset, 
                        encryption_key_sid: :unset, 
                        aws_s3_url: :unset, 
                        aws_storage_enabled: :unset, 
                        encryption_enabled: :unset
                    )

                        context.create(
                            friendly_name: friendly_name, 
                            aws_credentials_sid: aws_credentials_sid, 
                            encryption_key_sid: encryption_key_sid, 
                            aws_s3_url: aws_s3_url, 
                            aws_storage_enabled: aws_storage_enabled, 
                            encryption_enabled: encryption_enabled, 
                        )
                    end

                    ##
                    # Fetch the RecordingSettingsInstance
                    # @return [RecordingSettingsInstance] Fetched RecordingSettingsInstance
                    def fetch

                        context.fetch
                    end

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

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

            end
        end
    end
end
