Class: Vonage::Meetings::Themes
- Inherits:
-
Namespace
- Object
- Namespace
- Vonage::Meetings::Themes
- Extended by:
- T::Sig
- Defined in:
- lib/vonage/meetings/themes.rb
Defined Under Namespace
Classes: ListResponse
Instance Method Summary collapse
-
#create(main_color:, brand_text:, **params) ⇒ Response
Create a new theme.
-
#delete(theme_id:, force: false) ⇒ Response
Delete an existing theme.
-
#info(theme_id:) ⇒ Response
Return information for specified theme.
-
#list ⇒ ListResponse
Get a list of themes associated with the Vonage application.
-
#list_rooms(theme_id:, **params) ⇒ Response
Get a list of rooms that are associated with a theme id.
-
#set_logo(theme_id:, filepath:, logo_type:) ⇒ Response
Set a logo for a theme.
-
#update(theme_id:, **params) ⇒ Response
Update an existing theme.
Instance Method Details
#create(main_color:, brand_text:, **params) ⇒ Response
Create a new theme.
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
)
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.
30 31 32 |
# File 'lib/vonage/meetings/themes.rb', line 30 def info(theme_id:) request("/v1/meetings/themes/" + theme_id) end |
#list ⇒ ListResponse
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.
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
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/vonage/meetings/themes.rb', line 148 def set_logo(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.
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 |