bandwidth-sdk 11.3.0 → 12.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +18 -16
  3. data/README.md +15 -9
  4. data/Rakefile +4 -12
  5. data/bandwidth.yml +243 -28
  6. data/coverage/.last_run.json +1 -1
  7. data/coverage/.resultset.json +1412 -1009
  8. data/coverage/index.html +16274 -11823
  9. data/custom_templates/README.mustache +4 -4
  10. data/docs/AnswerCallback.md +1 -1
  11. data/docs/BridgeCompleteCallback.md +1 -1
  12. data/docs/BridgeTargetCompleteCallback.md +1 -1
  13. data/docs/CallRecordingMetadata.md +3 -3
  14. data/docs/CallTranscription.md +24 -0
  15. data/docs/CallTranscriptionMetadata.md +20 -0
  16. data/docs/CallTranscriptionResponse.md +24 -0
  17. data/docs/CallsApi.md +1 -1
  18. data/docs/ConferenceMemberExitCallback.md +1 -1
  19. data/docs/ConferenceMemberJoinCallback.md +1 -1
  20. data/docs/CreateCall.md +5 -3
  21. data/docs/DisconnectCallback.md +1 -1
  22. data/docs/DtmfCallback.md +2 -2
  23. data/docs/GatherCallback.md +2 -2
  24. data/docs/InitiateCallback.md +1 -1
  25. data/docs/MachineDetectionCompleteCallback.md +1 -1
  26. data/docs/RecordingAvailableCallback.md +4 -4
  27. data/docs/RecordingCompleteCallback.md +2 -2
  28. data/docs/RecordingTranscriptionMetadata.md +24 -0
  29. data/docs/RecordingTranscriptions.md +18 -0
  30. data/docs/RecordingsApi.md +49 -49
  31. data/docs/RedirectCallback.md +2 -2
  32. data/docs/TranscriptionAvailableCallback.md +2 -2
  33. data/docs/TranscriptionsApi.md +229 -0
  34. data/docs/TransferAnswerCallback.md +2 -2
  35. data/docs/TransferCompleteCallback.md +2 -2
  36. data/docs/TransferDisconnectCallback.md +2 -2
  37. data/lib/bandwidth-sdk/api/recordings_api.rb +56 -56
  38. data/lib/bandwidth-sdk/api/transcriptions_api.rb +241 -0
  39. data/lib/bandwidth-sdk/configuration.rb +22 -4
  40. data/lib/bandwidth-sdk/models/answer_callback.rb +1 -1
  41. data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +1 -1
  42. data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +1 -1
  43. data/lib/bandwidth-sdk/models/call_recording_metadata.rb +3 -3
  44. data/lib/bandwidth-sdk/models/call_transcription.rb +317 -0
  45. data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +223 -0
  46. data/lib/bandwidth-sdk/models/call_transcription_response.rb +244 -0
  47. data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +1 -1
  48. data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +1 -1
  49. data/lib/bandwidth-sdk/models/create_call.rb +14 -3
  50. data/lib/bandwidth-sdk/models/disconnect_callback.rb +1 -1
  51. data/lib/bandwidth-sdk/models/dtmf_callback.rb +2 -2
  52. data/lib/bandwidth-sdk/models/gather_callback.rb +2 -2
  53. data/lib/bandwidth-sdk/models/initiate_callback.rb +1 -1
  54. data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +1 -1
  55. data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +1 -1
  56. data/lib/bandwidth-sdk/models/recording_available_callback.rb +4 -4
  57. data/lib/bandwidth-sdk/models/recording_complete_callback.rb +2 -2
  58. data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +244 -0
  59. data/lib/bandwidth-sdk/models/recording_transcriptions.rb +214 -0
  60. data/lib/bandwidth-sdk/models/redirect_callback.rb +2 -2
  61. data/lib/bandwidth-sdk/models/transcription_available_callback.rb +2 -2
  62. data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +2 -2
  63. data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +2 -2
  64. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +2 -2
  65. data/lib/bandwidth-sdk/version.rb +1 -1
  66. data/lib/bandwidth-sdk.rb +6 -2
  67. data/spec/{integration/calls_api_integration_spec.rb → smoke/calls_api_spec.rb} +9 -7
  68. data/spec/{integration/conferences_api_integration_spec.rb → smoke/conferences_api_spec.rb} +9 -9
  69. data/spec/{integration/media_api_integration_spec.rb → smoke/media_api_spec.rb} +7 -7
  70. data/spec/{integration/messages_api_integration_spec.rb → smoke/messages_api_spec.rb} +3 -3
  71. data/spec/{integration/mfa_api_integration_spec.rb → smoke/mfa_api_spec.rb} +3 -3
  72. data/spec/{integration/phone_number_lookup_api_integration_spec.rb → smoke/phone_number_lookup_api_spec.rb} +2 -2
  73. data/spec/{integration/recordings_api_integration_spec.rb → smoke/recordings_api_spec.rb} +14 -14
  74. data/spec/{integration/statistics_api_integration_spec.rb → smoke/statistics_api_spec.rb} +1 -1
  75. data/spec/smoke/transcriptions_api_spec.rb +84 -0
  76. data/spec/spec_helper.rb +2 -2
  77. data/spec/{api → unit/api}/calls_api_spec.rb +6 -4
  78. data/spec/{api → unit/api}/conferences_api_spec.rb +12 -12
  79. data/spec/{api → unit/api}/media_api_spec.rb +6 -6
  80. data/spec/{api → unit/api}/messages_api_spec.rb +2 -2
  81. data/spec/{api → unit/api}/mfa_api_spec.rb +6 -6
  82. data/spec/{api → unit/api}/phone_number_lookup_api_spec.rb +2 -2
  83. data/spec/{api → unit/api}/recordings_api_spec.rb +30 -30
  84. data/spec/{api → unit/api}/statistics_api_spec.rb +1 -1
  85. data/spec/unit/api/transcriptions_api_spec.rb +130 -0
  86. data/spec/{api_client_spec.rb → unit/client/api_client_spec.rb} +2 -2
  87. metadata +130 -114
  88. /data/spec/{api_error_spec.rb → unit/client/api_error_spec.rb} +0 -0
  89. /data/spec/{configuration_spec.rb → unit/client/configuration_spec.rb} +0 -0
  90. /data/spec/{models → unit/models}/bxml/bxml_spec.rb +0 -0
  91. /data/spec/{models → unit/models}/bxml/nestable_verb_spec.rb +0 -0
  92. /data/spec/{models → unit/models}/bxml/response_spec.rb +0 -0
  93. /data/spec/{models → unit/models}/bxml/verb_spec.rb +0 -0
  94. /data/spec/{models → unit/models}/bxml/verbs/bridge_spec.rb +0 -0
  95. /data/spec/{models → unit/models}/bxml/verbs/conference_spec.rb +0 -0
  96. /data/spec/{models → unit/models}/bxml/verbs/custom_param_spec.rb +0 -0
  97. /data/spec/{models → unit/models}/bxml/verbs/forward_spec.rb +0 -0
  98. /data/spec/{models → unit/models}/bxml/verbs/gather_spec.rb +0 -0
  99. /data/spec/{models → unit/models}/bxml/verbs/hangup_spec.rb +0 -0
  100. /data/spec/{models → unit/models}/bxml/verbs/pause_recording_spec.rb +0 -0
  101. /data/spec/{models → unit/models}/bxml/verbs/pause_spec.rb +0 -0
  102. /data/spec/{models → unit/models}/bxml/verbs/phone_number_spec.rb +0 -0
  103. /data/spec/{models → unit/models}/bxml/verbs/play_audio_spec.rb +0 -0
  104. /data/spec/{models → unit/models}/bxml/verbs/record_spec.rb +0 -0
  105. /data/spec/{models → unit/models}/bxml/verbs/redirect_spec.rb +0 -0
  106. /data/spec/{models → unit/models}/bxml/verbs/resume_recording_spec.rb +0 -0
  107. /data/spec/{models → unit/models}/bxml/verbs/ring_spec.rb +0 -0
  108. /data/spec/{models → unit/models}/bxml/verbs/send_dtmf_spec.rb +0 -0
  109. /data/spec/{models → unit/models}/bxml/verbs/sip_uri_spec.rb +0 -0
  110. /data/spec/{models → unit/models}/bxml/verbs/speak_sentence_spec.rb +0 -0
  111. /data/spec/{models → unit/models}/bxml/verbs/start_gather_spec.rb +0 -0
  112. /data/spec/{models → unit/models}/bxml/verbs/start_recording_spec.rb +0 -0
  113. /data/spec/{models → unit/models}/bxml/verbs/start_stream_spec.rb +0 -0
  114. /data/spec/{models → unit/models}/bxml/verbs/start_transcription_spec.rb +0 -0
  115. /data/spec/{models → unit/models}/bxml/verbs/stop_gather_spec.rb +0 -0
  116. /data/spec/{models → unit/models}/bxml/verbs/stop_recording_spec.rb +0 -0
  117. /data/spec/{models → unit/models}/bxml/verbs/stop_stream_spec.rb +0 -0
  118. /data/spec/{models → unit/models}/bxml/verbs/stop_transcription_spec.rb +0 -0
  119. /data/spec/{models → unit/models}/bxml/verbs/stream_param_spec.rb +0 -0
  120. /data/spec/{models → unit/models}/bxml/verbs/tag_spec.rb +0 -0
  121. /data/spec/{models → unit/models}/bxml/verbs/transfer_spec.rb +0 -0
  122. /data/spec/{models → unit/models}/call_state_enum_spec.rb +0 -0
  123. /data/spec/{models → unit/models}/call_state_spec.rb +0 -0
  124. /data/spec/{models → unit/models}/deferred_result_spec.rb +0 -0
  125. /data/spec/{models → unit/models}/message_spec.rb +0 -0
  126. /data/spec/{models → unit/models}/verify_code_request_spec.rb +0 -0
@@ -0,0 +1,241 @@
1
+ =begin
2
+ #Bandwidth
3
+
4
+ #Bandwidth's Communication APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: letstalk@bandwidth.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.0.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Bandwidth
16
+ class TranscriptionsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Delete a specific transcription
23
+ # Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.
24
+ # @param account_id [String] Your Bandwidth Account ID.
25
+ # @param call_id [String] Programmable Voice API Call ID.
26
+ # @param transcription_id [String] Programmable Voice API Transcription ID.
27
+ # @param [Hash] opts the optional parameters
28
+ # @return [nil]
29
+ def delete_real_time_transcription(account_id, call_id, transcription_id, opts = {})
30
+ delete_real_time_transcription_with_http_info(account_id, call_id, transcription_id, opts)
31
+ nil
32
+ end
33
+
34
+ # Delete a specific transcription
35
+ # Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.
36
+ # @param account_id [String] Your Bandwidth Account ID.
37
+ # @param call_id [String] Programmable Voice API Call ID.
38
+ # @param transcription_id [String] Programmable Voice API Transcription ID.
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
41
+ def delete_real_time_transcription_with_http_info(account_id, call_id, transcription_id, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: TranscriptionsApi.delete_real_time_transcription ...'
44
+ end
45
+ # verify the required parameter 'account_id' is set
46
+ if @api_client.config.client_side_validation && account_id.nil?
47
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling TranscriptionsApi.delete_real_time_transcription"
48
+ end
49
+ # verify the required parameter 'call_id' is set
50
+ if @api_client.config.client_side_validation && call_id.nil?
51
+ fail ArgumentError, "Missing the required parameter 'call_id' when calling TranscriptionsApi.delete_real_time_transcription"
52
+ end
53
+ # verify the required parameter 'transcription_id' is set
54
+ if @api_client.config.client_side_validation && transcription_id.nil?
55
+ fail ArgumentError, "Missing the required parameter 'transcription_id' when calling TranscriptionsApi.delete_real_time_transcription"
56
+ end
57
+ # resource path
58
+ local_var_path = '/accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'transcriptionId' + '}', CGI.escape(transcription_id.to_s))
59
+
60
+ # query parameters
61
+ query_params = opts[:query_params] || {}
62
+
63
+ # header parameters
64
+ header_params = opts[:header_params] || {}
65
+ # HTTP header 'Accept' (if needed)
66
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
67
+
68
+ # form parameters
69
+ form_params = opts[:form_params] || {}
70
+
71
+ # http body (model)
72
+ post_body = opts[:debug_body]
73
+
74
+ # return_type
75
+ return_type = opts[:debug_return_type]
76
+
77
+ # auth_names
78
+ auth_names = opts[:debug_auth_names] || ['Basic']
79
+
80
+ new_options = opts.merge(
81
+ :operation => :"TranscriptionsApi.delete_real_time_transcription",
82
+ :header_params => header_params,
83
+ :query_params => query_params,
84
+ :form_params => form_params,
85
+ :body => post_body,
86
+ :auth_names => auth_names,
87
+ :return_type => return_type
88
+ )
89
+
90
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
91
+ if @api_client.config.debugging
92
+ @api_client.config.logger.debug "API called: TranscriptionsApi#delete_real_time_transcription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93
+ end
94
+ return data, status_code, headers
95
+ end
96
+
97
+ # Retrieve a specific transcription
98
+ # Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription).
99
+ # @param account_id [String] Your Bandwidth Account ID.
100
+ # @param call_id [String] Programmable Voice API Call ID.
101
+ # @param transcription_id [String] Programmable Voice API Transcription ID.
102
+ # @param [Hash] opts the optional parameters
103
+ # @return [CallTranscriptionResponse]
104
+ def get_real_time_transcription(account_id, call_id, transcription_id, opts = {})
105
+ data, _status_code, _headers = get_real_time_transcription_with_http_info(account_id, call_id, transcription_id, opts)
106
+ data
107
+ end
108
+
109
+ # Retrieve a specific transcription
110
+ # Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription).
111
+ # @param account_id [String] Your Bandwidth Account ID.
112
+ # @param call_id [String] Programmable Voice API Call ID.
113
+ # @param transcription_id [String] Programmable Voice API Transcription ID.
114
+ # @param [Hash] opts the optional parameters
115
+ # @return [Array<(CallTranscriptionResponse, Integer, Hash)>] CallTranscriptionResponse data, response status code and response headers
116
+ def get_real_time_transcription_with_http_info(account_id, call_id, transcription_id, opts = {})
117
+ if @api_client.config.debugging
118
+ @api_client.config.logger.debug 'Calling API: TranscriptionsApi.get_real_time_transcription ...'
119
+ end
120
+ # verify the required parameter 'account_id' is set
121
+ if @api_client.config.client_side_validation && account_id.nil?
122
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling TranscriptionsApi.get_real_time_transcription"
123
+ end
124
+ # verify the required parameter 'call_id' is set
125
+ if @api_client.config.client_side_validation && call_id.nil?
126
+ fail ArgumentError, "Missing the required parameter 'call_id' when calling TranscriptionsApi.get_real_time_transcription"
127
+ end
128
+ # verify the required parameter 'transcription_id' is set
129
+ if @api_client.config.client_side_validation && transcription_id.nil?
130
+ fail ArgumentError, "Missing the required parameter 'transcription_id' when calling TranscriptionsApi.get_real_time_transcription"
131
+ end
132
+ # resource path
133
+ local_var_path = '/accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'transcriptionId' + '}', CGI.escape(transcription_id.to_s))
134
+
135
+ # query parameters
136
+ query_params = opts[:query_params] || {}
137
+
138
+ # header parameters
139
+ header_params = opts[:header_params] || {}
140
+ # HTTP header 'Accept' (if needed)
141
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
142
+
143
+ # form parameters
144
+ form_params = opts[:form_params] || {}
145
+
146
+ # http body (model)
147
+ post_body = opts[:debug_body]
148
+
149
+ # return_type
150
+ return_type = opts[:debug_return_type] || 'CallTranscriptionResponse'
151
+
152
+ # auth_names
153
+ auth_names = opts[:debug_auth_names] || ['Basic']
154
+
155
+ new_options = opts.merge(
156
+ :operation => :"TranscriptionsApi.get_real_time_transcription",
157
+ :header_params => header_params,
158
+ :query_params => query_params,
159
+ :form_params => form_params,
160
+ :body => post_body,
161
+ :auth_names => auth_names,
162
+ :return_type => return_type
163
+ )
164
+
165
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
166
+ if @api_client.config.debugging
167
+ @api_client.config.logger.debug "API called: TranscriptionsApi#get_real_time_transcription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
168
+ end
169
+ return data, status_code, headers
170
+ end
171
+
172
+ # Enumerate transcriptions made with StartTranscription
173
+ # Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription).
174
+ # @param account_id [String] Your Bandwidth Account ID.
175
+ # @param call_id [String] Programmable Voice API Call ID.
176
+ # @param [Hash] opts the optional parameters
177
+ # @return [Array<CallTranscriptionMetadata>]
178
+ def list_real_time_transcriptions(account_id, call_id, opts = {})
179
+ data, _status_code, _headers = list_real_time_transcriptions_with_http_info(account_id, call_id, opts)
180
+ data
181
+ end
182
+
183
+ # Enumerate transcriptions made with StartTranscription
184
+ # Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription).
185
+ # @param account_id [String] Your Bandwidth Account ID.
186
+ # @param call_id [String] Programmable Voice API Call ID.
187
+ # @param [Hash] opts the optional parameters
188
+ # @return [Array<(Array<CallTranscriptionMetadata>, Integer, Hash)>] Array<CallTranscriptionMetadata> data, response status code and response headers
189
+ def list_real_time_transcriptions_with_http_info(account_id, call_id, opts = {})
190
+ if @api_client.config.debugging
191
+ @api_client.config.logger.debug 'Calling API: TranscriptionsApi.list_real_time_transcriptions ...'
192
+ end
193
+ # verify the required parameter 'account_id' is set
194
+ if @api_client.config.client_side_validation && account_id.nil?
195
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling TranscriptionsApi.list_real_time_transcriptions"
196
+ end
197
+ # verify the required parameter 'call_id' is set
198
+ if @api_client.config.client_side_validation && call_id.nil?
199
+ fail ArgumentError, "Missing the required parameter 'call_id' when calling TranscriptionsApi.list_real_time_transcriptions"
200
+ end
201
+ # resource path
202
+ local_var_path = '/accounts/{accountId}/calls/{callId}/transcriptions'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s))
203
+
204
+ # query parameters
205
+ query_params = opts[:query_params] || {}
206
+
207
+ # header parameters
208
+ header_params = opts[:header_params] || {}
209
+ # HTTP header 'Accept' (if needed)
210
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
211
+
212
+ # form parameters
213
+ form_params = opts[:form_params] || {}
214
+
215
+ # http body (model)
216
+ post_body = opts[:debug_body]
217
+
218
+ # return_type
219
+ return_type = opts[:debug_return_type] || 'Array<CallTranscriptionMetadata>'
220
+
221
+ # auth_names
222
+ auth_names = opts[:debug_auth_names] || ['Basic']
223
+
224
+ new_options = opts.merge(
225
+ :operation => :"TranscriptionsApi.list_real_time_transcriptions",
226
+ :header_params => header_params,
227
+ :query_params => query_params,
228
+ :form_params => form_params,
229
+ :body => post_body,
230
+ :auth_names => auth_names,
231
+ :return_type => return_type
232
+ )
233
+
234
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
235
+ if @api_client.config.debugging
236
+ @api_client.config.logger.debug "API called: TranscriptionsApi#list_real_time_transcriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
237
+ end
238
+ return data, status_code, headers
239
+ end
240
+ end
241
+ end
@@ -410,19 +410,19 @@ module Bandwidth
410
410
  description: "Production",
411
411
  }
412
412
  ],
413
- "RecordingsApi.delete_call_transcription": [
413
+ "RecordingsApi.delete_recording": [
414
414
  {
415
415
  url: "https://voice.bandwidth.com/api/v2",
416
416
  description: "Production",
417
417
  }
418
418
  ],
419
- "RecordingsApi.delete_recording": [
419
+ "RecordingsApi.delete_recording_media": [
420
420
  {
421
421
  url: "https://voice.bandwidth.com/api/v2",
422
422
  description: "Production",
423
423
  }
424
424
  ],
425
- "RecordingsApi.delete_recording_media": [
425
+ "RecordingsApi.delete_recording_transcription": [
426
426
  {
427
427
  url: "https://voice.bandwidth.com/api/v2",
428
428
  description: "Production",
@@ -440,7 +440,7 @@ module Bandwidth
440
440
  description: "Production",
441
441
  }
442
442
  ],
443
- "RecordingsApi.get_call_transcription": [
443
+ "RecordingsApi.get_recording_transcription": [
444
444
  {
445
445
  url: "https://voice.bandwidth.com/api/v2",
446
446
  description: "Production",
@@ -476,6 +476,24 @@ module Bandwidth
476
476
  description: "Production",
477
477
  }
478
478
  ],
479
+ "TranscriptionsApi.delete_real_time_transcription": [
480
+ {
481
+ url: "https://voice.bandwidth.com/api/v2",
482
+ description: "Production",
483
+ }
484
+ ],
485
+ "TranscriptionsApi.get_real_time_transcription": [
486
+ {
487
+ url: "https://voice.bandwidth.com/api/v2",
488
+ description: "Production",
489
+ }
490
+ ],
491
+ "TranscriptionsApi.list_real_time_transcriptions": [
492
+ {
493
+ url: "https://voice.bandwidth.com/api/v2",
494
+ description: "Production",
495
+ }
496
+ ],
479
497
  }
480
498
  end
481
499
 
@@ -28,7 +28,7 @@ module Bandwidth
28
28
  # The id of the application associated with the call.
29
29
  attr_accessor :application_id
30
30
 
31
- # The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
31
+ # The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
32
32
  attr_accessor :from
33
33
 
34
34
  # The phone number that received the call, in E.164 format (e.g. +15555555555).
@@ -28,7 +28,7 @@ module Bandwidth
28
28
  # The id of the application associated with the call.
29
29
  attr_accessor :application_id
30
30
 
31
- # The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
31
+ # The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
32
32
  attr_accessor :from
33
33
 
34
34
  # The phone number that received the call, in E.164 format (e.g. +15555555555).
@@ -28,7 +28,7 @@ module Bandwidth
28
28
  # The id of the application associated with the call.
29
29
  attr_accessor :application_id
30
30
 
31
- # The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
31
+ # The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
32
32
  attr_accessor :from
33
33
 
34
34
  # The phone number that received the call, in E.164 format (e.g. +15555555555).
@@ -33,10 +33,10 @@ module Bandwidth
33
33
  # The phone number that received the call, in E.164 format (e.g. +15555555555).
34
34
  attr_accessor :to
35
35
 
36
- # The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
36
+ # The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
37
37
  attr_accessor :from
38
38
 
39
- # The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.
39
+ # The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).
40
40
  attr_accessor :transfer_caller_id
41
41
 
42
42
  # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).
@@ -137,7 +137,7 @@ module Bandwidth
137
137
  :'file_format' => :'FileFormatEnum',
138
138
  :'status' => :'String',
139
139
  :'media_url' => :'String',
140
- :'transcription' => :'TranscriptionMetadata'
140
+ :'transcription' => :'RecordingTranscriptionMetadata'
141
141
  }
142
142
  end
143
143
 
@@ -0,0 +1,317 @@
1
+ =begin
2
+ #Bandwidth
3
+
4
+ #Bandwidth's Communication APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: letstalk@bandwidth.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Bandwidth
17
+ class CallTranscription
18
+ # The detected language for this transcription.
19
+ attr_accessor :detected_language
20
+
21
+ # Which `track` this transcription is derived from.
22
+ attr_accessor :track
23
+
24
+ # The transcription itself.
25
+ attr_accessor :text
26
+
27
+ # How confident the transcription engine was in transcribing the associated audio (from `0` to `1`).
28
+ attr_accessor :confidence
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'detected_language' => :'detectedLanguage',
56
+ :'track' => :'track',
57
+ :'text' => :'text',
58
+ :'confidence' => :'confidence'
59
+ }
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'detected_language' => :'String',
71
+ :'track' => :'String',
72
+ :'text' => :'String',
73
+ :'confidence' => :'Float'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CallTranscription` initialize method'
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!self.class.attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CallTranscription`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'detected_language')
99
+ self.detected_language = attributes[:'detected_language']
100
+ end
101
+
102
+ if attributes.key?(:'track')
103
+ self.track = attributes[:'track']
104
+ end
105
+
106
+ if attributes.key?(:'text')
107
+ self.text = attributes[:'text']
108
+ end
109
+
110
+ if attributes.key?(:'confidence')
111
+ self.confidence = attributes[:'confidence']
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
119
+ invalid_properties = Array.new
120
+ if !@confidence.nil? && @confidence > 1
121
+ invalid_properties.push('invalid value for "confidence", must be smaller than or equal to 1.')
122
+ end
123
+
124
+ if !@confidence.nil? && @confidence < 0
125
+ invalid_properties.push('invalid value for "confidence", must be greater than or equal to 0.')
126
+ end
127
+
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ warn '[DEPRECATED] the `valid?` method is obsolete'
135
+ detected_language_validator = EnumAttributeValidator.new('String', ['en-US', 'es-US', 'fr-FR'])
136
+ return false unless detected_language_validator.valid?(@detected_language)
137
+ track_validator = EnumAttributeValidator.new('String', ['inbound', 'outbound'])
138
+ return false unless track_validator.valid?(@track)
139
+ return false if !@confidence.nil? && @confidence > 1
140
+ return false if !@confidence.nil? && @confidence < 0
141
+ true
142
+ end
143
+
144
+ # Custom attribute writer method checking allowed values (enum).
145
+ # @param [Object] detected_language Object to be assigned
146
+ def detected_language=(detected_language)
147
+ validator = EnumAttributeValidator.new('String', ['en-US', 'es-US', 'fr-FR'])
148
+ unless validator.valid?(detected_language)
149
+ fail ArgumentError, "invalid value for \"detected_language\", must be one of #{validator.allowable_values}."
150
+ end
151
+ @detected_language = detected_language
152
+ end
153
+
154
+ # Custom attribute writer method checking allowed values (enum).
155
+ # @param [Object] track Object to be assigned
156
+ def track=(track)
157
+ validator = EnumAttributeValidator.new('String', ['inbound', 'outbound'])
158
+ unless validator.valid?(track)
159
+ fail ArgumentError, "invalid value for \"track\", must be one of #{validator.allowable_values}."
160
+ end
161
+ @track = track
162
+ end
163
+
164
+ # Custom attribute writer method with validation
165
+ # @param [Object] confidence Value to be assigned
166
+ def confidence=(confidence)
167
+ if confidence.nil?
168
+ fail ArgumentError, 'confidence cannot be nil'
169
+ end
170
+
171
+ if confidence > 1
172
+ fail ArgumentError, 'invalid value for "confidence", must be smaller than or equal to 1.'
173
+ end
174
+
175
+ if confidence < 0
176
+ fail ArgumentError, 'invalid value for "confidence", must be greater than or equal to 0.'
177
+ end
178
+
179
+ @confidence = confidence
180
+ end
181
+
182
+ # Checks equality by comparing each attribute.
183
+ # @param [Object] Object to be compared
184
+ def ==(o)
185
+ return true if self.equal?(o)
186
+ self.class == o.class &&
187
+ detected_language == o.detected_language &&
188
+ track == o.track &&
189
+ text == o.text &&
190
+ confidence == o.confidence
191
+ end
192
+
193
+ # @see the `==` method
194
+ # @param [Object] Object to be compared
195
+ def eql?(o)
196
+ self == o
197
+ end
198
+
199
+ # Calculates hash code according to all attributes.
200
+ # @return [Integer] Hash code
201
+ def hash
202
+ [detected_language, track, text, confidence].hash
203
+ end
204
+
205
+ # Builds the object from hash
206
+ # @param [Hash] attributes Model attributes in the form of hash
207
+ # @return [Object] Returns the model itself
208
+ def self.build_from_hash(attributes)
209
+ return nil unless attributes.is_a?(Hash)
210
+ attributes = attributes.transform_keys(&:to_sym)
211
+ transformed_hash = {}
212
+ openapi_types.each_pair do |key, type|
213
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
214
+ transformed_hash["#{key}"] = nil
215
+ elsif type =~ /\AArray<(.*)>/i
216
+ # check to ensure the input is an array given that the attribute
217
+ # is documented as an array but the input is not
218
+ if attributes[attribute_map[key]].is_a?(Array)
219
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
220
+ end
221
+ elsif !attributes[attribute_map[key]].nil?
222
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
223
+ end
224
+ end
225
+ new(transformed_hash)
226
+ end
227
+
228
+ # Deserializes the data based on type
229
+ # @param string type Data type
230
+ # @param string value Value to be deserialized
231
+ # @return [Object] Deserialized data
232
+ def self._deserialize(type, value)
233
+ case type.to_sym
234
+ when :Time
235
+ Time.parse(value)
236
+ when :Date
237
+ Date.parse(value)
238
+ when :String
239
+ value.to_s
240
+ when :Integer
241
+ value.to_i
242
+ when :Float
243
+ value.to_f
244
+ when :Boolean
245
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
246
+ true
247
+ else
248
+ false
249
+ end
250
+ when :Object
251
+ # generic object (usually a Hash), return directly
252
+ value
253
+ when /\AArray<(?<inner_type>.+)>\z/
254
+ inner_type = Regexp.last_match[:inner_type]
255
+ value.map { |v| _deserialize(inner_type, v) }
256
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
257
+ k_type = Regexp.last_match[:k_type]
258
+ v_type = Regexp.last_match[:v_type]
259
+ {}.tap do |hash|
260
+ value.each do |k, v|
261
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
262
+ end
263
+ end
264
+ else # model
265
+ # models (e.g. Pet) or oneOf
266
+ klass = Bandwidth.const_get(type)
267
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
268
+ end
269
+ end
270
+
271
+ # Returns the string representation of the object
272
+ # @return [String] String presentation of the object
273
+ def to_s
274
+ to_hash.to_s
275
+ end
276
+
277
+ # to_body is an alias to to_hash (backward compatibility)
278
+ # @return [Hash] Returns the object in the form of hash
279
+ def to_body
280
+ to_hash
281
+ end
282
+
283
+ # Returns the object in the form of hash
284
+ # @return [Hash] Returns the object in the form of hash
285
+ def to_hash
286
+ hash = {}
287
+ self.class.attribute_map.each_pair do |attr, param|
288
+ value = self.send(attr)
289
+ if value.nil?
290
+ is_nullable = self.class.openapi_nullable.include?(attr)
291
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
292
+ end
293
+
294
+ hash[param] = _to_hash(value)
295
+ end
296
+ hash
297
+ end
298
+
299
+ # Outputs non-array value in the form of hash
300
+ # For object, use to_hash. Otherwise, just return the value
301
+ # @param [Object] value Any valid value
302
+ # @return [Hash] Returns the value in the form of hash
303
+ def _to_hash(value)
304
+ if value.is_a?(Array)
305
+ value.compact.map { |v| _to_hash(v) }
306
+ elsif value.is_a?(Hash)
307
+ {}.tap do |hash|
308
+ value.each { |k, v| hash[k] = _to_hash(v) }
309
+ end
310
+ elsif value.respond_to? :to_hash
311
+ value.to_hash
312
+ else
313
+ value
314
+ end
315
+ end
316
+ end
317
+ end