Skip to content

Commit 596d8d0

Browse files
committed
Deploy
1 parent f1de74d commit 596d8d0

File tree

6 files changed

+272
-24
lines changed

6 files changed

+272
-24
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<project><modelVersion>4.0.0</modelVersion><groupId>com.bandwidth.sdk</groupId><artifactId>bandwidth-sdk</artifactId><version>3.3.0</version><packaging>jar</packaging><name>BandwidthLib</name><build><pluginManagement><plugins><plugin><groupId>org.eclipse.m2e</groupId><artifactId>lifecycle-mapping</artifactId><version>1.0.0</version><configuration><lifecycleMappingMetadata><pluginExecutions><pluginExecution><pluginExecutionFilter><groupId>org.apache.maven.plugins</groupId><artifactId>maven-enforcer-plugin</artifactId><versionRange>[2.0.0,)</versionRange><goals><goal>enforce</goal></goals></pluginExecutionFilter><action><execute><runOnIncremental>true</runOnIncremental></execute></action></pluginExecution></pluginExecutions></lifecycleMappingMetadata></configuration></plugin></plugins></pluginManagement><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-enforcer-plugin</artifactId><version>3.0.0-M2</version><executions><execution><id>enforce-versions</id><goals><goal>enforce</goal></goals><configuration><fail>true</fail><rules><requireJavaVersion><version>1.8</version></requireJavaVersion></rules></configuration></execution></executions></plugin><plugin><artifactId>maven-assembly-plugin</artifactId><configuration><descriptorRefs><descriptorRef>jar-with-dependencies</descriptorRef></descriptorRefs><appendAssemblyId>false</appendAssemblyId></configuration></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-source-plugin</artifactId><version>3.1.0</version><executions><execution><id>attach-sources</id><goals><goal>jar</goal></goals></execution></executions></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-gpg-plugin</artifactId><version>1.5</version><executions><execution><id>sign-artifacts</id><phase>verify</phase><goals><goal>sign</goal></goals></execution></executions></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-javadoc-plugin</artifactId><version>3.1.1</version><configuration><failOnError>false</failOnError></configuration><executions><execution><id>attach-javadocs</id><goals><goal>jar</goal></goals></execution></executions></plugin><plugin><groupId>org.sonatype.plugins</groupId><artifactId>nexus-staging-maven-plugin</artifactId><version>1.6.2</version><extensions>true</extensions><configuration><serverId>ossrh</serverId><nexusUrl>https://oss.sonatype.org/</nexusUrl><autoReleaseAfterClose>true</autoReleaseAfterClose></configuration></plugin></plugins></build><properties><jackson.version>2.9.10</jackson.version><jackson.databind.version>2.9.10.4</jackson.databind.version><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><dependencies><dependency><groupId>javax.xml.bind</groupId><artifactId>jaxb-api</artifactId><version>2.3.0</version></dependency><dependency><groupId>com.sun.xml.bind</groupId><artifactId>jaxb-core</artifactId><version>2.3.0</version></dependency><dependency><groupId>com.sun.xml.bind</groupId><artifactId>jaxb-impl</artifactId><version>2.3.0</version></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>1.18.8</version></dependency><dependency><groupId>com.squareup.okhttp3</groupId><artifactId>okhttp</artifactId><version>3.12.1</version></dependency><dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-databind</artifactId><version>${jackson.databind.version}</version></dependency><dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-core</artifactId><version>${jackson.version}</version></dependency><dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-annotations</artifactId><version>${jackson.version}</version></dependency></dependencies><distributionManagement><snapshotRepository><id>ossrh</id><url>https://oss.sonatype.org/content/repositories/snapshots</url></snapshotRepository><repository><id>ossrh</id><url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url></repository></distributionManagement><parent><groupId>org.sonatype.oss</groupId><artifactId>oss-parent</artifactId><version>7</version></parent><licenses><license><name>Apache License, Version 2.0</name><url>http://www.apache.org/licenses/LICENSE-2.0.txt</url><distribution>repo</distribution></license></licenses><scm><url>https://github.com/Bandwidth/java-sdk</url><connection>scm:git:git@github.com:Bandwidth/java-sdk.git</connection><developerConnection>scm:git:git@github.com:Bandwidth/java-sdk.git</developerConnection></scm><developers><developer><id>support</id><name>Bandwidth Support</name><email>info@bandwidth.com</email><organization>Bandwidth, Inc.</organization><organizationUrl>http://bandwidth.com</organizationUrl><timezone>-5</timezone></developer></developers></project>
1+
<project><modelVersion>4.0.0</modelVersion><groupId>com.bandwidth.sdk</groupId><artifactId>bandwidth-sdk</artifactId><version>3.4.0</version><packaging>jar</packaging><name>BandwidthLib</name><build><pluginManagement><plugins><plugin><groupId>org.eclipse.m2e</groupId><artifactId>lifecycle-mapping</artifactId><version>1.0.0</version><configuration><lifecycleMappingMetadata><pluginExecutions><pluginExecution><pluginExecutionFilter><groupId>org.apache.maven.plugins</groupId><artifactId>maven-enforcer-plugin</artifactId><versionRange>[2.0.0,)</versionRange><goals><goal>enforce</goal></goals></pluginExecutionFilter><action><execute><runOnIncremental>true</runOnIncremental></execute></action></pluginExecution></pluginExecutions></lifecycleMappingMetadata></configuration></plugin></plugins></pluginManagement><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-enforcer-plugin</artifactId><version>3.0.0-M2</version><executions><execution><id>enforce-versions</id><goals><goal>enforce</goal></goals><configuration><fail>true</fail><rules><requireJavaVersion><version>1.8</version></requireJavaVersion></rules></configuration></execution></executions></plugin><plugin><artifactId>maven-assembly-plugin</artifactId><configuration><descriptorRefs><descriptorRef>jar-with-dependencies</descriptorRef></descriptorRefs><appendAssemblyId>false</appendAssemblyId></configuration></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-source-plugin</artifactId><version>3.1.0</version><executions><execution><id>attach-sources</id><goals><goal>jar</goal></goals></execution></executions></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-gpg-plugin</artifactId><version>1.5</version><executions><execution><id>sign-artifacts</id><phase>verify</phase><goals><goal>sign</goal></goals></execution></executions></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-javadoc-plugin</artifactId><version>3.1.1</version><configuration><failOnError>false</failOnError></configuration><executions><execution><id>attach-javadocs</id><goals><goal>jar</goal></goals></execution></executions></plugin><plugin><groupId>org.sonatype.plugins</groupId><artifactId>nexus-staging-maven-plugin</artifactId><version>1.6.2</version><extensions>true</extensions><configuration><serverId>ossrh</serverId><nexusUrl>https://oss.sonatype.org/</nexusUrl><autoReleaseAfterClose>true</autoReleaseAfterClose></configuration></plugin></plugins></build><properties><jackson.version>2.9.10</jackson.version><jackson.databind.version>2.9.10.4</jackson.databind.version><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><dependencies><dependency><groupId>javax.xml.bind</groupId><artifactId>jaxb-api</artifactId><version>2.3.0</version></dependency><dependency><groupId>com.sun.xml.bind</groupId><artifactId>jaxb-core</artifactId><version>2.3.0</version></dependency><dependency><groupId>com.sun.xml.bind</groupId><artifactId>jaxb-impl</artifactId><version>2.3.0</version></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>1.18.8</version></dependency><dependency><groupId>com.squareup.okhttp3</groupId><artifactId>okhttp</artifactId><version>3.12.1</version></dependency><dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-databind</artifactId><version>${jackson.databind.version}</version></dependency><dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-core</artifactId><version>${jackson.version}</version></dependency><dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-annotations</artifactId><version>${jackson.version}</version></dependency></dependencies><distributionManagement><snapshotRepository><id>ossrh</id><url>https://oss.sonatype.org/content/repositories/snapshots</url></snapshotRepository><repository><id>ossrh</id><url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url></repository></distributionManagement><parent><groupId>org.sonatype.oss</groupId><artifactId>oss-parent</artifactId><version>7</version></parent><licenses><license><name>Apache License, Version 2.0</name><url>http://www.apache.org/licenses/LICENSE-2.0.txt</url><distribution>repo</distribution></license></licenses><scm><url>https://github.com/Bandwidth/java-sdk</url><connection>scm:git:git@github.com:Bandwidth/java-sdk.git</connection><developerConnection>scm:git:git@github.com:Bandwidth/java-sdk.git</developerConnection></scm><developers><developer><id>support</id><name>Bandwidth Support</name><email>info@bandwidth.com</email><organization>Bandwidth, Inc.</organization><organizationUrl>http://bandwidth.com</organizationUrl><timezone>-5</timezone></developer></developers></project>

src/main/java/com/bandwidth/controllers/BaseController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public abstract class BaseController {
2929
* Protected variables to hold an instance of Configuration
3030
*/
3131
protected final Configuration config;
32-
protected static final String userAgent = "java-sdk-refs/tags/java3.3.0";
32+
protected static final String userAgent = "java-sdk-refs/tags/java3.4.0";
3333

3434

3535
protected Map<String, AuthManager> authManagers;

src/main/java/com/bandwidth/twofactorauth/controllers/APIController.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.bandwidth.http.response.HttpResponse;
2424
import com.bandwidth.http.response.HttpStringResponse;
2525
import com.bandwidth.Server;
26+
import com.bandwidth.twofactorauth.exceptions.InvalidRequestException;
2627
import com.bandwidth.twofactorauth.models.TwoFactorCodeRequestSchema;
2728
import com.bandwidth.twofactorauth.models.TwoFactorMessagingResponse;
2829
import com.bandwidth.twofactorauth.models.TwoFactorVerifyCodeResponse;
@@ -118,6 +119,12 @@ private ApiResponse<TwoFactorVoiceResponse> handleCreateVoiceTwoFactorResponse(H
118119
throws ApiException, IOException {
119120
HttpResponse response = context.getResponse();
120121

122+
//Error handling using HTTP status codes
123+
int responseCode = response.getStatusCode();
124+
125+
if (responseCode == 400) {
126+
throw new InvalidRequestException("client request error", context);
127+
}
121128
//handle errors defined at the API level
122129
validateResponse(response, context);
123130

@@ -202,6 +209,12 @@ private ApiResponse<TwoFactorMessagingResponse> handleCreateMessagingTwoFactorRe
202209
throws ApiException, IOException {
203210
HttpResponse response = context.getResponse();
204211

212+
//Error handling using HTTP status codes
213+
int responseCode = response.getStatusCode();
214+
215+
if (responseCode == 400) {
216+
throw new InvalidRequestException("client request error", context);
217+
}
205218
//handle errors defined at the API level
206219
validateResponse(response, context);
207220

@@ -286,6 +299,12 @@ private ApiResponse<TwoFactorVerifyCodeResponse> handleCreateVerifyTwoFactorResp
286299
throws ApiException, IOException {
287300
HttpResponse response = context.getResponse();
288301

302+
//Error handling using HTTP status codes
303+
int responseCode = response.getStatusCode();
304+
305+
if (responseCode == 400) {
306+
throw new InvalidRequestException("client request error", context);
307+
}
289308
//handle errors defined at the API level
290309
validateResponse(response, context);
291310

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* BandwidthLib
3+
*
4+
* This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
5+
*/
6+
package com.bandwidth.twofactorauth.exceptions;
7+
8+
import com.fasterxml.jackson.annotation.JsonGetter;
9+
import com.fasterxml.jackson.annotation.JsonSetter;
10+
import com.bandwidth.http.client.HttpContext;
11+
import com.bandwidth.exceptions.ApiException;
12+
13+
14+
/**
15+
* This is a model class for InvalidRequestException type.
16+
*/
17+
public class InvalidRequestException
18+
extends ApiException {
19+
private static final long serialVersionUID = 21000398260607192L;
20+
/**
21+
* Initialization constructor
22+
* @param reason The reason for throwing exception
23+
* @param context The http context of the API exception
24+
*/
25+
public InvalidRequestException(String reason, HttpContext context) {
26+
super(reason, context);
27+
}
28+
29+
private String result;
30+
/**
31+
* Getter for Result.
32+
* An error message pertaining to what the issue could be
33+
*/
34+
@JsonGetter("result")
35+
public String getResult() {
36+
return this.result;
37+
}
38+
/**
39+
* Setter for Result.
40+
* An error message pertaining to what the issue could be
41+
*/
42+
@JsonSetter("result")
43+
private void setResult(String value) {
44+
this.result = value;
45+
}
46+
47+
48+
49+
}

0 commit comments

Comments
 (0)