Class: Twilio::REST::Video::V1::CompositionSettingsInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ CompositionSettingsInstance

Initialize the CompositionSettingsInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 137

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

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



170
171
172
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 170

def 
  @properties['account_sid']
end

#aws_credentials_sidString

Returns The SID of the stored Credential resource.

Returns:

  • (String)

    The SID of the stored Credential resource



182
183
184
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 182

def aws_credentials_sid
  @properties['aws_credentials_sid']
end

#aws_s3_urlString

Returns The URL of the AWS S3 bucket where the compositions are stored.

Returns:

  • (String)

    The URL of the AWS S3 bucket where the compositions are stored



188
189
190
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 188

def aws_s3_url
  @properties['aws_s3_url']
end

#aws_storage_enabledBoolean

Returns Whether all compositions are written to the aws_s3_url.

Returns:

  • (Boolean)

    Whether all compositions are written to the aws_s3_url



194
195
196
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 194

def aws_storage_enabled
  @properties['aws_storage_enabled']
end

#contextCompositionSettingsContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



161
162
163
164
165
166
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 161

def context
  unless @instance_context
    @instance_context = CompositionSettingsContext.new(@version, )
  end
  @instance_context
end

#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:



241
242
243
244
245
246
247
248
249
250
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 241

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

#encryption_enabledBoolean

Returns Whether all compositions are stored in an encrypted form.

Returns:

  • (Boolean)

    Whether all compositions are stored in an encrypted form



206
207
208
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 206

def encryption_enabled
  @properties['encryption_enabled']
end

#encryption_key_sidString

Returns The SID of the Public Key resource used for encryption.

Returns:

  • (String)

    The SID of the Public Key resource used for encryption



200
201
202
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 200

def encryption_key_sid
  @properties['encryption_key_sid']
end

#fetchCompositionSettingsInstance

Fetch the CompositionSettingsInstance

Returns:



219
220
221
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 219

def fetch
  context.fetch
end

#friendly_nameString

Returns The string that you assigned to describe the resource.

Returns:

  • (String)

    The string that you assigned to describe the resource



176
177
178
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 176

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



261
262
263
264
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 261

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Video.V1.CompositionSettingsInstance #{values}>"
end

#to_sObject

Provide a user friendly representation



254
255
256
257
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 254

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Video.V1.CompositionSettingsInstance #{values}>"
end

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource



212
213
214
# File 'lib/twilio-ruby/rest/video/v1/composition_settings.rb', line 212

def url
  @properties['url']
end