Class: Twilio::REST::Video::V1::RecordingSettingsInstance

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

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ RecordingSettingsInstance

Initialize the RecordingSettingsInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/twilio-ruby/rest/video/v1/recording_settings.rb', line 154

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 Twilio Account SID associated with this item.

Returns:

  • (String)

    The Twilio Account SID associated with this item



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

def 
  @properties['account_sid']
end

#aws_credentials_sidString

Returns SID of the Stored Credential resource CRxx.

Returns:

  • (String)

    SID of the Stored Credential resource CRxx



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

def aws_credentials_sid
  @properties['aws_credentials_sid']
end

#aws_s3_urlString

Returns URL of the S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like http://<my-bucket>.s3-<aws-region>.amazonaws.com/recordings, where recordings is the path where you want recordings to be stored.

Returns:

  • (String)

    URL of the S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like http://<my-bucket>.s3-<aws-region>.amazonaws.com/recordings, where recordings is the path where you want recordings to be stored.



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

def aws_s3_url
  @properties['aws_s3_url']
end

#aws_storage_enabledBoolean

Returns true|false When set to true, all Recordings will be written to the AwsS3Url specified above. When set to false, all Recordings will be stored in Twilio’s cloud.

Returns:

  • (Boolean)

    true|false When set to true, all Recordings will be written to the AwsS3Url specified above. When set to false, all Recordings will be stored in Twilio’s cloud.



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

def aws_storage_enabled
  @properties['aws_storage_enabled']
end

#contextRecordingSettingsContext

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

Returns:



178
179
180
181
182
183
# File 'lib/twilio-ruby/rest/video/v1/recording_settings.rb', line 178

def context
  unless @instance_context
    @instance_context = RecordingSettingsContext.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) ⇒ RecordingSettingsInstance

Retrieve a single page of RecordingSettingsInstance records from the API. Request is executed immediately.

Parameters:

  • friendly_name (String) (defaults to: nil)

    Friendly name of the configuration to be shown in the console

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

    SID of the Stored Credential resource ‘CRxx`

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

    SID of the Public Key resource ‘CRxx`

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

    Identity of the external location where the recordings should be stored. We only support DNS-compliant URLs like ‘http://<my-bucket>.s3-<aws-region>.amazonaws.com/recordings`, where `recordings` is the path where you want recordings to be stored.

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

    ‘true|false` When set to `true`, all Recordings will be written to the `AwsS3Url` specified above. When set to `false`, all Recordings will be stored in Twilio’s cloud.

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

    ‘true|false` When set to `true`, all Recordings will be stored encrypted. Dafault value is `false`

Returns:



257
258
259
260
261
262
263
264
265
266
# File 'lib/twilio-ruby/rest/video/v1/recording_settings.rb', line 257

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 true|false When set to true, all Recordings will be stored encrypted.

Returns:

  • (Boolean)

    true|false When set to true, all Recordings will be stored encrypted.



223
224
225
# File 'lib/twilio-ruby/rest/video/v1/recording_settings.rb', line 223

def encryption_enabled
  @properties['encryption_enabled']
end

#encryption_key_sidString

Returns SID of the Public Key resource CRxx.

Returns:

  • (String)

    SID of the Public Key resource CRxx



217
218
219
# File 'lib/twilio-ruby/rest/video/v1/recording_settings.rb', line 217

def encryption_key_sid
  @properties['encryption_key_sid']
end

#fetchRecordingSettingsInstance

Fetch a RecordingSettingsInstance

Returns:



236
237
238
# File 'lib/twilio-ruby/rest/video/v1/recording_settings.rb', line 236

def fetch
  context.fetch
end

#friendly_nameString

Returns Friendly name of the configuration to be shown in the console.

Returns:

  • (String)

    Friendly name of the configuration to be shown in the console



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

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



277
278
279
280
# File 'lib/twilio-ruby/rest/video/v1/recording_settings.rb', line 277

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

#to_sObject

Provide a user friendly representation



270
271
272
273
# File 'lib/twilio-ruby/rest/video/v1/recording_settings.rb', line 270

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

#urlString

Returns The url.

Returns:

  • (String)

    The url



229
230
231
# File 'lib/twilio-ruby/rest/video/v1/recording_settings.rb', line 229

def url
  @properties['url']
end