From 2edf796ff97d65c319acc5a0fa414b1dd7ffda17 Mon Sep 17 00:00:00 2001 From: Karl Lingiah Date: Thu, 22 Aug 2024 10:43:39 +0100 Subject: [PATCH] DEVX-8720/DEVX-8686: Numbers, Meetings, and Proactive Connect maintenance (#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 --- README.md | 23 ++++++++++------------- lib/vonage/meetings.rb | 12 ++++++++++++ lib/vonage/meetings/applications.rb | 3 +++ lib/vonage/meetings/dial_in_numbers.rb | 3 +++ lib/vonage/meetings/recordings.rb | 6 ++++++ lib/vonage/meetings/rooms.rb | 12 ++++++++++++ lib/vonage/meetings/sessions.rb | 3 +++ lib/vonage/meetings/themes.rb | 21 +++++++++++++++++++++ lib/vonage/numbers.rb | 22 +++++++++++----------- lib/vonage/proactive_connect.rb | 10 ++++++++++ lib/vonage/proactive_connect/events.rb | 3 +++ lib/vonage/proactive_connect/item.rb | 12 ++++++++++++ lib/vonage/proactive_connect/items.rb | 9 +++++++++ lib/vonage/proactive_connect/list.rb | 18 ++++++++++++++++++ lib/vonage/proactive_connect/lists.rb | 3 +++ 15 files changed, 136 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index e1ca4651..77b89e84 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 @@ -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. @@ -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: @@ -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. @@ -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 diff --git a/lib/vonage/meetings.rb b/lib/vonage/meetings.rb index cb0adc88..3c1c927c 100644 --- a/lib/vonage/meetings.rb +++ b/lib/vonage/meetings.rb @@ -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 diff --git a/lib/vonage/meetings/applications.rb b/lib/vonage/meetings/applications.rb index bcefdbfb..3b7c5251 100644 --- a/lib/vonage/meetings/applications.rb +++ b/lib/vonage/meetings/applications.rb @@ -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 diff --git a/lib/vonage/meetings/dial_in_numbers.rb b/lib/vonage/meetings/dial_in_numbers.rb index fec59275..9ff9baed 100644 --- a/lib/vonage/meetings/dial_in_numbers.rb +++ b/lib/vonage/meetings/dial_in_numbers.rb @@ -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 diff --git a/lib/vonage/meetings/recordings.rb b/lib/vonage/meetings/recordings.rb index 021eb272..a34f192e 100644 --- a/lib/vonage/meetings/recordings.rb +++ b/lib/vonage/meetings/recordings.rb @@ -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 diff --git a/lib/vonage/meetings/rooms.rb b/lib/vonage/meetings/rooms.rb index 67b30d89..02a97f76 100644 --- a/lib/vonage/meetings/rooms.rb +++ b/lib/vonage/meetings/rooms.rb @@ -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 @@ -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? @@ -31,6 +34,8 @@ 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 # @@ -38,11 +43,14 @@ def list(**params) # # @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 @@ -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 }), @@ -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 @@ -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, diff --git a/lib/vonage/meetings/sessions.rb b/lib/vonage/meetings/sessions.rb index 35f1e1c5..5404a9ca 100644 --- a/lib/vonage/meetings/sessions.rb +++ b/lib/vonage/meetings/sessions.rb @@ -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 diff --git a/lib/vonage/meetings/themes.rb b/lib/vonage/meetings/themes.rb index d9ed2302..d14f1852 100644 --- a/lib/vonage/meetings/themes.rb +++ b/lib/vonage/meetings/themes.rb @@ -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. # @@ -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), @@ -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 @@ -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: { @@ -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 @@ -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 @@ -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 @@ -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? @@ -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 @@ -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? diff --git a/lib/vonage/numbers.rb b/lib/vonage/numbers.rb index d3cafdc0..87d8d1b5 100644 --- a/lib/vonage/numbers.rb +++ b/lib/vonage/numbers.rb @@ -17,6 +17,8 @@ class Numbers < Namespace # puts "#{item.msisdn} #{item.country} #{item.type}" # end # + # @param [Hash] params + # # @option params [String] :application_id # The application that you want to return the numbers for. # @@ -47,8 +49,6 @@ class Numbers < Namespace # Set this to `true` to auto-advance through all the pages in the record # and collect all the data. The default is `false`. # - # @param [Hash] params - # # @return [ListResponse] # # @see https://developer.nexmo.com/api/developer/numbers#getOwnedNumbers @@ -65,6 +65,8 @@ def list(params = nil) # puts "#{item.msisdn} #{item.type} #{item.cost}" # end # + # @param [Hash] params + # # @option params [required, String] :country # The two character country code in ISO 3166-1 alpha-2 format. # @@ -82,7 +84,7 @@ def list(params = nil) # - `2` - Search for numbers that end with **:pattern** # # @option params [String] :features - # Available features are `SMS` and `VOICE`. + # Available features are `SMS`, `MMS`, and `VOICE`. # To look for numbers that support both, use a comma-separated value: `SMS,VOICE`. # # @option params [Integer] :size @@ -95,8 +97,6 @@ def list(params = nil) # Set this to `true` to auto-advance through all the pages in the record # and collect all the data. The default is `false`. # - # @param [Hash] params - # # @return [ListResponse] # # @see https://developer.nexmo.com/api/developer/numbers#getAvailableNumbers @@ -110,6 +110,8 @@ def search(params) # @example # response = client.numbers.buy(country: 'GB', msisdn: '447700900000') # + # @param [Hash] params + # # @option params [required, String] :country # The two character country code in ISO 3166-1 alpha-2 format. # @@ -120,8 +122,6 @@ def search(params) # If you'd like to perform an action on a subaccount, provide the `api_key` of that account here. # If you'd like to perform an action on your own account, you do not need to provide this field. # - # @param [Hash] params - # # @return [Response] # # @see https://developer.nexmo.com/api/developer/numbers#buyANumber @@ -140,6 +140,8 @@ def buy(params) # @example # response = client.numbers.cancel(country: 'GB', msisdn: '447700900000') # + # @param [Hash] params + # # @option params [required, String] :country # The two character country code in ISO 3166-1 alpha-2 format. # @@ -150,8 +152,6 @@ def buy(params) # If you'd like to perform an action on a subaccount, provide the `api_key` of that account here. # If you'd like to perform an action on your own account, you do not need to provide this field. # - # @param [Hash] params - # # @return [Response] # # @see https://developer.nexmo.com/api/developer/numbers#cancelANumber @@ -177,6 +177,8 @@ def cancel(params) # # response = client.numbers.update(params) # + # @param [Hash] params + # # @option params [required, String] :country # The two character country code in ISO 3166-1 alpha-2 format. # @@ -203,8 +205,6 @@ def cancel(params) # @option params [String] :voice_status_callback # A webhook URI for Vonage to send a request to when a call ends. # - # @param [Hash] params - # # @return [Response] # # @see https://developer.nexmo.com/api/developer/numbers#updateANumber diff --git a/lib/vonage/proactive_connect.rb b/lib/vonage/proactive_connect.rb index 3f5da09b..6207fd95 100644 --- a/lib/vonage/proactive_connect.rb +++ b/lib/vonage/proactive_connect.rb @@ -5,28 +5,38 @@ module Vonage class ProactiveConnect < Namespace extend T::Sig + # @deprecated sig { returns(T.nilable(Vonage::ProactiveConnect::Lists)) } def lists + logger.info('This method is deprecated and will be removed in a future release.') @lists ||= Lists.new(@config) end + # @deprecated sig { returns(T.nilable(Vonage::ProactiveConnect::List)) } def list + logger.info('This method is deprecated and will be removed in a future release.') @list ||= List.new(@config) end + # @deprecated sig { returns(T.nilable(Vonage::ProactiveConnect::Items)) } def items + logger.info('This method is deprecated and will be removed in a future release.') @items ||= Items.new(@config) end + # @deprecated sig { returns(T.nilable(Vonage::ProactiveConnect::Item)) } def item + logger.info('This method is deprecated and will be removed in a future release.') @item ||= Item.new(@config) end + # @deprecated sig { returns(T.nilable(Vonage::ProactiveConnect::Events)) } def events + logger.info('This method is deprecated and will be removed in a future release.') @events ||= Events.new(@config) end end diff --git a/lib/vonage/proactive_connect/events.rb b/lib/vonage/proactive_connect/events.rb index fa40cdf2..40963e08 100644 --- a/lib/vonage/proactive_connect/events.rb +++ b/lib/vonage/proactive_connect/events.rb @@ -11,6 +11,8 @@ class ProactiveConnect::Events < Namespace # Find all events # + # @deprecated + # # @example # response = proactive_connect.events.list # @@ -59,6 +61,7 @@ class ProactiveConnect::Events < Namespace # @see https://developer.vonage.com/en/api/proactive-connect#eventsFindAll # def list(**params) + logger.info('This method is deprecated and will be removed in a future release.') path = "/v0.1/bulk/events" path += "?#{Params.encode(params)}" unless params.empty? diff --git a/lib/vonage/proactive_connect/item.rb b/lib/vonage/proactive_connect/item.rb index abc6c22e..c5e100f0 100644 --- a/lib/vonage/proactive_connect/item.rb +++ b/lib/vonage/proactive_connect/item.rb @@ -13,6 +13,8 @@ class ProactiveConnect::Item < Namespace # Create a list item # + # @deprecated + # # @example # response = proactive_connect.item.create(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865', data: {name: 'Joe Bloggs', email: 'joe@email.com'}) # @@ -25,6 +27,7 @@ class ProactiveConnect::Item < Namespace # @see https://developer.vonage.com/en/api/proactive-connect#itemsCreate # def create(list_id:, data:) + logger.info('This method is deprecated and will be removed in a future release.') raise ArgumentError.new(":data must be a Hash") unless data.is_a? Hash request( "/v0.1/bulk/lists/#{list_id}/items", @@ -35,6 +38,8 @@ def create(list_id:, data:) # Get list item by id # + # @deprecated + # # @example # response = proactive_connect.item.find(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865', item_id: 'd97ebf20-e4de-4e50-921a-7bb4dceb373a') # @@ -47,11 +52,14 @@ def create(list_id:, data:) # @see https://developer.vonage.com/en/api/proactive-connect#itemsGet # def find(list_id:, item_id:) + logger.info('This method is deprecated and will be removed in a future release.') request("/v0.1/bulk/lists/#{list_id}/items/#{item_id}") end # Update list item # + # @deprecated + # # @example # response = proactive_connect.item.create( # list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865', @@ -73,6 +81,7 @@ def find(list_id:, item_id:) # @see https://developer.vonage.com/en/api/proactive-connect#itemsUpdate # def update(list_id:, item_id:, data:) + logger.info('This method is deprecated and will be removed in a future release.') raise ArgumentError.new(":data must be a Hash") unless data.is_a? Hash request( "/v0.1/bulk/lists/#{list_id}/items/#{item_id}", @@ -83,6 +92,8 @@ def update(list_id:, item_id:, data:) # Delete list item # + # @deprecated + # # @example # response = proactive_connect.item.delete(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865', item_id: 'd97ebf20-e4de-4e50-921a-7bb4dceb373a') # @@ -95,6 +106,7 @@ def update(list_id:, item_id:, data:) # @see https://developer.vonage.com/en/api/proactive-connect#itemsDelete # def delete(list_id:, item_id:) + logger.info('This method is deprecated and will be removed in a future release.') request( "/v0.1/bulk/lists/#{list_id}/items/#{item_id}", type: Delete diff --git a/lib/vonage/proactive_connect/items.rb b/lib/vonage/proactive_connect/items.rb index 50a290c4..3b3e85c6 100644 --- a/lib/vonage/proactive_connect/items.rb +++ b/lib/vonage/proactive_connect/items.rb @@ -11,6 +11,8 @@ class ProactiveConnect::Items < Namespace # Find all list items # + # @deprecated + # # @example # response = proactive_connect.items.list(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865') # @@ -29,6 +31,7 @@ class ProactiveConnect::Items < Namespace # @see https://developer.vonage.com/en/api/proactive-connect#itemsFindAll # def list(list_id:, **params) + logger.info('This method is deprecated and will be removed in a future release.') path = "/v0.1/bulk/lists/#{list_id}/items" path += "?#{Params.encode(params)}" unless params.empty? @@ -37,6 +40,8 @@ def list(list_id:, **params) # Download list items as a CSV file format # + # @deprecated + # # @example # response = proactive_connect.items.download_csv(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865') # @@ -64,6 +69,7 @@ def list(list_id:, **params) # @see https://developer.vonage.com/en/api/proactive-connect#itemsDownload # def download_csv(list_id:, order: 'asc', **params) + logger.info('This method is deprecated and will be removed in a future release.') response = request("/v0.1/bulk/lists/#{list_id}/items/download?order=#{order}", response_class: FileResponse) response.filename = params[:filename] if params[:filename] @@ -74,6 +80,8 @@ def download_csv(list_id:, order: 'asc', **params) # Import list items from a CSV file # + # @deprecated + # # @example # response = proactive_connect.items.upload_csv(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865', filepath: '/files/import.csv') # @@ -96,6 +104,7 @@ def download_csv(list_id:, order: 'asc', **params) # @see https://developer.vonage.com/en/api/proactive-connect#itemsImport # def upload_csv(list_id:, filepath:) + logger.info('This method is deprecated and will be removed in a future release.') pn = Pathname.new(filepath) raise ArgumentError, ':filepath not for a file' unless pn.file? raise ArgumentError, 'file at :filepath not readable' unless pn.readable? diff --git a/lib/vonage/proactive_connect/list.rb b/lib/vonage/proactive_connect/list.rb index a5a44d8c..35a2b2df 100644 --- a/lib/vonage/proactive_connect/list.rb +++ b/lib/vonage/proactive_connect/list.rb @@ -13,6 +13,8 @@ class ProactiveConnect::List < Namespace # Create list # + # @deprecated + # # @example # response = proactive_connect.list.create(name: 'List Number 1') # @@ -47,6 +49,7 @@ class ProactiveConnect::List < Namespace # @see https://developer.vonage.com/en/api/proactive-connect#listsCreate # def create(name:, **params) + logger.info('This method is deprecated and will be removed in a future release.') request( "/v0.1/bulk/lists", params: params.merge({ name: name }), @@ -56,6 +59,8 @@ def create(name:, **params) # Get list by id # + # @deprecated + # # @example # response = proactive_connect.list.find(id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865') # @@ -65,11 +70,14 @@ def create(name:, **params) # @see https://developer.vonage.com/en/api/proactive-connect#listsGet # def find(id:) + logger.info('This method is deprecated and will be removed in a future release.') request("/v0.1/bulk/lists/#{id}") end # Update list # + # @deprecated + # # @example # response = proactive_connect.list.update(name: 'List Number 1') # @@ -107,6 +115,7 @@ def find(id:) # @see https://developer.vonage.com/en/api/proactive-connect#listsUpdate # def update(id:, name:, **params) + logger.info('This method is deprecated and will be removed in a future release.') request( "/v0.1/bulk/lists/#{id}", params: params.merge({ name: name }), @@ -116,6 +125,8 @@ def update(id:, name:, **params) # Delete a list by id # + # @deprecated + # # @example # response = proactive_connect.list.delete(id: '74ea1ecf-06c9-4072-a285-61677bd353e8') # @@ -125,6 +136,7 @@ def update(id:, name:, **params) # @see https://developer.vonage.com/en/api/proactive-connect#listsDelete # def delete(id:) + logger.info('This method is deprecated and will be removed in a future release.') request( "/v0.1/bulk/lists/#{id}", type: Delete @@ -133,6 +145,8 @@ def delete(id:) # Clear list by deleting all items # + # @deprecated + # # @example # response = proactive_connect.list.clear_items(id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865') # @@ -142,6 +156,7 @@ def delete(id:) # @see https://developer.vonage.com/en/api/proactive-connect#listsClear # def clear_items(id:) + logger.info('This method is deprecated and will be removed in a future release.') request( "/v0.1/bulk/lists/#{id}/clear", type: Post @@ -150,6 +165,8 @@ def clear_items(id:) # Fetch and replace all items from datasource # + # @deprecated + # # @example # response = proactive_connect.list.fetch_and_replace_items(id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865') # @@ -159,6 +176,7 @@ def clear_items(id:) # @see https://developer.vonage.com/en/api/proactive-connect#listsFetch # def fetch_and_replace_items(id:) + logger.info('This method is deprecated and will be removed in a future release.') request( "/v0.1/bulk/lists/#{id}/fetch", type: Post diff --git a/lib/vonage/proactive_connect/lists.rb b/lib/vonage/proactive_connect/lists.rb index 48200e69..b6146293 100644 --- a/lib/vonage/proactive_connect/lists.rb +++ b/lib/vonage/proactive_connect/lists.rb @@ -11,6 +11,8 @@ class ProactiveConnect::Lists < Namespace # Find all lists # + # @deprecated + # # @example # response = proactive_connect.lists.list # @@ -26,6 +28,7 @@ class ProactiveConnect::Lists < Namespace # @see https://developer.vonage.com/en/api/proactive-connect#listsFindAll # def list(**params) + logger.info('This method is deprecated and will be removed in a future release.') path = "/v0.1/bulk/lists" path += "?#{Params.encode(params)}" unless params.empty?