Method: Vonage::Meetings::Themes#set_logo

Defined in:
lib/vonage/meetings/themes.rb

#set_logo(theme_id:, filepath:, logo_type:) ⇒ Response

Deprecated.

Set a logo for a theme.

TODO: add type signature

Parameters:

  • :theme_id (required, String)

    The ID of the theme for which the logo should be set

  • :filepath (required, String)

    The filepath of the logo file. Logo files must conform to the following requirements:

    • Format: PNG
    • Maximum size: 1MB
    • Background must be transparent
    • Dimensions:
      • 1 px - 300 px (white and colored logos)
      • 16 x 16 - 32 x 32 and must be square (favicon)
  • :logo_type (required, String)

    The type of logo to be set. Must be one of white, colored, favicon

Returns:

Raises:

  • (ArgumentError)

See Also:



168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/vonage/meetings/themes.rb', line 168

def (theme_id:, filepath:, logo_type:)
  logger.info('This method is deprecated and will be removed in a future release.')
  pn = Pathname.new(filepath)
  valid_logo_types = ['white', 'colored', 'favicon']
  raise ArgumentError, ':filepath not for a file' unless pn.file?
  raise ArgumentError, 'file at :filepath not readable' unless pn.readable?
  raise ArgumentError, "logo_type: must be one of #{valid_logo_types}" unless valid_logo_types.include?(logo_type)

  logo_upload_credentials = get_logo_upload_credentials

  filtered_logo_upload_credentials = logo_upload_credentials.select {|cred| cred.fields.logo_type == logo_type }.first

  upload_logo_file(filepath: filepath, credentials: filtered_logo_upload_credentials)

  finalize_logos(theme_id: theme_id, keys: [filtered_logo_upload_credentials.fields.key])
end