Class: Vonage::Meetings::Themes

Inherits:
Namespace
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/vonage/meetings/themes.rb

Defined Under Namespace

Classes: ListResponse

Instance Method Summary collapse

Instance Method Details

#create(main_color:, brand_text:, **params) ⇒ Response

Create a new theme.

Parameters:

  • :main_color (required, String)

    The main color that will be used for the meeting room.

  • :brand_text (required, String)

    The text that will appear on the meeting homepage, in the case that there is no brand image

  • :theme_name (optional, String)

    The name of the theme (must be unique). If null, a UUID will automatically be generated

  • :short_company_url (optional, String)

    The URL that will represent every meeting room with this theme. The value must be unique across Vonage

Returns:

See Also:



51
52
53
54
55
56
57
# File 'lib/vonage/meetings/themes.rb', line 51

def create(main_color:, brand_text:, **params)
  request(
    "/v1/meetings/themes",
    params: params.merge(main_color: main_color, brand_text: brand_text),
    type: Post
  )
end

#delete(theme_id:, force: false) ⇒ Response

Delete an existing theme.

a default theme. (Defaults to false)

Parameters:

  • :theme_id (required, String)

    The id of the theme to be deleted

  • :force. (optional, Boolean)

    Set to true to force delete a theme currently being used for a room, or as

Returns:

See Also:



98
99
100
101
102
103
# File 'lib/vonage/meetings/themes.rb', line 98

def delete(theme_id:, force: false)
  request(
    "/v1/meetings/themes/" + theme_id + "?force=#{force}",
    type: Delete
  )
end

#info(theme_id:) ⇒ Response

Return information for specified theme.

Parameters:

  • theme_id (required, String)

    The id of the theme for which the info should be returned

Returns:

See Also:



30
31
32
# File 'lib/vonage/meetings/themes.rb', line 30

def info(theme_id:)
  request("/v1/meetings/themes/" + theme_id)
end

#listListResponse

Get a list of themes associated with the Vonage application.



19
20
21
# File 'lib/vonage/meetings/themes.rb', line 19

def list
  request("/v1/meetings/themes", response_class: ListResponse)
end

#list_rooms(theme_id:, **params) ⇒ Response

Get a list of rooms that are associated with a theme id.

Parameters:

  • theme_id (required, String)

    THe ID of the theme to search for rooms associated with.

  • :start_id (optional, Integer)
  • :end_id (optional, Integer)
  • :page_size (optional, Integer)

Returns:

See Also:



118
119
120
121
122
123
# File 'lib/vonage/meetings/themes.rb', line 118

def list_rooms(theme_id:, **params)
  path = "/v1/meetings/themes/" + theme_id + "/rooms"
  path += "?#{Params.encode(params)}" unless params.empty?

  request(path, response_class: Meetings::Rooms::ListResponse)
end

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

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:



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/vonage/meetings/themes.rb', line 148

def (theme_id:, filepath:, logo_type:)
  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

#update(theme_id:, **params) ⇒ Response

Update an existing theme.

Parameters:

  • theme_id (required, String)

    The id of the theme to be updated

  • :main_color (required, String)

    The main color that will be used for the meeting room.

  • :brand_text (required, String)

    The text that will appear on the meeting homepage, in the case that there is no brand image

  • :theme_name (optional, String)

    The name of the theme (must be unique). If null, a UUID will automatically be generated

  • :short_company_url (optional, String)

    The URL that will represent every meeting room with this theme. The value must be unique across Vonage

Returns:

See Also:



78
79
80
81
82
83
84
85
86
# File 'lib/vonage/meetings/themes.rb', line 78

def update(theme_id:, **params)
  request(
    "/v1/meetings/themes/" + theme_id,
    params: {
      update_details: params
    },
    type: Patch
  )
end