vonage 7.14.0 → 7.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/vonage/client.rb +7 -0
- data/lib/vonage/users/list_response.rb +11 -0
- data/lib/vonage/users.rb +156 -0
- data/lib/vonage/verify2.rb +1 -1
- data/lib/vonage/version.rb +1 -1
- data/vonage.gemspec +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe42d262916665b0528b89b25fc9094ff4009739cea53ec28a416afe2ec232c8
|
4
|
+
data.tar.gz: d1bb14fcc3e8c862dedd87a32b80034d9914c0cafcc2c53f071b05a9c640a644
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a52f19d149c83ff7cbc2fe73982abaf79901c146fa45d006d19ba9f32b9640bf14065e132362aae591869339109deeafa68e72349a1e6d9f2a6fba173efbf9a6
|
7
|
+
data.tar.gz: 38f8d3a78930e5b13e8ed71e3bce0ee37789a506f053e9f31c543bdac10760f574dc976fca097f64f47419f9d99c4b912ce32484b389243b96c52f5fa6e7ef4c
|
data/lib/vonage/client.rb
CHANGED
@@ -145,6 +145,13 @@ module Vonage
|
|
145
145
|
@tfa ||= T.let(TFA.new(config), T.nilable(Vonage::TFA))
|
146
146
|
end
|
147
147
|
|
148
|
+
# @return [Users]
|
149
|
+
#
|
150
|
+
sig { returns(T.nilable(Vonage::Users)) }
|
151
|
+
def users
|
152
|
+
@users ||= T.let(Users.new(config), T.nilable(Vonage::Users))
|
153
|
+
end
|
154
|
+
|
148
155
|
# @return [Verify]
|
149
156
|
#
|
150
157
|
sig { returns(T.nilable(Vonage::Verify)) }
|
data/lib/vonage/users.rb
ADDED
@@ -0,0 +1,156 @@
|
|
1
|
+
# typed: strict
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Vonage
|
5
|
+
class Users < Namespace
|
6
|
+
extend T::Sig
|
7
|
+
self.authentication = BearerToken
|
8
|
+
|
9
|
+
self.request_body = JSON
|
10
|
+
|
11
|
+
# Get a list of Users associated with the Vonage Application.
|
12
|
+
#
|
13
|
+
# @param [optional, Integer] :page_size
|
14
|
+
# Specifies the number of records to be returned in the response.
|
15
|
+
#
|
16
|
+
# @param [optional, String] :order
|
17
|
+
# Specifies the order in which the records should be returned.
|
18
|
+
# Must be one of `asc`, `ASC`, `desc`, or `DESC`
|
19
|
+
#
|
20
|
+
# @param [optional, String] :cursor
|
21
|
+
# Specficy a cursor point from which to start returning results, for example the values of the `next` or `prev`
|
22
|
+
# `_links` contained in a response.
|
23
|
+
#
|
24
|
+
# @param [optional, String] :name
|
25
|
+
# Specify a user name with which to filter results
|
26
|
+
#
|
27
|
+
# @return [ListResponse]
|
28
|
+
#
|
29
|
+
# @see https://developer.vonage.com/en/api/application.v2#getUsers
|
30
|
+
#
|
31
|
+
def list(**params)
|
32
|
+
request('/v1/users', params: params, response_class: ListResponse)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Get a specified User associated with the Vonage Application.
|
36
|
+
#
|
37
|
+
# @param [required, String] :id
|
38
|
+
# The unique ID or name for the user.
|
39
|
+
#
|
40
|
+
# @return [Vonage::Response]
|
41
|
+
#
|
42
|
+
# @see https://developer.vonage.com/en/api/application.v2#getUser
|
43
|
+
#
|
44
|
+
def find(id:)
|
45
|
+
request("/v1/users/#{id}")
|
46
|
+
end
|
47
|
+
|
48
|
+
# Create a new User associated with the Vonage Application.
|
49
|
+
#
|
50
|
+
# @param [optional, String] :name
|
51
|
+
# A unique name for the user. If not provided, a name will be auto-generated.
|
52
|
+
#
|
53
|
+
# @param [optional, String] :display_name
|
54
|
+
# A string to be displayed as user name. It does not need to be unique.
|
55
|
+
#
|
56
|
+
# @param [optional, String] :image_url
|
57
|
+
# A publicly accessible URL to an image file for an image to be associated with the user.
|
58
|
+
#
|
59
|
+
# @param [optional, Hash] :properties A hash defining properties for the User.
|
60
|
+
# @option properties [Hash] :custom_data A hash of custom data as key/value pairs.
|
61
|
+
#
|
62
|
+
# @param [optional, Hash] :channels A hash defining details of various channels.
|
63
|
+
# @option channels [Array] :pstn An array containing a Hash which defines data for the pstn channel.
|
64
|
+
# @option pstn [Integer] :number The pstn number.
|
65
|
+
# @option channels [Array] :sip An array containing a Hash which defines data for the sip channel.
|
66
|
+
# @option sip [String] :uri The sip uri.
|
67
|
+
# @option sip [String] :username The sip username.
|
68
|
+
# @option sip [String] :password The sip password.
|
69
|
+
# @option channels [Array] :vbc An array containing a Hash which defines data for the vbc channel.
|
70
|
+
# @option vbc [String] :extension The vbc extension.
|
71
|
+
# @option channels [Array] :websocket An array containing a Hash which defines data for the websocket channel.
|
72
|
+
# @option websocket [String] :uri The websocket uri.
|
73
|
+
# @option websocket [String] :content-type The websocket audio type. Must be one of: `audio/l16;rate=8000`, `audio/l16;rate=16000`.
|
74
|
+
# @option websocket [Hash] :headers A hash of custom websocket headers provided as key/value pairs.
|
75
|
+
# @option channels [Array] :sms An array containing a Hash which defines data for the sms channel.
|
76
|
+
# @option sms [Integer] :number The sms number.
|
77
|
+
# @option channels [Array] :mms An array containing a Hash which defines data for the mms channel.
|
78
|
+
# @option mms [Integer] :number The mms number.
|
79
|
+
# @option channels [Array] :whatsapp An array containing a Hash which defines data for the whatsapp channel.
|
80
|
+
# @option whatsapp [Integer] :number The whatsapp number.
|
81
|
+
# @option channels [Array] :viber An array containing a Hash which defines data for the sms channel.
|
82
|
+
# @option viber [Integer] :number The viber number.
|
83
|
+
# @option channels [Array] :messenger An array containing a Hash which defines data for the messenger channel.
|
84
|
+
# @option messenger [Integer] :id The messenger id.
|
85
|
+
#
|
86
|
+
# @return [Vonage::Response]
|
87
|
+
#
|
88
|
+
# @see https://developer.vonage.com/en/api/application.v2#createUser
|
89
|
+
#
|
90
|
+
def create(**params)
|
91
|
+
request('/v1/users', params: params, type: Post)
|
92
|
+
end
|
93
|
+
|
94
|
+
# Update an existing User associated with the Vonage Application.
|
95
|
+
#
|
96
|
+
# @param [required, String] :id
|
97
|
+
# The unique ID or name for the user to be updated.
|
98
|
+
#
|
99
|
+
# @param [optional, String] :name
|
100
|
+
# A unique name for the user.
|
101
|
+
#
|
102
|
+
# @param [optional, String] :display_name
|
103
|
+
# A string to be displayed as user name. It does not need to be unique.
|
104
|
+
#
|
105
|
+
# @param [optional, String] :image_url
|
106
|
+
# A publicly accessible URL to an image file for an image to be associated with the user.
|
107
|
+
#
|
108
|
+
# @param [optional, Hash] :properties A hash defining properties for the User.
|
109
|
+
# @option properties [Hash] :custom_data A hash of custom data as key/value pairs.
|
110
|
+
#
|
111
|
+
# @param [optional, Hash] :channels A hash defining details of various channels.
|
112
|
+
# @option channels [Array] :pstn An array containing a Hash which defines data for the pstn channel.
|
113
|
+
# @option pstn [Integer] :number The pstn number.
|
114
|
+
# @option channels [Array] :sip An array containing a Hash which defines data for the sip channel.
|
115
|
+
# @option sip [String] :uri The sip uri.
|
116
|
+
# @option sip [String] :username The sip username.
|
117
|
+
# @option sip [String] :password The sip password.
|
118
|
+
# @option channels [Array] :vbc An array containing a Hash which defines data for the vbc channel.
|
119
|
+
# @option vbc [String] :extension The vbc extension.
|
120
|
+
# @option channels [Array] :websocket An array containing a Hash which defines data for the websocket channel.
|
121
|
+
# @option websocket [String] :uri The websocket uri.
|
122
|
+
# @option websocket [String] :content-type The websocket audio type. Must be one of: `audio/l16;rate=8000`, `audio/l16;rate=16000`.
|
123
|
+
# @option websocket [Hash] :headers A hash of custom websocket headers provided as key/value pairs.
|
124
|
+
# @option channels [Array] :sms An array containing a Hash which defines data for the sms channel.
|
125
|
+
# @option sms [Integer] :number The sms number.
|
126
|
+
# @option channels [Array] :mms An array containing a Hash which defines data for the mms channel.
|
127
|
+
# @option mms [Integer] :number The mms number.
|
128
|
+
# @option channels [Array] :whatsapp An array containing a Hash which defines data for the whatsapp channel.
|
129
|
+
# @option whatsapp [Integer] :number The whatsapp number.
|
130
|
+
# @option channels [Array] :viber An array containing a Hash which defines data for the sms channel.
|
131
|
+
# @option viber [Integer] :number The viber number.
|
132
|
+
# @option channels [Array] :messenger An array containing a Hash which defines data for the messenger channel.
|
133
|
+
# @option messenger [Integer] :id The messenger id.
|
134
|
+
#
|
135
|
+
# @return [Vonage::Response]
|
136
|
+
#
|
137
|
+
# @see https://developer.vonage.com/en/api/application.v2#createUser
|
138
|
+
#
|
139
|
+
def update(id:, **params)
|
140
|
+
request("/v1/users/#{id}", params: params, type: Patch)
|
141
|
+
end
|
142
|
+
|
143
|
+
# Delete a specified User associated with the Vonage Application.
|
144
|
+
#
|
145
|
+
# @param [required, String] :id
|
146
|
+
# The unique ID or name for the user.
|
147
|
+
#
|
148
|
+
# @return [Vonage::Response]
|
149
|
+
#
|
150
|
+
# @see https://developer.vonage.com/en/api/application.v2#deleteUser
|
151
|
+
#
|
152
|
+
def delete(id:)
|
153
|
+
request("/v1/users/#{id}", type: Delete)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
data/lib/vonage/verify2.rb
CHANGED
@@ -28,7 +28,7 @@ module Vonage
|
|
28
28
|
# @option opts [String] :client_ref Reference to be included in callbacks
|
29
29
|
# @option opts [Boolean] If used, must be set to `false`. Will bypass a network block for a single Verify V2 request
|
30
30
|
#
|
31
|
-
# @return
|
31
|
+
# @return Vonage::Response
|
32
32
|
# @see https://developer.vonage.com/en/api/verify.v2#newRequest
|
33
33
|
#
|
34
34
|
def start_verification(brand:, workflow:, **opts)
|
data/lib/vonage/version.rb
CHANGED
data/vonage.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = 'This is the Ruby Server SDK for Vonage APIs. To use it you\'ll need a Vonage account. Sign up for free at https://www.vonage.com'
|
13
13
|
s.files = Dir.glob('lib/**/*.rb') + %w(LICENSE.txt README.md vonage.gemspec)
|
14
14
|
s.required_ruby_version = '>= 2.5.0'
|
15
|
-
s.add_dependency('vonage-jwt', '~> 0.1.
|
15
|
+
s.add_dependency('vonage-jwt', '~> 0.1.3')
|
16
16
|
s.add_dependency('zeitwerk', '~> 2', '>= 2.2')
|
17
17
|
s.add_dependency('sorbet-runtime', '~> 0.5')
|
18
18
|
s.add_dependency('multipart-post', '~> 2.0')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vonage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vonage
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vonage-jwt
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
19
|
+
version: 0.1.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.
|
26
|
+
version: 0.1.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: zeitwerk
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -190,6 +190,8 @@ files:
|
|
190
190
|
- lib/vonage/subaccounts/list_response.rb
|
191
191
|
- lib/vonage/tfa.rb
|
192
192
|
- lib/vonage/user_agent.rb
|
193
|
+
- lib/vonage/users.rb
|
194
|
+
- lib/vonage/users/list_response.rb
|
193
195
|
- lib/vonage/verify.rb
|
194
196
|
- lib/vonage/verify2.rb
|
195
197
|
- lib/vonage/verify2/channels/email.rb
|