Skip to content

Commit

Permalink
DEVX-8720/DEVX-8686: Numbers, Meetings, and Proactive Connect mainten…
Browse files Browse the repository at this point in the history
…ance (#314)

* Updating code comments for Numbers API implementation

* Adding deprecation warnings to Proactive Connect API implementation

* Adding deprecation warnings to Meetings API implementation

* Fixing links in README
  • Loading branch information
superchilled authored Aug 22, 2024
1 parent 9327396 commit 2edf796
Show file tree
Hide file tree
Showing 15 changed files with 136 additions and 24 deletions.
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ client = Vonage::Client.new(application_id: application_id, private_key: private
```

Both arguments should have string values corresponding to the `id` and `private_key`
values returned in a ["create an application"](https://developer.nexmo.com/api/application.v2#createApplication)
values returned in a ["create an application"](https://developer.vonage.com/api/application.v2#createApplication)
response. These credentials can be stored in a datastore, in environment variables,
on disk outside of source control, or in some kind of key management infrastructure.

Expand All @@ -104,8 +104,8 @@ token = Vonage::JWT.generate(claims)
client = Vonage::Client.new(token: token)
```

Documentation for the Vonage Ruby JWT generator gem can be found at
[https://www.rubydoc.info/github/nexmo/nexmo-jwt-ruby](https://www.rubydoc.info/github/nexmo/nexmo-jwt-ruby).
Documentation for the Vonage Ruby JWT generator gem can be found at: https://www.rubydoc.info/gems/vonage-jwt

The documentation outlines all the possible parameters you can use to customize and build a token with.

### Logging
Expand Down Expand Up @@ -179,9 +179,6 @@ client = Vonage::Client.new(

By default the hosts are set to `api.nexmo.com` and `rest.nexmo.com`, respectively.




### Webhook signatures

Certain Vonage APIs provide signed [webhooks](https://developer.vonage.com/en/getting-started/concepts/webhooks) as a means of verifying the origin of the webhooks. The exact signing mechanism varies depending on the API.
Expand Down Expand Up @@ -300,10 +297,10 @@ Vonage APIs paginate list requests. This means that if a collection is requested

The `auto_advance` parameter is set to a default of `true` for the following APIs:

* [Account API](https://developer.nexmo.com/api/developer/account)
* [Application API](https://developer.nexmo.com/api/application.v2)
* [Conversation API](https://developer.nexmo.com/api/conversation)
* [Voice API](https://developer.nexmo.com/api/voice)
* [Account API](https://developer.vonage.com/api/developer/account)
* [Application API](https://developer.vonage.com/api/application.v2)
* [Conversation API](https://developer.vonage.com/api/conversation)
* [Voice API](https://developer.vonage.com/api/voice)

To modify the `auto_advance` behavior you can specify it in your method:

Expand All @@ -314,7 +311,7 @@ client.applications.list(auto_advance: false)

## Messages API

The [Vonage Messages API](https://developer.vonage.com/messages/overview) allows you to send messages over a number of different channels, and various message types within each channel. See the Vonage Developer Documentation for a [complete API reference](https://developer.vonage.com/api/messages-olympus) listing all the channel and message type combinations.
The [Vonage Messages API](https://developer.vonage.com/messages/overview) allows you to send messages over a number of different channels, and various message types within each channel. See the Vonage Developer Documentation for a [complete API reference](https://developer.vonage.com/en/api/messages) listing all the channel and message type combinations.

The Ruby SDK allows you to construct message data for specific messaging channels. Other than SMS (which has only one type -- text), you need to pass the message `:type` as well as the `:message` itself as arguments to the appropriate messages method, along with any optional properties if needed.

Expand Down Expand Up @@ -513,11 +510,11 @@ response = client.voice.create({

## Documentation

Vonage Ruby SDK documentation: https://www.rubydoc.info/github/Vonage/vonage-ruby-sdk
Vonage Ruby SDK documentation: https://www.rubydoc.info/gems/vonage

Vonage Ruby SDK code examples: https://github.com/Vonage/vonage-ruby-code-snippets

Vonage APIs API reference: https://developer.nexmo.com/api
Vonage APIs API reference: https://developer.vonage.com/api

## Supported APIs

Expand Down
12 changes: 12 additions & 0 deletions lib/vonage/meetings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,45 @@ module Vonage
class Meetings < Namespace
extend T::Sig

# @deprecated
sig { returns(T.nilable(Vonage::Meetings::Rooms)) }
def rooms
logger.info('This method is deprecated and will be removed in a future release.')
@rooms ||= Rooms.new(@config)
end

# @deprecated
sig { returns(T.nilable(Vonage::Meetings::Recordings)) }
def recordings
logger.info('This method is deprecated and will be removed in a future release.')
@recordings ||= Recordings.new(@config)
end

# @deprecated
sig { returns(T.nilable(Vonage::Meetings::Sessions)) }
def sessions
logger.info('This method is deprecated and will be removed in a future release.')
@sessions ||= Sessions.new(@config)
end

# @deprecated
sig { returns(T.nilable(Vonage::Meetings::Themes)) }
def themes
logger.info('This method is deprecated and will be removed in a future release.')
@themes ||= Themes.new(@config)
end

# @deprecated
sig { returns(T.nilable(Vonage::Meetings::Applications)) }
def applications
logger.info('This method is deprecated and will be removed in a future release.')
@applications ||= Applications.new(@config)
end

# @deprecated
sig { returns(T.nilable(Vonage::Meetings::DialInNumbers)) }
def dial_in_numbers
logger.info('This method is deprecated and will be removed in a future release.')
@dial_in_numbers ||= DialInNumbers.new(@config)
end
end
Expand Down
3 changes: 3 additions & 0 deletions lib/vonage/meetings/applications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ class Meetings::Applications < Namespace

# Update an existing application.
#
# @deprecated
#
# @param [required, String] :default_theme_id The id of the theme to set as application default theme
#
# @return [Response]
#
# @see https://developer.vonage.com/en/api/meetings#updateApplication
def update(default_theme_id:)
logger.info('This method is deprecated and will be removed in a future release.')
request("/v1/meetings/applications", params: {update_details: {default_theme_id: default_theme_id}}, type: Patch)
end
end
Expand Down
3 changes: 3 additions & 0 deletions lib/vonage/meetings/dial_in_numbers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ class Meetings::DialInNumbers < Namespace

# Get numbers that can be used to dial into a meeting.
#
# @deprecated
#
# @return [ListResponse]
#
# @see https://developer.vonage.com/en/api/meetings#getDialInNumbers
def list
logger.info('This method is deprecated and will be removed in a future release.')
request("/v1/meetings/dial-in-numbers", response_class: ListResponse)
end
end
Expand Down
6 changes: 6 additions & 0 deletions lib/vonage/meetings/recordings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,29 @@ class Meetings::Recordings < Namespace

# Return information for specified recording.
#
# @deprecated
#
# @param [required, String] recording_id The id of the recoring for which the info should be returned
#
# @return [Response]
#
# @see https://developer.vonage.com/en/api/meetings#getRecording
def info(recording_id:)
logger.info('This method is deprecated and will be removed in a future release.')
request("/v1/meetings/recordings/" + recording_id)
end

# Delete a specified recording.
#
# @deprecated
#
# @param [required, String] recording_id The id of the recoring to be deleted
#
# @return [Response]
#
# @see https://developer.vonage.com/en/api/meetings#deleteRecording
def delete(recording_id:)
logger.info('This method is deprecated and will be removed in a future release.')
request("/v1/meetings/recordings/" + recording_id, type: Delete)
end
end
Expand Down
12 changes: 12 additions & 0 deletions lib/vonage/meetings/rooms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class Meetings::Rooms < Namespace

# Get a list of rooms associated with the Vonage application.
#
# @deprecated
#
# @param [optional, Integer] :start_id
#
# @param [optional, Integer] :end_id
Expand All @@ -23,6 +25,7 @@ class Meetings::Rooms < Namespace
#
# @see https://developer.vonage.com/en/api/meetings#getRooms
def list(**params)
logger.info('This method is deprecated and will be removed in a future release.')
path = "/v1/meetings/rooms"
path += "?#{Params.encode(params)}" unless params.empty?

Expand All @@ -31,18 +34,23 @@ def list(**params)

# Return information for specified room.
#
# @deprecated
#
# @param [required, String] room_id
# The id of the room for which the info should be returned
#
# @return [Response]
#
# @see https://developer.vonage.com/en/api/meetings#getRoom
def info(room_id:)
logger.info('This method is deprecated and will be removed in a future release.')
request("/v1/meetings/rooms/" + room_id)
end

# Create a new room.
#
# @deprecated
#
# @param [required, String] :display_name
#
# @param [optional, String] :metadata
Expand Down Expand Up @@ -95,6 +103,7 @@ def info(room_id:)
#
# @see https://developer.vonage.com/en/api/meetings#createRoom
def create(display_name:, **params)
logger.info('This method is deprecated and will be removed in a future release.')
request(
"/v1/meetings/rooms",
params: params.merge({ display_name: display_name }),
Expand All @@ -106,6 +115,8 @@ def create(display_name:, **params)
# Although paramaters (other than `room_id`) are optional, at least one other parameter must be provided or an error
# response will be received.
#
# @deprecated
#
# @param [required, String] room_id The ID of the Room to be updated
#
# @param [optional, String(date)] :expires_at
Expand Down Expand Up @@ -142,6 +153,7 @@ def create(display_name:, **params)
#
# @see https://developer.vonage.com/en/api/meetings#updateRoom
def update(room_id:, **params)
logger.info('This method is deprecated and will be removed in a future release.')
raise ArgumentError, 'must provide at least one other param in addition to :room_id' if params.empty?
request(
"/v1/meetings/rooms/" + room_id,
Expand Down
3 changes: 3 additions & 0 deletions lib/vonage/meetings/sessions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ class Meetings::Sessions < Namespace

# Return a list of recordings for a specified session.
#
# @deprecated
#
# @param [required, String] session_id The id of the session for which the recordings list should be returned
#
# @return [ListResponse]
#
# @see https://developer.vonage.com/en/api/meetings#getSessionRecordings
def list_recordings(session_id:)
logger.info('This method is deprecated and will be removed in a future release.')
request(
"/v1/meetings/sessions/" + session_id + "/recordings",
response_class: ListResponse
Expand Down
21 changes: 21 additions & 0 deletions lib/vonage/meetings/themes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,34 @@ class Meetings::Themes < Namespace

# Get a list of themes associated with the Vonage application.
#
# @deprecated
#
# @return [ListResponse]
#
# @see https://developer.vonage.com/en/api/meetings#getThemes
def list
logger.info('This method is deprecated and will be removed in a future release.')
request("/v1/meetings/themes", response_class: ListResponse)
end

# Return information for specified theme.
#
# @deprecated
#
# @param [required, String] theme_id The id of the theme for which the info should be returned
#
# @return [Response]
#
# @see https://developer.vonage.com/en/api/meetings#getThemeById
def info(theme_id:)
logger.info('This method is deprecated and will be removed in a future release.')
request("/v1/meetings/themes/" + theme_id)
end

# Create a new theme.
#
# @deprecated
#
# @param [required, String] :main_color
# The main color that will be used for the meeting room.
#
Expand All @@ -49,6 +57,7 @@ def info(theme_id:)
#
# @see https://developer.vonage.com/en/api/meetings#createTheme
def create(main_color:, brand_text:, **params)
logger.info('This method is deprecated and will be removed in a future release.')
request(
"/v1/meetings/themes",
params: params.merge(main_color: main_color, brand_text: brand_text),
Expand All @@ -58,6 +67,8 @@ def create(main_color:, brand_text:, **params)

# Update an existing theme.
#
# @deprecated
#
# @param [required, String] theme_id The id of the theme to be updated
#
# @param [required, String] :main_color
Expand All @@ -76,6 +87,7 @@ def create(main_color:, brand_text:, **params)
#
# @see https://developer.vonage.com/en/api/meetings#updateTheme
def update(theme_id:, **params)
logger.info('This method is deprecated and will be removed in a future release.')
request(
"/v1/meetings/themes/" + theme_id,
params: {
Expand All @@ -87,6 +99,8 @@ def update(theme_id:, **params)

# Delete an existing theme.
#
# @deprecated
#
# @param [required, String] :theme_id The id of the theme to be deleted
#
# @param [optional, Boolean] :force. Set to `true` to force delete a theme currently being used for a room, or as
Expand All @@ -96,6 +110,7 @@ def update(theme_id:, **params)
#
# @see https://developer.vonage.com/en/api/meetings#deleteTheme
def delete(theme_id:, force: false)
logger.info('This method is deprecated and will be removed in a future release.')
request(
"/v1/meetings/themes/" + theme_id + "?force=#{force}",
type: Delete
Expand All @@ -104,6 +119,8 @@ def delete(theme_id:, force: false)

# Get a list of rooms that are associated with a theme id.
#
# @deprecated
#
# @param [required, String] theme_id THe ID of the theme to search for rooms associated with.
#
# @param [optional, Integer] :start_id
Expand All @@ -116,6 +133,7 @@ def delete(theme_id:, force: false)
#
# @see https://developer.vonage.com/en/api/meetings#getRoomsByThemeId
def list_rooms(theme_id:, **params)
logger.info('This method is deprecated and will be removed in a future release.')
path = "/v1/meetings/themes/" + theme_id + "/rooms"
path += "?#{Params.encode(params)}" unless params.empty?

Expand All @@ -124,6 +142,8 @@ def list_rooms(theme_id:, **params)

# Set a logo for a theme.
#
# @deprecated
#
# @param [required, String] :theme_id The ID of the theme for which the logo should be set
#
# @param [required, String] :filepath
Expand All @@ -146,6 +166,7 @@ def list_rooms(theme_id:, **params)
#
# TODO: add type signature
def set_logo(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?
Expand Down
Loading

0 comments on commit 2edf796

Please sign in to comment.