## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true module Twilio module REST class Video < Domain class V1 < Version class CompositionSettingsList < ListResource ## # Initialize the CompositionSettingsList # @param [Version] version Version that contains the resource # @return [CompositionSettingsList] CompositionSettingsList def initialize(version) super(version) # Path Solution @solution = {} end ## # Provide a user friendly representation def to_s '#' end end class CompositionSettingsPage < Page ## # Initialize the CompositionSettingsPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [CompositionSettingsPage] CompositionSettingsPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of CompositionSettingsInstance # @param [Hash] payload Payload response from the API # @return [CompositionSettingsInstance] CompositionSettingsInstance def get_instance(payload) CompositionSettingsInstance.new(@version, payload, ) end ## # Provide a user friendly representation def to_s '' end end class CompositionSettingsContext < InstanceContext ## # Initialize the CompositionSettingsContext # @param [Version] version Version that contains the resource # @return [CompositionSettingsContext] CompositionSettingsContext def initialize(version) super(version) # Path Solution @solution = {} @uri = "/CompositionSettings/Default" end ## # Fetch the CompositionSettingsInstance # @return [CompositionSettingsInstance] Fetched CompositionSettingsInstance def fetch payload = @version.fetch('GET', @uri) CompositionSettingsInstance.new(@version, payload, ) end ## # Create the CompositionSettingsInstance # @param [String] friendly_name A descriptive string that you create to describe # the resource and show to the user 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 compositions # should be stored. We only support DNS-compliant URLs like # `https://.s3-.amazonaws.com/compositions`, where # `compositions` is the path in which you want the compositions to be stored. This # URL accepts only URI-valid characters, as described in the RFC 3986. # @param [Boolean] aws_storage_enabled Whether all compositions should be written # to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. # @param [Boolean] encryption_enabled Whether all compositions should be stored in # an encrypted form. The default is `false`. # @return [CompositionSettingsInstance] Created CompositionSettingsInstance 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) CompositionSettingsInstance.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 CompositionSettingsInstance < InstanceResource ## # Initialize the CompositionSettingsInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @return [CompositionSettingsInstance] CompositionSettingsInstance 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 [CompositionSettingsContext] CompositionSettingsContext for this CompositionSettingsInstance def context unless @instance_context @instance_context = CompositionSettingsContext.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 compositions are stored def aws_s3_url @properties['aws_s3_url'] end ## # @return [Boolean] Whether all compositions 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 compositions 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 CompositionSettingsInstance # @return [CompositionSettingsInstance] Fetched CompositionSettingsInstance def fetch context.fetch end ## # Create the CompositionSettingsInstance # @param [String] friendly_name A descriptive string that you create to describe # the resource and show to the user 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 compositions # should be stored. We only support DNS-compliant URLs like # `https://.s3-.amazonaws.com/compositions`, where # `compositions` is the path in which you want the compositions to be stored. This # URL accepts only URI-valid characters, as described in the RFC 3986. # @param [Boolean] aws_storage_enabled Whether all compositions should be written # to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. # @param [Boolean] encryption_enabled Whether all compositions should be stored in # an encrypted form. The default is `false`. # @return [CompositionSettingsInstance] Created CompositionSettingsInstance 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