Skip to content

Commit

Permalink
Merge pull request #124 from Bandwidth/SWI-4902
Browse files Browse the repository at this point in the history
SWI-4902 Enum updates
  • Loading branch information
brianluisgomez authored Mar 28, 2024
2 parents b6ec57b + 9378ca7 commit 23b1304
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 35 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.bandwidth.sdk</groupId>
<artifactId>bandwidth-sdk</artifactId>
<version>9.1.3</version>
<version>9.1.4</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -56,7 +56,7 @@ Add this dependency to your project's build file:
}
dependencies {
implementation "com.bandwidth.sdk:bandwidth-sdk:9.1.3"
implementation "com.bandwidth.sdk:bandwidth-sdk:9.1.4"
}
```

Expand All @@ -70,7 +70,7 @@ mvn clean package

Then manually install the following JARs:

* `target/bandwidth-sdk-9.1.3.jar`
* `target/bandwidth-sdk-9.1.4.jar`
* `target/lib/*.jar`

## Getting Started
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'java'
apply plugin: 'com.diffplug.spotless'

group = 'com.bandwidth.sdk'
version = '9.1.3'
version = '9.1.4'

buildscript {
repositories {
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
settings(
organization := "com.bandwidth.sdk",
name := "bandwidth-sdk",
version := "9.1.3",
version := "9.1.4",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
javacOptions in compile ++= Seq("-Xlint:deprecation"),
Expand Down
2 changes: 1 addition & 1 deletion openapi-config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
artifactId: bandwidth-sdk
artifactVersion: 9.1.3
artifactVersion: 9.1.4
artifactDescription: The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs
artifactUrl: https://github.com/Bandwidth/java-sdk
developerEmail: [email protected]
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>bandwidth-sdk</artifactId>
<packaging>jar</packaging>
<name>bandwidth-sdk</name>
<version>9.1.3</version>
<version>9.1.4</version>
<url>https://github.com/Bandwidth/java-sdk</url>
<description>The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs</description>
<scm>
Expand Down Expand Up @@ -89,7 +89,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>3.2.5</version>
<configuration>
<systemProperties>
<property>
Expand Down Expand Up @@ -409,7 +409,7 @@
<jackson-databind-nullable-version>0.2.3</jackson-databind-nullable-version>
<jakarta-annotation-version>
1.3.5</jakarta-annotation-version>
<junit-version>5.8.2</junit-version>
<junit-version>5.9.1</junit-version>
<junit-platform-runner.version>1.6.2</junit-platform-runner.version>
<mockito-core-version>
3.12.4</mockito-core-version>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/bandwidth/sdk/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private void init() {
json = new JSON();

// Set default User-Agent.
setUserAgent("OpenAPI-Generator/9.1.3/java");
setUserAgent("OpenAPI-Generator/9.1.4/java");

authentications = new HashMap<String, Authentication>();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/bandwidth/sdk/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class Configuration {
public static final String VERSION = "9.1.3";
public static final String VERSION = "9.1.4";

private static ApiClient defaultApiClient = new ApiClient();

Expand Down
22 changes: 11 additions & 11 deletions src/main/java/com/bandwidth/sdk/model/DiversionReason.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@

@Getter
public enum DiversionReason {
AWAY("away"),
DEFLECTION("deflection"),
DO_NOT_DISTURB("do-not-disturb"),
FOLLOW_ME("follow-me"),
NO_ANSWER("no-answer"),
OUT_OF_SERVICE("out-of-service"),
TIME_OF_DAY("time-of-day"),
UNAVAILABLE("unavailable"),
UNCONDITIONAL("unconditional"),
UNKNOWN("unknown"),
USER_BUSY("user-busy"),
away("away"),
deflection("deflection"),
do_not_disturb("do-not-disturb"),
follow_me("follow-me"),
no_answer("no-answer"),
out_of_service("out-of-service"),
time_of_day("time-of-day"),
unavailable("unavailable"),
unconditional("unconditional"),
unknown("unknown"),
user_busy("user-busy"),
;

private static final Map<String, DiversionReason> DESERIALIZATION_MAP =
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/bandwidth/sdk/model/DiversionTreatment.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

@Getter
public enum DiversionTreatment {
NONE("none"),
PROPAGATE("propagate"),
STACK("stack"),
none("none"),
propagate("propagate"),
stack("stack"),
;

private static final Map<String, DiversionTreatment> DESERIALIZATION_MAP =
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/bandwidth/sdk/model/bxml/Forward.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ public class Forward implements Verb {

@XmlAttribute
@Builder.Default
private DiversionTreatment diversionTreatment = DiversionTreatment.NONE;
private DiversionTreatment diversionTreatment = DiversionTreatment.none;

@XmlAttribute
@Builder.Default
private DiversionReason diversionReason = DiversionReason.UNKNOWN;
private DiversionReason diversionReason = DiversionReason.unknown;

@Override
public String getVerbName() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/bandwidth/sdk/model/bxml/Transfer.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ public class Transfer implements Verb {

@XmlAttribute
@Default
protected DiversionTreatment diversionTreatment = DiversionTreatment.NONE;
protected DiversionTreatment diversionTreatment = DiversionTreatment.none;

@XmlAttribute
@Default
protected DiversionReason diversionReason = DiversionReason.UNKNOWN;
protected DiversionReason diversionReason = DiversionReason.unknown;

@Override
public String getVerbName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ public class ForwardVerbTest {
.to("+19195554321")
.from("19195554322")
.callTimeout(15d)
.diversionTreatment(DiversionTreatment.PROPAGATE)
.diversionReason(DiversionReason.AWAY)
.diversionTreatment(DiversionTreatment.propagate)
.diversionReason(DiversionReason.away)
.uui("93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt")
.build();

@Test
public void forwardVerbWorks() throws JAXBException {
JAXBContext jaxbContext = JAXBContext.newInstance(Bxml.class);
String expectedBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Forward to=\"+19195554321\" from=\"19195554322\" uui=\"93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt\" callTimeout=\"15.0\" diversionTreatment=\"PROPAGATE\" diversionReason=\"AWAY\"/></Bxml>";
String expectedBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Forward to=\"+19195554321\" from=\"19195554322\" uui=\"93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt\" callTimeout=\"15.0\" diversionTreatment=\"propagate\" diversionReason=\"away\"/></Bxml>";

assertThat(new Bxml().with(forward).toBxml(jaxbContext), is(expectedBxml));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class StartTranscriptionVerbTest {
@Test
public void startTranscriptionVerbWorks() throws JAXBException {
JAXBContext jaxbContext = JAXBContext.newInstance(Bxml.class);
String expectedBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><StartTranscription name=\"stream1\" tracks=\"INBOUND\" destination=\"testurl.com\" transcriptionEventUrl=\"eventurl.com\" transcriptionEventMethod=\"POST\" username=\"user\" password=\"pass\"><CustomParam name=\"name1\" value=\"value1\"/><CustomParam name=\"name2\" value=\"value2\"/></StartTranscription></Bxml>";
String expectedBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><StartTranscription name=\"test_transcription\" tracks=\"INBOUND\" destination=\"testurl.com\" transcriptionEventUrl=\"eventurl.com\" transcriptionEventMethod=\"POST\" username=\"user\" password=\"pass\"><CustomParam name=\"name1\" value=\"value1\"/><CustomParam name=\"name2\" value=\"value2\"/></StartTranscription></Bxml>";

assertThat(new Bxml().with(startTranscription).toBxml(jaxbContext), is(expectedBxml));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public class TransferVerbTest {
@Test
public void transferVerbWorks() throws JAXBException {
JAXBContext jaxbContext = JAXBContext.newInstance(Bxml.class);
String expectedSipUriBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Transfer transferCallerId=\"+19195554321\" callTimeout=\"15.0\" transferCompleteMethod=\"POST\" transferCompleteFallbackMethod=\"POST\" tag=\"test\" diversionTreatment=\"NONE\" diversionReason=\"UNKNOWN\"><SipUri uui=\"test\" transferAnswerUrl=\"https://example.com/webhooks/transfer_answer\" transferAnswerMethod=\"POST\" transferAnswerFallbackMethod=\"POST\" transferDisconnectMethod=\"POST\" tag=\"test\">[email protected]</SipUri></Transfer></Bxml>";
String expectedPhoneNumberBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Transfer transferCallerId=\"+19195554321\" transferCallerDisplayName=\"Clark Kent\" callTimeout=\"15.0\" transferCompleteMethod=\"POST\" transferCompleteFallbackMethod=\"POST\" tag=\"test\" diversionTreatment=\"NONE\" diversionReason=\"UNKNOWN\"><PhoneNumber transferAnswerUrl=\"https://example.com/webhooks/transfer_answer\" transferAnswerMethod=\"POST\" transferAnswerFallbackMethod=\"POST\" transferDisconnectMethod=\"POST\" tag=\"test\">+19195551234</PhoneNumber></Transfer></Bxml>";
String expectedSipUriBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Transfer transferCallerId=\"+19195554321\" callTimeout=\"15.0\" transferCompleteMethod=\"POST\" transferCompleteFallbackMethod=\"POST\" tag=\"test\" diversionTreatment=\"none\" diversionReason=\"unknown\"><SipUri uui=\"test\" transferAnswerUrl=\"https://example.com/webhooks/transfer_answer\" transferAnswerMethod=\"POST\" transferAnswerFallbackMethod=\"POST\" transferDisconnectMethod=\"POST\" tag=\"test\">[email protected]</SipUri></Transfer></Bxml>";
String expectedPhoneNumberBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Transfer transferCallerId=\"+19195554321\" transferCallerDisplayName=\"Clark Kent\" callTimeout=\"15.0\" transferCompleteMethod=\"POST\" transferCompleteFallbackMethod=\"POST\" tag=\"test\" diversionTreatment=\"none\" diversionReason=\"unknown\"><PhoneNumber transferAnswerUrl=\"https://example.com/webhooks/transfer_answer\" transferAnswerMethod=\"POST\" transferAnswerFallbackMethod=\"POST\" transferDisconnectMethod=\"POST\" tag=\"test\">+19195551234</PhoneNumber></Transfer></Bxml>"; //

assertThat(new Bxml().with(transfer1).toBxml(jaxbContext), is(expectedSipUriBxml));
assertThat(new Bxml().with(transfer2).toBxml(jaxbContext), is(expectedPhoneNumberBxml));
Expand Down

0 comments on commit 23b1304

Please sign in to comment.