Skip to content

Commit

Permalink
Merge pull request #111 from Bandwidth/SWI-5556
Browse files Browse the repository at this point in the history
SWI-5556 Update SDK Based on Recent Spec Changes
  • Loading branch information
ajrice6713 authored Jul 8, 2024
2 parents 5e166f3 + 459251e commit 28a1789
Show file tree
Hide file tree
Showing 21 changed files with 321 additions and 117 deletions.
12 changes: 6 additions & 6 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ docs/CallRecordingMetadata.md
docs/CallState.md
docs/CallStateEnum.md
docs/CallTranscription.md
docs/CallTranscriptionDetectedLanguageEnum.md
docs/CallTranscriptionMetadata.md
docs/CallTranscriptionResponse.md
docs/CallTranscriptionTrackEnum.md
docs/CallbackMethodEnum.md
docs/CallsApi.md
docs/CodeRequest.md
Expand Down Expand Up @@ -103,12 +105,8 @@ docs/VerifyCodeResponse.md
docs/VoiceApiError.md
docs/VoiceCodeResponse.md
git_push.sh
src/Bandwidth.Standard.Test/Api/TranscriptionsApiTests.cs
src/Bandwidth.Standard.Test/Model/CallTranscriptionMetadataTests.cs
src/Bandwidth.Standard.Test/Model/CallTranscriptionResponseTests.cs
src/Bandwidth.Standard.Test/Model/CallTranscriptionTests.cs
src/Bandwidth.Standard.Test/Model/RecordingTranscriptionMetadataTests.cs
src/Bandwidth.Standard.Test/Model/RecordingTranscriptionsTests.cs
src/Bandwidth.Standard.Test/Model/CallTranscriptionDetectedLanguageEnumTests.cs
src/Bandwidth.Standard.Test/Model/CallTranscriptionTrackEnumTests.cs
src/Bandwidth.Standard/Api/CallsApi.cs
src/Bandwidth.Standard/Api/ConferencesApi.cs
src/Bandwidth.Standard/Api/MFAApi.cs
Expand Down Expand Up @@ -144,8 +142,10 @@ src/Bandwidth.Standard/Model/CallRecordingMetadata.cs
src/Bandwidth.Standard/Model/CallState.cs
src/Bandwidth.Standard/Model/CallStateEnum.cs
src/Bandwidth.Standard/Model/CallTranscription.cs
src/Bandwidth.Standard/Model/CallTranscriptionDetectedLanguageEnum.cs
src/Bandwidth.Standard/Model/CallTranscriptionMetadata.cs
src/Bandwidth.Standard/Model/CallTranscriptionResponse.cs
src/Bandwidth.Standard/Model/CallTranscriptionTrackEnum.cs
src/Bandwidth.Standard/Model/CallbackMethodEnum.cs
src/Bandwidth.Standard/Model/CodeRequest.cs
src/Bandwidth.Standard/Model/Conference.cs
Expand Down
10 changes: 5 additions & 5 deletions Bandwidth.Standard.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Standard", "src\Bandwidth.Standard\Bandwidth.Standard.csproj", "{C6094E4B-D95D-4E49-8ECE-F2AD1A9044BB}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Standard", "src\Bandwidth.Standard\Bandwidth.Standard.csproj", "{6E2C3915-50F7-4853-B6BA-5191237A5ED8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Standard.Test", "src\Bandwidth.Standard.Test\Bandwidth.Standard.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
EndProject
Expand All @@ -12,10 +12,10 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C6094E4B-D95D-4E49-8ECE-F2AD1A9044BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C6094E4B-D95D-4E49-8ECE-F2AD1A9044BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C6094E4B-D95D-4E49-8ECE-F2AD1A9044BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C6094E4B-D95D-4E49-8ECE-F2AD1A9044BB}.Release|Any CPU.Build.0 = Release|Any CPU
{6E2C3915-50F7-4853-B6BA-5191237A5ED8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6E2C3915-50F7-4853-B6BA-5191237A5ED8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E2C3915-50F7-4853-B6BA-5191237A5ED8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E2C3915-50F7-4853-B6BA-5191237A5ED8}.Release|Any CPU.Build.0 = Release|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ Class | Method | HTTP request | Description
- [Model.CallState](docs/CallState.md)
- [Model.CallStateEnum](docs/CallStateEnum.md)
- [Model.CallTranscription](docs/CallTranscription.md)
- [Model.CallTranscriptionDetectedLanguageEnum](docs/CallTranscriptionDetectedLanguageEnum.md)
- [Model.CallTranscriptionMetadata](docs/CallTranscriptionMetadata.md)
- [Model.CallTranscriptionResponse](docs/CallTranscriptionResponse.md)
- [Model.CallTranscriptionTrackEnum](docs/CallTranscriptionTrackEnum.md)
- [Model.CallbackMethodEnum](docs/CallbackMethodEnum.md)
- [Model.CodeRequest](docs/CodeRequest.md)
- [Model.Conference](docs/Conference.md)
Expand Down
39 changes: 22 additions & 17 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6751,6 +6751,21 @@ components:
- async
example: async
type: string
callTranscriptionDetectedLanguageEnum:
description: The detected language for this transcription.
enum:
- en-US
- es-US
- fr-FR
example: en-US
type: string
callTranscriptionTrackEnum:
description: Which `track` this transcription is derived from.
enum:
- inbound
- outbound
example: inbound
type: string
createCall:
properties:
to:
Expand Down Expand Up @@ -7882,17 +7897,17 @@ components:
callTranscriptionResponse:
example:
callId: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85
accountId: "920012"
accountId: "9900000"
transcriptionId: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b
tracks:
- detectedLanguage: en-US
track: inbound
text: Hello World! This is an example.
transcript: Hello World! This is an example.
confidence: 0.9
properties:
accountId:
description: The user account associated with the call.
example: "920012"
example: "9900000"
type: string
callId:
description: The call id associated with the event.
Expand All @@ -7906,7 +7921,7 @@ components:
example:
- detectedLanguage: en-US
track: inbound
text: Hello World! This is an example.
transcript: Hello World! This is an example.
confidence: 0.9
items:
$ref: '#/components/schemas/callTranscription'
Expand All @@ -7915,20 +7930,9 @@ components:
callTranscription:
properties:
detectedLanguage:
description: The detected language for this transcription.
enum:
- en-US
- es-US
- fr-FR
example: en-US
type: string
$ref: '#/components/schemas/callTranscriptionDetectedLanguageEnum'
track:
description: Which `track` this transcription is derived from.
enum:
- inbound
- outbound
example: inbound
type: string
$ref: '#/components/schemas/callTranscriptionTrackEnum'
transcript:
description: The transcription itself.
example: Hello World! This is an example.
Expand Down Expand Up @@ -7967,6 +7971,7 @@ components:
completedTime:
description: The time that the transcription was completed
example: 2022-06-13T18:46:29.715Z
format: date-time
type: string
url:
description: "The URL of the [transcription](#operation/getCallTranscription)"
Expand Down
35 changes: 20 additions & 15 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2131,6 +2131,21 @@ components:
and will include its result.
example: async
callTranscriptionDetectedLanguageEnum:
type: string
enum:
- en-US
- es-US
- fr-FR
description: The detected language for this transcription.
example: en-US
callTranscriptionTrackEnum:
type: string
enum:
- inbound
- outbound
description: Which `track` this transcription is derived from.
example: inbound
createCall:
type: object
required:
Expand Down Expand Up @@ -3265,7 +3280,7 @@ components:
accountId:
type: string
description: The user account associated with the call.
example: '920012'
example: '9900000'
callId:
type: string
description: The call id associated with the event.
Expand All @@ -3281,26 +3296,15 @@ components:
example:
- detectedLanguage: en-US
track: inbound
text: Hello World! This is an example.
transcript: Hello World! This is an example.
confidence: 0.9
callTranscription:
type: object
properties:
detectedLanguage:
type: string
enum:
- en-US
- es-US
- fr-FR
description: The detected language for this transcription.
example: en-US
$ref: '#/components/schemas/callTranscriptionDetectedLanguageEnum'
track:
type: string
enum:
- inbound
- outbound
description: Which `track` this transcription is derived from.
example: inbound
$ref: '#/components/schemas/callTranscriptionTrackEnum'
transcript:
type: string
description: The transcription itself.
Expand All @@ -3327,6 +3331,7 @@ components:
$ref: '#/components/schemas/status'
completedTime:
type: string
format: date-time
description: The time that the transcription was completed
example: '2022-06-13T18:46:29.715Z'
url:
Expand Down
4 changes: 2 additions & 2 deletions docs/CallTranscription.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**DetectedLanguage** | **string** | The detected language for this transcription. | [optional]
**Track** | **string** | Which `track` this transcription is derived from. | [optional]
**DetectedLanguage** | **CallTranscriptionDetectedLanguageEnum** | | [optional]
**Track** | **CallTranscriptionTrackEnum** | | [optional]
**Transcript** | **string** | The transcription itself. | [optional]
**Confidence** | **double** | How confident the transcription engine was in transcribing the associated audio (from `0` to `1`). | [optional]

Expand Down
10 changes: 10 additions & 0 deletions docs/CallTranscriptionDetectedLanguageEnum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Bandwidth.Standard.Model.CallTranscriptionDetectedLanguageEnum
The detected language for this transcription.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

10 changes: 10 additions & 0 deletions docs/CallTranscriptionTrackEnum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Bandwidth.Standard.Model.CallTranscriptionTrackEnum
Which `track` this transcription is derived from.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

2 changes: 1 addition & 1 deletion docs/RecordingTranscriptionMetadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **string** | The unique transcription ID | [optional]
**Status** | **string** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional]
**CompletedTime** | **string** | The time that the transcription was completed | [optional]
**CompletedTime** | **DateTime** | The time that the transcription was completed | [optional]
**Url** | **string** | The URL of the [transcription](#operation/getCallTranscription) | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
6 changes: 3 additions & 3 deletions src/Bandwidth.Standard.Test/Api/RecordingsApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public void GetCallRecordingTest()
transcription: new RecordingTranscriptionMetadata(
id: "t-387bd648-18f3-4823-9d16-746bca0003c9",
status: "completed",
completedTime: "2022-06-13T18:46:29.715Z",
completedTime: DateTime.UtcNow,
url: "https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription"
)
);
Expand Down Expand Up @@ -448,7 +448,7 @@ public void ListAccountCallRecordingsTest()
transcription: new RecordingTranscriptionMetadata(
id: "t-387bd648-18f3-4823-9d16-746bca0003c9",
status: "completed",
completedTime: "2022-06-13T18:46:29.715Z",
completedTime: DateTime.UtcNow,
url: "https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription"
)
);
Expand Down Expand Up @@ -543,7 +543,7 @@ public void ListCallRecordingsTest()
transcription: new RecordingTranscriptionMetadata(
id: "t-387bd648-18f3-4823-9d16-746bca0003c9",
status: "completed",
completedTime: "2022-06-13T18:46:29.715Z",
completedTime: DateTime.UtcNow,
url: "https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription"
)
);
Expand Down
4 changes: 2 additions & 2 deletions src/Bandwidth.Standard.Test/Api/TranscriptionsApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ public void GetRealTimeTranscriptionTest()
string callId = "c-12345";
string transcriptionId = "t-12345";

CallTranscription.DetectedLanguageEnum detectedLanguage = CallTranscription.DetectedLanguageEnum.EnUS;
CallTranscription.TrackEnum track = CallTranscription.TrackEnum.Inbound;
CallTranscriptionDetectedLanguageEnum detectedLanguage = CallTranscriptionDetectedLanguageEnum.EnUS;
CallTranscriptionTrackEnum track = CallTranscriptionTrackEnum.Inbound;

CallTranscription transcription = new CallTranscription(detectedLanguage: detectedLanguage, track: track, transcript: "abc 123 this is a test", confidence: 0.9);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private void CreateCallTranscription()
private void ListRealTimeTranscriptions()
{
// Sleep for 20 seconds
System.Threading.Thread.Sleep(20000);
System.Threading.Thread.Sleep(40000);

List<CallTranscriptionMetadata> callTranscriptions = transcriptionsApiInstance.ListRealTimeTranscriptions(accountId, testCallId);
Assert.NotEmpty(callTranscriptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,11 @@ public void MediaUrlTest()
[Fact]
public void TranscriptionTest()
{
instance.Transcription = new RecordingTranscriptionMetadata("t-123", "complete", "2022-06-13T18:46:29.715Z", "https://test.url/");
System.DateTime dateTime = DateTime.UtcNow;

instance.Transcription = new RecordingTranscriptionMetadata("t-123", "complete", dateTime, "https://test.url/");
Assert.IsType<RecordingTranscriptionMetadata>(instance.Transcription);
Assert.Equal(new RecordingTranscriptionMetadata("t-123", "complete", "2022-06-13T18:46:29.715Z", "https://test.url/"), instance.Transcription);
Assert.Equal(new RecordingTranscriptionMetadata("t-123", "complete", dateTime, "https://test.url/"), instance.Transcription);
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Bandwidth
*
* Bandwidth's Communication APIs
*
* The version of the OpenAPI document: 1.0.0
* Contact: [email protected]
* Generated by: https://github.com/openapitools/openapi-generator.git
*/


using Xunit;

using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Bandwidth.Standard.Model;
using Bandwidth.Standard.Client;
using System.Reflection;
using Newtonsoft.Json;

namespace Bandwidth.Standard.Test.Model
{
/// <summary>
/// Class for testing CallTranscriptionDetectedLanguageEnum
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class CallTranscriptionDetectedLanguageEnumTests : IDisposable
{
// TODO uncomment below to declare an instance variable for CallTranscriptionDetectedLanguageEnum
//private CallTranscriptionDetectedLanguageEnum instance;

public CallTranscriptionDetectedLanguageEnumTests()
{
// TODO uncomment below to create an instance of CallTranscriptionDetectedLanguageEnum
//instance = new CallTranscriptionDetectedLanguageEnum();
}

public void Dispose()
{
// Cleanup when everything is done.
}

/// <summary>
/// Test an instance of CallTranscriptionDetectedLanguageEnum
/// </summary>
[Fact]
public void CallTranscriptionDetectedLanguageEnumInstanceTest()
{
// TODO uncomment below to test "IsType" CallTranscriptionDetectedLanguageEnum
//Assert.IsType<CallTranscriptionDetectedLanguageEnum>(instance);
}
}
}
Loading

0 comments on commit 28a1789

Please sign in to comment.