Class: Bandwidth::TranscriptionsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/bandwidth-sdk/api/transcriptions_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TranscriptionsApi

Returns a new instance of TranscriptionsApi.



19
20
21
# File 'lib/bandwidth-sdk/api/transcriptions_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/bandwidth-sdk/api/transcriptions_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_real_time_transcription(account_id, call_id, transcription_id, opts = {}) ⇒ nil

Delete a specific transcription Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a ‘200` 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.

Parameters:

  • account_id (String)

    Your Bandwidth Account ID.

  • call_id (String)

    Programmable Voice API Call ID.

  • transcription_id (String)

    Programmable Voice API Transcription ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


29
30
31
32
# File 'lib/bandwidth-sdk/api/transcriptions_api.rb', line 29

def delete_real_time_transcription(, call_id, transcription_id, opts = {})
  delete_real_time_transcription_with_http_info(, call_id, transcription_id, opts)
  nil
end

#delete_real_time_transcription_with_http_info(account_id, call_id, transcription_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a specific transcription Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a &#x60;200&#x60; 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.

Parameters:

  • account_id (String)

    Your Bandwidth Account ID.

  • call_id (String)

    Programmable Voice API Call ID.

  • transcription_id (String)

    Programmable Voice API Transcription ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/bandwidth-sdk/api/transcriptions_api.rb', line 41

def delete_real_time_transcription_with_http_info(, call_id, transcription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TranscriptionsApi.delete_real_time_transcription ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling TranscriptionsApi.delete_real_time_transcription"
  end
  # verify the required parameter 'call_id' is set
  if @api_client.config.client_side_validation && call_id.nil?
    fail ArgumentError, "Missing the required parameter 'call_id' when calling TranscriptionsApi.delete_real_time_transcription"
  end
  # verify the required parameter 'transcription_id' is set
  if @api_client.config.client_side_validation && transcription_id.nil?
    fail ArgumentError, "Missing the required parameter 'transcription_id' when calling TranscriptionsApi.delete_real_time_transcription"
  end
  # resource path
  local_var_path = '/accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}'.sub('{' + 'accountId' + '}', CGI.escape(.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'transcriptionId' + '}', CGI.escape(transcription_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic']

  new_options = opts.merge(
    :operation => :"TranscriptionsApi.delete_real_time_transcription",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TranscriptionsApi#delete_real_time_transcription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_real_time_transcription(account_id, call_id, transcription_id, opts = {}) ⇒ CallTranscriptionResponse

Retrieve a specific transcription Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription).

Parameters:

  • account_id (String)

    Your Bandwidth Account ID.

  • call_id (String)

    Programmable Voice API Call ID.

  • transcription_id (String)

    Programmable Voice API Transcription ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



104
105
106
107
# File 'lib/bandwidth-sdk/api/transcriptions_api.rb', line 104

def get_real_time_transcription(, call_id, transcription_id, opts = {})
  data, _status_code, _headers = get_real_time_transcription_with_http_info(, call_id, transcription_id, opts)
  data
end

#get_real_time_transcription_with_http_info(account_id, call_id, transcription_id, opts = {}) ⇒ Array<(CallTranscriptionResponse, Integer, Hash)>

Retrieve a specific transcription Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription).

Parameters:

  • account_id (String)

    Your Bandwidth Account ID.

  • call_id (String)

    Programmable Voice API Call ID.

  • transcription_id (String)

    Programmable Voice API Transcription ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CallTranscriptionResponse, Integer, Hash)>)

    CallTranscriptionResponse data, response status code and response headers



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/bandwidth-sdk/api/transcriptions_api.rb', line 116

def get_real_time_transcription_with_http_info(, call_id, transcription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TranscriptionsApi.get_real_time_transcription ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling TranscriptionsApi.get_real_time_transcription"
  end
  # verify the required parameter 'call_id' is set
  if @api_client.config.client_side_validation && call_id.nil?
    fail ArgumentError, "Missing the required parameter 'call_id' when calling TranscriptionsApi.get_real_time_transcription"
  end
  # verify the required parameter 'transcription_id' is set
  if @api_client.config.client_side_validation && transcription_id.nil?
    fail ArgumentError, "Missing the required parameter 'transcription_id' when calling TranscriptionsApi.get_real_time_transcription"
  end
  # resource path
  local_var_path = '/accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}'.sub('{' + 'accountId' + '}', CGI.escape(.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'transcriptionId' + '}', CGI.escape(transcription_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CallTranscriptionResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic']

  new_options = opts.merge(
    :operation => :"TranscriptionsApi.get_real_time_transcription",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TranscriptionsApi#get_real_time_transcription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_real_time_transcriptions(account_id, call_id, opts = {}) ⇒ Array<CallTranscriptionMetadata>

Enumerate transcriptions made with StartTranscription Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription).

Parameters:

  • account_id (String)

    Your Bandwidth Account ID.

  • call_id (String)

    Programmable Voice API Call ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



178
179
180
181
# File 'lib/bandwidth-sdk/api/transcriptions_api.rb', line 178

def list_real_time_transcriptions(, call_id, opts = {})
  data, _status_code, _headers = list_real_time_transcriptions_with_http_info(, call_id, opts)
  data
end

#list_real_time_transcriptions_with_http_info(account_id, call_id, opts = {}) ⇒ Array<(Array<CallTranscriptionMetadata>, Integer, Hash)>

Enumerate transcriptions made with StartTranscription Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription).

Parameters:

  • account_id (String)

    Your Bandwidth Account ID.

  • call_id (String)

    Programmable Voice API Call ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<CallTranscriptionMetadata>, Integer, Hash)>)

    Array<CallTranscriptionMetadata> data, response status code and response headers



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/bandwidth-sdk/api/transcriptions_api.rb', line 189

def list_real_time_transcriptions_with_http_info(, call_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TranscriptionsApi.list_real_time_transcriptions ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling TranscriptionsApi.list_real_time_transcriptions"
  end
  # verify the required parameter 'call_id' is set
  if @api_client.config.client_side_validation && call_id.nil?
    fail ArgumentError, "Missing the required parameter 'call_id' when calling TranscriptionsApi.list_real_time_transcriptions"
  end
  # resource path
  local_var_path = '/accounts/{accountId}/calls/{callId}/transcriptions'.sub('{' + 'accountId' + '}', CGI.escape(.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<CallTranscriptionMetadata>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic']

  new_options = opts.merge(
    :operation => :"TranscriptionsApi.list_real_time_transcriptions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TranscriptionsApi#list_real_time_transcriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end