bandwidth-sdk 1.0.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18591a5d5044520f1468b2739bf7f7d3f2e55c90256808ee87c88035b2547955
4
- data.tar.gz: 94718076a51266243ac4da676d6719ae4c3c8143f1ee41a2d4f74845160f5a7c
3
+ metadata.gz: a27ed8cd085180211649d0a0afbd5d4a99208c821496f31ce9a6f934817dacbd
4
+ data.tar.gz: 85f03331af6709b83dafeac29ca8becb265bb9343f2110a8c81b5f45420af8f5
5
5
  SHA512:
6
- metadata.gz: f4a3945a2bdc1dc56df26eaf365a6be187c25949accedcc1b711079273e42b29fcbffcb1a336a0a92f2e563638a01bfdfc0d6c2c2314fa7bb5be11b42f8c4cbe
7
- data.tar.gz: 79820119110f3e897e7da7115a957db73ebaa3ad27255c96de2ab7d740415bd85e221aafc72561fdff7ad9666fe845755dd436d8aac071eb9b975ab80b61f566
6
+ metadata.gz: 98e8f113a996e58efbd061cd30dbc77f325762b78dd0913c1f69bb15578792aa21e07e0cb8f95e15f6e6c908e7522adc164eb185b069b4b689400047a7206949
7
+ data.tar.gz: a6834d60817a9189e1b7731fff4e4022a7bbc842de1a0302718d168fa512b8c42fe12be64a90345a7388e6bb8d554a8c85a0c139f8f65ee7faf391fd0e38e389
data/README.md CHANGED
@@ -7,19 +7,16 @@ Bandwidth's set of APIs
7
7
  Install the gem from the command line:
8
8
 
9
9
  ```ruby
10
- gem install bandwidth-sdk -v 1.0.2
10
+ gem install bandwidth-sdk -v 2.0.0
11
11
  ```
12
12
 
13
13
  Or add the gem to your Gemfile and run `bundle`:
14
14
 
15
15
  ```ruby
16
- gem 'bandwidth-sdk', '1.0.2'
16
+ gem 'bandwidth-sdk', '2.0.0'
17
17
  ```
18
18
 
19
- For additional gem details, see the [RubyGems page for the bandwidth-sdk gem](https://rubygems.org/gems/bandwidth-sdk/versions/1.0.2).
20
-
21
-
22
-
19
+ For additional gem details, see the [RubyGems page for the bandwidth-sdk gem](https://rubygems.org/gems/bandwidth-sdk/versions/2.0.0).
23
20
 
24
21
  ## Initialize the API Client
25
22
 
@@ -65,10 +62,9 @@ API calls return an `ApiResponse` object that includes the following fields:
65
62
 
66
63
  This API does not require authentication.
67
64
 
68
-
69
-
70
65
  ## API Reference
71
66
 
72
67
  ### List of APIs
73
68
 
74
- *
69
+ *
70
+
@@ -9,19 +9,22 @@ require_relative 'voice/client.rb'
9
9
  # Models
10
10
  require_relative 'voice/models/api_call_response.rb'
11
11
  require_relative 'voice/models/api_create_call_request.rb'
12
+ require_relative 'voice/models/api_get_account_recordings_metadata_request.rb'
12
13
  require_relative 'voice/models/api_modify_call_request.rb'
13
- require_relative 'voice/models/duration.rb'
14
+ require_relative 'voice/models/modify_call_recording_state.rb'
14
15
  require_relative 'voice/models/recording_metadata_response.rb'
15
- require_relative 'voice/models/temporal_unit.rb'
16
16
  require_relative 'voice/models/answer_method_enum.rb'
17
17
  require_relative 'voice/models/direction_enum.rb'
18
18
  require_relative 'voice/models/disconnect_method_enum.rb'
19
19
  require_relative 'voice/models/file_format_enum.rb'
20
20
  require_relative 'voice/models/redirect_method_enum.rb'
21
21
  require_relative 'voice/models/state_enum.rb'
22
+ require_relative 'voice/models/state1_enum.rb'
22
23
  require_relative 'voice/models/transcription_status_enum.rb'
24
+ require_relative 'voice/models/type_enum.rb'
23
25
 
24
26
  # Exceptions
27
+ require_relative 'voice/exceptions/error_response_exception.rb'
25
28
  # Controllers
26
29
  require_relative 'voice/controllers/base_controller.rb'
27
30
  require_relative 'voice/controllers/api_controller.rb'
@@ -40,6 +40,43 @@ module Voice
40
40
  )
41
41
  VoiceBasicAuth.apply(config, _request)
42
42
  _response = execute_request(_request)
43
+
44
+ # Validate response against endpoint and global error codes.
45
+ if _response.status_code == 400
46
+ raise ErrorResponseException.new(
47
+ 'Something didn\'t look right about that request. Please fix it' \
48
+ ' before trying again.',
49
+ _response
50
+ )
51
+ elsif _response.status_code == 401
52
+ raise APIException.new(
53
+ 'Please authenticate yourself',
54
+ _response
55
+ )
56
+ elsif _response.status_code == 403
57
+ raise ErrorResponseException.new(
58
+ 'Your credentials are invalid. Please use your API credentials for' \
59
+ ' the Bandwidth Dashboard.',
60
+ _response
61
+ )
62
+ elsif _response.status_code == 415
63
+ raise ErrorResponseException.new(
64
+ 'We don\'t support that media type. Please send us' \
65
+ ' `application/json`.',
66
+ _response
67
+ )
68
+ elsif _response.status_code == 429
69
+ raise ErrorResponseException.new(
70
+ 'You\'re sending requests to this endpoint too frequently. Please' \
71
+ ' slow your request rate down and try again.',
72
+ _response
73
+ )
74
+ elsif _response.status_code == 500
75
+ raise ErrorResponseException.new(
76
+ 'Something unexpected happened. Please try again.',
77
+ _response
78
+ )
79
+ end
43
80
  validate_response(_response)
44
81
 
45
82
  # Return appropriate response type.
@@ -78,6 +115,125 @@ module Voice
78
115
  )
79
116
  VoiceBasicAuth.apply(config, _request)
80
117
  _response = execute_request(_request)
118
+
119
+ # Validate response against endpoint and global error codes.
120
+ if _response.status_code == 400
121
+ raise APIException.new(
122
+ 'The call can\'t be modified in its current state',
123
+ _response
124
+ )
125
+ elsif _response.status_code == 401
126
+ raise APIException.new(
127
+ 'Please authenticate yourself',
128
+ _response
129
+ )
130
+ elsif _response.status_code == 403
131
+ raise ErrorResponseException.new(
132
+ 'Your credentials are invalid. Please use your API credentials for' \
133
+ ' the Bandwidth Dashboard.',
134
+ _response
135
+ )
136
+ elsif _response.status_code == 404
137
+ raise APIException.new(
138
+ 'The call never existed, no longer exists, or is inaccessible to you',
139
+ _response
140
+ )
141
+ elsif _response.status_code == 415
142
+ raise ErrorResponseException.new(
143
+ 'We don\'t support that media type. Please send us' \
144
+ ' `application/json`.',
145
+ _response
146
+ )
147
+ elsif _response.status_code == 429
148
+ raise ErrorResponseException.new(
149
+ 'You\'re sending requests to this endpoint too frequently. Please' \
150
+ ' slow your request rate down and try again.',
151
+ _response
152
+ )
153
+ elsif _response.status_code == 500
154
+ raise ErrorResponseException.new(
155
+ 'Something unexpected happened. Please try again.',
156
+ _response
157
+ )
158
+ end
159
+ validate_response(_response)
160
+
161
+ # Return appropriate response type.
162
+ ApiResponse.new(_response)
163
+ end
164
+
165
+ # Pauses or resumes a recording
166
+ # @param [String] account_id Required parameter: Example:
167
+ # @param [String] call_id Required parameter: Example:
168
+ # @param [ModifyCallRecordingState] body Optional parameter: Example:
169
+ # @return [void] response from the API call
170
+ def modify_call_recording_state(account_id,
171
+ call_id,
172
+ body: nil)
173
+ # Prepare query url.
174
+ _query_builder = config.get_base_uri(Server::VOICEDEFAULT)
175
+ _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recording'
176
+ _query_builder = APIHelper.append_url_with_template_parameters(
177
+ _query_builder,
178
+ 'accountId' => account_id,
179
+ 'callId' => call_id
180
+ )
181
+ _query_url = APIHelper.clean_url _query_builder
182
+
183
+ # Prepare headers.
184
+ _headers = {
185
+ 'content-type' => 'application/json; charset=utf-8'
186
+ }
187
+
188
+ # Prepare and execute HttpRequest.
189
+ _request = config.http_client.put(
190
+ _query_url,
191
+ headers: _headers,
192
+ parameters: body.to_json
193
+ )
194
+ VoiceBasicAuth.apply(config, _request)
195
+ _response = execute_request(_request)
196
+
197
+ # Validate response against endpoint and global error codes.
198
+ if _response.status_code == 400
199
+ raise APIException.new(
200
+ 'The call can\'t be modified in its current state',
201
+ _response
202
+ )
203
+ elsif _response.status_code == 401
204
+ raise APIException.new(
205
+ 'Please authenticate yourself',
206
+ _response
207
+ )
208
+ elsif _response.status_code == 403
209
+ raise ErrorResponseException.new(
210
+ 'Your credentials are invalid. Please use your API credentials for' \
211
+ ' the Bandwidth Dashboard.',
212
+ _response
213
+ )
214
+ elsif _response.status_code == 404
215
+ raise APIException.new(
216
+ 'The call never existed, no longer exists, or is inaccessible to you',
217
+ _response
218
+ )
219
+ elsif _response.status_code == 415
220
+ raise ErrorResponseException.new(
221
+ 'We don\'t support that media type. Please send us' \
222
+ ' `application/json`.',
223
+ _response
224
+ )
225
+ elsif _response.status_code == 429
226
+ raise ErrorResponseException.new(
227
+ 'You\'re sending requests to this endpoint too frequently. Please' \
228
+ ' slow your request rate down and try again.',
229
+ _response
230
+ )
231
+ elsif _response.status_code == 500
232
+ raise ErrorResponseException.new(
233
+ 'Something unexpected happened. Please try again.',
234
+ _response
235
+ )
236
+ end
81
237
  validate_response(_response)
82
238
 
83
239
  # Return appropriate response type.
@@ -113,6 +269,43 @@ module Voice
113
269
  )
114
270
  VoiceBasicAuth.apply(config, _request)
115
271
  _response = execute_request(_request)
272
+
273
+ # Validate response against endpoint and global error codes.
274
+ if _response.status_code == 400
275
+ raise ErrorResponseException.new(
276
+ 'Something didn\'t look right about that request. Please fix it' \
277
+ ' before trying again.',
278
+ _response
279
+ )
280
+ elsif _response.status_code == 401
281
+ raise APIException.new(
282
+ 'Please authenticate yourself',
283
+ _response
284
+ )
285
+ elsif _response.status_code == 403
286
+ raise ErrorResponseException.new(
287
+ 'Your credentials are invalid. Please use your API credentials for' \
288
+ ' the Bandwidth Dashboard.',
289
+ _response
290
+ )
291
+ elsif _response.status_code == 415
292
+ raise ErrorResponseException.new(
293
+ 'We don\'t support that media type. Please send us' \
294
+ ' `application/json`.',
295
+ _response
296
+ )
297
+ elsif _response.status_code == 429
298
+ raise ErrorResponseException.new(
299
+ 'You\'re sending requests to this endpoint too frequently. Please' \
300
+ ' slow your request rate down and try again.',
301
+ _response
302
+ )
303
+ elsif _response.status_code == 500
304
+ raise ErrorResponseException.new(
305
+ 'Something unexpected happened. Please try again.',
306
+ _response
307
+ )
308
+ end
116
309
  validate_response(_response)
117
310
 
118
311
  # Return appropriate response type.
@@ -124,21 +317,21 @@ module Voice
124
317
  end
125
318
 
126
319
  # Returns metadata for the specified recording
127
- # @param [String] recording_id Required parameter: Example:
128
320
  # @param [String] account_id Required parameter: Example:
129
321
  # @param [String] call_id Required parameter: Example:
322
+ # @param [String] recording_id Required parameter: Example:
130
323
  # @return [RecordingMetadataResponse] response from the API call
131
- def get_metadata_for_recording(recording_id,
132
- account_id,
133
- call_id)
324
+ def get_metadata_for_recording(account_id,
325
+ call_id,
326
+ recording_id)
134
327
  # Prepare query url.
135
328
  _query_builder = config.get_base_uri(Server::VOICEDEFAULT)
136
329
  _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}'
137
330
  _query_builder = APIHelper.append_url_with_template_parameters(
138
331
  _query_builder,
139
- 'recordingId' => recording_id,
140
332
  'accountId' => account_id,
141
- 'callId' => call_id
333
+ 'callId' => call_id,
334
+ 'recordingId' => recording_id
142
335
  )
143
336
  _query_url = APIHelper.clean_url _query_builder
144
337
 
@@ -154,6 +347,49 @@ module Voice
154
347
  )
155
348
  VoiceBasicAuth.apply(config, _request)
156
349
  _response = execute_request(_request)
350
+
351
+ # Validate response against endpoint and global error codes.
352
+ if _response.status_code == 400
353
+ raise ErrorResponseException.new(
354
+ 'Something didn\'t look right about that request. Please fix it' \
355
+ ' before trying again.',
356
+ _response
357
+ )
358
+ elsif _response.status_code == 401
359
+ raise APIException.new(
360
+ 'Please authenticate yourself',
361
+ _response
362
+ )
363
+ elsif _response.status_code == 403
364
+ raise ErrorResponseException.new(
365
+ 'Your credentials are invalid. Please use your API credentials for' \
366
+ ' the Bandwidth Dashboard.',
367
+ _response
368
+ )
369
+ elsif _response.status_code == 404
370
+ raise APIException.new(
371
+ 'The recording never existed, no longer exists, or is inaccessible' \
372
+ ' to you',
373
+ _response
374
+ )
375
+ elsif _response.status_code == 415
376
+ raise ErrorResponseException.new(
377
+ 'We don\'t support that media type. Please send us' \
378
+ ' `application/json`.',
379
+ _response
380
+ )
381
+ elsif _response.status_code == 429
382
+ raise ErrorResponseException.new(
383
+ 'You\'re sending requests to this endpoint too frequently. Please' \
384
+ ' slow your request rate down and try again.',
385
+ _response
386
+ )
387
+ elsif _response.status_code == 500
388
+ raise ErrorResponseException.new(
389
+ 'Something unexpected happened. Please try again.',
390
+ _response
391
+ )
392
+ end
157
393
  validate_response(_response)
158
394
 
159
395
  # Return appropriate response type.
@@ -163,21 +399,21 @@ module Voice
163
399
  end
164
400
 
165
401
  # Deletes the specified recording
166
- # @param [String] recording_id Required parameter: Example:
167
402
  # @param [String] account_id Required parameter: Example:
168
403
  # @param [String] call_id Required parameter: Example:
404
+ # @param [String] recording_id Required parameter: Example:
169
405
  # @return [void] response from the API call
170
- def delete_recording(recording_id,
171
- account_id,
172
- call_id)
406
+ def delete_recording(account_id,
407
+ call_id,
408
+ recording_id)
173
409
  # Prepare query url.
174
410
  _query_builder = config.get_base_uri(Server::VOICEDEFAULT)
175
411
  _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}'
176
412
  _query_builder = APIHelper.append_url_with_template_parameters(
177
413
  _query_builder,
178
- 'recordingId' => recording_id,
179
414
  'accountId' => account_id,
180
- 'callId' => call_id
415
+ 'callId' => call_id,
416
+ 'recordingId' => recording_id
181
417
  )
182
418
  _query_url = APIHelper.clean_url _query_builder
183
419
 
@@ -187,6 +423,49 @@ module Voice
187
423
  )
188
424
  VoiceBasicAuth.apply(config, _request)
189
425
  _response = execute_request(_request)
426
+
427
+ # Validate response against endpoint and global error codes.
428
+ if _response.status_code == 400
429
+ raise ErrorResponseException.new(
430
+ 'Something didn\'t look right about that request. Please fix it' \
431
+ ' before trying again.',
432
+ _response
433
+ )
434
+ elsif _response.status_code == 401
435
+ raise APIException.new(
436
+ 'Please authenticate yourself',
437
+ _response
438
+ )
439
+ elsif _response.status_code == 403
440
+ raise ErrorResponseException.new(
441
+ 'Your credentials are invalid. Please use your API credentials for' \
442
+ ' the Bandwidth Dashboard.',
443
+ _response
444
+ )
445
+ elsif _response.status_code == 404
446
+ raise APIException.new(
447
+ 'The recording never existed, no longer exists, or is inaccessible' \
448
+ ' to you',
449
+ _response
450
+ )
451
+ elsif _response.status_code == 415
452
+ raise ErrorResponseException.new(
453
+ 'We don\'t support that media type. Please send us' \
454
+ ' `application/json`.',
455
+ _response
456
+ )
457
+ elsif _response.status_code == 429
458
+ raise ErrorResponseException.new(
459
+ 'You\'re sending requests to this endpoint too frequently. Please' \
460
+ ' slow your request rate down and try again.',
461
+ _response
462
+ )
463
+ elsif _response.status_code == 500
464
+ raise ErrorResponseException.new(
465
+ 'Something unexpected happened. Please try again.',
466
+ _response
467
+ )
468
+ end
190
469
  validate_response(_response)
191
470
 
192
471
  # Return appropriate response type.
@@ -197,7 +476,7 @@ module Voice
197
476
  # @param [String] account_id Required parameter: Example:
198
477
  # @param [String] call_id Required parameter: Example:
199
478
  # @param [String] recording_id Required parameter: Example:
200
- # @return [String] response from the API call
479
+ # @return [Binary] response from the API call
201
480
  def get_stream_recording_media(account_id,
202
481
  call_id,
203
482
  recording_id)
@@ -217,7 +496,50 @@ module Voice
217
496
  _query_url
218
497
  )
219
498
  VoiceBasicAuth.apply(config, _request)
220
- _response = execute_request(_request)
499
+ _response = execute_request(_request, binary: true)
500
+
501
+ # Validate response against endpoint and global error codes.
502
+ if _response.status_code == 400
503
+ raise ErrorResponseException.new(
504
+ 'Something didn\'t look right about that request. Please fix it' \
505
+ ' before trying again.',
506
+ _response
507
+ )
508
+ elsif _response.status_code == 401
509
+ raise APIException.new(
510
+ 'Please authenticate yourself',
511
+ _response
512
+ )
513
+ elsif _response.status_code == 403
514
+ raise ErrorResponseException.new(
515
+ 'Your credentials are invalid. Please use your API credentials for' \
516
+ ' the Bandwidth Dashboard.',
517
+ _response
518
+ )
519
+ elsif _response.status_code == 404
520
+ raise APIException.new(
521
+ 'The recording never existed, no longer exists, or is inaccessible' \
522
+ ' to you',
523
+ _response
524
+ )
525
+ elsif _response.status_code == 415
526
+ raise ErrorResponseException.new(
527
+ 'We don\'t support that media type. Please send us' \
528
+ ' `application/json`.',
529
+ _response
530
+ )
531
+ elsif _response.status_code == 429
532
+ raise ErrorResponseException.new(
533
+ 'You\'re sending requests to this endpoint too frequently. Please' \
534
+ ' slow your request rate down and try again.',
535
+ _response
536
+ )
537
+ elsif _response.status_code == 500
538
+ raise ErrorResponseException.new(
539
+ 'Something unexpected happened. Please try again.',
540
+ _response
541
+ )
542
+ end
221
543
  validate_response(_response)
222
544
 
223
545
  # Return appropriate response type.
@@ -250,6 +572,43 @@ module Voice
250
572
  )
251
573
  VoiceBasicAuth.apply(config, _request)
252
574
  _response = execute_request(_request)
575
+
576
+ # Validate response against endpoint and global error codes.
577
+ if _response.status_code == 400
578
+ raise ErrorResponseException.new(
579
+ 'Something didn\'t look right about that request. Please fix it' \
580
+ ' before trying again.',
581
+ _response
582
+ )
583
+ elsif _response.status_code == 401
584
+ raise APIException.new(
585
+ 'Please authenticate yourself',
586
+ _response
587
+ )
588
+ elsif _response.status_code == 403
589
+ raise ErrorResponseException.new(
590
+ 'Your credentials are invalid. Please use your API credentials for' \
591
+ ' the Bandwidth Dashboard.',
592
+ _response
593
+ )
594
+ elsif _response.status_code == 415
595
+ raise ErrorResponseException.new(
596
+ 'We don\'t support that media type. Please send us' \
597
+ ' `application/json`.',
598
+ _response
599
+ )
600
+ elsif _response.status_code == 429
601
+ raise ErrorResponseException.new(
602
+ 'You\'re sending requests to this endpoint too frequently. Please' \
603
+ ' slow your request rate down and try again.',
604
+ _response
605
+ )
606
+ elsif _response.status_code == 500
607
+ raise ErrorResponseException.new(
608
+ 'Something unexpected happened. Please try again.',
609
+ _response
610
+ )
611
+ end
253
612
  validate_response(_response)
254
613
 
255
614
  # Return appropriate response type.
@@ -0,0 +1,39 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # ErrorResponse class.
8
+ class ErrorResponseException < APIException
9
+ # TODO: Write general description for this method
10
+ # @return [TypeEnum]
11
+ attr_accessor :type
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [String]
15
+ attr_accessor :description
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [String]
19
+ attr_accessor :id
20
+
21
+ # The constructor.
22
+ # @param [String] The reason for raising an exception.
23
+ # @param [HttpResponse] The HttpReponse of the API call.
24
+ def initialize(reason, response)
25
+ super(reason, response)
26
+ hash = APIHelper.json_deserialize(@response.raw_body)
27
+ unbox(hash)
28
+ end
29
+
30
+ # Populates this object by extracting properties from a hash.
31
+ # @param [Hash] The deserialized response sent by the server in the
32
+ # response body.
33
+ def unbox(hash)
34
+ @type = hash['type']
35
+ @description = hash['description']
36
+ @id = hash['id']
37
+ end
38
+ end
39
+ end
@@ -7,29 +7,11 @@ module Bandwidth
7
7
  # AnswerMethod.
8
8
  class AnswerMethodEnum
9
9
  ANSWER_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
10
  # TODO: Write general description for POST
17
11
  POST = 'POST'.freeze,
18
12
 
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
13
+ # TODO: Write general description for GET
14
+ GET = 'GET'.freeze
33
15
  ].freeze
34
16
  end
35
17
  end
@@ -3,16 +3,17 @@
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
  # ApiCallResponse Model.
8
9
  class ApiCallResponse < BaseModel
9
10
  # TODO: Write general description for this method
10
11
  # @return [String]
11
- attr_accessor :username
12
+ attr_accessor :call_id
12
13
 
13
14
  # TODO: Write general description for this method
14
15
  # @return [String]
15
- attr_accessor :password
16
+ attr_accessor :application_id
16
17
 
17
18
  # TODO: Write general description for this method
18
19
  # @return [String]
@@ -23,12 +24,8 @@ module Bandwidth
23
24
  attr_accessor :from
24
25
 
25
26
  # TODO: Write general description for this method
26
- # @return [String]
27
- attr_accessor :application_id
28
-
29
- # TODO: Write general description for this method
30
- # @return [String]
31
- attr_accessor :call_id
27
+ # @return [DateTime]
28
+ attr_accessor :start_time
32
29
 
33
30
  # TODO: Write general description for this method
34
31
  # @return [String]
@@ -54,6 +51,14 @@ module Bandwidth
54
51
  # @return [DisconnectMethodEnum]
55
52
  attr_accessor :disconnect_method
56
53
 
54
+ # TODO: Write general description for this method
55
+ # @return [String]
56
+ attr_accessor :username
57
+
58
+ # TODO: Write general description for this method
59
+ # @return [String]
60
+ attr_accessor :password
61
+
57
62
  # TODO: Write general description for this method
58
63
  # @return [String]
59
64
  attr_accessor :tag
@@ -61,47 +66,50 @@ module Bandwidth
61
66
  # A mapping from model property names to API property names.
62
67
  def self.names
63
68
  @_hash = {} if @_hash.nil?
64
- @_hash['username'] = 'username'
65
- @_hash['password'] = 'password'
69
+ @_hash['call_id'] = 'callId'
70
+ @_hash['application_id'] = 'applicationId'
66
71
  @_hash['to'] = 'to'
67
72
  @_hash['from'] = 'from'
68
- @_hash['application_id'] = 'applicationId'
69
- @_hash['call_id'] = 'callId'
73
+ @_hash['start_time'] = 'startTime'
70
74
  @_hash['call_url'] = 'callUrl'
71
75
  @_hash['call_timeout'] = 'callTimeout'
72
76
  @_hash['answer_url'] = 'answerUrl'
73
77
  @_hash['answer_method'] = 'answerMethod'
74
78
  @_hash['disconnect_url'] = 'disconnectUrl'
75
79
  @_hash['disconnect_method'] = 'disconnectMethod'
80
+ @_hash['username'] = 'username'
81
+ @_hash['password'] = 'password'
76
82
  @_hash['tag'] = 'tag'
77
83
  @_hash
78
84
  end
79
85
 
80
- def initialize(to = nil,
81
- from = nil,
86
+ def initialize(call_id = nil,
82
87
  application_id = nil,
83
- call_id = nil,
88
+ to = nil,
89
+ from = nil,
84
90
  call_url = nil,
85
91
  answer_url = nil,
86
92
  answer_method = nil,
87
93
  disconnect_method = nil,
88
- username = nil,
89
- password = nil,
94
+ start_time = nil,
90
95
  call_timeout = nil,
91
96
  disconnect_url = nil,
97
+ username = nil,
98
+ password = nil,
92
99
  tag = nil)
93
- @username = username
94
- @password = password
100
+ @call_id = call_id
101
+ @application_id = application_id
95
102
  @to = to
96
103
  @from = from
97
- @application_id = application_id
98
- @call_id = call_id
104
+ @start_time = start_time
99
105
  @call_url = call_url
100
106
  @call_timeout = call_timeout
101
107
  @answer_url = answer_url
102
108
  @answer_method = answer_method
103
109
  @disconnect_url = disconnect_url
104
110
  @disconnect_method = disconnect_method
111
+ @username = username
112
+ @password = password
105
113
  @tag = tag
106
114
  end
107
115
 
@@ -110,33 +118,35 @@ module Bandwidth
110
118
  return nil unless hash
111
119
 
112
120
  # Extract variables from the hash.
121
+ call_id = hash['callId']
122
+ application_id = hash['applicationId']
113
123
  to = hash['to']
114
124
  from = hash['from']
115
- application_id = hash['applicationId']
116
- call_id = hash['callId']
117
125
  call_url = hash['callUrl']
118
126
  answer_url = hash['answerUrl']
119
127
  answer_method = hash['answerMethod']
120
128
  disconnect_method = hash['disconnectMethod']
121
- username = hash['username']
122
- password = hash['password']
129
+ start_time = APIHelper.rfc3339(hash['startTime']) if hash['startTime']
123
130
  call_timeout = hash['callTimeout']
124
131
  disconnect_url = hash['disconnectUrl']
132
+ username = hash['username']
133
+ password = hash['password']
125
134
  tag = hash['tag']
126
135
 
127
136
  # Create object from extracted values.
128
- ApiCallResponse.new(to,
129
- from,
137
+ ApiCallResponse.new(call_id,
130
138
  application_id,
131
- call_id,
139
+ to,
140
+ from,
132
141
  call_url,
133
142
  answer_url,
134
143
  answer_method,
135
144
  disconnect_method,
136
- username,
137
- password,
145
+ start_time,
138
146
  call_timeout,
139
147
  disconnect_url,
148
+ username,
149
+ password,
140
150
  tag)
141
151
  end
142
152
  end
@@ -0,0 +1,65 @@
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
+ # ApiGetAccountRecordingsMetadataRequest Model.
9
+ class ApiGetAccountRecordingsMetadataRequest < BaseModel
10
+ # Format is E164
11
+ # @return [String]
12
+ attr_accessor :from
13
+
14
+ # Format is E164
15
+ # @return [String]
16
+ attr_accessor :to
17
+
18
+ # ISO8601 format
19
+ # @return [DateTime]
20
+ attr_accessor :min_start_time
21
+
22
+ # ISO8601 format
23
+ # @return [DateTime]
24
+ attr_accessor :max_start_time
25
+
26
+ # A mapping from model property names to API property names.
27
+ def self.names
28
+ @_hash = {} if @_hash.nil?
29
+ @_hash['from'] = 'from'
30
+ @_hash['to'] = 'to'
31
+ @_hash['min_start_time'] = 'minStartTime'
32
+ @_hash['max_start_time'] = 'maxStartTime'
33
+ @_hash
34
+ end
35
+
36
+ def initialize(from = nil,
37
+ to = nil,
38
+ min_start_time = nil,
39
+ max_start_time = nil)
40
+ @from = from
41
+ @to = to
42
+ @min_start_time = min_start_time
43
+ @max_start_time = max_start_time
44
+ end
45
+
46
+ # Creates an instance of the object from a hash.
47
+ def self.from_hash(hash)
48
+ return nil unless hash
49
+
50
+ # Extract variables from the hash.
51
+ from = hash['from']
52
+ to = hash['to']
53
+ min_start_time = APIHelper.rfc3339(hash['minStartTime']) if
54
+ hash['minStartTime']
55
+ max_start_time = APIHelper.rfc3339(hash['maxStartTime']) if
56
+ hash['maxStartTime']
57
+
58
+ # Create object from extracted values.
59
+ ApiGetAccountRecordingsMetadataRequest.new(from,
60
+ to,
61
+ min_start_time,
62
+ max_start_time)
63
+ end
64
+ end
65
+ end
@@ -7,29 +7,11 @@ module Bandwidth
7
7
  # DisconnectMethod.
8
8
  class DisconnectMethodEnum
9
9
  DISCONNECT_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
10
  # TODO: Write general description for POST
17
11
  POST = 'POST'.freeze,
18
12
 
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
13
+ # TODO: Write general description for GET
14
+ GET = 'GET'.freeze
33
15
  ].freeze
34
16
  end
35
17
  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
+ # ModifyCallRecordingState Model.
8
+ class ModifyCallRecordingState < BaseModel
9
+ # TODO: Write general description for this method
10
+ # @return [State1Enum]
11
+ attr_accessor :state
12
+
13
+ # A mapping from model property names to API property names.
14
+ def self.names
15
+ @_hash = {} if @_hash.nil?
16
+ @_hash['state'] = 'state'
17
+ @_hash
18
+ end
19
+
20
+ def initialize(state = nil)
21
+ @state = state
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
+ state = hash['state']
30
+
31
+ # Create object from extracted values.
32
+ ModifyCallRecordingState.new(state)
33
+ end
34
+ end
35
+ end
@@ -27,7 +27,7 @@ module Bandwidth
27
27
  attr_accessor :from
28
28
 
29
29
  # TODO: Write general description for this method
30
- # @return [Duration]
30
+ # @return [String]
31
31
  attr_accessor :duration
32
32
 
33
33
  # TODO: Write general description for this method
@@ -122,7 +122,7 @@ module Bandwidth
122
122
  recording_id = hash['recordingId']
123
123
  to = hash['to']
124
124
  from = hash['from']
125
- duration = Duration.from_hash(hash['duration']) if hash['duration']
125
+ duration = hash['duration']
126
126
  direction = hash['direction']
127
127
  channels = hash['channels']
128
128
  start_time = hash['startTime']
@@ -7,29 +7,11 @@ module Bandwidth
7
7
  # RedirectMethod.
8
8
  class RedirectMethodEnum
9
9
  REDIRECT_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
10
  # TODO: Write general description for POST
17
11
  POST = 'POST'.freeze,
18
12
 
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
13
+ # TODO: Write general description for GET
14
+ GET = 'GET'.freeze
33
15
  ].freeze
34
16
  end
35
17
  end
@@ -0,0 +1,20 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # State1.
8
+ class State1Enum
9
+ STATE1_ENUM = [
10
+ # TODO: Write general description for NOT_RECORDING
11
+ NOT_RECORDING = 'NOT_RECORDING'.freeze,
12
+
13
+ # TODO: Write general description for PAUSED
14
+ PAUSED = 'PAUSED'.freeze,
15
+
16
+ # TODO: Write general description for RECORDING
17
+ RECORDING = 'RECORDING'.freeze
18
+ ].freeze
19
+ end
20
+ end
@@ -0,0 +1,32 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # Type.
8
+ class TypeEnum
9
+ TYPE_ENUM = [
10
+ # TODO: Write general description for VALIDATION
11
+ VALIDATION = 'validation'.freeze,
12
+
13
+ # TODO: Write general description for AUTHENTICATIONERROR
14
+ AUTHENTICATIONERROR = 'authentication-error'.freeze,
15
+
16
+ # TODO: Write general description for AUTHORIZATIONERROR
17
+ AUTHORIZATIONERROR = 'authorization-error'.freeze,
18
+
19
+ # TODO: Write general description for INTERNALERROR
20
+ INTERNALERROR = 'internal-error'.freeze,
21
+
22
+ # TODO: Write general description for ERROR
23
+ ERROR = 'error'.freeze,
24
+
25
+ # TODO: Write general description for RATELIMITEXCEEDED
26
+ RATELIMITEXCEEDED = 'rate-limit-exceeded'.freeze,
27
+
28
+ # TODO: Write general description for SYSTEMOVERLOADED
29
+ SYSTEMOVERLOADED = 'system-overloaded'.freeze
30
+ ].freeze
31
+ end
32
+ 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: 1.0.2
4
+ version: 2.0.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: 2019-11-15 00:00:00.000000000 Z
11
+ date: 2019-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging
@@ -133,19 +133,22 @@ files:
133
133
  - lib/bandwidth/voice_lib/voice/client.rb
134
134
  - lib/bandwidth/voice_lib/voice/controllers/api_controller.rb
135
135
  - lib/bandwidth/voice_lib/voice/controllers/base_controller.rb
136
+ - lib/bandwidth/voice_lib/voice/exceptions/error_response_exception.rb
136
137
  - lib/bandwidth/voice_lib/voice/models/answer_method_enum.rb
137
138
  - lib/bandwidth/voice_lib/voice/models/api_call_response.rb
138
139
  - lib/bandwidth/voice_lib/voice/models/api_create_call_request.rb
140
+ - lib/bandwidth/voice_lib/voice/models/api_get_account_recordings_metadata_request.rb
139
141
  - lib/bandwidth/voice_lib/voice/models/api_modify_call_request.rb
140
142
  - lib/bandwidth/voice_lib/voice/models/direction_enum.rb
141
143
  - lib/bandwidth/voice_lib/voice/models/disconnect_method_enum.rb
142
- - lib/bandwidth/voice_lib/voice/models/duration.rb
143
144
  - lib/bandwidth/voice_lib/voice/models/file_format_enum.rb
145
+ - lib/bandwidth/voice_lib/voice/models/modify_call_recording_state.rb
144
146
  - lib/bandwidth/voice_lib/voice/models/recording_metadata_response.rb
145
147
  - lib/bandwidth/voice_lib/voice/models/redirect_method_enum.rb
148
+ - lib/bandwidth/voice_lib/voice/models/state1_enum.rb
146
149
  - lib/bandwidth/voice_lib/voice/models/state_enum.rb
147
- - lib/bandwidth/voice_lib/voice/models/temporal_unit.rb
148
150
  - lib/bandwidth/voice_lib/voice/models/transcription_status_enum.rb
151
+ - lib/bandwidth/voice_lib/voice/models/type_enum.rb
149
152
  homepage: https://apimatic.io
150
153
  licenses:
151
154
  - MIT
@@ -1,78 +0,0 @@
1
- # bandwidth
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module Bandwidth
7
- # Duration Model.
8
- class Duration < BaseModel
9
- # TODO: Write general description for this method
10
- # @return [Long]
11
- attr_accessor :seconds
12
-
13
- # TODO: Write general description for this method
14
- # @return [Integer]
15
- attr_accessor :nano
16
-
17
- # TODO: Write general description for this method
18
- # @return [Boolean]
19
- attr_accessor :negative
20
-
21
- # TODO: Write general description for this method
22
- # @return [Boolean]
23
- attr_accessor :zero
24
-
25
- # TODO: Write general description for this method
26
- # @return [List of TemporalUnit]
27
- attr_accessor :units
28
-
29
- # A mapping from model property names to API property names.
30
- def self.names
31
- @_hash = {} if @_hash.nil?
32
- @_hash['seconds'] = 'seconds'
33
- @_hash['nano'] = 'nano'
34
- @_hash['negative'] = 'negative'
35
- @_hash['zero'] = 'zero'
36
- @_hash['units'] = 'units'
37
- @_hash
38
- end
39
-
40
- def initialize(seconds = nil,
41
- nano = nil,
42
- negative = nil,
43
- zero = nil,
44
- units = nil)
45
- @seconds = seconds
46
- @nano = nano
47
- @negative = negative
48
- @zero = zero
49
- @units = units
50
- end
51
-
52
- # Creates an instance of the object from a hash.
53
- def self.from_hash(hash)
54
- return nil unless hash
55
-
56
- # Extract variables from the hash.
57
- seconds = hash['seconds']
58
- nano = hash['nano']
59
- negative = hash['negative']
60
- zero = hash['zero']
61
- # Parameter is an array, so we need to iterate through it
62
- units = nil
63
- unless hash['units'].nil?
64
- units = []
65
- hash['units'].each do |structure|
66
- units << (TemporalUnit.from_hash(structure) if structure)
67
- end
68
- end
69
-
70
- # Create object from extracted values.
71
- Duration.new(seconds,
72
- nano,
73
- negative,
74
- zero,
75
- units)
76
- end
77
- end
78
- end
@@ -1,62 +0,0 @@
1
- # bandwidth
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module Bandwidth
7
- # TemporalUnit Model.
8
- class TemporalUnit < BaseModel
9
- # TODO: Write general description for this method
10
- # @return [Duration]
11
- attr_accessor :duration
12
-
13
- # TODO: Write general description for this method
14
- # @return [Boolean]
15
- attr_accessor :duration_estimated
16
-
17
- # TODO: Write general description for this method
18
- # @return [Boolean]
19
- attr_accessor :date_based
20
-
21
- # TODO: Write general description for this method
22
- # @return [Boolean]
23
- attr_accessor :time_based
24
-
25
- # A mapping from model property names to API property names.
26
- def self.names
27
- @_hash = {} if @_hash.nil?
28
- @_hash['duration'] = 'duration'
29
- @_hash['duration_estimated'] = 'durationEstimated'
30
- @_hash['date_based'] = 'dateBased'
31
- @_hash['time_based'] = 'timeBased'
32
- @_hash
33
- end
34
-
35
- def initialize(duration = nil,
36
- duration_estimated = nil,
37
- date_based = nil,
38
- time_based = nil)
39
- @duration = duration
40
- @duration_estimated = duration_estimated
41
- @date_based = date_based
42
- @time_based = time_based
43
- end
44
-
45
- # Creates an instance of the object from a hash.
46
- def self.from_hash(hash)
47
- return nil unless hash
48
-
49
- # Extract variables from the hash.
50
- duration = Duration.from_hash(hash['duration']) if hash['duration']
51
- duration_estimated = hash['durationEstimated']
52
- date_based = hash['dateBased']
53
- time_based = hash['timeBased']
54
-
55
- # Create object from extracted values.
56
- TemporalUnit.new(duration,
57
- duration_estimated,
58
- date_based,
59
- time_based)
60
- end
61
- end
62
- end