bandwidth-sdk 3.3.0 → 3.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bandwidth.rb +2 -0
  3. data/lib/bandwidth/api_helper.rb +14 -9
  4. data/lib/bandwidth/client.rb +11 -2
  5. data/lib/bandwidth/configuration.rb +23 -5
  6. data/lib/bandwidth/http/auth/web_rtc_basic_auth.rb +22 -0
  7. data/lib/bandwidth/messaging_lib/messaging/client.rb +7 -2
  8. data/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +18 -12
  9. data/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb +1 -1
  10. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth.rb +1 -0
  11. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/client.rb +7 -2
  12. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/api_controller.rb +38 -9
  13. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/base_controller.rb +1 -1
  14. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/invalid_request_exception.rb +29 -0
  15. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_code_request_schema.rb +30 -4
  16. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb +33 -10
  17. data/lib/bandwidth/voice_lib/bxml/verbs/bridge.rb +22 -0
  18. data/lib/bandwidth/voice_lib/bxml/verbs/conference.rb +28 -0
  19. data/lib/bandwidth/voice_lib/voice.rb +5 -0
  20. data/lib/bandwidth/voice_lib/voice/client.rb +7 -2
  21. data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +352 -115
  22. data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +1 -1
  23. data/lib/bandwidth/voice_lib/voice/models/api_create_call_request.rb +20 -2
  24. data/lib/bandwidth/voice_lib/voice/models/call_engine_modify_conference_request.rb +35 -0
  25. data/lib/bandwidth/voice_lib/voice/models/conference_detail.rb +105 -0
  26. data/lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb +35 -0
  27. data/lib/bandwidth/voice_lib/voice/models/conference_member_detail.rb +80 -0
  28. data/lib/bandwidth/voice_lib/voice/models/disconnect_cause_enum.rb +4 -1
  29. data/lib/bandwidth/voice_lib/voice/models/recording_metadata_response.rb +1 -1
  30. data/lib/bandwidth/voice_lib/voice/models/status1_enum.rb +8 -14
  31. data/lib/bandwidth/voice_lib/voice/models/status2_enum.rb +32 -0
  32. data/lib/bandwidth/voice_lib/voice/models/status_enum.rb +4 -13
  33. data/lib/bandwidth/voice_lib/voice/models/transcription.rb +1 -1
  34. data/lib/bandwidth/web_rtc_lib/web_rtc.rb +21 -0
  35. data/lib/bandwidth/web_rtc_lib/web_rtc/client.rb +49 -0
  36. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb +692 -0
  37. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb +49 -0
  38. data/lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb +34 -0
  39. data/lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb +47 -0
  40. data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb +83 -0
  41. data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant_subscription.rb +35 -0
  42. data/lib/bandwidth/web_rtc_lib/web_rtc/models/publish_permission_enum.rb +17 -0
  43. data/lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb +44 -0
  44. data/lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb +54 -0
  45. metadata +22 -2
@@ -0,0 +1,49 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # BaseController.
8
+ class BaseController
9
+ attr_accessor :config, :http_call_back
10
+
11
+ def initialize(config, http_call_back: nil)
12
+ @config = config
13
+ @http_call_back = http_call_back
14
+
15
+ @global_headers = {
16
+ 'user-agent' => 'ruby-sdk-refs/tags/ruby3.8.0'
17
+ }
18
+ end
19
+
20
+ def validate_parameters(args)
21
+ args.each do |_name, value|
22
+ if value.nil?
23
+ raise ArgumentError, "Required parameter #{_name} cannot be nil."
24
+ end
25
+ end
26
+ end
27
+
28
+ def execute_request(request, binary: false)
29
+ @http_call_back.on_before_request(request) if @http_call_back
30
+
31
+ APIHelper.clean_hash(request.headers)
32
+ request.headers.merge!(@global_headers)
33
+
34
+ response = if binary
35
+ config.http_client.execute_as_binary(request)
36
+ else
37
+ config.http_client.execute_as_string(request)
38
+ end
39
+ @http_call_back.on_after_response(response) if @http_call_back
40
+
41
+ response
42
+ end
43
+
44
+ def validate_response(response)
45
+ raise APIException.new 'HTTP Response Not OK', response unless
46
+ response.status_code.between?(200, 208) # [200,208] = HTTP OK
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,34 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # Error class.
8
+ class ErrorException < APIException
9
+ # TODO: Write general description for this method
10
+ # @return [Integer]
11
+ attr_accessor :code
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [String]
15
+ attr_accessor :message
16
+
17
+ # The constructor.
18
+ # @param [String] The reason for raising an exception.
19
+ # @param [HttpResponse] The HttpReponse of the API call.
20
+ def initialize(reason, response)
21
+ super(reason, response)
22
+ hash = APIHelper.json_deserialize(@response.raw_body)
23
+ unbox(hash)
24
+ end
25
+
26
+ # Populates this object by extracting properties from a hash.
27
+ # @param [Hash] The deserialized response sent by the server in the
28
+ # response body.
29
+ def unbox(hash)
30
+ @code = hash['code']
31
+ @message = hash['message']
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,47 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # AccountsParticipantsResponse Model.
8
+ class AccountsParticipantsResponse < BaseModel
9
+ # A participant object
10
+ # @return [Participant]
11
+ attr_accessor :participant
12
+
13
+ # Auth token for the returned participant
14
+ # This should be passed to the participant so that they can connect to the
15
+ # platform
16
+ # @return [String]
17
+ attr_accessor :token
18
+
19
+ # A mapping from model property names to API property names.
20
+ def self.names
21
+ @_hash = {} if @_hash.nil?
22
+ @_hash['participant'] = 'participant'
23
+ @_hash['token'] = 'token'
24
+ @_hash
25
+ end
26
+
27
+ def initialize(participant = nil,
28
+ token = nil)
29
+ @participant = participant
30
+ @token = token
31
+ end
32
+
33
+ # Creates an instance of the object from a hash.
34
+ def self.from_hash(hash)
35
+ return nil unless hash
36
+
37
+ # Extract variables from the hash.
38
+ participant = Participant.from_hash(hash['participant']) if
39
+ hash['participant']
40
+ token = hash['token']
41
+
42
+ # Create object from extracted values.
43
+ AccountsParticipantsResponse.new(participant,
44
+ token)
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,83 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # A participant object
8
+ class Participant < BaseModel
9
+ # Unique id of the participant
10
+ # @return [String]
11
+ attr_accessor :id
12
+
13
+ # Full callback url to use for notifications about this participant
14
+ # @return [String]
15
+ attr_accessor :callback_url
16
+
17
+ # Defines if this participant can publish audio or video
18
+ # @return [List of PublishPermissionEnum]
19
+ attr_accessor :publish_permissions
20
+
21
+ # List of session ids this participant is associated with
22
+ # Capped to one
23
+ # @return [List of String]
24
+ attr_accessor :sessions
25
+
26
+ # List of session ids this participant is associated with
27
+ # Capped to one
28
+ # @return [Subscriptions]
29
+ attr_accessor :subscriptions
30
+
31
+ # User defined tag to associate with the participant
32
+ # @return [String]
33
+ attr_accessor :tag
34
+
35
+ # A mapping from model property names to API property names.
36
+ def self.names
37
+ @_hash = {} if @_hash.nil?
38
+ @_hash['id'] = 'id'
39
+ @_hash['callback_url'] = 'callbackUrl'
40
+ @_hash['publish_permissions'] = 'publishPermissions'
41
+ @_hash['sessions'] = 'sessions'
42
+ @_hash['subscriptions'] = 'subscriptions'
43
+ @_hash['tag'] = 'tag'
44
+ @_hash
45
+ end
46
+
47
+ def initialize(id = nil,
48
+ callback_url = nil,
49
+ publish_permissions = nil,
50
+ sessions = nil,
51
+ subscriptions = nil,
52
+ tag = nil)
53
+ @id = id
54
+ @callback_url = callback_url
55
+ @publish_permissions = publish_permissions
56
+ @sessions = sessions
57
+ @subscriptions = subscriptions
58
+ @tag = tag
59
+ end
60
+
61
+ # Creates an instance of the object from a hash.
62
+ def self.from_hash(hash)
63
+ return nil unless hash
64
+
65
+ # Extract variables from the hash.
66
+ id = hash['id']
67
+ callback_url = hash['callbackUrl']
68
+ publish_permissions = hash['publishPermissions']
69
+ sessions = hash['sessions']
70
+ subscriptions = Subscriptions.from_hash(hash['subscriptions']) if
71
+ hash['subscriptions']
72
+ tag = hash['tag']
73
+
74
+ # Create object from extracted values.
75
+ Participant.new(id,
76
+ callback_url,
77
+ publish_permissions,
78
+ sessions,
79
+ subscriptions,
80
+ tag)
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,35 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # ParticipantSubscription Model.
8
+ class ParticipantSubscription < BaseModel
9
+ # Participant the subscriber should be subscribed to
10
+ # @return [String]
11
+ attr_accessor :participant_id
12
+
13
+ # A mapping from model property names to API property names.
14
+ def self.names
15
+ @_hash = {} if @_hash.nil?
16
+ @_hash['participant_id'] = 'participantId'
17
+ @_hash
18
+ end
19
+
20
+ def initialize(participant_id = nil)
21
+ @participant_id = participant_id
22
+ end
23
+
24
+ # Creates an instance of the object from a hash.
25
+ def self.from_hash(hash)
26
+ return nil unless hash
27
+
28
+ # Extract variables from the hash.
29
+ participant_id = hash['participantId']
30
+
31
+ # Create object from extracted values.
32
+ ParticipantSubscription.new(participant_id)
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,17 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # PublishPermission.
8
+ class PublishPermissionEnum
9
+ PUBLISH_PERMISSION_ENUM = [
10
+ # TODO: Write general description for AUDIO
11
+ AUDIO = 'AUDIO'.freeze,
12
+
13
+ # TODO: Write general description for VIDEO
14
+ VIDEO = 'VIDEO'.freeze
15
+ ].freeze
16
+ end
17
+ end
@@ -0,0 +1,44 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # A session object
8
+ class Session < BaseModel
9
+ # Unique id of the session
10
+ # @return [String]
11
+ attr_accessor :id
12
+
13
+ # User defined tag to associate with the session
14
+ # @return [String]
15
+ attr_accessor :tag
16
+
17
+ # A mapping from model property names to API property names.
18
+ def self.names
19
+ @_hash = {} if @_hash.nil?
20
+ @_hash['id'] = 'id'
21
+ @_hash['tag'] = 'tag'
22
+ @_hash
23
+ end
24
+
25
+ def initialize(id = nil,
26
+ tag = nil)
27
+ @id = id
28
+ @tag = tag
29
+ end
30
+
31
+ # Creates an instance of the object from a hash.
32
+ def self.from_hash(hash)
33
+ return nil unless hash
34
+
35
+ # Extract variables from the hash.
36
+ id = hash['id']
37
+ tag = hash['tag']
38
+
39
+ # Create object from extracted values.
40
+ Session.new(id,
41
+ tag)
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,54 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # Subscriptions Model.
8
+ class Subscriptions < BaseModel
9
+ # Session the subscriptions are associated with
10
+ # If this is the only field, the subscriber will be subscribed to all
11
+ # participants in the session (including any participants that are later
12
+ # added to the session)
13
+ # @return [String]
14
+ attr_accessor :session_id
15
+
16
+ # Subset of participants to subscribe to in the session. Optional.
17
+ # @return [List of ParticipantSubscription]
18
+ attr_accessor :participants
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['session_id'] = 'sessionId'
24
+ @_hash['participants'] = 'participants'
25
+ @_hash
26
+ end
27
+
28
+ def initialize(session_id = nil,
29
+ participants = nil)
30
+ @session_id = session_id
31
+ @participants = participants
32
+ end
33
+
34
+ # Creates an instance of the object from a hash.
35
+ def self.from_hash(hash)
36
+ return nil unless hash
37
+
38
+ # Extract variables from the hash.
39
+ session_id = hash['sessionId']
40
+ # Parameter is an array, so we need to iterate through it
41
+ participants = nil
42
+ unless hash['participants'].nil?
43
+ participants = []
44
+ hash['participants'].each do |structure|
45
+ participants << (ParticipantSubscription.from_hash(structure) if structure)
46
+ end
47
+ end
48
+
49
+ # Create object from extracted values.
50
+ Subscriptions.new(session_id,
51
+ participants)
52
+ end
53
+ end
54
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bandwidth-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - APIMatic SDK Generator
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-05 00:00:00.000000000 Z
11
+ date: 2020-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging
@@ -111,6 +111,7 @@ files:
111
111
  - lib/bandwidth/http/auth/messaging_basic_auth.rb
112
112
  - lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
113
113
  - lib/bandwidth/http/auth/voice_basic_auth.rb
114
+ - lib/bandwidth/http/auth/web_rtc_basic_auth.rb
114
115
  - lib/bandwidth/http/faraday_client.rb
115
116
  - lib/bandwidth/http/http_call_back.rb
116
117
  - lib/bandwidth/http/http_client.rb
@@ -133,6 +134,7 @@ files:
133
134
  - lib/bandwidth/two_factor_auth_lib/two_factor_auth/client.rb
134
135
  - lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/api_controller.rb
135
136
  - lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/base_controller.rb
137
+ - lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/invalid_request_exception.rb
136
138
  - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_code_request_schema.rb
137
139
  - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_messaging_response.rb
138
140
  - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_code_response.rb
@@ -140,6 +142,8 @@ files:
140
142
  - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_voice_response.rb
141
143
  - lib/bandwidth/utilities/file_wrapper.rb
142
144
  - lib/bandwidth/voice_lib/bxml/bxml.rb
145
+ - lib/bandwidth/voice_lib/bxml/verbs/bridge.rb
146
+ - lib/bandwidth/voice_lib/bxml/verbs/conference.rb
143
147
  - lib/bandwidth/voice_lib/bxml/verbs/forward.rb
144
148
  - lib/bandwidth/voice_lib/bxml/verbs/gather.rb
145
149
  - lib/bandwidth/voice_lib/bxml/verbs/hangup.rb
@@ -167,7 +171,11 @@ files:
167
171
  - lib/bandwidth/voice_lib/voice/models/api_create_call_request.rb
168
172
  - lib/bandwidth/voice_lib/voice/models/api_modify_call_request.rb
169
173
  - lib/bandwidth/voice_lib/voice/models/api_transcribe_recording_request.rb
174
+ - lib/bandwidth/voice_lib/voice/models/call_engine_modify_conference_request.rb
170
175
  - lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb
176
+ - lib/bandwidth/voice_lib/voice/models/conference_detail.rb
177
+ - lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb
178
+ - lib/bandwidth/voice_lib/voice/models/conference_member_detail.rb
171
179
  - lib/bandwidth/voice_lib/voice/models/direction_enum.rb
172
180
  - lib/bandwidth/voice_lib/voice/models/disconnect_cause_enum.rb
173
181
  - lib/bandwidth/voice_lib/voice/models/disconnect_method_enum.rb
@@ -179,10 +187,22 @@ files:
179
187
  - lib/bandwidth/voice_lib/voice/models/state2_enum.rb
180
188
  - lib/bandwidth/voice_lib/voice/models/state_enum.rb
181
189
  - lib/bandwidth/voice_lib/voice/models/status1_enum.rb
190
+ - lib/bandwidth/voice_lib/voice/models/status2_enum.rb
182
191
  - lib/bandwidth/voice_lib/voice/models/status_enum.rb
183
192
  - lib/bandwidth/voice_lib/voice/models/transcript.rb
184
193
  - lib/bandwidth/voice_lib/voice/models/transcription.rb
185
194
  - lib/bandwidth/voice_lib/voice/models/transcription_response.rb
195
+ - lib/bandwidth/web_rtc_lib/web_rtc.rb
196
+ - lib/bandwidth/web_rtc_lib/web_rtc/client.rb
197
+ - lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb
198
+ - lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb
199
+ - lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb
200
+ - lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb
201
+ - lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb
202
+ - lib/bandwidth/web_rtc_lib/web_rtc/models/participant_subscription.rb
203
+ - lib/bandwidth/web_rtc_lib/web_rtc/models/publish_permission_enum.rb
204
+ - lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
205
+ - lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb
186
206
  homepage: https://apimatic.io
187
207
  licenses:
188
208
  - MIT