bandwidth-sdk 3.7.0 → 3.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e10eadbf6902f10e74e9e2574332439ce256b7b8a57d8c7e87f6a776857376c0
4
- data.tar.gz: 585279582d7e65c7a88dbb284d72a05f399be1a4c36dbc169fdeecd8a5317e61
3
+ metadata.gz: 22e17841f86e7515af23eb80a22bdbebf088530844046ffe0015a967ec095335
4
+ data.tar.gz: 76973db63618901c5675517b4a9ba7e5adef6f0579132d493d50ce43d6814516
5
5
  SHA512:
6
- metadata.gz: e2c78bbe4acf58b05f186547b72e39f10cd198e68fe22051ab268027177544e51111b95af0f3a44b9ec1d1e038ca8420ef2a871c537fbb17138e430fc8cab1d1
7
- data.tar.gz: ad3b16633b516c60e14c8a9469acb912f74bc36c5e737fa636d4f2c32808636e76e718a1e3bcd7f30e7dcf2d93b278e31fdd1a71c08e5fe1574d16a484a0d184
6
+ metadata.gz: e60dd4c3f1ea55f0f92cd25fc3d62d695d96c286c87b1b54d54eec5a965e5d8a73cf6e45bbcf6c6099d631a7062f3aab6906ec5425af2c4490910fd95bcc2fd0
7
+ data.tar.gz: 5d93c7a448c86a2028f807cfe7e6a025f706563965a523582600e474ca92abc84fbbdf86b897fa0f574ea2fbcb08551f9a036da82ee6ccd6c81afda9fe87aa5b
@@ -41,17 +41,22 @@ module Bandwidth
41
41
  # Return if there are no parameters to replace.
42
42
  return query_builder if parameters.nil?
43
43
 
44
- # Iterate and append parameters.
45
- parameters.each do |key, value|
46
- replace_value = ''
47
-
48
- if value.nil?
44
+ parameters.each do |key, val|
45
+ if val.nil?
49
46
  replace_value = ''
50
- elsif value.instance_of? Array
51
- value.map! { |element| CGI.escape(element.to_s) }
52
- replace_value = value.join('/')
47
+ elsif val['value'].instance_of? Array
48
+ if val['encode'] == true
49
+ val['value'].map! { |element| CGI.escape(element.to_s) }
50
+ else
51
+ val['value'].map!(&:to_s)
52
+ end
53
+ replace_value = val['value'].join('/')
53
54
  else
54
- replace_value = CGI.escape(value.to_s)
55
+ replace_value = if val['encode'] == true
56
+ CGI.escape(val['value'].to_s)
57
+ else
58
+ val['value'].to_s
59
+ end
55
60
  end
56
61
 
57
62
  # Find the template parameter and replace it with its value.
@@ -22,7 +22,7 @@ module Messaging
22
22
  _query_builder << '/users/{userId}/media'
23
23
  _query_builder = APIHelper.append_url_with_template_parameters(
24
24
  _query_builder,
25
- 'userId' => user_id
25
+ 'userId' => { 'value' => user_id, 'encode' => true }
26
26
  )
27
27
  _query_url = APIHelper.clean_url _query_builder
28
28
 
@@ -76,8 +76,10 @@ module Messaging
76
76
 
77
77
  # Return appropriate response type.
78
78
  decoded = APIHelper.json_deserialize(_response.raw_body)
79
- ApiResponse.new(_response,
80
- data: decoded.map { |element| Media.from_hash(element) })
79
+ ApiResponse.new(
80
+ _response,
81
+ data: decoded.map { |element| Media.from_hash(element) }
82
+ )
81
83
  end
82
84
 
83
85
  # getMedia
@@ -91,8 +93,8 @@ module Messaging
91
93
  _query_builder << '/users/{userId}/media/{mediaId}'
92
94
  _query_builder = APIHelper.append_url_with_template_parameters(
93
95
  _query_builder,
94
- 'userId' => user_id,
95
- 'mediaId' => media_id
96
+ 'userId' => { 'value' => user_id, 'encode' => true },
97
+ 'mediaId' => { 'value' => media_id, 'encode' => true }
96
98
  )
97
99
  _query_url = APIHelper.clean_url _query_builder
98
100
 
@@ -138,7 +140,9 @@ module Messaging
138
140
  validate_response(_response)
139
141
 
140
142
  # Return appropriate response type.
141
- ApiResponse.new(_response, data: _response.raw_body)
143
+ ApiResponse.new(
144
+ _response, data: _response.raw_body
145
+ )
142
146
  end
143
147
 
144
148
  # uploadMedia
@@ -161,8 +165,8 @@ module Messaging
161
165
  _query_builder << '/users/{userId}/media/{mediaId}'
162
166
  _query_builder = APIHelper.append_url_with_template_parameters(
163
167
  _query_builder,
164
- 'userId' => user_id,
165
- 'mediaId' => media_id
168
+ 'userId' => { 'value' => user_id, 'encode' => true },
169
+ 'mediaId' => { 'value' => media_id, 'encode' => true }
166
170
  )
167
171
  _query_url = APIHelper.clean_url _query_builder
168
172
 
@@ -240,8 +244,8 @@ module Messaging
240
244
  _query_builder << '/users/{userId}/media/{mediaId}'
241
245
  _query_builder = APIHelper.append_url_with_template_parameters(
242
246
  _query_builder,
243
- 'userId' => user_id,
244
- 'mediaId' => media_id
247
+ 'userId' => { 'value' => user_id, 'encode' => true },
248
+ 'mediaId' => { 'value' => media_id, 'encode' => true }
245
249
  )
246
250
  _query_url = APIHelper.clean_url _query_builder
247
251
 
@@ -301,7 +305,7 @@ module Messaging
301
305
  _query_builder << '/users/{userId}/messages'
302
306
  _query_builder = APIHelper.append_url_with_template_parameters(
303
307
  _query_builder,
304
- 'userId' => user_id
308
+ 'userId' => { 'value' => user_id, 'encode' => true }
305
309
  )
306
310
  _query_url = APIHelper.clean_url _query_builder
307
311
 
@@ -356,7 +360,9 @@ module Messaging
356
360
 
357
361
  # Return appropriate response type.
358
362
  decoded = APIHelper.json_deserialize(_response.raw_body)
359
- ApiResponse.new(_response, data: BandwidthMessage.from_hash(decoded))
363
+ ApiResponse.new(
364
+ _response, data: BandwidthMessage.from_hash(decoded)
365
+ )
360
366
  end
361
367
  end
362
368
  end
@@ -13,7 +13,7 @@ module Bandwidth
13
13
  @http_call_back = http_call_back
14
14
 
15
15
  @global_headers = {
16
- 'user-agent' => 'ruby-sdk-refs/tags/ruby3.7.0'
16
+ 'user-agent' => 'ruby-sdk-refs/tags/ruby3.8.0'
17
17
  }
18
18
  end
19
19
 
@@ -23,7 +23,7 @@ module TwoFactorAuth
23
23
  _query_builder << '/accounts/{accountId}/code/voice'
24
24
  _query_builder = APIHelper.append_url_with_template_parameters(
25
25
  _query_builder,
26
- 'accountId' => account_id
26
+ 'accountId' => { 'value' => account_id, 'encode' => true }
27
27
  )
28
28
  _query_url = APIHelper.clean_url _query_builder
29
29
 
@@ -53,8 +53,9 @@ module TwoFactorAuth
53
53
 
54
54
  # Return appropriate response type.
55
55
  decoded = APIHelper.json_deserialize(_response.raw_body)
56
- ApiResponse.new(_response,
57
- data: TwoFactorVoiceResponse.from_hash(decoded))
56
+ ApiResponse.new(
57
+ _response, data: TwoFactorVoiceResponse.from_hash(decoded)
58
+ )
58
59
  end
59
60
 
60
61
  # Two-Factor authentication with Bandwidth messaging services
@@ -69,7 +70,7 @@ module TwoFactorAuth
69
70
  _query_builder << '/accounts/{accountId}/code/messaging'
70
71
  _query_builder = APIHelper.append_url_with_template_parameters(
71
72
  _query_builder,
72
- 'accountId' => account_id
73
+ 'accountId' => { 'value' => account_id, 'encode' => true }
73
74
  )
74
75
  _query_url = APIHelper.clean_url _query_builder
75
76
 
@@ -99,8 +100,10 @@ module TwoFactorAuth
99
100
 
100
101
  # Return appropriate response type.
101
102
  decoded = APIHelper.json_deserialize(_response.raw_body)
102
- ApiResponse.new(_response,
103
- data: TwoFactorMessagingResponse.from_hash(decoded))
103
+ ApiResponse.new(
104
+ _response,
105
+ data: TwoFactorMessagingResponse.from_hash(decoded)
106
+ )
104
107
  end
105
108
 
106
109
  # Verify a previously sent two-factor authentication code
@@ -115,7 +118,7 @@ module TwoFactorAuth
115
118
  _query_builder << '/accounts/{accountId}/code/verify'
116
119
  _query_builder = APIHelper.append_url_with_template_parameters(
117
120
  _query_builder,
118
- 'accountId' => account_id
121
+ 'accountId' => { 'value' => account_id, 'encode' => true }
119
122
  )
120
123
  _query_url = APIHelper.clean_url _query_builder
121
124
 
@@ -145,8 +148,10 @@ module TwoFactorAuth
145
148
 
146
149
  # Return appropriate response type.
147
150
  decoded = APIHelper.json_deserialize(_response.raw_body)
148
- ApiResponse.new(_response,
149
- data: TwoFactorVerifyCodeResponse.from_hash(decoded))
151
+ ApiResponse.new(
152
+ _response,
153
+ data: TwoFactorVerifyCodeResponse.from_hash(decoded)
154
+ )
150
155
  end
151
156
  end
152
157
  end
@@ -13,7 +13,7 @@ module Bandwidth
13
13
  @http_call_back = http_call_back
14
14
 
15
15
  @global_headers = {
16
- 'user-agent' => 'ruby-sdk-refs/tags/ruby3.7.0'
16
+ 'user-agent' => 'ruby-sdk-refs/tags/ruby3.8.0'
17
17
  }
18
18
  end
19
19
 
@@ -13,6 +13,8 @@ require_relative 'voice/models/api_create_call_request.rb'
13
13
  require_relative 'voice/models/api_modify_call_request.rb'
14
14
  require_relative 'voice/models/api_transcribe_recording_request.rb'
15
15
  require_relative 'voice/models/call_engine_modify_conference_request.rb'
16
+ require_relative 'voice/models/conference_detail.rb'
17
+ require_relative 'voice/models/conference_member_detail.rb'
16
18
  require_relative 'voice/models/modify_call_recording_state.rb'
17
19
  require_relative 'voice/models/recording_metadata_response.rb'
18
20
  require_relative 'voice/models/transcript.rb'
@@ -20,6 +22,7 @@ require_relative 'voice/models/transcription.rb'
20
22
  require_relative 'voice/models/transcription_response.rb'
21
23
  require_relative 'voice/models/answer_method_enum.rb'
22
24
  require_relative 'voice/models/callback_method_enum.rb'
25
+ require_relative 'voice/models/conference_event_method_enum.rb'
23
26
  require_relative 'voice/models/direction_enum.rb'
24
27
  require_relative 'voice/models/disconnect_cause_enum.rb'
25
28
  require_relative 'voice/models/disconnect_method_enum.rb'
@@ -22,7 +22,7 @@ module Voice
22
22
  _query_builder << '/api/v2/accounts/{accountId}/calls'
23
23
  _query_builder = APIHelper.append_url_with_template_parameters(
24
24
  _query_builder,
25
- 'accountId' => account_id
25
+ 'accountId' => { 'value' => account_id, 'encode' => true }
26
26
  )
27
27
  _query_url = APIHelper.clean_url _query_builder
28
28
 
@@ -86,7 +86,9 @@ module Voice
86
86
 
87
87
  # Return appropriate response type.
88
88
  decoded = APIHelper.json_deserialize(_response.raw_body)
89
- ApiResponse.new(_response, data: ApiCallResponse.from_hash(decoded))
89
+ ApiResponse.new(
90
+ _response, data: ApiCallResponse.from_hash(decoded)
91
+ )
90
92
  end
91
93
 
92
94
  # Returns near-realtime metadata about the specified call
@@ -100,8 +102,8 @@ module Voice
100
102
  _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}'
101
103
  _query_builder = APIHelper.append_url_with_template_parameters(
102
104
  _query_builder,
103
- 'accountId' => account_id,
104
- 'callId' => call_id
105
+ 'accountId' => { 'value' => account_id, 'encode' => true },
106
+ 'callId' => { 'value' => call_id, 'encode' => true }
105
107
  )
106
108
  _query_url = APIHelper.clean_url _query_builder
107
109
 
@@ -163,7 +165,9 @@ module Voice
163
165
 
164
166
  # Return appropriate response type.
165
167
  decoded = APIHelper.json_deserialize(_response.raw_body)
166
- ApiResponse.new(_response, data: ApiCallStateResponse.from_hash(decoded))
168
+ ApiResponse.new(
169
+ _response, data: ApiCallStateResponse.from_hash(decoded)
170
+ )
167
171
  end
168
172
 
169
173
  # Interrupts and replaces an active call's BXML document
@@ -179,8 +183,8 @@ module Voice
179
183
  _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}'
180
184
  _query_builder = APIHelper.append_url_with_template_parameters(
181
185
  _query_builder,
182
- 'accountId' => account_id,
183
- 'callId' => call_id
186
+ 'accountId' => { 'value' => account_id, 'encode' => true },
187
+ 'callId' => { 'value' => call_id, 'encode' => true }
184
188
  )
185
189
  _query_url = APIHelper.clean_url _query_builder
186
190
 
@@ -258,8 +262,8 @@ module Voice
258
262
  _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recording'
259
263
  _query_builder = APIHelper.append_url_with_template_parameters(
260
264
  _query_builder,
261
- 'accountId' => account_id,
262
- 'callId' => call_id
265
+ 'accountId' => { 'value' => account_id, 'encode' => true },
266
+ 'callId' => { 'value' => call_id, 'encode' => true }
263
267
  )
264
268
  _query_url = APIHelper.clean_url _query_builder
265
269
 
@@ -344,8 +348,8 @@ module Voice
344
348
  _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings'
345
349
  _query_builder = APIHelper.append_url_with_template_parameters(
346
350
  _query_builder,
347
- 'accountId' => account_id,
348
- 'callId' => call_id
351
+ 'accountId' => { 'value' => account_id, 'encode' => true },
352
+ 'callId' => { 'value' => call_id, 'encode' => true }
349
353
  )
350
354
  _query_builder = APIHelper.append_url_with_query_parameters(
351
355
  _query_builder,
@@ -433,9 +437,9 @@ module Voice
433
437
  _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}'
434
438
  _query_builder = APIHelper.append_url_with_template_parameters(
435
439
  _query_builder,
436
- 'accountId' => account_id,
437
- 'callId' => call_id,
438
- 'recordingId' => recording_id
440
+ 'accountId' => { 'value' => account_id, 'encode' => true },
441
+ 'callId' => { 'value' => call_id, 'encode' => true },
442
+ 'recordingId' => { 'value' => recording_id, 'encode' => true }
439
443
  )
440
444
  _query_url = APIHelper.clean_url _query_builder
441
445
 
@@ -497,8 +501,9 @@ module Voice
497
501
 
498
502
  # Return appropriate response type.
499
503
  decoded = APIHelper.json_deserialize(_response.raw_body)
500
- ApiResponse.new(_response,
501
- data: RecordingMetadataResponse.from_hash(decoded))
504
+ ApiResponse.new(
505
+ _response, data: RecordingMetadataResponse.from_hash(decoded)
506
+ )
502
507
  end
503
508
 
504
509
  # Deletes the specified recording
@@ -514,9 +519,9 @@ module Voice
514
519
  _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}'
515
520
  _query_builder = APIHelper.append_url_with_template_parameters(
516
521
  _query_builder,
517
- 'accountId' => account_id,
518
- 'callId' => call_id,
519
- 'recordingId' => recording_id
522
+ 'accountId' => { 'value' => account_id, 'encode' => true },
523
+ 'callId' => { 'value' => call_id, 'encode' => true },
524
+ 'recordingId' => { 'value' => recording_id, 'encode' => true }
520
525
  )
521
526
  _query_url = APIHelper.clean_url _query_builder
522
527
 
@@ -587,9 +592,9 @@ module Voice
587
592
  _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media'
588
593
  _query_builder = APIHelper.append_url_with_template_parameters(
589
594
  _query_builder,
590
- 'accountId' => account_id,
591
- 'callId' => call_id,
592
- 'recordingId' => recording_id
595
+ 'accountId' => { 'value' => account_id, 'encode' => true },
596
+ 'callId' => { 'value' => call_id, 'encode' => true },
597
+ 'recordingId' => { 'value' => recording_id, 'encode' => true }
593
598
  )
594
599
  _query_url = APIHelper.clean_url _query_builder
595
600
 
@@ -644,7 +649,9 @@ module Voice
644
649
  validate_response(_response)
645
650
 
646
651
  # Return appropriate response type.
647
- ApiResponse.new(_response, data: _response.raw_body)
652
+ ApiResponse.new(
653
+ _response, data: _response.raw_body
654
+ )
648
655
  end
649
656
 
650
657
  # Deletes the specified recording's media
@@ -660,9 +667,9 @@ module Voice
660
667
  _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media'
661
668
  _query_builder = APIHelper.append_url_with_template_parameters(
662
669
  _query_builder,
663
- 'accountId' => account_id,
664
- 'callId' => call_id,
665
- 'recordingId' => recording_id
670
+ 'accountId' => { 'value' => account_id, 'encode' => true },
671
+ 'callId' => { 'value' => call_id, 'encode' => true },
672
+ 'recordingId' => { 'value' => recording_id, 'encode' => true }
666
673
  )
667
674
  _query_url = APIHelper.clean_url _query_builder
668
675
 
@@ -733,9 +740,9 @@ module Voice
733
740
  _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription'
734
741
  _query_builder = APIHelper.append_url_with_template_parameters(
735
742
  _query_builder,
736
- 'accountId' => account_id,
737
- 'callId' => call_id,
738
- 'recordingId' => recording_id
743
+ 'accountId' => { 'value' => account_id, 'encode' => true },
744
+ 'callId' => { 'value' => call_id, 'encode' => true },
745
+ 'recordingId' => { 'value' => recording_id, 'encode' => true }
739
746
  )
740
747
  _query_url = APIHelper.clean_url _query_builder
741
748
 
@@ -797,7 +804,9 @@ module Voice
797
804
 
798
805
  # Return appropriate response type.
799
806
  decoded = APIHelper.json_deserialize(_response.raw_body)
800
- ApiResponse.new(_response, data: TranscriptionResponse.from_hash(decoded))
807
+ ApiResponse.new(
808
+ _response, data: TranscriptionResponse.from_hash(decoded)
809
+ )
801
810
  end
802
811
 
803
812
  # Requests that the specified recording be transcribed
@@ -815,9 +824,9 @@ module Voice
815
824
  _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription'
816
825
  _query_builder = APIHelper.append_url_with_template_parameters(
817
826
  _query_builder,
818
- 'accountId' => account_id,
819
- 'callId' => call_id,
820
- 'recordingId' => recording_id
827
+ 'accountId' => { 'value' => account_id, 'encode' => true },
828
+ 'callId' => { 'value' => call_id, 'encode' => true },
829
+ 'recordingId' => { 'value' => recording_id, 'encode' => true }
821
830
  )
822
831
  _query_url = APIHelper.clean_url _query_builder
823
832
 
@@ -901,9 +910,9 @@ module Voice
901
910
  _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription'
902
911
  _query_builder = APIHelper.append_url_with_template_parameters(
903
912
  _query_builder,
904
- 'accountId' => account_id,
905
- 'callId' => call_id,
906
- 'recordingId' => recording_id
913
+ 'accountId' => { 'value' => account_id, 'encode' => true },
914
+ 'callId' => { 'value' => call_id, 'encode' => true },
915
+ 'recordingId' => { 'value' => recording_id, 'encode' => true }
907
916
  )
908
917
  _query_url = APIHelper.clean_url _query_builder
909
918
 
@@ -961,6 +970,85 @@ module Voice
961
970
  ApiResponse.new(_response)
962
971
  end
963
972
 
973
+ # Returns information about the specified conference
974
+ # @param [String] account_id Required parameter: Example:
975
+ # @param [String] conference_id Required parameter: Example:
976
+ # @return [ConferenceDetail] response from the API call
977
+ def get_conference_by_id(account_id,
978
+ conference_id)
979
+ # Prepare query url.
980
+ _query_builder = config.get_base_uri(Server::VOICEDEFAULT)
981
+ _query_builder << '/api/v2/accounts/{accountId}/conferences/{conferenceId}'
982
+ _query_builder = APIHelper.append_url_with_template_parameters(
983
+ _query_builder,
984
+ 'accountId' => { 'value' => account_id, 'encode' => true },
985
+ 'conferenceId' => { 'value' => conference_id, 'encode' => true }
986
+ )
987
+ _query_url = APIHelper.clean_url _query_builder
988
+
989
+ # Prepare headers.
990
+ _headers = {
991
+ 'accept' => 'application/json'
992
+ }
993
+
994
+ # Prepare and execute HttpRequest.
995
+ _request = config.http_client.get(
996
+ _query_url,
997
+ headers: _headers
998
+ )
999
+ VoiceBasicAuth.apply(config, _request)
1000
+ _response = execute_request(_request)
1001
+
1002
+ # Validate response against endpoint and global error codes.
1003
+ if _response.status_code == 400
1004
+ raise ApiErrorResponseException.new(
1005
+ 'Something\'s not quite right... Your request is invalid. Please' \
1006
+ ' fix it before trying again.',
1007
+ _response
1008
+ )
1009
+ elsif _response.status_code == 401
1010
+ raise APIException.new(
1011
+ 'Your credentials are invalid. Please use your Bandwidth dashboard' \
1012
+ ' credentials to authenticate to the API.',
1013
+ _response
1014
+ )
1015
+ elsif _response.status_code == 403
1016
+ raise ApiErrorResponseException.new(
1017
+ 'User unauthorized to perform this action.',
1018
+ _response
1019
+ )
1020
+ elsif _response.status_code == 404
1021
+ raise ApiErrorResponseException.new(
1022
+ 'The resource specified cannot be found or does not belong to you.',
1023
+ _response
1024
+ )
1025
+ elsif _response.status_code == 415
1026
+ raise ApiErrorResponseException.new(
1027
+ 'We don\'t support that media type. If a request body is required,' \
1028
+ ' please send it to us as `application/json`.',
1029
+ _response
1030
+ )
1031
+ elsif _response.status_code == 429
1032
+ raise ApiErrorResponseException.new(
1033
+ 'You\'re sending requests to this endpoint too frequently. Please' \
1034
+ ' slow your request rate down and try again.',
1035
+ _response
1036
+ )
1037
+ elsif _response.status_code == 500
1038
+ raise ApiErrorResponseException.new(
1039
+ 'Something unexpected happened. Please try again.',
1040
+ _response
1041
+ )
1042
+ end
1043
+ validate_response(_response)
1044
+
1045
+ # Return appropriate response type.
1046
+ decoded = APIHelper.json_deserialize(_response.raw_body)
1047
+ ApiResponse.new(
1048
+ _response, data: ConferenceDetail.from_hash(decoded)
1049
+ )
1050
+ end
1051
+
964
1052
  # Modify the conference state
965
1053
  # @param [String] account_id Required parameter: Example:
966
1054
  # @param [String] conference_id Required parameter: Example:
@@ -975,8 +1063,8 @@ module Voice
975
1063
  _query_builder << '/api/v2/accounts/{accountId}/conferences/{conferenceId}'
976
1064
  _query_builder = APIHelper.append_url_with_template_parameters(
977
1065
  _query_builder,
978
- 'accountId' => account_id,
979
- 'conferenceId' => conference_id
1066
+ 'accountId' => { 'value' => account_id, 'encode' => true },
1067
+ 'conferenceId' => { 'value' => conference_id, 'encode' => true }
980
1068
  )
981
1069
  _query_url = APIHelper.clean_url _query_builder
982
1070
 
@@ -1041,6 +1129,88 @@ module Voice
1041
1129
  ApiResponse.new(_response)
1042
1130
  end
1043
1131
 
1132
+ # Returns information about the specified conference member
1133
+ # @param [String] account_id Required parameter: Example:
1134
+ # @param [String] conference_id Required parameter: Example:
1135
+ # @param [String] member_id Required parameter: Example:
1136
+ # @return [ConferenceMemberDetail] response from the API call
1137
+ def get_conference_member(account_id,
1138
+ conference_id,
1139
+ member_id)
1140
+ # Prepare query url.
1141
+ _query_builder = config.get_base_uri(Server::VOICEDEFAULT)
1142
+ _query_builder << '/api/v2/accounts/{accountId}/conferences/{conferenceId}/members/{memberId}'
1143
+ _query_builder = APIHelper.append_url_with_template_parameters(
1144
+ _query_builder,
1145
+ 'accountId' => { 'value' => account_id, 'encode' => true },
1146
+ 'conferenceId' => { 'value' => conference_id, 'encode' => true },
1147
+ 'memberId' => { 'value' => member_id, 'encode' => true }
1148
+ )
1149
+ _query_url = APIHelper.clean_url _query_builder
1150
+
1151
+ # Prepare headers.
1152
+ _headers = {
1153
+ 'accept' => 'application/json'
1154
+ }
1155
+
1156
+ # Prepare and execute HttpRequest.
1157
+ _request = config.http_client.get(
1158
+ _query_url,
1159
+ headers: _headers
1160
+ )
1161
+ VoiceBasicAuth.apply(config, _request)
1162
+ _response = execute_request(_request)
1163
+
1164
+ # Validate response against endpoint and global error codes.
1165
+ if _response.status_code == 400
1166
+ raise ApiErrorResponseException.new(
1167
+ 'Something\'s not quite right... Your request is invalid. Please' \
1168
+ ' fix it before trying again.',
1169
+ _response
1170
+ )
1171
+ elsif _response.status_code == 401
1172
+ raise APIException.new(
1173
+ 'Your credentials are invalid. Please use your Bandwidth dashboard' \
1174
+ ' credentials to authenticate to the API.',
1175
+ _response
1176
+ )
1177
+ elsif _response.status_code == 403
1178
+ raise ApiErrorResponseException.new(
1179
+ 'User unauthorized to perform this action.',
1180
+ _response
1181
+ )
1182
+ elsif _response.status_code == 404
1183
+ raise ApiErrorResponseException.new(
1184
+ 'The resource specified cannot be found or does not belong to you.',
1185
+ _response
1186
+ )
1187
+ elsif _response.status_code == 415
1188
+ raise ApiErrorResponseException.new(
1189
+ 'We don\'t support that media type. If a request body is required,' \
1190
+ ' please send it to us as `application/json`.',
1191
+ _response
1192
+ )
1193
+ elsif _response.status_code == 429
1194
+ raise ApiErrorResponseException.new(
1195
+ 'You\'re sending requests to this endpoint too frequently. Please' \
1196
+ ' slow your request rate down and try again.',
1197
+ _response
1198
+ )
1199
+ elsif _response.status_code == 500
1200
+ raise ApiErrorResponseException.new(
1201
+ 'Something unexpected happened. Please try again.',
1202
+ _response
1203
+ )
1204
+ end
1205
+ validate_response(_response)
1206
+
1207
+ # Return appropriate response type.
1208
+ decoded = APIHelper.json_deserialize(_response.raw_body)
1209
+ ApiResponse.new(
1210
+ _response, data: ConferenceMemberDetail.from_hash(decoded)
1211
+ )
1212
+ end
1213
+
1044
1214
  # Returns a list of metadata for the recordings associated with the
1045
1215
  # specified account. The list can be filtered by the optional from, to,
1046
1216
  # minStartTime, and maxStartTime arguments. The list is capped at 1000
@@ -1061,7 +1231,7 @@ module Voice
1061
1231
  _query_builder << '/api/v2/accounts/{accountId}/recordings'
1062
1232
  _query_builder = APIHelper.append_url_with_template_parameters(
1063
1233
  _query_builder,
1064
- 'accountId' => account_id
1234
+ 'accountId' => { 'value' => account_id, 'encode' => true }
1065
1235
  )
1066
1236
  _query_builder = APIHelper.append_url_with_query_parameters(
1067
1237
  _query_builder,
@@ -13,7 +13,7 @@ module Bandwidth
13
13
  @http_call_back = http_call_back
14
14
 
15
15
  @global_headers = {
16
- 'user-agent' => 'ruby-sdk-refs/tags/ruby3.7.0'
16
+ 'user-agent' => 'ruby-sdk-refs/tags/ruby3.8.0'
17
17
  }
18
18
  end
19
19
 
@@ -0,0 +1,105 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # ConferenceDetail Model.
8
+ class ConferenceDetail < BaseModel
9
+ # TODO: Write general description for this method
10
+ # @return [String]
11
+ attr_accessor :id
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [String]
15
+ attr_accessor :name
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [Long]
19
+ attr_accessor :created_time
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [Long]
23
+ attr_accessor :completed_time
24
+
25
+ # TODO: Write general description for this method
26
+ # @return [String]
27
+ attr_accessor :conference_event_url
28
+
29
+ # TODO: Write general description for this method
30
+ # @return [ConferenceEventMethodEnum]
31
+ attr_accessor :conference_event_method
32
+
33
+ # TODO: Write general description for this method
34
+ # @return [String]
35
+ attr_accessor :tag
36
+
37
+ # TODO: Write general description for this method
38
+ # @return [List of ConferenceMemberDetail]
39
+ attr_accessor :active_members
40
+
41
+ # A mapping from model property names to API property names.
42
+ def self.names
43
+ @_hash = {} if @_hash.nil?
44
+ @_hash['id'] = 'id'
45
+ @_hash['name'] = 'name'
46
+ @_hash['created_time'] = 'createdTime'
47
+ @_hash['completed_time'] = 'completedTime'
48
+ @_hash['conference_event_url'] = 'conferenceEventUrl'
49
+ @_hash['conference_event_method'] = 'conferenceEventMethod'
50
+ @_hash['tag'] = 'tag'
51
+ @_hash['active_members'] = 'activeMembers'
52
+ @_hash
53
+ end
54
+
55
+ def initialize(id = nil,
56
+ name = nil,
57
+ created_time = nil,
58
+ completed_time = nil,
59
+ conference_event_url = nil,
60
+ conference_event_method = nil,
61
+ tag = nil,
62
+ active_members = nil)
63
+ @id = id
64
+ @name = name
65
+ @created_time = created_time
66
+ @completed_time = completed_time
67
+ @conference_event_url = conference_event_url
68
+ @conference_event_method = conference_event_method
69
+ @tag = tag
70
+ @active_members = active_members
71
+ end
72
+
73
+ # Creates an instance of the object from a hash.
74
+ def self.from_hash(hash)
75
+ return nil unless hash
76
+
77
+ # Extract variables from the hash.
78
+ id = hash['id']
79
+ name = hash['name']
80
+ created_time = hash['createdTime']
81
+ completed_time = hash['completedTime']
82
+ conference_event_url = hash['conferenceEventUrl']
83
+ conference_event_method = hash['conferenceEventMethod']
84
+ tag = hash['tag']
85
+ # Parameter is an array, so we need to iterate through it
86
+ active_members = nil
87
+ unless hash['activeMembers'].nil?
88
+ active_members = []
89
+ hash['activeMembers'].each do |structure|
90
+ active_members << (ConferenceMemberDetail.from_hash(structure) if structure)
91
+ end
92
+ end
93
+
94
+ # Create object from extracted values.
95
+ ConferenceDetail.new(id,
96
+ name,
97
+ created_time,
98
+ completed_time,
99
+ conference_event_url,
100
+ conference_event_method,
101
+ tag,
102
+ active_members)
103
+ end
104
+ end
105
+ 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
@@ -24,7 +24,7 @@ module WebRtc
24
24
  _query_builder << '/accounts/{accountId}/participants'
25
25
  _query_builder = APIHelper.append_url_with_template_parameters(
26
26
  _query_builder,
27
- 'accountId' => account_id
27
+ 'accountId' => { 'value' => account_id, 'encode' => true }
28
28
  )
29
29
  _query_url = APIHelper.clean_url _query_builder
30
30
 
@@ -70,8 +70,10 @@ module WebRtc
70
70
 
71
71
  # Return appropriate response type.
72
72
  decoded = APIHelper.json_deserialize(_response.raw_body)
73
- ApiResponse.new(_response,
74
- data: AccountsParticipantsResponse.from_hash(decoded))
73
+ ApiResponse.new(
74
+ _response,
75
+ data: AccountsParticipantsResponse.from_hash(decoded)
76
+ )
75
77
  end
76
78
 
77
79
  # Get participant by ID
@@ -85,8 +87,8 @@ module WebRtc
85
87
  _query_builder << '/accounts/{accountId}/participants/{participantId}'
86
88
  _query_builder = APIHelper.append_url_with_template_parameters(
87
89
  _query_builder,
88
- 'accountId' => account_id,
89
- 'participantId' => participant_id
90
+ 'accountId' => { 'value' => account_id, 'encode' => true },
91
+ 'participantId' => { 'value' => participant_id, 'encode' => true }
90
92
  )
91
93
  _query_url = APIHelper.clean_url _query_builder
92
94
 
@@ -130,7 +132,9 @@ module WebRtc
130
132
 
131
133
  # Return appropriate response type.
132
134
  decoded = APIHelper.json_deserialize(_response.raw_body)
133
- ApiResponse.new(_response, data: Participant.from_hash(decoded))
135
+ ApiResponse.new(
136
+ _response, data: Participant.from_hash(decoded)
137
+ )
134
138
  end
135
139
 
136
140
  # Delete participant by ID
@@ -144,8 +148,8 @@ module WebRtc
144
148
  _query_builder << '/accounts/{accountId}/participants/{participantId}'
145
149
  _query_builder = APIHelper.append_url_with_template_parameters(
146
150
  _query_builder,
147
- 'accountId' => account_id,
148
- 'participantId' => participant_id
151
+ 'accountId' => { 'value' => account_id, 'encode' => true },
152
+ 'participantId' => { 'value' => participant_id, 'encode' => true }
149
153
  )
150
154
  _query_url = APIHelper.clean_url _query_builder
151
155
 
@@ -198,7 +202,7 @@ module WebRtc
198
202
  _query_builder << '/accounts/{accountId}/sessions'
199
203
  _query_builder = APIHelper.append_url_with_template_parameters(
200
204
  _query_builder,
201
- 'accountId' => account_id
205
+ 'accountId' => { 'value' => account_id, 'encode' => true }
202
206
  )
203
207
  _query_url = APIHelper.clean_url _query_builder
204
208
 
@@ -244,7 +248,9 @@ module WebRtc
244
248
 
245
249
  # Return appropriate response type.
246
250
  decoded = APIHelper.json_deserialize(_response.raw_body)
247
- ApiResponse.new(_response, data: Session.from_hash(decoded))
251
+ ApiResponse.new(
252
+ _response, data: Session.from_hash(decoded)
253
+ )
248
254
  end
249
255
 
250
256
  # Get session by ID
@@ -258,8 +264,8 @@ module WebRtc
258
264
  _query_builder << '/accounts/{accountId}/sessions/{sessionId}'
259
265
  _query_builder = APIHelper.append_url_with_template_parameters(
260
266
  _query_builder,
261
- 'accountId' => account_id,
262
- 'sessionId' => session_id
267
+ 'accountId' => { 'value' => account_id, 'encode' => true },
268
+ 'sessionId' => { 'value' => session_id, 'encode' => true }
263
269
  )
264
270
  _query_url = APIHelper.clean_url _query_builder
265
271
 
@@ -303,7 +309,9 @@ module WebRtc
303
309
 
304
310
  # Return appropriate response type.
305
311
  decoded = APIHelper.json_deserialize(_response.raw_body)
306
- ApiResponse.new(_response, data: Session.from_hash(decoded))
312
+ ApiResponse.new(
313
+ _response, data: Session.from_hash(decoded)
314
+ )
307
315
  end
308
316
 
309
317
  # Delete session by ID
@@ -317,8 +325,8 @@ module WebRtc
317
325
  _query_builder << '/accounts/{accountId}/sessions/{sessionId}'
318
326
  _query_builder = APIHelper.append_url_with_template_parameters(
319
327
  _query_builder,
320
- 'accountId' => account_id,
321
- 'sessionId' => session_id
328
+ 'accountId' => { 'value' => account_id, 'encode' => true },
329
+ 'sessionId' => { 'value' => session_id, 'encode' => true }
322
330
  )
323
331
  _query_url = APIHelper.clean_url _query_builder
324
332
 
@@ -369,8 +377,8 @@ module WebRtc
369
377
  _query_builder << '/accounts/{accountId}/sessions/{sessionId}/participants'
370
378
  _query_builder = APIHelper.append_url_with_template_parameters(
371
379
  _query_builder,
372
- 'accountId' => account_id,
373
- 'sessionId' => session_id
380
+ 'accountId' => { 'value' => account_id, 'encode' => true },
381
+ 'sessionId' => { 'value' => session_id, 'encode' => true }
374
382
  )
375
383
  _query_url = APIHelper.clean_url _query_builder
376
384
 
@@ -437,9 +445,9 @@ module WebRtc
437
445
  _query_builder << '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}'
438
446
  _query_builder = APIHelper.append_url_with_template_parameters(
439
447
  _query_builder,
440
- 'accountId' => account_id,
441
- 'sessionId' => session_id,
442
- 'participantId' => participant_id
448
+ 'accountId' => { 'value' => account_id, 'encode' => true },
449
+ 'sessionId' => { 'value' => session_id, 'encode' => true },
450
+ 'participantId' => { 'value' => participant_id, 'encode' => true }
443
451
  )
444
452
  _query_url = APIHelper.clean_url _query_builder
445
453
 
@@ -501,9 +509,9 @@ module WebRtc
501
509
  _query_builder << '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}'
502
510
  _query_builder = APIHelper.append_url_with_template_parameters(
503
511
  _query_builder,
504
- 'accountId' => account_id,
505
- 'participantId' => participant_id,
506
- 'sessionId' => session_id
512
+ 'accountId' => { 'value' => account_id, 'encode' => true },
513
+ 'participantId' => { 'value' => participant_id, 'encode' => true },
514
+ 'sessionId' => { 'value' => session_id, 'encode' => true }
507
515
  )
508
516
  _query_url = APIHelper.clean_url _query_builder
509
517
 
@@ -556,9 +564,9 @@ module WebRtc
556
564
  _query_builder << '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions'
557
565
  _query_builder = APIHelper.append_url_with_template_parameters(
558
566
  _query_builder,
559
- 'accountId' => account_id,
560
- 'participantId' => participant_id,
561
- 'sessionId' => session_id
567
+ 'accountId' => { 'value' => account_id, 'encode' => true },
568
+ 'participantId' => { 'value' => participant_id, 'encode' => true },
569
+ 'sessionId' => { 'value' => session_id, 'encode' => true }
562
570
  )
563
571
  _query_url = APIHelper.clean_url _query_builder
564
572
 
@@ -602,7 +610,9 @@ module WebRtc
602
610
 
603
611
  # Return appropriate response type.
604
612
  decoded = APIHelper.json_deserialize(_response.raw_body)
605
- ApiResponse.new(_response, data: Subscriptions.from_hash(decoded))
613
+ ApiResponse.new(
614
+ _response, data: Subscriptions.from_hash(decoded)
615
+ )
606
616
  end
607
617
 
608
618
  # Update a participant's subscriptions
@@ -624,9 +634,9 @@ module WebRtc
624
634
  _query_builder << '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions'
625
635
  _query_builder = APIHelper.append_url_with_template_parameters(
626
636
  _query_builder,
627
- 'accountId' => account_id,
628
- 'participantId' => participant_id,
629
- 'sessionId' => session_id
637
+ 'accountId' => { 'value' => account_id, 'encode' => true },
638
+ 'participantId' => { 'value' => participant_id, 'encode' => true },
639
+ 'sessionId' => { 'value' => session_id, 'encode' => true }
630
640
  )
631
641
  _query_url = APIHelper.clean_url _query_builder
632
642
 
@@ -13,7 +13,7 @@ module Bandwidth
13
13
  @http_call_back = http_call_back
14
14
 
15
15
  @global_headers = {
16
- 'user-agent' => 'ruby-sdk-refs/tags/ruby3.7.0'
16
+ 'user-agent' => 'ruby-sdk-refs/tags/ruby3.8.0'
17
17
  }
18
18
  end
19
19
 
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.7.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-29 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
@@ -173,6 +173,9 @@ files:
173
173
  - lib/bandwidth/voice_lib/voice/models/api_transcribe_recording_request.rb
174
174
  - lib/bandwidth/voice_lib/voice/models/call_engine_modify_conference_request.rb
175
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
176
179
  - lib/bandwidth/voice_lib/voice/models/direction_enum.rb
177
180
  - lib/bandwidth/voice_lib/voice/models/disconnect_cause_enum.rb
178
181
  - lib/bandwidth/voice_lib/voice/models/disconnect_method_enum.rb