Skip to content

Commit

Permalink
SWI-5869 Update SDK Based on Recent Spec Changes (#149)
Browse files Browse the repository at this point in the history
* Generate SDK with OpenAPI Generator Version 7.6.0

* update test workflows

* skip tests

* move tests

* fix test

* no smoke tests for now

* build?

* disable smoke

* pls build

* update workflows and gitignore

* fix unit test package

* first unit tests

* test fixes

* regenerate tests

* fixes to smoke tests

* write a bunch of unit tests

* update workflows

* fix CallCleanup

* update types and lots more unit tests

* remove unused import

* final unit tests

* update bxml tests

* fix smoke tests

* update transcriptions tests

* bring back smoke tests

* remove matrix from smoke tests

* use java 21 for tests

* calls api unit tests

* add other api unit tests

* test formatting

* switch from ArrayList to List

* run prism in unit test wf

* try a sleep because windows 19 is trash

* use bash

* SWI-5869 BXML Library Updates (#151)

* move @params to avoid warnings hopefully

* bxml formatting changes

* add wf dispatch to test wf

* not only on main

* fix javadoc warnings

* formatting

* on main only

---------

Co-authored-by: DX-Bandwidth <dx@bandwidth.com>
Co-authored-by: ckoegel <ckoegel1006@gmail.com>
Co-authored-by: Cameron Koegel <53310569+ckoegel@users.noreply.github.com>
  • Loading branch information
4 people authored Aug 16, 2024
1 parent c53212a commit 86964de
Show file tree
Hide file tree
Showing 205 changed files with 5,176 additions and 3,687 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Test PR

on:
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true


env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }}
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }}
BW_NUMBER: ${{ secrets.BW_NUMBER }}
USER_NUMBER: ${{ secrets.USER_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }}
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }}
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }}
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }}
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }}
ATT_NUMBER: ${{ secrets.ATT_NUMBER }}
T_MOBILE_NUMBER: ${{ secrets.T_MOBILE_NUMBER }}
VZW_NUMBER: ${{ secrets.VZW_NUMBER }}

jobs:
test:
name: Test PR
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
java-version: ["11", "17", "21"]
distribution: ["zulu", "temurin"]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java-version }}

- name: Build Package and Test
env:
JAVA_VERSION: ${{ matrix.java-version }}
RUNNER_OS: ${{ matrix.os }}
OPERATING_SYSTEM: ${{ matrix.os }}
DISTRIBUTION: ${{ matrix.distribution }}
run: |
mvn -B package --file pom.xml -DskipTests
npm install -g @stoplight/prism-cli
prism mock ./bandwidth.yml & (sleep 3; mvn test -Punit-tests)
shell: bash
71 changes: 71 additions & 0 deletions .github/workflows/test-smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Smoke Test

on:
schedule:
- cron: "0 4 * * *"
pull_request:
branches:
- main
paths:
- "src/test/java/com/bandwidth/sdk/smoke/*"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }}
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }}
BW_NUMBER: ${{ secrets.BW_NUMBER }}
USER_NUMBER: ${{ secrets.USER_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }}
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }}
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }}
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }}
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }}
ATT_NUMBER: ${{ secrets.ATT_NUMBER }}
T_MOBILE_NUMBER: ${{ secrets.T_MOBILE_NUMBER }}
VZW_NUMBER: ${{ secrets.VZW_NUMBER }}

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21

- name: Build Package and Test
env:
JAVA_VERSION: 21
RUNNER_OS: ubuntu-latest
OPERATING_SYSTEM: ubuntu-latest
DISTRIBUTION: zulu
run: |
mvn -B package --file pom.xml -DskipTests
mvn test -Psmoke-tests
shell: bash

notify_for_failures:
name: Notify for Failures
needs: [test]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Notify Slack of Failures
uses: Bandwidth/build-notify-slack-action@v2.0.0
with:
job-status: failure
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: ${{ secrets.SLACK_CHANNEL }}
67 changes: 0 additions & 67 deletions .github/workflows/test.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ build

.DS_Store
.idea
.settings
6 changes: 6 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,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 @@ -147,8 +149,10 @@ src/main/java/com/bandwidth/sdk/model/CallRecordingMetadata.java
src/main/java/com/bandwidth/sdk/model/CallState.java
src/main/java/com/bandwidth/sdk/model/CallStateEnum.java
src/main/java/com/bandwidth/sdk/model/CallTranscription.java
src/main/java/com/bandwidth/sdk/model/CallTranscriptionDetectedLanguageEnum.java
src/main/java/com/bandwidth/sdk/model/CallTranscriptionMetadata.java
src/main/java/com/bandwidth/sdk/model/CallTranscriptionResponse.java
src/main/java/com/bandwidth/sdk/model/CallTranscriptionTrackEnum.java
src/main/java/com/bandwidth/sdk/model/CallbackMethodEnum.java
src/main/java/com/bandwidth/sdk/model/CodeRequest.java
src/main/java/com/bandwidth/sdk/model/Conference.java
Expand Down Expand Up @@ -229,3 +233,5 @@ src/main/java/com/bandwidth/sdk/model/VerifyCodeRequest.java
src/main/java/com/bandwidth/sdk/model/VerifyCodeResponse.java
src/main/java/com/bandwidth/sdk/model/VoiceApiError.java
src/main/java/com/bandwidth/sdk/model/VoiceCodeResponse.java
src/test/java/com/bandwidth/sdk/model/CallTranscriptionDetectedLanguageEnumTest.java
src/test/java/com/bandwidth/sdk/model/CallTranscriptionTrackEnumTest.java
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,10 @@ Class | Method | HTTP request | Description
- [CallState](docs/CallState.md)
- [CallStateEnum](docs/CallStateEnum.md)
- [CallTranscription](docs/CallTranscription.md)
- [CallTranscriptionDetectedLanguageEnum](docs/CallTranscriptionDetectedLanguageEnum.md)
- [CallTranscriptionMetadata](docs/CallTranscriptionMetadata.md)
- [CallTranscriptionResponse](docs/CallTranscriptionResponse.md)
- [CallTranscriptionTrackEnum](docs/CallTranscriptionTrackEnum.md)
- [CallbackMethodEnum](docs/CallbackMethodEnum.md)
- [CodeRequest](docs/CodeRequest.md)
- [Conference](docs/Conference.md)
Expand Down
59 changes: 42 additions & 17 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6865,6 +6865,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 @@ -7421,6 +7436,7 @@ components:
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
status: completed
parentCallId: c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d
recordingName: my-recording-name
transferCallerId: "+15555555555"
transferTo: "+15555555555"
duration: PT13.67S
Expand Down Expand Up @@ -7520,6 +7536,10 @@ components:
type: string
transcription:
$ref: '#/components/schemas/recordingTranscriptionMetadata'
recordingName:
description: A name to identify this recording.
example: my-recording-name
type: string
type: object
conference:
example:
Expand Down Expand Up @@ -7731,6 +7751,7 @@ components:
channels: 1
mediaUrl: https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media
conferenceId: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9
recordingName: my-recording-name
name: my-conference-name
startTime: 2022-06-17T22:19:40.375Z
endTime: 2022-06-17T22:20:00Z
Expand Down Expand Up @@ -7793,6 +7814,10 @@ components:
format: uri
nullable: true
type: string
recordingName:
description: A name to identify this recording.
example: my-recording-name
type: string
type: object
machineDetectionConfiguration:
description: "The machine detection request used to perform <a href='/docs/voice/guides/machineDetection'>machine\
Expand Down Expand Up @@ -7976,6 +8001,7 @@ components:
callTranscriptionMetadataList:
example:
- transcriptionId: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b
transcriptionName: live_transcription
transcriptionUrl: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b
items:
$ref: '#/components/schemas/callTranscriptionMetadata'
Expand All @@ -7986,6 +8012,11 @@ components:
description: The programmable voice API transcription ID.
example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b
type: string
transcriptionName:
description: The programmable voice API transcription name. This name could
be provided by the user when creating the transcription.
example: live_transcription
type: string
transcriptionUrl:
description: |-
A URL that may be used to retrieve the transcription itself. This points to the
Expand All @@ -7996,17 +8027,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 @@ -8020,7 +8051,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 @@ -8029,20 +8060,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 @@ -8081,6 +8101,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 Expand Up @@ -9951,6 +9972,10 @@ components:
description: The call id associated with the event.
example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85
type: string
recordingName:
description: A name to identify this recording.
example: my-recording-name
type: string
callUrl:
description: The URL of the call associated with the event.
example: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85
Expand Down
Loading

0 comments on commit 86964de

Please sign in to comment.