## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true module Twilio module REST class Video < Domain 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 '#' 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 '' 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 ## # Fetch the RecordingSettingsInstance # @return [RecordingSettingsInstance] Fetched RecordingSettingsInstance def fetch payload = @version.fetch('GET', @uri) RecordingSettingsInstance.new(@version, payload, ) 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. # @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, }) payload = @version.create('POST', @uri, data: data) RecordingSettingsInstance.new(@version, payload, ) 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 RecordingSettingsInstance < InstanceResource ## # Initialize the RecordingSettingsInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @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] RecordingSettingsContext for this RecordingSettingsInstance def context unless @instance_context @instance_context = RecordingSettingsContext.new(@version, ) end @instance_context end ## # @return [String] The SID of the Account that created the resource def account_sid @properties['account_sid'] end ## # @return [String] The string that you assigned to describe the resource 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 def aws_s3_url @properties['aws_s3_url'] end ## # @return [Boolean] Whether all recordings are written to the aws_s3_url 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 def encryption_enabled @properties['encryption_enabled'] end ## # @return [String] The absolute URL of the resource def url @properties['url'] end ## # Fetch the RecordingSettingsInstance # @return [RecordingSettingsInstance] Fetched RecordingSettingsInstance def fetch context.fetch 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. # @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 ## # 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