vonage 7.14.0 → 7.15.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6681bf0608f283c8404c19838cae08679bed799b0d793622ba6863fbafddb2e
4
- data.tar.gz: 7c60d5f1ae1207a1404f705ce20b38cfe3ccbc5f549151f8367f346bb823b9e8
3
+ metadata.gz: 3d6768944b13ad567a9009b6b8612d4877f2bb61a33a5320c8bdaba5227e8250
4
+ data.tar.gz: d6ce687150cbc230e15b9437bce3c29c6ea2c9c11b69c6938dd0d5c9d76bf5c3
5
5
  SHA512:
6
- metadata.gz: 5c6ac59f07a9a94979ceca1e170bec5e67a0706b66d6b45cffe027505bf0280f3bad83041e6b09e1fec70afafb3edc47ea4f40a01894d9927ee7c19cae023247
7
- data.tar.gz: fbe93fa8fe2dd36b3ea498a5b48ad61ff9cfd6494435b1c3120cd47e3a0d9b1c3feffe2c847e619c716cbcb37688073bf5834cde1caf13b79c530d72661addf7
6
+ metadata.gz: 630445900058e653422d18dafb417d84babe40bc60584a598f60cb149539410a5f96348ac8eea1656ce67dc1b6ebc0956859059928b1d442ae7664f4446bbc7b
7
+ data.tar.gz: 64924d4e8c26cb23d76f327a4fe5ac137cf39fc6c870a850179e04ee5033b4b8c4420207adb1f1435891996c9386fe4ff0024fc4d12435060ab53bbe6c9c9ba6
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)) }
@@ -19,7 +19,7 @@ module Vonage
19
19
  #
20
20
  # @see https://developer.vonage.com/en/api/meetings#updateApplication
21
21
  def update(default_theme_id:)
22
- request("/meetings/applications", params: {update_details: {default_theme_id: default_theme_id}}, type: Patch)
22
+ request("/v1/meetings/applications", params: {update_details: {default_theme_id: default_theme_id}}, type: Patch)
23
23
  end
24
24
  end
25
25
  end
@@ -17,7 +17,7 @@ module Vonage
17
17
  #
18
18
  # @see https://developer.vonage.com/en/api/meetings#getDialInNumbers
19
19
  def list
20
- request("/meetings/dial-in-numbers", response_class: ListResponse)
20
+ request("/v1/meetings/dial-in-numbers", response_class: ListResponse)
21
21
  end
22
22
  end
23
23
  end
@@ -19,7 +19,7 @@ module Vonage
19
19
  #
20
20
  # @see https://developer.vonage.com/en/api/meetings#getRecording
21
21
  def info(recording_id:)
22
- request("/meetings/recordings/" + recording_id)
22
+ request("/v1/meetings/recordings/" + recording_id)
23
23
  end
24
24
 
25
25
  # Delete a specified recording.
@@ -30,7 +30,7 @@ module Vonage
30
30
  #
31
31
  # @see https://developer.vonage.com/en/api/meetings#deleteRecording
32
32
  def delete(recording_id:)
33
- request("/meetings/recordings/" + recording_id, type: Delete)
33
+ request("/v1/meetings/recordings/" + recording_id, type: Delete)
34
34
  end
35
35
  end
36
36
  end
@@ -23,7 +23,7 @@ module Vonage
23
23
  #
24
24
  # @see https://developer.vonage.com/en/api/meetings#getRooms
25
25
  def list(**params)
26
- path = "/meetings/rooms"
26
+ path = "/v1/meetings/rooms"
27
27
  path += "?#{Params.encode(params)}" unless params.empty?
28
28
 
29
29
  request(path, response_class: ListResponse)
@@ -38,7 +38,7 @@ module Vonage
38
38
  #
39
39
  # @see https://developer.vonage.com/en/api/meetings#getRoom
40
40
  def info(room_id:)
41
- request("/meetings/rooms/" + room_id)
41
+ request("/v1/meetings/rooms/" + room_id)
42
42
  end
43
43
 
44
44
  # Create a new room.
@@ -96,7 +96,7 @@ module Vonage
96
96
  # @see https://developer.vonage.com/en/api/meetings#createRoom
97
97
  def create(display_name:, **params)
98
98
  request(
99
- "/meetings/rooms",
99
+ "/v1/meetings/rooms",
100
100
  params: params.merge({ display_name: display_name }),
101
101
  type: Post
102
102
  )
@@ -144,7 +144,7 @@ module Vonage
144
144
  def update(room_id:, **params)
145
145
  raise ArgumentError, 'must provide at least one other param in addition to :room_id' if params.empty?
146
146
  request(
147
- "/meetings/rooms/" + room_id,
147
+ "/v1/meetings/rooms/" + room_id,
148
148
  params: {
149
149
  update_details: params
150
150
  },
@@ -20,7 +20,7 @@ module Vonage
20
20
  # @see https://developer.vonage.com/en/api/meetings#getSessionRecordings
21
21
  def list_recordings(session_id:)
22
22
  request(
23
- "/meetings/sessions/" + session_id + "/recordings",
23
+ "/v1/meetings/sessions/" + session_id + "/recordings",
24
24
  response_class: ListResponse
25
25
  )
26
26
  end
@@ -17,7 +17,7 @@ module Vonage
17
17
  #
18
18
  # @see https://developer.vonage.com/en/api/meetings#getThemes
19
19
  def list
20
- request("/meetings/themes", response_class: ListResponse)
20
+ request("/v1/meetings/themes", response_class: ListResponse)
21
21
  end
22
22
 
23
23
  # Return information for specified theme.
@@ -28,7 +28,7 @@ module Vonage
28
28
  #
29
29
  # @see https://developer.vonage.com/en/api/meetings#getThemeById
30
30
  def info(theme_id:)
31
- request("/meetings/themes/" + theme_id)
31
+ request("/v1/meetings/themes/" + theme_id)
32
32
  end
33
33
 
34
34
  # Create a new theme.
@@ -50,7 +50,7 @@ module Vonage
50
50
  # @see https://developer.vonage.com/en/api/meetings#createTheme
51
51
  def create(main_color:, brand_text:, **params)
52
52
  request(
53
- "/meetings/themes",
53
+ "/v1/meetings/themes",
54
54
  params: params.merge(main_color: main_color, brand_text: brand_text),
55
55
  type: Post
56
56
  )
@@ -77,7 +77,7 @@ module Vonage
77
77
  # @see https://developer.vonage.com/en/api/meetings#updateTheme
78
78
  def update(theme_id:, **params)
79
79
  request(
80
- "/meetings/themes/" + theme_id,
80
+ "/v1/meetings/themes/" + theme_id,
81
81
  params: {
82
82
  update_details: params
83
83
  },
@@ -97,7 +97,7 @@ module Vonage
97
97
  # @see https://developer.vonage.com/en/api/meetings#deleteTheme
98
98
  def delete(theme_id:, force: false)
99
99
  request(
100
- "/meetings/themes/" + theme_id + "?force=#{force}",
100
+ "/v1/meetings/themes/" + theme_id + "?force=#{force}",
101
101
  type: Delete
102
102
  )
103
103
  end
@@ -116,7 +116,7 @@ module Vonage
116
116
  #
117
117
  # @see https://developer.vonage.com/en/api/meetings#getRoomsByThemeId
118
118
  def list_rooms(theme_id:, **params)
119
- path = "/meetings/themes/" + theme_id + "/rooms"
119
+ path = "/v1/meetings/themes/" + theme_id + "/rooms"
120
120
  path += "?#{Params.encode(params)}" unless params.empty?
121
121
 
122
122
  request(path, response_class: Meetings::Rooms::ListResponse)
@@ -164,7 +164,7 @@ module Vonage
164
164
  private
165
165
 
166
166
  def get_logo_upload_credentials
167
- request("/meetings/themes/logos-upload-urls", response_class: ListResponse)
167
+ request("/v1/meetings/themes/logos-upload-urls", response_class: ListResponse)
168
168
  end
169
169
 
170
170
  def upload_logo_file(filepath:, credentials:)
@@ -185,7 +185,7 @@ module Vonage
185
185
 
186
186
  def finalize_logos(theme_id:, keys: [])
187
187
  request(
188
- "/meetings/themes/" + theme_id + "/finalizeLogos",
188
+ "/v1/meetings/themes/" + theme_id + "/finalizeLogos",
189
189
  params: {
190
190
  keys: keys
191
191
  },
@@ -0,0 +1,11 @@
1
+ # typed: true
2
+
3
+ class Vonage::Users::ListResponse < Vonage::Response
4
+ include Enumerable
5
+
6
+ def each
7
+ return enum_for(:each) unless block_given?
8
+
9
+ @entity._embedded.users.each { |item| yield item }
10
+ end
11
+ end
@@ -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
@@ -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 Vomage::Response
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)
@@ -1,5 +1,5 @@
1
1
  # typed: strong
2
2
 
3
3
  module Vonage
4
- VERSION = "7.14.0"
4
+ VERSION = "7.15.1"
5
5
  end
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.0')
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.14.0
4
+ version: 7.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vonage
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-13 00:00:00.000000000 Z
11
+ date: 2023-09-15 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.0
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.0
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