vonage 7.28.0 → 8.0.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +89 -476
- data/lib/vonage/applications.rb +4 -12
- data/lib/vonage/basic.rb +1 -1
- data/lib/vonage/bearer_token.rb +1 -1
- data/lib/vonage/client.rb +0 -65
- data/lib/vonage/client_error.rb +1 -1
- data/lib/vonage/config.rb +1 -9
- data/lib/vonage/conversations/events.rb +0 -12
- data/lib/vonage/conversations/legs.rb +0 -6
- data/lib/vonage/conversations/members.rb +0 -15
- data/lib/vonage/conversations/users.rb +0 -15
- data/lib/vonage/conversations.rb +0 -30
- data/lib/vonage/errors.rb +20 -37
- data/lib/vonage/gsm7.rb +1 -1
- data/lib/vonage/http.rb +3 -3
- data/lib/vonage/jwt.rb +0 -17
- data/lib/vonage/key_secret_params.rb +2 -3
- data/lib/vonage/keys.rb +1 -11
- data/lib/vonage/logger.rb +3 -5
- data/lib/vonage/messaging/channels/viber.rb +1 -8
- data/lib/vonage/messaging/channels/whats_app.rb +1 -3
- data/lib/vonage/messaging/message.rb +0 -1
- data/lib/vonage/messaging.rb +4 -34
- data/lib/vonage/namespace.rb +68 -137
- data/lib/vonage/numbers.rb +17 -40
- data/lib/vonage/server_error.rb +1 -1
- data/lib/vonage/signature.rb +5 -5
- data/lib/vonage/sms.rb +20 -20
- data/lib/vonage/version.rb +1 -1
- data/lib/vonage/video/archives.rb +53 -18
- data/lib/vonage/video/list_response.rb +11 -0
- data/lib/vonage/video/moderation.rb +22 -7
- data/lib/vonage/video/signals.rb +9 -4
- data/lib/vonage/video/streams.rb +12 -6
- data/lib/vonage/video.rb +13 -50
- data/lib/vonage/voice/actions/connect.rb +5 -34
- data/lib/vonage/voice/actions/conversation.rb +4 -10
- data/lib/vonage/voice/actions/input.rb +3 -19
- data/lib/vonage/voice/actions/notify.rb +3 -8
- data/lib/vonage/voice/actions/pay.rb +107 -0
- data/lib/vonage/voice/actions/record.rb +4 -52
- data/lib/vonage/voice/actions/stream.rb +4 -48
- data/lib/vonage/voice/actions/talk.rb +4 -54
- data/lib/vonage/voice/talk.rb +1 -11
- data/lib/vonage/voice.rb +0 -24
- data/lib/vonage.rb +0 -4
- data/vonage.gemspec +1 -3
- metadata +9 -108
- data/lib/vonage/api_error.rb +0 -33
- data/lib/vonage/conversation/event/list_response.rb +0 -11
- data/lib/vonage/conversation/event.rb +0 -108
- data/lib/vonage/conversation/list_response.rb +0 -11
- data/lib/vonage/conversation/member/list_response.rb +0 -11
- data/lib/vonage/conversation/member.rb +0 -134
- data/lib/vonage/conversation/user/conversations_list_response.rb +0 -11
- data/lib/vonage/conversation/user/sessions_list_response.rb +0 -11
- data/lib/vonage/conversation/user.rb +0 -67
- data/lib/vonage/conversation.rb +0 -164
- data/lib/vonage/meetings/applications.rb +0 -28
- data/lib/vonage/meetings/dial_in_numbers/list_response.rb +0 -11
- data/lib/vonage/meetings/dial_in_numbers.rb +0 -26
- data/lib/vonage/meetings/recordings.rb +0 -42
- data/lib/vonage/meetings/rooms/list_response.rb +0 -11
- data/lib/vonage/meetings/rooms.rb +0 -167
- data/lib/vonage/meetings/sessions/list_response.rb +0 -11
- data/lib/vonage/meetings/sessions.rb +0 -31
- data/lib/vonage/meetings/themes/list_response.rb +0 -11
- data/lib/vonage/meetings/themes.rb +0 -239
- data/lib/vonage/meetings.rb +0 -50
- data/lib/vonage/messaging/channels/rcs.rb +0 -42
- data/lib/vonage/network_authentication/client_authentication.rb +0 -39
- data/lib/vonage/network_authentication/server_authentication.rb +0 -47
- data/lib/vonage/network_authentication.rb +0 -22
- data/lib/vonage/network_number_verification.rb +0 -92
- data/lib/vonage/network_sim_swap.rb +0 -84
- data/lib/vonage/number_insight_2.rb +0 -36
- data/lib/vonage/proactive_connect/events/list_response.rb +0 -11
- data/lib/vonage/proactive_connect/events.rb +0 -71
- data/lib/vonage/proactive_connect/item.rb +0 -116
- data/lib/vonage/proactive_connect/items/file_response.rb +0 -32
- data/lib/vonage/proactive_connect/items/list_response.rb +0 -11
- data/lib/vonage/proactive_connect/items.rb +0 -116
- data/lib/vonage/proactive_connect/list.rb +0 -186
- data/lib/vonage/proactive_connect/lists/list_response.rb +0 -11
- data/lib/vonage/proactive_connect/lists.rb +0 -38
- data/lib/vonage/proactive_connect.rb +0 -43
- data/lib/vonage/subaccounts/balance_transfers/list_response.rb +0 -11
- data/lib/vonage/subaccounts/credit_transfers/list_response.rb +0 -11
- data/lib/vonage/subaccounts/list_response.rb +0 -15
- data/lib/vonage/subaccounts.rb +0 -203
- data/lib/vonage/users/list_response.rb +0 -11
- data/lib/vonage/users.rb +0 -156
- data/lib/vonage/verify2/channels/email.rb +0 -36
- data/lib/vonage/verify2/channels/silent_auth.rb +0 -45
- data/lib/vonage/verify2/channels/sms.rb +0 -63
- data/lib/vonage/verify2/channels/voice.rb +0 -32
- data/lib/vonage/verify2/channels/whats_app.rb +0 -39
- data/lib/vonage/verify2/channels/whats_app_interactive.rb +0 -32
- data/lib/vonage/verify2/start_verification_options.rb +0 -63
- data/lib/vonage/verify2/template_fragments/list_response.rb +0 -11
- data/lib/vonage/verify2/template_fragments.rb +0 -125
- data/lib/vonage/verify2/templates/list_response.rb +0 -11
- data/lib/vonage/verify2/templates.rb +0 -86
- data/lib/vonage/verify2/workflow.rb +0 -39
- data/lib/vonage/verify2/workflow_builder.rb +0 -25
- data/lib/vonage/verify2.rb +0 -112
- data/lib/vonage/video/archives/list_response.rb +0 -11
- data/lib/vonage/video/broadcasts/list_response.rb +0 -11
- data/lib/vonage/video/broadcasts.rb +0 -75
- data/lib/vonage/video/captions.rb +0 -67
- data/lib/vonage/video/renders/list_response.rb +0 -11
- data/lib/vonage/video/renders.rb +0 -107
- data/lib/vonage/video/sip.rb +0 -48
- data/lib/vonage/video/streams/list_response.rb +0 -11
- data/lib/vonage/video/web_socket.rb +0 -61
@@ -1,36 +0,0 @@
|
|
1
|
-
# typed: strict
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Vonage
|
5
|
-
class NumberInsight2 < Namespace
|
6
|
-
extend T::Sig
|
7
|
-
|
8
|
-
self.authentication = Basic
|
9
|
-
|
10
|
-
self.request_body = JSON
|
11
|
-
|
12
|
-
# Make fraud check requests with a phone number by looking up fraud score and/or by checking sim swap status.
|
13
|
-
#
|
14
|
-
# @example
|
15
|
-
# response = client.number_insight_2.fraud_check(type: 'phone', phone: '447900000000', insights: ['fraud_score'])
|
16
|
-
#
|
17
|
-
# @param [required, String] :type The type of number to check.
|
18
|
-
# Accepted value is “phone” when a phone number is provided.
|
19
|
-
#
|
20
|
-
# @param [required, String] :phone A single phone number that you need insight about in the E.164 format.
|
21
|
-
#
|
22
|
-
# @param [required, Array] :insights An array of strings indicating the fraud check insights required for the number.
|
23
|
-
# Must be least one of: `fraud_score`, `sim_swap`
|
24
|
-
#
|
25
|
-
# @return [Response]
|
26
|
-
#
|
27
|
-
# @see https://developer.vonage.com/en/api/number-insight.v2#fraud_check
|
28
|
-
#
|
29
|
-
sig { params(type: String, phone: String, insights: T::Array[String]).returns(Vonage::Response) }
|
30
|
-
def fraud_check(type:, phone:, insights:)
|
31
|
-
raise ArgumentError.new("`insights` must not be an empty") if insights.empty?
|
32
|
-
|
33
|
-
request('/v2/ni', params: {type: type, phone: phone, insights: insights}, type: Post)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,71 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Vonage
|
5
|
-
class ProactiveConnect::Events < Namespace
|
6
|
-
extend T::Sig
|
7
|
-
|
8
|
-
self.authentication = BearerToken
|
9
|
-
|
10
|
-
self.host = :vonage_host
|
11
|
-
|
12
|
-
# Find all events
|
13
|
-
#
|
14
|
-
# @deprecated
|
15
|
-
#
|
16
|
-
# @example
|
17
|
-
# response = proactive_connect.events.list
|
18
|
-
#
|
19
|
-
# @param [optional, String] :page
|
20
|
-
# Page of results to jump to
|
21
|
-
#
|
22
|
-
# @param [optional, String] :page_size
|
23
|
-
# Number of results per page
|
24
|
-
#
|
25
|
-
# @param [optional, String] order
|
26
|
-
# Sort in either ascending (asc, the default) or descending (desc) order
|
27
|
-
#
|
28
|
-
# @param [optional, String] :run_id
|
29
|
-
# Run IDs to filter by, if not specified, returns events for any run id
|
30
|
-
#
|
31
|
-
# @param [optional, String] :type
|
32
|
-
# Event types to filter by
|
33
|
-
#
|
34
|
-
# @param [optional, String] action_id
|
35
|
-
# Action IDs to filter by.
|
36
|
-
#
|
37
|
-
# @param [optional, String] :invocation_id
|
38
|
-
# Invocation IDs to filter by
|
39
|
-
#
|
40
|
-
# @param [optional, String] :recipient_id
|
41
|
-
# Recipient IDs to filter by
|
42
|
-
#
|
43
|
-
# @param [optional, String] :run_item_id
|
44
|
-
# Run item IDs to filter by
|
45
|
-
#
|
46
|
-
# @param [optional, String] src_ctx
|
47
|
-
# The name of the segment / matcher the item / event to filter by (exact string)
|
48
|
-
#
|
49
|
-
# @param [optional, String] :src_type
|
50
|
-
# Source types to filter by
|
51
|
-
#
|
52
|
-
# @param [optional, String] :trace_id
|
53
|
-
# Trace IDs to filter events by
|
54
|
-
#
|
55
|
-
# @param [optional, String] date_start
|
56
|
-
# ISO-8601 formatted date for when to begin events filter
|
57
|
-
#
|
58
|
-
# @param [optional, String] :date_end
|
59
|
-
# ISO-8601 formatted date for when to end events filter
|
60
|
-
#
|
61
|
-
# @see https://developer.vonage.com/en/api/proactive-connect#eventsFindAll
|
62
|
-
#
|
63
|
-
def list(**params)
|
64
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
65
|
-
path = "/v0.1/bulk/events"
|
66
|
-
path += "?#{Params.encode(params)}" unless params.empty?
|
67
|
-
|
68
|
-
request(path, response_class: ListResponse)
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
@@ -1,116 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Vonage
|
5
|
-
class ProactiveConnect::Item < Namespace
|
6
|
-
extend T::Sig
|
7
|
-
|
8
|
-
self.authentication = BearerToken
|
9
|
-
|
10
|
-
self.host = :vonage_host
|
11
|
-
|
12
|
-
self.request_body = JSON
|
13
|
-
|
14
|
-
# Create a list item
|
15
|
-
#
|
16
|
-
# @deprecated
|
17
|
-
#
|
18
|
-
# @example
|
19
|
-
# response = proactive_connect.item.create(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865', data: {name: 'Joe Bloggs', email: 'joe@email.com'})
|
20
|
-
#
|
21
|
-
# @param [required, String] :list_id
|
22
|
-
# Unique identifier for the list
|
23
|
-
#
|
24
|
-
# @param [required, Hash] :data
|
25
|
-
# A hash of data containing the item's data attributes and values
|
26
|
-
#
|
27
|
-
# @see https://developer.vonage.com/en/api/proactive-connect#itemsCreate
|
28
|
-
#
|
29
|
-
def create(list_id:, data:)
|
30
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
31
|
-
raise ArgumentError.new(":data must be a Hash") unless data.is_a? Hash
|
32
|
-
request(
|
33
|
-
"/v0.1/bulk/lists/#{list_id}/items",
|
34
|
-
params: { data: data },
|
35
|
-
type: Post
|
36
|
-
)
|
37
|
-
end
|
38
|
-
|
39
|
-
# Get list item by id
|
40
|
-
#
|
41
|
-
# @deprecated
|
42
|
-
#
|
43
|
-
# @example
|
44
|
-
# response = proactive_connect.item.find(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865', item_id: 'd97ebf20-e4de-4e50-921a-7bb4dceb373a')
|
45
|
-
#
|
46
|
-
# @param [required, String] :list_id
|
47
|
-
# Unique identifier for the list
|
48
|
-
#
|
49
|
-
# @param [required, String] :item_id
|
50
|
-
# Unique identifier for the item
|
51
|
-
#
|
52
|
-
# @see https://developer.vonage.com/en/api/proactive-connect#itemsGet
|
53
|
-
#
|
54
|
-
def find(list_id:, item_id:)
|
55
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
56
|
-
request("/v0.1/bulk/lists/#{list_id}/items/#{item_id}")
|
57
|
-
end
|
58
|
-
|
59
|
-
# Update list item
|
60
|
-
#
|
61
|
-
# @deprecated
|
62
|
-
#
|
63
|
-
# @example
|
64
|
-
# response = proactive_connect.item.create(
|
65
|
-
# list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865',
|
66
|
-
# item_id: 'd97ebf20-e4de-4e50-921a-7bb4dceb373a',
|
67
|
-
# data: {name: 'Jane Bloggs', email: 'joe@email.com'}
|
68
|
-
# )
|
69
|
-
#
|
70
|
-
# @param [required, String] :list_id
|
71
|
-
# Unique identifier for the list
|
72
|
-
#
|
73
|
-
# @param [required, String] :item_id
|
74
|
-
# Unique identifier for the item
|
75
|
-
#
|
76
|
-
# @param [required, Hash] :data
|
77
|
-
# A hash of data containing the item's data attributes and values
|
78
|
-
# All attributes for the item must be passed, even ones for which the value is not changing.
|
79
|
-
# If an attribute is omitted, existing data for that attribute will be deleted.
|
80
|
-
#
|
81
|
-
# @see https://developer.vonage.com/en/api/proactive-connect#itemsUpdate
|
82
|
-
#
|
83
|
-
def update(list_id:, item_id:, data:)
|
84
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
85
|
-
raise ArgumentError.new(":data must be a Hash") unless data.is_a? Hash
|
86
|
-
request(
|
87
|
-
"/v0.1/bulk/lists/#{list_id}/items/#{item_id}",
|
88
|
-
params: { data: data },
|
89
|
-
type: Put
|
90
|
-
)
|
91
|
-
end
|
92
|
-
|
93
|
-
# Delete list item
|
94
|
-
#
|
95
|
-
# @deprecated
|
96
|
-
#
|
97
|
-
# @example
|
98
|
-
# response = proactive_connect.item.delete(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865', item_id: 'd97ebf20-e4de-4e50-921a-7bb4dceb373a')
|
99
|
-
#
|
100
|
-
# @param [required, String] :list_id
|
101
|
-
# Unique identifier for the list
|
102
|
-
#
|
103
|
-
# @param [required, String] :item_id
|
104
|
-
# Unique identifier for the item
|
105
|
-
#
|
106
|
-
# @see https://developer.vonage.com/en/api/proactive-connect#itemsDelete
|
107
|
-
#
|
108
|
-
def delete(list_id:, item_id:)
|
109
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
110
|
-
request(
|
111
|
-
"/v0.1/bulk/lists/#{list_id}/items/#{item_id}",
|
112
|
-
type: Delete
|
113
|
-
)
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
|
3
|
-
class Vonage::ProactiveConnect::Items::FileResponse < Vonage::Response
|
4
|
-
DEFAULT_FILENAME = 'vonage-proactive-connect-list-items.csv'
|
5
|
-
|
6
|
-
attr_accessor :filename
|
7
|
-
|
8
|
-
def initialize(entity=nil, http_response=nil)
|
9
|
-
super
|
10
|
-
self.filename = initial_filename
|
11
|
-
end
|
12
|
-
|
13
|
-
def save(filepath:)
|
14
|
-
pn = Pathname.new(filepath)
|
15
|
-
raise ArgumentError, ':filepath not a directory' unless pn.directory?
|
16
|
-
raise ArgumentError, ':filepath not absolute' unless pn.absolute?
|
17
|
-
raise ArgumentError, ':filepath not writable' unless pn.writable?
|
18
|
-
|
19
|
-
File.open("#{pn.cleanpath}/#{filename}", 'w') {|f| f.write(http_response.body) }
|
20
|
-
end
|
21
|
-
|
22
|
-
def data
|
23
|
-
http_response ? http_response.body : nil
|
24
|
-
end
|
25
|
-
|
26
|
-
private
|
27
|
-
|
28
|
-
def initial_filename
|
29
|
-
match_data = http_response['Content-Disposition'].match(/filename=(\"?)(.+)\1/)
|
30
|
-
match_data ? match_data[2] : DEFAULT_FILENAME
|
31
|
-
end
|
32
|
-
end
|
@@ -1,116 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Vonage
|
5
|
-
class ProactiveConnect::Items < Namespace
|
6
|
-
extend T::Sig
|
7
|
-
|
8
|
-
self.authentication = BearerToken
|
9
|
-
|
10
|
-
self.host = :vonage_host
|
11
|
-
|
12
|
-
# Find all list items
|
13
|
-
#
|
14
|
-
# @deprecated
|
15
|
-
#
|
16
|
-
# @example
|
17
|
-
# response = proactive_connect.items.list(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865')
|
18
|
-
#
|
19
|
-
# @param [required, String] :list_id
|
20
|
-
# Unique identifier for the list
|
21
|
-
#
|
22
|
-
# @param [optional, String] :page
|
23
|
-
# Page of results to jump to
|
24
|
-
#
|
25
|
-
# @param [optional, String] :page_size
|
26
|
-
# Number of results per page
|
27
|
-
#
|
28
|
-
# @param [optional, String] order
|
29
|
-
# Sort in either ascending (asc, the default) or descending (desc) order
|
30
|
-
#
|
31
|
-
# @see https://developer.vonage.com/en/api/proactive-connect#itemsFindAll
|
32
|
-
#
|
33
|
-
def list(list_id:, **params)
|
34
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
35
|
-
path = "/v0.1/bulk/lists/#{list_id}/items"
|
36
|
-
path += "?#{Params.encode(params)}" unless params.empty?
|
37
|
-
|
38
|
-
request(path, response_class: ListResponse)
|
39
|
-
end
|
40
|
-
|
41
|
-
# Download list items as a CSV file format
|
42
|
-
#
|
43
|
-
# @deprecated
|
44
|
-
#
|
45
|
-
# @example
|
46
|
-
# response = proactive_connect.items.download_csv(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865')
|
47
|
-
#
|
48
|
-
# @param [required, String] :list_id
|
49
|
-
# ID for the list to download
|
50
|
-
#
|
51
|
-
# @param [optional, String] order
|
52
|
-
# Sort in either ascending (asc, the default) or descending (desc) order
|
53
|
-
#
|
54
|
-
# @param [optional, String] :filename
|
55
|
-
# A name to set for the returned File object. If not set, the File object will use the actual filename (if available)
|
56
|
-
# or a default of `download.csv` if the actual filename is not available.
|
57
|
-
#
|
58
|
-
# @param [optional, String] :filepath
|
59
|
-
# A filepath to a directory where the file should be written.
|
60
|
-
# If not set, the file is not written, though the the file can be written at any time by calling `save` on the returned
|
61
|
-
# object and passing in `:filepath` as an argument to the `save` method, for example:
|
62
|
-
# response = proactive_connect.items.download_csv(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865')
|
63
|
-
# response.save('/files/downloads/')
|
64
|
-
# If set, the filepath must be:
|
65
|
-
# - An absolute path
|
66
|
-
# - For a valid directory
|
67
|
-
# - The directory must be writable
|
68
|
-
#
|
69
|
-
# @see https://developer.vonage.com/en/api/proactive-connect#itemsDownload
|
70
|
-
#
|
71
|
-
def download_csv(list_id:, order: 'asc', **params)
|
72
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
73
|
-
response = request("/v0.1/bulk/lists/#{list_id}/items/download?order=#{order}", response_class: FileResponse)
|
74
|
-
|
75
|
-
response.filename = params[:filename] if params[:filename]
|
76
|
-
response.save(filepath: params[:filepath]) if params[:filepath]
|
77
|
-
|
78
|
-
response
|
79
|
-
end
|
80
|
-
|
81
|
-
# Import list items from a CSV file
|
82
|
-
#
|
83
|
-
# @deprecated
|
84
|
-
#
|
85
|
-
# @example
|
86
|
-
# response = proactive_connect.items.upload_csv(list_id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865', filepath: '/files/import.csv')
|
87
|
-
#
|
88
|
-
# @param [required, String] :list_id
|
89
|
-
# ID for the list to download
|
90
|
-
#
|
91
|
-
# @param [optional, String] order
|
92
|
-
# Sort in either ascending (asc, the default) or descending (desc) order
|
93
|
-
#
|
94
|
-
# @param [optional, String] :filename
|
95
|
-
# A name to set for the returned File object. If not set, the File object will use the actual filename (if available)
|
96
|
-
# or a default of `download.csv` if the actual filename is not available.
|
97
|
-
#
|
98
|
-
# @param [required, String] :filepath
|
99
|
-
# A filepath for the file to import. The file must be:
|
100
|
-
# - A valid file
|
101
|
-
# - Readable
|
102
|
-
# - Must have a `.csv` extension
|
103
|
-
#
|
104
|
-
# @see https://developer.vonage.com/en/api/proactive-connect#itemsImport
|
105
|
-
#
|
106
|
-
def upload_csv(list_id:, filepath:)
|
107
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
108
|
-
pn = Pathname.new(filepath)
|
109
|
-
raise ArgumentError, ':filepath not for a file' unless pn.file?
|
110
|
-
raise ArgumentError, 'file at :filepath not readable' unless pn.readable?
|
111
|
-
raise ArgumentError, 'file at :filepath not csv' unless pn.extname == '.csv'
|
112
|
-
|
113
|
-
multipart_post_request("/v0.1/bulk/lists/#{list_id}/items/import", filepath: filepath, file_name: pn.basename, mime_type: 'text/csv')
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
@@ -1,186 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Vonage
|
5
|
-
class ProactiveConnect::List < Namespace
|
6
|
-
extend T::Sig
|
7
|
-
|
8
|
-
self.authentication = BearerToken
|
9
|
-
|
10
|
-
self.host = :vonage_host
|
11
|
-
|
12
|
-
self.request_body = JSON
|
13
|
-
|
14
|
-
# Create list
|
15
|
-
#
|
16
|
-
# @deprecated
|
17
|
-
#
|
18
|
-
# @example
|
19
|
-
# response = proactive_connect.list.create(name: 'List Number 1')
|
20
|
-
#
|
21
|
-
# @param [required, String] :name
|
22
|
-
# A name for the list
|
23
|
-
#
|
24
|
-
# @param [optional, String] :description
|
25
|
-
# A description of the list
|
26
|
-
#
|
27
|
-
# @param [optional, Array] :tags
|
28
|
-
# An Array of up to 10 Strings assigining tags to the list. Each String must be between 1 and 15 characters
|
29
|
-
#
|
30
|
-
# @param [optional, Array] :attributes
|
31
|
-
# Array of Hash objects. Each Hash represents an attribute for the list.
|
32
|
-
#
|
33
|
-
# @option attributes [required, String] :name
|
34
|
-
# The name of the attribute
|
35
|
-
#
|
36
|
-
# @option attributes [optional, String] :alias
|
37
|
-
# Alternative name to use for this attribute.
|
38
|
-
# Use when you wish to correlate between 2 or more list that are using different attribute names for the same semantic data
|
39
|
-
#
|
40
|
-
# @option attributes [optional, Boolean] :key
|
41
|
-
# Set to `true` if this attribute should be used to correlate between 2 or more lists. Default is `false`
|
42
|
-
#
|
43
|
-
# @param [optional, Hash] :datasource
|
44
|
-
# Datasource for the list
|
45
|
-
#
|
46
|
-
# @option datasource [required, String] :type
|
47
|
-
# Must be set to `manual`, which is the default
|
48
|
-
#
|
49
|
-
# @see https://developer.vonage.com/en/api/proactive-connect#listsCreate
|
50
|
-
#
|
51
|
-
def create(name:, **params)
|
52
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
53
|
-
request(
|
54
|
-
"/v0.1/bulk/lists",
|
55
|
-
params: params.merge({ name: name }),
|
56
|
-
type: Post
|
57
|
-
)
|
58
|
-
end
|
59
|
-
|
60
|
-
# Get list by id
|
61
|
-
#
|
62
|
-
# @deprecated
|
63
|
-
#
|
64
|
-
# @example
|
65
|
-
# response = proactive_connect.list.find(id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865')
|
66
|
-
#
|
67
|
-
# @param [required, String] :id
|
68
|
-
# Unique identifier for the list
|
69
|
-
#
|
70
|
-
# @see https://developer.vonage.com/en/api/proactive-connect#listsGet
|
71
|
-
#
|
72
|
-
def find(id:)
|
73
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
74
|
-
request("/v0.1/bulk/lists/#{id}")
|
75
|
-
end
|
76
|
-
|
77
|
-
# Update list
|
78
|
-
#
|
79
|
-
# @deprecated
|
80
|
-
#
|
81
|
-
# @example
|
82
|
-
# response = proactive_connect.list.update(name: 'List Number 1')
|
83
|
-
#
|
84
|
-
# @param [required, String] :id
|
85
|
-
# The id of the list to update
|
86
|
-
#
|
87
|
-
# @param [required, String] :name
|
88
|
-
# The name of the list
|
89
|
-
#
|
90
|
-
# @param [optional, String] :description
|
91
|
-
# A description of the list
|
92
|
-
#
|
93
|
-
# @param [optional, Array] :tags
|
94
|
-
# An Array of up to 10 Strings assigining tags to the list. Each String must be between 1 and 15 characters
|
95
|
-
#
|
96
|
-
# @param [optional, Array] :attributes
|
97
|
-
# Array of Hash objects. Each Hash represents an attribute for the list.
|
98
|
-
#
|
99
|
-
# @option attributes [required, String] :name
|
100
|
-
# The name of the attribute
|
101
|
-
#
|
102
|
-
# @option attributes [optional, String] :alias
|
103
|
-
# Alternative name to use for this attribute.
|
104
|
-
# Use when you wish to correlate between 2 or more list that are using different attribute names for the same semantic data
|
105
|
-
#
|
106
|
-
# @option attributes [optional, Boolean] :key
|
107
|
-
# Set to `true` if this attribute should be used to correlate between 2 or more lists. Default is `false`
|
108
|
-
#
|
109
|
-
# @param [optional, Hash] :datasource
|
110
|
-
# Datasource for the list
|
111
|
-
#
|
112
|
-
# @option datasource [required, String] :type
|
113
|
-
# Must be set to `manual`, which is the default
|
114
|
-
#
|
115
|
-
# @see https://developer.vonage.com/en/api/proactive-connect#listsUpdate
|
116
|
-
#
|
117
|
-
def update(id:, name:, **params)
|
118
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
119
|
-
request(
|
120
|
-
"/v0.1/bulk/lists/#{id}",
|
121
|
-
params: params.merge({ name: name }),
|
122
|
-
type: Put
|
123
|
-
)
|
124
|
-
end
|
125
|
-
|
126
|
-
# Delete a list by id
|
127
|
-
#
|
128
|
-
# @deprecated
|
129
|
-
#
|
130
|
-
# @example
|
131
|
-
# response = proactive_connect.list.delete(id: '74ea1ecf-06c9-4072-a285-61677bd353e8')
|
132
|
-
#
|
133
|
-
# @param [required, String] :id
|
134
|
-
# Unique identifier for the list
|
135
|
-
#
|
136
|
-
# @see https://developer.vonage.com/en/api/proactive-connect#listsDelete
|
137
|
-
#
|
138
|
-
def delete(id:)
|
139
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
140
|
-
request(
|
141
|
-
"/v0.1/bulk/lists/#{id}",
|
142
|
-
type: Delete
|
143
|
-
)
|
144
|
-
end
|
145
|
-
|
146
|
-
# Clear list by deleting all items
|
147
|
-
#
|
148
|
-
# @deprecated
|
149
|
-
#
|
150
|
-
# @example
|
151
|
-
# response = proactive_connect.list.clear_items(id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865')
|
152
|
-
#
|
153
|
-
# @param [required, String] :id
|
154
|
-
# Unique identifier for the list
|
155
|
-
#
|
156
|
-
# @see https://developer.vonage.com/en/api/proactive-connect#listsClear
|
157
|
-
#
|
158
|
-
def clear_items(id:)
|
159
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
160
|
-
request(
|
161
|
-
"/v0.1/bulk/lists/#{id}/clear",
|
162
|
-
type: Post
|
163
|
-
)
|
164
|
-
end
|
165
|
-
|
166
|
-
# Fetch and replace all items from datasource
|
167
|
-
#
|
168
|
-
# @deprecated
|
169
|
-
#
|
170
|
-
# @example
|
171
|
-
# response = proactive_connect.list.fetch_and_replace_items(id: 'e546eebe-8e23-4e4d-bb7c-29d4700c9865')
|
172
|
-
#
|
173
|
-
# @param [required, String] :id
|
174
|
-
# Unique identifier for the list
|
175
|
-
#
|
176
|
-
# @see https://developer.vonage.com/en/api/proactive-connect#listsFetch
|
177
|
-
#
|
178
|
-
def fetch_and_replace_items(id:)
|
179
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
180
|
-
request(
|
181
|
-
"/v0.1/bulk/lists/#{id}/fetch",
|
182
|
-
type: Post
|
183
|
-
)
|
184
|
-
end
|
185
|
-
end
|
186
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Vonage
|
5
|
-
class ProactiveConnect::Lists < Namespace
|
6
|
-
extend T::Sig
|
7
|
-
|
8
|
-
self.authentication = BearerToken
|
9
|
-
|
10
|
-
self.host = :vonage_host
|
11
|
-
|
12
|
-
# Find all lists
|
13
|
-
#
|
14
|
-
# @deprecated
|
15
|
-
#
|
16
|
-
# @example
|
17
|
-
# response = proactive_connect.lists.list
|
18
|
-
#
|
19
|
-
# @param [optional, String] :page
|
20
|
-
# Page of results to jump to
|
21
|
-
#
|
22
|
-
# @param [optional, String] :page_size
|
23
|
-
# Number of results per page
|
24
|
-
#
|
25
|
-
# @param [optional, String] order
|
26
|
-
# Sort in either ascending (asc, the default) or descending (desc) order
|
27
|
-
#
|
28
|
-
# @see https://developer.vonage.com/en/api/proactive-connect#listsFindAll
|
29
|
-
#
|
30
|
-
def list(**params)
|
31
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
32
|
-
path = "/v0.1/bulk/lists"
|
33
|
-
path += "?#{Params.encode(params)}" unless params.empty?
|
34
|
-
|
35
|
-
request(path, response_class: ListResponse)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Vonage
|
5
|
-
class ProactiveConnect < Namespace
|
6
|
-
extend T::Sig
|
7
|
-
|
8
|
-
# @deprecated
|
9
|
-
sig { returns(T.nilable(Vonage::ProactiveConnect::Lists)) }
|
10
|
-
def lists
|
11
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
12
|
-
@lists ||= Lists.new(@config)
|
13
|
-
end
|
14
|
-
|
15
|
-
# @deprecated
|
16
|
-
sig { returns(T.nilable(Vonage::ProactiveConnect::List)) }
|
17
|
-
def list
|
18
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
19
|
-
@list ||= List.new(@config)
|
20
|
-
end
|
21
|
-
|
22
|
-
# @deprecated
|
23
|
-
sig { returns(T.nilable(Vonage::ProactiveConnect::Items)) }
|
24
|
-
def items
|
25
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
26
|
-
@items ||= Items.new(@config)
|
27
|
-
end
|
28
|
-
|
29
|
-
# @deprecated
|
30
|
-
sig { returns(T.nilable(Vonage::ProactiveConnect::Item)) }
|
31
|
-
def item
|
32
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
33
|
-
@item ||= Item.new(@config)
|
34
|
-
end
|
35
|
-
|
36
|
-
# @deprecated
|
37
|
-
sig { returns(T.nilable(Vonage::ProactiveConnect::Events)) }
|
38
|
-
def events
|
39
|
-
logger.info('This method is deprecated and will be removed in a future release.')
|
40
|
-
@events ||= Events.new(@config)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|