From 8f94b5c659337f2cd3d95c4fb759a39120a72b6e Mon Sep 17 00:00:00 2001 From: jmulford-bw Date: Mon, 8 Mar 2021 21:39:37 +0000 Subject: [PATCH 1/5] New deploy --- pom.xml | 94 +----- src/main/java/com/bandwidth/ApiHelper.java | 2 - .../java/com/bandwidth/BandwidthClient.java | 74 ++--- .../java/com/bandwidth/Configuration.java | 6 +- .../java/com/bandwidth/DateTimeHelper.java | 127 +++++++- ... MultiFactorAuthBasicAuthCredentials.java} | 2 +- ...a => MultiFactorAuthBasicAuthManager.java} | 8 +- ...Client.java => MultiFactorAuthClient.java} | 6 +- src/main/java/com/bandwidth/Server.java | 6 +- .../http/request/MultipartFileWrapper.java | 3 + .../http/request/MultipartWrapper.java | 3 + .../bandwidth/internal/OptionalNullable.java | 158 ++++++++++ .../messaging/controllers/APIController.java | 206 ++++++------ ... => MessagingExceptionErrorException.java} | 24 +- .../models/BandwidthCallbackMessage.java | 43 +-- .../messaging/models/BandwidthMessage.java | 85 ++--- .../models/BandwidthMessageItem.java | 78 +++-- .../models/BandwidthMessagesList.java | 22 +- .../messaging/models/DeferredResult.java | 15 +- .../com/bandwidth/messaging/models/Media.java | 292 ++---------------- .../messaging/models/MessageRequest.java | 57 ++-- .../messaging/models/MessagingException.java | 143 +++++++++ .../bandwidth/messaging/models/PageInfo.java | 29 +- .../com/bandwidth/messaging/models/Tag.java | 15 +- .../controllers/MFAController.java | 62 ++-- .../ErrorWithRequestErrorException.java} | 26 +- .../ForbiddenRequestErrorException.java} | 18 +- .../UnauthorizedRequestErrorException.java} | 18 +- .../models/ErrorWithRequest.java | 138 +++++++++ .../models/ForbiddenRequest.java | 101 ++++++ .../models/TwoFactorCodeRequestSchema.java | 55 ++-- .../models/TwoFactorMessagingResponse.java | 10 +- .../models/TwoFactorVerifyCodeResponse.java | 10 +- .../models/TwoFactorVerifyRequestSchema.java | 46 +-- .../models/TwoFactorVoiceResponse.java | 10 +- .../models/UnauthorizedRequest.java | 101 ++++++ .../com/bandwidth/utilities/FileWrapper.java | 3 + .../voice/controllers/APIController.java | 256 +++++++-------- ...va => ApiErrorResponseErrorException.java} | 32 +- .../voice/models/ApiCallResponse.java | 160 +++++----- .../voice/models/ApiCallStateResponse.java | 190 +++++++++--- .../voice/models/ApiCreateCallRequest.java | 143 +++++---- .../voice/models/ApiErrorResponse.java | 170 ++++++++++ .../voice/models/ApiModifyCallRequest.java | 73 +++-- .../models/ApiModifyConferenceRequest.java | 65 ++-- .../models/ApiTranscribeRecordingRequest.java | 43 +-- .../voice/models/ConferenceDetail.java | 57 ++-- .../voice/models/ConferenceMemberDetail.java | 43 +-- .../ConferenceRecordingMetadataResponse.java | 78 +++-- .../models/ModifyCallRecordingState.java | 8 +- .../models/RecordingMetadataResponse.java | 127 ++++---- .../bandwidth/voice/models/Transcript.java | 15 +- .../bandwidth/voice/models/Transcription.java | 29 +- .../voice/models/TranscriptionResponse.java | 8 +- .../webrtc/controllers/APIController.java | 24 +- ...xception.java => ErrorErrorException.java} | 24 +- .../models/AccountsParticipantsResponse.java | 15 +- .../webrtc/models/DeviceApiVersionEnum.java | 75 +++++ .../com/bandwidth/webrtc/models/Error.java | 143 +++++++++ .../bandwidth/webrtc/models/Participant.java | 89 ++++-- .../models/ParticipantSubscription.java | 8 +- .../com/bandwidth/webrtc/models/Session.java | 15 +- .../webrtc/models/Subscriptions.java | 16 +- 63 files changed, 2568 insertions(+), 1434 deletions(-) rename src/main/java/com/bandwidth/{TwoFactorAuthBasicAuthCredentials.java => MultiFactorAuthBasicAuthCredentials.java} (90%) rename src/main/java/com/bandwidth/{TwoFactorAuthBasicAuthManager.java => MultiFactorAuthBasicAuthManager.java} (84%) rename src/main/java/com/bandwidth/{TwoFactorAuthClient.java => MultiFactorAuthClient.java} (78%) create mode 100644 src/main/java/com/bandwidth/internal/OptionalNullable.java rename src/main/java/com/bandwidth/messaging/exceptions/{MessagingException.java => MessagingExceptionErrorException.java} (63%) create mode 100644 src/main/java/com/bandwidth/messaging/models/MessagingException.java rename src/main/java/com/bandwidth/{twofactorauth => multifactorauth}/controllers/MFAController.java (83%) rename src/main/java/com/bandwidth/{twofactorauth/exceptions/ErrorWithRequestException.java => multifactorauth/exceptions/ErrorWithRequestErrorException.java} (64%) rename src/main/java/com/bandwidth/{twofactorauth/exceptions/ForbiddenRequestException.java => multifactorauth/exceptions/ForbiddenRequestErrorException.java} (65%) rename src/main/java/com/bandwidth/{twofactorauth/exceptions/UnauthorizedRequestException.java => multifactorauth/exceptions/UnauthorizedRequestErrorException.java} (64%) create mode 100644 src/main/java/com/bandwidth/multifactorauth/models/ErrorWithRequest.java create mode 100644 src/main/java/com/bandwidth/multifactorauth/models/ForbiddenRequest.java rename src/main/java/com/bandwidth/{twofactorauth => multifactorauth}/models/TwoFactorCodeRequestSchema.java (83%) rename src/main/java/com/bandwidth/{twofactorauth => multifactorauth}/models/TwoFactorMessagingResponse.java (85%) rename src/main/java/com/bandwidth/{twofactorauth => multifactorauth}/models/TwoFactorVerifyCodeResponse.java (85%) rename src/main/java/com/bandwidth/{twofactorauth => multifactorauth}/models/TwoFactorVerifyRequestSchema.java (82%) rename src/main/java/com/bandwidth/{twofactorauth => multifactorauth}/models/TwoFactorVoiceResponse.java (85%) create mode 100644 src/main/java/com/bandwidth/multifactorauth/models/UnauthorizedRequest.java rename src/main/java/com/bandwidth/voice/exceptions/{ApiErrorResponseException.java => ApiErrorResponseErrorException.java} (62%) create mode 100644 src/main/java/com/bandwidth/voice/models/ApiErrorResponse.java rename src/main/java/com/bandwidth/webrtc/exceptions/{ErrorException.java => ErrorErrorException.java} (64%) create mode 100644 src/main/java/com/bandwidth/webrtc/models/DeviceApiVersionEnum.java create mode 100644 src/main/java/com/bandwidth/webrtc/models/Error.java diff --git a/pom.xml b/pom.xml index 26224291..d6b347d4 100644 --- a/pom.xml +++ b/pom.xml @@ -46,6 +46,14 @@ + + org.codehaus.mojo + versions-maven-plugin + 2.5 + + file://${project.basedir}/version-rules.xml + + org.apache.maven.plugins maven-enforcer-plugin @@ -76,55 +84,12 @@ false - - org.apache.maven.plugins - maven-source-plugin - 3.1.0 - - - attach-sources - - jar - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.1.1 - - false - - - - attach-javadocs - - jar - - - - 2.9.10 - 2.9.10.7 + 2.9.10.5 1.8 1.8 UTF-8 @@ -156,7 +121,7 @@ com.squareup.okhttp3 okhttp - 3.12.1 + [3.12, 4.9.1] com.fasterxml.jackson.core @@ -180,41 +145,4 @@ test - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - org.sonatype.oss - oss-parent - 7 - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - https://github.com/Bandwidth/java-sdk - scm:git:git@github.com:Bandwidth/java-sdk.git - scm:git:git@github.com:Bandwidth/java-sdk.git - - - - support - Bandwidth Support - info@bandwidth.com - Bandwidth, Inc. - http://bandwidth.com - -5 - - - + \ No newline at end of file diff --git a/src/main/java/com/bandwidth/ApiHelper.java b/src/main/java/com/bandwidth/ApiHelper.java index ac0067ad..407cb32c 100644 --- a/src/main/java/com/bandwidth/ApiHelper.java +++ b/src/main/java/com/bandwidth/ApiHelper.java @@ -11,7 +11,6 @@ import com.bandwidth.http.request.MultipartWrapper; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; @@ -52,7 +51,6 @@ public class ApiHelper { private static final long serialVersionUID = -174113593500315394L; { configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - setSerializationInclusion(JsonInclude.Include.NON_NULL); configOverride(BigDecimal.class).setFormat( JsonFormat.Value.forShape(JsonFormat.Shape.STRING)); } diff --git a/src/main/java/com/bandwidth/BandwidthClient.java b/src/main/java/com/bandwidth/BandwidthClient.java index e9141b8f..0aa14ba5 100644 --- a/src/main/java/com/bandwidth/BandwidthClient.java +++ b/src/main/java/com/bandwidth/BandwidthClient.java @@ -26,7 +26,7 @@ public final class BandwidthClient implements Configuration { * Private store for clients. */ private MessagingClient messagingClient; - private TwoFactorAuthClient twoFactorAuthClient; + private MultiFactorAuthClient multiFactorAuthClient; private VoiceClient voiceClient; private WebRtcClient webRtcClient; @@ -61,9 +61,9 @@ public final class BandwidthClient implements Configuration { private MessagingBasicAuthManager messagingBasicAuthManager; /** - * TwoFactorAuthBasicAuthManager. + * MultiFactorAuthBasicAuthManager. */ - private TwoFactorAuthBasicAuthManager twoFactorAuthBasicAuthManager; + private MultiFactorAuthBasicAuthManager multiFactorAuthBasicAuthManager; /** * VoiceBasicAuthManager. @@ -88,7 +88,7 @@ public final class BandwidthClient implements Configuration { private BandwidthClient(Environment environment, String baseUrl, HttpClient httpClient, long timeout, ReadonlyHttpClientConfiguration httpClientConfig, String messagingBasicAuthUserName, String messagingBasicAuthPassword, - String twoFactorAuthBasicAuthUserName, String twoFactorAuthBasicAuthPassword, + String multiFactorAuthBasicAuthUserName, String multiFactorAuthBasicAuthPassword, String voiceBasicAuthUserName, String voiceBasicAuthPassword, String webRtcBasicAuthUserName, String webRtcBasicAuthPassword, Map authManagers, HttpCallback httpCallback) { @@ -113,17 +113,17 @@ private BandwidthClient(Environment environment, String baseUrl, HttpClient http this.authManagers.put("messaging", messagingBasicAuthManager); } - if (this.authManagers.containsKey("twoFactorAuth")) { - this.twoFactorAuthBasicAuthManager = - (TwoFactorAuthBasicAuthManager) this.authManagers.get("twoFactorAuth"); + if (this.authManagers.containsKey("multiFactorAuth")) { + this.multiFactorAuthBasicAuthManager = + (MultiFactorAuthBasicAuthManager) this.authManagers.get("multiFactorAuth"); } - if (!this.authManagers.containsKey("twoFactorAuth") - || !getTwoFactorAuthBasicAuthCredentials().equals(twoFactorAuthBasicAuthUserName, - twoFactorAuthBasicAuthPassword)) { - this.twoFactorAuthBasicAuthManager = new TwoFactorAuthBasicAuthManager( - twoFactorAuthBasicAuthUserName, twoFactorAuthBasicAuthPassword); - this.authManagers.put("twoFactorAuth", twoFactorAuthBasicAuthManager); + if (!this.authManagers.containsKey("multiFactorAuth") + || !getMultiFactorAuthBasicAuthCredentials().equals( + multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword)) { + this.multiFactorAuthBasicAuthManager = new MultiFactorAuthBasicAuthManager( + multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword); + this.authManagers.put("multiFactorAuth", multiFactorAuthBasicAuthManager); } if (this.authManagers.containsKey("voice")) { @@ -152,7 +152,7 @@ private BandwidthClient(Environment environment, String baseUrl, HttpClient http messagingClient = new MessagingClient(this); - twoFactorAuthClient = new TwoFactorAuthClient(this); + multiFactorAuthClient = new MultiFactorAuthClient(this); voiceClient = new VoiceClient(this); webRtcClient = new WebRtcClient(this); } @@ -173,11 +173,11 @@ public MessagingClient getMessagingClient() { } /** - * Provides access to twoFactorAuthClient Client. - * @return Returns the TwoFactorAuthClient instance + * Provides access to multiFactorAuthClient Client. + * @return Returns the MultiFactorAuthClient instance */ - public TwoFactorAuthClient getTwoFactorAuthClient() { - return twoFactorAuthClient; + public MultiFactorAuthClient getMultiFactorAuthClient() { + return multiFactorAuthClient; } /** @@ -245,11 +245,11 @@ public MessagingBasicAuthCredentials getMessagingBasicAuthCredentials() { } /** - * The credentials to use with TwoFactorAuthBasicAuth. - * @return twoFactorAuthBasicAuthCredentials + * The credentials to use with MultiFactorAuthBasicAuth. + * @return multiFactorAuthBasicAuthCredentials */ - public TwoFactorAuthBasicAuthCredentials getTwoFactorAuthBasicAuthCredentials() { - return twoFactorAuthBasicAuthManager; + public MultiFactorAuthBasicAuthCredentials getMultiFactorAuthBasicAuthCredentials() { + return multiFactorAuthBasicAuthManager; } /** @@ -312,7 +312,7 @@ private static String environmentMapper(Environment environment, Server server) if (server.equals(Server.MESSAGINGDEFAULT)) { return "https://messaging.bandwidth.com/api/v2"; } - if (server.equals(Server.TWOFACTORAUTHDEFAULT)) { + if (server.equals(Server.MULTIFACTORAUTHDEFAULT)) { return "https://mfa.bandwidth.com/api/v1"; } if (server.equals(Server.VOICEDEFAULT)) { @@ -329,7 +329,7 @@ private static String environmentMapper(Environment environment, Server server) if (server.equals(Server.MESSAGINGDEFAULT)) { return "{base_url}"; } - if (server.equals(Server.TWOFACTORAUTHDEFAULT)) { + if (server.equals(Server.MULTIFACTORAUTHDEFAULT)) { return "{base_url}"; } if (server.equals(Server.VOICEDEFAULT)) { @@ -367,10 +367,10 @@ public Builder newBuilder() { getMessagingBasicAuthCredentials().getBasicAuthUserName(); builder.messagingBasicAuthPassword = getMessagingBasicAuthCredentials().getBasicAuthPassword(); - builder.twoFactorAuthBasicAuthUserName = - getTwoFactorAuthBasicAuthCredentials().getBasicAuthUserName(); - builder.twoFactorAuthBasicAuthPassword = - getTwoFactorAuthBasicAuthCredentials().getBasicAuthPassword(); + builder.multiFactorAuthBasicAuthUserName = + getMultiFactorAuthBasicAuthCredentials().getBasicAuthUserName(); + builder.multiFactorAuthBasicAuthPassword = + getMultiFactorAuthBasicAuthCredentials().getBasicAuthPassword(); builder.voiceBasicAuthUserName = getVoiceBasicAuthCredentials().getBasicAuthUserName(); builder.voiceBasicAuthPassword = getVoiceBasicAuthCredentials().getBasicAuthPassword(); builder.webRtcBasicAuthUserName = getWebRtcBasicAuthCredentials().getBasicAuthUserName(); @@ -391,8 +391,8 @@ public static class Builder { private long timeout = 0; private String messagingBasicAuthUserName = "TODO: Replace"; private String messagingBasicAuthPassword = "TODO: Replace"; - private String twoFactorAuthBasicAuthUserName = "TODO: Replace"; - private String twoFactorAuthBasicAuthPassword = "TODO: Replace"; + private String multiFactorAuthBasicAuthUserName = "TODO: Replace"; + private String multiFactorAuthBasicAuthPassword = "TODO: Replace"; private String voiceBasicAuthUserName = "TODO: Replace"; private String voiceBasicAuthPassword = "TODO: Replace"; private String webRtcBasicAuthUserName = "TODO: Replace"; @@ -421,12 +421,12 @@ public Builder messagingBasicAuthCredentials(String basicAuthUserName, } /** - * Credentials setter for TwoFactorAuthBasicAuth. - * @param basicAuthUserName String value for twoFactorAuthBasicAuthUserName. - * @param basicAuthPassword String value for twoFactorAuthBasicAuthPassword. + * Credentials setter for MultiFactorAuthBasicAuth. + * @param basicAuthUserName String value for multiFactorAuthBasicAuthUserName. + * @param basicAuthPassword String value for multiFactorAuthBasicAuthPassword. * @return Builder */ - public Builder twoFactorAuthBasicAuthCredentials(String basicAuthUserName, + public Builder multiFactorAuthBasicAuthCredentials(String basicAuthUserName, String basicAuthPassword) { if (basicAuthUserName == null) { throw new NullPointerException("BasicAuthUserName cannot be null."); @@ -434,8 +434,8 @@ public Builder twoFactorAuthBasicAuthCredentials(String basicAuthUserName, if (basicAuthPassword == null) { throw new NullPointerException("BasicAuthPassword cannot be null."); } - this.twoFactorAuthBasicAuthUserName = basicAuthUserName; - this.twoFactorAuthBasicAuthPassword = basicAuthPassword; + this.multiFactorAuthBasicAuthUserName = basicAuthUserName; + this.multiFactorAuthBasicAuthPassword = basicAuthPassword; return this; } @@ -535,7 +535,7 @@ public BandwidthClient build() { return new BandwidthClient(environment, baseUrl, httpClient, timeout, httpClientConfig, messagingBasicAuthUserName, messagingBasicAuthPassword, - twoFactorAuthBasicAuthUserName, twoFactorAuthBasicAuthPassword, + multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword, voiceBasicAuthUserName, voiceBasicAuthPassword, webRtcBasicAuthUserName, webRtcBasicAuthPassword, authManagers, httpCallback); } diff --git a/src/main/java/com/bandwidth/Configuration.java b/src/main/java/com/bandwidth/Configuration.java index b0c0329c..54003639 100644 --- a/src/main/java/com/bandwidth/Configuration.java +++ b/src/main/java/com/bandwidth/Configuration.java @@ -44,10 +44,10 @@ public interface Configuration { MessagingBasicAuthCredentials getMessagingBasicAuthCredentials(); /** - * The credentials to use with TwoFactorAuthBasicAuth. - * @return twoFactorAuthBasicAuthCredentials + * The credentials to use with MultiFactorAuthBasicAuth. + * @return multiFactorAuthBasicAuthCredentials */ - TwoFactorAuthBasicAuthCredentials getTwoFactorAuthBasicAuthCredentials(); + MultiFactorAuthBasicAuthCredentials getMultiFactorAuthBasicAuthCredentials(); /** * The credentials to use with VoiceBasicAuth. diff --git a/src/main/java/com/bandwidth/DateTimeHelper.java b/src/main/java/com/bandwidth/DateTimeHelper.java index 972b9ffd..c1de0bb1 100644 --- a/src/main/java/com/bandwidth/DateTimeHelper.java +++ b/src/main/java/com/bandwidth/DateTimeHelper.java @@ -6,7 +6,6 @@ package com.bandwidth; - import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; @@ -23,7 +22,9 @@ import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -62,7 +63,7 @@ public static LocalDateTime fromUnixTimestamp(String date) { * @return The converted String */ public static String toUnixTimestamp(LocalDateTime value) { - return Long.toString(value.toEpochSecond(java.time.ZoneOffset.UTC)); + return value == null ? null : Long.toString(value.toEpochSecond(java.time.ZoneOffset.UTC)); } /** @@ -81,6 +82,63 @@ public static List toUnixTimestamp(List values) { return valuesAsString; } + /** + * Convert a Map of DateTime objects to Unix Timestamp strings. + * @param values The Map of DateTime objects to convert + * @return The Map of converted Strings + */ + public static Map toUnixTimestamp(Map values) { + if (values == null) { + return null; + } + Map valuesAsString = new HashMap<>(); + for (Map.Entry value: values.entrySet()) { + valuesAsString.put(value.getKey(), toUnixTimestamp(value.getValue())); + } + return valuesAsString; + } + + /** + * Convert a DateTime object to a Unix Timestamp Long. + * @param value The DateTime object to convert + * @return The converted Long + */ + public static Long toUnixTimestampLong(LocalDateTime value) { + return value == null ? null : value.toEpochSecond(java.time.ZoneOffset.UTC); + } + + /** + * Convert a List of DateTime objects to Unix Timestamp Longs. + * @param values The List of DateTime objects to convert + * @return The list of converted Longs. + */ + public static List toUnixTimestampLong(List values) { + if (values == null) { + return null; + } + List valuesAsLong = new ArrayList<>(); + for (LocalDateTime value : values) { + valuesAsLong.add(toUnixTimestampLong(value)); + } + return valuesAsLong; + } + + /** + * Convert a Map of DateTime objects to Unix Timestamp Longs. + * @param values The Map of DateTime objects to convert + * @return The Map of converted Longs. + */ + public static Map toUnixTimestampLong(Map values) { + if (values == null) { + return null; + } + Map valuesAsLong = new HashMap<>(); + for (Map.Entry value: values.entrySet()) { + valuesAsLong.put(value.getKey(), toUnixTimestampLong(value.getValue())); + } + return valuesAsLong; + } + /** * Parse a datetime string in Rfc1123 format to a DateTime object. * @param date The datetime string in Rfc1123 format @@ -96,7 +154,8 @@ public static LocalDateTime fromRfc1123DateTime(String date) { * @return The converted String */ public static String toRfc1123DateTime(LocalDateTime value) { - return RFC1123_DATE_TIME_FORMATTER.format(value.atZone(ZoneId.of("GMT"))); + return value == null ? null + : RFC1123_DATE_TIME_FORMATTER.format(value.atZone(ZoneId.of("GMT"))); } /** @@ -115,6 +174,22 @@ public static List toRfc1123DateTime(List values) { return valuesAsString; } + /** + * Convert a Map of DateTime objects to Rfc1123 formatted strings. + * @param values The Map of DateTime objects to convert + * @return The Map of converted Strings + */ + public static Map toRfc1123DateTime(Map values) { + if (values == null) { + return null; + } + Map valuesAsString = new HashMap<>(); + for (Map.Entry value: values.entrySet()) { + valuesAsString.put(value.getKey(), toRfc1123DateTime(value.getValue())); + } + return valuesAsString; + } + /** * Parse a datetime string in Rfc8601(Rfc3339) format to a DateTime object. * @param date The datetime string in Rfc8601(Rfc3339) format @@ -136,7 +211,7 @@ public static LocalDateTime fromRfc8601DateTime(String date) { * @return The converted String */ public static String toRfc8601DateTime(LocalDateTime value) { - return value.toString() + "Z"; + return value == null ? null : value.toString() + "Z"; } /** @@ -155,6 +230,22 @@ public static List toRfc8601DateTime(List values) { return valuesAsString; } + /** + * Convert a Map of DateTime objects to Rfc8601(Rfc3339) formatted strings. + * @param values The Map of DateTime objects to convert + * @return The Map of converted Strings + */ + public static Map toRfc8601DateTime(Map values) { + if (values == null) { + return null; + } + Map valuesAsString = new HashMap<>(); + for (Map.Entry value: values.entrySet()) { + valuesAsString.put(value.getKey(), toRfc8601DateTime(value.getValue())); + } + return valuesAsString; + } + /** * Parse a simple date string to a LocalDate object. * @param date The date string @@ -170,7 +261,7 @@ public static LocalDate fromSimpleDate(String date) { * @return The converted Strings */ public static String toSimpleDate(LocalDate value) { - return value.toString(); + return value == null ? null : value.toString(); } /** @@ -189,10 +280,27 @@ public static List toSimpleDate(List values) { return valuesAsString; } + /** + * Convert a Map of LocalDate objects to strings. + * @param values The Map of LocalDate objects to convert + * @return The Map of converted Strings + */ + public static Map toSimpleDate(Map values) { + if (values == null) { + return null; + } + Map valuesAsString = new HashMap<>(); + for (Map.Entry value: values.entrySet()) { + valuesAsString.put(value.getKey(), toSimpleDate(value.getValue())); + } + return valuesAsString; + } + /** * A class to handle deserialization of DateTime objects to Unix Timestamps. */ public static class UnixTimestampDeserializer extends JsonDeserializer { + @SuppressWarnings("unused") @Override public LocalDateTime deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { @@ -204,10 +312,11 @@ public LocalDateTime deserialize(JsonParser jp, DeserializationContext ctxt) * A class to handle serialization of Unix Timestamps to DateTime objects. */ public static class UnixTimestampSerializer extends JsonSerializer { + @SuppressWarnings("unused") @Override public void serialize(LocalDateTime value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { - jgen.writeNumber(toUnixTimestamp(value)); + jgen.writeObject(toUnixTimestampLong(value)); } } @@ -215,6 +324,7 @@ public void serialize(LocalDateTime value, JsonGenerator jgen, SerializerProvide * A class to handle deserialization of DateTime objects to Rfc1123 format strings. */ public static class Rfc1123DateTimeDeserializer extends JsonDeserializer { + @SuppressWarnings("unused") @Override public LocalDateTime deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { @@ -226,6 +336,7 @@ public LocalDateTime deserialize(JsonParser jp, DeserializationContext ctxt) * A class to handle serialization of Rfc1123 format strings to DateTime objects. */ public static class Rfc1123DateTimeSerializer extends JsonSerializer { + @SuppressWarnings("unused") @Override public void serialize(LocalDateTime value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { @@ -237,6 +348,7 @@ public void serialize(LocalDateTime value, JsonGenerator jgen, SerializerProvide * A class to handle deserialization of DateTime objects to Rfc8601(Rfc3339) format strings. */ public static class Rfc8601DateTimeDeserializer extends JsonDeserializer { + @SuppressWarnings("unused") @Override public LocalDateTime deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { @@ -248,6 +360,7 @@ public LocalDateTime deserialize(JsonParser jp, DeserializationContext ctxt) * A class to handle serialization of Rfc8601(Rfc3339) format strings to DateTime objects. */ public static class Rfc8601DateTimeSerializer extends JsonSerializer { + @SuppressWarnings("unused") @Override public void serialize(LocalDateTime value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { @@ -259,6 +372,7 @@ public void serialize(LocalDateTime value, JsonGenerator jgen, SerializerProvide * A class to handle deserialization of date strings to LocalDate objects. */ public static class SimpleDateDeserializer extends JsonDeserializer { + @SuppressWarnings("unused") @Override public LocalDate deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { @@ -270,6 +384,7 @@ public LocalDate deserialize(JsonParser jp, DeserializationContext ctxt) * A class to handle serialization of LocalDate objects to date strings. */ public static class SimpleDateSerializer extends JsonSerializer { + @SuppressWarnings("unused") @Override public void serialize(LocalDate value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { diff --git a/src/main/java/com/bandwidth/TwoFactorAuthBasicAuthCredentials.java b/src/main/java/com/bandwidth/MultiFactorAuthBasicAuthCredentials.java similarity index 90% rename from src/main/java/com/bandwidth/TwoFactorAuthBasicAuthCredentials.java rename to src/main/java/com/bandwidth/MultiFactorAuthBasicAuthCredentials.java index 6475fcd6..5e5b75d9 100644 --- a/src/main/java/com/bandwidth/TwoFactorAuthBasicAuthCredentials.java +++ b/src/main/java/com/bandwidth/MultiFactorAuthBasicAuthCredentials.java @@ -9,7 +9,7 @@ /** * Interface for defining the behavior of Basic Authentication. */ -public interface TwoFactorAuthBasicAuthCredentials { +public interface MultiFactorAuthBasicAuthCredentials { /** * String value for basicAuthUserName. diff --git a/src/main/java/com/bandwidth/TwoFactorAuthBasicAuthManager.java b/src/main/java/com/bandwidth/MultiFactorAuthBasicAuthManager.java similarity index 84% rename from src/main/java/com/bandwidth/TwoFactorAuthBasicAuthManager.java rename to src/main/java/com/bandwidth/MultiFactorAuthBasicAuthManager.java index 7398f3ea..5ce4f73e 100644 --- a/src/main/java/com/bandwidth/TwoFactorAuthBasicAuthManager.java +++ b/src/main/java/com/bandwidth/MultiFactorAuthBasicAuthManager.java @@ -13,7 +13,7 @@ /** * Utility class for authorization and token management. */ -public class TwoFactorAuthBasicAuthManager implements AuthManager, TwoFactorAuthBasicAuthCredentials { +public class MultiFactorAuthBasicAuthManager implements AuthManager, MultiFactorAuthBasicAuthCredentials { private String basicAuthUserName; @@ -24,7 +24,7 @@ public class TwoFactorAuthBasicAuthManager implements AuthManager, TwoFactorAuth * @param username String value for username. * @param password String value for password. */ - public TwoFactorAuthBasicAuthManager(String username, String password) { + public MultiFactorAuthBasicAuthManager(String username, String password) { this.basicAuthUserName = username; this.basicAuthPassword = password; } @@ -57,12 +57,12 @@ public boolean equals(String basicAuthUserName, String basicAuthPassword) { } /** - * Converts this TwoFactorAuthBasicAuthManager into string format. + * Converts this MultiFactorAuthBasicAuthManager into string format. * @return String representation of this class */ @Override public String toString() { - return "TwoFactorAuthBasicAuthManager [" + "basicAuthUserName=" + basicAuthUserName + return "MultiFactorAuthBasicAuthManager [" + "basicAuthUserName=" + basicAuthUserName + ", basicAuthPassword=" + basicAuthPassword + "]"; } diff --git a/src/main/java/com/bandwidth/TwoFactorAuthClient.java b/src/main/java/com/bandwidth/MultiFactorAuthClient.java similarity index 78% rename from src/main/java/com/bandwidth/TwoFactorAuthClient.java rename to src/main/java/com/bandwidth/MultiFactorAuthClient.java index 821656a3..356008b9 100644 --- a/src/main/java/com/bandwidth/TwoFactorAuthClient.java +++ b/src/main/java/com/bandwidth/MultiFactorAuthClient.java @@ -6,10 +6,10 @@ package com.bandwidth; -import com.bandwidth.twofactorauth.controllers.*; +import com.bandwidth.multifactorauth.controllers.*; import com.bandwidth.http.client.OkClient; -public final class TwoFactorAuthClient { +public final class MultiFactorAuthClient { private final BandwidthClient config; /** @@ -20,7 +20,7 @@ public final class TwoFactorAuthClient { /** * Default constructor. */ - public TwoFactorAuthClient(BandwidthClient config) { + public MultiFactorAuthClient(BandwidthClient config) { this.config = config; mFA = new MFAController(config, config.getHttpClient(), config.getAuthManagers()); } diff --git a/src/main/java/com/bandwidth/Server.java b/src/main/java/com/bandwidth/Server.java index 499db38f..cbc71968 100644 --- a/src/main/java/com/bandwidth/Server.java +++ b/src/main/java/com/bandwidth/Server.java @@ -18,7 +18,7 @@ public enum Server { MESSAGINGDEFAULT, - TWOFACTORAUTHDEFAULT, + MULTIFACTORAUTHDEFAULT, VOICEDEFAULT, @@ -31,13 +31,13 @@ public enum Server { static { ENUM_DEFAULT.value = "default"; MESSAGINGDEFAULT.value = "MessagingDefault"; - TWOFACTORAUTHDEFAULT.value = "TwoFactorAuthDefault"; + MULTIFACTORAUTHDEFAULT.value = "MultiFactorAuthDefault"; VOICEDEFAULT.value = "VoiceDefault"; WEBRTCDEFAULT.value = "WebRtcDefault"; valueMap.put("default", ENUM_DEFAULT); valueMap.put("MessagingDefault", MESSAGINGDEFAULT); - valueMap.put("TwoFactorAuthDefault", TWOFACTORAUTHDEFAULT); + valueMap.put("MultiFactorAuthDefault", MULTIFACTORAUTHDEFAULT); valueMap.put("VoiceDefault", VOICEDEFAULT); valueMap.put("WebRtcDefault", WEBRTCDEFAULT); } diff --git a/src/main/java/com/bandwidth/http/request/MultipartFileWrapper.java b/src/main/java/com/bandwidth/http/request/MultipartFileWrapper.java index caef2ca6..24c87d75 100644 --- a/src/main/java/com/bandwidth/http/request/MultipartFileWrapper.java +++ b/src/main/java/com/bandwidth/http/request/MultipartFileWrapper.java @@ -8,13 +8,16 @@ import com.bandwidth.http.Headers; import com.bandwidth.utilities.FileWrapper; +import com.fasterxml.jackson.annotation.JsonInclude; /** * Class to wrap file and headers to be sent as part of a multipart request. */ public class MultipartFileWrapper { + @JsonInclude(JsonInclude.Include.NON_NULL) private FileWrapper fileWrapper; + @JsonInclude(JsonInclude.Include.NON_NULL) private Headers headers; /** diff --git a/src/main/java/com/bandwidth/http/request/MultipartWrapper.java b/src/main/java/com/bandwidth/http/request/MultipartWrapper.java index 401f7726..1b73e6bc 100644 --- a/src/main/java/com/bandwidth/http/request/MultipartWrapper.java +++ b/src/main/java/com/bandwidth/http/request/MultipartWrapper.java @@ -7,13 +7,16 @@ package com.bandwidth.http.request; import com.bandwidth.http.Headers; +import com.fasterxml.jackson.annotation.JsonInclude; /** * Class to wrap byteArray and headers to be sent as part of a multipart request. */ public class MultipartWrapper { + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] byteArray; + @JsonInclude(JsonInclude.Include.NON_NULL) private Headers headers; /** diff --git a/src/main/java/com/bandwidth/internal/OptionalNullable.java b/src/main/java/com/bandwidth/internal/OptionalNullable.java new file mode 100644 index 00000000..84d85017 --- /dev/null +++ b/src/main/java/com/bandwidth/internal/OptionalNullable.java @@ -0,0 +1,158 @@ +/* + * BandwidthLib + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +package com.bandwidth.internal; + +import com.bandwidth.DateTimeHelper; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import java.io.IOException; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Map; + +/** + * Class to encapsulate fields which are Optional as well as Nullable. It also + * provides helper methods to create OptionalNullable generic type, and to + * extract value from it. + * @param Type of the encapsulated field. + */ +public class OptionalNullable { + + /** + * Private store for encapsulated object's value. + */ + private T value; + + private OptionalNullable(T value) { + this.value = value; + } + + /** + * Converts this OptionalNullable into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "" + value; + } + + /** + * Creates an OptionalNullable instance with the provided value. + * @param Type of the provided object. + * @param value Value of the provided object. + * @return {@link OptionalNullable} instance encapsulating given value. + */ + public static OptionalNullable of(T value) { + return new OptionalNullable(value); + } + + /** + * Extracts the encapsulated value from the given OptionalNullable. + * @param Type of the expected value. + * @param optionalNullable OptionalNullable instance to get value. + * @return Value of the extracted field. + */ + public static T getFrom(OptionalNullable optionalNullable) { + return (optionalNullable == null) ? null : optionalNullable.value; + } + + /** + * JsonSerializer for the {@link OptionalNullable} instance. It is used to + * Serialize an {@link OptionalNullable} as its encapsulated object. + */ + public static class Serializer extends JsonSerializer> { + @SuppressWarnings("unused") + @Override + public void serialize(OptionalNullable object, JsonGenerator jgen, + SerializerProvider provider) throws IOException { + jgen.writeObject(object.value); + } + } + + /** + * A class to handle serialization of Unix Timestamps to DateTime objects. + */ + public static class UnixTimestampSerializer extends JsonSerializer> { + @SuppressWarnings({ "unused", "unchecked" }) + @Override + public void serialize(OptionalNullable object, JsonGenerator jgen, + SerializerProvider provider) throws IOException { + if (object.value instanceof List) { + jgen.writeObject( + DateTimeHelper.toUnixTimestampLong((List) object.value)); + } else if (object.value instanceof Map) { + jgen.writeObject( + DateTimeHelper.toUnixTimestampLong((Map) object.value)); + } else { + jgen.writeObject(DateTimeHelper.toUnixTimestampLong((LocalDateTime) object.value)); + } + } + } + + /** + * A class to handle serialization of Rfc1123 format strings to DateTime + * objects. + */ + public static class Rfc1123DateTimeSerializer extends JsonSerializer> { + @SuppressWarnings({ "unused", "unchecked" }) + @Override + public void serialize(OptionalNullable object, JsonGenerator jgen, + SerializerProvider provider) throws IOException { + if (object.value instanceof List) { + jgen.writeObject( + DateTimeHelper.toRfc1123DateTime((List) object.value)); + } else if (object.value instanceof Map) { + jgen.writeObject( + DateTimeHelper.toRfc1123DateTime((Map) object.value)); + } else { + jgen.writeString(DateTimeHelper.toRfc1123DateTime((LocalDateTime) object.value)); + } + } + } + + /** + * A class to handle serialization of Rfc8601(Rfc3339) format strings to + * DateTime objects. + */ + public static class Rfc8601DateTimeSerializer extends JsonSerializer> { + @SuppressWarnings({ "unused", "unchecked" }) + @Override + public void serialize(OptionalNullable object, JsonGenerator jgen, + SerializerProvider provider) throws IOException { + if (object.value instanceof List) { + jgen.writeObject( + DateTimeHelper.toRfc8601DateTime((List) object.value)); + } else if (object.value instanceof Map) { + jgen.writeObject( + DateTimeHelper.toRfc8601DateTime((Map) object.value)); + } else { + jgen.writeString(DateTimeHelper.toRfc8601DateTime((LocalDateTime) object.value)); + } + } + } + + /** + * A class to handle serialization of LocalDate objects to date strings. + */ + public static class SimpleDateSerializer extends JsonSerializer> { + @SuppressWarnings({ "unused", "unchecked" }) + @Override + public void serialize(OptionalNullable object, JsonGenerator jgen, + SerializerProvider provider) throws IOException { + if (object.value instanceof List) { + jgen.writeObject(DateTimeHelper.toSimpleDate((List) object.value)); + } else if (object.value instanceof Map) { + jgen.writeObject( + DateTimeHelper.toSimpleDate((Map) object.value)); + } else { + jgen.writeString(DateTimeHelper.toSimpleDate((LocalDate) object.value)); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/bandwidth/messaging/controllers/APIController.java b/src/main/java/com/bandwidth/messaging/controllers/APIController.java index 30ee9b52..e640ddc1 100644 --- a/src/main/java/com/bandwidth/messaging/controllers/APIController.java +++ b/src/main/java/com/bandwidth/messaging/controllers/APIController.java @@ -20,7 +20,7 @@ import com.bandwidth.http.response.ApiResponse; import com.bandwidth.http.response.HttpResponse; import com.bandwidth.http.response.HttpStringResponse; -import com.bandwidth.messaging.exceptions.MessagingException; +import com.bandwidth.messaging.exceptions.MessagingExceptionErrorException; import com.bandwidth.messaging.models.BandwidthMessage; import com.bandwidth.messaging.models.BandwidthMessagesList; import com.bandwidth.messaging.models.Media; @@ -65,7 +65,7 @@ public APIController(Configuration config, HttpClient httpClient, /** * listMedia. - * @param userId Required parameter: User's account ID + * @param accountId Required parameter: User's account ID * @param continuationToken Optional parameter: Continuation token used to retrieve subsequent * media. * @return Returns the List of Media wrapped in ApiResponse response from the API call @@ -73,9 +73,9 @@ public APIController(Configuration config, HttpClient httpClient, * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ApiResponse> listMedia( - final String userId, + final String accountId, final String continuationToken) throws ApiException, IOException { - HttpRequest request = buildListMediaRequest(userId, continuationToken); + HttpRequest request = buildListMediaRequest(accountId, continuationToken); authManagers.get("messaging").apply(request); HttpResponse response = getClientInstance().executeAsString(request); @@ -86,15 +86,15 @@ public ApiResponse> listMedia( /** * listMedia. - * @param userId Required parameter: User's account ID + * @param accountId Required parameter: User's account ID * @param continuationToken Optional parameter: Continuation token used to retrieve subsequent * media. * @return Returns the List of Media wrapped in ApiResponse response from the API call */ public CompletableFuture>> listMediaAsync( - final String userId, + final String accountId, final String continuationToken) { - return makeHttpCallAsync(() -> buildListMediaRequest(userId, continuationToken), + return makeHttpCallAsync(() -> buildListMediaRequest(accountId, continuationToken), req -> authManagers.get("messaging").applyAsync(req) .thenCompose(request -> getClientInstance() .executeAsStringAsync(request)), @@ -105,19 +105,19 @@ public CompletableFuture>> listMediaAsync( * Builds the HttpRequest object for listMedia. */ private HttpRequest buildListMediaRequest( - final String userId, + final String accountId, final String continuationToken) { //the base uri for api requests String baseUri = config.getBaseUri(Server.MESSAGINGDEFAULT); //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri - + "/users/{userId}/media"); + + "/users/{accountId}/media"); //process template parameters Map> templateParameters = new HashMap<>(); - templateParameters.put("userId", - new SimpleEntry(userId, false)); + templateParameters.put("accountId", + new SimpleEntry(accountId, false)); ApiHelper.appendUrlWithTemplateParameters(queryBuilder, templateParameters); //load all headers for the outgoing API request @@ -154,22 +154,22 @@ private ApiResponse> handleListMediaResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new MessagingException("400 Request is malformed or invalid", context); + throw new MessagingExceptionErrorException("400 Request is malformed or invalid", context); } if (responseCode == 401) { - throw new MessagingException("401 The specified user does not have access to the account", context); + throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", context); } if (responseCode == 403) { - throw new MessagingException("403 The user does not have access to this API", context); + throw new MessagingExceptionErrorException("403 The user does not have access to this API", context); } if (responseCode == 404) { - throw new MessagingException("404 Path not found", context); + throw new MessagingExceptionErrorException("404 Path not found", context); } if (responseCode == 415) { - throw new MessagingException("415 The content-type of the request is incorrect", context); + throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", context); } if (responseCode == 429) { - throw new MessagingException("429 The rate limit has been reached", context); + throw new MessagingExceptionErrorException("429 The rate limit has been reached", context); } //handle errors defined at the API level validateResponse(response, context); @@ -183,16 +183,16 @@ private ApiResponse> handleListMediaResponse( /** * getMedia. - * @param userId Required parameter: User's account ID + * @param accountId Required parameter: User's account ID * @param mediaId Required parameter: Media ID to retrieve * @return Returns the InputStream wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ApiResponse getMedia( - final String userId, + final String accountId, final String mediaId) throws ApiException, IOException { - HttpRequest request = buildGetMediaRequest(userId, mediaId); + HttpRequest request = buildGetMediaRequest(accountId, mediaId); authManagers.get("messaging").apply(request); HttpResponse response = getClientInstance().executeAsBinary(request); @@ -203,14 +203,14 @@ public ApiResponse getMedia( /** * getMedia. - * @param userId Required parameter: User's account ID + * @param accountId Required parameter: User's account ID * @param mediaId Required parameter: Media ID to retrieve * @return Returns the InputStream wrapped in ApiResponse response from the API call */ public CompletableFuture> getMediaAsync( - final String userId, + final String accountId, final String mediaId) { - return makeHttpCallAsync(() -> buildGetMediaRequest(userId, mediaId), + return makeHttpCallAsync(() -> buildGetMediaRequest(accountId, mediaId), req -> authManagers.get("messaging").applyAsync(req) .thenCompose(request -> getClientInstance() .executeAsStringAsync(request)), @@ -221,19 +221,19 @@ public CompletableFuture> getMediaAsync( * Builds the HttpRequest object for getMedia. */ private HttpRequest buildGetMediaRequest( - final String userId, + final String accountId, final String mediaId) { //the base uri for api requests String baseUri = config.getBaseUri(Server.MESSAGINGDEFAULT); //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri - + "/users/{userId}/media/{mediaId}"); + + "/users/{accountId}/media/{mediaId}"); //process template parameters Map> templateParameters = new HashMap<>(); - templateParameters.put("userId", - new SimpleEntry(userId, false)); + templateParameters.put("accountId", + new SimpleEntry(accountId, false)); templateParameters.put("mediaId", new SimpleEntry(mediaId, false)); ApiHelper.appendUrlWithTemplateParameters(queryBuilder, templateParameters); @@ -270,22 +270,22 @@ private ApiResponse handleGetMediaResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new MessagingException("400 Request is malformed or invalid", context); + throw new MessagingExceptionErrorException("400 Request is malformed or invalid", context); } if (responseCode == 401) { - throw new MessagingException("401 The specified user does not have access to the account", context); + throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", context); } if (responseCode == 403) { - throw new MessagingException("403 The user does not have access to this API", context); + throw new MessagingExceptionErrorException("403 The user does not have access to this API", context); } if (responseCode == 404) { - throw new MessagingException("404 Path not found", context); + throw new MessagingExceptionErrorException("404 Path not found", context); } if (responseCode == 415) { - throw new MessagingException("415 The content-type of the request is incorrect", context); + throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", context); } if (responseCode == 429) { - throw new MessagingException("429 The rate limit has been reached", context); + throw new MessagingExceptionErrorException("429 The rate limit has been reached", context); } //handle errors defined at the API level validateResponse(response, context); @@ -297,9 +297,8 @@ private ApiResponse handleGetMediaResponse( /** * uploadMedia. - * @param userId Required parameter: User's account ID + * @param accountId Required parameter: User's account ID * @param mediaId Required parameter: The user supplied custom media ID - * @param contentLength Required parameter: The size of the entity-body * @param body Required parameter: Example: * @param contentType Optional parameter: The media type of the entity-body * @param cacheControl Optional parameter: General-header field is used to specify directives @@ -308,14 +307,13 @@ private ApiResponse handleGetMediaResponse( * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ApiResponse uploadMedia( - final String userId, + final String accountId, final String mediaId, - final long contentLength, final FileWrapper body, final String contentType, final String cacheControl) throws ApiException, IOException { - HttpRequest request = buildUploadMediaRequest(userId, mediaId, contentLength, body, - contentType, cacheControl); + HttpRequest request = buildUploadMediaRequest(accountId, mediaId, body, contentType, + cacheControl); authManagers.get("messaging").apply(request); HttpResponse response = getClientInstance().executeAsString(request); @@ -326,9 +324,8 @@ public ApiResponse uploadMedia( /** * uploadMedia. - * @param userId Required parameter: User's account ID + * @param accountId Required parameter: User's account ID * @param mediaId Required parameter: The user supplied custom media ID - * @param contentLength Required parameter: The size of the entity-body * @param body Required parameter: Example: * @param contentType Optional parameter: The media type of the entity-body * @param cacheControl Optional parameter: General-header field is used to specify directives @@ -336,13 +333,12 @@ public ApiResponse uploadMedia( * @return Returns the Void wrapped in ApiResponse response from the API call */ public CompletableFuture> uploadMediaAsync( - final String userId, + final String accountId, final String mediaId, - final long contentLength, final FileWrapper body, final String contentType, final String cacheControl) { - return makeHttpCallAsync(() -> buildUploadMediaRequest(userId, mediaId, contentLength, body, + return makeHttpCallAsync(() -> buildUploadMediaRequest(accountId, mediaId, body, contentType, cacheControl), req -> authManagers.get("messaging").applyAsync(req) .thenCompose(request -> getClientInstance() @@ -354,9 +350,8 @@ public CompletableFuture> uploadMediaAsync( * Builds the HttpRequest object for uploadMedia. */ private HttpRequest buildUploadMediaRequest( - final String userId, + final String accountId, final String mediaId, - final long contentLength, final FileWrapper body, final String contentType, final String cacheControl) { @@ -365,19 +360,18 @@ private HttpRequest buildUploadMediaRequest( //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri - + "/users/{userId}/media/{mediaId}"); + + "/users/{accountId}/media/{mediaId}"); //process template parameters Map> templateParameters = new HashMap<>(); - templateParameters.put("userId", - new SimpleEntry(userId, false)); + templateParameters.put("accountId", + new SimpleEntry(accountId, false)); templateParameters.put("mediaId", new SimpleEntry(mediaId, false)); ApiHelper.appendUrlWithTemplateParameters(queryBuilder, templateParameters); //load all headers for the outgoing API request Headers headers = new Headers(); - headers.add("Content-Length", String.valueOf(contentLength)); headers.add("Content-Type", (contentType != null) ? contentType : "application/octet-stream"); headers.add("Cache-Control", cacheControl); @@ -411,22 +405,22 @@ private ApiResponse handleUploadMediaResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new MessagingException("400 Request is malformed or invalid", context); + throw new MessagingExceptionErrorException("400 Request is malformed or invalid", context); } if (responseCode == 401) { - throw new MessagingException("401 The specified user does not have access to the account", context); + throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", context); } if (responseCode == 403) { - throw new MessagingException("403 The user does not have access to this API", context); + throw new MessagingExceptionErrorException("403 The user does not have access to this API", context); } if (responseCode == 404) { - throw new MessagingException("404 Path not found", context); + throw new MessagingExceptionErrorException("404 Path not found", context); } if (responseCode == 415) { - throw new MessagingException("415 The content-type of the request is incorrect", context); + throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", context); } if (responseCode == 429) { - throw new MessagingException("429 The rate limit has been reached", context); + throw new MessagingExceptionErrorException("429 The rate limit has been reached", context); } //handle errors defined at the API level validateResponse(response, context); @@ -436,15 +430,15 @@ private ApiResponse handleUploadMediaResponse( /** * deleteMedia. - * @param userId Required parameter: User's account ID + * @param accountId Required parameter: User's account ID * @param mediaId Required parameter: The media ID to delete * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ApiResponse deleteMedia( - final String userId, + final String accountId, final String mediaId) throws ApiException, IOException { - HttpRequest request = buildDeleteMediaRequest(userId, mediaId); + HttpRequest request = buildDeleteMediaRequest(accountId, mediaId); authManagers.get("messaging").apply(request); HttpResponse response = getClientInstance().executeAsString(request); @@ -455,14 +449,14 @@ public ApiResponse deleteMedia( /** * deleteMedia. - * @param userId Required parameter: User's account ID + * @param accountId Required parameter: User's account ID * @param mediaId Required parameter: The media ID to delete * @return Returns the Void wrapped in ApiResponse response from the API call */ public CompletableFuture> deleteMediaAsync( - final String userId, + final String accountId, final String mediaId) { - return makeHttpCallAsync(() -> buildDeleteMediaRequest(userId, mediaId), + return makeHttpCallAsync(() -> buildDeleteMediaRequest(accountId, mediaId), req -> authManagers.get("messaging").applyAsync(req) .thenCompose(request -> getClientInstance() .executeAsStringAsync(request)), @@ -473,19 +467,19 @@ public CompletableFuture> deleteMediaAsync( * Builds the HttpRequest object for deleteMedia. */ private HttpRequest buildDeleteMediaRequest( - final String userId, + final String accountId, final String mediaId) { //the base uri for api requests String baseUri = config.getBaseUri(Server.MESSAGINGDEFAULT); //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri - + "/users/{userId}/media/{mediaId}"); + + "/users/{accountId}/media/{mediaId}"); //process template parameters Map> templateParameters = new HashMap<>(); - templateParameters.put("userId", - new SimpleEntry(userId, false)); + templateParameters.put("accountId", + new SimpleEntry(accountId, false)); templateParameters.put("mediaId", new SimpleEntry(mediaId, false)); ApiHelper.appendUrlWithTemplateParameters(queryBuilder, templateParameters); @@ -522,22 +516,22 @@ private ApiResponse handleDeleteMediaResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new MessagingException("400 Request is malformed or invalid", context); + throw new MessagingExceptionErrorException("400 Request is malformed or invalid", context); } if (responseCode == 401) { - throw new MessagingException("401 The specified user does not have access to the account", context); + throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", context); } if (responseCode == 403) { - throw new MessagingException("403 The user does not have access to this API", context); + throw new MessagingExceptionErrorException("403 The user does not have access to this API", context); } if (responseCode == 404) { - throw new MessagingException("404 Path not found", context); + throw new MessagingExceptionErrorException("404 Path not found", context); } if (responseCode == 415) { - throw new MessagingException("415 The content-type of the request is incorrect", context); + throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", context); } if (responseCode == 429) { - throw new MessagingException("429 The rate limit has been reached", context); + throw new MessagingExceptionErrorException("429 The rate limit has been reached", context); } //handle errors defined at the API level validateResponse(response, context); @@ -547,13 +541,13 @@ private ApiResponse handleDeleteMediaResponse( /** * getMessages. - * @param userId Required parameter: User's account ID + * @param accountId Required parameter: User's account ID * @param messageId Optional parameter: The ID of the message to search for. Special * characters need to be encoded using URL encoding * @param sourceTn Optional parameter: The phone number that sent the message * @param destinationTn Optional parameter: The phone number that received the message * @param messageStatus Optional parameter: The status of the message. One of RECEIVED, - * QUEUED, SENDING, SENT, FAILED, DELIVERED, DLR_EXPIRED + * QUEUED, SENDING, SENT, FAILED, DELIVERED, ACCEPTED, UNDELIVERED * @param errorCode Optional parameter: The error code of the message * @param fromDateTime Optional parameter: The start of the date range to search in ISO 8601 * format. Uses the message receive time. The date range to search in is currently 14 @@ -569,7 +563,7 @@ private ApiResponse handleDeleteMediaResponse( * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ApiResponse getMessages( - final String userId, + final String accountId, final String messageId, final String sourceTn, final String destinationTn, @@ -579,7 +573,7 @@ public ApiResponse getMessages( final String toDateTime, final String pageToken, final Integer limit) throws ApiException, IOException { - HttpRequest request = buildGetMessagesRequest(userId, messageId, sourceTn, destinationTn, + HttpRequest request = buildGetMessagesRequest(accountId, messageId, sourceTn, destinationTn, messageStatus, errorCode, fromDateTime, toDateTime, pageToken, limit); authManagers.get("messaging").apply(request); @@ -591,13 +585,13 @@ public ApiResponse getMessages( /** * getMessages. - * @param userId Required parameter: User's account ID + * @param accountId Required parameter: User's account ID * @param messageId Optional parameter: The ID of the message to search for. Special * characters need to be encoded using URL encoding * @param sourceTn Optional parameter: The phone number that sent the message * @param destinationTn Optional parameter: The phone number that received the message * @param messageStatus Optional parameter: The status of the message. One of RECEIVED, - * QUEUED, SENDING, SENT, FAILED, DELIVERED, DLR_EXPIRED + * QUEUED, SENDING, SENT, FAILED, DELIVERED, ACCEPTED, UNDELIVERED * @param errorCode Optional parameter: The error code of the message * @param fromDateTime Optional parameter: The start of the date range to search in ISO 8601 * format. Uses the message receive time. The date range to search in is currently 14 @@ -611,7 +605,7 @@ public ApiResponse getMessages( * @return Returns the BandwidthMessagesList wrapped in ApiResponse response from the API call */ public CompletableFuture> getMessagesAsync( - final String userId, + final String accountId, final String messageId, final String sourceTn, final String destinationTn, @@ -621,7 +615,7 @@ public CompletableFuture> getMessagesAsync( final String toDateTime, final String pageToken, final Integer limit) { - return makeHttpCallAsync(() -> buildGetMessagesRequest(userId, messageId, sourceTn, + return makeHttpCallAsync(() -> buildGetMessagesRequest(accountId, messageId, sourceTn, destinationTn, messageStatus, errorCode, fromDateTime, toDateTime, pageToken, limit), req -> authManagers.get("messaging").applyAsync(req) @@ -634,7 +628,7 @@ public CompletableFuture> getMessagesAsync( * Builds the HttpRequest object for getMessages. */ private HttpRequest buildGetMessagesRequest( - final String userId, + final String accountId, final String messageId, final String sourceTn, final String destinationTn, @@ -649,12 +643,12 @@ private HttpRequest buildGetMessagesRequest( //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri - + "/users/{userId}/messages"); + + "/users/{accountId}/messages"); //process template parameters Map> templateParameters = new HashMap<>(); - templateParameters.put("userId", - new SimpleEntry(userId, false)); + templateParameters.put("accountId", + new SimpleEntry(accountId, false)); ApiHelper.appendUrlWithTemplateParameters(queryBuilder, templateParameters); //load all query parameters @@ -703,22 +697,22 @@ private ApiResponse handleGetMessagesResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new MessagingException("400 Request is malformed or invalid", context); + throw new MessagingExceptionErrorException("400 Request is malformed or invalid", context); } if (responseCode == 401) { - throw new MessagingException("401 The specified user does not have access to the account", context); + throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", context); } if (responseCode == 403) { - throw new MessagingException("403 The user does not have access to this API", context); + throw new MessagingExceptionErrorException("403 The user does not have access to this API", context); } if (responseCode == 404) { - throw new MessagingException("404 Path not found", context); + throw new MessagingExceptionErrorException("404 Path not found", context); } if (responseCode == 415) { - throw new MessagingException("415 The content-type of the request is incorrect", context); + throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", context); } if (responseCode == 429) { - throw new MessagingException("429 The rate limit has been reached", context); + throw new MessagingExceptionErrorException("429 The rate limit has been reached", context); } //handle errors defined at the API level validateResponse(response, context); @@ -733,16 +727,16 @@ private ApiResponse handleGetMessagesResponse( /** * createMessage. - * @param userId Required parameter: User's account ID + * @param accountId Required parameter: User's account ID * @param body Required parameter: Example: * @return Returns the BandwidthMessage wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ApiResponse createMessage( - final String userId, + final String accountId, final MessageRequest body) throws ApiException, IOException { - HttpRequest request = buildCreateMessageRequest(userId, body); + HttpRequest request = buildCreateMessageRequest(accountId, body); authManagers.get("messaging").apply(request); HttpResponse response = getClientInstance().executeAsString(request); @@ -753,14 +747,14 @@ public ApiResponse createMessage( /** * createMessage. - * @param userId Required parameter: User's account ID + * @param accountId Required parameter: User's account ID * @param body Required parameter: Example: * @return Returns the BandwidthMessage wrapped in ApiResponse response from the API call */ public CompletableFuture> createMessageAsync( - final String userId, + final String accountId, final MessageRequest body) { - return makeHttpCallAsync(() -> buildCreateMessageRequest(userId, body), + return makeHttpCallAsync(() -> buildCreateMessageRequest(accountId, body), req -> authManagers.get("messaging").applyAsync(req) .thenCompose(request -> getClientInstance() .executeAsStringAsync(request)), @@ -771,19 +765,19 @@ public CompletableFuture> createMessageAsync( * Builds the HttpRequest object for createMessage. */ private HttpRequest buildCreateMessageRequest( - final String userId, + final String accountId, final MessageRequest body) throws JsonProcessingException { //the base uri for api requests String baseUri = config.getBaseUri(Server.MESSAGINGDEFAULT); //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri - + "/users/{userId}/messages"); + + "/users/{accountId}/messages"); //process template parameters Map> templateParameters = new HashMap<>(); - templateParameters.put("userId", - new SimpleEntry(userId, false)); + templateParameters.put("accountId", + new SimpleEntry(accountId, false)); ApiHelper.appendUrlWithTemplateParameters(queryBuilder, templateParameters); //load all headers for the outgoing API request @@ -821,22 +815,22 @@ private ApiResponse handleCreateMessageResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new MessagingException("400 Request is malformed or invalid", context); + throw new MessagingExceptionErrorException("400 Request is malformed or invalid", context); } if (responseCode == 401) { - throw new MessagingException("401 The specified user does not have access to the account", context); + throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", context); } if (responseCode == 403) { - throw new MessagingException("403 The user does not have access to this API", context); + throw new MessagingExceptionErrorException("403 The user does not have access to this API", context); } if (responseCode == 404) { - throw new MessagingException("404 Path not found", context); + throw new MessagingExceptionErrorException("404 Path not found", context); } if (responseCode == 415) { - throw new MessagingException("415 The content-type of the request is incorrect", context); + throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", context); } if (responseCode == 429) { - throw new MessagingException("429 The rate limit has been reached", context); + throw new MessagingExceptionErrorException("429 The rate limit has been reached", context); } //handle errors defined at the API level validateResponse(response, context); diff --git a/src/main/java/com/bandwidth/messaging/exceptions/MessagingException.java b/src/main/java/com/bandwidth/messaging/exceptions/MessagingExceptionErrorException.java similarity index 63% rename from src/main/java/com/bandwidth/messaging/exceptions/MessagingException.java rename to src/main/java/com/bandwidth/messaging/exceptions/MessagingExceptionErrorException.java index 60adc223..bff5081a 100644 --- a/src/main/java/com/bandwidth/messaging/exceptions/MessagingException.java +++ b/src/main/java/com/bandwidth/messaging/exceptions/MessagingExceptionErrorException.java @@ -12,11 +12,11 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for MessagingException type. + * This is a model class for MessagingExceptionErrorException type. */ -public class MessagingException +public class MessagingExceptionErrorException extends ApiException { - private static final long serialVersionUID = 3829971530321243789L; + private static final long serialVersionUID = 5055941313450903910L; private String type; private String description; @@ -25,14 +25,14 @@ public class MessagingException * @param reason The reason for throwing exception * @param context The http context of the API exception */ - public MessagingException(String reason, HttpContext context) { + public MessagingExceptionErrorException(String reason, HttpContext context) { super(reason, context); } /** * Getter for Type. - * @return Returns the String + * @return Returns the String */ @JsonGetter("type") public String getType() { @@ -41,16 +41,16 @@ public String getType() { /** * Setter for Type. - * @param value Value for String + * @param type Value for String */ @JsonSetter("type") - private void setType(String value) { - this.type = value; + private void setType(String type) { + this.type = type; } /** * Getter for Description. - * @return Returns the String + * @return Returns the String */ @JsonGetter("description") public String getDescription() { @@ -59,10 +59,10 @@ public String getDescription() { /** * Setter for Description. - * @param value Value for String + * @param description Value for String */ @JsonSetter("description") - private void setDescription(String value) { - this.description = value; + private void setDescription(String description) { + this.description = description; } } diff --git a/src/main/java/com/bandwidth/messaging/models/BandwidthCallbackMessage.java b/src/main/java/com/bandwidth/messaging/models/BandwidthCallbackMessage.java index 7e45f191..7fc89225 100644 --- a/src/main/java/com/bandwidth/messaging/models/BandwidthCallbackMessage.java +++ b/src/main/java/com/bandwidth/messaging/models/BandwidthCallbackMessage.java @@ -7,17 +7,24 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for BandwidthCallbackMessage type. */ public class BandwidthCallbackMessage { + @JsonInclude(JsonInclude.Include.NON_NULL) private String time; + @JsonInclude(JsonInclude.Include.NON_NULL) private String type; + @JsonInclude(JsonInclude.Include.NON_NULL) private String to; + @JsonInclude(JsonInclude.Include.NON_NULL) private String errorCode; + @JsonInclude(JsonInclude.Include.NON_NULL) private String description; + @JsonInclude(JsonInclude.Include.NON_NULL) private BandwidthMessage message; /** @@ -28,12 +35,12 @@ public BandwidthCallbackMessage() { /** * Initialization constructor. - * @param time String value for time. - * @param type String value for type. - * @param to String value for to. - * @param errorCode String value for errorCode. - * @param description String value for description. - * @param message BandwidthMessage value for message. + * @param time String value for time. + * @param type String value for type. + * @param to String value for to. + * @param errorCode String value for errorCode. + * @param description String value for description. + * @param message BandwidthMessage value for message. */ public BandwidthCallbackMessage( String time, @@ -56,7 +63,7 @@ public BandwidthCallbackMessage( */ @JsonGetter("time") public String getTime() { - return this.time; + return time; } /** @@ -74,7 +81,7 @@ public void setTime(String time) { */ @JsonGetter("type") public String getType() { - return this.type; + return type; } /** @@ -92,7 +99,7 @@ public void setType(String type) { */ @JsonGetter("to") public String getTo() { - return this.to; + return to; } /** @@ -110,7 +117,7 @@ public void setTo(String to) { */ @JsonGetter("errorCode") public String getErrorCode() { - return this.errorCode; + return errorCode; } /** @@ -128,7 +135,7 @@ public void setErrorCode(String errorCode) { */ @JsonGetter("description") public String getDescription() { - return this.description; + return description; } /** @@ -146,7 +153,7 @@ public void setDescription(String description) { */ @JsonGetter("message") public BandwidthMessage getMessage() { - return this.message; + return message; } /** @@ -200,7 +207,7 @@ public static class Builder { /** * Setter for time. - * @param time String value for time. + * @param time String value for time. * @return Builder */ public Builder time(String time) { @@ -210,7 +217,7 @@ public Builder time(String time) { /** * Setter for type. - * @param type String value for type. + * @param type String value for type. * @return Builder */ public Builder type(String type) { @@ -220,7 +227,7 @@ public Builder type(String type) { /** * Setter for to. - * @param to String value for to. + * @param to String value for to. * @return Builder */ public Builder to(String to) { @@ -230,7 +237,7 @@ public Builder to(String to) { /** * Setter for errorCode. - * @param errorCode String value for errorCode. + * @param errorCode String value for errorCode. * @return Builder */ public Builder errorCode(String errorCode) { @@ -240,7 +247,7 @@ public Builder errorCode(String errorCode) { /** * Setter for description. - * @param description String value for description. + * @param description String value for description. * @return Builder */ public Builder description(String description) { @@ -250,7 +257,7 @@ public Builder description(String description) { /** * Setter for message. - * @param message BandwidthMessage value for message. + * @param message BandwidthMessage value for message. * @return Builder */ public Builder message(BandwidthMessage message) { diff --git a/src/main/java/com/bandwidth/messaging/models/BandwidthMessage.java b/src/main/java/com/bandwidth/messaging/models/BandwidthMessage.java index dae9cbfe..e4092496 100644 --- a/src/main/java/com/bandwidth/messaging/models/BandwidthMessage.java +++ b/src/main/java/com/bandwidth/messaging/models/BandwidthMessage.java @@ -7,6 +7,7 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import java.util.List; @@ -14,17 +15,29 @@ * This is a model class for BandwidthMessage type. */ public class BandwidthMessage { + @JsonInclude(JsonInclude.Include.NON_NULL) private String id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String owner; + @JsonInclude(JsonInclude.Include.NON_NULL) private String applicationId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String time; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer segmentCount; + @JsonInclude(JsonInclude.Include.NON_NULL) private String direction; + @JsonInclude(JsonInclude.Include.NON_NULL) private List to; + @JsonInclude(JsonInclude.Include.NON_NULL) private String from; + @JsonInclude(JsonInclude.Include.NON_NULL) private List media; + @JsonInclude(JsonInclude.Include.NON_NULL) private String text; + @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; + @JsonInclude(JsonInclude.Include.NON_NULL) private String priority; /** @@ -35,18 +48,18 @@ public BandwidthMessage() { /** * Initialization constructor. - * @param id String value for id. - * @param owner String value for owner. - * @param applicationId String value for applicationId. - * @param time String value for time. - * @param segmentCount Integer value for segmentCount. - * @param direction String value for direction. - * @param to List of String value for to. - * @param from String value for from. - * @param media List of String value for media. - * @param text String value for text. - * @param tag String value for tag. - * @param priority String value for priority. + * @param id String value for id. + * @param owner String value for owner. + * @param applicationId String value for applicationId. + * @param time String value for time. + * @param segmentCount Integer value for segmentCount. + * @param direction String value for direction. + * @param to List of String value for to. + * @param from String value for from. + * @param media List of String value for media. + * @param text String value for text. + * @param tag String value for tag. + * @param priority String value for priority. */ public BandwidthMessage( String id, @@ -82,7 +95,7 @@ public BandwidthMessage( */ @JsonGetter("id") public String getId() { - return this.id; + return id; } /** @@ -102,7 +115,7 @@ public void setId(String id) { */ @JsonGetter("owner") public String getOwner() { - return this.owner; + return owner; } /** @@ -122,7 +135,7 @@ public void setOwner(String owner) { */ @JsonGetter("applicationId") public String getApplicationId() { - return this.applicationId; + return applicationId; } /** @@ -142,7 +155,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("time") public String getTime() { - return this.time; + return time; } /** @@ -163,7 +176,7 @@ public void setTime(String time) { */ @JsonGetter("segmentCount") public Integer getSegmentCount() { - return this.segmentCount; + return segmentCount; } /** @@ -184,7 +197,7 @@ public void setSegmentCount(Integer segmentCount) { */ @JsonGetter("direction") public String getDirection() { - return this.direction; + return direction; } /** @@ -204,7 +217,7 @@ public void setDirection(String direction) { */ @JsonGetter("to") public List getTo() { - return this.to; + return to; } /** @@ -224,7 +237,7 @@ public void setTo(List to) { */ @JsonGetter("from") public String getFrom() { - return this.from; + return from; } /** @@ -244,7 +257,7 @@ public void setFrom(String from) { */ @JsonGetter("media") public List getMedia() { - return this.media; + return media; } /** @@ -264,7 +277,7 @@ public void setMedia(List media) { */ @JsonGetter("text") public String getText() { - return this.text; + return text; } /** @@ -284,7 +297,7 @@ public void setText(String text) { */ @JsonGetter("tag") public String getTag() { - return this.tag; + return tag; } /** @@ -304,7 +317,7 @@ public void setTag(String tag) { */ @JsonGetter("priority") public String getPriority() { - return this.priority; + return priority; } /** @@ -372,7 +385,7 @@ public static class Builder { /** * Setter for id. - * @param id String value for id. + * @param id String value for id. * @return Builder */ public Builder id(String id) { @@ -382,7 +395,7 @@ public Builder id(String id) { /** * Setter for owner. - * @param owner String value for owner. + * @param owner String value for owner. * @return Builder */ public Builder owner(String owner) { @@ -392,7 +405,7 @@ public Builder owner(String owner) { /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -402,7 +415,7 @@ public Builder applicationId(String applicationId) { /** * Setter for time. - * @param time String value for time. + * @param time String value for time. * @return Builder */ public Builder time(String time) { @@ -412,7 +425,7 @@ public Builder time(String time) { /** * Setter for segmentCount. - * @param segmentCount Integer value for segmentCount. + * @param segmentCount Integer value for segmentCount. * @return Builder */ public Builder segmentCount(Integer segmentCount) { @@ -422,7 +435,7 @@ public Builder segmentCount(Integer segmentCount) { /** * Setter for direction. - * @param direction String value for direction. + * @param direction String value for direction. * @return Builder */ public Builder direction(String direction) { @@ -432,7 +445,7 @@ public Builder direction(String direction) { /** * Setter for to. - * @param to List of String value for to. + * @param to List of String value for to. * @return Builder */ public Builder to(List to) { @@ -442,7 +455,7 @@ public Builder to(List to) { /** * Setter for from. - * @param from String value for from. + * @param from String value for from. * @return Builder */ public Builder from(String from) { @@ -452,7 +465,7 @@ public Builder from(String from) { /** * Setter for media. - * @param media List of String value for media. + * @param media List of String value for media. * @return Builder */ public Builder media(List media) { @@ -462,7 +475,7 @@ public Builder media(List media) { /** * Setter for text. - * @param text String value for text. + * @param text String value for text. * @return Builder */ public Builder text(String text) { @@ -472,7 +485,7 @@ public Builder text(String text) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { @@ -482,7 +495,7 @@ public Builder tag(String tag) { /** * Setter for priority. - * @param priority String value for priority. + * @param priority String value for priority. * @return Builder */ public Builder priority(String priority) { diff --git a/src/main/java/com/bandwidth/messaging/models/BandwidthMessageItem.java b/src/main/java/com/bandwidth/messaging/models/BandwidthMessageItem.java index b2743397..8348ef78 100644 --- a/src/main/java/com/bandwidth/messaging/models/BandwidthMessageItem.java +++ b/src/main/java/com/bandwidth/messaging/models/BandwidthMessageItem.java @@ -7,22 +7,34 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for BandwidthMessageItem type. */ public class BandwidthMessageItem { + @JsonInclude(JsonInclude.Include.NON_NULL) private String messageId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String accountId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String sourceTn; + @JsonInclude(JsonInclude.Include.NON_NULL) private String destinationTn; + @JsonInclude(JsonInclude.Include.NON_NULL) private String messageStatus; + @JsonInclude(JsonInclude.Include.NON_NULL) private String messageDirection; + @JsonInclude(JsonInclude.Include.NON_NULL) private String messageType; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer segmentCount; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer errorCode; + @JsonInclude(JsonInclude.Include.NON_NULL) private String receiveTime; + @JsonInclude(JsonInclude.Include.NON_NULL) private String carrierName; /** @@ -33,17 +45,17 @@ public BandwidthMessageItem() { /** * Initialization constructor. - * @param messageId String value for messageId. - * @param accountId String value for accountId. - * @param sourceTn String value for sourceTn. - * @param destinationTn String value for destinationTn. - * @param messageStatus String value for messageStatus. - * @param messageDirection String value for messageDirection. - * @param messageType String value for messageType. - * @param segmentCount Integer value for segmentCount. - * @param errorCode Integer value for errorCode. - * @param receiveTime String value for receiveTime. - * @param carrierName String value for carrierName. + * @param messageId String value for messageId. + * @param accountId String value for accountId. + * @param sourceTn String value for sourceTn. + * @param destinationTn String value for destinationTn. + * @param messageStatus String value for messageStatus. + * @param messageDirection String value for messageDirection. + * @param messageType String value for messageType. + * @param segmentCount Integer value for segmentCount. + * @param errorCode Integer value for errorCode. + * @param receiveTime String value for receiveTime. + * @param carrierName String value for carrierName. */ public BandwidthMessageItem( String messageId, @@ -77,7 +89,7 @@ public BandwidthMessageItem( */ @JsonGetter("messageId") public String getMessageId() { - return this.messageId; + return messageId; } /** @@ -97,7 +109,7 @@ public void setMessageId(String messageId) { */ @JsonGetter("accountId") public String getAccountId() { - return this.accountId; + return accountId; } /** @@ -117,7 +129,7 @@ public void setAccountId(String accountId) { */ @JsonGetter("sourceTn") public String getSourceTn() { - return this.sourceTn; + return sourceTn; } /** @@ -137,7 +149,7 @@ public void setSourceTn(String sourceTn) { */ @JsonGetter("destinationTn") public String getDestinationTn() { - return this.destinationTn; + return destinationTn; } /** @@ -157,7 +169,7 @@ public void setDestinationTn(String destinationTn) { */ @JsonGetter("messageStatus") public String getMessageStatus() { - return this.messageStatus; + return messageStatus; } /** @@ -177,7 +189,7 @@ public void setMessageStatus(String messageStatus) { */ @JsonGetter("messageDirection") public String getMessageDirection() { - return this.messageDirection; + return messageDirection; } /** @@ -197,7 +209,7 @@ public void setMessageDirection(String messageDirection) { */ @JsonGetter("messageType") public String getMessageType() { - return this.messageType; + return messageType; } /** @@ -217,7 +229,7 @@ public void setMessageType(String messageType) { */ @JsonGetter("segmentCount") public Integer getSegmentCount() { - return this.segmentCount; + return segmentCount; } /** @@ -237,7 +249,7 @@ public void setSegmentCount(Integer segmentCount) { */ @JsonGetter("errorCode") public Integer getErrorCode() { - return this.errorCode; + return errorCode; } /** @@ -257,7 +269,7 @@ public void setErrorCode(Integer errorCode) { */ @JsonGetter("receiveTime") public String getReceiveTime() { - return this.receiveTime; + return receiveTime; } /** @@ -277,7 +289,7 @@ public void setReceiveTime(String receiveTime) { */ @JsonGetter("carrierName") public String getCarrierName() { - return this.carrierName; + return carrierName; } /** @@ -344,7 +356,7 @@ public static class Builder { /** * Setter for messageId. - * @param messageId String value for messageId. + * @param messageId String value for messageId. * @return Builder */ public Builder messageId(String messageId) { @@ -354,7 +366,7 @@ public Builder messageId(String messageId) { /** * Setter for accountId. - * @param accountId String value for accountId. + * @param accountId String value for accountId. * @return Builder */ public Builder accountId(String accountId) { @@ -364,7 +376,7 @@ public Builder accountId(String accountId) { /** * Setter for sourceTn. - * @param sourceTn String value for sourceTn. + * @param sourceTn String value for sourceTn. * @return Builder */ public Builder sourceTn(String sourceTn) { @@ -374,7 +386,7 @@ public Builder sourceTn(String sourceTn) { /** * Setter for destinationTn. - * @param destinationTn String value for destinationTn. + * @param destinationTn String value for destinationTn. * @return Builder */ public Builder destinationTn(String destinationTn) { @@ -384,7 +396,7 @@ public Builder destinationTn(String destinationTn) { /** * Setter for messageStatus. - * @param messageStatus String value for messageStatus. + * @param messageStatus String value for messageStatus. * @return Builder */ public Builder messageStatus(String messageStatus) { @@ -394,7 +406,7 @@ public Builder messageStatus(String messageStatus) { /** * Setter for messageDirection. - * @param messageDirection String value for messageDirection. + * @param messageDirection String value for messageDirection. * @return Builder */ public Builder messageDirection(String messageDirection) { @@ -404,7 +416,7 @@ public Builder messageDirection(String messageDirection) { /** * Setter for messageType. - * @param messageType String value for messageType. + * @param messageType String value for messageType. * @return Builder */ public Builder messageType(String messageType) { @@ -414,7 +426,7 @@ public Builder messageType(String messageType) { /** * Setter for segmentCount. - * @param segmentCount Integer value for segmentCount. + * @param segmentCount Integer value for segmentCount. * @return Builder */ public Builder segmentCount(Integer segmentCount) { @@ -424,7 +436,7 @@ public Builder segmentCount(Integer segmentCount) { /** * Setter for errorCode. - * @param errorCode Integer value for errorCode. + * @param errorCode Integer value for errorCode. * @return Builder */ public Builder errorCode(Integer errorCode) { @@ -434,7 +446,7 @@ public Builder errorCode(Integer errorCode) { /** * Setter for receiveTime. - * @param receiveTime String value for receiveTime. + * @param receiveTime String value for receiveTime. * @return Builder */ public Builder receiveTime(String receiveTime) { @@ -444,7 +456,7 @@ public Builder receiveTime(String receiveTime) { /** * Setter for carrierName. - * @param carrierName String value for carrierName. + * @param carrierName String value for carrierName. * @return Builder */ public Builder carrierName(String carrierName) { diff --git a/src/main/java/com/bandwidth/messaging/models/BandwidthMessagesList.java b/src/main/java/com/bandwidth/messaging/models/BandwidthMessagesList.java index ed1eaacc..4e643c73 100644 --- a/src/main/java/com/bandwidth/messaging/models/BandwidthMessagesList.java +++ b/src/main/java/com/bandwidth/messaging/models/BandwidthMessagesList.java @@ -7,6 +7,7 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import java.util.List; @@ -14,8 +15,11 @@ * This is a model class for BandwidthMessagesList type. */ public class BandwidthMessagesList { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer totalCount; + @JsonInclude(JsonInclude.Include.NON_NULL) private PageInfo pageInfo; + @JsonInclude(JsonInclude.Include.NON_NULL) private List messages; /** @@ -26,9 +30,9 @@ public BandwidthMessagesList() { /** * Initialization constructor. - * @param totalCount Integer value for totalCount. - * @param pageInfo PageInfo value for pageInfo. - * @param messages List of BandwidthMessageItem value for messages. + * @param totalCount Integer value for totalCount. + * @param pageInfo PageInfo value for pageInfo. + * @param messages List of BandwidthMessageItem value for messages. */ public BandwidthMessagesList( Integer totalCount, @@ -46,7 +50,7 @@ public BandwidthMessagesList( */ @JsonGetter("totalCount") public Integer getTotalCount() { - return this.totalCount; + return totalCount; } /** @@ -65,7 +69,7 @@ public void setTotalCount(Integer totalCount) { */ @JsonGetter("pageInfo") public PageInfo getPageInfo() { - return this.pageInfo; + return pageInfo; } /** @@ -83,7 +87,7 @@ public void setPageInfo(PageInfo pageInfo) { */ @JsonGetter("messages") public List getMessages() { - return this.messages; + return messages; } /** @@ -130,7 +134,7 @@ public static class Builder { /** * Setter for totalCount. - * @param totalCount Integer value for totalCount. + * @param totalCount Integer value for totalCount. * @return Builder */ public Builder totalCount(Integer totalCount) { @@ -140,7 +144,7 @@ public Builder totalCount(Integer totalCount) { /** * Setter for pageInfo. - * @param pageInfo PageInfo value for pageInfo. + * @param pageInfo PageInfo value for pageInfo. * @return Builder */ public Builder pageInfo(PageInfo pageInfo) { @@ -150,7 +154,7 @@ public Builder pageInfo(PageInfo pageInfo) { /** * Setter for messages. - * @param messages List of BandwidthMessageItem value for messages. + * @param messages List of BandwidthMessageItem value for messages. * @return Builder */ public Builder messages(List messages) { diff --git a/src/main/java/com/bandwidth/messaging/models/DeferredResult.java b/src/main/java/com/bandwidth/messaging/models/DeferredResult.java index d3825924..2b4d5ce6 100644 --- a/src/main/java/com/bandwidth/messaging/models/DeferredResult.java +++ b/src/main/java/com/bandwidth/messaging/models/DeferredResult.java @@ -7,13 +7,16 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for DeferredResult type. */ public class DeferredResult { + @JsonInclude(JsonInclude.Include.NON_NULL) private Object result; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean setOrExpired; /** @@ -24,8 +27,8 @@ public DeferredResult() { /** * Initialization constructor. - * @param result Object value for result. - * @param setOrExpired Boolean value for setOrExpired. + * @param result Object value for result. + * @param setOrExpired Boolean value for setOrExpired. */ public DeferredResult( Object result, @@ -40,7 +43,7 @@ public DeferredResult( */ @JsonGetter("result") public Object getResult() { - return this.result; + return result; } /** @@ -58,7 +61,7 @@ public void setResult(Object result) { */ @JsonGetter("setOrExpired") public Boolean getSetOrExpired() { - return this.setOrExpired; + return setOrExpired; } /** @@ -102,7 +105,7 @@ public static class Builder { /** * Setter for result. - * @param result Object value for result. + * @param result Object value for result. * @return Builder */ public Builder result(Object result) { @@ -112,7 +115,7 @@ public Builder result(Object result) { /** * Setter for setOrExpired. - * @param setOrExpired Boolean value for setOrExpired. + * @param setOrExpired Boolean value for setOrExpired. * @return Builder */ public Builder setOrExpired(Boolean setOrExpired) { diff --git a/src/main/java/com/bandwidth/messaging/models/Media.java b/src/main/java/com/bandwidth/messaging/models/Media.java index a6281ee3..be4d0197 100644 --- a/src/main/java/com/bandwidth/messaging/models/Media.java +++ b/src/main/java/com/bandwidth/messaging/models/Media.java @@ -7,23 +7,19 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; -import java.util.List; /** * This is a model class for Media type. */ public class Media { - private Object inputStream; + @JsonInclude(JsonInclude.Include.NON_NULL) private String content; - private String url; - private String contentLength; - private String contentType; - private List tags; - private String userId; + @JsonInclude(JsonInclude.Include.NON_NULL) + private Integer contentLength; + @JsonInclude(JsonInclude.Include.NON_NULL) private String mediaName; - private String mediaId; - private String cacheControl; /** * Default constructor. @@ -33,56 +29,17 @@ public Media() { /** * Initialization constructor. - * @param inputStream Object value for inputStream. - * @param content String value for content. - * @param url String value for url. - * @param contentLength String value for contentLength. - * @param contentType String value for contentType. - * @param tags List of Tag value for tags. - * @param userId String value for userId. - * @param mediaName String value for mediaName. - * @param mediaId String value for mediaId. - * @param cacheControl String value for cacheControl. + * @param content String value for content. + * @param contentLength Integer value for contentLength. + * @param mediaName String value for mediaName. */ public Media( - Object inputStream, String content, - String url, - String contentLength, - String contentType, - List tags, - String userId, - String mediaName, - String mediaId, - String cacheControl) { - this.inputStream = inputStream; + Integer contentLength, + String mediaName) { this.content = content; - this.url = url; this.contentLength = contentLength; - this.contentType = contentType; - this.tags = tags; - this.userId = userId; this.mediaName = mediaName; - this.mediaId = mediaId; - this.cacheControl = cacheControl; - } - - /** - * Getter for InputStream. - * @return Returns the Object - */ - @JsonGetter("inputStream") - public Object getInputStream() { - return this.inputStream; - } - - /** - * Setter for InputStream. - * @param inputStream Value for Object - */ - @JsonSetter("inputStream") - public void setInputStream(Object inputStream) { - this.inputStream = inputStream; } /** @@ -91,7 +48,7 @@ public void setInputStream(Object inputStream) { */ @JsonGetter("content") public String getContent() { - return this.content; + return content; } /** @@ -103,105 +60,31 @@ public void setContent(String content) { this.content = content; } - /** - * Getter for Url. - * @return Returns the String - */ - @JsonGetter("url") - public String getUrl() { - return this.url; - } - - /** - * Setter for Url. - * @param url Value for String - */ - @JsonSetter("url") - public void setUrl(String url) { - this.url = url; - } - /** * Getter for ContentLength. - * @return Returns the String + * @return Returns the Integer */ @JsonGetter("contentLength") - public String getContentLength() { - return this.contentLength; + public Integer getContentLength() { + return contentLength; } /** * Setter for ContentLength. - * @param contentLength Value for String + * @param contentLength Value for Integer */ @JsonSetter("contentLength") - public void setContentLength(String contentLength) { + public void setContentLength(Integer contentLength) { this.contentLength = contentLength; } - /** - * Getter for ContentType. - * @return Returns the String - */ - @JsonGetter("contentType") - public String getContentType() { - return this.contentType; - } - - /** - * Setter for ContentType. - * @param contentType Value for String - */ - @JsonSetter("contentType") - public void setContentType(String contentType) { - this.contentType = contentType; - } - - /** - * Getter for Tags. - * @return Returns the List of Tag - */ - @JsonGetter("tags") - public List getTags() { - return this.tags; - } - - /** - * Setter for Tags. - * @param tags Value for List of Tag - */ - @JsonSetter("tags") - public void setTags(List tags) { - this.tags = tags; - } - - /** - * Getter for UserId. - * User's account ID - * @return Returns the String - */ - @JsonGetter("userId") - public String getUserId() { - return this.userId; - } - - /** - * Setter for UserId. - * User's account ID - * @param userId Value for String - */ - @JsonSetter("userId") - public void setUserId(String userId) { - this.userId = userId; - } - /** * Getter for MediaName. * @return Returns the String */ @JsonGetter("mediaName") public String getMediaName() { - return this.mediaName; + return mediaName; } /** @@ -213,52 +96,14 @@ public void setMediaName(String mediaName) { this.mediaName = mediaName; } - /** - * Getter for MediaId. - * @return Returns the String - */ - @JsonGetter("mediaId") - public String getMediaId() { - return this.mediaId; - } - - /** - * Setter for MediaId. - * @param mediaId Value for String - */ - @JsonSetter("mediaId") - public void setMediaId(String mediaId) { - this.mediaId = mediaId; - } - - /** - * Getter for CacheControl. - * @return Returns the String - */ - @JsonGetter("cacheControl") - public String getCacheControl() { - return this.cacheControl; - } - - /** - * Setter for CacheControl. - * @param cacheControl Value for String - */ - @JsonSetter("cacheControl") - public void setCacheControl(String cacheControl) { - this.cacheControl = cacheControl; - } - /** * Converts this Media into string format. * @return String representation of this class */ @Override public String toString() { - return "Media [" + "inputStream=" + inputStream + ", content=" + content + ", url=" + url - + ", contentLength=" + contentLength + ", contentType=" + contentType + ", tags=" - + tags + ", userId=" + userId + ", mediaName=" + mediaName + ", mediaId=" + mediaId - + ", cacheControl=" + cacheControl + "]"; + return "Media [" + "content=" + content + ", contentLength=" + contentLength + + ", mediaName=" + mediaName + "]"; } /** @@ -268,16 +113,9 @@ public String toString() { */ public Builder toBuilder() { Builder builder = new Builder() - .inputStream(getInputStream()) .content(getContent()) - .url(getUrl()) .contentLength(getContentLength()) - .contentType(getContentType()) - .tags(getTags()) - .userId(getUserId()) - .mediaName(getMediaName()) - .mediaId(getMediaId()) - .cacheControl(getCacheControl()); + .mediaName(getMediaName()); return builder; } @@ -285,32 +123,15 @@ public Builder toBuilder() { * Class to build instances of {@link Media}. */ public static class Builder { - private Object inputStream; private String content; - private String url; - private String contentLength; - private String contentType; - private List tags; - private String userId; + private Integer contentLength; private String mediaName; - private String mediaId; - private String cacheControl; - /** - * Setter for inputStream. - * @param inputStream Object value for inputStream. - * @return Builder - */ - public Builder inputStream(Object inputStream) { - this.inputStream = inputStream; - return this; - } - /** * Setter for content. - * @param content String value for content. + * @param content String value for content. * @return Builder */ public Builder content(String content) { @@ -318,59 +139,19 @@ public Builder content(String content) { return this; } - /** - * Setter for url. - * @param url String value for url. - * @return Builder - */ - public Builder url(String url) { - this.url = url; - return this; - } - /** * Setter for contentLength. - * @param contentLength String value for contentLength. + * @param contentLength Integer value for contentLength. * @return Builder */ - public Builder contentLength(String contentLength) { + public Builder contentLength(Integer contentLength) { this.contentLength = contentLength; return this; } - /** - * Setter for contentType. - * @param contentType String value for contentType. - * @return Builder - */ - public Builder contentType(String contentType) { - this.contentType = contentType; - return this; - } - - /** - * Setter for tags. - * @param tags List of Tag value for tags. - * @return Builder - */ - public Builder tags(List tags) { - this.tags = tags; - return this; - } - - /** - * Setter for userId. - * @param userId String value for userId. - * @return Builder - */ - public Builder userId(String userId) { - this.userId = userId; - return this; - } - /** * Setter for mediaName. - * @param mediaName String value for mediaName. + * @param mediaName String value for mediaName. * @return Builder */ public Builder mediaName(String mediaName) { @@ -378,33 +159,12 @@ public Builder mediaName(String mediaName) { return this; } - /** - * Setter for mediaId. - * @param mediaId String value for mediaId. - * @return Builder - */ - public Builder mediaId(String mediaId) { - this.mediaId = mediaId; - return this; - } - - /** - * Setter for cacheControl. - * @param cacheControl String value for cacheControl. - * @return Builder - */ - public Builder cacheControl(String cacheControl) { - this.cacheControl = cacheControl; - return this; - } - /** * Builds a new {@link Media} object using the set fields. * @return {@link Media} */ public Media build() { - return new Media(inputStream, content, url, contentLength, contentType, tags, userId, - mediaName, mediaId, cacheControl); + return new Media(content, contentLength, mediaName); } } } diff --git a/src/main/java/com/bandwidth/messaging/models/MessageRequest.java b/src/main/java/com/bandwidth/messaging/models/MessageRequest.java index 19817550..ad488e06 100644 --- a/src/main/java/com/bandwidth/messaging/models/MessageRequest.java +++ b/src/main/java/com/bandwidth/messaging/models/MessageRequest.java @@ -7,6 +7,7 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import java.util.List; @@ -17,9 +18,13 @@ public class MessageRequest { private String applicationId; private List to; private String from; + @JsonInclude(JsonInclude.Include.NON_NULL) private String text; + @JsonInclude(JsonInclude.Include.NON_NULL) private List media; + @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; + @JsonInclude(JsonInclude.Include.NON_NULL) private PriorityEnum priority; /** @@ -30,13 +35,13 @@ public MessageRequest() { /** * Initialization constructor. - * @param applicationId String value for applicationId. - * @param to List of String value for to. - * @param from String value for from. - * @param text String value for text. - * @param media List of String value for media. - * @param tag String value for tag. - * @param priority PriorityEnum value for priority. + * @param applicationId String value for applicationId. + * @param to List of String value for to. + * @param from String value for from. + * @param text String value for text. + * @param media List of String value for media. + * @param tag String value for tag. + * @param priority PriorityEnum value for priority. */ public MessageRequest( String applicationId, @@ -63,7 +68,7 @@ public MessageRequest( */ @JsonGetter("applicationId") public String getApplicationId() { - return this.applicationId; + return applicationId; } /** @@ -84,7 +89,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("to") public List getTo() { - return this.to; + return to; } /** @@ -104,7 +109,7 @@ public void setTo(List to) { */ @JsonGetter("from") public String getFrom() { - return this.from; + return from; } /** @@ -124,7 +129,7 @@ public void setFrom(String from) { */ @JsonGetter("text") public String getText() { - return this.text; + return text; } /** @@ -144,7 +149,7 @@ public void setText(String text) { */ @JsonGetter("media") public List getMedia() { - return this.media; + return media; } /** @@ -164,7 +169,7 @@ public void setMedia(List media) { */ @JsonGetter("tag") public String getTag() { - return this.tag; + return tag; } /** @@ -185,7 +190,7 @@ public void setTag(String tag) { */ @JsonGetter("priority") public PriorityEnum getPriority() { - return this.priority; + return priority; } /** @@ -244,13 +249,11 @@ public Builder() { /** * Initialization constructor. - * @param applicationId String value for applicationId. - * @param to List of String value for to. - * @param from String value for from. + * @param applicationId String value for applicationId. + * @param to List of String value for to. + * @param from String value for from. */ - public Builder(String applicationId, - List to, - String from) { + public Builder(String applicationId, List to, String from) { this.applicationId = applicationId; this.to = to; this.from = from; @@ -258,7 +261,7 @@ public Builder(String applicationId, /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -268,7 +271,7 @@ public Builder applicationId(String applicationId) { /** * Setter for to. - * @param to List of String value for to. + * @param to List of String value for to. * @return Builder */ public Builder to(List to) { @@ -278,7 +281,7 @@ public Builder to(List to) { /** * Setter for from. - * @param from String value for from. + * @param from String value for from. * @return Builder */ public Builder from(String from) { @@ -288,7 +291,7 @@ public Builder from(String from) { /** * Setter for text. - * @param text String value for text. + * @param text String value for text. * @return Builder */ public Builder text(String text) { @@ -298,7 +301,7 @@ public Builder text(String text) { /** * Setter for media. - * @param media List of String value for media. + * @param media List of String value for media. * @return Builder */ public Builder media(List media) { @@ -308,7 +311,7 @@ public Builder media(List media) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { @@ -318,7 +321,7 @@ public Builder tag(String tag) { /** * Setter for priority. - * @param priority PriorityEnum value for priority. + * @param priority PriorityEnum value for priority. * @return Builder */ public Builder priority(PriorityEnum priority) { diff --git a/src/main/java/com/bandwidth/messaging/models/MessagingException.java b/src/main/java/com/bandwidth/messaging/models/MessagingException.java new file mode 100644 index 00000000..4287e3a6 --- /dev/null +++ b/src/main/java/com/bandwidth/messaging/models/MessagingException.java @@ -0,0 +1,143 @@ +/* + * BandwidthLib + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +package com.bandwidth.messaging.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for MessagingException type. + */ +public class MessagingException { + private String type; + private String description; + + /** + * Default constructor. + */ + public MessagingException() { + } + + /** + * Initialization constructor. + * @param type String value for type. + * @param description String value for description. + */ + public MessagingException( + String type, + String description) { + this.type = type; + this.description = description; + } + + /** + * Getter for Type. + * @return Returns the String + */ + @JsonGetter("type") + public String getType() { + return type; + } + + /** + * Setter for Type. + * @param type Value for String + */ + @JsonSetter("type") + public void setType(String type) { + this.type = type; + } + + /** + * Getter for Description. + * @return Returns the String + */ + @JsonGetter("description") + public String getDescription() { + return description; + } + + /** + * Setter for Description. + * @param description Value for String + */ + @JsonSetter("description") + public void setDescription(String description) { + this.description = description; + } + + /** + * Converts this MessagingException into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "MessagingException [" + "type=" + type + ", description=" + description + "]"; + } + + /** + * Builds a new {@link MessagingException.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link MessagingException.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(type, description); + return builder; + } + + /** + * Class to build instances of {@link MessagingException}. + */ + public static class Builder { + private String type; + private String description; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param type String value for type. + * @param description String value for description. + */ + public Builder(String type, String description) { + this.type = type; + this.description = description; + } + + /** + * Setter for type. + * @param type String value for type. + * @return Builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Setter for description. + * @param description String value for description. + * @return Builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Builds a new {@link MessagingException} object using the set fields. + * @return {@link MessagingException} + */ + public MessagingException build() { + return new MessagingException(type, description); + } + } +} diff --git a/src/main/java/com/bandwidth/messaging/models/PageInfo.java b/src/main/java/com/bandwidth/messaging/models/PageInfo.java index 70d01c36..82c907b1 100644 --- a/src/main/java/com/bandwidth/messaging/models/PageInfo.java +++ b/src/main/java/com/bandwidth/messaging/models/PageInfo.java @@ -7,15 +7,20 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for PageInfo type. */ public class PageInfo { + @JsonInclude(JsonInclude.Include.NON_NULL) private String prevPage; + @JsonInclude(JsonInclude.Include.NON_NULL) private String nextPage; + @JsonInclude(JsonInclude.Include.NON_NULL) private String prevPageToken; + @JsonInclude(JsonInclude.Include.NON_NULL) private String nextPageToken; /** @@ -26,10 +31,10 @@ public PageInfo() { /** * Initialization constructor. - * @param prevPage String value for prevPage. - * @param nextPage String value for nextPage. - * @param prevPageToken String value for prevPageToken. - * @param nextPageToken String value for nextPageToken. + * @param prevPage String value for prevPage. + * @param nextPage String value for nextPage. + * @param prevPageToken String value for prevPageToken. + * @param nextPageToken String value for nextPageToken. */ public PageInfo( String prevPage, @@ -49,7 +54,7 @@ public PageInfo( */ @JsonGetter("prevPage") public String getPrevPage() { - return this.prevPage; + return prevPage; } /** @@ -69,7 +74,7 @@ public void setPrevPage(String prevPage) { */ @JsonGetter("nextPage") public String getNextPage() { - return this.nextPage; + return nextPage; } /** @@ -89,7 +94,7 @@ public void setNextPage(String nextPage) { */ @JsonGetter("prevPageToken") public String getPrevPageToken() { - return this.prevPageToken; + return prevPageToken; } /** @@ -109,7 +114,7 @@ public void setPrevPageToken(String prevPageToken) { */ @JsonGetter("nextPageToken") public String getNextPageToken() { - return this.nextPageToken; + return nextPageToken; } /** @@ -159,7 +164,7 @@ public static class Builder { /** * Setter for prevPage. - * @param prevPage String value for prevPage. + * @param prevPage String value for prevPage. * @return Builder */ public Builder prevPage(String prevPage) { @@ -169,7 +174,7 @@ public Builder prevPage(String prevPage) { /** * Setter for nextPage. - * @param nextPage String value for nextPage. + * @param nextPage String value for nextPage. * @return Builder */ public Builder nextPage(String nextPage) { @@ -179,7 +184,7 @@ public Builder nextPage(String nextPage) { /** * Setter for prevPageToken. - * @param prevPageToken String value for prevPageToken. + * @param prevPageToken String value for prevPageToken. * @return Builder */ public Builder prevPageToken(String prevPageToken) { @@ -189,7 +194,7 @@ public Builder prevPageToken(String prevPageToken) { /** * Setter for nextPageToken. - * @param nextPageToken String value for nextPageToken. + * @param nextPageToken String value for nextPageToken. * @return Builder */ public Builder nextPageToken(String nextPageToken) { diff --git a/src/main/java/com/bandwidth/messaging/models/Tag.java b/src/main/java/com/bandwidth/messaging/models/Tag.java index 6b1751d2..77ff1ac7 100644 --- a/src/main/java/com/bandwidth/messaging/models/Tag.java +++ b/src/main/java/com/bandwidth/messaging/models/Tag.java @@ -7,13 +7,16 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for Tag type. */ public class Tag { + @JsonInclude(JsonInclude.Include.NON_NULL) private String key; + @JsonInclude(JsonInclude.Include.NON_NULL) private String value; /** @@ -24,8 +27,8 @@ public Tag() { /** * Initialization constructor. - * @param key String value for key. - * @param value String value for value. + * @param key String value for key. + * @param value String value for value. */ public Tag( String key, @@ -40,7 +43,7 @@ public Tag( */ @JsonGetter("key") public String getKey() { - return this.key; + return key; } /** @@ -58,7 +61,7 @@ public void setKey(String key) { */ @JsonGetter("value") public String getValue() { - return this.value; + return value; } /** @@ -102,7 +105,7 @@ public static class Builder { /** * Setter for key. - * @param key String value for key. + * @param key String value for key. * @return Builder */ public Builder key(String key) { @@ -112,7 +115,7 @@ public Builder key(String key) { /** * Setter for value. - * @param value String value for value. + * @param value String value for value. * @return Builder */ public Builder value(String value) { diff --git a/src/main/java/com/bandwidth/twofactorauth/controllers/MFAController.java b/src/main/java/com/bandwidth/multifactorauth/controllers/MFAController.java similarity index 83% rename from src/main/java/com/bandwidth/twofactorauth/controllers/MFAController.java rename to src/main/java/com/bandwidth/multifactorauth/controllers/MFAController.java index 2d3ee34b..bf7f0244 100644 --- a/src/main/java/com/bandwidth/twofactorauth/controllers/MFAController.java +++ b/src/main/java/com/bandwidth/multifactorauth/controllers/MFAController.java @@ -4,7 +4,7 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.twofactorauth.controllers; +package com.bandwidth.multifactorauth.controllers; import com.bandwidth.ApiHelper; import com.bandwidth.AuthManager; @@ -20,14 +20,14 @@ import com.bandwidth.http.response.ApiResponse; import com.bandwidth.http.response.HttpResponse; import com.bandwidth.http.response.HttpStringResponse; -import com.bandwidth.twofactorauth.exceptions.ErrorWithRequestException; -import com.bandwidth.twofactorauth.exceptions.ForbiddenRequestException; -import com.bandwidth.twofactorauth.exceptions.UnauthorizedRequestException; -import com.bandwidth.twofactorauth.models.TwoFactorCodeRequestSchema; -import com.bandwidth.twofactorauth.models.TwoFactorMessagingResponse; -import com.bandwidth.twofactorauth.models.TwoFactorVerifyCodeResponse; -import com.bandwidth.twofactorauth.models.TwoFactorVerifyRequestSchema; -import com.bandwidth.twofactorauth.models.TwoFactorVoiceResponse; +import com.bandwidth.multifactorauth.exceptions.ErrorWithRequestErrorException; +import com.bandwidth.multifactorauth.exceptions.ForbiddenRequestErrorException; +import com.bandwidth.multifactorauth.exceptions.UnauthorizedRequestErrorException; +import com.bandwidth.multifactorauth.models.TwoFactorCodeRequestSchema; +import com.bandwidth.multifactorauth.models.TwoFactorMessagingResponse; +import com.bandwidth.multifactorauth.models.TwoFactorVerifyCodeResponse; +import com.bandwidth.multifactorauth.models.TwoFactorVerifyRequestSchema; +import com.bandwidth.multifactorauth.models.TwoFactorVoiceResponse; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import java.util.AbstractMap.SimpleEntry; @@ -75,7 +75,7 @@ public ApiResponse createVoiceTwoFactor( final String accountId, final TwoFactorCodeRequestSchema body) throws ApiException, IOException { HttpRequest request = buildCreateVoiceTwoFactorRequest(accountId, body); - authManagers.get("twoFactorAuth").apply(request); + authManagers.get("multiFactorAuth").apply(request); HttpResponse response = getClientInstance().executeAsString(request); HttpContext context = new HttpContext(request, response); @@ -93,7 +93,7 @@ public CompletableFuture> createVoiceTwoFact final String accountId, final TwoFactorCodeRequestSchema body) { return makeHttpCallAsync(() -> buildCreateVoiceTwoFactorRequest(accountId, body), - req -> authManagers.get("twoFactorAuth").applyAsync(req) + req -> authManagers.get("multiFactorAuth").applyAsync(req) .thenCompose(request -> getClientInstance() .executeAsStringAsync(request)), context -> handleCreateVoiceTwoFactorResponse(context)); @@ -106,7 +106,7 @@ private HttpRequest buildCreateVoiceTwoFactorRequest( final String accountId, final TwoFactorCodeRequestSchema body) throws JsonProcessingException { //the base uri for api requests - String baseUri = config.getBaseUri(Server.TWOFACTORAUTHDEFAULT); + String baseUri = config.getBaseUri(Server.MULTIFACTORAUTHDEFAULT); //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri @@ -153,16 +153,16 @@ private ApiResponse handleCreateVoiceTwoFactorResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ErrorWithRequestException("If there is any issue with values passed in by the user", context); + throw new ErrorWithRequestErrorException("If there is any issue with values passed in by the user", context); } if (responseCode == 401) { - throw new UnauthorizedRequestException("Authentication is either incorrect or not present", context); + throw new UnauthorizedRequestErrorException("Authentication is either incorrect or not present", context); } if (responseCode == 403) { - throw new ForbiddenRequestException("The user is not authorized to access this resource", context); + throw new ForbiddenRequestErrorException("The user is not authorized to access this resource", context); } if (responseCode == 500) { - throw new ErrorWithRequestException("An internal server error occurred", context); + throw new ErrorWithRequestErrorException("An internal server error occurred", context); } //handle errors defined at the API level validateResponse(response, context); @@ -187,7 +187,7 @@ public ApiResponse createMessagingTwoFactor( final String accountId, final TwoFactorCodeRequestSchema body) throws ApiException, IOException { HttpRequest request = buildCreateMessagingTwoFactorRequest(accountId, body); - authManagers.get("twoFactorAuth").apply(request); + authManagers.get("multiFactorAuth").apply(request); HttpResponse response = getClientInstance().executeAsString(request); HttpContext context = new HttpContext(request, response); @@ -205,7 +205,7 @@ public CompletableFuture> createMessagin final String accountId, final TwoFactorCodeRequestSchema body) { return makeHttpCallAsync(() -> buildCreateMessagingTwoFactorRequest(accountId, body), - req -> authManagers.get("twoFactorAuth").applyAsync(req) + req -> authManagers.get("multiFactorAuth").applyAsync(req) .thenCompose(request -> getClientInstance() .executeAsStringAsync(request)), context -> handleCreateMessagingTwoFactorResponse(context)); @@ -218,7 +218,7 @@ private HttpRequest buildCreateMessagingTwoFactorRequest( final String accountId, final TwoFactorCodeRequestSchema body) throws JsonProcessingException { //the base uri for api requests - String baseUri = config.getBaseUri(Server.TWOFACTORAUTHDEFAULT); + String baseUri = config.getBaseUri(Server.MULTIFACTORAUTHDEFAULT); //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri @@ -265,16 +265,16 @@ private ApiResponse handleCreateMessagingTwoFactorRe int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ErrorWithRequestException("If there is any issue with values passed in by the user", context); + throw new ErrorWithRequestErrorException("If there is any issue with values passed in by the user", context); } if (responseCode == 401) { - throw new UnauthorizedRequestException("Authentication is either incorrect or not present", context); + throw new UnauthorizedRequestErrorException("Authentication is either incorrect or not present", context); } if (responseCode == 403) { - throw new ForbiddenRequestException("The user is not authorized to access this resource", context); + throw new ForbiddenRequestErrorException("The user is not authorized to access this resource", context); } if (responseCode == 500) { - throw new ErrorWithRequestException("An internal server error occurred", context); + throw new ErrorWithRequestErrorException("An internal server error occurred", context); } //handle errors defined at the API level validateResponse(response, context); @@ -299,7 +299,7 @@ public ApiResponse createVerifyTwoFactor( final String accountId, final TwoFactorVerifyRequestSchema body) throws ApiException, IOException { HttpRequest request = buildCreateVerifyTwoFactorRequest(accountId, body); - authManagers.get("twoFactorAuth").apply(request); + authManagers.get("multiFactorAuth").apply(request); HttpResponse response = getClientInstance().executeAsString(request); HttpContext context = new HttpContext(request, response); @@ -317,7 +317,7 @@ public CompletableFuture> createVerifyT final String accountId, final TwoFactorVerifyRequestSchema body) { return makeHttpCallAsync(() -> buildCreateVerifyTwoFactorRequest(accountId, body), - req -> authManagers.get("twoFactorAuth").applyAsync(req) + req -> authManagers.get("multiFactorAuth").applyAsync(req) .thenCompose(request -> getClientInstance() .executeAsStringAsync(request)), context -> handleCreateVerifyTwoFactorResponse(context)); @@ -330,7 +330,7 @@ private HttpRequest buildCreateVerifyTwoFactorRequest( final String accountId, final TwoFactorVerifyRequestSchema body) throws JsonProcessingException { //the base uri for api requests - String baseUri = config.getBaseUri(Server.TWOFACTORAUTHDEFAULT); + String baseUri = config.getBaseUri(Server.MULTIFACTORAUTHDEFAULT); //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri @@ -377,19 +377,19 @@ private ApiResponse handleCreateVerifyTwoFactorResp int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ErrorWithRequestException("If there is any issue with values passed in by the user", context); + throw new ErrorWithRequestErrorException("If there is any issue with values passed in by the user", context); } if (responseCode == 401) { - throw new UnauthorizedRequestException("Authentication is either incorrect or not present", context); + throw new UnauthorizedRequestErrorException("Authentication is either incorrect or not present", context); } if (responseCode == 403) { - throw new ForbiddenRequestException("The user is not authorized to access this resource", context); + throw new ForbiddenRequestErrorException("The user is not authorized to access this resource", context); } if (responseCode == 429) { - throw new ErrorWithRequestException("The user has made too many bad requests and is temporarily locked out", context); + throw new ErrorWithRequestErrorException("The user has made too many bad requests and is temporarily locked out", context); } if (responseCode == 500) { - throw new ErrorWithRequestException("An internal server error occurred", context); + throw new ErrorWithRequestErrorException("An internal server error occurred", context); } //handle errors defined at the API level validateResponse(response, context); diff --git a/src/main/java/com/bandwidth/twofactorauth/exceptions/ErrorWithRequestException.java b/src/main/java/com/bandwidth/multifactorauth/exceptions/ErrorWithRequestErrorException.java similarity index 64% rename from src/main/java/com/bandwidth/twofactorauth/exceptions/ErrorWithRequestException.java rename to src/main/java/com/bandwidth/multifactorauth/exceptions/ErrorWithRequestErrorException.java index 2e00e4ea..6dca1f48 100644 --- a/src/main/java/com/bandwidth/twofactorauth/exceptions/ErrorWithRequestException.java +++ b/src/main/java/com/bandwidth/multifactorauth/exceptions/ErrorWithRequestErrorException.java @@ -4,7 +4,7 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.twofactorauth.exceptions; +package com.bandwidth.multifactorauth.exceptions; import com.bandwidth.exceptions.ApiException; import com.bandwidth.http.client.HttpContext; @@ -12,11 +12,11 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for ErrorWithRequestException type. + * This is a model class for ErrorWithRequestErrorException type. */ -public class ErrorWithRequestException +public class ErrorWithRequestErrorException extends ApiException { - private static final long serialVersionUID = -2207935819585830921L; + private static final long serialVersionUID = 665861110067566032L; private String error; private String requestId; @@ -25,7 +25,7 @@ public class ErrorWithRequestException * @param reason The reason for throwing exception * @param context The http context of the API exception */ - public ErrorWithRequestException(String reason, HttpContext context) { + public ErrorWithRequestErrorException(String reason, HttpContext context) { super(reason, context); } @@ -33,7 +33,7 @@ public ErrorWithRequestException(String reason, HttpContext context) { /** * Getter for Error. * An error message pertaining to what the issue could be - * @return Returns the String + * @return Returns the String */ @JsonGetter("error") public String getError() { @@ -43,17 +43,17 @@ public String getError() { /** * Setter for Error. * An error message pertaining to what the issue could be - * @param value Value for String + * @param error Value for String */ @JsonSetter("error") - private void setError(String value) { - this.error = value; + private void setError(String error) { + this.error = error; } /** * Getter for RequestId. * The associated requestId from AWS - * @return Returns the String + * @return Returns the String */ @JsonGetter("requestId") public String getRequestId() { @@ -63,10 +63,10 @@ public String getRequestId() { /** * Setter for RequestId. * The associated requestId from AWS - * @param value Value for String + * @param requestId Value for String */ @JsonSetter("requestId") - private void setRequestId(String value) { - this.requestId = value; + private void setRequestId(String requestId) { + this.requestId = requestId; } } diff --git a/src/main/java/com/bandwidth/twofactorauth/exceptions/ForbiddenRequestException.java b/src/main/java/com/bandwidth/multifactorauth/exceptions/ForbiddenRequestErrorException.java similarity index 65% rename from src/main/java/com/bandwidth/twofactorauth/exceptions/ForbiddenRequestException.java rename to src/main/java/com/bandwidth/multifactorauth/exceptions/ForbiddenRequestErrorException.java index 4c7d1155..33dde3f3 100644 --- a/src/main/java/com/bandwidth/twofactorauth/exceptions/ForbiddenRequestException.java +++ b/src/main/java/com/bandwidth/multifactorauth/exceptions/ForbiddenRequestErrorException.java @@ -4,7 +4,7 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.twofactorauth.exceptions; +package com.bandwidth.multifactorauth.exceptions; import com.bandwidth.exceptions.ApiException; import com.bandwidth.http.client.HttpContext; @@ -12,11 +12,11 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for ForbiddenRequestException type. + * This is a model class for ForbiddenRequestErrorException type. */ -public class ForbiddenRequestException +public class ForbiddenRequestErrorException extends ApiException { - private static final long serialVersionUID = 41606914026773976L; + private static final long serialVersionUID = -90785364203660723L; private String message; /** @@ -24,7 +24,7 @@ public class ForbiddenRequestException * @param reason The reason for throwing exception * @param context The http context of the API exception */ - public ForbiddenRequestException(String reason, HttpContext context) { + public ForbiddenRequestErrorException(String reason, HttpContext context) { super(reason, context); } @@ -32,7 +32,7 @@ public ForbiddenRequestException(String reason, HttpContext context) { /** * Getter for Message. * The message containing the reason behind the request being forbidden - * @return Returns the String + * @return Returns the String */ @JsonGetter("Message") public String getMessage() { @@ -42,10 +42,10 @@ public String getMessage() { /** * Setter for Message. * The message containing the reason behind the request being forbidden - * @param value Value for String + * @param message Value for String */ @JsonSetter("Message") - private void setMessage(String value) { - this.message = value; + private void setMessage(String message) { + this.message = message; } } diff --git a/src/main/java/com/bandwidth/twofactorauth/exceptions/UnauthorizedRequestException.java b/src/main/java/com/bandwidth/multifactorauth/exceptions/UnauthorizedRequestErrorException.java similarity index 64% rename from src/main/java/com/bandwidth/twofactorauth/exceptions/UnauthorizedRequestException.java rename to src/main/java/com/bandwidth/multifactorauth/exceptions/UnauthorizedRequestErrorException.java index 436cd1c7..a61eb8ef 100644 --- a/src/main/java/com/bandwidth/twofactorauth/exceptions/UnauthorizedRequestException.java +++ b/src/main/java/com/bandwidth/multifactorauth/exceptions/UnauthorizedRequestErrorException.java @@ -4,7 +4,7 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.twofactorauth.exceptions; +package com.bandwidth.multifactorauth.exceptions; import com.bandwidth.exceptions.ApiException; import com.bandwidth.http.client.HttpContext; @@ -12,11 +12,11 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for UnauthorizedRequestException type. + * This is a model class for UnauthorizedRequestErrorException type. */ -public class UnauthorizedRequestException +public class UnauthorizedRequestErrorException extends ApiException { - private static final long serialVersionUID = -43402636942119755L; + private static final long serialVersionUID = -36139398783316808L; private String message; /** @@ -24,7 +24,7 @@ public class UnauthorizedRequestException * @param reason The reason for throwing exception * @param context The http context of the API exception */ - public UnauthorizedRequestException(String reason, HttpContext context) { + public UnauthorizedRequestErrorException(String reason, HttpContext context) { super(reason, context); } @@ -32,7 +32,7 @@ public UnauthorizedRequestException(String reason, HttpContext context) { /** * Getter for Message. * The message containing the reason behind the request being unauthorized - * @return Returns the String + * @return Returns the String */ @JsonGetter("message") public String getMessage() { @@ -42,10 +42,10 @@ public String getMessage() { /** * Setter for Message. * The message containing the reason behind the request being unauthorized - * @param value Value for String + * @param message Value for String */ @JsonSetter("message") - private void setMessage(String value) { - this.message = value; + private void setMessage(String message) { + this.message = message; } } diff --git a/src/main/java/com/bandwidth/multifactorauth/models/ErrorWithRequest.java b/src/main/java/com/bandwidth/multifactorauth/models/ErrorWithRequest.java new file mode 100644 index 00000000..8a390564 --- /dev/null +++ b/src/main/java/com/bandwidth/multifactorauth/models/ErrorWithRequest.java @@ -0,0 +1,138 @@ +/* + * BandwidthLib + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +package com.bandwidth.multifactorauth.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for ErrorWithRequest type. + */ +public class ErrorWithRequest { + @JsonInclude(JsonInclude.Include.NON_NULL) + private String error; + @JsonInclude(JsonInclude.Include.NON_NULL) + private String requestId; + + /** + * Default constructor. + */ + public ErrorWithRequest() { + } + + /** + * Initialization constructor. + * @param error String value for error. + * @param requestId String value for requestId. + */ + public ErrorWithRequest( + String error, + String requestId) { + this.error = error; + this.requestId = requestId; + } + + /** + * Getter for Error. + * An error message pertaining to what the issue could be + * @return Returns the String + */ + @JsonGetter("error") + public String getError() { + return error; + } + + /** + * Setter for Error. + * An error message pertaining to what the issue could be + * @param error Value for String + */ + @JsonSetter("error") + public void setError(String error) { + this.error = error; + } + + /** + * Getter for RequestId. + * The associated requestId from AWS + * @return Returns the String + */ + @JsonGetter("requestId") + public String getRequestId() { + return requestId; + } + + /** + * Setter for RequestId. + * The associated requestId from AWS + * @param requestId Value for String + */ + @JsonSetter("requestId") + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + /** + * Converts this ErrorWithRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ErrorWithRequest [" + "error=" + error + ", requestId=" + requestId + "]"; + } + + /** + * Builds a new {@link ErrorWithRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ErrorWithRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .error(getError()) + .requestId(getRequestId()); + return builder; + } + + /** + * Class to build instances of {@link ErrorWithRequest}. + */ + public static class Builder { + private String error; + private String requestId; + + + + /** + * Setter for error. + * @param error String value for error. + * @return Builder + */ + public Builder error(String error) { + this.error = error; + return this; + } + + /** + * Setter for requestId. + * @param requestId String value for requestId. + * @return Builder + */ + public Builder requestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Builds a new {@link ErrorWithRequest} object using the set fields. + * @return {@link ErrorWithRequest} + */ + public ErrorWithRequest build() { + return new ErrorWithRequest(error, requestId); + } + } +} diff --git a/src/main/java/com/bandwidth/multifactorauth/models/ForbiddenRequest.java b/src/main/java/com/bandwidth/multifactorauth/models/ForbiddenRequest.java new file mode 100644 index 00000000..7efe750c --- /dev/null +++ b/src/main/java/com/bandwidth/multifactorauth/models/ForbiddenRequest.java @@ -0,0 +1,101 @@ +/* + * BandwidthLib + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +package com.bandwidth.multifactorauth.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for ForbiddenRequest type. + */ +public class ForbiddenRequest { + @JsonInclude(JsonInclude.Include.NON_NULL) + private String message; + + /** + * Default constructor. + */ + public ForbiddenRequest() { + } + + /** + * Initialization constructor. + * @param message String value for message. + */ + public ForbiddenRequest( + String message) { + this.message = message; + } + + /** + * Getter for Message. + * The message containing the reason behind the request being forbidden + * @return Returns the String + */ + @JsonGetter("Message") + public String getMessage() { + return message; + } + + /** + * Setter for Message. + * The message containing the reason behind the request being forbidden + * @param message Value for String + */ + @JsonSetter("Message") + public void setMessage(String message) { + this.message = message; + } + + /** + * Converts this ForbiddenRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ForbiddenRequest [" + "message=" + message + "]"; + } + + /** + * Builds a new {@link ForbiddenRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ForbiddenRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .message(getMessage()); + return builder; + } + + /** + * Class to build instances of {@link ForbiddenRequest}. + */ + public static class Builder { + private String message; + + + + /** + * Setter for message. + * @param message String value for message. + * @return Builder + */ + public Builder message(String message) { + this.message = message; + return this; + } + + /** + * Builds a new {@link ForbiddenRequest} object using the set fields. + * @return {@link ForbiddenRequest} + */ + public ForbiddenRequest build() { + return new ForbiddenRequest(message); + } + } +} diff --git a/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorCodeRequestSchema.java b/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorCodeRequestSchema.java similarity index 83% rename from src/main/java/com/bandwidth/twofactorauth/models/TwoFactorCodeRequestSchema.java rename to src/main/java/com/bandwidth/multifactorauth/models/TwoFactorCodeRequestSchema.java index 62390a0f..6f56f2b9 100644 --- a/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorCodeRequestSchema.java +++ b/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorCodeRequestSchema.java @@ -4,9 +4,10 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.twofactorauth.models; +package com.bandwidth.multifactorauth.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** @@ -16,6 +17,7 @@ public class TwoFactorCodeRequestSchema { private String to; private String from; private String applicationId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String scope; private String message; private double digits; @@ -28,12 +30,12 @@ public TwoFactorCodeRequestSchema() { /** * Initialization constructor. - * @param to String value for to. - * @param from String value for from. - * @param applicationId String value for applicationId. - * @param message String value for message. - * @param digits double value for digits. - * @param scope String value for scope. + * @param to String value for to. + * @param from String value for from. + * @param applicationId String value for applicationId. + * @param message String value for message. + * @param digits double value for digits. + * @param scope String value for scope. */ public TwoFactorCodeRequestSchema( String to, @@ -57,7 +59,7 @@ public TwoFactorCodeRequestSchema( */ @JsonGetter("to") public String getTo() { - return this.to; + return to; } /** @@ -77,7 +79,7 @@ public void setTo(String to) { */ @JsonGetter("from") public String getFrom() { - return this.from; + return from; } /** @@ -97,7 +99,7 @@ public void setFrom(String from) { */ @JsonGetter("applicationId") public String getApplicationId() { - return this.applicationId; + return applicationId; } /** @@ -118,7 +120,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("scope") public String getScope() { - return this.scope; + return scope; } /** @@ -143,7 +145,7 @@ public void setScope(String scope) { */ @JsonGetter("message") public String getMessage() { - return this.message; + return message; } /** @@ -167,7 +169,7 @@ public void setMessage(String message) { */ @JsonGetter("digits") public double getDigits() { - return this.digits; + return digits; } /** @@ -221,16 +223,13 @@ public Builder() { /** * Initialization constructor. - * @param to String value for to. - * @param from String value for from. - * @param applicationId String value for applicationId. - * @param message String value for message. - * @param digits double value for digits. + * @param to String value for to. + * @param from String value for from. + * @param applicationId String value for applicationId. + * @param message String value for message. + * @param digits double value for digits. */ - public Builder(String to, - String from, - String applicationId, - String message, + public Builder(String to, String from, String applicationId, String message, double digits) { this.to = to; this.from = from; @@ -241,7 +240,7 @@ public Builder(String to, /** * Setter for to. - * @param to String value for to. + * @param to String value for to. * @return Builder */ public Builder to(String to) { @@ -251,7 +250,7 @@ public Builder to(String to) { /** * Setter for from. - * @param from String value for from. + * @param from String value for from. * @return Builder */ public Builder from(String from) { @@ -261,7 +260,7 @@ public Builder from(String from) { /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -271,7 +270,7 @@ public Builder applicationId(String applicationId) { /** * Setter for message. - * @param message String value for message. + * @param message String value for message. * @return Builder */ public Builder message(String message) { @@ -281,7 +280,7 @@ public Builder message(String message) { /** * Setter for digits. - * @param digits double value for digits. + * @param digits double value for digits. * @return Builder */ public Builder digits(double digits) { @@ -291,7 +290,7 @@ public Builder digits(double digits) { /** * Setter for scope. - * @param scope String value for scope. + * @param scope String value for scope. * @return Builder */ public Builder scope(String scope) { diff --git a/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorMessagingResponse.java b/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorMessagingResponse.java similarity index 85% rename from src/main/java/com/bandwidth/twofactorauth/models/TwoFactorMessagingResponse.java rename to src/main/java/com/bandwidth/multifactorauth/models/TwoFactorMessagingResponse.java index 93a9f157..396d5ade 100644 --- a/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorMessagingResponse.java +++ b/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorMessagingResponse.java @@ -4,15 +4,17 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.twofactorauth.models; +package com.bandwidth.multifactorauth.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for TwoFactorMessagingResponse type. */ public class TwoFactorMessagingResponse { + @JsonInclude(JsonInclude.Include.NON_NULL) private String messageId; /** @@ -23,7 +25,7 @@ public TwoFactorMessagingResponse() { /** * Initialization constructor. - * @param messageId String value for messageId. + * @param messageId String value for messageId. */ public TwoFactorMessagingResponse( String messageId) { @@ -36,7 +38,7 @@ public TwoFactorMessagingResponse( */ @JsonGetter("messageId") public String getMessageId() { - return this.messageId; + return messageId; } /** @@ -78,7 +80,7 @@ public static class Builder { /** * Setter for messageId. - * @param messageId String value for messageId. + * @param messageId String value for messageId. * @return Builder */ public Builder messageId(String messageId) { diff --git a/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVerifyCodeResponse.java b/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVerifyCodeResponse.java similarity index 85% rename from src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVerifyCodeResponse.java rename to src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVerifyCodeResponse.java index ccda9c6a..2ecf4167 100644 --- a/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVerifyCodeResponse.java +++ b/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVerifyCodeResponse.java @@ -4,15 +4,17 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.twofactorauth.models; +package com.bandwidth.multifactorauth.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for TwoFactorVerifyCodeResponse type. */ public class TwoFactorVerifyCodeResponse { + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean valid; /** @@ -23,7 +25,7 @@ public TwoFactorVerifyCodeResponse() { /** * Initialization constructor. - * @param valid Boolean value for valid. + * @param valid Boolean value for valid. */ public TwoFactorVerifyCodeResponse( Boolean valid) { @@ -36,7 +38,7 @@ public TwoFactorVerifyCodeResponse( */ @JsonGetter("valid") public Boolean getValid() { - return this.valid; + return valid; } /** @@ -78,7 +80,7 @@ public static class Builder { /** * Setter for valid. - * @param valid Boolean value for valid. + * @param valid Boolean value for valid. * @return Builder */ public Builder valid(Boolean valid) { diff --git a/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVerifyRequestSchema.java b/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVerifyRequestSchema.java similarity index 82% rename from src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVerifyRequestSchema.java rename to src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVerifyRequestSchema.java index a3997fb5..e4690ab8 100644 --- a/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVerifyRequestSchema.java +++ b/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVerifyRequestSchema.java @@ -4,9 +4,10 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.twofactorauth.models; +package com.bandwidth.multifactorauth.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** @@ -15,6 +16,7 @@ public class TwoFactorVerifyRequestSchema { private String to; private String applicationId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String scope; private double expirationTimeInMinutes; private String code; @@ -27,11 +29,11 @@ public TwoFactorVerifyRequestSchema() { /** * Initialization constructor. - * @param to String value for to. - * @param applicationId String value for applicationId. - * @param expirationTimeInMinutes double value for expirationTimeInMinutes. - * @param code String value for code. - * @param scope String value for scope. + * @param to String value for to. + * @param applicationId String value for applicationId. + * @param expirationTimeInMinutes double value for expirationTimeInMinutes. + * @param code String value for code. + * @param scope String value for scope. */ public TwoFactorVerifyRequestSchema( String to, @@ -53,7 +55,7 @@ public TwoFactorVerifyRequestSchema( */ @JsonGetter("to") public String getTo() { - return this.to; + return to; } /** @@ -73,7 +75,7 @@ public void setTo(String to) { */ @JsonGetter("applicationId") public String getApplicationId() { - return this.applicationId; + return applicationId; } /** @@ -94,7 +96,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("scope") public String getScope() { - return this.scope; + return scope; } /** @@ -117,7 +119,7 @@ public void setScope(String scope) { */ @JsonGetter("expirationTimeInMinutes") public double getExpirationTimeInMinutes() { - return this.expirationTimeInMinutes; + return expirationTimeInMinutes; } /** @@ -139,7 +141,7 @@ public void setExpirationTimeInMinutes(double expirationTimeInMinutes) { */ @JsonGetter("code") public String getCode() { - return this.code; + return code; } /** @@ -192,14 +194,12 @@ public Builder() { /** * Initialization constructor. - * @param to String value for to. - * @param applicationId String value for applicationId. - * @param expirationTimeInMinutes double value for expirationTimeInMinutes. - * @param code String value for code. + * @param to String value for to. + * @param applicationId String value for applicationId. + * @param expirationTimeInMinutes double value for expirationTimeInMinutes. + * @param code String value for code. */ - public Builder(String to, - String applicationId, - double expirationTimeInMinutes, + public Builder(String to, String applicationId, double expirationTimeInMinutes, String code) { this.to = to; this.applicationId = applicationId; @@ -209,7 +209,7 @@ public Builder(String to, /** * Setter for to. - * @param to String value for to. + * @param to String value for to. * @return Builder */ public Builder to(String to) { @@ -219,7 +219,7 @@ public Builder to(String to) { /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -229,7 +229,7 @@ public Builder applicationId(String applicationId) { /** * Setter for expirationTimeInMinutes. - * @param expirationTimeInMinutes double value for expirationTimeInMinutes. + * @param expirationTimeInMinutes double value for expirationTimeInMinutes. * @return Builder */ public Builder expirationTimeInMinutes(double expirationTimeInMinutes) { @@ -239,7 +239,7 @@ public Builder expirationTimeInMinutes(double expirationTimeInMinutes) { /** * Setter for code. - * @param code String value for code. + * @param code String value for code. * @return Builder */ public Builder code(String code) { @@ -249,7 +249,7 @@ public Builder code(String code) { /** * Setter for scope. - * @param scope String value for scope. + * @param scope String value for scope. * @return Builder */ public Builder scope(String scope) { diff --git a/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVoiceResponse.java b/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVoiceResponse.java similarity index 85% rename from src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVoiceResponse.java rename to src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVoiceResponse.java index c12e7a53..d00b0d63 100644 --- a/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVoiceResponse.java +++ b/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVoiceResponse.java @@ -4,15 +4,17 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.twofactorauth.models; +package com.bandwidth.multifactorauth.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for TwoFactorVoiceResponse type. */ public class TwoFactorVoiceResponse { + @JsonInclude(JsonInclude.Include.NON_NULL) private String callId; /** @@ -23,7 +25,7 @@ public TwoFactorVoiceResponse() { /** * Initialization constructor. - * @param callId String value for callId. + * @param callId String value for callId. */ public TwoFactorVoiceResponse( String callId) { @@ -36,7 +38,7 @@ public TwoFactorVoiceResponse( */ @JsonGetter("callId") public String getCallId() { - return this.callId; + return callId; } /** @@ -78,7 +80,7 @@ public static class Builder { /** * Setter for callId. - * @param callId String value for callId. + * @param callId String value for callId. * @return Builder */ public Builder callId(String callId) { diff --git a/src/main/java/com/bandwidth/multifactorauth/models/UnauthorizedRequest.java b/src/main/java/com/bandwidth/multifactorauth/models/UnauthorizedRequest.java new file mode 100644 index 00000000..eec532bd --- /dev/null +++ b/src/main/java/com/bandwidth/multifactorauth/models/UnauthorizedRequest.java @@ -0,0 +1,101 @@ +/* + * BandwidthLib + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +package com.bandwidth.multifactorauth.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for UnauthorizedRequest type. + */ +public class UnauthorizedRequest { + @JsonInclude(JsonInclude.Include.NON_NULL) + private String message; + + /** + * Default constructor. + */ + public UnauthorizedRequest() { + } + + /** + * Initialization constructor. + * @param message String value for message. + */ + public UnauthorizedRequest( + String message) { + this.message = message; + } + + /** + * Getter for Message. + * The message containing the reason behind the request being unauthorized + * @return Returns the String + */ + @JsonGetter("message") + public String getMessage() { + return message; + } + + /** + * Setter for Message. + * The message containing the reason behind the request being unauthorized + * @param message Value for String + */ + @JsonSetter("message") + public void setMessage(String message) { + this.message = message; + } + + /** + * Converts this UnauthorizedRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "UnauthorizedRequest [" + "message=" + message + "]"; + } + + /** + * Builds a new {@link UnauthorizedRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link UnauthorizedRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .message(getMessage()); + return builder; + } + + /** + * Class to build instances of {@link UnauthorizedRequest}. + */ + public static class Builder { + private String message; + + + + /** + * Setter for message. + * @param message String value for message. + * @return Builder + */ + public Builder message(String message) { + this.message = message; + return this; + } + + /** + * Builds a new {@link UnauthorizedRequest} object using the set fields. + * @return {@link UnauthorizedRequest} + */ + public UnauthorizedRequest build() { + return new UnauthorizedRequest(message); + } + } +} diff --git a/src/main/java/com/bandwidth/utilities/FileWrapper.java b/src/main/java/com/bandwidth/utilities/FileWrapper.java index b8064af8..2b3fe536 100644 --- a/src/main/java/com/bandwidth/utilities/FileWrapper.java +++ b/src/main/java/com/bandwidth/utilities/FileWrapper.java @@ -7,13 +7,16 @@ package com.bandwidth.utilities; import java.io.File; +import com.fasterxml.jackson.annotation.JsonInclude; /** * Class to wrap file and contentType to be sent as part of a HTTP request. */ public class FileWrapper { + @JsonInclude(JsonInclude.Include.NON_NULL) private File file; + @JsonInclude(JsonInclude.Include.NON_NULL) private String contentType; /** diff --git a/src/main/java/com/bandwidth/voice/controllers/APIController.java b/src/main/java/com/bandwidth/voice/controllers/APIController.java index acefd94b..c3887bb7 100644 --- a/src/main/java/com/bandwidth/voice/controllers/APIController.java +++ b/src/main/java/com/bandwidth/voice/controllers/APIController.java @@ -20,7 +20,7 @@ import com.bandwidth.http.response.ApiResponse; import com.bandwidth.http.response.HttpResponse; import com.bandwidth.http.response.HttpStringResponse; -import com.bandwidth.voice.exceptions.ApiErrorResponseException; +import com.bandwidth.voice.exceptions.ApiErrorResponseErrorException; import com.bandwidth.voice.models.ApiCallResponse; import com.bandwidth.voice.models.ApiCallStateResponse; import com.bandwidth.voice.models.ApiCreateCallRequest; @@ -160,25 +160,25 @@ private ApiResponse handleCreateCallResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -281,25 +281,25 @@ private ApiResponse handleGetCallStateResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -407,25 +407,25 @@ private ApiResponse handleModifyCallResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -529,25 +529,25 @@ private ApiResponse handleModifyCallRecordingStateResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -648,25 +648,25 @@ private ApiResponse> handleGetQueryMetadataForAc int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -776,25 +776,25 @@ private ApiResponse handleGetMetadataForRecordingResp int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -902,25 +902,25 @@ private ApiResponse handleDeleteRecordingResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1025,25 +1025,25 @@ private ApiResponse handleGetStreamRecordingMediaResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1149,25 +1149,25 @@ private ApiResponse handleDeleteRecordingMediaResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1273,25 +1273,25 @@ private ApiResponse handleGetRecordingTranscriptionRespon int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1408,28 +1408,28 @@ private ApiResponse handleCreateTranscribeRecordingResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 410) { - throw new ApiErrorResponseException("The media for this recording has been deleted, so we can't transcribe it", context); + throw new ApiErrorResponseErrorException("The media for this recording has been deleted, so we can't transcribe it", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1534,25 +1534,25 @@ private ApiResponse handleDeleteRecordingTranscriptionResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1680,25 +1680,25 @@ private ApiResponse> handleGetConferencesByAccountRespons int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1800,25 +1800,25 @@ private ApiResponse handleGetConferenceByIdResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1926,25 +1926,25 @@ private ApiResponse handleModifyConferenceResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -2056,25 +2056,25 @@ private ApiResponse handleModifyConferenceMemberResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -2180,25 +2180,25 @@ private ApiResponse handleGetConferenceMemberResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -2305,25 +2305,25 @@ private ApiResponse> handleGetQueryMet int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -2434,25 +2434,25 @@ private ApiResponse handleGetMetadataForConferenceRec int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -2563,25 +2563,25 @@ private ApiResponse handleGetStreamConferenceRecordingMediaResponse int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -2708,25 +2708,25 @@ private ApiResponse> handleGetQueryMetadataForAc int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); diff --git a/src/main/java/com/bandwidth/voice/exceptions/ApiErrorResponseException.java b/src/main/java/com/bandwidth/voice/exceptions/ApiErrorResponseErrorException.java similarity index 62% rename from src/main/java/com/bandwidth/voice/exceptions/ApiErrorResponseException.java rename to src/main/java/com/bandwidth/voice/exceptions/ApiErrorResponseErrorException.java index adae8ad4..c59875cd 100644 --- a/src/main/java/com/bandwidth/voice/exceptions/ApiErrorResponseException.java +++ b/src/main/java/com/bandwidth/voice/exceptions/ApiErrorResponseErrorException.java @@ -12,11 +12,11 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for ApiErrorResponseException type. + * This is a model class for ApiErrorResponseErrorException type. */ -public class ApiErrorResponseException +public class ApiErrorResponseErrorException extends ApiException { - private static final long serialVersionUID = -5354659649987151873L; + private static final long serialVersionUID = -7170536725053545402L; private String type; private String description; private String id; @@ -26,14 +26,14 @@ public class ApiErrorResponseException * @param reason The reason for throwing exception * @param context The http context of the API exception */ - public ApiErrorResponseException(String reason, HttpContext context) { + public ApiErrorResponseErrorException(String reason, HttpContext context) { super(reason, context); } /** * Getter for Type. - * @return Returns the String + * @return Returns the String */ @JsonGetter("type") public String getType() { @@ -42,16 +42,16 @@ public String getType() { /** * Setter for Type. - * @param value Value for String + * @param type Value for String */ @JsonSetter("type") - private void setType(String value) { - this.type = value; + private void setType(String type) { + this.type = type; } /** * Getter for Description. - * @return Returns the String + * @return Returns the String */ @JsonGetter("description") public String getDescription() { @@ -60,16 +60,16 @@ public String getDescription() { /** * Setter for Description. - * @param value Value for String + * @param description Value for String */ @JsonSetter("description") - private void setDescription(String value) { - this.description = value; + private void setDescription(String description) { + this.description = description; } /** * Getter for Id. - * @return Returns the String + * @return Returns the String */ @JsonGetter("id") public String getId() { @@ -78,10 +78,10 @@ public String getId() { /** * Setter for Id. - * @param value Value for String + * @param id Value for String */ @JsonSetter("id") - private void setId(String value) { - this.id = value; + private void setId(String id) { + this.id = id; } } diff --git a/src/main/java/com/bandwidth/voice/models/ApiCallResponse.java b/src/main/java/com/bandwidth/voice/models/ApiCallResponse.java index 5761610b..402a602a 100644 --- a/src/main/java/com/bandwidth/voice/models/ApiCallResponse.java +++ b/src/main/java/com/bandwidth/voice/models/ApiCallResponse.java @@ -8,6 +8,7 @@ import com.bandwidth.DateTimeHelper; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -22,20 +23,31 @@ public class ApiCallResponse { private String applicationId; private String to; private String from; + @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime startTime; private String callUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) private Double callTimeout; + @JsonInclude(JsonInclude.Include.NON_NULL) private Double callbackTimeout; private String answerUrl; private AnswerMethodEnum answerMethod; + @JsonInclude(JsonInclude.Include.NON_NULL) private String answerFallbackUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) private AnswerFallbackMethodEnum answerFallbackMethod; + @JsonInclude(JsonInclude.Include.NON_NULL) private String disconnectUrl; private DisconnectMethodEnum disconnectMethod; + @JsonInclude(JsonInclude.Include.NON_NULL) private String username; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; + @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackUsername; + @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackPassword; + @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; /** @@ -46,26 +58,26 @@ public ApiCallResponse() { /** * Initialization constructor. - * @param accountId String value for accountId. - * @param callId String value for callId. - * @param applicationId String value for applicationId. - * @param to String value for to. - * @param from String value for from. - * @param callUrl String value for callUrl. - * @param answerUrl String value for answerUrl. - * @param answerMethod AnswerMethodEnum value for answerMethod. - * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. - * @param startTime LocalDateTime value for startTime. - * @param callTimeout Double value for callTimeout. - * @param callbackTimeout Double value for callbackTimeout. - * @param answerFallbackUrl String value for answerFallbackUrl. - * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. - * @param disconnectUrl String value for disconnectUrl. - * @param username String value for username. - * @param password String value for password. - * @param fallbackUsername String value for fallbackUsername. - * @param fallbackPassword String value for fallbackPassword. - * @param tag String value for tag. + * @param accountId String value for accountId. + * @param callId String value for callId. + * @param applicationId String value for applicationId. + * @param to String value for to. + * @param from String value for from. + * @param callUrl String value for callUrl. + * @param answerUrl String value for answerUrl. + * @param answerMethod AnswerMethodEnum value for answerMethod. + * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. + * @param startTime LocalDateTime value for startTime. + * @param callTimeout Double value for callTimeout. + * @param callbackTimeout Double value for callbackTimeout. + * @param answerFallbackUrl String value for answerFallbackUrl. + * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. + * @param disconnectUrl String value for disconnectUrl. + * @param username String value for username. + * @param password String value for password. + * @param fallbackUsername String value for fallbackUsername. + * @param fallbackPassword String value for fallbackPassword. + * @param tag String value for tag. */ public ApiCallResponse( String accountId, @@ -116,7 +128,7 @@ public ApiCallResponse( */ @JsonGetter("accountId") public String getAccountId() { - return this.accountId; + return accountId; } /** @@ -134,7 +146,7 @@ public void setAccountId(String accountId) { */ @JsonGetter("callId") public String getCallId() { - return this.callId; + return callId; } /** @@ -152,7 +164,7 @@ public void setCallId(String callId) { */ @JsonGetter("applicationId") public String getApplicationId() { - return this.applicationId; + return applicationId; } /** @@ -170,7 +182,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("to") public String getTo() { - return this.to; + return to; } /** @@ -188,7 +200,7 @@ public void setTo(String to) { */ @JsonGetter("from") public String getFrom() { - return this.from; + return from; } /** @@ -207,7 +219,7 @@ public void setFrom(String from) { @JsonGetter("startTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getStartTime() { - return this.startTime; + return startTime; } /** @@ -226,7 +238,7 @@ public void setStartTime(LocalDateTime startTime) { */ @JsonGetter("callUrl") public String getCallUrl() { - return this.callUrl; + return callUrl; } /** @@ -244,7 +256,7 @@ public void setCallUrl(String callUrl) { */ @JsonGetter("callTimeout") public Double getCallTimeout() { - return this.callTimeout; + return callTimeout; } /** @@ -262,7 +274,7 @@ public void setCallTimeout(Double callTimeout) { */ @JsonGetter("callbackTimeout") public Double getCallbackTimeout() { - return this.callbackTimeout; + return callbackTimeout; } /** @@ -280,7 +292,7 @@ public void setCallbackTimeout(Double callbackTimeout) { */ @JsonGetter("answerUrl") public String getAnswerUrl() { - return this.answerUrl; + return answerUrl; } /** @@ -298,7 +310,7 @@ public void setAnswerUrl(String answerUrl) { */ @JsonGetter("answerMethod") public AnswerMethodEnum getAnswerMethod() { - return this.answerMethod; + return answerMethod; } /** @@ -316,7 +328,7 @@ public void setAnswerMethod(AnswerMethodEnum answerMethod) { */ @JsonGetter("answerFallbackUrl") public String getAnswerFallbackUrl() { - return this.answerFallbackUrl; + return answerFallbackUrl; } /** @@ -334,7 +346,7 @@ public void setAnswerFallbackUrl(String answerFallbackUrl) { */ @JsonGetter("answerFallbackMethod") public AnswerFallbackMethodEnum getAnswerFallbackMethod() { - return this.answerFallbackMethod; + return answerFallbackMethod; } /** @@ -352,7 +364,7 @@ public void setAnswerFallbackMethod(AnswerFallbackMethodEnum answerFallbackMetho */ @JsonGetter("disconnectUrl") public String getDisconnectUrl() { - return this.disconnectUrl; + return disconnectUrl; } /** @@ -370,7 +382,7 @@ public void setDisconnectUrl(String disconnectUrl) { */ @JsonGetter("disconnectMethod") public DisconnectMethodEnum getDisconnectMethod() { - return this.disconnectMethod; + return disconnectMethod; } /** @@ -388,7 +400,7 @@ public void setDisconnectMethod(DisconnectMethodEnum disconnectMethod) { */ @JsonGetter("username") public String getUsername() { - return this.username; + return username; } /** @@ -406,7 +418,7 @@ public void setUsername(String username) { */ @JsonGetter("password") public String getPassword() { - return this.password; + return password; } /** @@ -424,7 +436,7 @@ public void setPassword(String password) { */ @JsonGetter("fallbackUsername") public String getFallbackUsername() { - return this.fallbackUsername; + return fallbackUsername; } /** @@ -442,7 +454,7 @@ public void setFallbackUsername(String fallbackUsername) { */ @JsonGetter("fallbackPassword") public String getFallbackPassword() { - return this.fallbackPassword; + return fallbackPassword; } /** @@ -460,7 +472,7 @@ public void setFallbackPassword(String fallbackPassword) { */ @JsonGetter("tag") public String getTag() { - return this.tag; + return tag; } /** @@ -545,24 +557,18 @@ public Builder() { /** * Initialization constructor. - * @param accountId String value for accountId. - * @param callId String value for callId. - * @param applicationId String value for applicationId. - * @param to String value for to. - * @param from String value for from. - * @param callUrl String value for callUrl. - * @param answerUrl String value for answerUrl. - * @param answerMethod AnswerMethodEnum value for answerMethod. - * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. + * @param accountId String value for accountId. + * @param callId String value for callId. + * @param applicationId String value for applicationId. + * @param to String value for to. + * @param from String value for from. + * @param callUrl String value for callUrl. + * @param answerUrl String value for answerUrl. + * @param answerMethod AnswerMethodEnum value for answerMethod. + * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. */ - public Builder(String accountId, - String callId, - String applicationId, - String to, - String from, - String callUrl, - String answerUrl, - AnswerMethodEnum answerMethod, + public Builder(String accountId, String callId, String applicationId, String to, + String from, String callUrl, String answerUrl, AnswerMethodEnum answerMethod, DisconnectMethodEnum disconnectMethod) { this.accountId = accountId; this.callId = callId; @@ -577,7 +583,7 @@ public Builder(String accountId, /** * Setter for accountId. - * @param accountId String value for accountId. + * @param accountId String value for accountId. * @return Builder */ public Builder accountId(String accountId) { @@ -587,7 +593,7 @@ public Builder accountId(String accountId) { /** * Setter for callId. - * @param callId String value for callId. + * @param callId String value for callId. * @return Builder */ public Builder callId(String callId) { @@ -597,7 +603,7 @@ public Builder callId(String callId) { /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -607,7 +613,7 @@ public Builder applicationId(String applicationId) { /** * Setter for to. - * @param to String value for to. + * @param to String value for to. * @return Builder */ public Builder to(String to) { @@ -617,7 +623,7 @@ public Builder to(String to) { /** * Setter for from. - * @param from String value for from. + * @param from String value for from. * @return Builder */ public Builder from(String from) { @@ -627,7 +633,7 @@ public Builder from(String from) { /** * Setter for callUrl. - * @param callUrl String value for callUrl. + * @param callUrl String value for callUrl. * @return Builder */ public Builder callUrl(String callUrl) { @@ -637,7 +643,7 @@ public Builder callUrl(String callUrl) { /** * Setter for answerUrl. - * @param answerUrl String value for answerUrl. + * @param answerUrl String value for answerUrl. * @return Builder */ public Builder answerUrl(String answerUrl) { @@ -647,7 +653,7 @@ public Builder answerUrl(String answerUrl) { /** * Setter for answerMethod. - * @param answerMethod AnswerMethodEnum value for answerMethod. + * @param answerMethod AnswerMethodEnum value for answerMethod. * @return Builder */ public Builder answerMethod(AnswerMethodEnum answerMethod) { @@ -657,7 +663,7 @@ public Builder answerMethod(AnswerMethodEnum answerMethod) { /** * Setter for disconnectMethod. - * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. + * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. * @return Builder */ public Builder disconnectMethod(DisconnectMethodEnum disconnectMethod) { @@ -667,7 +673,7 @@ public Builder disconnectMethod(DisconnectMethodEnum disconnectMethod) { /** * Setter for startTime. - * @param startTime LocalDateTime value for startTime. + * @param startTime LocalDateTime value for startTime. * @return Builder */ public Builder startTime(LocalDateTime startTime) { @@ -677,7 +683,7 @@ public Builder startTime(LocalDateTime startTime) { /** * Setter for callTimeout. - * @param callTimeout Double value for callTimeout. + * @param callTimeout Double value for callTimeout. * @return Builder */ public Builder callTimeout(Double callTimeout) { @@ -687,7 +693,7 @@ public Builder callTimeout(Double callTimeout) { /** * Setter for callbackTimeout. - * @param callbackTimeout Double value for callbackTimeout. + * @param callbackTimeout Double value for callbackTimeout. * @return Builder */ public Builder callbackTimeout(Double callbackTimeout) { @@ -697,7 +703,7 @@ public Builder callbackTimeout(Double callbackTimeout) { /** * Setter for answerFallbackUrl. - * @param answerFallbackUrl String value for answerFallbackUrl. + * @param answerFallbackUrl String value for answerFallbackUrl. * @return Builder */ public Builder answerFallbackUrl(String answerFallbackUrl) { @@ -707,7 +713,7 @@ public Builder answerFallbackUrl(String answerFallbackUrl) { /** * Setter for answerFallbackMethod. - * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. + * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. * @return Builder */ public Builder answerFallbackMethod(AnswerFallbackMethodEnum answerFallbackMethod) { @@ -717,7 +723,7 @@ public Builder answerFallbackMethod(AnswerFallbackMethodEnum answerFallbackMetho /** * Setter for disconnectUrl. - * @param disconnectUrl String value for disconnectUrl. + * @param disconnectUrl String value for disconnectUrl. * @return Builder */ public Builder disconnectUrl(String disconnectUrl) { @@ -727,7 +733,7 @@ public Builder disconnectUrl(String disconnectUrl) { /** * Setter for username. - * @param username String value for username. + * @param username String value for username. * @return Builder */ public Builder username(String username) { @@ -737,7 +743,7 @@ public Builder username(String username) { /** * Setter for password. - * @param password String value for password. + * @param password String value for password. * @return Builder */ public Builder password(String password) { @@ -747,7 +753,7 @@ public Builder password(String password) { /** * Setter for fallbackUsername. - * @param fallbackUsername String value for fallbackUsername. + * @param fallbackUsername String value for fallbackUsername. * @return Builder */ public Builder fallbackUsername(String fallbackUsername) { @@ -757,7 +763,7 @@ public Builder fallbackUsername(String fallbackUsername) { /** * Setter for fallbackPassword. - * @param fallbackPassword String value for fallbackPassword. + * @param fallbackPassword String value for fallbackPassword. * @return Builder */ public Builder fallbackPassword(String fallbackPassword) { @@ -767,7 +773,7 @@ public Builder fallbackPassword(String fallbackPassword) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { diff --git a/src/main/java/com/bandwidth/voice/models/ApiCallStateResponse.java b/src/main/java/com/bandwidth/voice/models/ApiCallStateResponse.java index 99d84c52..2bf89462 100644 --- a/src/main/java/com/bandwidth/voice/models/ApiCallStateResponse.java +++ b/src/main/java/com/bandwidth/voice/models/ApiCallStateResponse.java @@ -8,29 +8,50 @@ import com.bandwidth.DateTimeHelper; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.time.LocalDateTime; +import java.util.Map; /** * This is a model class for ApiCallStateResponse type. */ public class ApiCallStateResponse { + @JsonInclude(JsonInclude.Include.NON_NULL) private String callId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String parentCallId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String applicationId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String accountId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String to; + @JsonInclude(JsonInclude.Include.NON_NULL) private String from; + @JsonInclude(JsonInclude.Include.NON_NULL) private String direction; + @JsonInclude(JsonInclude.Include.NON_NULL) private StateEnum state; + @JsonInclude(JsonInclude.Include.NON_NULL) + private String identity; + @JsonInclude(JsonInclude.Include.NON_NULL) + private Map pai; + @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime startTime; + @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime answerTime; + @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime endTime; + @JsonInclude(JsonInclude.Include.NON_NULL) private DisconnectCauseEnum disconnectCause; + @JsonInclude(JsonInclude.Include.NON_NULL) private String errorMessage; + @JsonInclude(JsonInclude.Include.NON_NULL) private String errorId; + @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime lastUpdate; /** @@ -41,21 +62,23 @@ public ApiCallStateResponse() { /** * Initialization constructor. - * @param callId String value for callId. - * @param parentCallId String value for parentCallId. - * @param applicationId String value for applicationId. - * @param accountId String value for accountId. - * @param to String value for to. - * @param from String value for from. - * @param direction String value for direction. - * @param state StateEnum value for state. - * @param startTime LocalDateTime value for startTime. - * @param answerTime LocalDateTime value for answerTime. - * @param endTime LocalDateTime value for endTime. - * @param disconnectCause DisconnectCauseEnum value for disconnectCause. - * @param errorMessage String value for errorMessage. - * @param errorId String value for errorId. - * @param lastUpdate LocalDateTime value for lastUpdate. + * @param callId String value for callId. + * @param parentCallId String value for parentCallId. + * @param applicationId String value for applicationId. + * @param accountId String value for accountId. + * @param to String value for to. + * @param from String value for from. + * @param direction String value for direction. + * @param state StateEnum value for state. + * @param identity String value for identity. + * @param pai Map of String, value for pai. + * @param startTime LocalDateTime value for startTime. + * @param answerTime LocalDateTime value for answerTime. + * @param endTime LocalDateTime value for endTime. + * @param disconnectCause DisconnectCauseEnum value for disconnectCause. + * @param errorMessage String value for errorMessage. + * @param errorId String value for errorId. + * @param lastUpdate LocalDateTime value for lastUpdate. */ public ApiCallStateResponse( String callId, @@ -66,6 +89,8 @@ public ApiCallStateResponse( String from, String direction, StateEnum state, + String identity, + Map pai, LocalDateTime startTime, LocalDateTime answerTime, LocalDateTime endTime, @@ -81,6 +106,8 @@ public ApiCallStateResponse( this.from = from; this.direction = direction; this.state = state; + this.identity = identity; + this.pai = pai; this.startTime = startTime; this.answerTime = answerTime; this.endTime = endTime; @@ -96,7 +123,7 @@ public ApiCallStateResponse( */ @JsonGetter("callId") public String getCallId() { - return this.callId; + return callId; } /** @@ -114,7 +141,7 @@ public void setCallId(String callId) { */ @JsonGetter("parentCallId") public String getParentCallId() { - return this.parentCallId; + return parentCallId; } /** @@ -132,7 +159,7 @@ public void setParentCallId(String parentCallId) { */ @JsonGetter("applicationId") public String getApplicationId() { - return this.applicationId; + return applicationId; } /** @@ -150,7 +177,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("accountId") public String getAccountId() { - return this.accountId; + return accountId; } /** @@ -168,7 +195,7 @@ public void setAccountId(String accountId) { */ @JsonGetter("to") public String getTo() { - return this.to; + return to; } /** @@ -186,7 +213,7 @@ public void setTo(String to) { */ @JsonGetter("from") public String getFrom() { - return this.from; + return from; } /** @@ -204,7 +231,7 @@ public void setFrom(String from) { */ @JsonGetter("direction") public String getDirection() { - return this.direction; + return direction; } /** @@ -222,7 +249,7 @@ public void setDirection(String direction) { */ @JsonGetter("state") public StateEnum getState() { - return this.state; + return state; } /** @@ -234,6 +261,42 @@ public void setState(StateEnum state) { this.state = state; } + /** + * Getter for Identity. + * @return Returns the String + */ + @JsonGetter("identity") + public String getIdentity() { + return identity; + } + + /** + * Setter for Identity. + * @param identity Value for String + */ + @JsonSetter("identity") + public void setIdentity(String identity) { + this.identity = identity; + } + + /** + * Getter for Pai. + * @return Returns the Map of String, String + */ + @JsonGetter("pai") + public Map getPai() { + return pai; + } + + /** + * Setter for Pai. + * @param pai Value for Map of String, String + */ + @JsonSetter("pai") + public void setPai(Map pai) { + this.pai = pai; + } + /** * Getter for StartTime. * @return Returns the LocalDateTime @@ -241,7 +304,7 @@ public void setState(StateEnum state) { @JsonGetter("startTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getStartTime() { - return this.startTime; + return startTime; } /** @@ -261,7 +324,7 @@ public void setStartTime(LocalDateTime startTime) { @JsonGetter("answerTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getAnswerTime() { - return this.answerTime; + return answerTime; } /** @@ -281,7 +344,7 @@ public void setAnswerTime(LocalDateTime answerTime) { @JsonGetter("endTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getEndTime() { - return this.endTime; + return endTime; } /** @@ -300,7 +363,7 @@ public void setEndTime(LocalDateTime endTime) { */ @JsonGetter("disconnectCause") public DisconnectCauseEnum getDisconnectCause() { - return this.disconnectCause; + return disconnectCause; } /** @@ -318,7 +381,7 @@ public void setDisconnectCause(DisconnectCauseEnum disconnectCause) { */ @JsonGetter("errorMessage") public String getErrorMessage() { - return this.errorMessage; + return errorMessage; } /** @@ -336,7 +399,7 @@ public void setErrorMessage(String errorMessage) { */ @JsonGetter("errorId") public String getErrorId() { - return this.errorId; + return errorId; } /** @@ -355,7 +418,7 @@ public void setErrorId(String errorId) { @JsonGetter("lastUpdate") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getLastUpdate() { - return this.lastUpdate; + return lastUpdate; } /** @@ -376,10 +439,11 @@ public void setLastUpdate(LocalDateTime lastUpdate) { public String toString() { return "ApiCallStateResponse [" + "callId=" + callId + ", parentCallId=" + parentCallId + ", applicationId=" + applicationId + ", accountId=" + accountId + ", to=" + to - + ", from=" + from + ", direction=" + direction + ", state=" + state - + ", startTime=" + startTime + ", answerTime=" + answerTime + ", endTime=" + endTime - + ", disconnectCause=" + disconnectCause + ", errorMessage=" + errorMessage - + ", errorId=" + errorId + ", lastUpdate=" + lastUpdate + "]"; + + ", from=" + from + ", direction=" + direction + ", state=" + state + ", identity=" + + identity + ", pai=" + pai + ", startTime=" + startTime + ", answerTime=" + + answerTime + ", endTime=" + endTime + ", disconnectCause=" + disconnectCause + + ", errorMessage=" + errorMessage + ", errorId=" + errorId + ", lastUpdate=" + + lastUpdate + "]"; } /** @@ -397,6 +461,8 @@ public Builder toBuilder() { .from(getFrom()) .direction(getDirection()) .state(getState()) + .identity(getIdentity()) + .pai(getPai()) .startTime(getStartTime()) .answerTime(getAnswerTime()) .endTime(getEndTime()) @@ -419,6 +485,8 @@ public static class Builder { private String from; private String direction; private StateEnum state; + private String identity; + private Map pai; private LocalDateTime startTime; private LocalDateTime answerTime; private LocalDateTime endTime; @@ -431,7 +499,7 @@ public static class Builder { /** * Setter for callId. - * @param callId String value for callId. + * @param callId String value for callId. * @return Builder */ public Builder callId(String callId) { @@ -441,7 +509,7 @@ public Builder callId(String callId) { /** * Setter for parentCallId. - * @param parentCallId String value for parentCallId. + * @param parentCallId String value for parentCallId. * @return Builder */ public Builder parentCallId(String parentCallId) { @@ -451,7 +519,7 @@ public Builder parentCallId(String parentCallId) { /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -461,7 +529,7 @@ public Builder applicationId(String applicationId) { /** * Setter for accountId. - * @param accountId String value for accountId. + * @param accountId String value for accountId. * @return Builder */ public Builder accountId(String accountId) { @@ -471,7 +539,7 @@ public Builder accountId(String accountId) { /** * Setter for to. - * @param to String value for to. + * @param to String value for to. * @return Builder */ public Builder to(String to) { @@ -481,7 +549,7 @@ public Builder to(String to) { /** * Setter for from. - * @param from String value for from. + * @param from String value for from. * @return Builder */ public Builder from(String from) { @@ -491,7 +559,7 @@ public Builder from(String from) { /** * Setter for direction. - * @param direction String value for direction. + * @param direction String value for direction. * @return Builder */ public Builder direction(String direction) { @@ -501,7 +569,7 @@ public Builder direction(String direction) { /** * Setter for state. - * @param state StateEnum value for state. + * @param state StateEnum value for state. * @return Builder */ public Builder state(StateEnum state) { @@ -509,9 +577,29 @@ public Builder state(StateEnum state) { return this; } + /** + * Setter for identity. + * @param identity String value for identity. + * @return Builder + */ + public Builder identity(String identity) { + this.identity = identity; + return this; + } + + /** + * Setter for pai. + * @param pai Map of String, value for pai. + * @return Builder + */ + public Builder pai(Map pai) { + this.pai = pai; + return this; + } + /** * Setter for startTime. - * @param startTime LocalDateTime value for startTime. + * @param startTime LocalDateTime value for startTime. * @return Builder */ public Builder startTime(LocalDateTime startTime) { @@ -521,7 +609,7 @@ public Builder startTime(LocalDateTime startTime) { /** * Setter for answerTime. - * @param answerTime LocalDateTime value for answerTime. + * @param answerTime LocalDateTime value for answerTime. * @return Builder */ public Builder answerTime(LocalDateTime answerTime) { @@ -531,7 +619,7 @@ public Builder answerTime(LocalDateTime answerTime) { /** * Setter for endTime. - * @param endTime LocalDateTime value for endTime. + * @param endTime LocalDateTime value for endTime. * @return Builder */ public Builder endTime(LocalDateTime endTime) { @@ -541,7 +629,7 @@ public Builder endTime(LocalDateTime endTime) { /** * Setter for disconnectCause. - * @param disconnectCause DisconnectCauseEnum value for disconnectCause. + * @param disconnectCause DisconnectCauseEnum value for disconnectCause. * @return Builder */ public Builder disconnectCause(DisconnectCauseEnum disconnectCause) { @@ -551,7 +639,7 @@ public Builder disconnectCause(DisconnectCauseEnum disconnectCause) { /** * Setter for errorMessage. - * @param errorMessage String value for errorMessage. + * @param errorMessage String value for errorMessage. * @return Builder */ public Builder errorMessage(String errorMessage) { @@ -561,7 +649,7 @@ public Builder errorMessage(String errorMessage) { /** * Setter for errorId. - * @param errorId String value for errorId. + * @param errorId String value for errorId. * @return Builder */ public Builder errorId(String errorId) { @@ -571,7 +659,7 @@ public Builder errorId(String errorId) { /** * Setter for lastUpdate. - * @param lastUpdate LocalDateTime value for lastUpdate. + * @param lastUpdate LocalDateTime value for lastUpdate. * @return Builder */ public Builder lastUpdate(LocalDateTime lastUpdate) { @@ -585,8 +673,8 @@ public Builder lastUpdate(LocalDateTime lastUpdate) { */ public ApiCallStateResponse build() { return new ApiCallStateResponse(callId, parentCallId, applicationId, accountId, to, - from, direction, state, startTime, answerTime, endTime, disconnectCause, - errorMessage, errorId, lastUpdate); + from, direction, state, identity, pai, startTime, answerTime, endTime, + disconnectCause, errorMessage, errorId, lastUpdate); } } } diff --git a/src/main/java/com/bandwidth/voice/models/ApiCreateCallRequest.java b/src/main/java/com/bandwidth/voice/models/ApiCreateCallRequest.java index f9cc6392..9bde4d50 100644 --- a/src/main/java/com/bandwidth/voice/models/ApiCreateCallRequest.java +++ b/src/main/java/com/bandwidth/voice/models/ApiCreateCallRequest.java @@ -7,6 +7,7 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** @@ -15,22 +16,37 @@ public class ApiCreateCallRequest { private String from; private String to; + @JsonInclude(JsonInclude.Include.NON_NULL) private String uui; + @JsonInclude(JsonInclude.Include.NON_NULL) private Double callTimeout; + @JsonInclude(JsonInclude.Include.NON_NULL) private Double callbackTimeout; private String answerUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) private String answerFallbackUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) private String username; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; + @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackUsername; + @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackPassword; + @JsonInclude(JsonInclude.Include.NON_NULL) private AnswerMethodEnum answerMethod; + @JsonInclude(JsonInclude.Include.NON_NULL) private AnswerFallbackMethodEnum answerFallbackMethod; + @JsonInclude(JsonInclude.Include.NON_NULL) private String disconnectUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) private DisconnectMethodEnum disconnectMethod; + @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; private String applicationId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String obfuscatedTo; + @JsonInclude(JsonInclude.Include.NON_NULL) private String obfuscatedFrom; /** @@ -41,25 +57,25 @@ public ApiCreateCallRequest() { /** * Initialization constructor. - * @param from String value for from. - * @param to String value for to. - * @param answerUrl String value for answerUrl. - * @param applicationId String value for applicationId. - * @param uui String value for uui. - * @param callTimeout Double value for callTimeout. - * @param callbackTimeout Double value for callbackTimeout. - * @param answerFallbackUrl String value for answerFallbackUrl. - * @param username String value for username. - * @param password String value for password. - * @param fallbackUsername String value for fallbackUsername. - * @param fallbackPassword String value for fallbackPassword. - * @param answerMethod AnswerMethodEnum value for answerMethod. - * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. - * @param disconnectUrl String value for disconnectUrl. - * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. - * @param tag String value for tag. - * @param obfuscatedTo String value for obfuscatedTo. - * @param obfuscatedFrom String value for obfuscatedFrom. + * @param from String value for from. + * @param to String value for to. + * @param answerUrl String value for answerUrl. + * @param applicationId String value for applicationId. + * @param uui String value for uui. + * @param callTimeout Double value for callTimeout. + * @param callbackTimeout Double value for callbackTimeout. + * @param answerFallbackUrl String value for answerFallbackUrl. + * @param username String value for username. + * @param password String value for password. + * @param fallbackUsername String value for fallbackUsername. + * @param fallbackPassword String value for fallbackPassword. + * @param answerMethod AnswerMethodEnum value for answerMethod. + * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. + * @param disconnectUrl String value for disconnectUrl. + * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. + * @param tag String value for tag. + * @param obfuscatedTo String value for obfuscatedTo. + * @param obfuscatedFrom String value for obfuscatedFrom. */ public ApiCreateCallRequest( String from, @@ -109,7 +125,7 @@ public ApiCreateCallRequest( */ @JsonGetter("from") public String getFrom() { - return this.from; + return from; } /** @@ -129,7 +145,7 @@ public void setFrom(String from) { */ @JsonGetter("to") public String getTo() { - return this.to; + return to; } /** @@ -152,7 +168,7 @@ public void setTo(String to) { */ @JsonGetter("uui") public String getUui() { - return this.uui; + return uui; } /** @@ -174,7 +190,7 @@ public void setUui(String uui) { */ @JsonGetter("callTimeout") public Double getCallTimeout() { - return this.callTimeout; + return callTimeout; } /** @@ -192,7 +208,7 @@ public void setCallTimeout(Double callTimeout) { */ @JsonGetter("callbackTimeout") public Double getCallbackTimeout() { - return this.callbackTimeout; + return callbackTimeout; } /** @@ -210,7 +226,7 @@ public void setCallbackTimeout(Double callbackTimeout) { */ @JsonGetter("answerUrl") public String getAnswerUrl() { - return this.answerUrl; + return answerUrl; } /** @@ -228,7 +244,7 @@ public void setAnswerUrl(String answerUrl) { */ @JsonGetter("answerFallbackUrl") public String getAnswerFallbackUrl() { - return this.answerFallbackUrl; + return answerFallbackUrl; } /** @@ -246,7 +262,7 @@ public void setAnswerFallbackUrl(String answerFallbackUrl) { */ @JsonGetter("username") public String getUsername() { - return this.username; + return username; } /** @@ -264,7 +280,7 @@ public void setUsername(String username) { */ @JsonGetter("password") public String getPassword() { - return this.password; + return password; } /** @@ -282,7 +298,7 @@ public void setPassword(String password) { */ @JsonGetter("fallbackUsername") public String getFallbackUsername() { - return this.fallbackUsername; + return fallbackUsername; } /** @@ -300,7 +316,7 @@ public void setFallbackUsername(String fallbackUsername) { */ @JsonGetter("fallbackPassword") public String getFallbackPassword() { - return this.fallbackPassword; + return fallbackPassword; } /** @@ -318,7 +334,7 @@ public void setFallbackPassword(String fallbackPassword) { */ @JsonGetter("answerMethod") public AnswerMethodEnum getAnswerMethod() { - return this.answerMethod; + return answerMethod; } /** @@ -336,7 +352,7 @@ public void setAnswerMethod(AnswerMethodEnum answerMethod) { */ @JsonGetter("answerFallbackMethod") public AnswerFallbackMethodEnum getAnswerFallbackMethod() { - return this.answerFallbackMethod; + return answerFallbackMethod; } /** @@ -354,7 +370,7 @@ public void setAnswerFallbackMethod(AnswerFallbackMethodEnum answerFallbackMetho */ @JsonGetter("disconnectUrl") public String getDisconnectUrl() { - return this.disconnectUrl; + return disconnectUrl; } /** @@ -372,7 +388,7 @@ public void setDisconnectUrl(String disconnectUrl) { */ @JsonGetter("disconnectMethod") public DisconnectMethodEnum getDisconnectMethod() { - return this.disconnectMethod; + return disconnectMethod; } /** @@ -390,7 +406,7 @@ public void setDisconnectMethod(DisconnectMethodEnum disconnectMethod) { */ @JsonGetter("tag") public String getTag() { - return this.tag; + return tag; } /** @@ -408,7 +424,7 @@ public void setTag(String tag) { */ @JsonGetter("applicationId") public String getApplicationId() { - return this.applicationId; + return applicationId; } /** @@ -426,7 +442,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("obfuscatedTo") public String getObfuscatedTo() { - return this.obfuscatedTo; + return obfuscatedTo; } /** @@ -444,7 +460,7 @@ public void setObfuscatedTo(String obfuscatedTo) { */ @JsonGetter("obfuscatedFrom") public String getObfuscatedFrom() { - return this.obfuscatedFrom; + return obfuscatedFrom; } /** @@ -530,15 +546,12 @@ public Builder() { /** * Initialization constructor. - * @param from String value for from. - * @param to String value for to. - * @param answerUrl String value for answerUrl. - * @param applicationId String value for applicationId. + * @param from String value for from. + * @param to String value for to. + * @param answerUrl String value for answerUrl. + * @param applicationId String value for applicationId. */ - public Builder(String from, - String to, - String answerUrl, - String applicationId) { + public Builder(String from, String to, String answerUrl, String applicationId) { this.from = from; this.to = to; this.answerUrl = answerUrl; @@ -547,7 +560,7 @@ public Builder(String from, /** * Setter for from. - * @param from String value for from. + * @param from String value for from. * @return Builder */ public Builder from(String from) { @@ -557,7 +570,7 @@ public Builder from(String from) { /** * Setter for to. - * @param to String value for to. + * @param to String value for to. * @return Builder */ public Builder to(String to) { @@ -567,7 +580,7 @@ public Builder to(String to) { /** * Setter for answerUrl. - * @param answerUrl String value for answerUrl. + * @param answerUrl String value for answerUrl. * @return Builder */ public Builder answerUrl(String answerUrl) { @@ -577,7 +590,7 @@ public Builder answerUrl(String answerUrl) { /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -587,7 +600,7 @@ public Builder applicationId(String applicationId) { /** * Setter for uui. - * @param uui String value for uui. + * @param uui String value for uui. * @return Builder */ public Builder uui(String uui) { @@ -597,7 +610,7 @@ public Builder uui(String uui) { /** * Setter for callTimeout. - * @param callTimeout Double value for callTimeout. + * @param callTimeout Double value for callTimeout. * @return Builder */ public Builder callTimeout(Double callTimeout) { @@ -607,7 +620,7 @@ public Builder callTimeout(Double callTimeout) { /** * Setter for callbackTimeout. - * @param callbackTimeout Double value for callbackTimeout. + * @param callbackTimeout Double value for callbackTimeout. * @return Builder */ public Builder callbackTimeout(Double callbackTimeout) { @@ -617,7 +630,7 @@ public Builder callbackTimeout(Double callbackTimeout) { /** * Setter for answerFallbackUrl. - * @param answerFallbackUrl String value for answerFallbackUrl. + * @param answerFallbackUrl String value for answerFallbackUrl. * @return Builder */ public Builder answerFallbackUrl(String answerFallbackUrl) { @@ -627,7 +640,7 @@ public Builder answerFallbackUrl(String answerFallbackUrl) { /** * Setter for username. - * @param username String value for username. + * @param username String value for username. * @return Builder */ public Builder username(String username) { @@ -637,7 +650,7 @@ public Builder username(String username) { /** * Setter for password. - * @param password String value for password. + * @param password String value for password. * @return Builder */ public Builder password(String password) { @@ -647,7 +660,7 @@ public Builder password(String password) { /** * Setter for fallbackUsername. - * @param fallbackUsername String value for fallbackUsername. + * @param fallbackUsername String value for fallbackUsername. * @return Builder */ public Builder fallbackUsername(String fallbackUsername) { @@ -657,7 +670,7 @@ public Builder fallbackUsername(String fallbackUsername) { /** * Setter for fallbackPassword. - * @param fallbackPassword String value for fallbackPassword. + * @param fallbackPassword String value for fallbackPassword. * @return Builder */ public Builder fallbackPassword(String fallbackPassword) { @@ -667,7 +680,7 @@ public Builder fallbackPassword(String fallbackPassword) { /** * Setter for answerMethod. - * @param answerMethod AnswerMethodEnum value for answerMethod. + * @param answerMethod AnswerMethodEnum value for answerMethod. * @return Builder */ public Builder answerMethod(AnswerMethodEnum answerMethod) { @@ -677,7 +690,7 @@ public Builder answerMethod(AnswerMethodEnum answerMethod) { /** * Setter for answerFallbackMethod. - * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. + * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. * @return Builder */ public Builder answerFallbackMethod(AnswerFallbackMethodEnum answerFallbackMethod) { @@ -687,7 +700,7 @@ public Builder answerFallbackMethod(AnswerFallbackMethodEnum answerFallbackMetho /** * Setter for disconnectUrl. - * @param disconnectUrl String value for disconnectUrl. + * @param disconnectUrl String value for disconnectUrl. * @return Builder */ public Builder disconnectUrl(String disconnectUrl) { @@ -697,7 +710,7 @@ public Builder disconnectUrl(String disconnectUrl) { /** * Setter for disconnectMethod. - * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. + * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. * @return Builder */ public Builder disconnectMethod(DisconnectMethodEnum disconnectMethod) { @@ -707,7 +720,7 @@ public Builder disconnectMethod(DisconnectMethodEnum disconnectMethod) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { @@ -717,7 +730,7 @@ public Builder tag(String tag) { /** * Setter for obfuscatedTo. - * @param obfuscatedTo String value for obfuscatedTo. + * @param obfuscatedTo String value for obfuscatedTo. * @return Builder */ public Builder obfuscatedTo(String obfuscatedTo) { @@ -727,7 +740,7 @@ public Builder obfuscatedTo(String obfuscatedTo) { /** * Setter for obfuscatedFrom. - * @param obfuscatedFrom String value for obfuscatedFrom. + * @param obfuscatedFrom String value for obfuscatedFrom. * @return Builder */ public Builder obfuscatedFrom(String obfuscatedFrom) { diff --git a/src/main/java/com/bandwidth/voice/models/ApiErrorResponse.java b/src/main/java/com/bandwidth/voice/models/ApiErrorResponse.java new file mode 100644 index 00000000..8d286e7e --- /dev/null +++ b/src/main/java/com/bandwidth/voice/models/ApiErrorResponse.java @@ -0,0 +1,170 @@ +/* + * BandwidthLib + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +package com.bandwidth.voice.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for ApiErrorResponse type. + */ +public class ApiErrorResponse { + @JsonInclude(JsonInclude.Include.NON_NULL) + private String type; + @JsonInclude(JsonInclude.Include.NON_NULL) + private String description; + @JsonInclude(JsonInclude.Include.NON_NULL) + private String id; + + /** + * Default constructor. + */ + public ApiErrorResponse() { + } + + /** + * Initialization constructor. + * @param type String value for type. + * @param description String value for description. + * @param id String value for id. + */ + public ApiErrorResponse( + String type, + String description, + String id) { + this.type = type; + this.description = description; + this.id = id; + } + + /** + * Getter for Type. + * @return Returns the String + */ + @JsonGetter("type") + public String getType() { + return type; + } + + /** + * Setter for Type. + * @param type Value for String + */ + @JsonSetter("type") + public void setType(String type) { + this.type = type; + } + + /** + * Getter for Description. + * @return Returns the String + */ + @JsonGetter("description") + public String getDescription() { + return description; + } + + /** + * Setter for Description. + * @param description Value for String + */ + @JsonSetter("description") + public void setDescription(String description) { + this.description = description; + } + + /** + * Getter for Id. + * @return Returns the String + */ + @JsonGetter("id") + public String getId() { + return id; + } + + /** + * Setter for Id. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = id; + } + + /** + * Converts this ApiErrorResponse into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ApiErrorResponse [" + "type=" + type + ", description=" + description + ", id=" + id + + "]"; + } + + /** + * Builds a new {@link ApiErrorResponse.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ApiErrorResponse.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .type(getType()) + .description(getDescription()) + .id(getId()); + return builder; + } + + /** + * Class to build instances of {@link ApiErrorResponse}. + */ + public static class Builder { + private String type; + private String description; + private String id; + + + + /** + * Setter for type. + * @param type String value for type. + * @return Builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Setter for description. + * @param description String value for description. + * @return Builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Builds a new {@link ApiErrorResponse} object using the set fields. + * @return {@link ApiErrorResponse} + */ + public ApiErrorResponse build() { + return new ApiErrorResponse(type, description, id); + } + } +} diff --git a/src/main/java/com/bandwidth/voice/models/ApiModifyCallRequest.java b/src/main/java/com/bandwidth/voice/models/ApiModifyCallRequest.java index d83f1a46..8a3a7340 100644 --- a/src/main/java/com/bandwidth/voice/models/ApiModifyCallRequest.java +++ b/src/main/java/com/bandwidth/voice/models/ApiModifyCallRequest.java @@ -7,21 +7,31 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for ApiModifyCallRequest type. */ public class ApiModifyCallRequest { + @JsonInclude(JsonInclude.Include.NON_NULL) private State1Enum state; private String redirectUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) private String redirectFallbackUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) private RedirectMethodEnum redirectMethod; + @JsonInclude(JsonInclude.Include.NON_NULL) private RedirectFallbackMethodEnum redirectFallbackMethod; + @JsonInclude(JsonInclude.Include.NON_NULL) private String username; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; + @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackUsername; + @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackPassword; + @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; /** @@ -32,16 +42,16 @@ public ApiModifyCallRequest() { /** * Initialization constructor. - * @param redirectUrl String value for redirectUrl. - * @param state State1Enum value for state. - * @param redirectFallbackUrl String value for redirectFallbackUrl. - * @param redirectMethod RedirectMethodEnum value for redirectMethod. - * @param redirectFallbackMethod RedirectFallbackMethodEnum value for redirectFallbackMethod. - * @param username String value for username. - * @param password String value for password. - * @param fallbackUsername String value for fallbackUsername. - * @param fallbackPassword String value for fallbackPassword. - * @param tag String value for tag. + * @param redirectUrl String value for redirectUrl. + * @param state State1Enum value for state. + * @param redirectFallbackUrl String value for redirectFallbackUrl. + * @param redirectMethod RedirectMethodEnum value for redirectMethod. + * @param redirectFallbackMethod RedirectFallbackMethodEnum value for redirectFallbackMethod. + * @param username String value for username. + * @param password String value for password. + * @param fallbackUsername String value for fallbackUsername. + * @param fallbackPassword String value for fallbackPassword. + * @param tag String value for tag. */ public ApiModifyCallRequest( String redirectUrl, @@ -72,7 +82,7 @@ public ApiModifyCallRequest( */ @JsonGetter("state") public State1Enum getState() { - return this.state; + return state; } /** @@ -90,7 +100,7 @@ public void setState(State1Enum state) { */ @JsonGetter("redirectUrl") public String getRedirectUrl() { - return this.redirectUrl; + return redirectUrl; } /** @@ -108,7 +118,7 @@ public void setRedirectUrl(String redirectUrl) { */ @JsonGetter("redirectFallbackUrl") public String getRedirectFallbackUrl() { - return this.redirectFallbackUrl; + return redirectFallbackUrl; } /** @@ -126,7 +136,7 @@ public void setRedirectFallbackUrl(String redirectFallbackUrl) { */ @JsonGetter("redirectMethod") public RedirectMethodEnum getRedirectMethod() { - return this.redirectMethod; + return redirectMethod; } /** @@ -144,7 +154,7 @@ public void setRedirectMethod(RedirectMethodEnum redirectMethod) { */ @JsonGetter("redirectFallbackMethod") public RedirectFallbackMethodEnum getRedirectFallbackMethod() { - return this.redirectFallbackMethod; + return redirectFallbackMethod; } /** @@ -162,7 +172,7 @@ public void setRedirectFallbackMethod(RedirectFallbackMethodEnum redirectFallbac */ @JsonGetter("username") public String getUsername() { - return this.username; + return username; } /** @@ -180,7 +190,7 @@ public void setUsername(String username) { */ @JsonGetter("password") public String getPassword() { - return this.password; + return password; } /** @@ -198,7 +208,7 @@ public void setPassword(String password) { */ @JsonGetter("fallbackUsername") public String getFallbackUsername() { - return this.fallbackUsername; + return fallbackUsername; } /** @@ -216,7 +226,7 @@ public void setFallbackUsername(String fallbackUsername) { */ @JsonGetter("fallbackPassword") public String getFallbackPassword() { - return this.fallbackPassword; + return fallbackPassword; } /** @@ -234,7 +244,7 @@ public void setFallbackPassword(String fallbackPassword) { */ @JsonGetter("tag") public String getTag() { - return this.tag; + return tag; } /** @@ -302,7 +312,7 @@ public Builder() { /** * Initialization constructor. - * @param redirectUrl String value for redirectUrl. + * @param redirectUrl String value for redirectUrl. */ public Builder(String redirectUrl) { this.redirectUrl = redirectUrl; @@ -310,7 +320,7 @@ public Builder(String redirectUrl) { /** * Setter for redirectUrl. - * @param redirectUrl String value for redirectUrl. + * @param redirectUrl String value for redirectUrl. * @return Builder */ public Builder redirectUrl(String redirectUrl) { @@ -320,7 +330,7 @@ public Builder redirectUrl(String redirectUrl) { /** * Setter for state. - * @param state State1Enum value for state. + * @param state State1Enum value for state. * @return Builder */ public Builder state(State1Enum state) { @@ -330,7 +340,7 @@ public Builder state(State1Enum state) { /** * Setter for redirectFallbackUrl. - * @param redirectFallbackUrl String value for redirectFallbackUrl. + * @param redirectFallbackUrl String value for redirectFallbackUrl. * @return Builder */ public Builder redirectFallbackUrl(String redirectFallbackUrl) { @@ -340,7 +350,7 @@ public Builder redirectFallbackUrl(String redirectFallbackUrl) { /** * Setter for redirectMethod. - * @param redirectMethod RedirectMethodEnum value for redirectMethod. + * @param redirectMethod RedirectMethodEnum value for redirectMethod. * @return Builder */ public Builder redirectMethod(RedirectMethodEnum redirectMethod) { @@ -350,7 +360,8 @@ public Builder redirectMethod(RedirectMethodEnum redirectMethod) { /** * Setter for redirectFallbackMethod. - * @param redirectFallbackMethod RedirectFallbackMethodEnum value for redirectFallbackMethod. + * @param redirectFallbackMethod RedirectFallbackMethodEnum value for + * redirectFallbackMethod. * @return Builder */ public Builder redirectFallbackMethod(RedirectFallbackMethodEnum redirectFallbackMethod) { @@ -360,7 +371,7 @@ public Builder redirectFallbackMethod(RedirectFallbackMethodEnum redirectFallbac /** * Setter for username. - * @param username String value for username. + * @param username String value for username. * @return Builder */ public Builder username(String username) { @@ -370,7 +381,7 @@ public Builder username(String username) { /** * Setter for password. - * @param password String value for password. + * @param password String value for password. * @return Builder */ public Builder password(String password) { @@ -380,7 +391,7 @@ public Builder password(String password) { /** * Setter for fallbackUsername. - * @param fallbackUsername String value for fallbackUsername. + * @param fallbackUsername String value for fallbackUsername. * @return Builder */ public Builder fallbackUsername(String fallbackUsername) { @@ -390,7 +401,7 @@ public Builder fallbackUsername(String fallbackUsername) { /** * Setter for fallbackPassword. - * @param fallbackPassword String value for fallbackPassword. + * @param fallbackPassword String value for fallbackPassword. * @return Builder */ public Builder fallbackPassword(String fallbackPassword) { @@ -400,7 +411,7 @@ public Builder fallbackPassword(String fallbackPassword) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { diff --git a/src/main/java/com/bandwidth/voice/models/ApiModifyConferenceRequest.java b/src/main/java/com/bandwidth/voice/models/ApiModifyConferenceRequest.java index 066fea32..3ff78886 100644 --- a/src/main/java/com/bandwidth/voice/models/ApiModifyConferenceRequest.java +++ b/src/main/java/com/bandwidth/voice/models/ApiModifyConferenceRequest.java @@ -7,20 +7,30 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for ApiModifyConferenceRequest type. */ public class ApiModifyConferenceRequest { + @JsonInclude(JsonInclude.Include.NON_NULL) private StatusEnum status; + @JsonInclude(JsonInclude.Include.NON_NULL) private String redirectUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) private String redirectFallbackUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) private RedirectMethodEnum redirectMethod; + @JsonInclude(JsonInclude.Include.NON_NULL) private RedirectFallbackMethodEnum redirectFallbackMethod; + @JsonInclude(JsonInclude.Include.NON_NULL) private String username; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; + @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackUsername; + @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackPassword; /** @@ -31,15 +41,15 @@ public ApiModifyConferenceRequest() { /** * Initialization constructor. - * @param status StatusEnum value for status. - * @param redirectUrl String value for redirectUrl. - * @param redirectFallbackUrl String value for redirectFallbackUrl. - * @param redirectMethod RedirectMethodEnum value for redirectMethod. - * @param redirectFallbackMethod RedirectFallbackMethodEnum value for redirectFallbackMethod. - * @param username String value for username. - * @param password String value for password. - * @param fallbackUsername String value for fallbackUsername. - * @param fallbackPassword String value for fallbackPassword. + * @param status StatusEnum value for status. + * @param redirectUrl String value for redirectUrl. + * @param redirectFallbackUrl String value for redirectFallbackUrl. + * @param redirectMethod RedirectMethodEnum value for redirectMethod. + * @param redirectFallbackMethod RedirectFallbackMethodEnum value for redirectFallbackMethod. + * @param username String value for username. + * @param password String value for password. + * @param fallbackUsername String value for fallbackUsername. + * @param fallbackPassword String value for fallbackPassword. */ public ApiModifyConferenceRequest( StatusEnum status, @@ -68,7 +78,7 @@ public ApiModifyConferenceRequest( */ @JsonGetter("status") public StatusEnum getStatus() { - return this.status; + return status; } /** @@ -86,7 +96,7 @@ public void setStatus(StatusEnum status) { */ @JsonGetter("redirectUrl") public String getRedirectUrl() { - return this.redirectUrl; + return redirectUrl; } /** @@ -104,7 +114,7 @@ public void setRedirectUrl(String redirectUrl) { */ @JsonGetter("redirectFallbackUrl") public String getRedirectFallbackUrl() { - return this.redirectFallbackUrl; + return redirectFallbackUrl; } /** @@ -122,7 +132,7 @@ public void setRedirectFallbackUrl(String redirectFallbackUrl) { */ @JsonGetter("redirectMethod") public RedirectMethodEnum getRedirectMethod() { - return this.redirectMethod; + return redirectMethod; } /** @@ -140,7 +150,7 @@ public void setRedirectMethod(RedirectMethodEnum redirectMethod) { */ @JsonGetter("redirectFallbackMethod") public RedirectFallbackMethodEnum getRedirectFallbackMethod() { - return this.redirectFallbackMethod; + return redirectFallbackMethod; } /** @@ -158,7 +168,7 @@ public void setRedirectFallbackMethod(RedirectFallbackMethodEnum redirectFallbac */ @JsonGetter("username") public String getUsername() { - return this.username; + return username; } /** @@ -176,7 +186,7 @@ public void setUsername(String username) { */ @JsonGetter("password") public String getPassword() { - return this.password; + return password; } /** @@ -194,7 +204,7 @@ public void setPassword(String password) { */ @JsonGetter("fallbackUsername") public String getFallbackUsername() { - return this.fallbackUsername; + return fallbackUsername; } /** @@ -212,7 +222,7 @@ public void setFallbackUsername(String fallbackUsername) { */ @JsonGetter("fallbackPassword") public String getFallbackPassword() { - return this.fallbackPassword; + return fallbackPassword; } /** @@ -274,7 +284,7 @@ public static class Builder { /** * Setter for status. - * @param status StatusEnum value for status. + * @param status StatusEnum value for status. * @return Builder */ public Builder status(StatusEnum status) { @@ -284,7 +294,7 @@ public Builder status(StatusEnum status) { /** * Setter for redirectUrl. - * @param redirectUrl String value for redirectUrl. + * @param redirectUrl String value for redirectUrl. * @return Builder */ public Builder redirectUrl(String redirectUrl) { @@ -294,7 +304,7 @@ public Builder redirectUrl(String redirectUrl) { /** * Setter for redirectFallbackUrl. - * @param redirectFallbackUrl String value for redirectFallbackUrl. + * @param redirectFallbackUrl String value for redirectFallbackUrl. * @return Builder */ public Builder redirectFallbackUrl(String redirectFallbackUrl) { @@ -304,7 +314,7 @@ public Builder redirectFallbackUrl(String redirectFallbackUrl) { /** * Setter for redirectMethod. - * @param redirectMethod RedirectMethodEnum value for redirectMethod. + * @param redirectMethod RedirectMethodEnum value for redirectMethod. * @return Builder */ public Builder redirectMethod(RedirectMethodEnum redirectMethod) { @@ -314,7 +324,8 @@ public Builder redirectMethod(RedirectMethodEnum redirectMethod) { /** * Setter for redirectFallbackMethod. - * @param redirectFallbackMethod RedirectFallbackMethodEnum value for redirectFallbackMethod. + * @param redirectFallbackMethod RedirectFallbackMethodEnum value for + * redirectFallbackMethod. * @return Builder */ public Builder redirectFallbackMethod(RedirectFallbackMethodEnum redirectFallbackMethod) { @@ -324,7 +335,7 @@ public Builder redirectFallbackMethod(RedirectFallbackMethodEnum redirectFallbac /** * Setter for username. - * @param username String value for username. + * @param username String value for username. * @return Builder */ public Builder username(String username) { @@ -334,7 +345,7 @@ public Builder username(String username) { /** * Setter for password. - * @param password String value for password. + * @param password String value for password. * @return Builder */ public Builder password(String password) { @@ -344,7 +355,7 @@ public Builder password(String password) { /** * Setter for fallbackUsername. - * @param fallbackUsername String value for fallbackUsername. + * @param fallbackUsername String value for fallbackUsername. * @return Builder */ public Builder fallbackUsername(String fallbackUsername) { @@ -354,7 +365,7 @@ public Builder fallbackUsername(String fallbackUsername) { /** * Setter for fallbackPassword. - * @param fallbackPassword String value for fallbackPassword. + * @param fallbackPassword String value for fallbackPassword. * @return Builder */ public Builder fallbackPassword(String fallbackPassword) { diff --git a/src/main/java/com/bandwidth/voice/models/ApiTranscribeRecordingRequest.java b/src/main/java/com/bandwidth/voice/models/ApiTranscribeRecordingRequest.java index 135a26b4..a2ed1d1b 100644 --- a/src/main/java/com/bandwidth/voice/models/ApiTranscribeRecordingRequest.java +++ b/src/main/java/com/bandwidth/voice/models/ApiTranscribeRecordingRequest.java @@ -7,17 +7,24 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for ApiTranscribeRecordingRequest type. */ public class ApiTranscribeRecordingRequest { + @JsonInclude(JsonInclude.Include.NON_NULL) private String callbackUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) private CallbackMethodEnum callbackMethod; + @JsonInclude(JsonInclude.Include.NON_NULL) private String username; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; + @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; + @JsonInclude(JsonInclude.Include.NON_NULL) private Double callbackTimeout; /** @@ -28,12 +35,12 @@ public ApiTranscribeRecordingRequest() { /** * Initialization constructor. - * @param callbackUrl String value for callbackUrl. - * @param callbackMethod CallbackMethodEnum value for callbackMethod. - * @param username String value for username. - * @param password String value for password. - * @param tag String value for tag. - * @param callbackTimeout Double value for callbackTimeout. + * @param callbackUrl String value for callbackUrl. + * @param callbackMethod CallbackMethodEnum value for callbackMethod. + * @param username String value for username. + * @param password String value for password. + * @param tag String value for tag. + * @param callbackTimeout Double value for callbackTimeout. */ public ApiTranscribeRecordingRequest( String callbackUrl, @@ -56,7 +63,7 @@ public ApiTranscribeRecordingRequest( */ @JsonGetter("callbackUrl") public String getCallbackUrl() { - return this.callbackUrl; + return callbackUrl; } /** @@ -74,7 +81,7 @@ public void setCallbackUrl(String callbackUrl) { */ @JsonGetter("callbackMethod") public CallbackMethodEnum getCallbackMethod() { - return this.callbackMethod; + return callbackMethod; } /** @@ -92,7 +99,7 @@ public void setCallbackMethod(CallbackMethodEnum callbackMethod) { */ @JsonGetter("username") public String getUsername() { - return this.username; + return username; } /** @@ -110,7 +117,7 @@ public void setUsername(String username) { */ @JsonGetter("password") public String getPassword() { - return this.password; + return password; } /** @@ -128,7 +135,7 @@ public void setPassword(String password) { */ @JsonGetter("tag") public String getTag() { - return this.tag; + return tag; } /** @@ -146,7 +153,7 @@ public void setTag(String tag) { */ @JsonGetter("callbackTimeout") public Double getCallbackTimeout() { - return this.callbackTimeout; + return callbackTimeout; } /** @@ -200,7 +207,7 @@ public static class Builder { /** * Setter for callbackUrl. - * @param callbackUrl String value for callbackUrl. + * @param callbackUrl String value for callbackUrl. * @return Builder */ public Builder callbackUrl(String callbackUrl) { @@ -210,7 +217,7 @@ public Builder callbackUrl(String callbackUrl) { /** * Setter for callbackMethod. - * @param callbackMethod CallbackMethodEnum value for callbackMethod. + * @param callbackMethod CallbackMethodEnum value for callbackMethod. * @return Builder */ public Builder callbackMethod(CallbackMethodEnum callbackMethod) { @@ -220,7 +227,7 @@ public Builder callbackMethod(CallbackMethodEnum callbackMethod) { /** * Setter for username. - * @param username String value for username. + * @param username String value for username. * @return Builder */ public Builder username(String username) { @@ -230,7 +237,7 @@ public Builder username(String username) { /** * Setter for password. - * @param password String value for password. + * @param password String value for password. * @return Builder */ public Builder password(String password) { @@ -240,7 +247,7 @@ public Builder password(String password) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { @@ -250,7 +257,7 @@ public Builder tag(String tag) { /** * Setter for callbackTimeout. - * @param callbackTimeout Double value for callbackTimeout. + * @param callbackTimeout Double value for callbackTimeout. * @return Builder */ public Builder callbackTimeout(Double callbackTimeout) { diff --git a/src/main/java/com/bandwidth/voice/models/ConferenceDetail.java b/src/main/java/com/bandwidth/voice/models/ConferenceDetail.java index b371afe4..ebc7e704 100644 --- a/src/main/java/com/bandwidth/voice/models/ConferenceDetail.java +++ b/src/main/java/com/bandwidth/voice/models/ConferenceDetail.java @@ -8,6 +8,7 @@ import com.bandwidth.DateTimeHelper; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -18,13 +19,21 @@ * This is a model class for ConferenceDetail type. */ public class ConferenceDetail { + @JsonInclude(JsonInclude.Include.NON_NULL) private String id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime createdTime; + @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime completedTime; + @JsonInclude(JsonInclude.Include.NON_NULL) private String conferenceEventUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) private ConferenceEventMethodEnum conferenceEventMethod; + @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; + @JsonInclude(JsonInclude.Include.NON_NULL) private List activeMembers; /** @@ -35,14 +44,14 @@ public ConferenceDetail() { /** * Initialization constructor. - * @param id String value for id. - * @param name String value for name. - * @param createdTime LocalDateTime value for createdTime. - * @param completedTime LocalDateTime value for completedTime. - * @param conferenceEventUrl String value for conferenceEventUrl. - * @param conferenceEventMethod ConferenceEventMethodEnum value for conferenceEventMethod. - * @param tag String value for tag. - * @param activeMembers List of ConferenceMemberDetail value for activeMembers. + * @param id String value for id. + * @param name String value for name. + * @param createdTime LocalDateTime value for createdTime. + * @param completedTime LocalDateTime value for completedTime. + * @param conferenceEventUrl String value for conferenceEventUrl. + * @param conferenceEventMethod ConferenceEventMethodEnum value for conferenceEventMethod. + * @param tag String value for tag. + * @param activeMembers List of ConferenceMemberDetail value for activeMembers. */ public ConferenceDetail( String id, @@ -69,7 +78,7 @@ public ConferenceDetail( */ @JsonGetter("id") public String getId() { - return this.id; + return id; } /** @@ -87,7 +96,7 @@ public void setId(String id) { */ @JsonGetter("name") public String getName() { - return this.name; + return name; } /** @@ -106,7 +115,7 @@ public void setName(String name) { @JsonGetter("createdTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getCreatedTime() { - return this.createdTime; + return createdTime; } /** @@ -126,7 +135,7 @@ public void setCreatedTime(LocalDateTime createdTime) { @JsonGetter("completedTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getCompletedTime() { - return this.completedTime; + return completedTime; } /** @@ -145,7 +154,7 @@ public void setCompletedTime(LocalDateTime completedTime) { */ @JsonGetter("conferenceEventUrl") public String getConferenceEventUrl() { - return this.conferenceEventUrl; + return conferenceEventUrl; } /** @@ -163,7 +172,7 @@ public void setConferenceEventUrl(String conferenceEventUrl) { */ @JsonGetter("conferenceEventMethod") public ConferenceEventMethodEnum getConferenceEventMethod() { - return this.conferenceEventMethod; + return conferenceEventMethod; } /** @@ -181,7 +190,7 @@ public void setConferenceEventMethod(ConferenceEventMethodEnum conferenceEventMe */ @JsonGetter("tag") public String getTag() { - return this.tag; + return tag; } /** @@ -199,7 +208,7 @@ public void setTag(String tag) { */ @JsonGetter("activeMembers") public List getActiveMembers() { - return this.activeMembers; + return activeMembers; } /** @@ -258,7 +267,7 @@ public static class Builder { /** * Setter for id. - * @param id String value for id. + * @param id String value for id. * @return Builder */ public Builder id(String id) { @@ -268,7 +277,7 @@ public Builder id(String id) { /** * Setter for name. - * @param name String value for name. + * @param name String value for name. * @return Builder */ public Builder name(String name) { @@ -278,7 +287,7 @@ public Builder name(String name) { /** * Setter for createdTime. - * @param createdTime LocalDateTime value for createdTime. + * @param createdTime LocalDateTime value for createdTime. * @return Builder */ public Builder createdTime(LocalDateTime createdTime) { @@ -288,7 +297,7 @@ public Builder createdTime(LocalDateTime createdTime) { /** * Setter for completedTime. - * @param completedTime LocalDateTime value for completedTime. + * @param completedTime LocalDateTime value for completedTime. * @return Builder */ public Builder completedTime(LocalDateTime completedTime) { @@ -298,7 +307,7 @@ public Builder completedTime(LocalDateTime completedTime) { /** * Setter for conferenceEventUrl. - * @param conferenceEventUrl String value for conferenceEventUrl. + * @param conferenceEventUrl String value for conferenceEventUrl. * @return Builder */ public Builder conferenceEventUrl(String conferenceEventUrl) { @@ -308,7 +317,7 @@ public Builder conferenceEventUrl(String conferenceEventUrl) { /** * Setter for conferenceEventMethod. - * @param conferenceEventMethod ConferenceEventMethodEnum value for conferenceEventMethod. + * @param conferenceEventMethod ConferenceEventMethodEnum value for conferenceEventMethod. * @return Builder */ public Builder conferenceEventMethod(ConferenceEventMethodEnum conferenceEventMethod) { @@ -318,7 +327,7 @@ public Builder conferenceEventMethod(ConferenceEventMethodEnum conferenceEventMe /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { @@ -328,7 +337,7 @@ public Builder tag(String tag) { /** * Setter for activeMembers. - * @param activeMembers List of ConferenceMemberDetail value for activeMembers. + * @param activeMembers List of ConferenceMemberDetail value for activeMembers. * @return Builder */ public Builder activeMembers(List activeMembers) { diff --git a/src/main/java/com/bandwidth/voice/models/ConferenceMemberDetail.java b/src/main/java/com/bandwidth/voice/models/ConferenceMemberDetail.java index 26fd91af..54d8c389 100644 --- a/src/main/java/com/bandwidth/voice/models/ConferenceMemberDetail.java +++ b/src/main/java/com/bandwidth/voice/models/ConferenceMemberDetail.java @@ -7,6 +7,7 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import java.util.List; @@ -14,11 +15,17 @@ * This is a model class for ConferenceMemberDetail type. */ public class ConferenceMemberDetail { + @JsonInclude(JsonInclude.Include.NON_NULL) private String callId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String conferenceId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String memberUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean mute; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean hold; + @JsonInclude(JsonInclude.Include.NON_NULL) private List callIdsToCoach; /** @@ -29,12 +36,12 @@ public ConferenceMemberDetail() { /** * Initialization constructor. - * @param callId String value for callId. - * @param conferenceId String value for conferenceId. - * @param memberUrl String value for memberUrl. - * @param mute Boolean value for mute. - * @param hold Boolean value for hold. - * @param callIdsToCoach List of String value for callIdsToCoach. + * @param callId String value for callId. + * @param conferenceId String value for conferenceId. + * @param memberUrl String value for memberUrl. + * @param mute Boolean value for mute. + * @param hold Boolean value for hold. + * @param callIdsToCoach List of String value for callIdsToCoach. */ public ConferenceMemberDetail( String callId, @@ -57,7 +64,7 @@ public ConferenceMemberDetail( */ @JsonGetter("callId") public String getCallId() { - return this.callId; + return callId; } /** @@ -75,7 +82,7 @@ public void setCallId(String callId) { */ @JsonGetter("conferenceId") public String getConferenceId() { - return this.conferenceId; + return conferenceId; } /** @@ -93,7 +100,7 @@ public void setConferenceId(String conferenceId) { */ @JsonGetter("memberUrl") public String getMemberUrl() { - return this.memberUrl; + return memberUrl; } /** @@ -111,7 +118,7 @@ public void setMemberUrl(String memberUrl) { */ @JsonGetter("mute") public Boolean getMute() { - return this.mute; + return mute; } /** @@ -129,7 +136,7 @@ public void setMute(Boolean mute) { */ @JsonGetter("hold") public Boolean getHold() { - return this.hold; + return hold; } /** @@ -147,7 +154,7 @@ public void setHold(Boolean hold) { */ @JsonGetter("callIdsToCoach") public List getCallIdsToCoach() { - return this.callIdsToCoach; + return callIdsToCoach; } /** @@ -201,7 +208,7 @@ public static class Builder { /** * Setter for callId. - * @param callId String value for callId. + * @param callId String value for callId. * @return Builder */ public Builder callId(String callId) { @@ -211,7 +218,7 @@ public Builder callId(String callId) { /** * Setter for conferenceId. - * @param conferenceId String value for conferenceId. + * @param conferenceId String value for conferenceId. * @return Builder */ public Builder conferenceId(String conferenceId) { @@ -221,7 +228,7 @@ public Builder conferenceId(String conferenceId) { /** * Setter for memberUrl. - * @param memberUrl String value for memberUrl. + * @param memberUrl String value for memberUrl. * @return Builder */ public Builder memberUrl(String memberUrl) { @@ -231,7 +238,7 @@ public Builder memberUrl(String memberUrl) { /** * Setter for mute. - * @param mute Boolean value for mute. + * @param mute Boolean value for mute. * @return Builder */ public Builder mute(Boolean mute) { @@ -241,7 +248,7 @@ public Builder mute(Boolean mute) { /** * Setter for hold. - * @param hold Boolean value for hold. + * @param hold Boolean value for hold. * @return Builder */ public Builder hold(Boolean hold) { @@ -251,7 +258,7 @@ public Builder hold(Boolean hold) { /** * Setter for callIdsToCoach. - * @param callIdsToCoach List of String value for callIdsToCoach. + * @param callIdsToCoach List of String value for callIdsToCoach. * @return Builder */ public Builder callIdsToCoach(List callIdsToCoach) { diff --git a/src/main/java/com/bandwidth/voice/models/ConferenceRecordingMetadataResponse.java b/src/main/java/com/bandwidth/voice/models/ConferenceRecordingMetadataResponse.java index b1dfbec2..80258adf 100644 --- a/src/main/java/com/bandwidth/voice/models/ConferenceRecordingMetadataResponse.java +++ b/src/main/java/com/bandwidth/voice/models/ConferenceRecordingMetadataResponse.java @@ -8,6 +8,7 @@ import com.bandwidth.DateTimeHelper; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -17,16 +18,27 @@ * This is a model class for ConferenceRecordingMetadataResponse type. */ public class ConferenceRecordingMetadataResponse { + @JsonInclude(JsonInclude.Include.NON_NULL) private String accountId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String conferenceId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private String recordingId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String duration; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer channels; + @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime startTime; + @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime endTime; + @JsonInclude(JsonInclude.Include.NON_NULL) private FileFormatEnum fileFormat; + @JsonInclude(JsonInclude.Include.NON_NULL) private Status1Enum status; + @JsonInclude(JsonInclude.Include.NON_NULL) private String mediaUrl; /** @@ -37,17 +49,17 @@ public ConferenceRecordingMetadataResponse() { /** * Initialization constructor. - * @param accountId String value for accountId. - * @param conferenceId String value for conferenceId. - * @param name String value for name. - * @param recordingId String value for recordingId. - * @param duration String value for duration. - * @param channels Integer value for channels. - * @param startTime LocalDateTime value for startTime. - * @param endTime LocalDateTime value for endTime. - * @param fileFormat FileFormatEnum value for fileFormat. - * @param status Status1Enum value for status. - * @param mediaUrl String value for mediaUrl. + * @param accountId String value for accountId. + * @param conferenceId String value for conferenceId. + * @param name String value for name. + * @param recordingId String value for recordingId. + * @param duration String value for duration. + * @param channels Integer value for channels. + * @param startTime LocalDateTime value for startTime. + * @param endTime LocalDateTime value for endTime. + * @param fileFormat FileFormatEnum value for fileFormat. + * @param status Status1Enum value for status. + * @param mediaUrl String value for mediaUrl. */ public ConferenceRecordingMetadataResponse( String accountId, @@ -80,7 +92,7 @@ public ConferenceRecordingMetadataResponse( */ @JsonGetter("accountId") public String getAccountId() { - return this.accountId; + return accountId; } /** @@ -98,7 +110,7 @@ public void setAccountId(String accountId) { */ @JsonGetter("conferenceId") public String getConferenceId() { - return this.conferenceId; + return conferenceId; } /** @@ -116,7 +128,7 @@ public void setConferenceId(String conferenceId) { */ @JsonGetter("name") public String getName() { - return this.name; + return name; } /** @@ -134,7 +146,7 @@ public void setName(String name) { */ @JsonGetter("recordingId") public String getRecordingId() { - return this.recordingId; + return recordingId; } /** @@ -153,7 +165,7 @@ public void setRecordingId(String recordingId) { */ @JsonGetter("duration") public String getDuration() { - return this.duration; + return duration; } /** @@ -172,7 +184,7 @@ public void setDuration(String duration) { */ @JsonGetter("channels") public Integer getChannels() { - return this.channels; + return channels; } /** @@ -191,7 +203,7 @@ public void setChannels(Integer channels) { @JsonGetter("startTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getStartTime() { - return this.startTime; + return startTime; } /** @@ -211,7 +223,7 @@ public void setStartTime(LocalDateTime startTime) { @JsonGetter("endTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getEndTime() { - return this.endTime; + return endTime; } /** @@ -230,7 +242,7 @@ public void setEndTime(LocalDateTime endTime) { */ @JsonGetter("fileFormat") public FileFormatEnum getFileFormat() { - return this.fileFormat; + return fileFormat; } /** @@ -248,7 +260,7 @@ public void setFileFormat(FileFormatEnum fileFormat) { */ @JsonGetter("status") public Status1Enum getStatus() { - return this.status; + return status; } /** @@ -266,7 +278,7 @@ public void setStatus(Status1Enum status) { */ @JsonGetter("mediaUrl") public String getMediaUrl() { - return this.mediaUrl; + return mediaUrl; } /** @@ -332,7 +344,7 @@ public static class Builder { /** * Setter for accountId. - * @param accountId String value for accountId. + * @param accountId String value for accountId. * @return Builder */ public Builder accountId(String accountId) { @@ -342,7 +354,7 @@ public Builder accountId(String accountId) { /** * Setter for conferenceId. - * @param conferenceId String value for conferenceId. + * @param conferenceId String value for conferenceId. * @return Builder */ public Builder conferenceId(String conferenceId) { @@ -352,7 +364,7 @@ public Builder conferenceId(String conferenceId) { /** * Setter for name. - * @param name String value for name. + * @param name String value for name. * @return Builder */ public Builder name(String name) { @@ -362,7 +374,7 @@ public Builder name(String name) { /** * Setter for recordingId. - * @param recordingId String value for recordingId. + * @param recordingId String value for recordingId. * @return Builder */ public Builder recordingId(String recordingId) { @@ -372,7 +384,7 @@ public Builder recordingId(String recordingId) { /** * Setter for duration. - * @param duration String value for duration. + * @param duration String value for duration. * @return Builder */ public Builder duration(String duration) { @@ -382,7 +394,7 @@ public Builder duration(String duration) { /** * Setter for channels. - * @param channels Integer value for channels. + * @param channels Integer value for channels. * @return Builder */ public Builder channels(Integer channels) { @@ -392,7 +404,7 @@ public Builder channels(Integer channels) { /** * Setter for startTime. - * @param startTime LocalDateTime value for startTime. + * @param startTime LocalDateTime value for startTime. * @return Builder */ public Builder startTime(LocalDateTime startTime) { @@ -402,7 +414,7 @@ public Builder startTime(LocalDateTime startTime) { /** * Setter for endTime. - * @param endTime LocalDateTime value for endTime. + * @param endTime LocalDateTime value for endTime. * @return Builder */ public Builder endTime(LocalDateTime endTime) { @@ -412,7 +424,7 @@ public Builder endTime(LocalDateTime endTime) { /** * Setter for fileFormat. - * @param fileFormat FileFormatEnum value for fileFormat. + * @param fileFormat FileFormatEnum value for fileFormat. * @return Builder */ public Builder fileFormat(FileFormatEnum fileFormat) { @@ -422,7 +434,7 @@ public Builder fileFormat(FileFormatEnum fileFormat) { /** * Setter for status. - * @param status Status1Enum value for status. + * @param status Status1Enum value for status. * @return Builder */ public Builder status(Status1Enum status) { @@ -432,7 +444,7 @@ public Builder status(Status1Enum status) { /** * Setter for mediaUrl. - * @param mediaUrl String value for mediaUrl. + * @param mediaUrl String value for mediaUrl. * @return Builder */ public Builder mediaUrl(String mediaUrl) { diff --git a/src/main/java/com/bandwidth/voice/models/ModifyCallRecordingState.java b/src/main/java/com/bandwidth/voice/models/ModifyCallRecordingState.java index 2156ef20..185a1598 100644 --- a/src/main/java/com/bandwidth/voice/models/ModifyCallRecordingState.java +++ b/src/main/java/com/bandwidth/voice/models/ModifyCallRecordingState.java @@ -23,7 +23,7 @@ public ModifyCallRecordingState() { /** * Initialization constructor. - * @param state State2Enum value for state. + * @param state State2Enum value for state. */ public ModifyCallRecordingState( State2Enum state) { @@ -36,7 +36,7 @@ public ModifyCallRecordingState( */ @JsonGetter("state") public State2Enum getState() { - return this.state; + return state; } /** @@ -81,7 +81,7 @@ public Builder() { /** * Initialization constructor. - * @param state State2Enum value for state. + * @param state State2Enum value for state. */ public Builder(State2Enum state) { this.state = state; @@ -89,7 +89,7 @@ public Builder(State2Enum state) { /** * Setter for state. - * @param state State2Enum value for state. + * @param state State2Enum value for state. * @return Builder */ public Builder state(State2Enum state) { diff --git a/src/main/java/com/bandwidth/voice/models/RecordingMetadataResponse.java b/src/main/java/com/bandwidth/voice/models/RecordingMetadataResponse.java index 21fbeff8..c064b411 100644 --- a/src/main/java/com/bandwidth/voice/models/RecordingMetadataResponse.java +++ b/src/main/java/com/bandwidth/voice/models/RecordingMetadataResponse.java @@ -8,6 +8,7 @@ import com.bandwidth.DateTimeHelper; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -17,23 +18,41 @@ * This is a model class for RecordingMetadataResponse type. */ public class RecordingMetadataResponse { + @JsonInclude(JsonInclude.Include.NON_NULL) private String applicationId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String accountId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String callId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String parentCallId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String recordingId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String to; + @JsonInclude(JsonInclude.Include.NON_NULL) private String from; + @JsonInclude(JsonInclude.Include.NON_NULL) private String transferCallerId; + @JsonInclude(JsonInclude.Include.NON_NULL) private String transferTo; + @JsonInclude(JsonInclude.Include.NON_NULL) private String duration; + @JsonInclude(JsonInclude.Include.NON_NULL) private DirectionEnum direction; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer channels; + @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime startTime; + @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime endTime; + @JsonInclude(JsonInclude.Include.NON_NULL) private FileFormatEnum fileFormat; + @JsonInclude(JsonInclude.Include.NON_NULL) private Status1Enum status; + @JsonInclude(JsonInclude.Include.NON_NULL) private String mediaUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) private Transcription transcription; /** @@ -44,24 +63,24 @@ public RecordingMetadataResponse() { /** * Initialization constructor. - * @param applicationId String value for applicationId. - * @param accountId String value for accountId. - * @param callId String value for callId. - * @param parentCallId String value for parentCallId. - * @param recordingId String value for recordingId. - * @param to String value for to. - * @param from String value for from. - * @param transferCallerId String value for transferCallerId. - * @param transferTo String value for transferTo. - * @param duration String value for duration. - * @param direction DirectionEnum value for direction. - * @param channels Integer value for channels. - * @param startTime LocalDateTime value for startTime. - * @param endTime LocalDateTime value for endTime. - * @param fileFormat FileFormatEnum value for fileFormat. - * @param status Status1Enum value for status. - * @param mediaUrl String value for mediaUrl. - * @param transcription Transcription value for transcription. + * @param applicationId String value for applicationId. + * @param accountId String value for accountId. + * @param callId String value for callId. + * @param parentCallId String value for parentCallId. + * @param recordingId String value for recordingId. + * @param to String value for to. + * @param from String value for from. + * @param transferCallerId String value for transferCallerId. + * @param transferTo String value for transferTo. + * @param duration String value for duration. + * @param direction DirectionEnum value for direction. + * @param channels Integer value for channels. + * @param startTime LocalDateTime value for startTime. + * @param endTime LocalDateTime value for endTime. + * @param fileFormat FileFormatEnum value for fileFormat. + * @param status Status1Enum value for status. + * @param mediaUrl String value for mediaUrl. + * @param transcription Transcription value for transcription. */ public RecordingMetadataResponse( String applicationId, @@ -108,7 +127,7 @@ public RecordingMetadataResponse( */ @JsonGetter("applicationId") public String getApplicationId() { - return this.applicationId; + return applicationId; } /** @@ -126,7 +145,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("accountId") public String getAccountId() { - return this.accountId; + return accountId; } /** @@ -144,7 +163,7 @@ public void setAccountId(String accountId) { */ @JsonGetter("callId") public String getCallId() { - return this.callId; + return callId; } /** @@ -162,7 +181,7 @@ public void setCallId(String callId) { */ @JsonGetter("parentCallId") public String getParentCallId() { - return this.parentCallId; + return parentCallId; } /** @@ -180,7 +199,7 @@ public void setParentCallId(String parentCallId) { */ @JsonGetter("recordingId") public String getRecordingId() { - return this.recordingId; + return recordingId; } /** @@ -198,7 +217,7 @@ public void setRecordingId(String recordingId) { */ @JsonGetter("to") public String getTo() { - return this.to; + return to; } /** @@ -216,7 +235,7 @@ public void setTo(String to) { */ @JsonGetter("from") public String getFrom() { - return this.from; + return from; } /** @@ -234,7 +253,7 @@ public void setFrom(String from) { */ @JsonGetter("transferCallerId") public String getTransferCallerId() { - return this.transferCallerId; + return transferCallerId; } /** @@ -252,7 +271,7 @@ public void setTransferCallerId(String transferCallerId) { */ @JsonGetter("transferTo") public String getTransferTo() { - return this.transferTo; + return transferTo; } /** @@ -271,7 +290,7 @@ public void setTransferTo(String transferTo) { */ @JsonGetter("duration") public String getDuration() { - return this.duration; + return duration; } /** @@ -290,7 +309,7 @@ public void setDuration(String duration) { */ @JsonGetter("direction") public DirectionEnum getDirection() { - return this.direction; + return direction; } /** @@ -308,7 +327,7 @@ public void setDirection(DirectionEnum direction) { */ @JsonGetter("channels") public Integer getChannels() { - return this.channels; + return channels; } /** @@ -327,7 +346,7 @@ public void setChannels(Integer channels) { @JsonGetter("startTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getStartTime() { - return this.startTime; + return startTime; } /** @@ -347,7 +366,7 @@ public void setStartTime(LocalDateTime startTime) { @JsonGetter("endTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getEndTime() { - return this.endTime; + return endTime; } /** @@ -366,7 +385,7 @@ public void setEndTime(LocalDateTime endTime) { */ @JsonGetter("fileFormat") public FileFormatEnum getFileFormat() { - return this.fileFormat; + return fileFormat; } /** @@ -384,7 +403,7 @@ public void setFileFormat(FileFormatEnum fileFormat) { */ @JsonGetter("status") public Status1Enum getStatus() { - return this.status; + return status; } /** @@ -402,7 +421,7 @@ public void setStatus(Status1Enum status) { */ @JsonGetter("mediaUrl") public String getMediaUrl() { - return this.mediaUrl; + return mediaUrl; } /** @@ -420,7 +439,7 @@ public void setMediaUrl(String mediaUrl) { */ @JsonGetter("transcription") public Transcription getTranscription() { - return this.transcription; + return transcription; } /** @@ -503,7 +522,7 @@ public static class Builder { /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -513,7 +532,7 @@ public Builder applicationId(String applicationId) { /** * Setter for accountId. - * @param accountId String value for accountId. + * @param accountId String value for accountId. * @return Builder */ public Builder accountId(String accountId) { @@ -523,7 +542,7 @@ public Builder accountId(String accountId) { /** * Setter for callId. - * @param callId String value for callId. + * @param callId String value for callId. * @return Builder */ public Builder callId(String callId) { @@ -533,7 +552,7 @@ public Builder callId(String callId) { /** * Setter for parentCallId. - * @param parentCallId String value for parentCallId. + * @param parentCallId String value for parentCallId. * @return Builder */ public Builder parentCallId(String parentCallId) { @@ -543,7 +562,7 @@ public Builder parentCallId(String parentCallId) { /** * Setter for recordingId. - * @param recordingId String value for recordingId. + * @param recordingId String value for recordingId. * @return Builder */ public Builder recordingId(String recordingId) { @@ -553,7 +572,7 @@ public Builder recordingId(String recordingId) { /** * Setter for to. - * @param to String value for to. + * @param to String value for to. * @return Builder */ public Builder to(String to) { @@ -563,7 +582,7 @@ public Builder to(String to) { /** * Setter for from. - * @param from String value for from. + * @param from String value for from. * @return Builder */ public Builder from(String from) { @@ -573,7 +592,7 @@ public Builder from(String from) { /** * Setter for transferCallerId. - * @param transferCallerId String value for transferCallerId. + * @param transferCallerId String value for transferCallerId. * @return Builder */ public Builder transferCallerId(String transferCallerId) { @@ -583,7 +602,7 @@ public Builder transferCallerId(String transferCallerId) { /** * Setter for transferTo. - * @param transferTo String value for transferTo. + * @param transferTo String value for transferTo. * @return Builder */ public Builder transferTo(String transferTo) { @@ -593,7 +612,7 @@ public Builder transferTo(String transferTo) { /** * Setter for duration. - * @param duration String value for duration. + * @param duration String value for duration. * @return Builder */ public Builder duration(String duration) { @@ -603,7 +622,7 @@ public Builder duration(String duration) { /** * Setter for direction. - * @param direction DirectionEnum value for direction. + * @param direction DirectionEnum value for direction. * @return Builder */ public Builder direction(DirectionEnum direction) { @@ -613,7 +632,7 @@ public Builder direction(DirectionEnum direction) { /** * Setter for channels. - * @param channels Integer value for channels. + * @param channels Integer value for channels. * @return Builder */ public Builder channels(Integer channels) { @@ -623,7 +642,7 @@ public Builder channels(Integer channels) { /** * Setter for startTime. - * @param startTime LocalDateTime value for startTime. + * @param startTime LocalDateTime value for startTime. * @return Builder */ public Builder startTime(LocalDateTime startTime) { @@ -633,7 +652,7 @@ public Builder startTime(LocalDateTime startTime) { /** * Setter for endTime. - * @param endTime LocalDateTime value for endTime. + * @param endTime LocalDateTime value for endTime. * @return Builder */ public Builder endTime(LocalDateTime endTime) { @@ -643,7 +662,7 @@ public Builder endTime(LocalDateTime endTime) { /** * Setter for fileFormat. - * @param fileFormat FileFormatEnum value for fileFormat. + * @param fileFormat FileFormatEnum value for fileFormat. * @return Builder */ public Builder fileFormat(FileFormatEnum fileFormat) { @@ -653,7 +672,7 @@ public Builder fileFormat(FileFormatEnum fileFormat) { /** * Setter for status. - * @param status Status1Enum value for status. + * @param status Status1Enum value for status. * @return Builder */ public Builder status(Status1Enum status) { @@ -663,7 +682,7 @@ public Builder status(Status1Enum status) { /** * Setter for mediaUrl. - * @param mediaUrl String value for mediaUrl. + * @param mediaUrl String value for mediaUrl. * @return Builder */ public Builder mediaUrl(String mediaUrl) { @@ -673,7 +692,7 @@ public Builder mediaUrl(String mediaUrl) { /** * Setter for transcription. - * @param transcription Transcription value for transcription. + * @param transcription Transcription value for transcription. * @return Builder */ public Builder transcription(Transcription transcription) { diff --git a/src/main/java/com/bandwidth/voice/models/Transcript.java b/src/main/java/com/bandwidth/voice/models/Transcript.java index 46345064..74c96bec 100644 --- a/src/main/java/com/bandwidth/voice/models/Transcript.java +++ b/src/main/java/com/bandwidth/voice/models/Transcript.java @@ -7,13 +7,16 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for Transcript type. */ public class Transcript { + @JsonInclude(JsonInclude.Include.NON_NULL) private String text; + @JsonInclude(JsonInclude.Include.NON_NULL) private Double confidence; /** @@ -24,8 +27,8 @@ public Transcript() { /** * Initialization constructor. - * @param text String value for text. - * @param confidence Double value for confidence. + * @param text String value for text. + * @param confidence Double value for confidence. */ public Transcript( String text, @@ -40,7 +43,7 @@ public Transcript( */ @JsonGetter("text") public String getText() { - return this.text; + return text; } /** @@ -58,7 +61,7 @@ public void setText(String text) { */ @JsonGetter("confidence") public Double getConfidence() { - return this.confidence; + return confidence; } /** @@ -102,7 +105,7 @@ public static class Builder { /** * Setter for text. - * @param text String value for text. + * @param text String value for text. * @return Builder */ public Builder text(String text) { @@ -112,7 +115,7 @@ public Builder text(String text) { /** * Setter for confidence. - * @param confidence Double value for confidence. + * @param confidence Double value for confidence. * @return Builder */ public Builder confidence(Double confidence) { diff --git a/src/main/java/com/bandwidth/voice/models/Transcription.java b/src/main/java/com/bandwidth/voice/models/Transcription.java index 408cf3f1..a7f88d3d 100644 --- a/src/main/java/com/bandwidth/voice/models/Transcription.java +++ b/src/main/java/com/bandwidth/voice/models/Transcription.java @@ -7,15 +7,20 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for Transcription type. */ public class Transcription { + @JsonInclude(JsonInclude.Include.NON_NULL) private String id; + @JsonInclude(JsonInclude.Include.NON_NULL) private Status3Enum status; + @JsonInclude(JsonInclude.Include.NON_NULL) private String completedTime; + @JsonInclude(JsonInclude.Include.NON_NULL) private String url; /** @@ -26,10 +31,10 @@ public Transcription() { /** * Initialization constructor. - * @param id String value for id. - * @param status Status3Enum value for status. - * @param completedTime String value for completedTime. - * @param url String value for url. + * @param id String value for id. + * @param status Status3Enum value for status. + * @param completedTime String value for completedTime. + * @param url String value for url. */ public Transcription( String id, @@ -48,7 +53,7 @@ public Transcription( */ @JsonGetter("id") public String getId() { - return this.id; + return id; } /** @@ -66,7 +71,7 @@ public void setId(String id) { */ @JsonGetter("status") public Status3Enum getStatus() { - return this.status; + return status; } /** @@ -84,7 +89,7 @@ public void setStatus(Status3Enum status) { */ @JsonGetter("completedTime") public String getCompletedTime() { - return this.completedTime; + return completedTime; } /** @@ -102,7 +107,7 @@ public void setCompletedTime(String completedTime) { */ @JsonGetter("url") public String getUrl() { - return this.url; + return url; } /** @@ -151,7 +156,7 @@ public static class Builder { /** * Setter for id. - * @param id String value for id. + * @param id String value for id. * @return Builder */ public Builder id(String id) { @@ -161,7 +166,7 @@ public Builder id(String id) { /** * Setter for status. - * @param status Status3Enum value for status. + * @param status Status3Enum value for status. * @return Builder */ public Builder status(Status3Enum status) { @@ -171,7 +176,7 @@ public Builder status(Status3Enum status) { /** * Setter for completedTime. - * @param completedTime String value for completedTime. + * @param completedTime String value for completedTime. * @return Builder */ public Builder completedTime(String completedTime) { @@ -181,7 +186,7 @@ public Builder completedTime(String completedTime) { /** * Setter for url. - * @param url String value for url. + * @param url String value for url. * @return Builder */ public Builder url(String url) { diff --git a/src/main/java/com/bandwidth/voice/models/TranscriptionResponse.java b/src/main/java/com/bandwidth/voice/models/TranscriptionResponse.java index cf46386c..9fdc2d84 100644 --- a/src/main/java/com/bandwidth/voice/models/TranscriptionResponse.java +++ b/src/main/java/com/bandwidth/voice/models/TranscriptionResponse.java @@ -7,6 +7,7 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import java.util.List; @@ -14,6 +15,7 @@ * This is a model class for TranscriptionResponse type. */ public class TranscriptionResponse { + @JsonInclude(JsonInclude.Include.NON_NULL) private List transcripts; /** @@ -24,7 +26,7 @@ public TranscriptionResponse() { /** * Initialization constructor. - * @param transcripts List of Transcript value for transcripts. + * @param transcripts List of Transcript value for transcripts. */ public TranscriptionResponse( List transcripts) { @@ -37,7 +39,7 @@ public TranscriptionResponse( */ @JsonGetter("transcripts") public List getTranscripts() { - return this.transcripts; + return transcripts; } /** @@ -79,7 +81,7 @@ public static class Builder { /** * Setter for transcripts. - * @param transcripts List of Transcript value for transcripts. + * @param transcripts List of Transcript value for transcripts. * @return Builder */ public Builder transcripts(List transcripts) { diff --git a/src/main/java/com/bandwidth/webrtc/controllers/APIController.java b/src/main/java/com/bandwidth/webrtc/controllers/APIController.java index 78225783..01c2ebf6 100644 --- a/src/main/java/com/bandwidth/webrtc/controllers/APIController.java +++ b/src/main/java/com/bandwidth/webrtc/controllers/APIController.java @@ -20,7 +20,7 @@ import com.bandwidth.http.response.ApiResponse; import com.bandwidth.http.response.HttpResponse; import com.bandwidth.http.response.HttpStringResponse; -import com.bandwidth.webrtc.exceptions.ErrorException; +import com.bandwidth.webrtc.exceptions.ErrorErrorException; import com.bandwidth.webrtc.models.AccountsParticipantsResponse; import com.bandwidth.webrtc.models.Participant; import com.bandwidth.webrtc.models.Session; @@ -162,7 +162,7 @@ private ApiResponse handleCreateParticipantRespons throw new ApiException("Access Denied", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorException("Unexpected Error", context); + throw new ErrorErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -274,7 +274,7 @@ private ApiResponse handleGetParticipantResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorException("Unexpected Error", context); + throw new ErrorErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -384,7 +384,7 @@ private ApiResponse handleDeleteParticipantResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorException("Unexpected Error", context); + throw new ErrorErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -493,7 +493,7 @@ private ApiResponse handleCreateSessionResponse( throw new ApiException("Access Denied", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorException("Unexpected Error", context); + throw new ErrorErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -605,7 +605,7 @@ private ApiResponse handleGetSessionResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorException("Unexpected Error", context); + throw new ErrorErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -715,7 +715,7 @@ private ApiResponse handleDeleteSessionResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorException("Unexpected Error", context); + throw new ErrorErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -822,7 +822,7 @@ private ApiResponse> handleListSessionParticipantsResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorException("Unexpected Error", context); + throw new ErrorErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -947,7 +947,7 @@ private ApiResponse handleAddParticipantToSessionResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorException("Unexpected Error", context); + throw new ErrorErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1063,7 +1063,7 @@ private ApiResponse handleRemoveParticipantFromSessionResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorException("Unexpected Error", context); + throw new ErrorErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1179,7 +1179,7 @@ private ApiResponse handleGetParticipantSubscriptionsResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorException("Unexpected Error", context); + throw new ErrorErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1312,7 +1312,7 @@ private ApiResponse handleUpdateParticipantSubscriptionsResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorException("Unexpected Error", context); + throw new ErrorErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); diff --git a/src/main/java/com/bandwidth/webrtc/exceptions/ErrorException.java b/src/main/java/com/bandwidth/webrtc/exceptions/ErrorErrorException.java similarity index 64% rename from src/main/java/com/bandwidth/webrtc/exceptions/ErrorException.java rename to src/main/java/com/bandwidth/webrtc/exceptions/ErrorErrorException.java index b8d8c9ed..7c6fff10 100644 --- a/src/main/java/com/bandwidth/webrtc/exceptions/ErrorException.java +++ b/src/main/java/com/bandwidth/webrtc/exceptions/ErrorErrorException.java @@ -12,11 +12,11 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for ErrorException type. + * This is a model class for ErrorErrorException type. */ -public class ErrorException +public class ErrorErrorException extends ApiException { - private static final long serialVersionUID = 6300991168895097478L; + private static final long serialVersionUID = -1260975273933949507L; private int code; private String message; @@ -25,14 +25,14 @@ public class ErrorException * @param reason The reason for throwing exception * @param context The http context of the API exception */ - public ErrorException(String reason, HttpContext context) { + public ErrorErrorException(String reason, HttpContext context) { super(reason, context); } /** * Getter for Code. - * @return Returns the int + * @return Returns the int */ @JsonGetter("code") public int getCode() { @@ -41,16 +41,16 @@ public int getCode() { /** * Setter for Code. - * @param value Value for int + * @param code Value for int */ @JsonSetter("code") - private void setCode(int value) { - this.code = value; + private void setCode(int code) { + this.code = code; } /** * Getter for Message. - * @return Returns the String + * @return Returns the String */ @JsonGetter("message") public String getMessage() { @@ -59,10 +59,10 @@ public String getMessage() { /** * Setter for Message. - * @param value Value for String + * @param message Value for String */ @JsonSetter("message") - private void setMessage(String value) { - this.message = value; + private void setMessage(String message) { + this.message = message; } } diff --git a/src/main/java/com/bandwidth/webrtc/models/AccountsParticipantsResponse.java b/src/main/java/com/bandwidth/webrtc/models/AccountsParticipantsResponse.java index 947145b9..bd33e2ca 100644 --- a/src/main/java/com/bandwidth/webrtc/models/AccountsParticipantsResponse.java +++ b/src/main/java/com/bandwidth/webrtc/models/AccountsParticipantsResponse.java @@ -7,13 +7,16 @@ package com.bandwidth.webrtc.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for AccountsParticipantsResponse type. */ public class AccountsParticipantsResponse { + @JsonInclude(JsonInclude.Include.NON_NULL) private Participant participant; + @JsonInclude(JsonInclude.Include.NON_NULL) private String token; /** @@ -24,8 +27,8 @@ public AccountsParticipantsResponse() { /** * Initialization constructor. - * @param participant Participant value for participant. - * @param token String value for token. + * @param participant Participant value for participant. + * @param token String value for token. */ public AccountsParticipantsResponse( Participant participant, @@ -41,7 +44,7 @@ public AccountsParticipantsResponse( */ @JsonGetter("participant") public Participant getParticipant() { - return this.participant; + return participant; } /** @@ -62,7 +65,7 @@ public void setParticipant(Participant participant) { */ @JsonGetter("token") public String getToken() { - return this.token; + return token; } /** @@ -109,7 +112,7 @@ public static class Builder { /** * Setter for participant. - * @param participant Participant value for participant. + * @param participant Participant value for participant. * @return Builder */ public Builder participant(Participant participant) { @@ -119,7 +122,7 @@ public Builder participant(Participant participant) { /** * Setter for token. - * @param token String value for token. + * @param token String value for token. * @return Builder */ public Builder token(String token) { diff --git a/src/main/java/com/bandwidth/webrtc/models/DeviceApiVersionEnum.java b/src/main/java/com/bandwidth/webrtc/models/DeviceApiVersionEnum.java new file mode 100644 index 00000000..70e86738 --- /dev/null +++ b/src/main/java/com/bandwidth/webrtc/models/DeviceApiVersionEnum.java @@ -0,0 +1,75 @@ +/* + * BandwidthLib + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +package com.bandwidth.webrtc.models; + +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + +/** + * DeviceApiVersionEnum to be used. + */ +public enum DeviceApiVersionEnum { + V3, + + V2; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + V3.value = "v3"; + V2.value = "v2"; + + valueMap.put("v3", V3); + valueMap.put("v2", V2); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + @com.fasterxml.jackson.annotation.JsonCreator + public static DeviceApiVersionEnum fromString(String toConvert) { + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @com.fasterxml.jackson.annotation.JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + return value.toString(); + } + + /** + * Convert list of DeviceApiVersionEnum values to list of string values. + * @param toConvert The list of DeviceApiVersionEnum values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (DeviceApiVersionEnum enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/bandwidth/webrtc/models/Error.java b/src/main/java/com/bandwidth/webrtc/models/Error.java new file mode 100644 index 00000000..e777b3ea --- /dev/null +++ b/src/main/java/com/bandwidth/webrtc/models/Error.java @@ -0,0 +1,143 @@ +/* + * BandwidthLib + * + * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + */ + +package com.bandwidth.webrtc.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonSetter; + +/** + * This is a model class for Error type. + */ +public class Error { + private int code; + private String message; + + /** + * Default constructor. + */ + public Error() { + } + + /** + * Initialization constructor. + * @param code int value for code. + * @param message String value for message. + */ + public Error( + int code, + String message) { + this.code = code; + this.message = message; + } + + /** + * Getter for Code. + * @return Returns the int + */ + @JsonGetter("code") + public int getCode() { + return code; + } + + /** + * Setter for Code. + * @param code Value for int + */ + @JsonSetter("code") + public void setCode(int code) { + this.code = code; + } + + /** + * Getter for Message. + * @return Returns the String + */ + @JsonGetter("message") + public String getMessage() { + return message; + } + + /** + * Setter for Message. + * @param message Value for String + */ + @JsonSetter("message") + public void setMessage(String message) { + this.message = message; + } + + /** + * Converts this Error into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "Error [" + "code=" + code + ", message=" + message + "]"; + } + + /** + * Builds a new {@link Error.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link Error.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(code, message); + return builder; + } + + /** + * Class to build instances of {@link Error}. + */ + public static class Builder { + private int code; + private String message; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param code int value for code. + * @param message String value for message. + */ + public Builder(int code, String message) { + this.code = code; + this.message = message; + } + + /** + * Setter for code. + * @param code int value for code. + * @return Builder + */ + public Builder code(int code) { + this.code = code; + return this; + } + + /** + * Setter for message. + * @param message String value for message. + * @return Builder + */ + public Builder message(String message) { + this.message = message; + return this; + } + + /** + * Builds a new {@link Error} object using the set fields. + * @return {@link Error} + */ + public Error build() { + return new Error(code, message); + } + } +} diff --git a/src/main/java/com/bandwidth/webrtc/models/Participant.java b/src/main/java/com/bandwidth/webrtc/models/Participant.java index 33f14ea1..a734b206 100644 --- a/src/main/java/com/bandwidth/webrtc/models/Participant.java +++ b/src/main/java/com/bandwidth/webrtc/models/Participant.java @@ -7,6 +7,7 @@ package com.bandwidth.webrtc.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import java.util.List; @@ -14,12 +15,20 @@ * This is a model class for Participant type. */ public class Participant { + @JsonInclude(JsonInclude.Include.NON_NULL) private String id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String callbackUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) private List publishPermissions; + @JsonInclude(JsonInclude.Include.NON_NULL) private List sessions; + @JsonInclude(JsonInclude.Include.NON_NULL) private Subscriptions subscriptions; + @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; + @JsonInclude(JsonInclude.Include.NON_NULL) + private DeviceApiVersionEnum deviceApiVersion; /** * Default constructor. @@ -29,12 +38,13 @@ public Participant() { /** * Initialization constructor. - * @param id String value for id. - * @param callbackUrl String value for callbackUrl. - * @param publishPermissions List of PublishPermissionEnum value for publishPermissions. - * @param sessions List of String value for sessions. - * @param subscriptions Subscriptions value for subscriptions. - * @param tag String value for tag. + * @param id String value for id. + * @param callbackUrl String value for callbackUrl. + * @param publishPermissions List of PublishPermissionEnum value for publishPermissions. + * @param sessions List of String value for sessions. + * @param subscriptions Subscriptions value for subscriptions. + * @param tag String value for tag. + * @param deviceApiVersion DeviceApiVersionEnum value for deviceApiVersion. */ public Participant( String id, @@ -42,13 +52,15 @@ public Participant( List publishPermissions, List sessions, Subscriptions subscriptions, - String tag) { + String tag, + DeviceApiVersionEnum deviceApiVersion) { this.id = id; this.callbackUrl = callbackUrl; this.publishPermissions = publishPermissions; this.sessions = sessions; this.subscriptions = subscriptions; this.tag = tag; + this.deviceApiVersion = deviceApiVersion; } /** @@ -58,7 +70,7 @@ public Participant( */ @JsonGetter("id") public String getId() { - return this.id; + return id; } /** @@ -78,7 +90,7 @@ public void setId(String id) { */ @JsonGetter("callbackUrl") public String getCallbackUrl() { - return this.callbackUrl; + return callbackUrl; } /** @@ -98,7 +110,7 @@ public void setCallbackUrl(String callbackUrl) { */ @JsonGetter("publishPermissions") public List getPublishPermissions() { - return this.publishPermissions; + return publishPermissions; } /** @@ -118,7 +130,7 @@ public void setPublishPermissions(List publishPermissions */ @JsonGetter("sessions") public List getSessions() { - return this.sessions; + return sessions; } /** @@ -137,7 +149,7 @@ public void setSessions(List sessions) { */ @JsonGetter("subscriptions") public Subscriptions getSubscriptions() { - return this.subscriptions; + return subscriptions; } /** @@ -156,7 +168,7 @@ public void setSubscriptions(Subscriptions subscriptions) { */ @JsonGetter("tag") public String getTag() { - return this.tag; + return tag; } /** @@ -169,6 +181,26 @@ public void setTag(String tag) { this.tag = tag; } + /** + * Getter for DeviceApiVersion. + * Optional field to define the device api version of this participant + * @return Returns the DeviceApiVersionEnum + */ + @JsonGetter("deviceApiVersion") + public DeviceApiVersionEnum getDeviceApiVersion() { + return deviceApiVersion; + } + + /** + * Setter for DeviceApiVersion. + * Optional field to define the device api version of this participant + * @param deviceApiVersion Value for DeviceApiVersionEnum + */ + @JsonSetter("deviceApiVersion") + public void setDeviceApiVersion(DeviceApiVersionEnum deviceApiVersion) { + this.deviceApiVersion = deviceApiVersion; + } + /** * Converts this Participant into string format. * @return String representation of this class @@ -177,7 +209,8 @@ public void setTag(String tag) { public String toString() { return "Participant [" + "id=" + id + ", callbackUrl=" + callbackUrl + ", publishPermissions=" + publishPermissions + ", sessions=" + sessions - + ", subscriptions=" + subscriptions + ", tag=" + tag + "]"; + + ", subscriptions=" + subscriptions + ", tag=" + tag + ", deviceApiVersion=" + + deviceApiVersion + "]"; } /** @@ -192,7 +225,8 @@ public Builder toBuilder() { .publishPermissions(getPublishPermissions()) .sessions(getSessions()) .subscriptions(getSubscriptions()) - .tag(getTag()); + .tag(getTag()) + .deviceApiVersion(getDeviceApiVersion()); return builder; } @@ -206,12 +240,13 @@ public static class Builder { private List sessions; private Subscriptions subscriptions; private String tag; + private DeviceApiVersionEnum deviceApiVersion = DeviceApiVersionEnum.V2; /** * Setter for id. - * @param id String value for id. + * @param id String value for id. * @return Builder */ public Builder id(String id) { @@ -221,7 +256,7 @@ public Builder id(String id) { /** * Setter for callbackUrl. - * @param callbackUrl String value for callbackUrl. + * @param callbackUrl String value for callbackUrl. * @return Builder */ public Builder callbackUrl(String callbackUrl) { @@ -231,7 +266,7 @@ public Builder callbackUrl(String callbackUrl) { /** * Setter for publishPermissions. - * @param publishPermissions List of PublishPermissionEnum value for publishPermissions. + * @param publishPermissions List of PublishPermissionEnum value for publishPermissions. * @return Builder */ public Builder publishPermissions(List publishPermissions) { @@ -241,7 +276,7 @@ public Builder publishPermissions(List publishPermissions /** * Setter for sessions. - * @param sessions List of String value for sessions. + * @param sessions List of String value for sessions. * @return Builder */ public Builder sessions(List sessions) { @@ -251,7 +286,7 @@ public Builder sessions(List sessions) { /** * Setter for subscriptions. - * @param subscriptions Subscriptions value for subscriptions. + * @param subscriptions Subscriptions value for subscriptions. * @return Builder */ public Builder subscriptions(Subscriptions subscriptions) { @@ -261,7 +296,7 @@ public Builder subscriptions(Subscriptions subscriptions) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { @@ -269,13 +304,23 @@ public Builder tag(String tag) { return this; } + /** + * Setter for deviceApiVersion. + * @param deviceApiVersion DeviceApiVersionEnum value for deviceApiVersion. + * @return Builder + */ + public Builder deviceApiVersion(DeviceApiVersionEnum deviceApiVersion) { + this.deviceApiVersion = deviceApiVersion; + return this; + } + /** * Builds a new {@link Participant} object using the set fields. * @return {@link Participant} */ public Participant build() { return new Participant(id, callbackUrl, publishPermissions, sessions, subscriptions, - tag); + tag, deviceApiVersion); } } } diff --git a/src/main/java/com/bandwidth/webrtc/models/ParticipantSubscription.java b/src/main/java/com/bandwidth/webrtc/models/ParticipantSubscription.java index b6a055b9..92beb637 100644 --- a/src/main/java/com/bandwidth/webrtc/models/ParticipantSubscription.java +++ b/src/main/java/com/bandwidth/webrtc/models/ParticipantSubscription.java @@ -23,7 +23,7 @@ public ParticipantSubscription() { /** * Initialization constructor. - * @param participantId String value for participantId. + * @param participantId String value for participantId. */ public ParticipantSubscription( String participantId) { @@ -37,7 +37,7 @@ public ParticipantSubscription( */ @JsonGetter("participantId") public String getParticipantId() { - return this.participantId; + return participantId; } /** @@ -83,7 +83,7 @@ public Builder() { /** * Initialization constructor. - * @param participantId String value for participantId. + * @param participantId String value for participantId. */ public Builder(String participantId) { this.participantId = participantId; @@ -91,7 +91,7 @@ public Builder(String participantId) { /** * Setter for participantId. - * @param participantId String value for participantId. + * @param participantId String value for participantId. * @return Builder */ public Builder participantId(String participantId) { diff --git a/src/main/java/com/bandwidth/webrtc/models/Session.java b/src/main/java/com/bandwidth/webrtc/models/Session.java index b054b078..fd8d5c6d 100644 --- a/src/main/java/com/bandwidth/webrtc/models/Session.java +++ b/src/main/java/com/bandwidth/webrtc/models/Session.java @@ -7,13 +7,16 @@ package com.bandwidth.webrtc.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for Session type. */ public class Session { + @JsonInclude(JsonInclude.Include.NON_NULL) private String id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; /** @@ -24,8 +27,8 @@ public Session() { /** * Initialization constructor. - * @param id String value for id. - * @param tag String value for tag. + * @param id String value for id. + * @param tag String value for tag. */ public Session( String id, @@ -41,7 +44,7 @@ public Session( */ @JsonGetter("id") public String getId() { - return this.id; + return id; } /** @@ -61,7 +64,7 @@ public void setId(String id) { */ @JsonGetter("tag") public String getTag() { - return this.tag; + return tag; } /** @@ -106,7 +109,7 @@ public static class Builder { /** * Setter for id. - * @param id String value for id. + * @param id String value for id. * @return Builder */ public Builder id(String id) { @@ -116,7 +119,7 @@ public Builder id(String id) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { diff --git a/src/main/java/com/bandwidth/webrtc/models/Subscriptions.java b/src/main/java/com/bandwidth/webrtc/models/Subscriptions.java index 420774fe..62493636 100644 --- a/src/main/java/com/bandwidth/webrtc/models/Subscriptions.java +++ b/src/main/java/com/bandwidth/webrtc/models/Subscriptions.java @@ -7,6 +7,7 @@ package com.bandwidth.webrtc.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import java.util.List; @@ -15,6 +16,7 @@ */ public class Subscriptions { private String sessionId; + @JsonInclude(JsonInclude.Include.NON_NULL) private List participants; /** @@ -25,8 +27,8 @@ public Subscriptions() { /** * Initialization constructor. - * @param sessionId String value for sessionId. - * @param participants List of ParticipantSubscription value for participants. + * @param sessionId String value for sessionId. + * @param participants List of ParticipantSubscription value for participants. */ public Subscriptions( String sessionId, @@ -44,7 +46,7 @@ public Subscriptions( */ @JsonGetter("sessionId") public String getSessionId() { - return this.sessionId; + return sessionId; } /** @@ -66,7 +68,7 @@ public void setSessionId(String sessionId) { */ @JsonGetter("participants") public List getParticipants() { - return this.participants; + return participants; } /** @@ -115,7 +117,7 @@ public Builder() { /** * Initialization constructor. - * @param sessionId String value for sessionId. + * @param sessionId String value for sessionId. */ public Builder(String sessionId) { this.sessionId = sessionId; @@ -123,7 +125,7 @@ public Builder(String sessionId) { /** * Setter for sessionId. - * @param sessionId String value for sessionId. + * @param sessionId String value for sessionId. * @return Builder */ public Builder sessionId(String sessionId) { @@ -133,7 +135,7 @@ public Builder sessionId(String sessionId) { /** * Setter for participants. - * @param participants List of ParticipantSubscription value for participants. + * @param participants List of ParticipantSubscription value for participants. * @return Builder */ public Builder participants(List participants) { From 676cfb1bae71534de517cff84890ec526401be4e Mon Sep 17 00:00:00 2001 From: jmulford-bandwidth Date: Tue, 9 Mar 2021 14:50:15 -0500 Subject: [PATCH 2/5] reverted to just webrtc release --- pom.xml | 94 +++++- src/main/java/com/bandwidth/ApiHelper.java | 2 + .../java/com/bandwidth/BandwidthClient.java | 74 ++--- .../java/com/bandwidth/Configuration.java | 6 +- .../java/com/bandwidth/DateTimeHelper.java | 127 +------- src/main/java/com/bandwidth/Server.java | 6 +- ...=> TwoFactorAuthBasicAuthCredentials.java} | 2 +- ...ava => TwoFactorAuthBasicAuthManager.java} | 8 +- ...thClient.java => TwoFactorAuthClient.java} | 6 +- .../http/request/MultipartFileWrapper.java | 3 - .../http/request/MultipartWrapper.java | 3 - .../bandwidth/internal/OptionalNullable.java | 158 ---------- .../messaging/controllers/APIController.java | 206 ++++++------ ...Exception.java => MessagingException.java} | 24 +- .../models/BandwidthCallbackMessage.java | 43 ++- .../messaging/models/BandwidthMessage.java | 85 +++-- .../models/BandwidthMessageItem.java | 78 ++--- .../models/BandwidthMessagesList.java | 22 +- .../messaging/models/DeferredResult.java | 15 +- .../com/bandwidth/messaging/models/Media.java | 292 ++++++++++++++++-- .../messaging/models/MessageRequest.java | 57 ++-- .../bandwidth/messaging/models/PageInfo.java | 29 +- .../com/bandwidth/messaging/models/Tag.java | 15 +- .../models/ErrorWithRequest.java | 138 --------- .../models/ForbiddenRequest.java | 101 ------ .../models/UnauthorizedRequest.java | 101 ------ .../controllers/MFAController.java | 62 ++-- .../ErrorWithRequestException.java} | 26 +- .../ForbiddenRequestException.java} | 18 +- .../UnauthorizedRequestException.java} | 18 +- .../models/TwoFactorCodeRequestSchema.java | 55 ++-- .../models/TwoFactorMessagingResponse.java | 10 +- .../models/TwoFactorVerifyCodeResponse.java | 10 +- .../models/TwoFactorVerifyRequestSchema.java | 46 +-- .../models/TwoFactorVoiceResponse.java | 10 +- .../voice/controllers/APIController.java | 256 +++++++-------- ...on.java => ApiErrorResponseException.java} | 32 +- .../voice/models/ApiCallResponse.java | 160 +++++----- .../voice/models/ApiCallStateResponse.java | 190 +++--------- .../voice/models/ApiCreateCallRequest.java | 143 ++++----- .../voice/models/ApiErrorResponse.java | 170 ---------- .../voice/models/ApiModifyCallRequest.java | 73 ++--- .../models/ApiModifyConferenceRequest.java | 65 ++-- .../models/ApiTranscribeRecordingRequest.java | 43 ++- .../voice/models/ConferenceDetail.java | 57 ++-- .../voice/models/ConferenceMemberDetail.java | 43 ++- .../ConferenceRecordingMetadataResponse.java | 78 ++--- .../models/ModifyCallRecordingState.java | 8 +- .../models/RecordingMetadataResponse.java | 127 ++++---- .../bandwidth/voice/models/Transcript.java | 15 +- .../bandwidth/voice/models/Transcription.java | 29 +- .../voice/models/TranscriptionResponse.java | 8 +- .../webrtc/controllers/APIController.java | 24 +- ...rrorException.java => ErrorException.java} | 24 +- .../models/AccountsParticipantsResponse.java | 15 +- .../com/bandwidth/webrtc/models/Error.java | 143 --------- .../bandwidth/webrtc/models/Participant.java | 50 ++- .../models/ParticipantSubscription.java | 8 +- .../com/bandwidth/webrtc/models/Session.java | 15 +- .../webrtc/models/Subscriptions.java | 16 +- 60 files changed, 1433 insertions(+), 2309 deletions(-) rename src/main/java/com/bandwidth/{MultiFactorAuthBasicAuthCredentials.java => TwoFactorAuthBasicAuthCredentials.java} (90%) rename src/main/java/com/bandwidth/{MultiFactorAuthBasicAuthManager.java => TwoFactorAuthBasicAuthManager.java} (84%) rename src/main/java/com/bandwidth/{MultiFactorAuthClient.java => TwoFactorAuthClient.java} (78%) delete mode 100644 src/main/java/com/bandwidth/internal/OptionalNullable.java rename src/main/java/com/bandwidth/messaging/exceptions/{MessagingExceptionErrorException.java => MessagingException.java} (63%) delete mode 100644 src/main/java/com/bandwidth/multifactorauth/models/ErrorWithRequest.java delete mode 100644 src/main/java/com/bandwidth/multifactorauth/models/ForbiddenRequest.java delete mode 100644 src/main/java/com/bandwidth/multifactorauth/models/UnauthorizedRequest.java rename src/main/java/com/bandwidth/{multifactorauth => twofactorauth}/controllers/MFAController.java (83%) rename src/main/java/com/bandwidth/{multifactorauth/exceptions/ErrorWithRequestErrorException.java => twofactorauth/exceptions/ErrorWithRequestException.java} (64%) rename src/main/java/com/bandwidth/{multifactorauth/exceptions/ForbiddenRequestErrorException.java => twofactorauth/exceptions/ForbiddenRequestException.java} (65%) rename src/main/java/com/bandwidth/{multifactorauth/exceptions/UnauthorizedRequestErrorException.java => twofactorauth/exceptions/UnauthorizedRequestException.java} (64%) rename src/main/java/com/bandwidth/{multifactorauth => twofactorauth}/models/TwoFactorCodeRequestSchema.java (83%) rename src/main/java/com/bandwidth/{multifactorauth => twofactorauth}/models/TwoFactorMessagingResponse.java (85%) rename src/main/java/com/bandwidth/{multifactorauth => twofactorauth}/models/TwoFactorVerifyCodeResponse.java (85%) rename src/main/java/com/bandwidth/{multifactorauth => twofactorauth}/models/TwoFactorVerifyRequestSchema.java (82%) rename src/main/java/com/bandwidth/{multifactorauth => twofactorauth}/models/TwoFactorVoiceResponse.java (85%) rename src/main/java/com/bandwidth/voice/exceptions/{ApiErrorResponseErrorException.java => ApiErrorResponseException.java} (62%) delete mode 100644 src/main/java/com/bandwidth/voice/models/ApiErrorResponse.java rename src/main/java/com/bandwidth/webrtc/exceptions/{ErrorErrorException.java => ErrorException.java} (64%) delete mode 100644 src/main/java/com/bandwidth/webrtc/models/Error.java diff --git a/pom.xml b/pom.xml index d6b347d4..26224291 100644 --- a/pom.xml +++ b/pom.xml @@ -46,14 +46,6 @@ - - org.codehaus.mojo - versions-maven-plugin - 2.5 - - file://${project.basedir}/version-rules.xml - - org.apache.maven.plugins maven-enforcer-plugin @@ -84,12 +76,55 @@ false + + org.apache.maven.plugins + maven-source-plugin + 3.1.0 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + false + + + + attach-javadocs + + jar + + + + 2.9.10 - 2.9.10.5 + 2.9.10.7 1.8 1.8 UTF-8 @@ -121,7 +156,7 @@ com.squareup.okhttp3 okhttp - [3.12, 4.9.1] + 3.12.1 com.fasterxml.jackson.core @@ -145,4 +180,41 @@ test - \ No newline at end of file + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + org.sonatype.oss + oss-parent + 7 + + + + Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + https://github.com/Bandwidth/java-sdk + scm:git:git@github.com:Bandwidth/java-sdk.git + scm:git:git@github.com:Bandwidth/java-sdk.git + + + + support + Bandwidth Support + info@bandwidth.com + Bandwidth, Inc. + http://bandwidth.com + -5 + + + diff --git a/src/main/java/com/bandwidth/ApiHelper.java b/src/main/java/com/bandwidth/ApiHelper.java index 407cb32c..ac0067ad 100644 --- a/src/main/java/com/bandwidth/ApiHelper.java +++ b/src/main/java/com/bandwidth/ApiHelper.java @@ -11,6 +11,7 @@ import com.bandwidth.http.request.MultipartWrapper; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; @@ -51,6 +52,7 @@ public class ApiHelper { private static final long serialVersionUID = -174113593500315394L; { configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + setSerializationInclusion(JsonInclude.Include.NON_NULL); configOverride(BigDecimal.class).setFormat( JsonFormat.Value.forShape(JsonFormat.Shape.STRING)); } diff --git a/src/main/java/com/bandwidth/BandwidthClient.java b/src/main/java/com/bandwidth/BandwidthClient.java index 0aa14ba5..e9141b8f 100644 --- a/src/main/java/com/bandwidth/BandwidthClient.java +++ b/src/main/java/com/bandwidth/BandwidthClient.java @@ -26,7 +26,7 @@ public final class BandwidthClient implements Configuration { * Private store for clients. */ private MessagingClient messagingClient; - private MultiFactorAuthClient multiFactorAuthClient; + private TwoFactorAuthClient twoFactorAuthClient; private VoiceClient voiceClient; private WebRtcClient webRtcClient; @@ -61,9 +61,9 @@ public final class BandwidthClient implements Configuration { private MessagingBasicAuthManager messagingBasicAuthManager; /** - * MultiFactorAuthBasicAuthManager. + * TwoFactorAuthBasicAuthManager. */ - private MultiFactorAuthBasicAuthManager multiFactorAuthBasicAuthManager; + private TwoFactorAuthBasicAuthManager twoFactorAuthBasicAuthManager; /** * VoiceBasicAuthManager. @@ -88,7 +88,7 @@ public final class BandwidthClient implements Configuration { private BandwidthClient(Environment environment, String baseUrl, HttpClient httpClient, long timeout, ReadonlyHttpClientConfiguration httpClientConfig, String messagingBasicAuthUserName, String messagingBasicAuthPassword, - String multiFactorAuthBasicAuthUserName, String multiFactorAuthBasicAuthPassword, + String twoFactorAuthBasicAuthUserName, String twoFactorAuthBasicAuthPassword, String voiceBasicAuthUserName, String voiceBasicAuthPassword, String webRtcBasicAuthUserName, String webRtcBasicAuthPassword, Map authManagers, HttpCallback httpCallback) { @@ -113,17 +113,17 @@ private BandwidthClient(Environment environment, String baseUrl, HttpClient http this.authManagers.put("messaging", messagingBasicAuthManager); } - if (this.authManagers.containsKey("multiFactorAuth")) { - this.multiFactorAuthBasicAuthManager = - (MultiFactorAuthBasicAuthManager) this.authManagers.get("multiFactorAuth"); + if (this.authManagers.containsKey("twoFactorAuth")) { + this.twoFactorAuthBasicAuthManager = + (TwoFactorAuthBasicAuthManager) this.authManagers.get("twoFactorAuth"); } - if (!this.authManagers.containsKey("multiFactorAuth") - || !getMultiFactorAuthBasicAuthCredentials().equals( - multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword)) { - this.multiFactorAuthBasicAuthManager = new MultiFactorAuthBasicAuthManager( - multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword); - this.authManagers.put("multiFactorAuth", multiFactorAuthBasicAuthManager); + if (!this.authManagers.containsKey("twoFactorAuth") + || !getTwoFactorAuthBasicAuthCredentials().equals(twoFactorAuthBasicAuthUserName, + twoFactorAuthBasicAuthPassword)) { + this.twoFactorAuthBasicAuthManager = new TwoFactorAuthBasicAuthManager( + twoFactorAuthBasicAuthUserName, twoFactorAuthBasicAuthPassword); + this.authManagers.put("twoFactorAuth", twoFactorAuthBasicAuthManager); } if (this.authManagers.containsKey("voice")) { @@ -152,7 +152,7 @@ private BandwidthClient(Environment environment, String baseUrl, HttpClient http messagingClient = new MessagingClient(this); - multiFactorAuthClient = new MultiFactorAuthClient(this); + twoFactorAuthClient = new TwoFactorAuthClient(this); voiceClient = new VoiceClient(this); webRtcClient = new WebRtcClient(this); } @@ -173,11 +173,11 @@ public MessagingClient getMessagingClient() { } /** - * Provides access to multiFactorAuthClient Client. - * @return Returns the MultiFactorAuthClient instance + * Provides access to twoFactorAuthClient Client. + * @return Returns the TwoFactorAuthClient instance */ - public MultiFactorAuthClient getMultiFactorAuthClient() { - return multiFactorAuthClient; + public TwoFactorAuthClient getTwoFactorAuthClient() { + return twoFactorAuthClient; } /** @@ -245,11 +245,11 @@ public MessagingBasicAuthCredentials getMessagingBasicAuthCredentials() { } /** - * The credentials to use with MultiFactorAuthBasicAuth. - * @return multiFactorAuthBasicAuthCredentials + * The credentials to use with TwoFactorAuthBasicAuth. + * @return twoFactorAuthBasicAuthCredentials */ - public MultiFactorAuthBasicAuthCredentials getMultiFactorAuthBasicAuthCredentials() { - return multiFactorAuthBasicAuthManager; + public TwoFactorAuthBasicAuthCredentials getTwoFactorAuthBasicAuthCredentials() { + return twoFactorAuthBasicAuthManager; } /** @@ -312,7 +312,7 @@ private static String environmentMapper(Environment environment, Server server) if (server.equals(Server.MESSAGINGDEFAULT)) { return "https://messaging.bandwidth.com/api/v2"; } - if (server.equals(Server.MULTIFACTORAUTHDEFAULT)) { + if (server.equals(Server.TWOFACTORAUTHDEFAULT)) { return "https://mfa.bandwidth.com/api/v1"; } if (server.equals(Server.VOICEDEFAULT)) { @@ -329,7 +329,7 @@ private static String environmentMapper(Environment environment, Server server) if (server.equals(Server.MESSAGINGDEFAULT)) { return "{base_url}"; } - if (server.equals(Server.MULTIFACTORAUTHDEFAULT)) { + if (server.equals(Server.TWOFACTORAUTHDEFAULT)) { return "{base_url}"; } if (server.equals(Server.VOICEDEFAULT)) { @@ -367,10 +367,10 @@ public Builder newBuilder() { getMessagingBasicAuthCredentials().getBasicAuthUserName(); builder.messagingBasicAuthPassword = getMessagingBasicAuthCredentials().getBasicAuthPassword(); - builder.multiFactorAuthBasicAuthUserName = - getMultiFactorAuthBasicAuthCredentials().getBasicAuthUserName(); - builder.multiFactorAuthBasicAuthPassword = - getMultiFactorAuthBasicAuthCredentials().getBasicAuthPassword(); + builder.twoFactorAuthBasicAuthUserName = + getTwoFactorAuthBasicAuthCredentials().getBasicAuthUserName(); + builder.twoFactorAuthBasicAuthPassword = + getTwoFactorAuthBasicAuthCredentials().getBasicAuthPassword(); builder.voiceBasicAuthUserName = getVoiceBasicAuthCredentials().getBasicAuthUserName(); builder.voiceBasicAuthPassword = getVoiceBasicAuthCredentials().getBasicAuthPassword(); builder.webRtcBasicAuthUserName = getWebRtcBasicAuthCredentials().getBasicAuthUserName(); @@ -391,8 +391,8 @@ public static class Builder { private long timeout = 0; private String messagingBasicAuthUserName = "TODO: Replace"; private String messagingBasicAuthPassword = "TODO: Replace"; - private String multiFactorAuthBasicAuthUserName = "TODO: Replace"; - private String multiFactorAuthBasicAuthPassword = "TODO: Replace"; + private String twoFactorAuthBasicAuthUserName = "TODO: Replace"; + private String twoFactorAuthBasicAuthPassword = "TODO: Replace"; private String voiceBasicAuthUserName = "TODO: Replace"; private String voiceBasicAuthPassword = "TODO: Replace"; private String webRtcBasicAuthUserName = "TODO: Replace"; @@ -421,12 +421,12 @@ public Builder messagingBasicAuthCredentials(String basicAuthUserName, } /** - * Credentials setter for MultiFactorAuthBasicAuth. - * @param basicAuthUserName String value for multiFactorAuthBasicAuthUserName. - * @param basicAuthPassword String value for multiFactorAuthBasicAuthPassword. + * Credentials setter for TwoFactorAuthBasicAuth. + * @param basicAuthUserName String value for twoFactorAuthBasicAuthUserName. + * @param basicAuthPassword String value for twoFactorAuthBasicAuthPassword. * @return Builder */ - public Builder multiFactorAuthBasicAuthCredentials(String basicAuthUserName, + public Builder twoFactorAuthBasicAuthCredentials(String basicAuthUserName, String basicAuthPassword) { if (basicAuthUserName == null) { throw new NullPointerException("BasicAuthUserName cannot be null."); @@ -434,8 +434,8 @@ public Builder multiFactorAuthBasicAuthCredentials(String basicAuthUserName, if (basicAuthPassword == null) { throw new NullPointerException("BasicAuthPassword cannot be null."); } - this.multiFactorAuthBasicAuthUserName = basicAuthUserName; - this.multiFactorAuthBasicAuthPassword = basicAuthPassword; + this.twoFactorAuthBasicAuthUserName = basicAuthUserName; + this.twoFactorAuthBasicAuthPassword = basicAuthPassword; return this; } @@ -535,7 +535,7 @@ public BandwidthClient build() { return new BandwidthClient(environment, baseUrl, httpClient, timeout, httpClientConfig, messagingBasicAuthUserName, messagingBasicAuthPassword, - multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword, + twoFactorAuthBasicAuthUserName, twoFactorAuthBasicAuthPassword, voiceBasicAuthUserName, voiceBasicAuthPassword, webRtcBasicAuthUserName, webRtcBasicAuthPassword, authManagers, httpCallback); } diff --git a/src/main/java/com/bandwidth/Configuration.java b/src/main/java/com/bandwidth/Configuration.java index 54003639..b0c0329c 100644 --- a/src/main/java/com/bandwidth/Configuration.java +++ b/src/main/java/com/bandwidth/Configuration.java @@ -44,10 +44,10 @@ public interface Configuration { MessagingBasicAuthCredentials getMessagingBasicAuthCredentials(); /** - * The credentials to use with MultiFactorAuthBasicAuth. - * @return multiFactorAuthBasicAuthCredentials + * The credentials to use with TwoFactorAuthBasicAuth. + * @return twoFactorAuthBasicAuthCredentials */ - MultiFactorAuthBasicAuthCredentials getMultiFactorAuthBasicAuthCredentials(); + TwoFactorAuthBasicAuthCredentials getTwoFactorAuthBasicAuthCredentials(); /** * The credentials to use with VoiceBasicAuth. diff --git a/src/main/java/com/bandwidth/DateTimeHelper.java b/src/main/java/com/bandwidth/DateTimeHelper.java index c1de0bb1..972b9ffd 100644 --- a/src/main/java/com/bandwidth/DateTimeHelper.java +++ b/src/main/java/com/bandwidth/DateTimeHelper.java @@ -6,6 +6,7 @@ package com.bandwidth; + import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; @@ -22,9 +23,7 @@ import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -63,7 +62,7 @@ public static LocalDateTime fromUnixTimestamp(String date) { * @return The converted String */ public static String toUnixTimestamp(LocalDateTime value) { - return value == null ? null : Long.toString(value.toEpochSecond(java.time.ZoneOffset.UTC)); + return Long.toString(value.toEpochSecond(java.time.ZoneOffset.UTC)); } /** @@ -82,63 +81,6 @@ public static List toUnixTimestamp(List values) { return valuesAsString; } - /** - * Convert a Map of DateTime objects to Unix Timestamp strings. - * @param values The Map of DateTime objects to convert - * @return The Map of converted Strings - */ - public static Map toUnixTimestamp(Map values) { - if (values == null) { - return null; - } - Map valuesAsString = new HashMap<>(); - for (Map.Entry value: values.entrySet()) { - valuesAsString.put(value.getKey(), toUnixTimestamp(value.getValue())); - } - return valuesAsString; - } - - /** - * Convert a DateTime object to a Unix Timestamp Long. - * @param value The DateTime object to convert - * @return The converted Long - */ - public static Long toUnixTimestampLong(LocalDateTime value) { - return value == null ? null : value.toEpochSecond(java.time.ZoneOffset.UTC); - } - - /** - * Convert a List of DateTime objects to Unix Timestamp Longs. - * @param values The List of DateTime objects to convert - * @return The list of converted Longs. - */ - public static List toUnixTimestampLong(List values) { - if (values == null) { - return null; - } - List valuesAsLong = new ArrayList<>(); - for (LocalDateTime value : values) { - valuesAsLong.add(toUnixTimestampLong(value)); - } - return valuesAsLong; - } - - /** - * Convert a Map of DateTime objects to Unix Timestamp Longs. - * @param values The Map of DateTime objects to convert - * @return The Map of converted Longs. - */ - public static Map toUnixTimestampLong(Map values) { - if (values == null) { - return null; - } - Map valuesAsLong = new HashMap<>(); - for (Map.Entry value: values.entrySet()) { - valuesAsLong.put(value.getKey(), toUnixTimestampLong(value.getValue())); - } - return valuesAsLong; - } - /** * Parse a datetime string in Rfc1123 format to a DateTime object. * @param date The datetime string in Rfc1123 format @@ -154,8 +96,7 @@ public static LocalDateTime fromRfc1123DateTime(String date) { * @return The converted String */ public static String toRfc1123DateTime(LocalDateTime value) { - return value == null ? null - : RFC1123_DATE_TIME_FORMATTER.format(value.atZone(ZoneId.of("GMT"))); + return RFC1123_DATE_TIME_FORMATTER.format(value.atZone(ZoneId.of("GMT"))); } /** @@ -174,22 +115,6 @@ public static List toRfc1123DateTime(List values) { return valuesAsString; } - /** - * Convert a Map of DateTime objects to Rfc1123 formatted strings. - * @param values The Map of DateTime objects to convert - * @return The Map of converted Strings - */ - public static Map toRfc1123DateTime(Map values) { - if (values == null) { - return null; - } - Map valuesAsString = new HashMap<>(); - for (Map.Entry value: values.entrySet()) { - valuesAsString.put(value.getKey(), toRfc1123DateTime(value.getValue())); - } - return valuesAsString; - } - /** * Parse a datetime string in Rfc8601(Rfc3339) format to a DateTime object. * @param date The datetime string in Rfc8601(Rfc3339) format @@ -211,7 +136,7 @@ public static LocalDateTime fromRfc8601DateTime(String date) { * @return The converted String */ public static String toRfc8601DateTime(LocalDateTime value) { - return value == null ? null : value.toString() + "Z"; + return value.toString() + "Z"; } /** @@ -230,22 +155,6 @@ public static List toRfc8601DateTime(List values) { return valuesAsString; } - /** - * Convert a Map of DateTime objects to Rfc8601(Rfc3339) formatted strings. - * @param values The Map of DateTime objects to convert - * @return The Map of converted Strings - */ - public static Map toRfc8601DateTime(Map values) { - if (values == null) { - return null; - } - Map valuesAsString = new HashMap<>(); - for (Map.Entry value: values.entrySet()) { - valuesAsString.put(value.getKey(), toRfc8601DateTime(value.getValue())); - } - return valuesAsString; - } - /** * Parse a simple date string to a LocalDate object. * @param date The date string @@ -261,7 +170,7 @@ public static LocalDate fromSimpleDate(String date) { * @return The converted Strings */ public static String toSimpleDate(LocalDate value) { - return value == null ? null : value.toString(); + return value.toString(); } /** @@ -280,27 +189,10 @@ public static List toSimpleDate(List values) { return valuesAsString; } - /** - * Convert a Map of LocalDate objects to strings. - * @param values The Map of LocalDate objects to convert - * @return The Map of converted Strings - */ - public static Map toSimpleDate(Map values) { - if (values == null) { - return null; - } - Map valuesAsString = new HashMap<>(); - for (Map.Entry value: values.entrySet()) { - valuesAsString.put(value.getKey(), toSimpleDate(value.getValue())); - } - return valuesAsString; - } - /** * A class to handle deserialization of DateTime objects to Unix Timestamps. */ public static class UnixTimestampDeserializer extends JsonDeserializer { - @SuppressWarnings("unused") @Override public LocalDateTime deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { @@ -312,11 +204,10 @@ public LocalDateTime deserialize(JsonParser jp, DeserializationContext ctxt) * A class to handle serialization of Unix Timestamps to DateTime objects. */ public static class UnixTimestampSerializer extends JsonSerializer { - @SuppressWarnings("unused") @Override public void serialize(LocalDateTime value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { - jgen.writeObject(toUnixTimestampLong(value)); + jgen.writeNumber(toUnixTimestamp(value)); } } @@ -324,7 +215,6 @@ public void serialize(LocalDateTime value, JsonGenerator jgen, SerializerProvide * A class to handle deserialization of DateTime objects to Rfc1123 format strings. */ public static class Rfc1123DateTimeDeserializer extends JsonDeserializer { - @SuppressWarnings("unused") @Override public LocalDateTime deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { @@ -336,7 +226,6 @@ public LocalDateTime deserialize(JsonParser jp, DeserializationContext ctxt) * A class to handle serialization of Rfc1123 format strings to DateTime objects. */ public static class Rfc1123DateTimeSerializer extends JsonSerializer { - @SuppressWarnings("unused") @Override public void serialize(LocalDateTime value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { @@ -348,7 +237,6 @@ public void serialize(LocalDateTime value, JsonGenerator jgen, SerializerProvide * A class to handle deserialization of DateTime objects to Rfc8601(Rfc3339) format strings. */ public static class Rfc8601DateTimeDeserializer extends JsonDeserializer { - @SuppressWarnings("unused") @Override public LocalDateTime deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { @@ -360,7 +248,6 @@ public LocalDateTime deserialize(JsonParser jp, DeserializationContext ctxt) * A class to handle serialization of Rfc8601(Rfc3339) format strings to DateTime objects. */ public static class Rfc8601DateTimeSerializer extends JsonSerializer { - @SuppressWarnings("unused") @Override public void serialize(LocalDateTime value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { @@ -372,7 +259,6 @@ public void serialize(LocalDateTime value, JsonGenerator jgen, SerializerProvide * A class to handle deserialization of date strings to LocalDate objects. */ public static class SimpleDateDeserializer extends JsonDeserializer { - @SuppressWarnings("unused") @Override public LocalDate deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { @@ -384,7 +270,6 @@ public LocalDate deserialize(JsonParser jp, DeserializationContext ctxt) * A class to handle serialization of LocalDate objects to date strings. */ public static class SimpleDateSerializer extends JsonSerializer { - @SuppressWarnings("unused") @Override public void serialize(LocalDate value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { diff --git a/src/main/java/com/bandwidth/Server.java b/src/main/java/com/bandwidth/Server.java index cbc71968..499db38f 100644 --- a/src/main/java/com/bandwidth/Server.java +++ b/src/main/java/com/bandwidth/Server.java @@ -18,7 +18,7 @@ public enum Server { MESSAGINGDEFAULT, - MULTIFACTORAUTHDEFAULT, + TWOFACTORAUTHDEFAULT, VOICEDEFAULT, @@ -31,13 +31,13 @@ public enum Server { static { ENUM_DEFAULT.value = "default"; MESSAGINGDEFAULT.value = "MessagingDefault"; - MULTIFACTORAUTHDEFAULT.value = "MultiFactorAuthDefault"; + TWOFACTORAUTHDEFAULT.value = "TwoFactorAuthDefault"; VOICEDEFAULT.value = "VoiceDefault"; WEBRTCDEFAULT.value = "WebRtcDefault"; valueMap.put("default", ENUM_DEFAULT); valueMap.put("MessagingDefault", MESSAGINGDEFAULT); - valueMap.put("MultiFactorAuthDefault", MULTIFACTORAUTHDEFAULT); + valueMap.put("TwoFactorAuthDefault", TWOFACTORAUTHDEFAULT); valueMap.put("VoiceDefault", VOICEDEFAULT); valueMap.put("WebRtcDefault", WEBRTCDEFAULT); } diff --git a/src/main/java/com/bandwidth/MultiFactorAuthBasicAuthCredentials.java b/src/main/java/com/bandwidth/TwoFactorAuthBasicAuthCredentials.java similarity index 90% rename from src/main/java/com/bandwidth/MultiFactorAuthBasicAuthCredentials.java rename to src/main/java/com/bandwidth/TwoFactorAuthBasicAuthCredentials.java index 5e5b75d9..6475fcd6 100644 --- a/src/main/java/com/bandwidth/MultiFactorAuthBasicAuthCredentials.java +++ b/src/main/java/com/bandwidth/TwoFactorAuthBasicAuthCredentials.java @@ -9,7 +9,7 @@ /** * Interface for defining the behavior of Basic Authentication. */ -public interface MultiFactorAuthBasicAuthCredentials { +public interface TwoFactorAuthBasicAuthCredentials { /** * String value for basicAuthUserName. diff --git a/src/main/java/com/bandwidth/MultiFactorAuthBasicAuthManager.java b/src/main/java/com/bandwidth/TwoFactorAuthBasicAuthManager.java similarity index 84% rename from src/main/java/com/bandwidth/MultiFactorAuthBasicAuthManager.java rename to src/main/java/com/bandwidth/TwoFactorAuthBasicAuthManager.java index 5ce4f73e..7398f3ea 100644 --- a/src/main/java/com/bandwidth/MultiFactorAuthBasicAuthManager.java +++ b/src/main/java/com/bandwidth/TwoFactorAuthBasicAuthManager.java @@ -13,7 +13,7 @@ /** * Utility class for authorization and token management. */ -public class MultiFactorAuthBasicAuthManager implements AuthManager, MultiFactorAuthBasicAuthCredentials { +public class TwoFactorAuthBasicAuthManager implements AuthManager, TwoFactorAuthBasicAuthCredentials { private String basicAuthUserName; @@ -24,7 +24,7 @@ public class MultiFactorAuthBasicAuthManager implements AuthManager, MultiFactor * @param username String value for username. * @param password String value for password. */ - public MultiFactorAuthBasicAuthManager(String username, String password) { + public TwoFactorAuthBasicAuthManager(String username, String password) { this.basicAuthUserName = username; this.basicAuthPassword = password; } @@ -57,12 +57,12 @@ public boolean equals(String basicAuthUserName, String basicAuthPassword) { } /** - * Converts this MultiFactorAuthBasicAuthManager into string format. + * Converts this TwoFactorAuthBasicAuthManager into string format. * @return String representation of this class */ @Override public String toString() { - return "MultiFactorAuthBasicAuthManager [" + "basicAuthUserName=" + basicAuthUserName + return "TwoFactorAuthBasicAuthManager [" + "basicAuthUserName=" + basicAuthUserName + ", basicAuthPassword=" + basicAuthPassword + "]"; } diff --git a/src/main/java/com/bandwidth/MultiFactorAuthClient.java b/src/main/java/com/bandwidth/TwoFactorAuthClient.java similarity index 78% rename from src/main/java/com/bandwidth/MultiFactorAuthClient.java rename to src/main/java/com/bandwidth/TwoFactorAuthClient.java index 356008b9..821656a3 100644 --- a/src/main/java/com/bandwidth/MultiFactorAuthClient.java +++ b/src/main/java/com/bandwidth/TwoFactorAuthClient.java @@ -6,10 +6,10 @@ package com.bandwidth; -import com.bandwidth.multifactorauth.controllers.*; +import com.bandwidth.twofactorauth.controllers.*; import com.bandwidth.http.client.OkClient; -public final class MultiFactorAuthClient { +public final class TwoFactorAuthClient { private final BandwidthClient config; /** @@ -20,7 +20,7 @@ public final class MultiFactorAuthClient { /** * Default constructor. */ - public MultiFactorAuthClient(BandwidthClient config) { + public TwoFactorAuthClient(BandwidthClient config) { this.config = config; mFA = new MFAController(config, config.getHttpClient(), config.getAuthManagers()); } diff --git a/src/main/java/com/bandwidth/http/request/MultipartFileWrapper.java b/src/main/java/com/bandwidth/http/request/MultipartFileWrapper.java index 24c87d75..caef2ca6 100644 --- a/src/main/java/com/bandwidth/http/request/MultipartFileWrapper.java +++ b/src/main/java/com/bandwidth/http/request/MultipartFileWrapper.java @@ -8,16 +8,13 @@ import com.bandwidth.http.Headers; import com.bandwidth.utilities.FileWrapper; -import com.fasterxml.jackson.annotation.JsonInclude; /** * Class to wrap file and headers to be sent as part of a multipart request. */ public class MultipartFileWrapper { - @JsonInclude(JsonInclude.Include.NON_NULL) private FileWrapper fileWrapper; - @JsonInclude(JsonInclude.Include.NON_NULL) private Headers headers; /** diff --git a/src/main/java/com/bandwidth/http/request/MultipartWrapper.java b/src/main/java/com/bandwidth/http/request/MultipartWrapper.java index 1b73e6bc..401f7726 100644 --- a/src/main/java/com/bandwidth/http/request/MultipartWrapper.java +++ b/src/main/java/com/bandwidth/http/request/MultipartWrapper.java @@ -7,16 +7,13 @@ package com.bandwidth.http.request; import com.bandwidth.http.Headers; -import com.fasterxml.jackson.annotation.JsonInclude; /** * Class to wrap byteArray and headers to be sent as part of a multipart request. */ public class MultipartWrapper { - @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] byteArray; - @JsonInclude(JsonInclude.Include.NON_NULL) private Headers headers; /** diff --git a/src/main/java/com/bandwidth/internal/OptionalNullable.java b/src/main/java/com/bandwidth/internal/OptionalNullable.java deleted file mode 100644 index 84d85017..00000000 --- a/src/main/java/com/bandwidth/internal/OptionalNullable.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * BandwidthLib - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -package com.bandwidth.internal; - -import com.bandwidth.DateTimeHelper; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import java.io.IOException; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; - -/** - * Class to encapsulate fields which are Optional as well as Nullable. It also - * provides helper methods to create OptionalNullable generic type, and to - * extract value from it. - * @param Type of the encapsulated field. - */ -public class OptionalNullable { - - /** - * Private store for encapsulated object's value. - */ - private T value; - - private OptionalNullable(T value) { - this.value = value; - } - - /** - * Converts this OptionalNullable into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "" + value; - } - - /** - * Creates an OptionalNullable instance with the provided value. - * @param Type of the provided object. - * @param value Value of the provided object. - * @return {@link OptionalNullable} instance encapsulating given value. - */ - public static OptionalNullable of(T value) { - return new OptionalNullable(value); - } - - /** - * Extracts the encapsulated value from the given OptionalNullable. - * @param Type of the expected value. - * @param optionalNullable OptionalNullable instance to get value. - * @return Value of the extracted field. - */ - public static T getFrom(OptionalNullable optionalNullable) { - return (optionalNullable == null) ? null : optionalNullable.value; - } - - /** - * JsonSerializer for the {@link OptionalNullable} instance. It is used to - * Serialize an {@link OptionalNullable} as its encapsulated object. - */ - public static class Serializer extends JsonSerializer> { - @SuppressWarnings("unused") - @Override - public void serialize(OptionalNullable object, JsonGenerator jgen, - SerializerProvider provider) throws IOException { - jgen.writeObject(object.value); - } - } - - /** - * A class to handle serialization of Unix Timestamps to DateTime objects. - */ - public static class UnixTimestampSerializer extends JsonSerializer> { - @SuppressWarnings({ "unused", "unchecked" }) - @Override - public void serialize(OptionalNullable object, JsonGenerator jgen, - SerializerProvider provider) throws IOException { - if (object.value instanceof List) { - jgen.writeObject( - DateTimeHelper.toUnixTimestampLong((List) object.value)); - } else if (object.value instanceof Map) { - jgen.writeObject( - DateTimeHelper.toUnixTimestampLong((Map) object.value)); - } else { - jgen.writeObject(DateTimeHelper.toUnixTimestampLong((LocalDateTime) object.value)); - } - } - } - - /** - * A class to handle serialization of Rfc1123 format strings to DateTime - * objects. - */ - public static class Rfc1123DateTimeSerializer extends JsonSerializer> { - @SuppressWarnings({ "unused", "unchecked" }) - @Override - public void serialize(OptionalNullable object, JsonGenerator jgen, - SerializerProvider provider) throws IOException { - if (object.value instanceof List) { - jgen.writeObject( - DateTimeHelper.toRfc1123DateTime((List) object.value)); - } else if (object.value instanceof Map) { - jgen.writeObject( - DateTimeHelper.toRfc1123DateTime((Map) object.value)); - } else { - jgen.writeString(DateTimeHelper.toRfc1123DateTime((LocalDateTime) object.value)); - } - } - } - - /** - * A class to handle serialization of Rfc8601(Rfc3339) format strings to - * DateTime objects. - */ - public static class Rfc8601DateTimeSerializer extends JsonSerializer> { - @SuppressWarnings({ "unused", "unchecked" }) - @Override - public void serialize(OptionalNullable object, JsonGenerator jgen, - SerializerProvider provider) throws IOException { - if (object.value instanceof List) { - jgen.writeObject( - DateTimeHelper.toRfc8601DateTime((List) object.value)); - } else if (object.value instanceof Map) { - jgen.writeObject( - DateTimeHelper.toRfc8601DateTime((Map) object.value)); - } else { - jgen.writeString(DateTimeHelper.toRfc8601DateTime((LocalDateTime) object.value)); - } - } - } - - /** - * A class to handle serialization of LocalDate objects to date strings. - */ - public static class SimpleDateSerializer extends JsonSerializer> { - @SuppressWarnings({ "unused", "unchecked" }) - @Override - public void serialize(OptionalNullable object, JsonGenerator jgen, - SerializerProvider provider) throws IOException { - if (object.value instanceof List) { - jgen.writeObject(DateTimeHelper.toSimpleDate((List) object.value)); - } else if (object.value instanceof Map) { - jgen.writeObject( - DateTimeHelper.toSimpleDate((Map) object.value)); - } else { - jgen.writeString(DateTimeHelper.toSimpleDate((LocalDate) object.value)); - } - } - } -} \ No newline at end of file diff --git a/src/main/java/com/bandwidth/messaging/controllers/APIController.java b/src/main/java/com/bandwidth/messaging/controllers/APIController.java index e640ddc1..30ee9b52 100644 --- a/src/main/java/com/bandwidth/messaging/controllers/APIController.java +++ b/src/main/java/com/bandwidth/messaging/controllers/APIController.java @@ -20,7 +20,7 @@ import com.bandwidth.http.response.ApiResponse; import com.bandwidth.http.response.HttpResponse; import com.bandwidth.http.response.HttpStringResponse; -import com.bandwidth.messaging.exceptions.MessagingExceptionErrorException; +import com.bandwidth.messaging.exceptions.MessagingException; import com.bandwidth.messaging.models.BandwidthMessage; import com.bandwidth.messaging.models.BandwidthMessagesList; import com.bandwidth.messaging.models.Media; @@ -65,7 +65,7 @@ public APIController(Configuration config, HttpClient httpClient, /** * listMedia. - * @param accountId Required parameter: User's account ID + * @param userId Required parameter: User's account ID * @param continuationToken Optional parameter: Continuation token used to retrieve subsequent * media. * @return Returns the List of Media wrapped in ApiResponse response from the API call @@ -73,9 +73,9 @@ public APIController(Configuration config, HttpClient httpClient, * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ApiResponse> listMedia( - final String accountId, + final String userId, final String continuationToken) throws ApiException, IOException { - HttpRequest request = buildListMediaRequest(accountId, continuationToken); + HttpRequest request = buildListMediaRequest(userId, continuationToken); authManagers.get("messaging").apply(request); HttpResponse response = getClientInstance().executeAsString(request); @@ -86,15 +86,15 @@ public ApiResponse> listMedia( /** * listMedia. - * @param accountId Required parameter: User's account ID + * @param userId Required parameter: User's account ID * @param continuationToken Optional parameter: Continuation token used to retrieve subsequent * media. * @return Returns the List of Media wrapped in ApiResponse response from the API call */ public CompletableFuture>> listMediaAsync( - final String accountId, + final String userId, final String continuationToken) { - return makeHttpCallAsync(() -> buildListMediaRequest(accountId, continuationToken), + return makeHttpCallAsync(() -> buildListMediaRequest(userId, continuationToken), req -> authManagers.get("messaging").applyAsync(req) .thenCompose(request -> getClientInstance() .executeAsStringAsync(request)), @@ -105,19 +105,19 @@ public CompletableFuture>> listMediaAsync( * Builds the HttpRequest object for listMedia. */ private HttpRequest buildListMediaRequest( - final String accountId, + final String userId, final String continuationToken) { //the base uri for api requests String baseUri = config.getBaseUri(Server.MESSAGINGDEFAULT); //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri - + "/users/{accountId}/media"); + + "/users/{userId}/media"); //process template parameters Map> templateParameters = new HashMap<>(); - templateParameters.put("accountId", - new SimpleEntry(accountId, false)); + templateParameters.put("userId", + new SimpleEntry(userId, false)); ApiHelper.appendUrlWithTemplateParameters(queryBuilder, templateParameters); //load all headers for the outgoing API request @@ -154,22 +154,22 @@ private ApiResponse> handleListMediaResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new MessagingExceptionErrorException("400 Request is malformed or invalid", context); + throw new MessagingException("400 Request is malformed or invalid", context); } if (responseCode == 401) { - throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", context); + throw new MessagingException("401 The specified user does not have access to the account", context); } if (responseCode == 403) { - throw new MessagingExceptionErrorException("403 The user does not have access to this API", context); + throw new MessagingException("403 The user does not have access to this API", context); } if (responseCode == 404) { - throw new MessagingExceptionErrorException("404 Path not found", context); + throw new MessagingException("404 Path not found", context); } if (responseCode == 415) { - throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", context); + throw new MessagingException("415 The content-type of the request is incorrect", context); } if (responseCode == 429) { - throw new MessagingExceptionErrorException("429 The rate limit has been reached", context); + throw new MessagingException("429 The rate limit has been reached", context); } //handle errors defined at the API level validateResponse(response, context); @@ -183,16 +183,16 @@ private ApiResponse> handleListMediaResponse( /** * getMedia. - * @param accountId Required parameter: User's account ID + * @param userId Required parameter: User's account ID * @param mediaId Required parameter: Media ID to retrieve * @return Returns the InputStream wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ApiResponse getMedia( - final String accountId, + final String userId, final String mediaId) throws ApiException, IOException { - HttpRequest request = buildGetMediaRequest(accountId, mediaId); + HttpRequest request = buildGetMediaRequest(userId, mediaId); authManagers.get("messaging").apply(request); HttpResponse response = getClientInstance().executeAsBinary(request); @@ -203,14 +203,14 @@ public ApiResponse getMedia( /** * getMedia. - * @param accountId Required parameter: User's account ID + * @param userId Required parameter: User's account ID * @param mediaId Required parameter: Media ID to retrieve * @return Returns the InputStream wrapped in ApiResponse response from the API call */ public CompletableFuture> getMediaAsync( - final String accountId, + final String userId, final String mediaId) { - return makeHttpCallAsync(() -> buildGetMediaRequest(accountId, mediaId), + return makeHttpCallAsync(() -> buildGetMediaRequest(userId, mediaId), req -> authManagers.get("messaging").applyAsync(req) .thenCompose(request -> getClientInstance() .executeAsStringAsync(request)), @@ -221,19 +221,19 @@ public CompletableFuture> getMediaAsync( * Builds the HttpRequest object for getMedia. */ private HttpRequest buildGetMediaRequest( - final String accountId, + final String userId, final String mediaId) { //the base uri for api requests String baseUri = config.getBaseUri(Server.MESSAGINGDEFAULT); //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri - + "/users/{accountId}/media/{mediaId}"); + + "/users/{userId}/media/{mediaId}"); //process template parameters Map> templateParameters = new HashMap<>(); - templateParameters.put("accountId", - new SimpleEntry(accountId, false)); + templateParameters.put("userId", + new SimpleEntry(userId, false)); templateParameters.put("mediaId", new SimpleEntry(mediaId, false)); ApiHelper.appendUrlWithTemplateParameters(queryBuilder, templateParameters); @@ -270,22 +270,22 @@ private ApiResponse handleGetMediaResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new MessagingExceptionErrorException("400 Request is malformed or invalid", context); + throw new MessagingException("400 Request is malformed or invalid", context); } if (responseCode == 401) { - throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", context); + throw new MessagingException("401 The specified user does not have access to the account", context); } if (responseCode == 403) { - throw new MessagingExceptionErrorException("403 The user does not have access to this API", context); + throw new MessagingException("403 The user does not have access to this API", context); } if (responseCode == 404) { - throw new MessagingExceptionErrorException("404 Path not found", context); + throw new MessagingException("404 Path not found", context); } if (responseCode == 415) { - throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", context); + throw new MessagingException("415 The content-type of the request is incorrect", context); } if (responseCode == 429) { - throw new MessagingExceptionErrorException("429 The rate limit has been reached", context); + throw new MessagingException("429 The rate limit has been reached", context); } //handle errors defined at the API level validateResponse(response, context); @@ -297,8 +297,9 @@ private ApiResponse handleGetMediaResponse( /** * uploadMedia. - * @param accountId Required parameter: User's account ID + * @param userId Required parameter: User's account ID * @param mediaId Required parameter: The user supplied custom media ID + * @param contentLength Required parameter: The size of the entity-body * @param body Required parameter: Example: * @param contentType Optional parameter: The media type of the entity-body * @param cacheControl Optional parameter: General-header field is used to specify directives @@ -307,13 +308,14 @@ private ApiResponse handleGetMediaResponse( * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ApiResponse uploadMedia( - final String accountId, + final String userId, final String mediaId, + final long contentLength, final FileWrapper body, final String contentType, final String cacheControl) throws ApiException, IOException { - HttpRequest request = buildUploadMediaRequest(accountId, mediaId, body, contentType, - cacheControl); + HttpRequest request = buildUploadMediaRequest(userId, mediaId, contentLength, body, + contentType, cacheControl); authManagers.get("messaging").apply(request); HttpResponse response = getClientInstance().executeAsString(request); @@ -324,8 +326,9 @@ public ApiResponse uploadMedia( /** * uploadMedia. - * @param accountId Required parameter: User's account ID + * @param userId Required parameter: User's account ID * @param mediaId Required parameter: The user supplied custom media ID + * @param contentLength Required parameter: The size of the entity-body * @param body Required parameter: Example: * @param contentType Optional parameter: The media type of the entity-body * @param cacheControl Optional parameter: General-header field is used to specify directives @@ -333,12 +336,13 @@ public ApiResponse uploadMedia( * @return Returns the Void wrapped in ApiResponse response from the API call */ public CompletableFuture> uploadMediaAsync( - final String accountId, + final String userId, final String mediaId, + final long contentLength, final FileWrapper body, final String contentType, final String cacheControl) { - return makeHttpCallAsync(() -> buildUploadMediaRequest(accountId, mediaId, body, + return makeHttpCallAsync(() -> buildUploadMediaRequest(userId, mediaId, contentLength, body, contentType, cacheControl), req -> authManagers.get("messaging").applyAsync(req) .thenCompose(request -> getClientInstance() @@ -350,8 +354,9 @@ public CompletableFuture> uploadMediaAsync( * Builds the HttpRequest object for uploadMedia. */ private HttpRequest buildUploadMediaRequest( - final String accountId, + final String userId, final String mediaId, + final long contentLength, final FileWrapper body, final String contentType, final String cacheControl) { @@ -360,18 +365,19 @@ private HttpRequest buildUploadMediaRequest( //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri - + "/users/{accountId}/media/{mediaId}"); + + "/users/{userId}/media/{mediaId}"); //process template parameters Map> templateParameters = new HashMap<>(); - templateParameters.put("accountId", - new SimpleEntry(accountId, false)); + templateParameters.put("userId", + new SimpleEntry(userId, false)); templateParameters.put("mediaId", new SimpleEntry(mediaId, false)); ApiHelper.appendUrlWithTemplateParameters(queryBuilder, templateParameters); //load all headers for the outgoing API request Headers headers = new Headers(); + headers.add("Content-Length", String.valueOf(contentLength)); headers.add("Content-Type", (contentType != null) ? contentType : "application/octet-stream"); headers.add("Cache-Control", cacheControl); @@ -405,22 +411,22 @@ private ApiResponse handleUploadMediaResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new MessagingExceptionErrorException("400 Request is malformed or invalid", context); + throw new MessagingException("400 Request is malformed or invalid", context); } if (responseCode == 401) { - throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", context); + throw new MessagingException("401 The specified user does not have access to the account", context); } if (responseCode == 403) { - throw new MessagingExceptionErrorException("403 The user does not have access to this API", context); + throw new MessagingException("403 The user does not have access to this API", context); } if (responseCode == 404) { - throw new MessagingExceptionErrorException("404 Path not found", context); + throw new MessagingException("404 Path not found", context); } if (responseCode == 415) { - throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", context); + throw new MessagingException("415 The content-type of the request is incorrect", context); } if (responseCode == 429) { - throw new MessagingExceptionErrorException("429 The rate limit has been reached", context); + throw new MessagingException("429 The rate limit has been reached", context); } //handle errors defined at the API level validateResponse(response, context); @@ -430,15 +436,15 @@ private ApiResponse handleUploadMediaResponse( /** * deleteMedia. - * @param accountId Required parameter: User's account ID + * @param userId Required parameter: User's account ID * @param mediaId Required parameter: The media ID to delete * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ApiResponse deleteMedia( - final String accountId, + final String userId, final String mediaId) throws ApiException, IOException { - HttpRequest request = buildDeleteMediaRequest(accountId, mediaId); + HttpRequest request = buildDeleteMediaRequest(userId, mediaId); authManagers.get("messaging").apply(request); HttpResponse response = getClientInstance().executeAsString(request); @@ -449,14 +455,14 @@ public ApiResponse deleteMedia( /** * deleteMedia. - * @param accountId Required parameter: User's account ID + * @param userId Required parameter: User's account ID * @param mediaId Required parameter: The media ID to delete * @return Returns the Void wrapped in ApiResponse response from the API call */ public CompletableFuture> deleteMediaAsync( - final String accountId, + final String userId, final String mediaId) { - return makeHttpCallAsync(() -> buildDeleteMediaRequest(accountId, mediaId), + return makeHttpCallAsync(() -> buildDeleteMediaRequest(userId, mediaId), req -> authManagers.get("messaging").applyAsync(req) .thenCompose(request -> getClientInstance() .executeAsStringAsync(request)), @@ -467,19 +473,19 @@ public CompletableFuture> deleteMediaAsync( * Builds the HttpRequest object for deleteMedia. */ private HttpRequest buildDeleteMediaRequest( - final String accountId, + final String userId, final String mediaId) { //the base uri for api requests String baseUri = config.getBaseUri(Server.MESSAGINGDEFAULT); //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri - + "/users/{accountId}/media/{mediaId}"); + + "/users/{userId}/media/{mediaId}"); //process template parameters Map> templateParameters = new HashMap<>(); - templateParameters.put("accountId", - new SimpleEntry(accountId, false)); + templateParameters.put("userId", + new SimpleEntry(userId, false)); templateParameters.put("mediaId", new SimpleEntry(mediaId, false)); ApiHelper.appendUrlWithTemplateParameters(queryBuilder, templateParameters); @@ -516,22 +522,22 @@ private ApiResponse handleDeleteMediaResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new MessagingExceptionErrorException("400 Request is malformed or invalid", context); + throw new MessagingException("400 Request is malformed or invalid", context); } if (responseCode == 401) { - throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", context); + throw new MessagingException("401 The specified user does not have access to the account", context); } if (responseCode == 403) { - throw new MessagingExceptionErrorException("403 The user does not have access to this API", context); + throw new MessagingException("403 The user does not have access to this API", context); } if (responseCode == 404) { - throw new MessagingExceptionErrorException("404 Path not found", context); + throw new MessagingException("404 Path not found", context); } if (responseCode == 415) { - throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", context); + throw new MessagingException("415 The content-type of the request is incorrect", context); } if (responseCode == 429) { - throw new MessagingExceptionErrorException("429 The rate limit has been reached", context); + throw new MessagingException("429 The rate limit has been reached", context); } //handle errors defined at the API level validateResponse(response, context); @@ -541,13 +547,13 @@ private ApiResponse handleDeleteMediaResponse( /** * getMessages. - * @param accountId Required parameter: User's account ID + * @param userId Required parameter: User's account ID * @param messageId Optional parameter: The ID of the message to search for. Special * characters need to be encoded using URL encoding * @param sourceTn Optional parameter: The phone number that sent the message * @param destinationTn Optional parameter: The phone number that received the message * @param messageStatus Optional parameter: The status of the message. One of RECEIVED, - * QUEUED, SENDING, SENT, FAILED, DELIVERED, ACCEPTED, UNDELIVERED + * QUEUED, SENDING, SENT, FAILED, DELIVERED, DLR_EXPIRED * @param errorCode Optional parameter: The error code of the message * @param fromDateTime Optional parameter: The start of the date range to search in ISO 8601 * format. Uses the message receive time. The date range to search in is currently 14 @@ -563,7 +569,7 @@ private ApiResponse handleDeleteMediaResponse( * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ApiResponse getMessages( - final String accountId, + final String userId, final String messageId, final String sourceTn, final String destinationTn, @@ -573,7 +579,7 @@ public ApiResponse getMessages( final String toDateTime, final String pageToken, final Integer limit) throws ApiException, IOException { - HttpRequest request = buildGetMessagesRequest(accountId, messageId, sourceTn, destinationTn, + HttpRequest request = buildGetMessagesRequest(userId, messageId, sourceTn, destinationTn, messageStatus, errorCode, fromDateTime, toDateTime, pageToken, limit); authManagers.get("messaging").apply(request); @@ -585,13 +591,13 @@ public ApiResponse getMessages( /** * getMessages. - * @param accountId Required parameter: User's account ID + * @param userId Required parameter: User's account ID * @param messageId Optional parameter: The ID of the message to search for. Special * characters need to be encoded using URL encoding * @param sourceTn Optional parameter: The phone number that sent the message * @param destinationTn Optional parameter: The phone number that received the message * @param messageStatus Optional parameter: The status of the message. One of RECEIVED, - * QUEUED, SENDING, SENT, FAILED, DELIVERED, ACCEPTED, UNDELIVERED + * QUEUED, SENDING, SENT, FAILED, DELIVERED, DLR_EXPIRED * @param errorCode Optional parameter: The error code of the message * @param fromDateTime Optional parameter: The start of the date range to search in ISO 8601 * format. Uses the message receive time. The date range to search in is currently 14 @@ -605,7 +611,7 @@ public ApiResponse getMessages( * @return Returns the BandwidthMessagesList wrapped in ApiResponse response from the API call */ public CompletableFuture> getMessagesAsync( - final String accountId, + final String userId, final String messageId, final String sourceTn, final String destinationTn, @@ -615,7 +621,7 @@ public CompletableFuture> getMessagesAsync( final String toDateTime, final String pageToken, final Integer limit) { - return makeHttpCallAsync(() -> buildGetMessagesRequest(accountId, messageId, sourceTn, + return makeHttpCallAsync(() -> buildGetMessagesRequest(userId, messageId, sourceTn, destinationTn, messageStatus, errorCode, fromDateTime, toDateTime, pageToken, limit), req -> authManagers.get("messaging").applyAsync(req) @@ -628,7 +634,7 @@ public CompletableFuture> getMessagesAsync( * Builds the HttpRequest object for getMessages. */ private HttpRequest buildGetMessagesRequest( - final String accountId, + final String userId, final String messageId, final String sourceTn, final String destinationTn, @@ -643,12 +649,12 @@ private HttpRequest buildGetMessagesRequest( //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri - + "/users/{accountId}/messages"); + + "/users/{userId}/messages"); //process template parameters Map> templateParameters = new HashMap<>(); - templateParameters.put("accountId", - new SimpleEntry(accountId, false)); + templateParameters.put("userId", + new SimpleEntry(userId, false)); ApiHelper.appendUrlWithTemplateParameters(queryBuilder, templateParameters); //load all query parameters @@ -697,22 +703,22 @@ private ApiResponse handleGetMessagesResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new MessagingExceptionErrorException("400 Request is malformed or invalid", context); + throw new MessagingException("400 Request is malformed or invalid", context); } if (responseCode == 401) { - throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", context); + throw new MessagingException("401 The specified user does not have access to the account", context); } if (responseCode == 403) { - throw new MessagingExceptionErrorException("403 The user does not have access to this API", context); + throw new MessagingException("403 The user does not have access to this API", context); } if (responseCode == 404) { - throw new MessagingExceptionErrorException("404 Path not found", context); + throw new MessagingException("404 Path not found", context); } if (responseCode == 415) { - throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", context); + throw new MessagingException("415 The content-type of the request is incorrect", context); } if (responseCode == 429) { - throw new MessagingExceptionErrorException("429 The rate limit has been reached", context); + throw new MessagingException("429 The rate limit has been reached", context); } //handle errors defined at the API level validateResponse(response, context); @@ -727,16 +733,16 @@ private ApiResponse handleGetMessagesResponse( /** * createMessage. - * @param accountId Required parameter: User's account ID + * @param userId Required parameter: User's account ID * @param body Required parameter: Example: * @return Returns the BandwidthMessage wrapped in ApiResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ApiResponse createMessage( - final String accountId, + final String userId, final MessageRequest body) throws ApiException, IOException { - HttpRequest request = buildCreateMessageRequest(accountId, body); + HttpRequest request = buildCreateMessageRequest(userId, body); authManagers.get("messaging").apply(request); HttpResponse response = getClientInstance().executeAsString(request); @@ -747,14 +753,14 @@ public ApiResponse createMessage( /** * createMessage. - * @param accountId Required parameter: User's account ID + * @param userId Required parameter: User's account ID * @param body Required parameter: Example: * @return Returns the BandwidthMessage wrapped in ApiResponse response from the API call */ public CompletableFuture> createMessageAsync( - final String accountId, + final String userId, final MessageRequest body) { - return makeHttpCallAsync(() -> buildCreateMessageRequest(accountId, body), + return makeHttpCallAsync(() -> buildCreateMessageRequest(userId, body), req -> authManagers.get("messaging").applyAsync(req) .thenCompose(request -> getClientInstance() .executeAsStringAsync(request)), @@ -765,19 +771,19 @@ public CompletableFuture> createMessageAsync( * Builds the HttpRequest object for createMessage. */ private HttpRequest buildCreateMessageRequest( - final String accountId, + final String userId, final MessageRequest body) throws JsonProcessingException { //the base uri for api requests String baseUri = config.getBaseUri(Server.MESSAGINGDEFAULT); //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri - + "/users/{accountId}/messages"); + + "/users/{userId}/messages"); //process template parameters Map> templateParameters = new HashMap<>(); - templateParameters.put("accountId", - new SimpleEntry(accountId, false)); + templateParameters.put("userId", + new SimpleEntry(userId, false)); ApiHelper.appendUrlWithTemplateParameters(queryBuilder, templateParameters); //load all headers for the outgoing API request @@ -815,22 +821,22 @@ private ApiResponse handleCreateMessageResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new MessagingExceptionErrorException("400 Request is malformed or invalid", context); + throw new MessagingException("400 Request is malformed or invalid", context); } if (responseCode == 401) { - throw new MessagingExceptionErrorException("401 The specified user does not have access to the account", context); + throw new MessagingException("401 The specified user does not have access to the account", context); } if (responseCode == 403) { - throw new MessagingExceptionErrorException("403 The user does not have access to this API", context); + throw new MessagingException("403 The user does not have access to this API", context); } if (responseCode == 404) { - throw new MessagingExceptionErrorException("404 Path not found", context); + throw new MessagingException("404 Path not found", context); } if (responseCode == 415) { - throw new MessagingExceptionErrorException("415 The content-type of the request is incorrect", context); + throw new MessagingException("415 The content-type of the request is incorrect", context); } if (responseCode == 429) { - throw new MessagingExceptionErrorException("429 The rate limit has been reached", context); + throw new MessagingException("429 The rate limit has been reached", context); } //handle errors defined at the API level validateResponse(response, context); diff --git a/src/main/java/com/bandwidth/messaging/exceptions/MessagingExceptionErrorException.java b/src/main/java/com/bandwidth/messaging/exceptions/MessagingException.java similarity index 63% rename from src/main/java/com/bandwidth/messaging/exceptions/MessagingExceptionErrorException.java rename to src/main/java/com/bandwidth/messaging/exceptions/MessagingException.java index bff5081a..60adc223 100644 --- a/src/main/java/com/bandwidth/messaging/exceptions/MessagingExceptionErrorException.java +++ b/src/main/java/com/bandwidth/messaging/exceptions/MessagingException.java @@ -12,11 +12,11 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for MessagingExceptionErrorException type. + * This is a model class for MessagingException type. */ -public class MessagingExceptionErrorException +public class MessagingException extends ApiException { - private static final long serialVersionUID = 5055941313450903910L; + private static final long serialVersionUID = 3829971530321243789L; private String type; private String description; @@ -25,14 +25,14 @@ public class MessagingExceptionErrorException * @param reason The reason for throwing exception * @param context The http context of the API exception */ - public MessagingExceptionErrorException(String reason, HttpContext context) { + public MessagingException(String reason, HttpContext context) { super(reason, context); } /** * Getter for Type. - * @return Returns the String + * @return Returns the String */ @JsonGetter("type") public String getType() { @@ -41,16 +41,16 @@ public String getType() { /** * Setter for Type. - * @param type Value for String + * @param value Value for String */ @JsonSetter("type") - private void setType(String type) { - this.type = type; + private void setType(String value) { + this.type = value; } /** * Getter for Description. - * @return Returns the String + * @return Returns the String */ @JsonGetter("description") public String getDescription() { @@ -59,10 +59,10 @@ public String getDescription() { /** * Setter for Description. - * @param description Value for String + * @param value Value for String */ @JsonSetter("description") - private void setDescription(String description) { - this.description = description; + private void setDescription(String value) { + this.description = value; } } diff --git a/src/main/java/com/bandwidth/messaging/models/BandwidthCallbackMessage.java b/src/main/java/com/bandwidth/messaging/models/BandwidthCallbackMessage.java index 7fc89225..7e45f191 100644 --- a/src/main/java/com/bandwidth/messaging/models/BandwidthCallbackMessage.java +++ b/src/main/java/com/bandwidth/messaging/models/BandwidthCallbackMessage.java @@ -7,24 +7,17 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for BandwidthCallbackMessage type. */ public class BandwidthCallbackMessage { - @JsonInclude(JsonInclude.Include.NON_NULL) private String time; - @JsonInclude(JsonInclude.Include.NON_NULL) private String type; - @JsonInclude(JsonInclude.Include.NON_NULL) private String to; - @JsonInclude(JsonInclude.Include.NON_NULL) private String errorCode; - @JsonInclude(JsonInclude.Include.NON_NULL) private String description; - @JsonInclude(JsonInclude.Include.NON_NULL) private BandwidthMessage message; /** @@ -35,12 +28,12 @@ public BandwidthCallbackMessage() { /** * Initialization constructor. - * @param time String value for time. - * @param type String value for type. - * @param to String value for to. - * @param errorCode String value for errorCode. - * @param description String value for description. - * @param message BandwidthMessage value for message. + * @param time String value for time. + * @param type String value for type. + * @param to String value for to. + * @param errorCode String value for errorCode. + * @param description String value for description. + * @param message BandwidthMessage value for message. */ public BandwidthCallbackMessage( String time, @@ -63,7 +56,7 @@ public BandwidthCallbackMessage( */ @JsonGetter("time") public String getTime() { - return time; + return this.time; } /** @@ -81,7 +74,7 @@ public void setTime(String time) { */ @JsonGetter("type") public String getType() { - return type; + return this.type; } /** @@ -99,7 +92,7 @@ public void setType(String type) { */ @JsonGetter("to") public String getTo() { - return to; + return this.to; } /** @@ -117,7 +110,7 @@ public void setTo(String to) { */ @JsonGetter("errorCode") public String getErrorCode() { - return errorCode; + return this.errorCode; } /** @@ -135,7 +128,7 @@ public void setErrorCode(String errorCode) { */ @JsonGetter("description") public String getDescription() { - return description; + return this.description; } /** @@ -153,7 +146,7 @@ public void setDescription(String description) { */ @JsonGetter("message") public BandwidthMessage getMessage() { - return message; + return this.message; } /** @@ -207,7 +200,7 @@ public static class Builder { /** * Setter for time. - * @param time String value for time. + * @param time String value for time. * @return Builder */ public Builder time(String time) { @@ -217,7 +210,7 @@ public Builder time(String time) { /** * Setter for type. - * @param type String value for type. + * @param type String value for type. * @return Builder */ public Builder type(String type) { @@ -227,7 +220,7 @@ public Builder type(String type) { /** * Setter for to. - * @param to String value for to. + * @param to String value for to. * @return Builder */ public Builder to(String to) { @@ -237,7 +230,7 @@ public Builder to(String to) { /** * Setter for errorCode. - * @param errorCode String value for errorCode. + * @param errorCode String value for errorCode. * @return Builder */ public Builder errorCode(String errorCode) { @@ -247,7 +240,7 @@ public Builder errorCode(String errorCode) { /** * Setter for description. - * @param description String value for description. + * @param description String value for description. * @return Builder */ public Builder description(String description) { @@ -257,7 +250,7 @@ public Builder description(String description) { /** * Setter for message. - * @param message BandwidthMessage value for message. + * @param message BandwidthMessage value for message. * @return Builder */ public Builder message(BandwidthMessage message) { diff --git a/src/main/java/com/bandwidth/messaging/models/BandwidthMessage.java b/src/main/java/com/bandwidth/messaging/models/BandwidthMessage.java index e4092496..dae9cbfe 100644 --- a/src/main/java/com/bandwidth/messaging/models/BandwidthMessage.java +++ b/src/main/java/com/bandwidth/messaging/models/BandwidthMessage.java @@ -7,7 +7,6 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import java.util.List; @@ -15,29 +14,17 @@ * This is a model class for BandwidthMessage type. */ public class BandwidthMessage { - @JsonInclude(JsonInclude.Include.NON_NULL) private String id; - @JsonInclude(JsonInclude.Include.NON_NULL) private String owner; - @JsonInclude(JsonInclude.Include.NON_NULL) private String applicationId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String time; - @JsonInclude(JsonInclude.Include.NON_NULL) private Integer segmentCount; - @JsonInclude(JsonInclude.Include.NON_NULL) private String direction; - @JsonInclude(JsonInclude.Include.NON_NULL) private List to; - @JsonInclude(JsonInclude.Include.NON_NULL) private String from; - @JsonInclude(JsonInclude.Include.NON_NULL) private List media; - @JsonInclude(JsonInclude.Include.NON_NULL) private String text; - @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; - @JsonInclude(JsonInclude.Include.NON_NULL) private String priority; /** @@ -48,18 +35,18 @@ public BandwidthMessage() { /** * Initialization constructor. - * @param id String value for id. - * @param owner String value for owner. - * @param applicationId String value for applicationId. - * @param time String value for time. - * @param segmentCount Integer value for segmentCount. - * @param direction String value for direction. - * @param to List of String value for to. - * @param from String value for from. - * @param media List of String value for media. - * @param text String value for text. - * @param tag String value for tag. - * @param priority String value for priority. + * @param id String value for id. + * @param owner String value for owner. + * @param applicationId String value for applicationId. + * @param time String value for time. + * @param segmentCount Integer value for segmentCount. + * @param direction String value for direction. + * @param to List of String value for to. + * @param from String value for from. + * @param media List of String value for media. + * @param text String value for text. + * @param tag String value for tag. + * @param priority String value for priority. */ public BandwidthMessage( String id, @@ -95,7 +82,7 @@ public BandwidthMessage( */ @JsonGetter("id") public String getId() { - return id; + return this.id; } /** @@ -115,7 +102,7 @@ public void setId(String id) { */ @JsonGetter("owner") public String getOwner() { - return owner; + return this.owner; } /** @@ -135,7 +122,7 @@ public void setOwner(String owner) { */ @JsonGetter("applicationId") public String getApplicationId() { - return applicationId; + return this.applicationId; } /** @@ -155,7 +142,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("time") public String getTime() { - return time; + return this.time; } /** @@ -176,7 +163,7 @@ public void setTime(String time) { */ @JsonGetter("segmentCount") public Integer getSegmentCount() { - return segmentCount; + return this.segmentCount; } /** @@ -197,7 +184,7 @@ public void setSegmentCount(Integer segmentCount) { */ @JsonGetter("direction") public String getDirection() { - return direction; + return this.direction; } /** @@ -217,7 +204,7 @@ public void setDirection(String direction) { */ @JsonGetter("to") public List getTo() { - return to; + return this.to; } /** @@ -237,7 +224,7 @@ public void setTo(List to) { */ @JsonGetter("from") public String getFrom() { - return from; + return this.from; } /** @@ -257,7 +244,7 @@ public void setFrom(String from) { */ @JsonGetter("media") public List getMedia() { - return media; + return this.media; } /** @@ -277,7 +264,7 @@ public void setMedia(List media) { */ @JsonGetter("text") public String getText() { - return text; + return this.text; } /** @@ -297,7 +284,7 @@ public void setText(String text) { */ @JsonGetter("tag") public String getTag() { - return tag; + return this.tag; } /** @@ -317,7 +304,7 @@ public void setTag(String tag) { */ @JsonGetter("priority") public String getPriority() { - return priority; + return this.priority; } /** @@ -385,7 +372,7 @@ public static class Builder { /** * Setter for id. - * @param id String value for id. + * @param id String value for id. * @return Builder */ public Builder id(String id) { @@ -395,7 +382,7 @@ public Builder id(String id) { /** * Setter for owner. - * @param owner String value for owner. + * @param owner String value for owner. * @return Builder */ public Builder owner(String owner) { @@ -405,7 +392,7 @@ public Builder owner(String owner) { /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -415,7 +402,7 @@ public Builder applicationId(String applicationId) { /** * Setter for time. - * @param time String value for time. + * @param time String value for time. * @return Builder */ public Builder time(String time) { @@ -425,7 +412,7 @@ public Builder time(String time) { /** * Setter for segmentCount. - * @param segmentCount Integer value for segmentCount. + * @param segmentCount Integer value for segmentCount. * @return Builder */ public Builder segmentCount(Integer segmentCount) { @@ -435,7 +422,7 @@ public Builder segmentCount(Integer segmentCount) { /** * Setter for direction. - * @param direction String value for direction. + * @param direction String value for direction. * @return Builder */ public Builder direction(String direction) { @@ -445,7 +432,7 @@ public Builder direction(String direction) { /** * Setter for to. - * @param to List of String value for to. + * @param to List of String value for to. * @return Builder */ public Builder to(List to) { @@ -455,7 +442,7 @@ public Builder to(List to) { /** * Setter for from. - * @param from String value for from. + * @param from String value for from. * @return Builder */ public Builder from(String from) { @@ -465,7 +452,7 @@ public Builder from(String from) { /** * Setter for media. - * @param media List of String value for media. + * @param media List of String value for media. * @return Builder */ public Builder media(List media) { @@ -475,7 +462,7 @@ public Builder media(List media) { /** * Setter for text. - * @param text String value for text. + * @param text String value for text. * @return Builder */ public Builder text(String text) { @@ -485,7 +472,7 @@ public Builder text(String text) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { @@ -495,7 +482,7 @@ public Builder tag(String tag) { /** * Setter for priority. - * @param priority String value for priority. + * @param priority String value for priority. * @return Builder */ public Builder priority(String priority) { diff --git a/src/main/java/com/bandwidth/messaging/models/BandwidthMessageItem.java b/src/main/java/com/bandwidth/messaging/models/BandwidthMessageItem.java index 8348ef78..b2743397 100644 --- a/src/main/java/com/bandwidth/messaging/models/BandwidthMessageItem.java +++ b/src/main/java/com/bandwidth/messaging/models/BandwidthMessageItem.java @@ -7,34 +7,22 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for BandwidthMessageItem type. */ public class BandwidthMessageItem { - @JsonInclude(JsonInclude.Include.NON_NULL) private String messageId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String accountId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String sourceTn; - @JsonInclude(JsonInclude.Include.NON_NULL) private String destinationTn; - @JsonInclude(JsonInclude.Include.NON_NULL) private String messageStatus; - @JsonInclude(JsonInclude.Include.NON_NULL) private String messageDirection; - @JsonInclude(JsonInclude.Include.NON_NULL) private String messageType; - @JsonInclude(JsonInclude.Include.NON_NULL) private Integer segmentCount; - @JsonInclude(JsonInclude.Include.NON_NULL) private Integer errorCode; - @JsonInclude(JsonInclude.Include.NON_NULL) private String receiveTime; - @JsonInclude(JsonInclude.Include.NON_NULL) private String carrierName; /** @@ -45,17 +33,17 @@ public BandwidthMessageItem() { /** * Initialization constructor. - * @param messageId String value for messageId. - * @param accountId String value for accountId. - * @param sourceTn String value for sourceTn. - * @param destinationTn String value for destinationTn. - * @param messageStatus String value for messageStatus. - * @param messageDirection String value for messageDirection. - * @param messageType String value for messageType. - * @param segmentCount Integer value for segmentCount. - * @param errorCode Integer value for errorCode. - * @param receiveTime String value for receiveTime. - * @param carrierName String value for carrierName. + * @param messageId String value for messageId. + * @param accountId String value for accountId. + * @param sourceTn String value for sourceTn. + * @param destinationTn String value for destinationTn. + * @param messageStatus String value for messageStatus. + * @param messageDirection String value for messageDirection. + * @param messageType String value for messageType. + * @param segmentCount Integer value for segmentCount. + * @param errorCode Integer value for errorCode. + * @param receiveTime String value for receiveTime. + * @param carrierName String value for carrierName. */ public BandwidthMessageItem( String messageId, @@ -89,7 +77,7 @@ public BandwidthMessageItem( */ @JsonGetter("messageId") public String getMessageId() { - return messageId; + return this.messageId; } /** @@ -109,7 +97,7 @@ public void setMessageId(String messageId) { */ @JsonGetter("accountId") public String getAccountId() { - return accountId; + return this.accountId; } /** @@ -129,7 +117,7 @@ public void setAccountId(String accountId) { */ @JsonGetter("sourceTn") public String getSourceTn() { - return sourceTn; + return this.sourceTn; } /** @@ -149,7 +137,7 @@ public void setSourceTn(String sourceTn) { */ @JsonGetter("destinationTn") public String getDestinationTn() { - return destinationTn; + return this.destinationTn; } /** @@ -169,7 +157,7 @@ public void setDestinationTn(String destinationTn) { */ @JsonGetter("messageStatus") public String getMessageStatus() { - return messageStatus; + return this.messageStatus; } /** @@ -189,7 +177,7 @@ public void setMessageStatus(String messageStatus) { */ @JsonGetter("messageDirection") public String getMessageDirection() { - return messageDirection; + return this.messageDirection; } /** @@ -209,7 +197,7 @@ public void setMessageDirection(String messageDirection) { */ @JsonGetter("messageType") public String getMessageType() { - return messageType; + return this.messageType; } /** @@ -229,7 +217,7 @@ public void setMessageType(String messageType) { */ @JsonGetter("segmentCount") public Integer getSegmentCount() { - return segmentCount; + return this.segmentCount; } /** @@ -249,7 +237,7 @@ public void setSegmentCount(Integer segmentCount) { */ @JsonGetter("errorCode") public Integer getErrorCode() { - return errorCode; + return this.errorCode; } /** @@ -269,7 +257,7 @@ public void setErrorCode(Integer errorCode) { */ @JsonGetter("receiveTime") public String getReceiveTime() { - return receiveTime; + return this.receiveTime; } /** @@ -289,7 +277,7 @@ public void setReceiveTime(String receiveTime) { */ @JsonGetter("carrierName") public String getCarrierName() { - return carrierName; + return this.carrierName; } /** @@ -356,7 +344,7 @@ public static class Builder { /** * Setter for messageId. - * @param messageId String value for messageId. + * @param messageId String value for messageId. * @return Builder */ public Builder messageId(String messageId) { @@ -366,7 +354,7 @@ public Builder messageId(String messageId) { /** * Setter for accountId. - * @param accountId String value for accountId. + * @param accountId String value for accountId. * @return Builder */ public Builder accountId(String accountId) { @@ -376,7 +364,7 @@ public Builder accountId(String accountId) { /** * Setter for sourceTn. - * @param sourceTn String value for sourceTn. + * @param sourceTn String value for sourceTn. * @return Builder */ public Builder sourceTn(String sourceTn) { @@ -386,7 +374,7 @@ public Builder sourceTn(String sourceTn) { /** * Setter for destinationTn. - * @param destinationTn String value for destinationTn. + * @param destinationTn String value for destinationTn. * @return Builder */ public Builder destinationTn(String destinationTn) { @@ -396,7 +384,7 @@ public Builder destinationTn(String destinationTn) { /** * Setter for messageStatus. - * @param messageStatus String value for messageStatus. + * @param messageStatus String value for messageStatus. * @return Builder */ public Builder messageStatus(String messageStatus) { @@ -406,7 +394,7 @@ public Builder messageStatus(String messageStatus) { /** * Setter for messageDirection. - * @param messageDirection String value for messageDirection. + * @param messageDirection String value for messageDirection. * @return Builder */ public Builder messageDirection(String messageDirection) { @@ -416,7 +404,7 @@ public Builder messageDirection(String messageDirection) { /** * Setter for messageType. - * @param messageType String value for messageType. + * @param messageType String value for messageType. * @return Builder */ public Builder messageType(String messageType) { @@ -426,7 +414,7 @@ public Builder messageType(String messageType) { /** * Setter for segmentCount. - * @param segmentCount Integer value for segmentCount. + * @param segmentCount Integer value for segmentCount. * @return Builder */ public Builder segmentCount(Integer segmentCount) { @@ -436,7 +424,7 @@ public Builder segmentCount(Integer segmentCount) { /** * Setter for errorCode. - * @param errorCode Integer value for errorCode. + * @param errorCode Integer value for errorCode. * @return Builder */ public Builder errorCode(Integer errorCode) { @@ -446,7 +434,7 @@ public Builder errorCode(Integer errorCode) { /** * Setter for receiveTime. - * @param receiveTime String value for receiveTime. + * @param receiveTime String value for receiveTime. * @return Builder */ public Builder receiveTime(String receiveTime) { @@ -456,7 +444,7 @@ public Builder receiveTime(String receiveTime) { /** * Setter for carrierName. - * @param carrierName String value for carrierName. + * @param carrierName String value for carrierName. * @return Builder */ public Builder carrierName(String carrierName) { diff --git a/src/main/java/com/bandwidth/messaging/models/BandwidthMessagesList.java b/src/main/java/com/bandwidth/messaging/models/BandwidthMessagesList.java index 4e643c73..ed1eaacc 100644 --- a/src/main/java/com/bandwidth/messaging/models/BandwidthMessagesList.java +++ b/src/main/java/com/bandwidth/messaging/models/BandwidthMessagesList.java @@ -7,7 +7,6 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import java.util.List; @@ -15,11 +14,8 @@ * This is a model class for BandwidthMessagesList type. */ public class BandwidthMessagesList { - @JsonInclude(JsonInclude.Include.NON_NULL) private Integer totalCount; - @JsonInclude(JsonInclude.Include.NON_NULL) private PageInfo pageInfo; - @JsonInclude(JsonInclude.Include.NON_NULL) private List messages; /** @@ -30,9 +26,9 @@ public BandwidthMessagesList() { /** * Initialization constructor. - * @param totalCount Integer value for totalCount. - * @param pageInfo PageInfo value for pageInfo. - * @param messages List of BandwidthMessageItem value for messages. + * @param totalCount Integer value for totalCount. + * @param pageInfo PageInfo value for pageInfo. + * @param messages List of BandwidthMessageItem value for messages. */ public BandwidthMessagesList( Integer totalCount, @@ -50,7 +46,7 @@ public BandwidthMessagesList( */ @JsonGetter("totalCount") public Integer getTotalCount() { - return totalCount; + return this.totalCount; } /** @@ -69,7 +65,7 @@ public void setTotalCount(Integer totalCount) { */ @JsonGetter("pageInfo") public PageInfo getPageInfo() { - return pageInfo; + return this.pageInfo; } /** @@ -87,7 +83,7 @@ public void setPageInfo(PageInfo pageInfo) { */ @JsonGetter("messages") public List getMessages() { - return messages; + return this.messages; } /** @@ -134,7 +130,7 @@ public static class Builder { /** * Setter for totalCount. - * @param totalCount Integer value for totalCount. + * @param totalCount Integer value for totalCount. * @return Builder */ public Builder totalCount(Integer totalCount) { @@ -144,7 +140,7 @@ public Builder totalCount(Integer totalCount) { /** * Setter for pageInfo. - * @param pageInfo PageInfo value for pageInfo. + * @param pageInfo PageInfo value for pageInfo. * @return Builder */ public Builder pageInfo(PageInfo pageInfo) { @@ -154,7 +150,7 @@ public Builder pageInfo(PageInfo pageInfo) { /** * Setter for messages. - * @param messages List of BandwidthMessageItem value for messages. + * @param messages List of BandwidthMessageItem value for messages. * @return Builder */ public Builder messages(List messages) { diff --git a/src/main/java/com/bandwidth/messaging/models/DeferredResult.java b/src/main/java/com/bandwidth/messaging/models/DeferredResult.java index 2b4d5ce6..d3825924 100644 --- a/src/main/java/com/bandwidth/messaging/models/DeferredResult.java +++ b/src/main/java/com/bandwidth/messaging/models/DeferredResult.java @@ -7,16 +7,13 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for DeferredResult type. */ public class DeferredResult { - @JsonInclude(JsonInclude.Include.NON_NULL) private Object result; - @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean setOrExpired; /** @@ -27,8 +24,8 @@ public DeferredResult() { /** * Initialization constructor. - * @param result Object value for result. - * @param setOrExpired Boolean value for setOrExpired. + * @param result Object value for result. + * @param setOrExpired Boolean value for setOrExpired. */ public DeferredResult( Object result, @@ -43,7 +40,7 @@ public DeferredResult( */ @JsonGetter("result") public Object getResult() { - return result; + return this.result; } /** @@ -61,7 +58,7 @@ public void setResult(Object result) { */ @JsonGetter("setOrExpired") public Boolean getSetOrExpired() { - return setOrExpired; + return this.setOrExpired; } /** @@ -105,7 +102,7 @@ public static class Builder { /** * Setter for result. - * @param result Object value for result. + * @param result Object value for result. * @return Builder */ public Builder result(Object result) { @@ -115,7 +112,7 @@ public Builder result(Object result) { /** * Setter for setOrExpired. - * @param setOrExpired Boolean value for setOrExpired. + * @param setOrExpired Boolean value for setOrExpired. * @return Builder */ public Builder setOrExpired(Boolean setOrExpired) { diff --git a/src/main/java/com/bandwidth/messaging/models/Media.java b/src/main/java/com/bandwidth/messaging/models/Media.java index be4d0197..a6281ee3 100644 --- a/src/main/java/com/bandwidth/messaging/models/Media.java +++ b/src/main/java/com/bandwidth/messaging/models/Media.java @@ -7,19 +7,23 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; +import java.util.List; /** * This is a model class for Media type. */ public class Media { - @JsonInclude(JsonInclude.Include.NON_NULL) + private Object inputStream; private String content; - @JsonInclude(JsonInclude.Include.NON_NULL) - private Integer contentLength; - @JsonInclude(JsonInclude.Include.NON_NULL) + private String url; + private String contentLength; + private String contentType; + private List tags; + private String userId; private String mediaName; + private String mediaId; + private String cacheControl; /** * Default constructor. @@ -29,17 +33,56 @@ public Media() { /** * Initialization constructor. - * @param content String value for content. - * @param contentLength Integer value for contentLength. - * @param mediaName String value for mediaName. + * @param inputStream Object value for inputStream. + * @param content String value for content. + * @param url String value for url. + * @param contentLength String value for contentLength. + * @param contentType String value for contentType. + * @param tags List of Tag value for tags. + * @param userId String value for userId. + * @param mediaName String value for mediaName. + * @param mediaId String value for mediaId. + * @param cacheControl String value for cacheControl. */ public Media( + Object inputStream, String content, - Integer contentLength, - String mediaName) { + String url, + String contentLength, + String contentType, + List tags, + String userId, + String mediaName, + String mediaId, + String cacheControl) { + this.inputStream = inputStream; this.content = content; + this.url = url; this.contentLength = contentLength; + this.contentType = contentType; + this.tags = tags; + this.userId = userId; this.mediaName = mediaName; + this.mediaId = mediaId; + this.cacheControl = cacheControl; + } + + /** + * Getter for InputStream. + * @return Returns the Object + */ + @JsonGetter("inputStream") + public Object getInputStream() { + return this.inputStream; + } + + /** + * Setter for InputStream. + * @param inputStream Value for Object + */ + @JsonSetter("inputStream") + public void setInputStream(Object inputStream) { + this.inputStream = inputStream; } /** @@ -48,7 +91,7 @@ public Media( */ @JsonGetter("content") public String getContent() { - return content; + return this.content; } /** @@ -60,31 +103,105 @@ public void setContent(String content) { this.content = content; } + /** + * Getter for Url. + * @return Returns the String + */ + @JsonGetter("url") + public String getUrl() { + return this.url; + } + + /** + * Setter for Url. + * @param url Value for String + */ + @JsonSetter("url") + public void setUrl(String url) { + this.url = url; + } + /** * Getter for ContentLength. - * @return Returns the Integer + * @return Returns the String */ @JsonGetter("contentLength") - public Integer getContentLength() { - return contentLength; + public String getContentLength() { + return this.contentLength; } /** * Setter for ContentLength. - * @param contentLength Value for Integer + * @param contentLength Value for String */ @JsonSetter("contentLength") - public void setContentLength(Integer contentLength) { + public void setContentLength(String contentLength) { this.contentLength = contentLength; } + /** + * Getter for ContentType. + * @return Returns the String + */ + @JsonGetter("contentType") + public String getContentType() { + return this.contentType; + } + + /** + * Setter for ContentType. + * @param contentType Value for String + */ + @JsonSetter("contentType") + public void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Getter for Tags. + * @return Returns the List of Tag + */ + @JsonGetter("tags") + public List getTags() { + return this.tags; + } + + /** + * Setter for Tags. + * @param tags Value for List of Tag + */ + @JsonSetter("tags") + public void setTags(List tags) { + this.tags = tags; + } + + /** + * Getter for UserId. + * User's account ID + * @return Returns the String + */ + @JsonGetter("userId") + public String getUserId() { + return this.userId; + } + + /** + * Setter for UserId. + * User's account ID + * @param userId Value for String + */ + @JsonSetter("userId") + public void setUserId(String userId) { + this.userId = userId; + } + /** * Getter for MediaName. * @return Returns the String */ @JsonGetter("mediaName") public String getMediaName() { - return mediaName; + return this.mediaName; } /** @@ -96,14 +213,52 @@ public void setMediaName(String mediaName) { this.mediaName = mediaName; } + /** + * Getter for MediaId. + * @return Returns the String + */ + @JsonGetter("mediaId") + public String getMediaId() { + return this.mediaId; + } + + /** + * Setter for MediaId. + * @param mediaId Value for String + */ + @JsonSetter("mediaId") + public void setMediaId(String mediaId) { + this.mediaId = mediaId; + } + + /** + * Getter for CacheControl. + * @return Returns the String + */ + @JsonGetter("cacheControl") + public String getCacheControl() { + return this.cacheControl; + } + + /** + * Setter for CacheControl. + * @param cacheControl Value for String + */ + @JsonSetter("cacheControl") + public void setCacheControl(String cacheControl) { + this.cacheControl = cacheControl; + } + /** * Converts this Media into string format. * @return String representation of this class */ @Override public String toString() { - return "Media [" + "content=" + content + ", contentLength=" + contentLength - + ", mediaName=" + mediaName + "]"; + return "Media [" + "inputStream=" + inputStream + ", content=" + content + ", url=" + url + + ", contentLength=" + contentLength + ", contentType=" + contentType + ", tags=" + + tags + ", userId=" + userId + ", mediaName=" + mediaName + ", mediaId=" + mediaId + + ", cacheControl=" + cacheControl + "]"; } /** @@ -113,9 +268,16 @@ public String toString() { */ public Builder toBuilder() { Builder builder = new Builder() + .inputStream(getInputStream()) .content(getContent()) + .url(getUrl()) .contentLength(getContentLength()) - .mediaName(getMediaName()); + .contentType(getContentType()) + .tags(getTags()) + .userId(getUserId()) + .mediaName(getMediaName()) + .mediaId(getMediaId()) + .cacheControl(getCacheControl()); return builder; } @@ -123,15 +285,32 @@ public Builder toBuilder() { * Class to build instances of {@link Media}. */ public static class Builder { + private Object inputStream; private String content; - private Integer contentLength; + private String url; + private String contentLength; + private String contentType; + private List tags; + private String userId; private String mediaName; + private String mediaId; + private String cacheControl; + /** + * Setter for inputStream. + * @param inputStream Object value for inputStream. + * @return Builder + */ + public Builder inputStream(Object inputStream) { + this.inputStream = inputStream; + return this; + } + /** * Setter for content. - * @param content String value for content. + * @param content String value for content. * @return Builder */ public Builder content(String content) { @@ -139,19 +318,59 @@ public Builder content(String content) { return this; } + /** + * Setter for url. + * @param url String value for url. + * @return Builder + */ + public Builder url(String url) { + this.url = url; + return this; + } + /** * Setter for contentLength. - * @param contentLength Integer value for contentLength. + * @param contentLength String value for contentLength. * @return Builder */ - public Builder contentLength(Integer contentLength) { + public Builder contentLength(String contentLength) { this.contentLength = contentLength; return this; } + /** + * Setter for contentType. + * @param contentType String value for contentType. + * @return Builder + */ + public Builder contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Setter for tags. + * @param tags List of Tag value for tags. + * @return Builder + */ + public Builder tags(List tags) { + this.tags = tags; + return this; + } + + /** + * Setter for userId. + * @param userId String value for userId. + * @return Builder + */ + public Builder userId(String userId) { + this.userId = userId; + return this; + } + /** * Setter for mediaName. - * @param mediaName String value for mediaName. + * @param mediaName String value for mediaName. * @return Builder */ public Builder mediaName(String mediaName) { @@ -159,12 +378,33 @@ public Builder mediaName(String mediaName) { return this; } + /** + * Setter for mediaId. + * @param mediaId String value for mediaId. + * @return Builder + */ + public Builder mediaId(String mediaId) { + this.mediaId = mediaId; + return this; + } + + /** + * Setter for cacheControl. + * @param cacheControl String value for cacheControl. + * @return Builder + */ + public Builder cacheControl(String cacheControl) { + this.cacheControl = cacheControl; + return this; + } + /** * Builds a new {@link Media} object using the set fields. * @return {@link Media} */ public Media build() { - return new Media(content, contentLength, mediaName); + return new Media(inputStream, content, url, contentLength, contentType, tags, userId, + mediaName, mediaId, cacheControl); } } } diff --git a/src/main/java/com/bandwidth/messaging/models/MessageRequest.java b/src/main/java/com/bandwidth/messaging/models/MessageRequest.java index ad488e06..19817550 100644 --- a/src/main/java/com/bandwidth/messaging/models/MessageRequest.java +++ b/src/main/java/com/bandwidth/messaging/models/MessageRequest.java @@ -7,7 +7,6 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import java.util.List; @@ -18,13 +17,9 @@ public class MessageRequest { private String applicationId; private List to; private String from; - @JsonInclude(JsonInclude.Include.NON_NULL) private String text; - @JsonInclude(JsonInclude.Include.NON_NULL) private List media; - @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; - @JsonInclude(JsonInclude.Include.NON_NULL) private PriorityEnum priority; /** @@ -35,13 +30,13 @@ public MessageRequest() { /** * Initialization constructor. - * @param applicationId String value for applicationId. - * @param to List of String value for to. - * @param from String value for from. - * @param text String value for text. - * @param media List of String value for media. - * @param tag String value for tag. - * @param priority PriorityEnum value for priority. + * @param applicationId String value for applicationId. + * @param to List of String value for to. + * @param from String value for from. + * @param text String value for text. + * @param media List of String value for media. + * @param tag String value for tag. + * @param priority PriorityEnum value for priority. */ public MessageRequest( String applicationId, @@ -68,7 +63,7 @@ public MessageRequest( */ @JsonGetter("applicationId") public String getApplicationId() { - return applicationId; + return this.applicationId; } /** @@ -89,7 +84,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("to") public List getTo() { - return to; + return this.to; } /** @@ -109,7 +104,7 @@ public void setTo(List to) { */ @JsonGetter("from") public String getFrom() { - return from; + return this.from; } /** @@ -129,7 +124,7 @@ public void setFrom(String from) { */ @JsonGetter("text") public String getText() { - return text; + return this.text; } /** @@ -149,7 +144,7 @@ public void setText(String text) { */ @JsonGetter("media") public List getMedia() { - return media; + return this.media; } /** @@ -169,7 +164,7 @@ public void setMedia(List media) { */ @JsonGetter("tag") public String getTag() { - return tag; + return this.tag; } /** @@ -190,7 +185,7 @@ public void setTag(String tag) { */ @JsonGetter("priority") public PriorityEnum getPriority() { - return priority; + return this.priority; } /** @@ -249,11 +244,13 @@ public Builder() { /** * Initialization constructor. - * @param applicationId String value for applicationId. - * @param to List of String value for to. - * @param from String value for from. + * @param applicationId String value for applicationId. + * @param to List of String value for to. + * @param from String value for from. */ - public Builder(String applicationId, List to, String from) { + public Builder(String applicationId, + List to, + String from) { this.applicationId = applicationId; this.to = to; this.from = from; @@ -261,7 +258,7 @@ public Builder(String applicationId, List to, String from) { /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -271,7 +268,7 @@ public Builder applicationId(String applicationId) { /** * Setter for to. - * @param to List of String value for to. + * @param to List of String value for to. * @return Builder */ public Builder to(List to) { @@ -281,7 +278,7 @@ public Builder to(List to) { /** * Setter for from. - * @param from String value for from. + * @param from String value for from. * @return Builder */ public Builder from(String from) { @@ -291,7 +288,7 @@ public Builder from(String from) { /** * Setter for text. - * @param text String value for text. + * @param text String value for text. * @return Builder */ public Builder text(String text) { @@ -301,7 +298,7 @@ public Builder text(String text) { /** * Setter for media. - * @param media List of String value for media. + * @param media List of String value for media. * @return Builder */ public Builder media(List media) { @@ -311,7 +308,7 @@ public Builder media(List media) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { @@ -321,7 +318,7 @@ public Builder tag(String tag) { /** * Setter for priority. - * @param priority PriorityEnum value for priority. + * @param priority PriorityEnum value for priority. * @return Builder */ public Builder priority(PriorityEnum priority) { diff --git a/src/main/java/com/bandwidth/messaging/models/PageInfo.java b/src/main/java/com/bandwidth/messaging/models/PageInfo.java index 82c907b1..70d01c36 100644 --- a/src/main/java/com/bandwidth/messaging/models/PageInfo.java +++ b/src/main/java/com/bandwidth/messaging/models/PageInfo.java @@ -7,20 +7,15 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for PageInfo type. */ public class PageInfo { - @JsonInclude(JsonInclude.Include.NON_NULL) private String prevPage; - @JsonInclude(JsonInclude.Include.NON_NULL) private String nextPage; - @JsonInclude(JsonInclude.Include.NON_NULL) private String prevPageToken; - @JsonInclude(JsonInclude.Include.NON_NULL) private String nextPageToken; /** @@ -31,10 +26,10 @@ public PageInfo() { /** * Initialization constructor. - * @param prevPage String value for prevPage. - * @param nextPage String value for nextPage. - * @param prevPageToken String value for prevPageToken. - * @param nextPageToken String value for nextPageToken. + * @param prevPage String value for prevPage. + * @param nextPage String value for nextPage. + * @param prevPageToken String value for prevPageToken. + * @param nextPageToken String value for nextPageToken. */ public PageInfo( String prevPage, @@ -54,7 +49,7 @@ public PageInfo( */ @JsonGetter("prevPage") public String getPrevPage() { - return prevPage; + return this.prevPage; } /** @@ -74,7 +69,7 @@ public void setPrevPage(String prevPage) { */ @JsonGetter("nextPage") public String getNextPage() { - return nextPage; + return this.nextPage; } /** @@ -94,7 +89,7 @@ public void setNextPage(String nextPage) { */ @JsonGetter("prevPageToken") public String getPrevPageToken() { - return prevPageToken; + return this.prevPageToken; } /** @@ -114,7 +109,7 @@ public void setPrevPageToken(String prevPageToken) { */ @JsonGetter("nextPageToken") public String getNextPageToken() { - return nextPageToken; + return this.nextPageToken; } /** @@ -164,7 +159,7 @@ public static class Builder { /** * Setter for prevPage. - * @param prevPage String value for prevPage. + * @param prevPage String value for prevPage. * @return Builder */ public Builder prevPage(String prevPage) { @@ -174,7 +169,7 @@ public Builder prevPage(String prevPage) { /** * Setter for nextPage. - * @param nextPage String value for nextPage. + * @param nextPage String value for nextPage. * @return Builder */ public Builder nextPage(String nextPage) { @@ -184,7 +179,7 @@ public Builder nextPage(String nextPage) { /** * Setter for prevPageToken. - * @param prevPageToken String value for prevPageToken. + * @param prevPageToken String value for prevPageToken. * @return Builder */ public Builder prevPageToken(String prevPageToken) { @@ -194,7 +189,7 @@ public Builder prevPageToken(String prevPageToken) { /** * Setter for nextPageToken. - * @param nextPageToken String value for nextPageToken. + * @param nextPageToken String value for nextPageToken. * @return Builder */ public Builder nextPageToken(String nextPageToken) { diff --git a/src/main/java/com/bandwidth/messaging/models/Tag.java b/src/main/java/com/bandwidth/messaging/models/Tag.java index 77ff1ac7..6b1751d2 100644 --- a/src/main/java/com/bandwidth/messaging/models/Tag.java +++ b/src/main/java/com/bandwidth/messaging/models/Tag.java @@ -7,16 +7,13 @@ package com.bandwidth.messaging.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for Tag type. */ public class Tag { - @JsonInclude(JsonInclude.Include.NON_NULL) private String key; - @JsonInclude(JsonInclude.Include.NON_NULL) private String value; /** @@ -27,8 +24,8 @@ public Tag() { /** * Initialization constructor. - * @param key String value for key. - * @param value String value for value. + * @param key String value for key. + * @param value String value for value. */ public Tag( String key, @@ -43,7 +40,7 @@ public Tag( */ @JsonGetter("key") public String getKey() { - return key; + return this.key; } /** @@ -61,7 +58,7 @@ public void setKey(String key) { */ @JsonGetter("value") public String getValue() { - return value; + return this.value; } /** @@ -105,7 +102,7 @@ public static class Builder { /** * Setter for key. - * @param key String value for key. + * @param key String value for key. * @return Builder */ public Builder key(String key) { @@ -115,7 +112,7 @@ public Builder key(String key) { /** * Setter for value. - * @param value String value for value. + * @param value String value for value. * @return Builder */ public Builder value(String value) { diff --git a/src/main/java/com/bandwidth/multifactorauth/models/ErrorWithRequest.java b/src/main/java/com/bandwidth/multifactorauth/models/ErrorWithRequest.java deleted file mode 100644 index 8a390564..00000000 --- a/src/main/java/com/bandwidth/multifactorauth/models/ErrorWithRequest.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * BandwidthLib - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -package com.bandwidth.multifactorauth.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSetter; - -/** - * This is a model class for ErrorWithRequest type. - */ -public class ErrorWithRequest { - @JsonInclude(JsonInclude.Include.NON_NULL) - private String error; - @JsonInclude(JsonInclude.Include.NON_NULL) - private String requestId; - - /** - * Default constructor. - */ - public ErrorWithRequest() { - } - - /** - * Initialization constructor. - * @param error String value for error. - * @param requestId String value for requestId. - */ - public ErrorWithRequest( - String error, - String requestId) { - this.error = error; - this.requestId = requestId; - } - - /** - * Getter for Error. - * An error message pertaining to what the issue could be - * @return Returns the String - */ - @JsonGetter("error") - public String getError() { - return error; - } - - /** - * Setter for Error. - * An error message pertaining to what the issue could be - * @param error Value for String - */ - @JsonSetter("error") - public void setError(String error) { - this.error = error; - } - - /** - * Getter for RequestId. - * The associated requestId from AWS - * @return Returns the String - */ - @JsonGetter("requestId") - public String getRequestId() { - return requestId; - } - - /** - * Setter for RequestId. - * The associated requestId from AWS - * @param requestId Value for String - */ - @JsonSetter("requestId") - public void setRequestId(String requestId) { - this.requestId = requestId; - } - - /** - * Converts this ErrorWithRequest into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "ErrorWithRequest [" + "error=" + error + ", requestId=" + requestId + "]"; - } - - /** - * Builds a new {@link ErrorWithRequest.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link ErrorWithRequest.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .error(getError()) - .requestId(getRequestId()); - return builder; - } - - /** - * Class to build instances of {@link ErrorWithRequest}. - */ - public static class Builder { - private String error; - private String requestId; - - - - /** - * Setter for error. - * @param error String value for error. - * @return Builder - */ - public Builder error(String error) { - this.error = error; - return this; - } - - /** - * Setter for requestId. - * @param requestId String value for requestId. - * @return Builder - */ - public Builder requestId(String requestId) { - this.requestId = requestId; - return this; - } - - /** - * Builds a new {@link ErrorWithRequest} object using the set fields. - * @return {@link ErrorWithRequest} - */ - public ErrorWithRequest build() { - return new ErrorWithRequest(error, requestId); - } - } -} diff --git a/src/main/java/com/bandwidth/multifactorauth/models/ForbiddenRequest.java b/src/main/java/com/bandwidth/multifactorauth/models/ForbiddenRequest.java deleted file mode 100644 index 7efe750c..00000000 --- a/src/main/java/com/bandwidth/multifactorauth/models/ForbiddenRequest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * BandwidthLib - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -package com.bandwidth.multifactorauth.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSetter; - -/** - * This is a model class for ForbiddenRequest type. - */ -public class ForbiddenRequest { - @JsonInclude(JsonInclude.Include.NON_NULL) - private String message; - - /** - * Default constructor. - */ - public ForbiddenRequest() { - } - - /** - * Initialization constructor. - * @param message String value for message. - */ - public ForbiddenRequest( - String message) { - this.message = message; - } - - /** - * Getter for Message. - * The message containing the reason behind the request being forbidden - * @return Returns the String - */ - @JsonGetter("Message") - public String getMessage() { - return message; - } - - /** - * Setter for Message. - * The message containing the reason behind the request being forbidden - * @param message Value for String - */ - @JsonSetter("Message") - public void setMessage(String message) { - this.message = message; - } - - /** - * Converts this ForbiddenRequest into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "ForbiddenRequest [" + "message=" + message + "]"; - } - - /** - * Builds a new {@link ForbiddenRequest.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link ForbiddenRequest.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .message(getMessage()); - return builder; - } - - /** - * Class to build instances of {@link ForbiddenRequest}. - */ - public static class Builder { - private String message; - - - - /** - * Setter for message. - * @param message String value for message. - * @return Builder - */ - public Builder message(String message) { - this.message = message; - return this; - } - - /** - * Builds a new {@link ForbiddenRequest} object using the set fields. - * @return {@link ForbiddenRequest} - */ - public ForbiddenRequest build() { - return new ForbiddenRequest(message); - } - } -} diff --git a/src/main/java/com/bandwidth/multifactorauth/models/UnauthorizedRequest.java b/src/main/java/com/bandwidth/multifactorauth/models/UnauthorizedRequest.java deleted file mode 100644 index eec532bd..00000000 --- a/src/main/java/com/bandwidth/multifactorauth/models/UnauthorizedRequest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * BandwidthLib - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -package com.bandwidth.multifactorauth.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSetter; - -/** - * This is a model class for UnauthorizedRequest type. - */ -public class UnauthorizedRequest { - @JsonInclude(JsonInclude.Include.NON_NULL) - private String message; - - /** - * Default constructor. - */ - public UnauthorizedRequest() { - } - - /** - * Initialization constructor. - * @param message String value for message. - */ - public UnauthorizedRequest( - String message) { - this.message = message; - } - - /** - * Getter for Message. - * The message containing the reason behind the request being unauthorized - * @return Returns the String - */ - @JsonGetter("message") - public String getMessage() { - return message; - } - - /** - * Setter for Message. - * The message containing the reason behind the request being unauthorized - * @param message Value for String - */ - @JsonSetter("message") - public void setMessage(String message) { - this.message = message; - } - - /** - * Converts this UnauthorizedRequest into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "UnauthorizedRequest [" + "message=" + message + "]"; - } - - /** - * Builds a new {@link UnauthorizedRequest.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link UnauthorizedRequest.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .message(getMessage()); - return builder; - } - - /** - * Class to build instances of {@link UnauthorizedRequest}. - */ - public static class Builder { - private String message; - - - - /** - * Setter for message. - * @param message String value for message. - * @return Builder - */ - public Builder message(String message) { - this.message = message; - return this; - } - - /** - * Builds a new {@link UnauthorizedRequest} object using the set fields. - * @return {@link UnauthorizedRequest} - */ - public UnauthorizedRequest build() { - return new UnauthorizedRequest(message); - } - } -} diff --git a/src/main/java/com/bandwidth/multifactorauth/controllers/MFAController.java b/src/main/java/com/bandwidth/twofactorauth/controllers/MFAController.java similarity index 83% rename from src/main/java/com/bandwidth/multifactorauth/controllers/MFAController.java rename to src/main/java/com/bandwidth/twofactorauth/controllers/MFAController.java index bf7f0244..2d3ee34b 100644 --- a/src/main/java/com/bandwidth/multifactorauth/controllers/MFAController.java +++ b/src/main/java/com/bandwidth/twofactorauth/controllers/MFAController.java @@ -4,7 +4,7 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.multifactorauth.controllers; +package com.bandwidth.twofactorauth.controllers; import com.bandwidth.ApiHelper; import com.bandwidth.AuthManager; @@ -20,14 +20,14 @@ import com.bandwidth.http.response.ApiResponse; import com.bandwidth.http.response.HttpResponse; import com.bandwidth.http.response.HttpStringResponse; -import com.bandwidth.multifactorauth.exceptions.ErrorWithRequestErrorException; -import com.bandwidth.multifactorauth.exceptions.ForbiddenRequestErrorException; -import com.bandwidth.multifactorauth.exceptions.UnauthorizedRequestErrorException; -import com.bandwidth.multifactorauth.models.TwoFactorCodeRequestSchema; -import com.bandwidth.multifactorauth.models.TwoFactorMessagingResponse; -import com.bandwidth.multifactorauth.models.TwoFactorVerifyCodeResponse; -import com.bandwidth.multifactorauth.models.TwoFactorVerifyRequestSchema; -import com.bandwidth.multifactorauth.models.TwoFactorVoiceResponse; +import com.bandwidth.twofactorauth.exceptions.ErrorWithRequestException; +import com.bandwidth.twofactorauth.exceptions.ForbiddenRequestException; +import com.bandwidth.twofactorauth.exceptions.UnauthorizedRequestException; +import com.bandwidth.twofactorauth.models.TwoFactorCodeRequestSchema; +import com.bandwidth.twofactorauth.models.TwoFactorMessagingResponse; +import com.bandwidth.twofactorauth.models.TwoFactorVerifyCodeResponse; +import com.bandwidth.twofactorauth.models.TwoFactorVerifyRequestSchema; +import com.bandwidth.twofactorauth.models.TwoFactorVoiceResponse; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import java.util.AbstractMap.SimpleEntry; @@ -75,7 +75,7 @@ public ApiResponse createVoiceTwoFactor( final String accountId, final TwoFactorCodeRequestSchema body) throws ApiException, IOException { HttpRequest request = buildCreateVoiceTwoFactorRequest(accountId, body); - authManagers.get("multiFactorAuth").apply(request); + authManagers.get("twoFactorAuth").apply(request); HttpResponse response = getClientInstance().executeAsString(request); HttpContext context = new HttpContext(request, response); @@ -93,7 +93,7 @@ public CompletableFuture> createVoiceTwoFact final String accountId, final TwoFactorCodeRequestSchema body) { return makeHttpCallAsync(() -> buildCreateVoiceTwoFactorRequest(accountId, body), - req -> authManagers.get("multiFactorAuth").applyAsync(req) + req -> authManagers.get("twoFactorAuth").applyAsync(req) .thenCompose(request -> getClientInstance() .executeAsStringAsync(request)), context -> handleCreateVoiceTwoFactorResponse(context)); @@ -106,7 +106,7 @@ private HttpRequest buildCreateVoiceTwoFactorRequest( final String accountId, final TwoFactorCodeRequestSchema body) throws JsonProcessingException { //the base uri for api requests - String baseUri = config.getBaseUri(Server.MULTIFACTORAUTHDEFAULT); + String baseUri = config.getBaseUri(Server.TWOFACTORAUTHDEFAULT); //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri @@ -153,16 +153,16 @@ private ApiResponse handleCreateVoiceTwoFactorResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ErrorWithRequestErrorException("If there is any issue with values passed in by the user", context); + throw new ErrorWithRequestException("If there is any issue with values passed in by the user", context); } if (responseCode == 401) { - throw new UnauthorizedRequestErrorException("Authentication is either incorrect or not present", context); + throw new UnauthorizedRequestException("Authentication is either incorrect or not present", context); } if (responseCode == 403) { - throw new ForbiddenRequestErrorException("The user is not authorized to access this resource", context); + throw new ForbiddenRequestException("The user is not authorized to access this resource", context); } if (responseCode == 500) { - throw new ErrorWithRequestErrorException("An internal server error occurred", context); + throw new ErrorWithRequestException("An internal server error occurred", context); } //handle errors defined at the API level validateResponse(response, context); @@ -187,7 +187,7 @@ public ApiResponse createMessagingTwoFactor( final String accountId, final TwoFactorCodeRequestSchema body) throws ApiException, IOException { HttpRequest request = buildCreateMessagingTwoFactorRequest(accountId, body); - authManagers.get("multiFactorAuth").apply(request); + authManagers.get("twoFactorAuth").apply(request); HttpResponse response = getClientInstance().executeAsString(request); HttpContext context = new HttpContext(request, response); @@ -205,7 +205,7 @@ public CompletableFuture> createMessagin final String accountId, final TwoFactorCodeRequestSchema body) { return makeHttpCallAsync(() -> buildCreateMessagingTwoFactorRequest(accountId, body), - req -> authManagers.get("multiFactorAuth").applyAsync(req) + req -> authManagers.get("twoFactorAuth").applyAsync(req) .thenCompose(request -> getClientInstance() .executeAsStringAsync(request)), context -> handleCreateMessagingTwoFactorResponse(context)); @@ -218,7 +218,7 @@ private HttpRequest buildCreateMessagingTwoFactorRequest( final String accountId, final TwoFactorCodeRequestSchema body) throws JsonProcessingException { //the base uri for api requests - String baseUri = config.getBaseUri(Server.MULTIFACTORAUTHDEFAULT); + String baseUri = config.getBaseUri(Server.TWOFACTORAUTHDEFAULT); //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri @@ -265,16 +265,16 @@ private ApiResponse handleCreateMessagingTwoFactorRe int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ErrorWithRequestErrorException("If there is any issue with values passed in by the user", context); + throw new ErrorWithRequestException("If there is any issue with values passed in by the user", context); } if (responseCode == 401) { - throw new UnauthorizedRequestErrorException("Authentication is either incorrect or not present", context); + throw new UnauthorizedRequestException("Authentication is either incorrect or not present", context); } if (responseCode == 403) { - throw new ForbiddenRequestErrorException("The user is not authorized to access this resource", context); + throw new ForbiddenRequestException("The user is not authorized to access this resource", context); } if (responseCode == 500) { - throw new ErrorWithRequestErrorException("An internal server error occurred", context); + throw new ErrorWithRequestException("An internal server error occurred", context); } //handle errors defined at the API level validateResponse(response, context); @@ -299,7 +299,7 @@ public ApiResponse createVerifyTwoFactor( final String accountId, final TwoFactorVerifyRequestSchema body) throws ApiException, IOException { HttpRequest request = buildCreateVerifyTwoFactorRequest(accountId, body); - authManagers.get("multiFactorAuth").apply(request); + authManagers.get("twoFactorAuth").apply(request); HttpResponse response = getClientInstance().executeAsString(request); HttpContext context = new HttpContext(request, response); @@ -317,7 +317,7 @@ public CompletableFuture> createVerifyT final String accountId, final TwoFactorVerifyRequestSchema body) { return makeHttpCallAsync(() -> buildCreateVerifyTwoFactorRequest(accountId, body), - req -> authManagers.get("multiFactorAuth").applyAsync(req) + req -> authManagers.get("twoFactorAuth").applyAsync(req) .thenCompose(request -> getClientInstance() .executeAsStringAsync(request)), context -> handleCreateVerifyTwoFactorResponse(context)); @@ -330,7 +330,7 @@ private HttpRequest buildCreateVerifyTwoFactorRequest( final String accountId, final TwoFactorVerifyRequestSchema body) throws JsonProcessingException { //the base uri for api requests - String baseUri = config.getBaseUri(Server.MULTIFACTORAUTHDEFAULT); + String baseUri = config.getBaseUri(Server.TWOFACTORAUTHDEFAULT); //prepare query string for API call final StringBuilder queryBuilder = new StringBuilder(baseUri @@ -377,19 +377,19 @@ private ApiResponse handleCreateVerifyTwoFactorResp int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ErrorWithRequestErrorException("If there is any issue with values passed in by the user", context); + throw new ErrorWithRequestException("If there is any issue with values passed in by the user", context); } if (responseCode == 401) { - throw new UnauthorizedRequestErrorException("Authentication is either incorrect or not present", context); + throw new UnauthorizedRequestException("Authentication is either incorrect or not present", context); } if (responseCode == 403) { - throw new ForbiddenRequestErrorException("The user is not authorized to access this resource", context); + throw new ForbiddenRequestException("The user is not authorized to access this resource", context); } if (responseCode == 429) { - throw new ErrorWithRequestErrorException("The user has made too many bad requests and is temporarily locked out", context); + throw new ErrorWithRequestException("The user has made too many bad requests and is temporarily locked out", context); } if (responseCode == 500) { - throw new ErrorWithRequestErrorException("An internal server error occurred", context); + throw new ErrorWithRequestException("An internal server error occurred", context); } //handle errors defined at the API level validateResponse(response, context); diff --git a/src/main/java/com/bandwidth/multifactorauth/exceptions/ErrorWithRequestErrorException.java b/src/main/java/com/bandwidth/twofactorauth/exceptions/ErrorWithRequestException.java similarity index 64% rename from src/main/java/com/bandwidth/multifactorauth/exceptions/ErrorWithRequestErrorException.java rename to src/main/java/com/bandwidth/twofactorauth/exceptions/ErrorWithRequestException.java index 6dca1f48..2e00e4ea 100644 --- a/src/main/java/com/bandwidth/multifactorauth/exceptions/ErrorWithRequestErrorException.java +++ b/src/main/java/com/bandwidth/twofactorauth/exceptions/ErrorWithRequestException.java @@ -4,7 +4,7 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.multifactorauth.exceptions; +package com.bandwidth.twofactorauth.exceptions; import com.bandwidth.exceptions.ApiException; import com.bandwidth.http.client.HttpContext; @@ -12,11 +12,11 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for ErrorWithRequestErrorException type. + * This is a model class for ErrorWithRequestException type. */ -public class ErrorWithRequestErrorException +public class ErrorWithRequestException extends ApiException { - private static final long serialVersionUID = 665861110067566032L; + private static final long serialVersionUID = -2207935819585830921L; private String error; private String requestId; @@ -25,7 +25,7 @@ public class ErrorWithRequestErrorException * @param reason The reason for throwing exception * @param context The http context of the API exception */ - public ErrorWithRequestErrorException(String reason, HttpContext context) { + public ErrorWithRequestException(String reason, HttpContext context) { super(reason, context); } @@ -33,7 +33,7 @@ public ErrorWithRequestErrorException(String reason, HttpContext context) { /** * Getter for Error. * An error message pertaining to what the issue could be - * @return Returns the String + * @return Returns the String */ @JsonGetter("error") public String getError() { @@ -43,17 +43,17 @@ public String getError() { /** * Setter for Error. * An error message pertaining to what the issue could be - * @param error Value for String + * @param value Value for String */ @JsonSetter("error") - private void setError(String error) { - this.error = error; + private void setError(String value) { + this.error = value; } /** * Getter for RequestId. * The associated requestId from AWS - * @return Returns the String + * @return Returns the String */ @JsonGetter("requestId") public String getRequestId() { @@ -63,10 +63,10 @@ public String getRequestId() { /** * Setter for RequestId. * The associated requestId from AWS - * @param requestId Value for String + * @param value Value for String */ @JsonSetter("requestId") - private void setRequestId(String requestId) { - this.requestId = requestId; + private void setRequestId(String value) { + this.requestId = value; } } diff --git a/src/main/java/com/bandwidth/multifactorauth/exceptions/ForbiddenRequestErrorException.java b/src/main/java/com/bandwidth/twofactorauth/exceptions/ForbiddenRequestException.java similarity index 65% rename from src/main/java/com/bandwidth/multifactorauth/exceptions/ForbiddenRequestErrorException.java rename to src/main/java/com/bandwidth/twofactorauth/exceptions/ForbiddenRequestException.java index 33dde3f3..4c7d1155 100644 --- a/src/main/java/com/bandwidth/multifactorauth/exceptions/ForbiddenRequestErrorException.java +++ b/src/main/java/com/bandwidth/twofactorauth/exceptions/ForbiddenRequestException.java @@ -4,7 +4,7 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.multifactorauth.exceptions; +package com.bandwidth.twofactorauth.exceptions; import com.bandwidth.exceptions.ApiException; import com.bandwidth.http.client.HttpContext; @@ -12,11 +12,11 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for ForbiddenRequestErrorException type. + * This is a model class for ForbiddenRequestException type. */ -public class ForbiddenRequestErrorException +public class ForbiddenRequestException extends ApiException { - private static final long serialVersionUID = -90785364203660723L; + private static final long serialVersionUID = 41606914026773976L; private String message; /** @@ -24,7 +24,7 @@ public class ForbiddenRequestErrorException * @param reason The reason for throwing exception * @param context The http context of the API exception */ - public ForbiddenRequestErrorException(String reason, HttpContext context) { + public ForbiddenRequestException(String reason, HttpContext context) { super(reason, context); } @@ -32,7 +32,7 @@ public ForbiddenRequestErrorException(String reason, HttpContext context) { /** * Getter for Message. * The message containing the reason behind the request being forbidden - * @return Returns the String + * @return Returns the String */ @JsonGetter("Message") public String getMessage() { @@ -42,10 +42,10 @@ public String getMessage() { /** * Setter for Message. * The message containing the reason behind the request being forbidden - * @param message Value for String + * @param value Value for String */ @JsonSetter("Message") - private void setMessage(String message) { - this.message = message; + private void setMessage(String value) { + this.message = value; } } diff --git a/src/main/java/com/bandwidth/multifactorauth/exceptions/UnauthorizedRequestErrorException.java b/src/main/java/com/bandwidth/twofactorauth/exceptions/UnauthorizedRequestException.java similarity index 64% rename from src/main/java/com/bandwidth/multifactorauth/exceptions/UnauthorizedRequestErrorException.java rename to src/main/java/com/bandwidth/twofactorauth/exceptions/UnauthorizedRequestException.java index a61eb8ef..436cd1c7 100644 --- a/src/main/java/com/bandwidth/multifactorauth/exceptions/UnauthorizedRequestErrorException.java +++ b/src/main/java/com/bandwidth/twofactorauth/exceptions/UnauthorizedRequestException.java @@ -4,7 +4,7 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.multifactorauth.exceptions; +package com.bandwidth.twofactorauth.exceptions; import com.bandwidth.exceptions.ApiException; import com.bandwidth.http.client.HttpContext; @@ -12,11 +12,11 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for UnauthorizedRequestErrorException type. + * This is a model class for UnauthorizedRequestException type. */ -public class UnauthorizedRequestErrorException +public class UnauthorizedRequestException extends ApiException { - private static final long serialVersionUID = -36139398783316808L; + private static final long serialVersionUID = -43402636942119755L; private String message; /** @@ -24,7 +24,7 @@ public class UnauthorizedRequestErrorException * @param reason The reason for throwing exception * @param context The http context of the API exception */ - public UnauthorizedRequestErrorException(String reason, HttpContext context) { + public UnauthorizedRequestException(String reason, HttpContext context) { super(reason, context); } @@ -32,7 +32,7 @@ public UnauthorizedRequestErrorException(String reason, HttpContext context) { /** * Getter for Message. * The message containing the reason behind the request being unauthorized - * @return Returns the String + * @return Returns the String */ @JsonGetter("message") public String getMessage() { @@ -42,10 +42,10 @@ public String getMessage() { /** * Setter for Message. * The message containing the reason behind the request being unauthorized - * @param message Value for String + * @param value Value for String */ @JsonSetter("message") - private void setMessage(String message) { - this.message = message; + private void setMessage(String value) { + this.message = value; } } diff --git a/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorCodeRequestSchema.java b/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorCodeRequestSchema.java similarity index 83% rename from src/main/java/com/bandwidth/multifactorauth/models/TwoFactorCodeRequestSchema.java rename to src/main/java/com/bandwidth/twofactorauth/models/TwoFactorCodeRequestSchema.java index 6f56f2b9..62390a0f 100644 --- a/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorCodeRequestSchema.java +++ b/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorCodeRequestSchema.java @@ -4,10 +4,9 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.multifactorauth.models; +package com.bandwidth.twofactorauth.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** @@ -17,7 +16,6 @@ public class TwoFactorCodeRequestSchema { private String to; private String from; private String applicationId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String scope; private String message; private double digits; @@ -30,12 +28,12 @@ public TwoFactorCodeRequestSchema() { /** * Initialization constructor. - * @param to String value for to. - * @param from String value for from. - * @param applicationId String value for applicationId. - * @param message String value for message. - * @param digits double value for digits. - * @param scope String value for scope. + * @param to String value for to. + * @param from String value for from. + * @param applicationId String value for applicationId. + * @param message String value for message. + * @param digits double value for digits. + * @param scope String value for scope. */ public TwoFactorCodeRequestSchema( String to, @@ -59,7 +57,7 @@ public TwoFactorCodeRequestSchema( */ @JsonGetter("to") public String getTo() { - return to; + return this.to; } /** @@ -79,7 +77,7 @@ public void setTo(String to) { */ @JsonGetter("from") public String getFrom() { - return from; + return this.from; } /** @@ -99,7 +97,7 @@ public void setFrom(String from) { */ @JsonGetter("applicationId") public String getApplicationId() { - return applicationId; + return this.applicationId; } /** @@ -120,7 +118,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("scope") public String getScope() { - return scope; + return this.scope; } /** @@ -145,7 +143,7 @@ public void setScope(String scope) { */ @JsonGetter("message") public String getMessage() { - return message; + return this.message; } /** @@ -169,7 +167,7 @@ public void setMessage(String message) { */ @JsonGetter("digits") public double getDigits() { - return digits; + return this.digits; } /** @@ -223,13 +221,16 @@ public Builder() { /** * Initialization constructor. - * @param to String value for to. - * @param from String value for from. - * @param applicationId String value for applicationId. - * @param message String value for message. - * @param digits double value for digits. + * @param to String value for to. + * @param from String value for from. + * @param applicationId String value for applicationId. + * @param message String value for message. + * @param digits double value for digits. */ - public Builder(String to, String from, String applicationId, String message, + public Builder(String to, + String from, + String applicationId, + String message, double digits) { this.to = to; this.from = from; @@ -240,7 +241,7 @@ public Builder(String to, String from, String applicationId, String message, /** * Setter for to. - * @param to String value for to. + * @param to String value for to. * @return Builder */ public Builder to(String to) { @@ -250,7 +251,7 @@ public Builder to(String to) { /** * Setter for from. - * @param from String value for from. + * @param from String value for from. * @return Builder */ public Builder from(String from) { @@ -260,7 +261,7 @@ public Builder from(String from) { /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -270,7 +271,7 @@ public Builder applicationId(String applicationId) { /** * Setter for message. - * @param message String value for message. + * @param message String value for message. * @return Builder */ public Builder message(String message) { @@ -280,7 +281,7 @@ public Builder message(String message) { /** * Setter for digits. - * @param digits double value for digits. + * @param digits double value for digits. * @return Builder */ public Builder digits(double digits) { @@ -290,7 +291,7 @@ public Builder digits(double digits) { /** * Setter for scope. - * @param scope String value for scope. + * @param scope String value for scope. * @return Builder */ public Builder scope(String scope) { diff --git a/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorMessagingResponse.java b/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorMessagingResponse.java similarity index 85% rename from src/main/java/com/bandwidth/multifactorauth/models/TwoFactorMessagingResponse.java rename to src/main/java/com/bandwidth/twofactorauth/models/TwoFactorMessagingResponse.java index 396d5ade..93a9f157 100644 --- a/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorMessagingResponse.java +++ b/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorMessagingResponse.java @@ -4,17 +4,15 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.multifactorauth.models; +package com.bandwidth.twofactorauth.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for TwoFactorMessagingResponse type. */ public class TwoFactorMessagingResponse { - @JsonInclude(JsonInclude.Include.NON_NULL) private String messageId; /** @@ -25,7 +23,7 @@ public TwoFactorMessagingResponse() { /** * Initialization constructor. - * @param messageId String value for messageId. + * @param messageId String value for messageId. */ public TwoFactorMessagingResponse( String messageId) { @@ -38,7 +36,7 @@ public TwoFactorMessagingResponse( */ @JsonGetter("messageId") public String getMessageId() { - return messageId; + return this.messageId; } /** @@ -80,7 +78,7 @@ public static class Builder { /** * Setter for messageId. - * @param messageId String value for messageId. + * @param messageId String value for messageId. * @return Builder */ public Builder messageId(String messageId) { diff --git a/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVerifyCodeResponse.java b/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVerifyCodeResponse.java similarity index 85% rename from src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVerifyCodeResponse.java rename to src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVerifyCodeResponse.java index 2ecf4167..ccda9c6a 100644 --- a/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVerifyCodeResponse.java +++ b/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVerifyCodeResponse.java @@ -4,17 +4,15 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.multifactorauth.models; +package com.bandwidth.twofactorauth.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for TwoFactorVerifyCodeResponse type. */ public class TwoFactorVerifyCodeResponse { - @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean valid; /** @@ -25,7 +23,7 @@ public TwoFactorVerifyCodeResponse() { /** * Initialization constructor. - * @param valid Boolean value for valid. + * @param valid Boolean value for valid. */ public TwoFactorVerifyCodeResponse( Boolean valid) { @@ -38,7 +36,7 @@ public TwoFactorVerifyCodeResponse( */ @JsonGetter("valid") public Boolean getValid() { - return valid; + return this.valid; } /** @@ -80,7 +78,7 @@ public static class Builder { /** * Setter for valid. - * @param valid Boolean value for valid. + * @param valid Boolean value for valid. * @return Builder */ public Builder valid(Boolean valid) { diff --git a/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVerifyRequestSchema.java b/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVerifyRequestSchema.java similarity index 82% rename from src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVerifyRequestSchema.java rename to src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVerifyRequestSchema.java index e4690ab8..a3997fb5 100644 --- a/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVerifyRequestSchema.java +++ b/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVerifyRequestSchema.java @@ -4,10 +4,9 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.multifactorauth.models; +package com.bandwidth.twofactorauth.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** @@ -16,7 +15,6 @@ public class TwoFactorVerifyRequestSchema { private String to; private String applicationId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String scope; private double expirationTimeInMinutes; private String code; @@ -29,11 +27,11 @@ public TwoFactorVerifyRequestSchema() { /** * Initialization constructor. - * @param to String value for to. - * @param applicationId String value for applicationId. - * @param expirationTimeInMinutes double value for expirationTimeInMinutes. - * @param code String value for code. - * @param scope String value for scope. + * @param to String value for to. + * @param applicationId String value for applicationId. + * @param expirationTimeInMinutes double value for expirationTimeInMinutes. + * @param code String value for code. + * @param scope String value for scope. */ public TwoFactorVerifyRequestSchema( String to, @@ -55,7 +53,7 @@ public TwoFactorVerifyRequestSchema( */ @JsonGetter("to") public String getTo() { - return to; + return this.to; } /** @@ -75,7 +73,7 @@ public void setTo(String to) { */ @JsonGetter("applicationId") public String getApplicationId() { - return applicationId; + return this.applicationId; } /** @@ -96,7 +94,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("scope") public String getScope() { - return scope; + return this.scope; } /** @@ -119,7 +117,7 @@ public void setScope(String scope) { */ @JsonGetter("expirationTimeInMinutes") public double getExpirationTimeInMinutes() { - return expirationTimeInMinutes; + return this.expirationTimeInMinutes; } /** @@ -141,7 +139,7 @@ public void setExpirationTimeInMinutes(double expirationTimeInMinutes) { */ @JsonGetter("code") public String getCode() { - return code; + return this.code; } /** @@ -194,12 +192,14 @@ public Builder() { /** * Initialization constructor. - * @param to String value for to. - * @param applicationId String value for applicationId. - * @param expirationTimeInMinutes double value for expirationTimeInMinutes. - * @param code String value for code. + * @param to String value for to. + * @param applicationId String value for applicationId. + * @param expirationTimeInMinutes double value for expirationTimeInMinutes. + * @param code String value for code. */ - public Builder(String to, String applicationId, double expirationTimeInMinutes, + public Builder(String to, + String applicationId, + double expirationTimeInMinutes, String code) { this.to = to; this.applicationId = applicationId; @@ -209,7 +209,7 @@ public Builder(String to, String applicationId, double expirationTimeInMinutes, /** * Setter for to. - * @param to String value for to. + * @param to String value for to. * @return Builder */ public Builder to(String to) { @@ -219,7 +219,7 @@ public Builder to(String to) { /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -229,7 +229,7 @@ public Builder applicationId(String applicationId) { /** * Setter for expirationTimeInMinutes. - * @param expirationTimeInMinutes double value for expirationTimeInMinutes. + * @param expirationTimeInMinutes double value for expirationTimeInMinutes. * @return Builder */ public Builder expirationTimeInMinutes(double expirationTimeInMinutes) { @@ -239,7 +239,7 @@ public Builder expirationTimeInMinutes(double expirationTimeInMinutes) { /** * Setter for code. - * @param code String value for code. + * @param code String value for code. * @return Builder */ public Builder code(String code) { @@ -249,7 +249,7 @@ public Builder code(String code) { /** * Setter for scope. - * @param scope String value for scope. + * @param scope String value for scope. * @return Builder */ public Builder scope(String scope) { diff --git a/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVoiceResponse.java b/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVoiceResponse.java similarity index 85% rename from src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVoiceResponse.java rename to src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVoiceResponse.java index d00b0d63..c12e7a53 100644 --- a/src/main/java/com/bandwidth/multifactorauth/models/TwoFactorVoiceResponse.java +++ b/src/main/java/com/bandwidth/twofactorauth/models/TwoFactorVoiceResponse.java @@ -4,17 +4,15 @@ * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ -package com.bandwidth.multifactorauth.models; +package com.bandwidth.twofactorauth.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for TwoFactorVoiceResponse type. */ public class TwoFactorVoiceResponse { - @JsonInclude(JsonInclude.Include.NON_NULL) private String callId; /** @@ -25,7 +23,7 @@ public TwoFactorVoiceResponse() { /** * Initialization constructor. - * @param callId String value for callId. + * @param callId String value for callId. */ public TwoFactorVoiceResponse( String callId) { @@ -38,7 +36,7 @@ public TwoFactorVoiceResponse( */ @JsonGetter("callId") public String getCallId() { - return callId; + return this.callId; } /** @@ -80,7 +78,7 @@ public static class Builder { /** * Setter for callId. - * @param callId String value for callId. + * @param callId String value for callId. * @return Builder */ public Builder callId(String callId) { diff --git a/src/main/java/com/bandwidth/voice/controllers/APIController.java b/src/main/java/com/bandwidth/voice/controllers/APIController.java index c3887bb7..acefd94b 100644 --- a/src/main/java/com/bandwidth/voice/controllers/APIController.java +++ b/src/main/java/com/bandwidth/voice/controllers/APIController.java @@ -20,7 +20,7 @@ import com.bandwidth.http.response.ApiResponse; import com.bandwidth.http.response.HttpResponse; import com.bandwidth.http.response.HttpStringResponse; -import com.bandwidth.voice.exceptions.ApiErrorResponseErrorException; +import com.bandwidth.voice.exceptions.ApiErrorResponseException; import com.bandwidth.voice.models.ApiCallResponse; import com.bandwidth.voice.models.ApiCallStateResponse; import com.bandwidth.voice.models.ApiCreateCallRequest; @@ -160,25 +160,25 @@ private ApiResponse handleCreateCallResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -281,25 +281,25 @@ private ApiResponse handleGetCallStateResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -407,25 +407,25 @@ private ApiResponse handleModifyCallResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -529,25 +529,25 @@ private ApiResponse handleModifyCallRecordingStateResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -648,25 +648,25 @@ private ApiResponse> handleGetQueryMetadataForAc int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -776,25 +776,25 @@ private ApiResponse handleGetMetadataForRecordingResp int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -902,25 +902,25 @@ private ApiResponse handleDeleteRecordingResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1025,25 +1025,25 @@ private ApiResponse handleGetStreamRecordingMediaResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1149,25 +1149,25 @@ private ApiResponse handleDeleteRecordingMediaResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1273,25 +1273,25 @@ private ApiResponse handleGetRecordingTranscriptionRespon int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1408,28 +1408,28 @@ private ApiResponse handleCreateTranscribeRecordingResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 410) { - throw new ApiErrorResponseErrorException("The media for this recording has been deleted, so we can't transcribe it", context); + throw new ApiErrorResponseException("The media for this recording has been deleted, so we can't transcribe it", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1534,25 +1534,25 @@ private ApiResponse handleDeleteRecordingTranscriptionResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1680,25 +1680,25 @@ private ApiResponse> handleGetConferencesByAccountRespons int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1800,25 +1800,25 @@ private ApiResponse handleGetConferenceByIdResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1926,25 +1926,25 @@ private ApiResponse handleModifyConferenceResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -2056,25 +2056,25 @@ private ApiResponse handleModifyConferenceMemberResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -2180,25 +2180,25 @@ private ApiResponse handleGetConferenceMemberResponse( int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -2305,25 +2305,25 @@ private ApiResponse> handleGetQueryMet int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -2434,25 +2434,25 @@ private ApiResponse handleGetMetadataForConferenceRec int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -2563,25 +2563,25 @@ private ApiResponse handleGetStreamConferenceRecordingMediaResponse int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); @@ -2708,25 +2708,25 @@ private ApiResponse> handleGetQueryMetadataForAc int responseCode = response.getStatusCode(); if (responseCode == 400) { - throw new ApiErrorResponseErrorException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); + throw new ApiErrorResponseException("Something's not quite right... Your request is invalid. Please fix it before trying again.", context); } if (responseCode == 401) { throw new ApiException("Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.", context); } if (responseCode == 403) { - throw new ApiErrorResponseErrorException("User unauthorized to perform this action.", context); + throw new ApiErrorResponseException("User unauthorized to perform this action.", context); } if (responseCode == 404) { - throw new ApiErrorResponseErrorException("The resource specified cannot be found or does not belong to you.", context); + throw new ApiErrorResponseException("The resource specified cannot be found or does not belong to you.", context); } if (responseCode == 415) { - throw new ApiErrorResponseErrorException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); + throw new ApiErrorResponseException("We don't support that media type. If a request body is required, please send it to us as `application/json`.", context); } if (responseCode == 429) { - throw new ApiErrorResponseErrorException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); + throw new ApiErrorResponseException("You're sending requests to this endpoint too frequently. Please slow your request rate down and try again.", context); } if (responseCode == 500) { - throw new ApiErrorResponseErrorException("Something unexpected happened. Please try again.", context); + throw new ApiErrorResponseException("Something unexpected happened. Please try again.", context); } //handle errors defined at the API level validateResponse(response, context); diff --git a/src/main/java/com/bandwidth/voice/exceptions/ApiErrorResponseErrorException.java b/src/main/java/com/bandwidth/voice/exceptions/ApiErrorResponseException.java similarity index 62% rename from src/main/java/com/bandwidth/voice/exceptions/ApiErrorResponseErrorException.java rename to src/main/java/com/bandwidth/voice/exceptions/ApiErrorResponseException.java index c59875cd..adae8ad4 100644 --- a/src/main/java/com/bandwidth/voice/exceptions/ApiErrorResponseErrorException.java +++ b/src/main/java/com/bandwidth/voice/exceptions/ApiErrorResponseException.java @@ -12,11 +12,11 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for ApiErrorResponseErrorException type. + * This is a model class for ApiErrorResponseException type. */ -public class ApiErrorResponseErrorException +public class ApiErrorResponseException extends ApiException { - private static final long serialVersionUID = -7170536725053545402L; + private static final long serialVersionUID = -5354659649987151873L; private String type; private String description; private String id; @@ -26,14 +26,14 @@ public class ApiErrorResponseErrorException * @param reason The reason for throwing exception * @param context The http context of the API exception */ - public ApiErrorResponseErrorException(String reason, HttpContext context) { + public ApiErrorResponseException(String reason, HttpContext context) { super(reason, context); } /** * Getter for Type. - * @return Returns the String + * @return Returns the String */ @JsonGetter("type") public String getType() { @@ -42,16 +42,16 @@ public String getType() { /** * Setter for Type. - * @param type Value for String + * @param value Value for String */ @JsonSetter("type") - private void setType(String type) { - this.type = type; + private void setType(String value) { + this.type = value; } /** * Getter for Description. - * @return Returns the String + * @return Returns the String */ @JsonGetter("description") public String getDescription() { @@ -60,16 +60,16 @@ public String getDescription() { /** * Setter for Description. - * @param description Value for String + * @param value Value for String */ @JsonSetter("description") - private void setDescription(String description) { - this.description = description; + private void setDescription(String value) { + this.description = value; } /** * Getter for Id. - * @return Returns the String + * @return Returns the String */ @JsonGetter("id") public String getId() { @@ -78,10 +78,10 @@ public String getId() { /** * Setter for Id. - * @param id Value for String + * @param value Value for String */ @JsonSetter("id") - private void setId(String id) { - this.id = id; + private void setId(String value) { + this.id = value; } } diff --git a/src/main/java/com/bandwidth/voice/models/ApiCallResponse.java b/src/main/java/com/bandwidth/voice/models/ApiCallResponse.java index 402a602a..5761610b 100644 --- a/src/main/java/com/bandwidth/voice/models/ApiCallResponse.java +++ b/src/main/java/com/bandwidth/voice/models/ApiCallResponse.java @@ -8,7 +8,6 @@ import com.bandwidth.DateTimeHelper; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -23,31 +22,20 @@ public class ApiCallResponse { private String applicationId; private String to; private String from; - @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime startTime; private String callUrl; - @JsonInclude(JsonInclude.Include.NON_NULL) private Double callTimeout; - @JsonInclude(JsonInclude.Include.NON_NULL) private Double callbackTimeout; private String answerUrl; private AnswerMethodEnum answerMethod; - @JsonInclude(JsonInclude.Include.NON_NULL) private String answerFallbackUrl; - @JsonInclude(JsonInclude.Include.NON_NULL) private AnswerFallbackMethodEnum answerFallbackMethod; - @JsonInclude(JsonInclude.Include.NON_NULL) private String disconnectUrl; private DisconnectMethodEnum disconnectMethod; - @JsonInclude(JsonInclude.Include.NON_NULL) private String username; - @JsonInclude(JsonInclude.Include.NON_NULL) private String password; - @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackUsername; - @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackPassword; - @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; /** @@ -58,26 +46,26 @@ public ApiCallResponse() { /** * Initialization constructor. - * @param accountId String value for accountId. - * @param callId String value for callId. - * @param applicationId String value for applicationId. - * @param to String value for to. - * @param from String value for from. - * @param callUrl String value for callUrl. - * @param answerUrl String value for answerUrl. - * @param answerMethod AnswerMethodEnum value for answerMethod. - * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. - * @param startTime LocalDateTime value for startTime. - * @param callTimeout Double value for callTimeout. - * @param callbackTimeout Double value for callbackTimeout. - * @param answerFallbackUrl String value for answerFallbackUrl. - * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. - * @param disconnectUrl String value for disconnectUrl. - * @param username String value for username. - * @param password String value for password. - * @param fallbackUsername String value for fallbackUsername. - * @param fallbackPassword String value for fallbackPassword. - * @param tag String value for tag. + * @param accountId String value for accountId. + * @param callId String value for callId. + * @param applicationId String value for applicationId. + * @param to String value for to. + * @param from String value for from. + * @param callUrl String value for callUrl. + * @param answerUrl String value for answerUrl. + * @param answerMethod AnswerMethodEnum value for answerMethod. + * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. + * @param startTime LocalDateTime value for startTime. + * @param callTimeout Double value for callTimeout. + * @param callbackTimeout Double value for callbackTimeout. + * @param answerFallbackUrl String value for answerFallbackUrl. + * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. + * @param disconnectUrl String value for disconnectUrl. + * @param username String value for username. + * @param password String value for password. + * @param fallbackUsername String value for fallbackUsername. + * @param fallbackPassword String value for fallbackPassword. + * @param tag String value for tag. */ public ApiCallResponse( String accountId, @@ -128,7 +116,7 @@ public ApiCallResponse( */ @JsonGetter("accountId") public String getAccountId() { - return accountId; + return this.accountId; } /** @@ -146,7 +134,7 @@ public void setAccountId(String accountId) { */ @JsonGetter("callId") public String getCallId() { - return callId; + return this.callId; } /** @@ -164,7 +152,7 @@ public void setCallId(String callId) { */ @JsonGetter("applicationId") public String getApplicationId() { - return applicationId; + return this.applicationId; } /** @@ -182,7 +170,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("to") public String getTo() { - return to; + return this.to; } /** @@ -200,7 +188,7 @@ public void setTo(String to) { */ @JsonGetter("from") public String getFrom() { - return from; + return this.from; } /** @@ -219,7 +207,7 @@ public void setFrom(String from) { @JsonGetter("startTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getStartTime() { - return startTime; + return this.startTime; } /** @@ -238,7 +226,7 @@ public void setStartTime(LocalDateTime startTime) { */ @JsonGetter("callUrl") public String getCallUrl() { - return callUrl; + return this.callUrl; } /** @@ -256,7 +244,7 @@ public void setCallUrl(String callUrl) { */ @JsonGetter("callTimeout") public Double getCallTimeout() { - return callTimeout; + return this.callTimeout; } /** @@ -274,7 +262,7 @@ public void setCallTimeout(Double callTimeout) { */ @JsonGetter("callbackTimeout") public Double getCallbackTimeout() { - return callbackTimeout; + return this.callbackTimeout; } /** @@ -292,7 +280,7 @@ public void setCallbackTimeout(Double callbackTimeout) { */ @JsonGetter("answerUrl") public String getAnswerUrl() { - return answerUrl; + return this.answerUrl; } /** @@ -310,7 +298,7 @@ public void setAnswerUrl(String answerUrl) { */ @JsonGetter("answerMethod") public AnswerMethodEnum getAnswerMethod() { - return answerMethod; + return this.answerMethod; } /** @@ -328,7 +316,7 @@ public void setAnswerMethod(AnswerMethodEnum answerMethod) { */ @JsonGetter("answerFallbackUrl") public String getAnswerFallbackUrl() { - return answerFallbackUrl; + return this.answerFallbackUrl; } /** @@ -346,7 +334,7 @@ public void setAnswerFallbackUrl(String answerFallbackUrl) { */ @JsonGetter("answerFallbackMethod") public AnswerFallbackMethodEnum getAnswerFallbackMethod() { - return answerFallbackMethod; + return this.answerFallbackMethod; } /** @@ -364,7 +352,7 @@ public void setAnswerFallbackMethod(AnswerFallbackMethodEnum answerFallbackMetho */ @JsonGetter("disconnectUrl") public String getDisconnectUrl() { - return disconnectUrl; + return this.disconnectUrl; } /** @@ -382,7 +370,7 @@ public void setDisconnectUrl(String disconnectUrl) { */ @JsonGetter("disconnectMethod") public DisconnectMethodEnum getDisconnectMethod() { - return disconnectMethod; + return this.disconnectMethod; } /** @@ -400,7 +388,7 @@ public void setDisconnectMethod(DisconnectMethodEnum disconnectMethod) { */ @JsonGetter("username") public String getUsername() { - return username; + return this.username; } /** @@ -418,7 +406,7 @@ public void setUsername(String username) { */ @JsonGetter("password") public String getPassword() { - return password; + return this.password; } /** @@ -436,7 +424,7 @@ public void setPassword(String password) { */ @JsonGetter("fallbackUsername") public String getFallbackUsername() { - return fallbackUsername; + return this.fallbackUsername; } /** @@ -454,7 +442,7 @@ public void setFallbackUsername(String fallbackUsername) { */ @JsonGetter("fallbackPassword") public String getFallbackPassword() { - return fallbackPassword; + return this.fallbackPassword; } /** @@ -472,7 +460,7 @@ public void setFallbackPassword(String fallbackPassword) { */ @JsonGetter("tag") public String getTag() { - return tag; + return this.tag; } /** @@ -557,18 +545,24 @@ public Builder() { /** * Initialization constructor. - * @param accountId String value for accountId. - * @param callId String value for callId. - * @param applicationId String value for applicationId. - * @param to String value for to. - * @param from String value for from. - * @param callUrl String value for callUrl. - * @param answerUrl String value for answerUrl. - * @param answerMethod AnswerMethodEnum value for answerMethod. - * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. + * @param accountId String value for accountId. + * @param callId String value for callId. + * @param applicationId String value for applicationId. + * @param to String value for to. + * @param from String value for from. + * @param callUrl String value for callUrl. + * @param answerUrl String value for answerUrl. + * @param answerMethod AnswerMethodEnum value for answerMethod. + * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. */ - public Builder(String accountId, String callId, String applicationId, String to, - String from, String callUrl, String answerUrl, AnswerMethodEnum answerMethod, + public Builder(String accountId, + String callId, + String applicationId, + String to, + String from, + String callUrl, + String answerUrl, + AnswerMethodEnum answerMethod, DisconnectMethodEnum disconnectMethod) { this.accountId = accountId; this.callId = callId; @@ -583,7 +577,7 @@ public Builder(String accountId, String callId, String applicationId, String to, /** * Setter for accountId. - * @param accountId String value for accountId. + * @param accountId String value for accountId. * @return Builder */ public Builder accountId(String accountId) { @@ -593,7 +587,7 @@ public Builder accountId(String accountId) { /** * Setter for callId. - * @param callId String value for callId. + * @param callId String value for callId. * @return Builder */ public Builder callId(String callId) { @@ -603,7 +597,7 @@ public Builder callId(String callId) { /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -613,7 +607,7 @@ public Builder applicationId(String applicationId) { /** * Setter for to. - * @param to String value for to. + * @param to String value for to. * @return Builder */ public Builder to(String to) { @@ -623,7 +617,7 @@ public Builder to(String to) { /** * Setter for from. - * @param from String value for from. + * @param from String value for from. * @return Builder */ public Builder from(String from) { @@ -633,7 +627,7 @@ public Builder from(String from) { /** * Setter for callUrl. - * @param callUrl String value for callUrl. + * @param callUrl String value for callUrl. * @return Builder */ public Builder callUrl(String callUrl) { @@ -643,7 +637,7 @@ public Builder callUrl(String callUrl) { /** * Setter for answerUrl. - * @param answerUrl String value for answerUrl. + * @param answerUrl String value for answerUrl. * @return Builder */ public Builder answerUrl(String answerUrl) { @@ -653,7 +647,7 @@ public Builder answerUrl(String answerUrl) { /** * Setter for answerMethod. - * @param answerMethod AnswerMethodEnum value for answerMethod. + * @param answerMethod AnswerMethodEnum value for answerMethod. * @return Builder */ public Builder answerMethod(AnswerMethodEnum answerMethod) { @@ -663,7 +657,7 @@ public Builder answerMethod(AnswerMethodEnum answerMethod) { /** * Setter for disconnectMethod. - * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. + * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. * @return Builder */ public Builder disconnectMethod(DisconnectMethodEnum disconnectMethod) { @@ -673,7 +667,7 @@ public Builder disconnectMethod(DisconnectMethodEnum disconnectMethod) { /** * Setter for startTime. - * @param startTime LocalDateTime value for startTime. + * @param startTime LocalDateTime value for startTime. * @return Builder */ public Builder startTime(LocalDateTime startTime) { @@ -683,7 +677,7 @@ public Builder startTime(LocalDateTime startTime) { /** * Setter for callTimeout. - * @param callTimeout Double value for callTimeout. + * @param callTimeout Double value for callTimeout. * @return Builder */ public Builder callTimeout(Double callTimeout) { @@ -693,7 +687,7 @@ public Builder callTimeout(Double callTimeout) { /** * Setter for callbackTimeout. - * @param callbackTimeout Double value for callbackTimeout. + * @param callbackTimeout Double value for callbackTimeout. * @return Builder */ public Builder callbackTimeout(Double callbackTimeout) { @@ -703,7 +697,7 @@ public Builder callbackTimeout(Double callbackTimeout) { /** * Setter for answerFallbackUrl. - * @param answerFallbackUrl String value for answerFallbackUrl. + * @param answerFallbackUrl String value for answerFallbackUrl. * @return Builder */ public Builder answerFallbackUrl(String answerFallbackUrl) { @@ -713,7 +707,7 @@ public Builder answerFallbackUrl(String answerFallbackUrl) { /** * Setter for answerFallbackMethod. - * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. + * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. * @return Builder */ public Builder answerFallbackMethod(AnswerFallbackMethodEnum answerFallbackMethod) { @@ -723,7 +717,7 @@ public Builder answerFallbackMethod(AnswerFallbackMethodEnum answerFallbackMetho /** * Setter for disconnectUrl. - * @param disconnectUrl String value for disconnectUrl. + * @param disconnectUrl String value for disconnectUrl. * @return Builder */ public Builder disconnectUrl(String disconnectUrl) { @@ -733,7 +727,7 @@ public Builder disconnectUrl(String disconnectUrl) { /** * Setter for username. - * @param username String value for username. + * @param username String value for username. * @return Builder */ public Builder username(String username) { @@ -743,7 +737,7 @@ public Builder username(String username) { /** * Setter for password. - * @param password String value for password. + * @param password String value for password. * @return Builder */ public Builder password(String password) { @@ -753,7 +747,7 @@ public Builder password(String password) { /** * Setter for fallbackUsername. - * @param fallbackUsername String value for fallbackUsername. + * @param fallbackUsername String value for fallbackUsername. * @return Builder */ public Builder fallbackUsername(String fallbackUsername) { @@ -763,7 +757,7 @@ public Builder fallbackUsername(String fallbackUsername) { /** * Setter for fallbackPassword. - * @param fallbackPassword String value for fallbackPassword. + * @param fallbackPassword String value for fallbackPassword. * @return Builder */ public Builder fallbackPassword(String fallbackPassword) { @@ -773,7 +767,7 @@ public Builder fallbackPassword(String fallbackPassword) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { diff --git a/src/main/java/com/bandwidth/voice/models/ApiCallStateResponse.java b/src/main/java/com/bandwidth/voice/models/ApiCallStateResponse.java index 2bf89462..99d84c52 100644 --- a/src/main/java/com/bandwidth/voice/models/ApiCallStateResponse.java +++ b/src/main/java/com/bandwidth/voice/models/ApiCallStateResponse.java @@ -8,50 +8,29 @@ import com.bandwidth.DateTimeHelper; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.time.LocalDateTime; -import java.util.Map; /** * This is a model class for ApiCallStateResponse type. */ public class ApiCallStateResponse { - @JsonInclude(JsonInclude.Include.NON_NULL) private String callId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String parentCallId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String applicationId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String accountId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String to; - @JsonInclude(JsonInclude.Include.NON_NULL) private String from; - @JsonInclude(JsonInclude.Include.NON_NULL) private String direction; - @JsonInclude(JsonInclude.Include.NON_NULL) private StateEnum state; - @JsonInclude(JsonInclude.Include.NON_NULL) - private String identity; - @JsonInclude(JsonInclude.Include.NON_NULL) - private Map pai; - @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime startTime; - @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime answerTime; - @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime endTime; - @JsonInclude(JsonInclude.Include.NON_NULL) private DisconnectCauseEnum disconnectCause; - @JsonInclude(JsonInclude.Include.NON_NULL) private String errorMessage; - @JsonInclude(JsonInclude.Include.NON_NULL) private String errorId; - @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime lastUpdate; /** @@ -62,23 +41,21 @@ public ApiCallStateResponse() { /** * Initialization constructor. - * @param callId String value for callId. - * @param parentCallId String value for parentCallId. - * @param applicationId String value for applicationId. - * @param accountId String value for accountId. - * @param to String value for to. - * @param from String value for from. - * @param direction String value for direction. - * @param state StateEnum value for state. - * @param identity String value for identity. - * @param pai Map of String, value for pai. - * @param startTime LocalDateTime value for startTime. - * @param answerTime LocalDateTime value for answerTime. - * @param endTime LocalDateTime value for endTime. - * @param disconnectCause DisconnectCauseEnum value for disconnectCause. - * @param errorMessage String value for errorMessage. - * @param errorId String value for errorId. - * @param lastUpdate LocalDateTime value for lastUpdate. + * @param callId String value for callId. + * @param parentCallId String value for parentCallId. + * @param applicationId String value for applicationId. + * @param accountId String value for accountId. + * @param to String value for to. + * @param from String value for from. + * @param direction String value for direction. + * @param state StateEnum value for state. + * @param startTime LocalDateTime value for startTime. + * @param answerTime LocalDateTime value for answerTime. + * @param endTime LocalDateTime value for endTime. + * @param disconnectCause DisconnectCauseEnum value for disconnectCause. + * @param errorMessage String value for errorMessage. + * @param errorId String value for errorId. + * @param lastUpdate LocalDateTime value for lastUpdate. */ public ApiCallStateResponse( String callId, @@ -89,8 +66,6 @@ public ApiCallStateResponse( String from, String direction, StateEnum state, - String identity, - Map pai, LocalDateTime startTime, LocalDateTime answerTime, LocalDateTime endTime, @@ -106,8 +81,6 @@ public ApiCallStateResponse( this.from = from; this.direction = direction; this.state = state; - this.identity = identity; - this.pai = pai; this.startTime = startTime; this.answerTime = answerTime; this.endTime = endTime; @@ -123,7 +96,7 @@ public ApiCallStateResponse( */ @JsonGetter("callId") public String getCallId() { - return callId; + return this.callId; } /** @@ -141,7 +114,7 @@ public void setCallId(String callId) { */ @JsonGetter("parentCallId") public String getParentCallId() { - return parentCallId; + return this.parentCallId; } /** @@ -159,7 +132,7 @@ public void setParentCallId(String parentCallId) { */ @JsonGetter("applicationId") public String getApplicationId() { - return applicationId; + return this.applicationId; } /** @@ -177,7 +150,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("accountId") public String getAccountId() { - return accountId; + return this.accountId; } /** @@ -195,7 +168,7 @@ public void setAccountId(String accountId) { */ @JsonGetter("to") public String getTo() { - return to; + return this.to; } /** @@ -213,7 +186,7 @@ public void setTo(String to) { */ @JsonGetter("from") public String getFrom() { - return from; + return this.from; } /** @@ -231,7 +204,7 @@ public void setFrom(String from) { */ @JsonGetter("direction") public String getDirection() { - return direction; + return this.direction; } /** @@ -249,7 +222,7 @@ public void setDirection(String direction) { */ @JsonGetter("state") public StateEnum getState() { - return state; + return this.state; } /** @@ -261,42 +234,6 @@ public void setState(StateEnum state) { this.state = state; } - /** - * Getter for Identity. - * @return Returns the String - */ - @JsonGetter("identity") - public String getIdentity() { - return identity; - } - - /** - * Setter for Identity. - * @param identity Value for String - */ - @JsonSetter("identity") - public void setIdentity(String identity) { - this.identity = identity; - } - - /** - * Getter for Pai. - * @return Returns the Map of String, String - */ - @JsonGetter("pai") - public Map getPai() { - return pai; - } - - /** - * Setter for Pai. - * @param pai Value for Map of String, String - */ - @JsonSetter("pai") - public void setPai(Map pai) { - this.pai = pai; - } - /** * Getter for StartTime. * @return Returns the LocalDateTime @@ -304,7 +241,7 @@ public void setPai(Map pai) { @JsonGetter("startTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getStartTime() { - return startTime; + return this.startTime; } /** @@ -324,7 +261,7 @@ public void setStartTime(LocalDateTime startTime) { @JsonGetter("answerTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getAnswerTime() { - return answerTime; + return this.answerTime; } /** @@ -344,7 +281,7 @@ public void setAnswerTime(LocalDateTime answerTime) { @JsonGetter("endTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getEndTime() { - return endTime; + return this.endTime; } /** @@ -363,7 +300,7 @@ public void setEndTime(LocalDateTime endTime) { */ @JsonGetter("disconnectCause") public DisconnectCauseEnum getDisconnectCause() { - return disconnectCause; + return this.disconnectCause; } /** @@ -381,7 +318,7 @@ public void setDisconnectCause(DisconnectCauseEnum disconnectCause) { */ @JsonGetter("errorMessage") public String getErrorMessage() { - return errorMessage; + return this.errorMessage; } /** @@ -399,7 +336,7 @@ public void setErrorMessage(String errorMessage) { */ @JsonGetter("errorId") public String getErrorId() { - return errorId; + return this.errorId; } /** @@ -418,7 +355,7 @@ public void setErrorId(String errorId) { @JsonGetter("lastUpdate") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getLastUpdate() { - return lastUpdate; + return this.lastUpdate; } /** @@ -439,11 +376,10 @@ public void setLastUpdate(LocalDateTime lastUpdate) { public String toString() { return "ApiCallStateResponse [" + "callId=" + callId + ", parentCallId=" + parentCallId + ", applicationId=" + applicationId + ", accountId=" + accountId + ", to=" + to - + ", from=" + from + ", direction=" + direction + ", state=" + state + ", identity=" - + identity + ", pai=" + pai + ", startTime=" + startTime + ", answerTime=" - + answerTime + ", endTime=" + endTime + ", disconnectCause=" + disconnectCause - + ", errorMessage=" + errorMessage + ", errorId=" + errorId + ", lastUpdate=" - + lastUpdate + "]"; + + ", from=" + from + ", direction=" + direction + ", state=" + state + + ", startTime=" + startTime + ", answerTime=" + answerTime + ", endTime=" + endTime + + ", disconnectCause=" + disconnectCause + ", errorMessage=" + errorMessage + + ", errorId=" + errorId + ", lastUpdate=" + lastUpdate + "]"; } /** @@ -461,8 +397,6 @@ public Builder toBuilder() { .from(getFrom()) .direction(getDirection()) .state(getState()) - .identity(getIdentity()) - .pai(getPai()) .startTime(getStartTime()) .answerTime(getAnswerTime()) .endTime(getEndTime()) @@ -485,8 +419,6 @@ public static class Builder { private String from; private String direction; private StateEnum state; - private String identity; - private Map pai; private LocalDateTime startTime; private LocalDateTime answerTime; private LocalDateTime endTime; @@ -499,7 +431,7 @@ public static class Builder { /** * Setter for callId. - * @param callId String value for callId. + * @param callId String value for callId. * @return Builder */ public Builder callId(String callId) { @@ -509,7 +441,7 @@ public Builder callId(String callId) { /** * Setter for parentCallId. - * @param parentCallId String value for parentCallId. + * @param parentCallId String value for parentCallId. * @return Builder */ public Builder parentCallId(String parentCallId) { @@ -519,7 +451,7 @@ public Builder parentCallId(String parentCallId) { /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -529,7 +461,7 @@ public Builder applicationId(String applicationId) { /** * Setter for accountId. - * @param accountId String value for accountId. + * @param accountId String value for accountId. * @return Builder */ public Builder accountId(String accountId) { @@ -539,7 +471,7 @@ public Builder accountId(String accountId) { /** * Setter for to. - * @param to String value for to. + * @param to String value for to. * @return Builder */ public Builder to(String to) { @@ -549,7 +481,7 @@ public Builder to(String to) { /** * Setter for from. - * @param from String value for from. + * @param from String value for from. * @return Builder */ public Builder from(String from) { @@ -559,7 +491,7 @@ public Builder from(String from) { /** * Setter for direction. - * @param direction String value for direction. + * @param direction String value for direction. * @return Builder */ public Builder direction(String direction) { @@ -569,7 +501,7 @@ public Builder direction(String direction) { /** * Setter for state. - * @param state StateEnum value for state. + * @param state StateEnum value for state. * @return Builder */ public Builder state(StateEnum state) { @@ -577,29 +509,9 @@ public Builder state(StateEnum state) { return this; } - /** - * Setter for identity. - * @param identity String value for identity. - * @return Builder - */ - public Builder identity(String identity) { - this.identity = identity; - return this; - } - - /** - * Setter for pai. - * @param pai Map of String, value for pai. - * @return Builder - */ - public Builder pai(Map pai) { - this.pai = pai; - return this; - } - /** * Setter for startTime. - * @param startTime LocalDateTime value for startTime. + * @param startTime LocalDateTime value for startTime. * @return Builder */ public Builder startTime(LocalDateTime startTime) { @@ -609,7 +521,7 @@ public Builder startTime(LocalDateTime startTime) { /** * Setter for answerTime. - * @param answerTime LocalDateTime value for answerTime. + * @param answerTime LocalDateTime value for answerTime. * @return Builder */ public Builder answerTime(LocalDateTime answerTime) { @@ -619,7 +531,7 @@ public Builder answerTime(LocalDateTime answerTime) { /** * Setter for endTime. - * @param endTime LocalDateTime value for endTime. + * @param endTime LocalDateTime value for endTime. * @return Builder */ public Builder endTime(LocalDateTime endTime) { @@ -629,7 +541,7 @@ public Builder endTime(LocalDateTime endTime) { /** * Setter for disconnectCause. - * @param disconnectCause DisconnectCauseEnum value for disconnectCause. + * @param disconnectCause DisconnectCauseEnum value for disconnectCause. * @return Builder */ public Builder disconnectCause(DisconnectCauseEnum disconnectCause) { @@ -639,7 +551,7 @@ public Builder disconnectCause(DisconnectCauseEnum disconnectCause) { /** * Setter for errorMessage. - * @param errorMessage String value for errorMessage. + * @param errorMessage String value for errorMessage. * @return Builder */ public Builder errorMessage(String errorMessage) { @@ -649,7 +561,7 @@ public Builder errorMessage(String errorMessage) { /** * Setter for errorId. - * @param errorId String value for errorId. + * @param errorId String value for errorId. * @return Builder */ public Builder errorId(String errorId) { @@ -659,7 +571,7 @@ public Builder errorId(String errorId) { /** * Setter for lastUpdate. - * @param lastUpdate LocalDateTime value for lastUpdate. + * @param lastUpdate LocalDateTime value for lastUpdate. * @return Builder */ public Builder lastUpdate(LocalDateTime lastUpdate) { @@ -673,8 +585,8 @@ public Builder lastUpdate(LocalDateTime lastUpdate) { */ public ApiCallStateResponse build() { return new ApiCallStateResponse(callId, parentCallId, applicationId, accountId, to, - from, direction, state, identity, pai, startTime, answerTime, endTime, - disconnectCause, errorMessage, errorId, lastUpdate); + from, direction, state, startTime, answerTime, endTime, disconnectCause, + errorMessage, errorId, lastUpdate); } } } diff --git a/src/main/java/com/bandwidth/voice/models/ApiCreateCallRequest.java b/src/main/java/com/bandwidth/voice/models/ApiCreateCallRequest.java index 9bde4d50..f9cc6392 100644 --- a/src/main/java/com/bandwidth/voice/models/ApiCreateCallRequest.java +++ b/src/main/java/com/bandwidth/voice/models/ApiCreateCallRequest.java @@ -7,7 +7,6 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** @@ -16,37 +15,22 @@ public class ApiCreateCallRequest { private String from; private String to; - @JsonInclude(JsonInclude.Include.NON_NULL) private String uui; - @JsonInclude(JsonInclude.Include.NON_NULL) private Double callTimeout; - @JsonInclude(JsonInclude.Include.NON_NULL) private Double callbackTimeout; private String answerUrl; - @JsonInclude(JsonInclude.Include.NON_NULL) private String answerFallbackUrl; - @JsonInclude(JsonInclude.Include.NON_NULL) private String username; - @JsonInclude(JsonInclude.Include.NON_NULL) private String password; - @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackUsername; - @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackPassword; - @JsonInclude(JsonInclude.Include.NON_NULL) private AnswerMethodEnum answerMethod; - @JsonInclude(JsonInclude.Include.NON_NULL) private AnswerFallbackMethodEnum answerFallbackMethod; - @JsonInclude(JsonInclude.Include.NON_NULL) private String disconnectUrl; - @JsonInclude(JsonInclude.Include.NON_NULL) private DisconnectMethodEnum disconnectMethod; - @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; private String applicationId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String obfuscatedTo; - @JsonInclude(JsonInclude.Include.NON_NULL) private String obfuscatedFrom; /** @@ -57,25 +41,25 @@ public ApiCreateCallRequest() { /** * Initialization constructor. - * @param from String value for from. - * @param to String value for to. - * @param answerUrl String value for answerUrl. - * @param applicationId String value for applicationId. - * @param uui String value for uui. - * @param callTimeout Double value for callTimeout. - * @param callbackTimeout Double value for callbackTimeout. - * @param answerFallbackUrl String value for answerFallbackUrl. - * @param username String value for username. - * @param password String value for password. - * @param fallbackUsername String value for fallbackUsername. - * @param fallbackPassword String value for fallbackPassword. - * @param answerMethod AnswerMethodEnum value for answerMethod. - * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. - * @param disconnectUrl String value for disconnectUrl. - * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. - * @param tag String value for tag. - * @param obfuscatedTo String value for obfuscatedTo. - * @param obfuscatedFrom String value for obfuscatedFrom. + * @param from String value for from. + * @param to String value for to. + * @param answerUrl String value for answerUrl. + * @param applicationId String value for applicationId. + * @param uui String value for uui. + * @param callTimeout Double value for callTimeout. + * @param callbackTimeout Double value for callbackTimeout. + * @param answerFallbackUrl String value for answerFallbackUrl. + * @param username String value for username. + * @param password String value for password. + * @param fallbackUsername String value for fallbackUsername. + * @param fallbackPassword String value for fallbackPassword. + * @param answerMethod AnswerMethodEnum value for answerMethod. + * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. + * @param disconnectUrl String value for disconnectUrl. + * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. + * @param tag String value for tag. + * @param obfuscatedTo String value for obfuscatedTo. + * @param obfuscatedFrom String value for obfuscatedFrom. */ public ApiCreateCallRequest( String from, @@ -125,7 +109,7 @@ public ApiCreateCallRequest( */ @JsonGetter("from") public String getFrom() { - return from; + return this.from; } /** @@ -145,7 +129,7 @@ public void setFrom(String from) { */ @JsonGetter("to") public String getTo() { - return to; + return this.to; } /** @@ -168,7 +152,7 @@ public void setTo(String to) { */ @JsonGetter("uui") public String getUui() { - return uui; + return this.uui; } /** @@ -190,7 +174,7 @@ public void setUui(String uui) { */ @JsonGetter("callTimeout") public Double getCallTimeout() { - return callTimeout; + return this.callTimeout; } /** @@ -208,7 +192,7 @@ public void setCallTimeout(Double callTimeout) { */ @JsonGetter("callbackTimeout") public Double getCallbackTimeout() { - return callbackTimeout; + return this.callbackTimeout; } /** @@ -226,7 +210,7 @@ public void setCallbackTimeout(Double callbackTimeout) { */ @JsonGetter("answerUrl") public String getAnswerUrl() { - return answerUrl; + return this.answerUrl; } /** @@ -244,7 +228,7 @@ public void setAnswerUrl(String answerUrl) { */ @JsonGetter("answerFallbackUrl") public String getAnswerFallbackUrl() { - return answerFallbackUrl; + return this.answerFallbackUrl; } /** @@ -262,7 +246,7 @@ public void setAnswerFallbackUrl(String answerFallbackUrl) { */ @JsonGetter("username") public String getUsername() { - return username; + return this.username; } /** @@ -280,7 +264,7 @@ public void setUsername(String username) { */ @JsonGetter("password") public String getPassword() { - return password; + return this.password; } /** @@ -298,7 +282,7 @@ public void setPassword(String password) { */ @JsonGetter("fallbackUsername") public String getFallbackUsername() { - return fallbackUsername; + return this.fallbackUsername; } /** @@ -316,7 +300,7 @@ public void setFallbackUsername(String fallbackUsername) { */ @JsonGetter("fallbackPassword") public String getFallbackPassword() { - return fallbackPassword; + return this.fallbackPassword; } /** @@ -334,7 +318,7 @@ public void setFallbackPassword(String fallbackPassword) { */ @JsonGetter("answerMethod") public AnswerMethodEnum getAnswerMethod() { - return answerMethod; + return this.answerMethod; } /** @@ -352,7 +336,7 @@ public void setAnswerMethod(AnswerMethodEnum answerMethod) { */ @JsonGetter("answerFallbackMethod") public AnswerFallbackMethodEnum getAnswerFallbackMethod() { - return answerFallbackMethod; + return this.answerFallbackMethod; } /** @@ -370,7 +354,7 @@ public void setAnswerFallbackMethod(AnswerFallbackMethodEnum answerFallbackMetho */ @JsonGetter("disconnectUrl") public String getDisconnectUrl() { - return disconnectUrl; + return this.disconnectUrl; } /** @@ -388,7 +372,7 @@ public void setDisconnectUrl(String disconnectUrl) { */ @JsonGetter("disconnectMethod") public DisconnectMethodEnum getDisconnectMethod() { - return disconnectMethod; + return this.disconnectMethod; } /** @@ -406,7 +390,7 @@ public void setDisconnectMethod(DisconnectMethodEnum disconnectMethod) { */ @JsonGetter("tag") public String getTag() { - return tag; + return this.tag; } /** @@ -424,7 +408,7 @@ public void setTag(String tag) { */ @JsonGetter("applicationId") public String getApplicationId() { - return applicationId; + return this.applicationId; } /** @@ -442,7 +426,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("obfuscatedTo") public String getObfuscatedTo() { - return obfuscatedTo; + return this.obfuscatedTo; } /** @@ -460,7 +444,7 @@ public void setObfuscatedTo(String obfuscatedTo) { */ @JsonGetter("obfuscatedFrom") public String getObfuscatedFrom() { - return obfuscatedFrom; + return this.obfuscatedFrom; } /** @@ -546,12 +530,15 @@ public Builder() { /** * Initialization constructor. - * @param from String value for from. - * @param to String value for to. - * @param answerUrl String value for answerUrl. - * @param applicationId String value for applicationId. + * @param from String value for from. + * @param to String value for to. + * @param answerUrl String value for answerUrl. + * @param applicationId String value for applicationId. */ - public Builder(String from, String to, String answerUrl, String applicationId) { + public Builder(String from, + String to, + String answerUrl, + String applicationId) { this.from = from; this.to = to; this.answerUrl = answerUrl; @@ -560,7 +547,7 @@ public Builder(String from, String to, String answerUrl, String applicationId) { /** * Setter for from. - * @param from String value for from. + * @param from String value for from. * @return Builder */ public Builder from(String from) { @@ -570,7 +557,7 @@ public Builder from(String from) { /** * Setter for to. - * @param to String value for to. + * @param to String value for to. * @return Builder */ public Builder to(String to) { @@ -580,7 +567,7 @@ public Builder to(String to) { /** * Setter for answerUrl. - * @param answerUrl String value for answerUrl. + * @param answerUrl String value for answerUrl. * @return Builder */ public Builder answerUrl(String answerUrl) { @@ -590,7 +577,7 @@ public Builder answerUrl(String answerUrl) { /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -600,7 +587,7 @@ public Builder applicationId(String applicationId) { /** * Setter for uui. - * @param uui String value for uui. + * @param uui String value for uui. * @return Builder */ public Builder uui(String uui) { @@ -610,7 +597,7 @@ public Builder uui(String uui) { /** * Setter for callTimeout. - * @param callTimeout Double value for callTimeout. + * @param callTimeout Double value for callTimeout. * @return Builder */ public Builder callTimeout(Double callTimeout) { @@ -620,7 +607,7 @@ public Builder callTimeout(Double callTimeout) { /** * Setter for callbackTimeout. - * @param callbackTimeout Double value for callbackTimeout. + * @param callbackTimeout Double value for callbackTimeout. * @return Builder */ public Builder callbackTimeout(Double callbackTimeout) { @@ -630,7 +617,7 @@ public Builder callbackTimeout(Double callbackTimeout) { /** * Setter for answerFallbackUrl. - * @param answerFallbackUrl String value for answerFallbackUrl. + * @param answerFallbackUrl String value for answerFallbackUrl. * @return Builder */ public Builder answerFallbackUrl(String answerFallbackUrl) { @@ -640,7 +627,7 @@ public Builder answerFallbackUrl(String answerFallbackUrl) { /** * Setter for username. - * @param username String value for username. + * @param username String value for username. * @return Builder */ public Builder username(String username) { @@ -650,7 +637,7 @@ public Builder username(String username) { /** * Setter for password. - * @param password String value for password. + * @param password String value for password. * @return Builder */ public Builder password(String password) { @@ -660,7 +647,7 @@ public Builder password(String password) { /** * Setter for fallbackUsername. - * @param fallbackUsername String value for fallbackUsername. + * @param fallbackUsername String value for fallbackUsername. * @return Builder */ public Builder fallbackUsername(String fallbackUsername) { @@ -670,7 +657,7 @@ public Builder fallbackUsername(String fallbackUsername) { /** * Setter for fallbackPassword. - * @param fallbackPassword String value for fallbackPassword. + * @param fallbackPassword String value for fallbackPassword. * @return Builder */ public Builder fallbackPassword(String fallbackPassword) { @@ -680,7 +667,7 @@ public Builder fallbackPassword(String fallbackPassword) { /** * Setter for answerMethod. - * @param answerMethod AnswerMethodEnum value for answerMethod. + * @param answerMethod AnswerMethodEnum value for answerMethod. * @return Builder */ public Builder answerMethod(AnswerMethodEnum answerMethod) { @@ -690,7 +677,7 @@ public Builder answerMethod(AnswerMethodEnum answerMethod) { /** * Setter for answerFallbackMethod. - * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. + * @param answerFallbackMethod AnswerFallbackMethodEnum value for answerFallbackMethod. * @return Builder */ public Builder answerFallbackMethod(AnswerFallbackMethodEnum answerFallbackMethod) { @@ -700,7 +687,7 @@ public Builder answerFallbackMethod(AnswerFallbackMethodEnum answerFallbackMetho /** * Setter for disconnectUrl. - * @param disconnectUrl String value for disconnectUrl. + * @param disconnectUrl String value for disconnectUrl. * @return Builder */ public Builder disconnectUrl(String disconnectUrl) { @@ -710,7 +697,7 @@ public Builder disconnectUrl(String disconnectUrl) { /** * Setter for disconnectMethod. - * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. + * @param disconnectMethod DisconnectMethodEnum value for disconnectMethod. * @return Builder */ public Builder disconnectMethod(DisconnectMethodEnum disconnectMethod) { @@ -720,7 +707,7 @@ public Builder disconnectMethod(DisconnectMethodEnum disconnectMethod) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { @@ -730,7 +717,7 @@ public Builder tag(String tag) { /** * Setter for obfuscatedTo. - * @param obfuscatedTo String value for obfuscatedTo. + * @param obfuscatedTo String value for obfuscatedTo. * @return Builder */ public Builder obfuscatedTo(String obfuscatedTo) { @@ -740,7 +727,7 @@ public Builder obfuscatedTo(String obfuscatedTo) { /** * Setter for obfuscatedFrom. - * @param obfuscatedFrom String value for obfuscatedFrom. + * @param obfuscatedFrom String value for obfuscatedFrom. * @return Builder */ public Builder obfuscatedFrom(String obfuscatedFrom) { diff --git a/src/main/java/com/bandwidth/voice/models/ApiErrorResponse.java b/src/main/java/com/bandwidth/voice/models/ApiErrorResponse.java deleted file mode 100644 index 8d286e7e..00000000 --- a/src/main/java/com/bandwidth/voice/models/ApiErrorResponse.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * BandwidthLib - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -package com.bandwidth.voice.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSetter; - -/** - * This is a model class for ApiErrorResponse type. - */ -public class ApiErrorResponse { - @JsonInclude(JsonInclude.Include.NON_NULL) - private String type; - @JsonInclude(JsonInclude.Include.NON_NULL) - private String description; - @JsonInclude(JsonInclude.Include.NON_NULL) - private String id; - - /** - * Default constructor. - */ - public ApiErrorResponse() { - } - - /** - * Initialization constructor. - * @param type String value for type. - * @param description String value for description. - * @param id String value for id. - */ - public ApiErrorResponse( - String type, - String description, - String id) { - this.type = type; - this.description = description; - this.id = id; - } - - /** - * Getter for Type. - * @return Returns the String - */ - @JsonGetter("type") - public String getType() { - return type; - } - - /** - * Setter for Type. - * @param type Value for String - */ - @JsonSetter("type") - public void setType(String type) { - this.type = type; - } - - /** - * Getter for Description. - * @return Returns the String - */ - @JsonGetter("description") - public String getDescription() { - return description; - } - - /** - * Setter for Description. - * @param description Value for String - */ - @JsonSetter("description") - public void setDescription(String description) { - this.description = description; - } - - /** - * Getter for Id. - * @return Returns the String - */ - @JsonGetter("id") - public String getId() { - return id; - } - - /** - * Setter for Id. - * @param id Value for String - */ - @JsonSetter("id") - public void setId(String id) { - this.id = id; - } - - /** - * Converts this ApiErrorResponse into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "ApiErrorResponse [" + "type=" + type + ", description=" + description + ", id=" + id - + "]"; - } - - /** - * Builds a new {@link ApiErrorResponse.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link ApiErrorResponse.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .type(getType()) - .description(getDescription()) - .id(getId()); - return builder; - } - - /** - * Class to build instances of {@link ApiErrorResponse}. - */ - public static class Builder { - private String type; - private String description; - private String id; - - - - /** - * Setter for type. - * @param type String value for type. - * @return Builder - */ - public Builder type(String type) { - this.type = type; - return this; - } - - /** - * Setter for description. - * @param description String value for description. - * @return Builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Setter for id. - * @param id String value for id. - * @return Builder - */ - public Builder id(String id) { - this.id = id; - return this; - } - - /** - * Builds a new {@link ApiErrorResponse} object using the set fields. - * @return {@link ApiErrorResponse} - */ - public ApiErrorResponse build() { - return new ApiErrorResponse(type, description, id); - } - } -} diff --git a/src/main/java/com/bandwidth/voice/models/ApiModifyCallRequest.java b/src/main/java/com/bandwidth/voice/models/ApiModifyCallRequest.java index 8a3a7340..d83f1a46 100644 --- a/src/main/java/com/bandwidth/voice/models/ApiModifyCallRequest.java +++ b/src/main/java/com/bandwidth/voice/models/ApiModifyCallRequest.java @@ -7,31 +7,21 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for ApiModifyCallRequest type. */ public class ApiModifyCallRequest { - @JsonInclude(JsonInclude.Include.NON_NULL) private State1Enum state; private String redirectUrl; - @JsonInclude(JsonInclude.Include.NON_NULL) private String redirectFallbackUrl; - @JsonInclude(JsonInclude.Include.NON_NULL) private RedirectMethodEnum redirectMethod; - @JsonInclude(JsonInclude.Include.NON_NULL) private RedirectFallbackMethodEnum redirectFallbackMethod; - @JsonInclude(JsonInclude.Include.NON_NULL) private String username; - @JsonInclude(JsonInclude.Include.NON_NULL) private String password; - @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackUsername; - @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackPassword; - @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; /** @@ -42,16 +32,16 @@ public ApiModifyCallRequest() { /** * Initialization constructor. - * @param redirectUrl String value for redirectUrl. - * @param state State1Enum value for state. - * @param redirectFallbackUrl String value for redirectFallbackUrl. - * @param redirectMethod RedirectMethodEnum value for redirectMethod. - * @param redirectFallbackMethod RedirectFallbackMethodEnum value for redirectFallbackMethod. - * @param username String value for username. - * @param password String value for password. - * @param fallbackUsername String value for fallbackUsername. - * @param fallbackPassword String value for fallbackPassword. - * @param tag String value for tag. + * @param redirectUrl String value for redirectUrl. + * @param state State1Enum value for state. + * @param redirectFallbackUrl String value for redirectFallbackUrl. + * @param redirectMethod RedirectMethodEnum value for redirectMethod. + * @param redirectFallbackMethod RedirectFallbackMethodEnum value for redirectFallbackMethod. + * @param username String value for username. + * @param password String value for password. + * @param fallbackUsername String value for fallbackUsername. + * @param fallbackPassword String value for fallbackPassword. + * @param tag String value for tag. */ public ApiModifyCallRequest( String redirectUrl, @@ -82,7 +72,7 @@ public ApiModifyCallRequest( */ @JsonGetter("state") public State1Enum getState() { - return state; + return this.state; } /** @@ -100,7 +90,7 @@ public void setState(State1Enum state) { */ @JsonGetter("redirectUrl") public String getRedirectUrl() { - return redirectUrl; + return this.redirectUrl; } /** @@ -118,7 +108,7 @@ public void setRedirectUrl(String redirectUrl) { */ @JsonGetter("redirectFallbackUrl") public String getRedirectFallbackUrl() { - return redirectFallbackUrl; + return this.redirectFallbackUrl; } /** @@ -136,7 +126,7 @@ public void setRedirectFallbackUrl(String redirectFallbackUrl) { */ @JsonGetter("redirectMethod") public RedirectMethodEnum getRedirectMethod() { - return redirectMethod; + return this.redirectMethod; } /** @@ -154,7 +144,7 @@ public void setRedirectMethod(RedirectMethodEnum redirectMethod) { */ @JsonGetter("redirectFallbackMethod") public RedirectFallbackMethodEnum getRedirectFallbackMethod() { - return redirectFallbackMethod; + return this.redirectFallbackMethod; } /** @@ -172,7 +162,7 @@ public void setRedirectFallbackMethod(RedirectFallbackMethodEnum redirectFallbac */ @JsonGetter("username") public String getUsername() { - return username; + return this.username; } /** @@ -190,7 +180,7 @@ public void setUsername(String username) { */ @JsonGetter("password") public String getPassword() { - return password; + return this.password; } /** @@ -208,7 +198,7 @@ public void setPassword(String password) { */ @JsonGetter("fallbackUsername") public String getFallbackUsername() { - return fallbackUsername; + return this.fallbackUsername; } /** @@ -226,7 +216,7 @@ public void setFallbackUsername(String fallbackUsername) { */ @JsonGetter("fallbackPassword") public String getFallbackPassword() { - return fallbackPassword; + return this.fallbackPassword; } /** @@ -244,7 +234,7 @@ public void setFallbackPassword(String fallbackPassword) { */ @JsonGetter("tag") public String getTag() { - return tag; + return this.tag; } /** @@ -312,7 +302,7 @@ public Builder() { /** * Initialization constructor. - * @param redirectUrl String value for redirectUrl. + * @param redirectUrl String value for redirectUrl. */ public Builder(String redirectUrl) { this.redirectUrl = redirectUrl; @@ -320,7 +310,7 @@ public Builder(String redirectUrl) { /** * Setter for redirectUrl. - * @param redirectUrl String value for redirectUrl. + * @param redirectUrl String value for redirectUrl. * @return Builder */ public Builder redirectUrl(String redirectUrl) { @@ -330,7 +320,7 @@ public Builder redirectUrl(String redirectUrl) { /** * Setter for state. - * @param state State1Enum value for state. + * @param state State1Enum value for state. * @return Builder */ public Builder state(State1Enum state) { @@ -340,7 +330,7 @@ public Builder state(State1Enum state) { /** * Setter for redirectFallbackUrl. - * @param redirectFallbackUrl String value for redirectFallbackUrl. + * @param redirectFallbackUrl String value for redirectFallbackUrl. * @return Builder */ public Builder redirectFallbackUrl(String redirectFallbackUrl) { @@ -350,7 +340,7 @@ public Builder redirectFallbackUrl(String redirectFallbackUrl) { /** * Setter for redirectMethod. - * @param redirectMethod RedirectMethodEnum value for redirectMethod. + * @param redirectMethod RedirectMethodEnum value for redirectMethod. * @return Builder */ public Builder redirectMethod(RedirectMethodEnum redirectMethod) { @@ -360,8 +350,7 @@ public Builder redirectMethod(RedirectMethodEnum redirectMethod) { /** * Setter for redirectFallbackMethod. - * @param redirectFallbackMethod RedirectFallbackMethodEnum value for - * redirectFallbackMethod. + * @param redirectFallbackMethod RedirectFallbackMethodEnum value for redirectFallbackMethod. * @return Builder */ public Builder redirectFallbackMethod(RedirectFallbackMethodEnum redirectFallbackMethod) { @@ -371,7 +360,7 @@ public Builder redirectFallbackMethod(RedirectFallbackMethodEnum redirectFallbac /** * Setter for username. - * @param username String value for username. + * @param username String value for username. * @return Builder */ public Builder username(String username) { @@ -381,7 +370,7 @@ public Builder username(String username) { /** * Setter for password. - * @param password String value for password. + * @param password String value for password. * @return Builder */ public Builder password(String password) { @@ -391,7 +380,7 @@ public Builder password(String password) { /** * Setter for fallbackUsername. - * @param fallbackUsername String value for fallbackUsername. + * @param fallbackUsername String value for fallbackUsername. * @return Builder */ public Builder fallbackUsername(String fallbackUsername) { @@ -401,7 +390,7 @@ public Builder fallbackUsername(String fallbackUsername) { /** * Setter for fallbackPassword. - * @param fallbackPassword String value for fallbackPassword. + * @param fallbackPassword String value for fallbackPassword. * @return Builder */ public Builder fallbackPassword(String fallbackPassword) { @@ -411,7 +400,7 @@ public Builder fallbackPassword(String fallbackPassword) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { diff --git a/src/main/java/com/bandwidth/voice/models/ApiModifyConferenceRequest.java b/src/main/java/com/bandwidth/voice/models/ApiModifyConferenceRequest.java index 3ff78886..066fea32 100644 --- a/src/main/java/com/bandwidth/voice/models/ApiModifyConferenceRequest.java +++ b/src/main/java/com/bandwidth/voice/models/ApiModifyConferenceRequest.java @@ -7,30 +7,20 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for ApiModifyConferenceRequest type. */ public class ApiModifyConferenceRequest { - @JsonInclude(JsonInclude.Include.NON_NULL) private StatusEnum status; - @JsonInclude(JsonInclude.Include.NON_NULL) private String redirectUrl; - @JsonInclude(JsonInclude.Include.NON_NULL) private String redirectFallbackUrl; - @JsonInclude(JsonInclude.Include.NON_NULL) private RedirectMethodEnum redirectMethod; - @JsonInclude(JsonInclude.Include.NON_NULL) private RedirectFallbackMethodEnum redirectFallbackMethod; - @JsonInclude(JsonInclude.Include.NON_NULL) private String username; - @JsonInclude(JsonInclude.Include.NON_NULL) private String password; - @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackUsername; - @JsonInclude(JsonInclude.Include.NON_NULL) private String fallbackPassword; /** @@ -41,15 +31,15 @@ public ApiModifyConferenceRequest() { /** * Initialization constructor. - * @param status StatusEnum value for status. - * @param redirectUrl String value for redirectUrl. - * @param redirectFallbackUrl String value for redirectFallbackUrl. - * @param redirectMethod RedirectMethodEnum value for redirectMethod. - * @param redirectFallbackMethod RedirectFallbackMethodEnum value for redirectFallbackMethod. - * @param username String value for username. - * @param password String value for password. - * @param fallbackUsername String value for fallbackUsername. - * @param fallbackPassword String value for fallbackPassword. + * @param status StatusEnum value for status. + * @param redirectUrl String value for redirectUrl. + * @param redirectFallbackUrl String value for redirectFallbackUrl. + * @param redirectMethod RedirectMethodEnum value for redirectMethod. + * @param redirectFallbackMethod RedirectFallbackMethodEnum value for redirectFallbackMethod. + * @param username String value for username. + * @param password String value for password. + * @param fallbackUsername String value for fallbackUsername. + * @param fallbackPassword String value for fallbackPassword. */ public ApiModifyConferenceRequest( StatusEnum status, @@ -78,7 +68,7 @@ public ApiModifyConferenceRequest( */ @JsonGetter("status") public StatusEnum getStatus() { - return status; + return this.status; } /** @@ -96,7 +86,7 @@ public void setStatus(StatusEnum status) { */ @JsonGetter("redirectUrl") public String getRedirectUrl() { - return redirectUrl; + return this.redirectUrl; } /** @@ -114,7 +104,7 @@ public void setRedirectUrl(String redirectUrl) { */ @JsonGetter("redirectFallbackUrl") public String getRedirectFallbackUrl() { - return redirectFallbackUrl; + return this.redirectFallbackUrl; } /** @@ -132,7 +122,7 @@ public void setRedirectFallbackUrl(String redirectFallbackUrl) { */ @JsonGetter("redirectMethod") public RedirectMethodEnum getRedirectMethod() { - return redirectMethod; + return this.redirectMethod; } /** @@ -150,7 +140,7 @@ public void setRedirectMethod(RedirectMethodEnum redirectMethod) { */ @JsonGetter("redirectFallbackMethod") public RedirectFallbackMethodEnum getRedirectFallbackMethod() { - return redirectFallbackMethod; + return this.redirectFallbackMethod; } /** @@ -168,7 +158,7 @@ public void setRedirectFallbackMethod(RedirectFallbackMethodEnum redirectFallbac */ @JsonGetter("username") public String getUsername() { - return username; + return this.username; } /** @@ -186,7 +176,7 @@ public void setUsername(String username) { */ @JsonGetter("password") public String getPassword() { - return password; + return this.password; } /** @@ -204,7 +194,7 @@ public void setPassword(String password) { */ @JsonGetter("fallbackUsername") public String getFallbackUsername() { - return fallbackUsername; + return this.fallbackUsername; } /** @@ -222,7 +212,7 @@ public void setFallbackUsername(String fallbackUsername) { */ @JsonGetter("fallbackPassword") public String getFallbackPassword() { - return fallbackPassword; + return this.fallbackPassword; } /** @@ -284,7 +274,7 @@ public static class Builder { /** * Setter for status. - * @param status StatusEnum value for status. + * @param status StatusEnum value for status. * @return Builder */ public Builder status(StatusEnum status) { @@ -294,7 +284,7 @@ public Builder status(StatusEnum status) { /** * Setter for redirectUrl. - * @param redirectUrl String value for redirectUrl. + * @param redirectUrl String value for redirectUrl. * @return Builder */ public Builder redirectUrl(String redirectUrl) { @@ -304,7 +294,7 @@ public Builder redirectUrl(String redirectUrl) { /** * Setter for redirectFallbackUrl. - * @param redirectFallbackUrl String value for redirectFallbackUrl. + * @param redirectFallbackUrl String value for redirectFallbackUrl. * @return Builder */ public Builder redirectFallbackUrl(String redirectFallbackUrl) { @@ -314,7 +304,7 @@ public Builder redirectFallbackUrl(String redirectFallbackUrl) { /** * Setter for redirectMethod. - * @param redirectMethod RedirectMethodEnum value for redirectMethod. + * @param redirectMethod RedirectMethodEnum value for redirectMethod. * @return Builder */ public Builder redirectMethod(RedirectMethodEnum redirectMethod) { @@ -324,8 +314,7 @@ public Builder redirectMethod(RedirectMethodEnum redirectMethod) { /** * Setter for redirectFallbackMethod. - * @param redirectFallbackMethod RedirectFallbackMethodEnum value for - * redirectFallbackMethod. + * @param redirectFallbackMethod RedirectFallbackMethodEnum value for redirectFallbackMethod. * @return Builder */ public Builder redirectFallbackMethod(RedirectFallbackMethodEnum redirectFallbackMethod) { @@ -335,7 +324,7 @@ public Builder redirectFallbackMethod(RedirectFallbackMethodEnum redirectFallbac /** * Setter for username. - * @param username String value for username. + * @param username String value for username. * @return Builder */ public Builder username(String username) { @@ -345,7 +334,7 @@ public Builder username(String username) { /** * Setter for password. - * @param password String value for password. + * @param password String value for password. * @return Builder */ public Builder password(String password) { @@ -355,7 +344,7 @@ public Builder password(String password) { /** * Setter for fallbackUsername. - * @param fallbackUsername String value for fallbackUsername. + * @param fallbackUsername String value for fallbackUsername. * @return Builder */ public Builder fallbackUsername(String fallbackUsername) { @@ -365,7 +354,7 @@ public Builder fallbackUsername(String fallbackUsername) { /** * Setter for fallbackPassword. - * @param fallbackPassword String value for fallbackPassword. + * @param fallbackPassword String value for fallbackPassword. * @return Builder */ public Builder fallbackPassword(String fallbackPassword) { diff --git a/src/main/java/com/bandwidth/voice/models/ApiTranscribeRecordingRequest.java b/src/main/java/com/bandwidth/voice/models/ApiTranscribeRecordingRequest.java index a2ed1d1b..135a26b4 100644 --- a/src/main/java/com/bandwidth/voice/models/ApiTranscribeRecordingRequest.java +++ b/src/main/java/com/bandwidth/voice/models/ApiTranscribeRecordingRequest.java @@ -7,24 +7,17 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for ApiTranscribeRecordingRequest type. */ public class ApiTranscribeRecordingRequest { - @JsonInclude(JsonInclude.Include.NON_NULL) private String callbackUrl; - @JsonInclude(JsonInclude.Include.NON_NULL) private CallbackMethodEnum callbackMethod; - @JsonInclude(JsonInclude.Include.NON_NULL) private String username; - @JsonInclude(JsonInclude.Include.NON_NULL) private String password; - @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; - @JsonInclude(JsonInclude.Include.NON_NULL) private Double callbackTimeout; /** @@ -35,12 +28,12 @@ public ApiTranscribeRecordingRequest() { /** * Initialization constructor. - * @param callbackUrl String value for callbackUrl. - * @param callbackMethod CallbackMethodEnum value for callbackMethod. - * @param username String value for username. - * @param password String value for password. - * @param tag String value for tag. - * @param callbackTimeout Double value for callbackTimeout. + * @param callbackUrl String value for callbackUrl. + * @param callbackMethod CallbackMethodEnum value for callbackMethod. + * @param username String value for username. + * @param password String value for password. + * @param tag String value for tag. + * @param callbackTimeout Double value for callbackTimeout. */ public ApiTranscribeRecordingRequest( String callbackUrl, @@ -63,7 +56,7 @@ public ApiTranscribeRecordingRequest( */ @JsonGetter("callbackUrl") public String getCallbackUrl() { - return callbackUrl; + return this.callbackUrl; } /** @@ -81,7 +74,7 @@ public void setCallbackUrl(String callbackUrl) { */ @JsonGetter("callbackMethod") public CallbackMethodEnum getCallbackMethod() { - return callbackMethod; + return this.callbackMethod; } /** @@ -99,7 +92,7 @@ public void setCallbackMethod(CallbackMethodEnum callbackMethod) { */ @JsonGetter("username") public String getUsername() { - return username; + return this.username; } /** @@ -117,7 +110,7 @@ public void setUsername(String username) { */ @JsonGetter("password") public String getPassword() { - return password; + return this.password; } /** @@ -135,7 +128,7 @@ public void setPassword(String password) { */ @JsonGetter("tag") public String getTag() { - return tag; + return this.tag; } /** @@ -153,7 +146,7 @@ public void setTag(String tag) { */ @JsonGetter("callbackTimeout") public Double getCallbackTimeout() { - return callbackTimeout; + return this.callbackTimeout; } /** @@ -207,7 +200,7 @@ public static class Builder { /** * Setter for callbackUrl. - * @param callbackUrl String value for callbackUrl. + * @param callbackUrl String value for callbackUrl. * @return Builder */ public Builder callbackUrl(String callbackUrl) { @@ -217,7 +210,7 @@ public Builder callbackUrl(String callbackUrl) { /** * Setter for callbackMethod. - * @param callbackMethod CallbackMethodEnum value for callbackMethod. + * @param callbackMethod CallbackMethodEnum value for callbackMethod. * @return Builder */ public Builder callbackMethod(CallbackMethodEnum callbackMethod) { @@ -227,7 +220,7 @@ public Builder callbackMethod(CallbackMethodEnum callbackMethod) { /** * Setter for username. - * @param username String value for username. + * @param username String value for username. * @return Builder */ public Builder username(String username) { @@ -237,7 +230,7 @@ public Builder username(String username) { /** * Setter for password. - * @param password String value for password. + * @param password String value for password. * @return Builder */ public Builder password(String password) { @@ -247,7 +240,7 @@ public Builder password(String password) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { @@ -257,7 +250,7 @@ public Builder tag(String tag) { /** * Setter for callbackTimeout. - * @param callbackTimeout Double value for callbackTimeout. + * @param callbackTimeout Double value for callbackTimeout. * @return Builder */ public Builder callbackTimeout(Double callbackTimeout) { diff --git a/src/main/java/com/bandwidth/voice/models/ConferenceDetail.java b/src/main/java/com/bandwidth/voice/models/ConferenceDetail.java index ebc7e704..b371afe4 100644 --- a/src/main/java/com/bandwidth/voice/models/ConferenceDetail.java +++ b/src/main/java/com/bandwidth/voice/models/ConferenceDetail.java @@ -8,7 +8,6 @@ import com.bandwidth.DateTimeHelper; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -19,21 +18,13 @@ * This is a model class for ConferenceDetail type. */ public class ConferenceDetail { - @JsonInclude(JsonInclude.Include.NON_NULL) private String id; - @JsonInclude(JsonInclude.Include.NON_NULL) private String name; - @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime createdTime; - @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime completedTime; - @JsonInclude(JsonInclude.Include.NON_NULL) private String conferenceEventUrl; - @JsonInclude(JsonInclude.Include.NON_NULL) private ConferenceEventMethodEnum conferenceEventMethod; - @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; - @JsonInclude(JsonInclude.Include.NON_NULL) private List activeMembers; /** @@ -44,14 +35,14 @@ public ConferenceDetail() { /** * Initialization constructor. - * @param id String value for id. - * @param name String value for name. - * @param createdTime LocalDateTime value for createdTime. - * @param completedTime LocalDateTime value for completedTime. - * @param conferenceEventUrl String value for conferenceEventUrl. - * @param conferenceEventMethod ConferenceEventMethodEnum value for conferenceEventMethod. - * @param tag String value for tag. - * @param activeMembers List of ConferenceMemberDetail value for activeMembers. + * @param id String value for id. + * @param name String value for name. + * @param createdTime LocalDateTime value for createdTime. + * @param completedTime LocalDateTime value for completedTime. + * @param conferenceEventUrl String value for conferenceEventUrl. + * @param conferenceEventMethod ConferenceEventMethodEnum value for conferenceEventMethod. + * @param tag String value for tag. + * @param activeMembers List of ConferenceMemberDetail value for activeMembers. */ public ConferenceDetail( String id, @@ -78,7 +69,7 @@ public ConferenceDetail( */ @JsonGetter("id") public String getId() { - return id; + return this.id; } /** @@ -96,7 +87,7 @@ public void setId(String id) { */ @JsonGetter("name") public String getName() { - return name; + return this.name; } /** @@ -115,7 +106,7 @@ public void setName(String name) { @JsonGetter("createdTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getCreatedTime() { - return createdTime; + return this.createdTime; } /** @@ -135,7 +126,7 @@ public void setCreatedTime(LocalDateTime createdTime) { @JsonGetter("completedTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getCompletedTime() { - return completedTime; + return this.completedTime; } /** @@ -154,7 +145,7 @@ public void setCompletedTime(LocalDateTime completedTime) { */ @JsonGetter("conferenceEventUrl") public String getConferenceEventUrl() { - return conferenceEventUrl; + return this.conferenceEventUrl; } /** @@ -172,7 +163,7 @@ public void setConferenceEventUrl(String conferenceEventUrl) { */ @JsonGetter("conferenceEventMethod") public ConferenceEventMethodEnum getConferenceEventMethod() { - return conferenceEventMethod; + return this.conferenceEventMethod; } /** @@ -190,7 +181,7 @@ public void setConferenceEventMethod(ConferenceEventMethodEnum conferenceEventMe */ @JsonGetter("tag") public String getTag() { - return tag; + return this.tag; } /** @@ -208,7 +199,7 @@ public void setTag(String tag) { */ @JsonGetter("activeMembers") public List getActiveMembers() { - return activeMembers; + return this.activeMembers; } /** @@ -267,7 +258,7 @@ public static class Builder { /** * Setter for id. - * @param id String value for id. + * @param id String value for id. * @return Builder */ public Builder id(String id) { @@ -277,7 +268,7 @@ public Builder id(String id) { /** * Setter for name. - * @param name String value for name. + * @param name String value for name. * @return Builder */ public Builder name(String name) { @@ -287,7 +278,7 @@ public Builder name(String name) { /** * Setter for createdTime. - * @param createdTime LocalDateTime value for createdTime. + * @param createdTime LocalDateTime value for createdTime. * @return Builder */ public Builder createdTime(LocalDateTime createdTime) { @@ -297,7 +288,7 @@ public Builder createdTime(LocalDateTime createdTime) { /** * Setter for completedTime. - * @param completedTime LocalDateTime value for completedTime. + * @param completedTime LocalDateTime value for completedTime. * @return Builder */ public Builder completedTime(LocalDateTime completedTime) { @@ -307,7 +298,7 @@ public Builder completedTime(LocalDateTime completedTime) { /** * Setter for conferenceEventUrl. - * @param conferenceEventUrl String value for conferenceEventUrl. + * @param conferenceEventUrl String value for conferenceEventUrl. * @return Builder */ public Builder conferenceEventUrl(String conferenceEventUrl) { @@ -317,7 +308,7 @@ public Builder conferenceEventUrl(String conferenceEventUrl) { /** * Setter for conferenceEventMethod. - * @param conferenceEventMethod ConferenceEventMethodEnum value for conferenceEventMethod. + * @param conferenceEventMethod ConferenceEventMethodEnum value for conferenceEventMethod. * @return Builder */ public Builder conferenceEventMethod(ConferenceEventMethodEnum conferenceEventMethod) { @@ -327,7 +318,7 @@ public Builder conferenceEventMethod(ConferenceEventMethodEnum conferenceEventMe /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { @@ -337,7 +328,7 @@ public Builder tag(String tag) { /** * Setter for activeMembers. - * @param activeMembers List of ConferenceMemberDetail value for activeMembers. + * @param activeMembers List of ConferenceMemberDetail value for activeMembers. * @return Builder */ public Builder activeMembers(List activeMembers) { diff --git a/src/main/java/com/bandwidth/voice/models/ConferenceMemberDetail.java b/src/main/java/com/bandwidth/voice/models/ConferenceMemberDetail.java index 54d8c389..26fd91af 100644 --- a/src/main/java/com/bandwidth/voice/models/ConferenceMemberDetail.java +++ b/src/main/java/com/bandwidth/voice/models/ConferenceMemberDetail.java @@ -7,7 +7,6 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import java.util.List; @@ -15,17 +14,11 @@ * This is a model class for ConferenceMemberDetail type. */ public class ConferenceMemberDetail { - @JsonInclude(JsonInclude.Include.NON_NULL) private String callId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String conferenceId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String memberUrl; - @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean mute; - @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean hold; - @JsonInclude(JsonInclude.Include.NON_NULL) private List callIdsToCoach; /** @@ -36,12 +29,12 @@ public ConferenceMemberDetail() { /** * Initialization constructor. - * @param callId String value for callId. - * @param conferenceId String value for conferenceId. - * @param memberUrl String value for memberUrl. - * @param mute Boolean value for mute. - * @param hold Boolean value for hold. - * @param callIdsToCoach List of String value for callIdsToCoach. + * @param callId String value for callId. + * @param conferenceId String value for conferenceId. + * @param memberUrl String value for memberUrl. + * @param mute Boolean value for mute. + * @param hold Boolean value for hold. + * @param callIdsToCoach List of String value for callIdsToCoach. */ public ConferenceMemberDetail( String callId, @@ -64,7 +57,7 @@ public ConferenceMemberDetail( */ @JsonGetter("callId") public String getCallId() { - return callId; + return this.callId; } /** @@ -82,7 +75,7 @@ public void setCallId(String callId) { */ @JsonGetter("conferenceId") public String getConferenceId() { - return conferenceId; + return this.conferenceId; } /** @@ -100,7 +93,7 @@ public void setConferenceId(String conferenceId) { */ @JsonGetter("memberUrl") public String getMemberUrl() { - return memberUrl; + return this.memberUrl; } /** @@ -118,7 +111,7 @@ public void setMemberUrl(String memberUrl) { */ @JsonGetter("mute") public Boolean getMute() { - return mute; + return this.mute; } /** @@ -136,7 +129,7 @@ public void setMute(Boolean mute) { */ @JsonGetter("hold") public Boolean getHold() { - return hold; + return this.hold; } /** @@ -154,7 +147,7 @@ public void setHold(Boolean hold) { */ @JsonGetter("callIdsToCoach") public List getCallIdsToCoach() { - return callIdsToCoach; + return this.callIdsToCoach; } /** @@ -208,7 +201,7 @@ public static class Builder { /** * Setter for callId. - * @param callId String value for callId. + * @param callId String value for callId. * @return Builder */ public Builder callId(String callId) { @@ -218,7 +211,7 @@ public Builder callId(String callId) { /** * Setter for conferenceId. - * @param conferenceId String value for conferenceId. + * @param conferenceId String value for conferenceId. * @return Builder */ public Builder conferenceId(String conferenceId) { @@ -228,7 +221,7 @@ public Builder conferenceId(String conferenceId) { /** * Setter for memberUrl. - * @param memberUrl String value for memberUrl. + * @param memberUrl String value for memberUrl. * @return Builder */ public Builder memberUrl(String memberUrl) { @@ -238,7 +231,7 @@ public Builder memberUrl(String memberUrl) { /** * Setter for mute. - * @param mute Boolean value for mute. + * @param mute Boolean value for mute. * @return Builder */ public Builder mute(Boolean mute) { @@ -248,7 +241,7 @@ public Builder mute(Boolean mute) { /** * Setter for hold. - * @param hold Boolean value for hold. + * @param hold Boolean value for hold. * @return Builder */ public Builder hold(Boolean hold) { @@ -258,7 +251,7 @@ public Builder hold(Boolean hold) { /** * Setter for callIdsToCoach. - * @param callIdsToCoach List of String value for callIdsToCoach. + * @param callIdsToCoach List of String value for callIdsToCoach. * @return Builder */ public Builder callIdsToCoach(List callIdsToCoach) { diff --git a/src/main/java/com/bandwidth/voice/models/ConferenceRecordingMetadataResponse.java b/src/main/java/com/bandwidth/voice/models/ConferenceRecordingMetadataResponse.java index 80258adf..b1dfbec2 100644 --- a/src/main/java/com/bandwidth/voice/models/ConferenceRecordingMetadataResponse.java +++ b/src/main/java/com/bandwidth/voice/models/ConferenceRecordingMetadataResponse.java @@ -8,7 +8,6 @@ import com.bandwidth.DateTimeHelper; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -18,27 +17,16 @@ * This is a model class for ConferenceRecordingMetadataResponse type. */ public class ConferenceRecordingMetadataResponse { - @JsonInclude(JsonInclude.Include.NON_NULL) private String accountId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String conferenceId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String name; - @JsonInclude(JsonInclude.Include.NON_NULL) private String recordingId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String duration; - @JsonInclude(JsonInclude.Include.NON_NULL) private Integer channels; - @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime startTime; - @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime endTime; - @JsonInclude(JsonInclude.Include.NON_NULL) private FileFormatEnum fileFormat; - @JsonInclude(JsonInclude.Include.NON_NULL) private Status1Enum status; - @JsonInclude(JsonInclude.Include.NON_NULL) private String mediaUrl; /** @@ -49,17 +37,17 @@ public ConferenceRecordingMetadataResponse() { /** * Initialization constructor. - * @param accountId String value for accountId. - * @param conferenceId String value for conferenceId. - * @param name String value for name. - * @param recordingId String value for recordingId. - * @param duration String value for duration. - * @param channels Integer value for channels. - * @param startTime LocalDateTime value for startTime. - * @param endTime LocalDateTime value for endTime. - * @param fileFormat FileFormatEnum value for fileFormat. - * @param status Status1Enum value for status. - * @param mediaUrl String value for mediaUrl. + * @param accountId String value for accountId. + * @param conferenceId String value for conferenceId. + * @param name String value for name. + * @param recordingId String value for recordingId. + * @param duration String value for duration. + * @param channels Integer value for channels. + * @param startTime LocalDateTime value for startTime. + * @param endTime LocalDateTime value for endTime. + * @param fileFormat FileFormatEnum value for fileFormat. + * @param status Status1Enum value for status. + * @param mediaUrl String value for mediaUrl. */ public ConferenceRecordingMetadataResponse( String accountId, @@ -92,7 +80,7 @@ public ConferenceRecordingMetadataResponse( */ @JsonGetter("accountId") public String getAccountId() { - return accountId; + return this.accountId; } /** @@ -110,7 +98,7 @@ public void setAccountId(String accountId) { */ @JsonGetter("conferenceId") public String getConferenceId() { - return conferenceId; + return this.conferenceId; } /** @@ -128,7 +116,7 @@ public void setConferenceId(String conferenceId) { */ @JsonGetter("name") public String getName() { - return name; + return this.name; } /** @@ -146,7 +134,7 @@ public void setName(String name) { */ @JsonGetter("recordingId") public String getRecordingId() { - return recordingId; + return this.recordingId; } /** @@ -165,7 +153,7 @@ public void setRecordingId(String recordingId) { */ @JsonGetter("duration") public String getDuration() { - return duration; + return this.duration; } /** @@ -184,7 +172,7 @@ public void setDuration(String duration) { */ @JsonGetter("channels") public Integer getChannels() { - return channels; + return this.channels; } /** @@ -203,7 +191,7 @@ public void setChannels(Integer channels) { @JsonGetter("startTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getStartTime() { - return startTime; + return this.startTime; } /** @@ -223,7 +211,7 @@ public void setStartTime(LocalDateTime startTime) { @JsonGetter("endTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getEndTime() { - return endTime; + return this.endTime; } /** @@ -242,7 +230,7 @@ public void setEndTime(LocalDateTime endTime) { */ @JsonGetter("fileFormat") public FileFormatEnum getFileFormat() { - return fileFormat; + return this.fileFormat; } /** @@ -260,7 +248,7 @@ public void setFileFormat(FileFormatEnum fileFormat) { */ @JsonGetter("status") public Status1Enum getStatus() { - return status; + return this.status; } /** @@ -278,7 +266,7 @@ public void setStatus(Status1Enum status) { */ @JsonGetter("mediaUrl") public String getMediaUrl() { - return mediaUrl; + return this.mediaUrl; } /** @@ -344,7 +332,7 @@ public static class Builder { /** * Setter for accountId. - * @param accountId String value for accountId. + * @param accountId String value for accountId. * @return Builder */ public Builder accountId(String accountId) { @@ -354,7 +342,7 @@ public Builder accountId(String accountId) { /** * Setter for conferenceId. - * @param conferenceId String value for conferenceId. + * @param conferenceId String value for conferenceId. * @return Builder */ public Builder conferenceId(String conferenceId) { @@ -364,7 +352,7 @@ public Builder conferenceId(String conferenceId) { /** * Setter for name. - * @param name String value for name. + * @param name String value for name. * @return Builder */ public Builder name(String name) { @@ -374,7 +362,7 @@ public Builder name(String name) { /** * Setter for recordingId. - * @param recordingId String value for recordingId. + * @param recordingId String value for recordingId. * @return Builder */ public Builder recordingId(String recordingId) { @@ -384,7 +372,7 @@ public Builder recordingId(String recordingId) { /** * Setter for duration. - * @param duration String value for duration. + * @param duration String value for duration. * @return Builder */ public Builder duration(String duration) { @@ -394,7 +382,7 @@ public Builder duration(String duration) { /** * Setter for channels. - * @param channels Integer value for channels. + * @param channels Integer value for channels. * @return Builder */ public Builder channels(Integer channels) { @@ -404,7 +392,7 @@ public Builder channels(Integer channels) { /** * Setter for startTime. - * @param startTime LocalDateTime value for startTime. + * @param startTime LocalDateTime value for startTime. * @return Builder */ public Builder startTime(LocalDateTime startTime) { @@ -414,7 +402,7 @@ public Builder startTime(LocalDateTime startTime) { /** * Setter for endTime. - * @param endTime LocalDateTime value for endTime. + * @param endTime LocalDateTime value for endTime. * @return Builder */ public Builder endTime(LocalDateTime endTime) { @@ -424,7 +412,7 @@ public Builder endTime(LocalDateTime endTime) { /** * Setter for fileFormat. - * @param fileFormat FileFormatEnum value for fileFormat. + * @param fileFormat FileFormatEnum value for fileFormat. * @return Builder */ public Builder fileFormat(FileFormatEnum fileFormat) { @@ -434,7 +422,7 @@ public Builder fileFormat(FileFormatEnum fileFormat) { /** * Setter for status. - * @param status Status1Enum value for status. + * @param status Status1Enum value for status. * @return Builder */ public Builder status(Status1Enum status) { @@ -444,7 +432,7 @@ public Builder status(Status1Enum status) { /** * Setter for mediaUrl. - * @param mediaUrl String value for mediaUrl. + * @param mediaUrl String value for mediaUrl. * @return Builder */ public Builder mediaUrl(String mediaUrl) { diff --git a/src/main/java/com/bandwidth/voice/models/ModifyCallRecordingState.java b/src/main/java/com/bandwidth/voice/models/ModifyCallRecordingState.java index 185a1598..2156ef20 100644 --- a/src/main/java/com/bandwidth/voice/models/ModifyCallRecordingState.java +++ b/src/main/java/com/bandwidth/voice/models/ModifyCallRecordingState.java @@ -23,7 +23,7 @@ public ModifyCallRecordingState() { /** * Initialization constructor. - * @param state State2Enum value for state. + * @param state State2Enum value for state. */ public ModifyCallRecordingState( State2Enum state) { @@ -36,7 +36,7 @@ public ModifyCallRecordingState( */ @JsonGetter("state") public State2Enum getState() { - return state; + return this.state; } /** @@ -81,7 +81,7 @@ public Builder() { /** * Initialization constructor. - * @param state State2Enum value for state. + * @param state State2Enum value for state. */ public Builder(State2Enum state) { this.state = state; @@ -89,7 +89,7 @@ public Builder(State2Enum state) { /** * Setter for state. - * @param state State2Enum value for state. + * @param state State2Enum value for state. * @return Builder */ public Builder state(State2Enum state) { diff --git a/src/main/java/com/bandwidth/voice/models/RecordingMetadataResponse.java b/src/main/java/com/bandwidth/voice/models/RecordingMetadataResponse.java index c064b411..21fbeff8 100644 --- a/src/main/java/com/bandwidth/voice/models/RecordingMetadataResponse.java +++ b/src/main/java/com/bandwidth/voice/models/RecordingMetadataResponse.java @@ -8,7 +8,6 @@ import com.bandwidth.DateTimeHelper; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -18,41 +17,23 @@ * This is a model class for RecordingMetadataResponse type. */ public class RecordingMetadataResponse { - @JsonInclude(JsonInclude.Include.NON_NULL) private String applicationId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String accountId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String callId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String parentCallId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String recordingId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String to; - @JsonInclude(JsonInclude.Include.NON_NULL) private String from; - @JsonInclude(JsonInclude.Include.NON_NULL) private String transferCallerId; - @JsonInclude(JsonInclude.Include.NON_NULL) private String transferTo; - @JsonInclude(JsonInclude.Include.NON_NULL) private String duration; - @JsonInclude(JsonInclude.Include.NON_NULL) private DirectionEnum direction; - @JsonInclude(JsonInclude.Include.NON_NULL) private Integer channels; - @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime startTime; - @JsonInclude(JsonInclude.Include.NON_NULL) private LocalDateTime endTime; - @JsonInclude(JsonInclude.Include.NON_NULL) private FileFormatEnum fileFormat; - @JsonInclude(JsonInclude.Include.NON_NULL) private Status1Enum status; - @JsonInclude(JsonInclude.Include.NON_NULL) private String mediaUrl; - @JsonInclude(JsonInclude.Include.NON_NULL) private Transcription transcription; /** @@ -63,24 +44,24 @@ public RecordingMetadataResponse() { /** * Initialization constructor. - * @param applicationId String value for applicationId. - * @param accountId String value for accountId. - * @param callId String value for callId. - * @param parentCallId String value for parentCallId. - * @param recordingId String value for recordingId. - * @param to String value for to. - * @param from String value for from. - * @param transferCallerId String value for transferCallerId. - * @param transferTo String value for transferTo. - * @param duration String value for duration. - * @param direction DirectionEnum value for direction. - * @param channels Integer value for channels. - * @param startTime LocalDateTime value for startTime. - * @param endTime LocalDateTime value for endTime. - * @param fileFormat FileFormatEnum value for fileFormat. - * @param status Status1Enum value for status. - * @param mediaUrl String value for mediaUrl. - * @param transcription Transcription value for transcription. + * @param applicationId String value for applicationId. + * @param accountId String value for accountId. + * @param callId String value for callId. + * @param parentCallId String value for parentCallId. + * @param recordingId String value for recordingId. + * @param to String value for to. + * @param from String value for from. + * @param transferCallerId String value for transferCallerId. + * @param transferTo String value for transferTo. + * @param duration String value for duration. + * @param direction DirectionEnum value for direction. + * @param channels Integer value for channels. + * @param startTime LocalDateTime value for startTime. + * @param endTime LocalDateTime value for endTime. + * @param fileFormat FileFormatEnum value for fileFormat. + * @param status Status1Enum value for status. + * @param mediaUrl String value for mediaUrl. + * @param transcription Transcription value for transcription. */ public RecordingMetadataResponse( String applicationId, @@ -127,7 +108,7 @@ public RecordingMetadataResponse( */ @JsonGetter("applicationId") public String getApplicationId() { - return applicationId; + return this.applicationId; } /** @@ -145,7 +126,7 @@ public void setApplicationId(String applicationId) { */ @JsonGetter("accountId") public String getAccountId() { - return accountId; + return this.accountId; } /** @@ -163,7 +144,7 @@ public void setAccountId(String accountId) { */ @JsonGetter("callId") public String getCallId() { - return callId; + return this.callId; } /** @@ -181,7 +162,7 @@ public void setCallId(String callId) { */ @JsonGetter("parentCallId") public String getParentCallId() { - return parentCallId; + return this.parentCallId; } /** @@ -199,7 +180,7 @@ public void setParentCallId(String parentCallId) { */ @JsonGetter("recordingId") public String getRecordingId() { - return recordingId; + return this.recordingId; } /** @@ -217,7 +198,7 @@ public void setRecordingId(String recordingId) { */ @JsonGetter("to") public String getTo() { - return to; + return this.to; } /** @@ -235,7 +216,7 @@ public void setTo(String to) { */ @JsonGetter("from") public String getFrom() { - return from; + return this.from; } /** @@ -253,7 +234,7 @@ public void setFrom(String from) { */ @JsonGetter("transferCallerId") public String getTransferCallerId() { - return transferCallerId; + return this.transferCallerId; } /** @@ -271,7 +252,7 @@ public void setTransferCallerId(String transferCallerId) { */ @JsonGetter("transferTo") public String getTransferTo() { - return transferTo; + return this.transferTo; } /** @@ -290,7 +271,7 @@ public void setTransferTo(String transferTo) { */ @JsonGetter("duration") public String getDuration() { - return duration; + return this.duration; } /** @@ -309,7 +290,7 @@ public void setDuration(String duration) { */ @JsonGetter("direction") public DirectionEnum getDirection() { - return direction; + return this.direction; } /** @@ -327,7 +308,7 @@ public void setDirection(DirectionEnum direction) { */ @JsonGetter("channels") public Integer getChannels() { - return channels; + return this.channels; } /** @@ -346,7 +327,7 @@ public void setChannels(Integer channels) { @JsonGetter("startTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getStartTime() { - return startTime; + return this.startTime; } /** @@ -366,7 +347,7 @@ public void setStartTime(LocalDateTime startTime) { @JsonGetter("endTime") @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) public LocalDateTime getEndTime() { - return endTime; + return this.endTime; } /** @@ -385,7 +366,7 @@ public void setEndTime(LocalDateTime endTime) { */ @JsonGetter("fileFormat") public FileFormatEnum getFileFormat() { - return fileFormat; + return this.fileFormat; } /** @@ -403,7 +384,7 @@ public void setFileFormat(FileFormatEnum fileFormat) { */ @JsonGetter("status") public Status1Enum getStatus() { - return status; + return this.status; } /** @@ -421,7 +402,7 @@ public void setStatus(Status1Enum status) { */ @JsonGetter("mediaUrl") public String getMediaUrl() { - return mediaUrl; + return this.mediaUrl; } /** @@ -439,7 +420,7 @@ public void setMediaUrl(String mediaUrl) { */ @JsonGetter("transcription") public Transcription getTranscription() { - return transcription; + return this.transcription; } /** @@ -522,7 +503,7 @@ public static class Builder { /** * Setter for applicationId. - * @param applicationId String value for applicationId. + * @param applicationId String value for applicationId. * @return Builder */ public Builder applicationId(String applicationId) { @@ -532,7 +513,7 @@ public Builder applicationId(String applicationId) { /** * Setter for accountId. - * @param accountId String value for accountId. + * @param accountId String value for accountId. * @return Builder */ public Builder accountId(String accountId) { @@ -542,7 +523,7 @@ public Builder accountId(String accountId) { /** * Setter for callId. - * @param callId String value for callId. + * @param callId String value for callId. * @return Builder */ public Builder callId(String callId) { @@ -552,7 +533,7 @@ public Builder callId(String callId) { /** * Setter for parentCallId. - * @param parentCallId String value for parentCallId. + * @param parentCallId String value for parentCallId. * @return Builder */ public Builder parentCallId(String parentCallId) { @@ -562,7 +543,7 @@ public Builder parentCallId(String parentCallId) { /** * Setter for recordingId. - * @param recordingId String value for recordingId. + * @param recordingId String value for recordingId. * @return Builder */ public Builder recordingId(String recordingId) { @@ -572,7 +553,7 @@ public Builder recordingId(String recordingId) { /** * Setter for to. - * @param to String value for to. + * @param to String value for to. * @return Builder */ public Builder to(String to) { @@ -582,7 +563,7 @@ public Builder to(String to) { /** * Setter for from. - * @param from String value for from. + * @param from String value for from. * @return Builder */ public Builder from(String from) { @@ -592,7 +573,7 @@ public Builder from(String from) { /** * Setter for transferCallerId. - * @param transferCallerId String value for transferCallerId. + * @param transferCallerId String value for transferCallerId. * @return Builder */ public Builder transferCallerId(String transferCallerId) { @@ -602,7 +583,7 @@ public Builder transferCallerId(String transferCallerId) { /** * Setter for transferTo. - * @param transferTo String value for transferTo. + * @param transferTo String value for transferTo. * @return Builder */ public Builder transferTo(String transferTo) { @@ -612,7 +593,7 @@ public Builder transferTo(String transferTo) { /** * Setter for duration. - * @param duration String value for duration. + * @param duration String value for duration. * @return Builder */ public Builder duration(String duration) { @@ -622,7 +603,7 @@ public Builder duration(String duration) { /** * Setter for direction. - * @param direction DirectionEnum value for direction. + * @param direction DirectionEnum value for direction. * @return Builder */ public Builder direction(DirectionEnum direction) { @@ -632,7 +613,7 @@ public Builder direction(DirectionEnum direction) { /** * Setter for channels. - * @param channels Integer value for channels. + * @param channels Integer value for channels. * @return Builder */ public Builder channels(Integer channels) { @@ -642,7 +623,7 @@ public Builder channels(Integer channels) { /** * Setter for startTime. - * @param startTime LocalDateTime value for startTime. + * @param startTime LocalDateTime value for startTime. * @return Builder */ public Builder startTime(LocalDateTime startTime) { @@ -652,7 +633,7 @@ public Builder startTime(LocalDateTime startTime) { /** * Setter for endTime. - * @param endTime LocalDateTime value for endTime. + * @param endTime LocalDateTime value for endTime. * @return Builder */ public Builder endTime(LocalDateTime endTime) { @@ -662,7 +643,7 @@ public Builder endTime(LocalDateTime endTime) { /** * Setter for fileFormat. - * @param fileFormat FileFormatEnum value for fileFormat. + * @param fileFormat FileFormatEnum value for fileFormat. * @return Builder */ public Builder fileFormat(FileFormatEnum fileFormat) { @@ -672,7 +653,7 @@ public Builder fileFormat(FileFormatEnum fileFormat) { /** * Setter for status. - * @param status Status1Enum value for status. + * @param status Status1Enum value for status. * @return Builder */ public Builder status(Status1Enum status) { @@ -682,7 +663,7 @@ public Builder status(Status1Enum status) { /** * Setter for mediaUrl. - * @param mediaUrl String value for mediaUrl. + * @param mediaUrl String value for mediaUrl. * @return Builder */ public Builder mediaUrl(String mediaUrl) { @@ -692,7 +673,7 @@ public Builder mediaUrl(String mediaUrl) { /** * Setter for transcription. - * @param transcription Transcription value for transcription. + * @param transcription Transcription value for transcription. * @return Builder */ public Builder transcription(Transcription transcription) { diff --git a/src/main/java/com/bandwidth/voice/models/Transcript.java b/src/main/java/com/bandwidth/voice/models/Transcript.java index 74c96bec..46345064 100644 --- a/src/main/java/com/bandwidth/voice/models/Transcript.java +++ b/src/main/java/com/bandwidth/voice/models/Transcript.java @@ -7,16 +7,13 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for Transcript type. */ public class Transcript { - @JsonInclude(JsonInclude.Include.NON_NULL) private String text; - @JsonInclude(JsonInclude.Include.NON_NULL) private Double confidence; /** @@ -27,8 +24,8 @@ public Transcript() { /** * Initialization constructor. - * @param text String value for text. - * @param confidence Double value for confidence. + * @param text String value for text. + * @param confidence Double value for confidence. */ public Transcript( String text, @@ -43,7 +40,7 @@ public Transcript( */ @JsonGetter("text") public String getText() { - return text; + return this.text; } /** @@ -61,7 +58,7 @@ public void setText(String text) { */ @JsonGetter("confidence") public Double getConfidence() { - return confidence; + return this.confidence; } /** @@ -105,7 +102,7 @@ public static class Builder { /** * Setter for text. - * @param text String value for text. + * @param text String value for text. * @return Builder */ public Builder text(String text) { @@ -115,7 +112,7 @@ public Builder text(String text) { /** * Setter for confidence. - * @param confidence Double value for confidence. + * @param confidence Double value for confidence. * @return Builder */ public Builder confidence(Double confidence) { diff --git a/src/main/java/com/bandwidth/voice/models/Transcription.java b/src/main/java/com/bandwidth/voice/models/Transcription.java index a7f88d3d..408cf3f1 100644 --- a/src/main/java/com/bandwidth/voice/models/Transcription.java +++ b/src/main/java/com/bandwidth/voice/models/Transcription.java @@ -7,20 +7,15 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for Transcription type. */ public class Transcription { - @JsonInclude(JsonInclude.Include.NON_NULL) private String id; - @JsonInclude(JsonInclude.Include.NON_NULL) private Status3Enum status; - @JsonInclude(JsonInclude.Include.NON_NULL) private String completedTime; - @JsonInclude(JsonInclude.Include.NON_NULL) private String url; /** @@ -31,10 +26,10 @@ public Transcription() { /** * Initialization constructor. - * @param id String value for id. - * @param status Status3Enum value for status. - * @param completedTime String value for completedTime. - * @param url String value for url. + * @param id String value for id. + * @param status Status3Enum value for status. + * @param completedTime String value for completedTime. + * @param url String value for url. */ public Transcription( String id, @@ -53,7 +48,7 @@ public Transcription( */ @JsonGetter("id") public String getId() { - return id; + return this.id; } /** @@ -71,7 +66,7 @@ public void setId(String id) { */ @JsonGetter("status") public Status3Enum getStatus() { - return status; + return this.status; } /** @@ -89,7 +84,7 @@ public void setStatus(Status3Enum status) { */ @JsonGetter("completedTime") public String getCompletedTime() { - return completedTime; + return this.completedTime; } /** @@ -107,7 +102,7 @@ public void setCompletedTime(String completedTime) { */ @JsonGetter("url") public String getUrl() { - return url; + return this.url; } /** @@ -156,7 +151,7 @@ public static class Builder { /** * Setter for id. - * @param id String value for id. + * @param id String value for id. * @return Builder */ public Builder id(String id) { @@ -166,7 +161,7 @@ public Builder id(String id) { /** * Setter for status. - * @param status Status3Enum value for status. + * @param status Status3Enum value for status. * @return Builder */ public Builder status(Status3Enum status) { @@ -176,7 +171,7 @@ public Builder status(Status3Enum status) { /** * Setter for completedTime. - * @param completedTime String value for completedTime. + * @param completedTime String value for completedTime. * @return Builder */ public Builder completedTime(String completedTime) { @@ -186,7 +181,7 @@ public Builder completedTime(String completedTime) { /** * Setter for url. - * @param url String value for url. + * @param url String value for url. * @return Builder */ public Builder url(String url) { diff --git a/src/main/java/com/bandwidth/voice/models/TranscriptionResponse.java b/src/main/java/com/bandwidth/voice/models/TranscriptionResponse.java index 9fdc2d84..cf46386c 100644 --- a/src/main/java/com/bandwidth/voice/models/TranscriptionResponse.java +++ b/src/main/java/com/bandwidth/voice/models/TranscriptionResponse.java @@ -7,7 +7,6 @@ package com.bandwidth.voice.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import java.util.List; @@ -15,7 +14,6 @@ * This is a model class for TranscriptionResponse type. */ public class TranscriptionResponse { - @JsonInclude(JsonInclude.Include.NON_NULL) private List transcripts; /** @@ -26,7 +24,7 @@ public TranscriptionResponse() { /** * Initialization constructor. - * @param transcripts List of Transcript value for transcripts. + * @param transcripts List of Transcript value for transcripts. */ public TranscriptionResponse( List transcripts) { @@ -39,7 +37,7 @@ public TranscriptionResponse( */ @JsonGetter("transcripts") public List getTranscripts() { - return transcripts; + return this.transcripts; } /** @@ -81,7 +79,7 @@ public static class Builder { /** * Setter for transcripts. - * @param transcripts List of Transcript value for transcripts. + * @param transcripts List of Transcript value for transcripts. * @return Builder */ public Builder transcripts(List transcripts) { diff --git a/src/main/java/com/bandwidth/webrtc/controllers/APIController.java b/src/main/java/com/bandwidth/webrtc/controllers/APIController.java index 01c2ebf6..78225783 100644 --- a/src/main/java/com/bandwidth/webrtc/controllers/APIController.java +++ b/src/main/java/com/bandwidth/webrtc/controllers/APIController.java @@ -20,7 +20,7 @@ import com.bandwidth.http.response.ApiResponse; import com.bandwidth.http.response.HttpResponse; import com.bandwidth.http.response.HttpStringResponse; -import com.bandwidth.webrtc.exceptions.ErrorErrorException; +import com.bandwidth.webrtc.exceptions.ErrorException; import com.bandwidth.webrtc.models.AccountsParticipantsResponse; import com.bandwidth.webrtc.models.Participant; import com.bandwidth.webrtc.models.Session; @@ -162,7 +162,7 @@ private ApiResponse handleCreateParticipantRespons throw new ApiException("Access Denied", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorErrorException("Unexpected Error", context); + throw new ErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -274,7 +274,7 @@ private ApiResponse handleGetParticipantResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorErrorException("Unexpected Error", context); + throw new ErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -384,7 +384,7 @@ private ApiResponse handleDeleteParticipantResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorErrorException("Unexpected Error", context); + throw new ErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -493,7 +493,7 @@ private ApiResponse handleCreateSessionResponse( throw new ApiException("Access Denied", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorErrorException("Unexpected Error", context); + throw new ErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -605,7 +605,7 @@ private ApiResponse handleGetSessionResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorErrorException("Unexpected Error", context); + throw new ErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -715,7 +715,7 @@ private ApiResponse handleDeleteSessionResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorErrorException("Unexpected Error", context); + throw new ErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -822,7 +822,7 @@ private ApiResponse> handleListSessionParticipantsResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorErrorException("Unexpected Error", context); + throw new ErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -947,7 +947,7 @@ private ApiResponse handleAddParticipantToSessionResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorErrorException("Unexpected Error", context); + throw new ErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1063,7 +1063,7 @@ private ApiResponse handleRemoveParticipantFromSessionResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorErrorException("Unexpected Error", context); + throw new ErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1179,7 +1179,7 @@ private ApiResponse handleGetParticipantSubscriptionsResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorErrorException("Unexpected Error", context); + throw new ErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); @@ -1312,7 +1312,7 @@ private ApiResponse handleUpdateParticipantSubscriptionsResponse( throw new ApiException("Not Found", context); } if ((responseCode < 200) || (responseCode > 208)) { - throw new ErrorErrorException("Unexpected Error", context); + throw new ErrorException("Unexpected Error", context); } //handle errors defined at the API level validateResponse(response, context); diff --git a/src/main/java/com/bandwidth/webrtc/exceptions/ErrorErrorException.java b/src/main/java/com/bandwidth/webrtc/exceptions/ErrorException.java similarity index 64% rename from src/main/java/com/bandwidth/webrtc/exceptions/ErrorErrorException.java rename to src/main/java/com/bandwidth/webrtc/exceptions/ErrorException.java index 7c6fff10..b8d8c9ed 100644 --- a/src/main/java/com/bandwidth/webrtc/exceptions/ErrorErrorException.java +++ b/src/main/java/com/bandwidth/webrtc/exceptions/ErrorException.java @@ -12,11 +12,11 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for ErrorErrorException type. + * This is a model class for ErrorException type. */ -public class ErrorErrorException +public class ErrorException extends ApiException { - private static final long serialVersionUID = -1260975273933949507L; + private static final long serialVersionUID = 6300991168895097478L; private int code; private String message; @@ -25,14 +25,14 @@ public class ErrorErrorException * @param reason The reason for throwing exception * @param context The http context of the API exception */ - public ErrorErrorException(String reason, HttpContext context) { + public ErrorException(String reason, HttpContext context) { super(reason, context); } /** * Getter for Code. - * @return Returns the int + * @return Returns the int */ @JsonGetter("code") public int getCode() { @@ -41,16 +41,16 @@ public int getCode() { /** * Setter for Code. - * @param code Value for int + * @param value Value for int */ @JsonSetter("code") - private void setCode(int code) { - this.code = code; + private void setCode(int value) { + this.code = value; } /** * Getter for Message. - * @return Returns the String + * @return Returns the String */ @JsonGetter("message") public String getMessage() { @@ -59,10 +59,10 @@ public String getMessage() { /** * Setter for Message. - * @param message Value for String + * @param value Value for String */ @JsonSetter("message") - private void setMessage(String message) { - this.message = message; + private void setMessage(String value) { + this.message = value; } } diff --git a/src/main/java/com/bandwidth/webrtc/models/AccountsParticipantsResponse.java b/src/main/java/com/bandwidth/webrtc/models/AccountsParticipantsResponse.java index bd33e2ca..947145b9 100644 --- a/src/main/java/com/bandwidth/webrtc/models/AccountsParticipantsResponse.java +++ b/src/main/java/com/bandwidth/webrtc/models/AccountsParticipantsResponse.java @@ -7,16 +7,13 @@ package com.bandwidth.webrtc.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for AccountsParticipantsResponse type. */ public class AccountsParticipantsResponse { - @JsonInclude(JsonInclude.Include.NON_NULL) private Participant participant; - @JsonInclude(JsonInclude.Include.NON_NULL) private String token; /** @@ -27,8 +24,8 @@ public AccountsParticipantsResponse() { /** * Initialization constructor. - * @param participant Participant value for participant. - * @param token String value for token. + * @param participant Participant value for participant. + * @param token String value for token. */ public AccountsParticipantsResponse( Participant participant, @@ -44,7 +41,7 @@ public AccountsParticipantsResponse( */ @JsonGetter("participant") public Participant getParticipant() { - return participant; + return this.participant; } /** @@ -65,7 +62,7 @@ public void setParticipant(Participant participant) { */ @JsonGetter("token") public String getToken() { - return token; + return this.token; } /** @@ -112,7 +109,7 @@ public static class Builder { /** * Setter for participant. - * @param participant Participant value for participant. + * @param participant Participant value for participant. * @return Builder */ public Builder participant(Participant participant) { @@ -122,7 +119,7 @@ public Builder participant(Participant participant) { /** * Setter for token. - * @param token String value for token. + * @param token String value for token. * @return Builder */ public Builder token(String token) { diff --git a/src/main/java/com/bandwidth/webrtc/models/Error.java b/src/main/java/com/bandwidth/webrtc/models/Error.java deleted file mode 100644 index e777b3ea..00000000 --- a/src/main/java/com/bandwidth/webrtc/models/Error.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * BandwidthLib - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -package com.bandwidth.webrtc.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonSetter; - -/** - * This is a model class for Error type. - */ -public class Error { - private int code; - private String message; - - /** - * Default constructor. - */ - public Error() { - } - - /** - * Initialization constructor. - * @param code int value for code. - * @param message String value for message. - */ - public Error( - int code, - String message) { - this.code = code; - this.message = message; - } - - /** - * Getter for Code. - * @return Returns the int - */ - @JsonGetter("code") - public int getCode() { - return code; - } - - /** - * Setter for Code. - * @param code Value for int - */ - @JsonSetter("code") - public void setCode(int code) { - this.code = code; - } - - /** - * Getter for Message. - * @return Returns the String - */ - @JsonGetter("message") - public String getMessage() { - return message; - } - - /** - * Setter for Message. - * @param message Value for String - */ - @JsonSetter("message") - public void setMessage(String message) { - this.message = message; - } - - /** - * Converts this Error into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "Error [" + "code=" + code + ", message=" + message + "]"; - } - - /** - * Builds a new {@link Error.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link Error.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder(code, message); - return builder; - } - - /** - * Class to build instances of {@link Error}. - */ - public static class Builder { - private int code; - private String message; - - /** - * Initialization constructor. - */ - public Builder() { - } - - /** - * Initialization constructor. - * @param code int value for code. - * @param message String value for message. - */ - public Builder(int code, String message) { - this.code = code; - this.message = message; - } - - /** - * Setter for code. - * @param code int value for code. - * @return Builder - */ - public Builder code(int code) { - this.code = code; - return this; - } - - /** - * Setter for message. - * @param message String value for message. - * @return Builder - */ - public Builder message(String message) { - this.message = message; - return this; - } - - /** - * Builds a new {@link Error} object using the set fields. - * @return {@link Error} - */ - public Error build() { - return new Error(code, message); - } - } -} diff --git a/src/main/java/com/bandwidth/webrtc/models/Participant.java b/src/main/java/com/bandwidth/webrtc/models/Participant.java index a734b206..d59b67dc 100644 --- a/src/main/java/com/bandwidth/webrtc/models/Participant.java +++ b/src/main/java/com/bandwidth/webrtc/models/Participant.java @@ -7,7 +7,6 @@ package com.bandwidth.webrtc.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import java.util.List; @@ -15,19 +14,12 @@ * This is a model class for Participant type. */ public class Participant { - @JsonInclude(JsonInclude.Include.NON_NULL) private String id; - @JsonInclude(JsonInclude.Include.NON_NULL) private String callbackUrl; - @JsonInclude(JsonInclude.Include.NON_NULL) private List publishPermissions; - @JsonInclude(JsonInclude.Include.NON_NULL) private List sessions; - @JsonInclude(JsonInclude.Include.NON_NULL) private Subscriptions subscriptions; - @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; - @JsonInclude(JsonInclude.Include.NON_NULL) private DeviceApiVersionEnum deviceApiVersion; /** @@ -38,13 +30,13 @@ public Participant() { /** * Initialization constructor. - * @param id String value for id. - * @param callbackUrl String value for callbackUrl. - * @param publishPermissions List of PublishPermissionEnum value for publishPermissions. - * @param sessions List of String value for sessions. - * @param subscriptions Subscriptions value for subscriptions. - * @param tag String value for tag. - * @param deviceApiVersion DeviceApiVersionEnum value for deviceApiVersion. + * @param id String value for id. + * @param callbackUrl String value for callbackUrl. + * @param publishPermissions List of PublishPermissionEnum value for publishPermissions. + * @param sessions List of String value for sessions. + * @param subscriptions Subscriptions value for subscriptions. + * @param tag String value for tag. + * @param deviceApiVersion DeviceApiVersionEnum value for deviceApiVersion. */ public Participant( String id, @@ -70,7 +62,7 @@ public Participant( */ @JsonGetter("id") public String getId() { - return id; + return this.id; } /** @@ -90,7 +82,7 @@ public void setId(String id) { */ @JsonGetter("callbackUrl") public String getCallbackUrl() { - return callbackUrl; + return this.callbackUrl; } /** @@ -110,7 +102,7 @@ public void setCallbackUrl(String callbackUrl) { */ @JsonGetter("publishPermissions") public List getPublishPermissions() { - return publishPermissions; + return this.publishPermissions; } /** @@ -130,7 +122,7 @@ public void setPublishPermissions(List publishPermissions */ @JsonGetter("sessions") public List getSessions() { - return sessions; + return this.sessions; } /** @@ -149,7 +141,7 @@ public void setSessions(List sessions) { */ @JsonGetter("subscriptions") public Subscriptions getSubscriptions() { - return subscriptions; + return this.subscriptions; } /** @@ -168,7 +160,7 @@ public void setSubscriptions(Subscriptions subscriptions) { */ @JsonGetter("tag") public String getTag() { - return tag; + return this.tag; } /** @@ -188,7 +180,7 @@ public void setTag(String tag) { */ @JsonGetter("deviceApiVersion") public DeviceApiVersionEnum getDeviceApiVersion() { - return deviceApiVersion; + return this.deviceApiVersion; } /** @@ -246,7 +238,7 @@ public static class Builder { /** * Setter for id. - * @param id String value for id. + * @param id String value for id. * @return Builder */ public Builder id(String id) { @@ -256,7 +248,7 @@ public Builder id(String id) { /** * Setter for callbackUrl. - * @param callbackUrl String value for callbackUrl. + * @param callbackUrl String value for callbackUrl. * @return Builder */ public Builder callbackUrl(String callbackUrl) { @@ -266,7 +258,7 @@ public Builder callbackUrl(String callbackUrl) { /** * Setter for publishPermissions. - * @param publishPermissions List of PublishPermissionEnum value for publishPermissions. + * @param publishPermissions List of PublishPermissionEnum value for publishPermissions. * @return Builder */ public Builder publishPermissions(List publishPermissions) { @@ -276,7 +268,7 @@ public Builder publishPermissions(List publishPermissions /** * Setter for sessions. - * @param sessions List of String value for sessions. + * @param sessions List of String value for sessions. * @return Builder */ public Builder sessions(List sessions) { @@ -286,7 +278,7 @@ public Builder sessions(List sessions) { /** * Setter for subscriptions. - * @param subscriptions Subscriptions value for subscriptions. + * @param subscriptions Subscriptions value for subscriptions. * @return Builder */ public Builder subscriptions(Subscriptions subscriptions) { @@ -296,7 +288,7 @@ public Builder subscriptions(Subscriptions subscriptions) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { @@ -306,7 +298,7 @@ public Builder tag(String tag) { /** * Setter for deviceApiVersion. - * @param deviceApiVersion DeviceApiVersionEnum value for deviceApiVersion. + * @param deviceApiVersion DeviceApiVersionEnum value for deviceApiVersion. * @return Builder */ public Builder deviceApiVersion(DeviceApiVersionEnum deviceApiVersion) { diff --git a/src/main/java/com/bandwidth/webrtc/models/ParticipantSubscription.java b/src/main/java/com/bandwidth/webrtc/models/ParticipantSubscription.java index 92beb637..b6a055b9 100644 --- a/src/main/java/com/bandwidth/webrtc/models/ParticipantSubscription.java +++ b/src/main/java/com/bandwidth/webrtc/models/ParticipantSubscription.java @@ -23,7 +23,7 @@ public ParticipantSubscription() { /** * Initialization constructor. - * @param participantId String value for participantId. + * @param participantId String value for participantId. */ public ParticipantSubscription( String participantId) { @@ -37,7 +37,7 @@ public ParticipantSubscription( */ @JsonGetter("participantId") public String getParticipantId() { - return participantId; + return this.participantId; } /** @@ -83,7 +83,7 @@ public Builder() { /** * Initialization constructor. - * @param participantId String value for participantId. + * @param participantId String value for participantId. */ public Builder(String participantId) { this.participantId = participantId; @@ -91,7 +91,7 @@ public Builder(String participantId) { /** * Setter for participantId. - * @param participantId String value for participantId. + * @param participantId String value for participantId. * @return Builder */ public Builder participantId(String participantId) { diff --git a/src/main/java/com/bandwidth/webrtc/models/Session.java b/src/main/java/com/bandwidth/webrtc/models/Session.java index fd8d5c6d..b054b078 100644 --- a/src/main/java/com/bandwidth/webrtc/models/Session.java +++ b/src/main/java/com/bandwidth/webrtc/models/Session.java @@ -7,16 +7,13 @@ package com.bandwidth.webrtc.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; /** * This is a model class for Session type. */ public class Session { - @JsonInclude(JsonInclude.Include.NON_NULL) private String id; - @JsonInclude(JsonInclude.Include.NON_NULL) private String tag; /** @@ -27,8 +24,8 @@ public Session() { /** * Initialization constructor. - * @param id String value for id. - * @param tag String value for tag. + * @param id String value for id. + * @param tag String value for tag. */ public Session( String id, @@ -44,7 +41,7 @@ public Session( */ @JsonGetter("id") public String getId() { - return id; + return this.id; } /** @@ -64,7 +61,7 @@ public void setId(String id) { */ @JsonGetter("tag") public String getTag() { - return tag; + return this.tag; } /** @@ -109,7 +106,7 @@ public static class Builder { /** * Setter for id. - * @param id String value for id. + * @param id String value for id. * @return Builder */ public Builder id(String id) { @@ -119,7 +116,7 @@ public Builder id(String id) { /** * Setter for tag. - * @param tag String value for tag. + * @param tag String value for tag. * @return Builder */ public Builder tag(String tag) { diff --git a/src/main/java/com/bandwidth/webrtc/models/Subscriptions.java b/src/main/java/com/bandwidth/webrtc/models/Subscriptions.java index 62493636..420774fe 100644 --- a/src/main/java/com/bandwidth/webrtc/models/Subscriptions.java +++ b/src/main/java/com/bandwidth/webrtc/models/Subscriptions.java @@ -7,7 +7,6 @@ package com.bandwidth.webrtc.models; import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import java.util.List; @@ -16,7 +15,6 @@ */ public class Subscriptions { private String sessionId; - @JsonInclude(JsonInclude.Include.NON_NULL) private List participants; /** @@ -27,8 +25,8 @@ public Subscriptions() { /** * Initialization constructor. - * @param sessionId String value for sessionId. - * @param participants List of ParticipantSubscription value for participants. + * @param sessionId String value for sessionId. + * @param participants List of ParticipantSubscription value for participants. */ public Subscriptions( String sessionId, @@ -46,7 +44,7 @@ public Subscriptions( */ @JsonGetter("sessionId") public String getSessionId() { - return sessionId; + return this.sessionId; } /** @@ -68,7 +66,7 @@ public void setSessionId(String sessionId) { */ @JsonGetter("participants") public List getParticipants() { - return participants; + return this.participants; } /** @@ -117,7 +115,7 @@ public Builder() { /** * Initialization constructor. - * @param sessionId String value for sessionId. + * @param sessionId String value for sessionId. */ public Builder(String sessionId) { this.sessionId = sessionId; @@ -125,7 +123,7 @@ public Builder(String sessionId) { /** * Setter for sessionId. - * @param sessionId String value for sessionId. + * @param sessionId String value for sessionId. * @return Builder */ public Builder sessionId(String sessionId) { @@ -135,7 +133,7 @@ public Builder sessionId(String sessionId) { /** * Setter for participants. - * @param participants List of ParticipantSubscription value for participants. + * @param participants List of ParticipantSubscription value for participants. * @return Builder */ public Builder participants(List participants) { From 5434913303fecbbb4c4476e39ea7fd31e106b377 Mon Sep 17 00:00:00 2001 From: jmulford-bandwidth Date: Tue, 9 Mar 2021 14:52:24 -0500 Subject: [PATCH 3/5] file cleanup --- .../messaging/models/MessagingException.java | 143 ------------------ .../com/bandwidth/utilities/FileWrapper.java | 3 - 2 files changed, 146 deletions(-) delete mode 100644 src/main/java/com/bandwidth/messaging/models/MessagingException.java diff --git a/src/main/java/com/bandwidth/messaging/models/MessagingException.java b/src/main/java/com/bandwidth/messaging/models/MessagingException.java deleted file mode 100644 index 4287e3a6..00000000 --- a/src/main/java/com/bandwidth/messaging/models/MessagingException.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * BandwidthLib - * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). - */ - -package com.bandwidth.messaging.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonSetter; - -/** - * This is a model class for MessagingException type. - */ -public class MessagingException { - private String type; - private String description; - - /** - * Default constructor. - */ - public MessagingException() { - } - - /** - * Initialization constructor. - * @param type String value for type. - * @param description String value for description. - */ - public MessagingException( - String type, - String description) { - this.type = type; - this.description = description; - } - - /** - * Getter for Type. - * @return Returns the String - */ - @JsonGetter("type") - public String getType() { - return type; - } - - /** - * Setter for Type. - * @param type Value for String - */ - @JsonSetter("type") - public void setType(String type) { - this.type = type; - } - - /** - * Getter for Description. - * @return Returns the String - */ - @JsonGetter("description") - public String getDescription() { - return description; - } - - /** - * Setter for Description. - * @param description Value for String - */ - @JsonSetter("description") - public void setDescription(String description) { - this.description = description; - } - - /** - * Converts this MessagingException into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "MessagingException [" + "type=" + type + ", description=" + description + "]"; - } - - /** - * Builds a new {@link MessagingException.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link MessagingException.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder(type, description); - return builder; - } - - /** - * Class to build instances of {@link MessagingException}. - */ - public static class Builder { - private String type; - private String description; - - /** - * Initialization constructor. - */ - public Builder() { - } - - /** - * Initialization constructor. - * @param type String value for type. - * @param description String value for description. - */ - public Builder(String type, String description) { - this.type = type; - this.description = description; - } - - /** - * Setter for type. - * @param type String value for type. - * @return Builder - */ - public Builder type(String type) { - this.type = type; - return this; - } - - /** - * Setter for description. - * @param description String value for description. - * @return Builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Builds a new {@link MessagingException} object using the set fields. - * @return {@link MessagingException} - */ - public MessagingException build() { - return new MessagingException(type, description); - } - } -} diff --git a/src/main/java/com/bandwidth/utilities/FileWrapper.java b/src/main/java/com/bandwidth/utilities/FileWrapper.java index 2b3fe536..b8064af8 100644 --- a/src/main/java/com/bandwidth/utilities/FileWrapper.java +++ b/src/main/java/com/bandwidth/utilities/FileWrapper.java @@ -7,16 +7,13 @@ package com.bandwidth.utilities; import java.io.File; -import com.fasterxml.jackson.annotation.JsonInclude; /** * Class to wrap file and contentType to be sent as part of a HTTP request. */ public class FileWrapper { - @JsonInclude(JsonInclude.Include.NON_NULL) private File file; - @JsonInclude(JsonInclude.Include.NON_NULL) private String contentType; /** From 5b663042b409893bcc376e99cb783d46f17a6e48 Mon Sep 17 00:00:00 2001 From: jmulford-bandwidth Date: Tue, 9 Mar 2021 14:53:46 -0500 Subject: [PATCH 4/5] whitespace cleanup --- .../com/bandwidth/webrtc/models/Participant.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/bandwidth/webrtc/models/Participant.java b/src/main/java/com/bandwidth/webrtc/models/Participant.java index d59b67dc..6ab7aeb5 100644 --- a/src/main/java/com/bandwidth/webrtc/models/Participant.java +++ b/src/main/java/com/bandwidth/webrtc/models/Participant.java @@ -30,13 +30,13 @@ public Participant() { /** * Initialization constructor. - * @param id String value for id. - * @param callbackUrl String value for callbackUrl. - * @param publishPermissions List of PublishPermissionEnum value for publishPermissions. - * @param sessions List of String value for sessions. - * @param subscriptions Subscriptions value for subscriptions. - * @param tag String value for tag. - * @param deviceApiVersion DeviceApiVersionEnum value for deviceApiVersion. + * @param id tring value for id. + * @param callbackUrl tring value for callbackUrl. + * @param publishPermissions List of PublishPermissionEnum value for publishPermissions. + * @param sessions List of String value for sessions. + * @param subscriptions Subscriptions value for subscriptions. + * @param tag String value for tag. + * @param deviceApiVersion DeviceApiVersionEnum value for deviceApiVersion. */ public Participant( String id, From 4568d6e66bf92e1ac91d06e830d17a812543c197 Mon Sep 17 00:00:00 2001 From: jmulford-bandwidth Date: Tue, 9 Mar 2021 14:54:25 -0500 Subject: [PATCH 5/5] letters are hard --- src/main/java/com/bandwidth/webrtc/models/Participant.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/bandwidth/webrtc/models/Participant.java b/src/main/java/com/bandwidth/webrtc/models/Participant.java index 6ab7aeb5..429cfaac 100644 --- a/src/main/java/com/bandwidth/webrtc/models/Participant.java +++ b/src/main/java/com/bandwidth/webrtc/models/Participant.java @@ -30,8 +30,8 @@ public Participant() { /** * Initialization constructor. - * @param id tring value for id. - * @param callbackUrl tring value for callbackUrl. + * @param id String value for id. + * @param callbackUrl String value for callbackUrl. * @param publishPermissions List of PublishPermissionEnum value for publishPermissions. * @param sessions List of String value for sessions. * @param subscriptions Subscriptions value for subscriptions.