Class: Twilio::REST::Video::V1::CompositionSettingsContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/video/v1/composition_settings.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ CompositionSettingsContext

Initialize the CompositionSettingsContext

Parameters:

  • version (Version)

    Version that contains the resource



47
48
49
50
51
52
53
54
55
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 47

def initialize(version)
    super(version)

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

    
end

Instance Method Details

#create(friendly_name: nil, aws_credentials_sid: :unset, encryption_key_sid: :unset, aws_s3_url: :unset, aws_storage_enabled: :unset, encryption_enabled: :unset) ⇒ CompositionSettingsInstance

Create the CompositionSettingsInstance

Parameters:

  • friendly_name (String) (defaults to: nil)

    A descriptive string that you create to describe the resource and show to the user in the console

  • aws_credentials_sid (String) (defaults to: :unset)

    The SID of the stored Credential resource.

  • encryption_key_sid (String) (defaults to: :unset)

    The SID of the Public Key resource to use for encryption.

  • aws_s3_url (String) (defaults to: :unset)

    The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like ‘documentation-example-twilio-bucket/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 <a href=’tools.ietf.org/html/rfc3986#section-2’>RFC 3986</a>.

  • aws_storage_enabled (Boolean) (defaults to: :unset)

    Whether all compositions should be written to the ‘aws_s3_url`. When `false`, all compositions are stored in our cloud.

  • encryption_enabled (Boolean) (defaults to: :unset)

    Whether all compositions should be stored in an encrypted form. The default is ‘false`.

Returns:



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 65

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

#fetchCompositionSettingsInstance

Fetch the CompositionSettingsInstance

Returns:



93
94
95
96
97
98
99
100
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 93

def fetch

    payload = @version.fetch('GET', @uri)
    CompositionSettingsInstance.new(
        @version,
        payload,
    )
end

#inspectObject

Provide a detailed, user friendly representation



112
113
114
115
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 112

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Video.V1.CompositionSettingsContext #{context}>"
end

#to_sObject

Provide a user friendly representation



105
106
107
108
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 105

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Video.V1.CompositionSettingsContext #{context}>"
end