bandwidth-sdk 3.5.0 → 3.10.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.
Files changed (52) 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 +13 -2
  5. data/lib/bandwidth/configuration.rb +46 -9
  6. data/lib/bandwidth/http/auth/web_rtc_basic_auth.rb +22 -0
  7. data/lib/bandwidth/messaging_lib/messaging/client.rb +9 -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/client.rb +9 -2
  11. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/api_controller.rb +14 -9
  12. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/base_controller.rb +1 -1
  13. data/lib/bandwidth/voice_lib/bxml/verbs/bridge.rb +28 -0
  14. data/lib/bandwidth/voice_lib/bxml/verbs/conference.rb +5 -1
  15. data/lib/bandwidth/voice_lib/bxml/verbs/gather.rb +5 -1
  16. data/lib/bandwidth/voice_lib/bxml/verbs/phone_number.rb +5 -1
  17. data/lib/bandwidth/voice_lib/bxml/verbs/record.rb +5 -1
  18. data/lib/bandwidth/voice_lib/bxml/verbs/redirect.rb +5 -1
  19. data/lib/bandwidth/voice_lib/bxml/verbs/ring.rb +15 -0
  20. data/lib/bandwidth/voice_lib/bxml/verbs/transfer.rb +5 -1
  21. data/lib/bandwidth/voice_lib/voice.rb +8 -2
  22. data/lib/bandwidth/voice_lib/voice/client.rb +9 -2
  23. data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +625 -55
  24. data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +1 -1
  25. data/lib/bandwidth/voice_lib/voice/models/answer_fallback_method_enum.rb +17 -0
  26. data/lib/bandwidth/voice_lib/voice/models/api_call_response.rb +45 -0
  27. data/lib/bandwidth/voice_lib/voice/models/api_create_call_request.rb +45 -0
  28. data/lib/bandwidth/voice_lib/voice/models/api_modify_call_request.rb +36 -0
  29. data/lib/bandwidth/voice_lib/voice/models/api_transcribe_recording_request.rb +11 -2
  30. data/lib/bandwidth/voice_lib/voice/models/call_engine_modify_conference_request.rb +74 -2
  31. data/lib/bandwidth/voice_lib/voice/models/conference_detail.rb +108 -0
  32. data/lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb +35 -0
  33. data/lib/bandwidth/voice_lib/voice/models/conference_member_detail.rb +80 -0
  34. data/lib/bandwidth/voice_lib/voice/models/conference_recording_metadata_response.rb +126 -0
  35. data/lib/bandwidth/voice_lib/voice/models/recording_metadata_response.rb +32 -4
  36. data/lib/bandwidth/voice_lib/voice/models/redirect_fallback_method_enum.rb +17 -0
  37. data/lib/bandwidth/voice_lib/voice/models/state_enum.rb +3 -3
  38. data/lib/bandwidth/voice_lib/voice/models/status1_enum.rb +4 -1
  39. data/lib/bandwidth/voice_lib/voice/models/{status2_enum.rb → status3_enum.rb} +3 -3
  40. data/lib/bandwidth/voice_lib/voice/models/transcription.rb +1 -1
  41. data/lib/bandwidth/web_rtc_lib/web_rtc.rb +21 -0
  42. data/lib/bandwidth/web_rtc_lib/web_rtc/client.rb +51 -0
  43. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb +692 -0
  44. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb +49 -0
  45. data/lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb +34 -0
  46. data/lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb +47 -0
  47. data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb +83 -0
  48. data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant_subscription.rb +35 -0
  49. data/lib/bandwidth/web_rtc_lib/web_rtc/models/publish_permission_enum.rb +17 -0
  50. data/lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb +44 -0
  51. data/lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb +54 -0
  52. metadata +43 -11
@@ -0,0 +1,108 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ require 'date'
7
+ module Bandwidth
8
+ # ConferenceDetail Model.
9
+ class ConferenceDetail < BaseModel
10
+ # TODO: Write general description for this method
11
+ # @return [String]
12
+ attr_accessor :id
13
+
14
+ # TODO: Write general description for this method
15
+ # @return [String]
16
+ attr_accessor :name
17
+
18
+ # TODO: Write general description for this method
19
+ # @return [DateTime]
20
+ attr_accessor :created_time
21
+
22
+ # TODO: Write general description for this method
23
+ # @return [DateTime]
24
+ attr_accessor :completed_time
25
+
26
+ # TODO: Write general description for this method
27
+ # @return [String]
28
+ attr_accessor :conference_event_url
29
+
30
+ # TODO: Write general description for this method
31
+ # @return [ConferenceEventMethodEnum]
32
+ attr_accessor :conference_event_method
33
+
34
+ # TODO: Write general description for this method
35
+ # @return [String]
36
+ attr_accessor :tag
37
+
38
+ # TODO: Write general description for this method
39
+ # @return [List of ConferenceMemberDetail]
40
+ attr_accessor :active_members
41
+
42
+ # A mapping from model property names to API property names.
43
+ def self.names
44
+ @_hash = {} if @_hash.nil?
45
+ @_hash['id'] = 'id'
46
+ @_hash['name'] = 'name'
47
+ @_hash['created_time'] = 'createdTime'
48
+ @_hash['completed_time'] = 'completedTime'
49
+ @_hash['conference_event_url'] = 'conferenceEventUrl'
50
+ @_hash['conference_event_method'] = 'conferenceEventMethod'
51
+ @_hash['tag'] = 'tag'
52
+ @_hash['active_members'] = 'activeMembers'
53
+ @_hash
54
+ end
55
+
56
+ def initialize(id = nil,
57
+ name = nil,
58
+ created_time = nil,
59
+ completed_time = nil,
60
+ conference_event_url = nil,
61
+ conference_event_method = nil,
62
+ tag = nil,
63
+ active_members = nil)
64
+ @id = id
65
+ @name = name
66
+ @created_time = created_time
67
+ @completed_time = completed_time
68
+ @conference_event_url = conference_event_url
69
+ @conference_event_method = conference_event_method
70
+ @tag = tag
71
+ @active_members = active_members
72
+ end
73
+
74
+ # Creates an instance of the object from a hash.
75
+ def self.from_hash(hash)
76
+ return nil unless hash
77
+
78
+ # Extract variables from the hash.
79
+ id = hash['id']
80
+ name = hash['name']
81
+ created_time = APIHelper.rfc3339(hash['createdTime']) if
82
+ hash['createdTime']
83
+ completed_time = APIHelper.rfc3339(hash['completedTime']) if
84
+ hash['completedTime']
85
+ conference_event_url = hash['conferenceEventUrl']
86
+ conference_event_method = hash['conferenceEventMethod']
87
+ tag = hash['tag']
88
+ # Parameter is an array, so we need to iterate through it
89
+ active_members = nil
90
+ unless hash['activeMembers'].nil?
91
+ active_members = []
92
+ hash['activeMembers'].each do |structure|
93
+ active_members << (ConferenceMemberDetail.from_hash(structure) if structure)
94
+ end
95
+ end
96
+
97
+ # Create object from extracted values.
98
+ ConferenceDetail.new(id,
99
+ name,
100
+ created_time,
101
+ completed_time,
102
+ conference_event_url,
103
+ conference_event_method,
104
+ tag,
105
+ active_members)
106
+ end
107
+ end
108
+ 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
+ # ConferenceEventMethod.
8
+ class ConferenceEventMethodEnum
9
+ CONFERENCE_EVENT_METHOD_ENUM = [
10
+ # TODO: Write general description for GET
11
+ GET = 'GET'.freeze,
12
+
13
+ # TODO: Write general description for HEAD
14
+ HEAD = 'HEAD'.freeze,
15
+
16
+ # TODO: Write general description for POST
17
+ POST = 'POST'.freeze,
18
+
19
+ # TODO: Write general description for PUT
20
+ PUT = 'PUT'.freeze,
21
+
22
+ # TODO: Write general description for PATCH
23
+ PATCH = 'PATCH'.freeze,
24
+
25
+ # TODO: Write general description for DELETE
26
+ DELETE = 'DELETE'.freeze,
27
+
28
+ # TODO: Write general description for OPTIONS
29
+ OPTIONS = 'OPTIONS'.freeze,
30
+
31
+ # TODO: Write general description for TRACE
32
+ TRACE = 'TRACE'.freeze
33
+ ].freeze
34
+ end
35
+ end
@@ -0,0 +1,80 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # ConferenceMemberDetail Model.
8
+ class ConferenceMemberDetail < BaseModel
9
+ # TODO: Write general description for this method
10
+ # @return [String]
11
+ attr_accessor :call_id
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [String]
15
+ attr_accessor :conference_id
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [String]
19
+ attr_accessor :member_url
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [Boolean]
23
+ attr_accessor :mute
24
+
25
+ # TODO: Write general description for this method
26
+ # @return [Boolean]
27
+ attr_accessor :hold
28
+
29
+ # TODO: Write general description for this method
30
+ # @return [List of String]
31
+ attr_accessor :call_ids_to_coach
32
+
33
+ # A mapping from model property names to API property names.
34
+ def self.names
35
+ @_hash = {} if @_hash.nil?
36
+ @_hash['call_id'] = 'callId'
37
+ @_hash['conference_id'] = 'conferenceId'
38
+ @_hash['member_url'] = 'memberUrl'
39
+ @_hash['mute'] = 'mute'
40
+ @_hash['hold'] = 'hold'
41
+ @_hash['call_ids_to_coach'] = 'callIdsToCoach'
42
+ @_hash
43
+ end
44
+
45
+ def initialize(call_id = nil,
46
+ conference_id = nil,
47
+ member_url = nil,
48
+ mute = nil,
49
+ hold = nil,
50
+ call_ids_to_coach = nil)
51
+ @call_id = call_id
52
+ @conference_id = conference_id
53
+ @member_url = member_url
54
+ @mute = mute
55
+ @hold = hold
56
+ @call_ids_to_coach = call_ids_to_coach
57
+ end
58
+
59
+ # Creates an instance of the object from a hash.
60
+ def self.from_hash(hash)
61
+ return nil unless hash
62
+
63
+ # Extract variables from the hash.
64
+ call_id = hash['callId']
65
+ conference_id = hash['conferenceId']
66
+ member_url = hash['memberUrl']
67
+ mute = hash['mute']
68
+ hold = hash['hold']
69
+ call_ids_to_coach = hash['callIdsToCoach']
70
+
71
+ # Create object from extracted values.
72
+ ConferenceMemberDetail.new(call_id,
73
+ conference_id,
74
+ member_url,
75
+ mute,
76
+ hold,
77
+ call_ids_to_coach)
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,126 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ require 'date'
7
+ module Bandwidth
8
+ # ConferenceRecordingMetadataResponse Model.
9
+ class ConferenceRecordingMetadataResponse < BaseModel
10
+ # TODO: Write general description for this method
11
+ # @return [String]
12
+ attr_accessor :account_id
13
+
14
+ # TODO: Write general description for this method
15
+ # @return [String]
16
+ attr_accessor :conference_id
17
+
18
+ # TODO: Write general description for this method
19
+ # @return [String]
20
+ attr_accessor :name
21
+
22
+ # TODO: Write general description for this method
23
+ # @return [String]
24
+ attr_accessor :recording_id
25
+
26
+ # Format is ISO-8601
27
+ # @return [String]
28
+ attr_accessor :duration
29
+
30
+ # Format is ISO-8601
31
+ # @return [Integer]
32
+ attr_accessor :channels
33
+
34
+ # Format is ISO-8601
35
+ # @return [DateTime]
36
+ attr_accessor :start_time
37
+
38
+ # Format is ISO-8601
39
+ # @return [DateTime]
40
+ attr_accessor :end_time
41
+
42
+ # Format is ISO-8601
43
+ # @return [FileFormatEnum]
44
+ attr_accessor :file_format
45
+
46
+ # Format is ISO-8601
47
+ # @return [Status1Enum]
48
+ attr_accessor :status
49
+
50
+ # Format is ISO-8601
51
+ # @return [String]
52
+ attr_accessor :media_url
53
+
54
+ # A mapping from model property names to API property names.
55
+ def self.names
56
+ @_hash = {} if @_hash.nil?
57
+ @_hash['account_id'] = 'accountId'
58
+ @_hash['conference_id'] = 'conferenceId'
59
+ @_hash['name'] = 'name'
60
+ @_hash['recording_id'] = 'recordingId'
61
+ @_hash['duration'] = 'duration'
62
+ @_hash['channels'] = 'channels'
63
+ @_hash['start_time'] = 'startTime'
64
+ @_hash['end_time'] = 'endTime'
65
+ @_hash['file_format'] = 'fileFormat'
66
+ @_hash['status'] = 'status'
67
+ @_hash['media_url'] = 'mediaUrl'
68
+ @_hash
69
+ end
70
+
71
+ def initialize(account_id = nil,
72
+ conference_id = nil,
73
+ name = nil,
74
+ recording_id = nil,
75
+ duration = nil,
76
+ channels = nil,
77
+ start_time = nil,
78
+ end_time = nil,
79
+ file_format = nil,
80
+ status = nil,
81
+ media_url = nil)
82
+ @account_id = account_id
83
+ @conference_id = conference_id
84
+ @name = name
85
+ @recording_id = recording_id
86
+ @duration = duration
87
+ @channels = channels
88
+ @start_time = start_time
89
+ @end_time = end_time
90
+ @file_format = file_format
91
+ @status = status
92
+ @media_url = media_url
93
+ end
94
+
95
+ # Creates an instance of the object from a hash.
96
+ def self.from_hash(hash)
97
+ return nil unless hash
98
+
99
+ # Extract variables from the hash.
100
+ account_id = hash['accountId']
101
+ conference_id = hash['conferenceId']
102
+ name = hash['name']
103
+ recording_id = hash['recordingId']
104
+ duration = hash['duration']
105
+ channels = hash['channels']
106
+ start_time = APIHelper.rfc3339(hash['startTime']) if hash['startTime']
107
+ end_time = APIHelper.rfc3339(hash['endTime']) if hash['endTime']
108
+ file_format = hash['fileFormat']
109
+ status = hash['status']
110
+ media_url = hash['mediaUrl']
111
+
112
+ # Create object from extracted values.
113
+ ConferenceRecordingMetadataResponse.new(account_id,
114
+ conference_id,
115
+ name,
116
+ recording_id,
117
+ duration,
118
+ channels,
119
+ start_time,
120
+ end_time,
121
+ file_format,
122
+ status,
123
+ media_url)
124
+ end
125
+ end
126
+ end
@@ -3,6 +3,7 @@
3
3
  # This file was automatically generated by APIMATIC v2.0
4
4
  # ( https://apimatic.io ).
5
5
 
6
+ require 'date'
6
7
  module Bandwidth
7
8
  # RecordingMetadataResponse Model.
8
9
  class RecordingMetadataResponse < BaseModel
@@ -18,6 +19,10 @@ module Bandwidth
18
19
  # @return [String]
19
20
  attr_accessor :call_id
20
21
 
22
+ # TODO: Write general description for this method
23
+ # @return [String]
24
+ attr_accessor :parent_call_id
25
+
21
26
  # TODO: Write general description for this method
22
27
  # @return [String]
23
28
  attr_accessor :recording_id
@@ -30,6 +35,14 @@ module Bandwidth
30
35
  # @return [String]
31
36
  attr_accessor :from
32
37
 
38
+ # TODO: Write general description for this method
39
+ # @return [String]
40
+ attr_accessor :transfer_caller_id
41
+
42
+ # TODO: Write general description for this method
43
+ # @return [String]
44
+ attr_accessor :transfer_to
45
+
33
46
  # Format is ISO-8601
34
47
  # @return [String]
35
48
  attr_accessor :duration
@@ -43,11 +56,11 @@ module Bandwidth
43
56
  attr_accessor :channels
44
57
 
45
58
  # Format is ISO-8601
46
- # @return [Long]
59
+ # @return [DateTime]
47
60
  attr_accessor :start_time
48
61
 
49
62
  # Format is ISO-8601
50
- # @return [Long]
63
+ # @return [DateTime]
51
64
  attr_accessor :end_time
52
65
 
53
66
  # Format is ISO-8601
@@ -72,9 +85,12 @@ module Bandwidth
72
85
  @_hash['application_id'] = 'applicationId'
73
86
  @_hash['account_id'] = 'accountId'
74
87
  @_hash['call_id'] = 'callId'
88
+ @_hash['parent_call_id'] = 'parentCallId'
75
89
  @_hash['recording_id'] = 'recordingId'
76
90
  @_hash['to'] = 'to'
77
91
  @_hash['from'] = 'from'
92
+ @_hash['transfer_caller_id'] = 'transferCallerId'
93
+ @_hash['transfer_to'] = 'transferTo'
78
94
  @_hash['duration'] = 'duration'
79
95
  @_hash['direction'] = 'direction'
80
96
  @_hash['channels'] = 'channels'
@@ -90,9 +106,12 @@ module Bandwidth
90
106
  def initialize(application_id = nil,
91
107
  account_id = nil,
92
108
  call_id = nil,
109
+ parent_call_id = nil,
93
110
  recording_id = nil,
94
111
  to = nil,
95
112
  from = nil,
113
+ transfer_caller_id = nil,
114
+ transfer_to = nil,
96
115
  duration = nil,
97
116
  direction = nil,
98
117
  channels = nil,
@@ -105,9 +124,12 @@ module Bandwidth
105
124
  @application_id = application_id
106
125
  @account_id = account_id
107
126
  @call_id = call_id
127
+ @parent_call_id = parent_call_id
108
128
  @recording_id = recording_id
109
129
  @to = to
110
130
  @from = from
131
+ @transfer_caller_id = transfer_caller_id
132
+ @transfer_to = transfer_to
111
133
  @duration = duration
112
134
  @direction = direction
113
135
  @channels = channels
@@ -127,14 +149,17 @@ module Bandwidth
127
149
  application_id = hash['applicationId']
128
150
  account_id = hash['accountId']
129
151
  call_id = hash['callId']
152
+ parent_call_id = hash['parentCallId']
130
153
  recording_id = hash['recordingId']
131
154
  to = hash['to']
132
155
  from = hash['from']
156
+ transfer_caller_id = hash['transferCallerId']
157
+ transfer_to = hash['transferTo']
133
158
  duration = hash['duration']
134
159
  direction = hash['direction']
135
160
  channels = hash['channels']
136
- start_time = hash['startTime']
137
- end_time = hash['endTime']
161
+ start_time = APIHelper.rfc3339(hash['startTime']) if hash['startTime']
162
+ end_time = APIHelper.rfc3339(hash['endTime']) if hash['endTime']
138
163
  file_format = hash['fileFormat']
139
164
  status = hash['status']
140
165
  media_url = hash['mediaUrl']
@@ -145,9 +170,12 @@ module Bandwidth
145
170
  RecordingMetadataResponse.new(application_id,
146
171
  account_id,
147
172
  call_id,
173
+ parent_call_id,
148
174
  recording_id,
149
175
  to,
150
176
  from,
177
+ transfer_caller_id,
178
+ transfer_to,
151
179
  duration,
152
180
  direction,
153
181
  channels,