Skip to content

Commit d5706b9

Browse files
Merge pull request #78 from Bandwidth/DX-3178
DX-3178, DX-3179, DX-3180 Refactored All BXML Verbs
2 parents bed370b + 3e1ed6f commit d5706b9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+3492
-59
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v2
2222
- name: Set up Apache Maven Central
23-
uses: actions/setup-java@v2
23+
uses: actions/setup-java@v3
2424
with:
2525
distribution: 'adopt'
2626
java-version: '11'

.github/workflows/maven.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
java: [ '8' ]
20+
java: [ '11' ]
2121
steps:
2222
- uses: actions/checkout@v2
2323
- name: Set up JDK
24-
uses: actions/setup-java@v2
24+
uses: actions/setup-java@v3
2525
with:
2626
java-version: ${{ matrix.java }}
2727
distribution: 'temurin'

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: [windows-2022, windows-2019, ubuntu-18.04, ubuntu-20.04]
15-
java-version: ['8', '11']
15+
java-version: ['11',' 17', '19']
1616
distribution: ['zulu', 'temurin']
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@v2
2020

2121
- name: Set up JDK
22-
uses: actions/setup-java@v2
22+
uses: actions/setup-java@v3
2323
with:
2424
distribution: ${{ matrix.distribution }}
2525
java-version: ${{ matrix.java-version }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ hs_err_pid*
2424
target
2525
.gradle
2626
build
27+
.vscode/settings.json

.settings/org.eclipse.jdt.core.prefs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
4242
org.eclipse.jdt.core.compiler.codegen.lambda.genericSignature=do not generate
4343
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4444
org.eclipse.jdt.core.compiler.codegen.shareCommonFinallyBlocks=disabled
45-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
45+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
4646
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
47-
org.eclipse.jdt.core.compiler.compliance=1.8
47+
org.eclipse.jdt.core.compiler.compliance=11
4848
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
4949
org.eclipse.jdt.core.compiler.debug.localVariable=generate
5050
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -167,9 +167,9 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeArgumentsForMethodInvocation=war
167167
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
168168
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
169169
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
170-
org.eclipse.jdt.core.compiler.processAnnotations=disabled
171-
org.eclipse.jdt.core.compiler.release=disabled
172-
org.eclipse.jdt.core.compiler.source=1.8
170+
org.eclipse.jdt.core.compiler.processAnnotations=enabled
171+
org.eclipse.jdt.core.compiler.release=enabled
172+
org.eclipse.jdt.core.compiler.source=11
173173
org.eclipse.jdt.core.compiler.storeAnnotations=disabled
174174
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
175175
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL

pom.xml

Lines changed: 83 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.bandwidth.sdk</groupId>
55
<artifactId>bandwidth-sdk</artifactId>
@@ -33,39 +33,43 @@
3333

3434
<build>
3535
<plugins>
36-
<plugin>
36+
<plugin>
3737
<groupId>org.apache.maven.plugins</groupId>
3838
<artifactId>maven-compiler-plugin</artifactId>
39-
<version>3.8.1</version>
39+
<version>3.10.1</version>
4040
<configuration>
4141
<fork>true</fork>
4242
<meminitial>128m</meminitial>
4343
<maxmem>512m</maxmem>
4444
<compilerArgs>
4545
<arg>-Xlint:all</arg>
46-
<arg>-J-Xss4m</arg><!-- Compiling the generated JSON.java file may require larger stack size. -->
46+
<arg>-J-Xss4m</arg> <!-- Compiling the generated JSON.java file may require larger stack size. -->
4747
</compilerArgs>
48+
<forceJavacCompilerUse>true</forceJavacCompilerUse>
49+
<release>${java.version}</release>
50+
<source>${java.version}</source>
51+
<target>${java.version}</target>
4852
</configuration>
4953
</plugin>
5054
<plugin>
5155
<groupId>org.apache.maven.plugins</groupId>
5256
<artifactId>maven-enforcer-plugin</artifactId>
53-
<version>3.0.0</version>
57+
<version>3.1.0</version>
5458
<executions>
5559
<execution>
5660
<id>enforce-maven</id>
5761
<goals>
5862
<goal>enforce</goal>
5963
</goals>
60-
<configuration>
61-
<rules>
62-
<requireMavenVersion>
63-
<version>2.2.0</version>
64-
</requireMavenVersion>
65-
</rules>
66-
</configuration>
6764
</execution>
6865
</executions>
66+
<configuration>
67+
<rules>
68+
<requireMavenVersion>
69+
<version>3.8.6</version>
70+
</requireMavenVersion>
71+
</rules>
72+
</configuration>
6973
</plugin>
7074
<plugin>
7175
<groupId>org.apache.maven.plugins</groupId>
@@ -192,42 +196,42 @@
192196
Ref: https://github.com/diffplug/spotless/tree/main/plugin-maven
193197
-->
194198
<plugin>
195-
<groupId>com.diffplug.spotless</groupId>
196-
<artifactId>spotless-maven-plugin</artifactId>
197-
<version>${spotless.version}</version>
198-
<configuration>
199-
<formats>
200-
<!-- you can define as many formats as you want, each is independent -->
201-
<format>
202-
<!-- define the files to apply to -->
203-
<includes>
204-
<include>.gitignore</include>
205-
</includes>
206-
<!-- define the steps to apply to those files -->
207-
<trimTrailingWhitespace/>
208-
<endWithNewline/>
209-
<indent>
210-
<spaces>true</spaces> <!-- or <tabs>true</tabs> -->
211-
<spacesPerTab>4</spacesPerTab> <!-- optional, default is 4 -->
212-
</indent>
213-
</format>
214-
</formats>
215-
<!-- define a language-specific format -->
216-
<java>
217-
<!-- no need to specify files, inferred automatically, but you can if you want -->
199+
<groupId>com.diffplug.spotless</groupId>
200+
<artifactId>spotless-maven-plugin</artifactId>
201+
<version>${spotless.version}</version>
202+
<configuration>
203+
<formats>
204+
<!-- you can define as many formats as you want, each is independent -->
205+
<format>
206+
<!-- define the files to apply to -->
207+
<includes>
208+
<include>.gitignore</include>
209+
</includes>
210+
<!-- define the steps to apply to those files -->
211+
<trimTrailingWhitespace/>
212+
<endWithNewline/>
213+
<indent>
214+
<spaces>true</spaces> <!-- or <tabs>true</tabs> -->
215+
<spacesPerTab>4</spacesPerTab> <!-- optional, default is 4 -->
216+
</indent>
217+
</format>
218+
</formats>
219+
<!-- define a language-specific format -->
220+
<java>
221+
<!-- no need to specify files, inferred automatically, but you can if you want -->
218222

219-
<!-- apply a specific flavor of google-java-format and reflow long strings -->
220-
<googleJavaFormat>
221-
<version>1.8</version>
222-
<style>AOSP</style>
223-
<reflowLongStrings>true</reflowLongStrings>
224-
</googleJavaFormat>
223+
<!-- apply a specific flavor of google-java-format and reflow long strings -->
224+
<googleJavaFormat>
225+
<version>1.8</version>
226+
<style>AOSP</style>
227+
<reflowLongStrings>true</reflowLongStrings>
228+
</googleJavaFormat>
225229

226-
<removeUnusedImports/>
227-
<importOrder/>
230+
<removeUnusedImports/>
231+
<importOrder/>
228232

229-
</java>
230-
</configuration>
233+
</java>
234+
</configuration>
231235
</plugin>
232236
</plugins>
233237
</build>
@@ -257,13 +261,32 @@
257261
</profiles>
258262

259263
<dependencies>
260-
264+
<dependency>
265+
<groupId>org.glassfish.jaxb</groupId>
266+
<artifactId>jaxb-core</artifactId>
267+
<version>${jaxb.version}</version>
268+
</dependency>
269+
<dependency>
270+
<groupId>org.glassfish.jaxb</groupId>
271+
<artifactId>jaxb-runtime</artifactId>
272+
<version>${jaxb.version}</version>
273+
</dependency>
274+
<dependency>
275+
<groupId>org.projectlombok</groupId>
276+
<artifactId>lombok</artifactId>
277+
<version>1.18.24</version>
278+
<scope>provided</scope>
279+
</dependency>
280+
<dependency>
281+
<groupId>jakarta.xml.bind</groupId>
282+
<artifactId>jakarta.xml.bind-api</artifactId>
283+
<version>${jaxb.version}</version>
284+
</dependency>
261285
<dependency>
262286
<groupId>org.hamcrest</groupId>
263287
<artifactId>hamcrest</artifactId>
264288
<version>2.2</version>
265289
</dependency>
266-
267290
<dependency>
268291
<groupId>io.swagger</groupId>
269292
<artifactId>swagger-annotations</artifactId>
@@ -342,14 +365,15 @@
342365
</dependency>
343366
</dependencies>
344367
<properties>
345-
<java.version>1.8</java.version>
368+
<java.version>11</java.version>
346369
<maven.compiler.source>${java.version}</maven.compiler.source>
347370
<maven.compiler.target>${java.version}</maven.compiler.target>
348371
<gson-fire-version>1.8.5</gson-fire-version>
349372
<swagger-core-version>1.6.5</swagger-core-version>
350373
<okhttp-version>4.9.3</okhttp-version>
351374
<gson-version>2.9.0</gson-version>
352375
<commons-lang3-version>3.12.0</commons-lang3-version>
376+
<jaxb.version>4.0.0</jaxb.version>
353377
<jackson-databind-nullable-version>0.2.3</jackson-databind-nullable-version>
354378
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
355379
<junit-version>5.8.2</junit-version>
@@ -360,4 +384,14 @@
360384
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
361385
<spotless.version>2.21.0</spotless.version>
362386
</properties>
387+
<dependencyManagement>
388+
<dependencies>
389+
<dependency>
390+
<groupId>org.projectlombok</groupId>
391+
<artifactId>lombok</artifactId>
392+
<version>1.18.24</version>
393+
<scope>provided</scope>
394+
</dependency>
395+
</dependencies>
396+
</dependencyManagement>
363397
</project>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package org.openapitools.client.model;
2+
3+
import static java.util.function.Function.identity;
4+
import static java.util.stream.Collectors.toMap;
5+
6+
import com.fasterxml.jackson.annotation.JsonCreator;
7+
import java.util.Arrays;
8+
import java.util.Map;
9+
import lombok.Getter;
10+
11+
@Getter
12+
public enum DiversionReason {
13+
AWAY("away"),
14+
DEFLECTION("deflection"),
15+
DO_NOT_DISTURB("do-not-disturb"),
16+
FOLLOW_ME("follow-me"),
17+
NO_ANSWER("no-answer"),
18+
OUT_OF_SERVICE("out-of-service"),
19+
TIME_OF_DAY("time-of-day"),
20+
UNAVAILABLE("unavailable"),
21+
UNCONDITIONAL("unconditional"),
22+
UNKNOWN("unknown"),
23+
USER_BUSY("user-busy"),
24+
;
25+
26+
private static final Map<String, DiversionReason> DESERIALIZATION_MAP =
27+
Arrays.stream(values())
28+
.collect(toMap(v -> v.name, identity()));
29+
30+
private final String name;
31+
32+
DiversionReason(String name) {
33+
this.name = name;
34+
}
35+
36+
@JsonCreator
37+
public static DiversionReason resolve(String name) {
38+
return DESERIALIZATION_MAP.get(name.toLowerCase());
39+
}
40+
41+
@Override
42+
public String toString() {
43+
return name;
44+
}
45+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package org.openapitools.client.model;
2+
3+
import static java.util.function.Function.identity;
4+
import static java.util.stream.Collectors.toMap;
5+
6+
import com.fasterxml.jackson.annotation.JsonCreator;
7+
import java.util.Arrays;
8+
import java.util.Map;
9+
import lombok.Getter;
10+
11+
@Getter
12+
public enum DiversionTreatment {
13+
NONE("none"),
14+
PROPAGATE("propagate"),
15+
STACK("stack"),
16+
;
17+
18+
private static final Map<String, DiversionTreatment> DESERIALIZATION_MAP =
19+
Arrays.stream(values())
20+
.collect(toMap(v -> v.name, identity()));
21+
22+
private final String name;
23+
24+
DiversionTreatment(String name) {
25+
this.name = name;
26+
}
27+
28+
@JsonCreator
29+
public static DiversionTreatment resolve(String name) {
30+
return DESERIALIZATION_MAP.get(name.toLowerCase());
31+
}
32+
33+
@Override
34+
public String toString() {
35+
return name;
36+
}
37+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.openapitools.client.model.bxml;
2+
3+
import com.fasterxml.jackson.annotation.JsonSubTypes;
4+
import com.fasterxml.jackson.annotation.JsonTypeInfo;
5+
6+
/**
7+
* A marker interface for BXML verbs that process audio output. The class annotations describe how
8+
* Jackson should serialize and deserialize verbs.
9+
*/
10+
@JsonSubTypes({
11+
@JsonSubTypes.Type(value = PlayAudio.class, name = PlayAudio.TYPE_NAME),
12+
@JsonSubTypes.Type(value = SpeakSentence.class, name = SpeakSentence.TYPE_NAME),
13+
})
14+
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "name")
15+
public interface AudioProducer extends Verb {
16+
}

0 commit comments

Comments
 (0)