diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 2fbf95bb..b9eeadaa 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -8,6 +8,7 @@ docs/AdditionalDenialReason.md docs/Address.md docs/AnswerCallback.md docs/AsyncLookupRequest.md +docs/AttestationLevelEnum.md docs/BlockedWebhook.md docs/BridgeCompleteCallback.md docs/BridgeTargetCompleteCallback.md @@ -264,6 +265,7 @@ src/main/java/com/bandwidth/sdk/model/AdditionalDenialReason.java src/main/java/com/bandwidth/sdk/model/Address.java src/main/java/com/bandwidth/sdk/model/AnswerCallback.java src/main/java/com/bandwidth/sdk/model/AsyncLookupRequest.java +src/main/java/com/bandwidth/sdk/model/AttestationLevelEnum.java src/main/java/com/bandwidth/sdk/model/BlockedWebhook.java src/main/java/com/bandwidth/sdk/model/BridgeCompleteCallback.java src/main/java/com/bandwidth/sdk/model/BridgeTargetCompleteCallback.java diff --git a/README.md b/README.md index f4aecbf6..70ea31a3 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,7 @@ Class | Method | HTTP request | Description - [Address](docs/Address.md) - [AnswerCallback](docs/AnswerCallback.md) - [AsyncLookupRequest](docs/AsyncLookupRequest.md) + - [AttestationLevelEnum](docs/AttestationLevelEnum.md) - [BlockedWebhook](docs/BlockedWebhook.md) - [BridgeCompleteCallback](docs/BridgeCompleteCallback.md) - [BridgeTargetCompleteCallback](docs/BridgeTargetCompleteCallback.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 1adb001e..a474641a 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -11120,6 +11120,15 @@ components: - segmentCount - time - to + attestationLevelEnum: + description: "The STIR/SHAKEN attestation level Bandwidth signs the call with:\ + \ `A` (full), `B` (partial), or `C` (gateway)." + enum: + - A + - B + - C + example: B + type: string callbackMethodEnum: default: POST description: The HTTP method to use to deliver the callback. GET or POST. Default @@ -11263,6 +11272,33 @@ components: example: "eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64" nullable: true type: string + requestedAttestationLevel: + allOf: + - $ref: "#/components/schemas/attestationLevelEnum" + description: |- + The STIR/SHAKEN attestation level (`A`, `B`, or `C`) you request Bandwidth sign this call with. + Applies to outbound calls to US destinations only, and only to accounts that use the + Hosted Signing Service; it is ignored + for all other accounts. If omitted, the attestation policy configured on your account is used. + + Cannot be combined with `identity`. A request that includes both is rejected with a `400`, as is + any value other than `A`, `B`, or `C`. + nullable: true + identity: + description: |- + A complete SIP `Identity` header value that you signed yourself. It must be a valid STIR/SHAKEN + PASSporT and may not exceed 2000 characters. Bandwidth sends it unmodified on the outbound call and + does not sign the call. Bandwidth checks only the format and size of the value, not the signature. + Applies to outbound calls to US destinations only. + + Cannot be combined with `requestedAttestationLevel`. A request that includes both, or a value that is too long + or not in the expected format, is rejected with a `400`. + example: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=;alg=ES256;ppt="shaken" + maxLength: 2000 + minLength: 1 + nullable: true + pattern: "^ *[A-Za-z0-9\\-_.+/=;:<>\"][A-Za-z0-9\\-_.+/=;:<>\" ]*$" + type: string applicationId: description: The id of the application associated with the `from` number. example: 1234-qwer-5679-tyui @@ -11411,6 +11447,8 @@ components: fallbackUsername: mySecretUsername fallbackPassword: mySecretPassword1! priority: 5 + requestedAttestationLevel: "" + identity: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=;alg=ES256;ppt="shaken" properties: applicationId: description: The id of the application associated with the `from` number. @@ -11512,6 +11550,19 @@ components: example: 5 nullable: true type: integer + requestedAttestationLevel: + allOf: + - $ref: "#/components/schemas/attestationLevelEnum" + description: |- + The `requestedAttestationLevel` provided in the Create Call request, if any. This is the level you requested, + which can differ from the level the call is ultimately signed with. + nullable: true + identity: + description: "The `identity` value provided in the Create Call request,\ + \ if any." + example: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=;alg=ES256;ppt="shaken" + nullable: true + type: string required: - accountId - answerMethod diff --git a/bandwidth.yml b/bandwidth.yml index bffc6469..b88af843 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -3241,6 +3241,16 @@ components: - direction - to - from + attestationLevelEnum: + type: string + enum: + - A + - B + - C + description: >- + The STIR/SHAKEN attestation level Bandwidth signs the call with: `A` + (full), `B` (partial), or `C` (gateway). + example: B callbackMethodEnum: type: string nullable: true @@ -3419,6 +3429,52 @@ components: entire value cannot exceed 350 characters, including parameters and separators. + requestedAttestationLevel: + nullable: true + allOf: + - $ref: '#/components/schemas/attestationLevelEnum' + description: >- + The STIR/SHAKEN attestation level (`A`, `B`, or `C`) you request + Bandwidth sign this call with. + + Applies to outbound calls to US destinations only, and only to + accounts that use the + + Hosted + Signing Service; it is ignored + + for all other accounts. If omitted, the attestation policy + configured on your account is used. + + + Cannot be combined with `identity`. A request that includes both is + rejected with a `400`, as is + + any value other than `A`, `B`, or `C`. + identity: + nullable: true + type: string + minLength: 1 + maxLength: 2000 + pattern: ^ *[A-Za-z0-9\-_.+/=;:<>"][A-Za-z0-9\-_.+/=;:<>" ]*$ + description: >- + A complete SIP `Identity` header value that you signed yourself. It + must be a valid STIR/SHAKEN + + PASSporT and may not exceed 2000 characters. Bandwidth sends it + unmodified on the outbound call and + + does not sign the call. Bandwidth checks only the format and size of + the value, not the signature. + + Applies to outbound calls to US destinations only. + + + Cannot be combined with `requestedAttestationLevel`. A request that + includes both, or a value that is too long + + or not in the expected format, is rejected with a `400`. + example: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=;alg=ES256;ppt="shaken" applicationId: type: string description: The id of the application associated with the `from` number. @@ -3688,6 +3744,20 @@ components: type: integer example: 5 description: The priority of this call over other calls from your account. + requestedAttestationLevel: + nullable: true + allOf: + - $ref: '#/components/schemas/attestationLevelEnum' + description: >- + The `requestedAttestationLevel` provided in the Create Call request, + if any. This is the level you requested, + + which can differ from the level the call is ultimately signed with. + identity: + nullable: true + type: string + description: The `identity` value provided in the Create Call request, if any. + example: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=;alg=ES256;ppt="shaken" callState: type: object properties: diff --git a/docs/AttestationLevelEnum.md b/docs/AttestationLevelEnum.md new file mode 100644 index 00000000..dbc8c406 --- /dev/null +++ b/docs/AttestationLevelEnum.md @@ -0,0 +1,15 @@ + + +# AttestationLevelEnum + +## Enum + + +* `A` (value: `"A"`) + +* `B` (value: `"B"`) + +* `C` (value: `"C"`) + + + diff --git a/docs/CreateCall.md b/docs/CreateCall.md index 2561841f..f9463130 100644 --- a/docs/CreateCall.md +++ b/docs/CreateCall.md @@ -12,6 +12,8 @@ |**privacy** | **Boolean** | Hide the calling number. The `displayName` field can be used to customize the displayed name. | [optional] | |**displayName** | **String** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] | |**uui** | **String** | A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt', 'base64' and 'hex' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional] | +|**requestedAttestationLevel** | **AttestationLevelEnum** | The STIR/SHAKEN attestation level (`A`, `B`, or `C`) you request Bandwidth sign this call with. Applies to outbound calls to US destinations only, and only to accounts that use the <a href='/docs/voice/stir-shaken/hosted-signing-service'>Hosted Signing Service</a>; it is ignored for all other accounts. If omitted, the attestation policy configured on your account is used. Cannot be combined with `identity`. A request that includes both is rejected with a `400`, as is any value other than `A`, `B`, or `C`. | [optional] | +|**identity** | **String** | A complete SIP `Identity` header value that you signed yourself. It must be a valid STIR/SHAKEN PASSporT and may not exceed 2000 characters. Bandwidth sends it unmodified on the outbound call and does not sign the call. Bandwidth checks only the format and size of the value, not the signature. Applies to outbound calls to US destinations only. Cannot be combined with `requestedAttestationLevel`. A request that includes both, or a value that is too long or not in the expected format, is rejected with a `400`. | [optional] | |**applicationId** | **String** | The id of the application associated with the `from` number. | | |**answerUrl** | **URI** | The full URL to send the <a href='/docs/voice/webhooks/answer'>Answer</a> event to when the called party answers. This endpoint should return the first <a href='/docs/voice/bxml'>BXML document</a> to be executed in the call. Must use `https` if specifying `username` and `password`. | | |**answerMethod** | **CallbackMethodEnum** | | [optional] | diff --git a/docs/CreateCallResponse.md b/docs/CreateCallResponse.md index 0a317eee..d517993a 100644 --- a/docs/CreateCallResponse.md +++ b/docs/CreateCallResponse.md @@ -28,6 +28,8 @@ |**fallbackUsername** | **String** | Basic auth username. | [optional] | |**fallbackPassword** | **String** | Basic auth password. | [optional] | |**priority** | **Integer** | The priority of this call over other calls from your account. | [optional] | +|**requestedAttestationLevel** | **AttestationLevelEnum** | The `requestedAttestationLevel` provided in the Create Call request, if any. This is the level you requested, which can differ from the level the call is ultimately signed with. | [optional] | +|**identity** | **String** | The `identity` value provided in the Create Call request, if any. | [optional] | diff --git a/src/main/java/com/bandwidth/sdk/model/AttestationLevelEnum.java b/src/main/java/com/bandwidth/sdk/model/AttestationLevelEnum.java new file mode 100644 index 00000000..21978697 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/AttestationLevelEnum.java @@ -0,0 +1,80 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The STIR/SHAKEN attestation level Bandwidth signs the call with: `A` (full), `B` (partial), or `C` (gateway). + */ +@JsonAdapter(AttestationLevelEnum.Adapter.class) +public enum AttestationLevelEnum { + + A("A"), + + B("B"), + + C("C"); + + private String value; + + AttestationLevelEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AttestationLevelEnum fromValue(String value) { + for (AttestationLevelEnum b : AttestationLevelEnum.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AttestationLevelEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AttestationLevelEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AttestationLevelEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AttestationLevelEnum.fromValue(value); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/CreateCall.java b/src/main/java/com/bandwidth/sdk/model/CreateCall.java index 084ab442..6c023abe 100644 --- a/src/main/java/com/bandwidth/sdk/model/CreateCall.java +++ b/src/main/java/com/bandwidth/sdk/model/CreateCall.java @@ -14,6 +14,7 @@ package com.bandwidth.sdk.model; import java.util.Objects; +import com.bandwidth.sdk.model.AttestationLevelEnum; import com.bandwidth.sdk.model.CallbackMethodEnum; import com.bandwidth.sdk.model.MachineDetectionConfiguration; import com.google.gson.TypeAdapter; @@ -80,6 +81,16 @@ public class CreateCall { @javax.annotation.Nullable private String uui; + public static final String SERIALIZED_NAME_REQUESTED_ATTESTATION_LEVEL = "requestedAttestationLevel"; + @SerializedName(SERIALIZED_NAME_REQUESTED_ATTESTATION_LEVEL) + @javax.annotation.Nullable + private AttestationLevelEnum requestedAttestationLevel; + + public static final String SERIALIZED_NAME_IDENTITY = "identity"; + @SerializedName(SERIALIZED_NAME_IDENTITY) + @javax.annotation.Nullable + private String identity; + public static final String SERIALIZED_NAME_APPLICATION_ID = "applicationId"; @SerializedName(SERIALIZED_NAME_APPLICATION_ID) @javax.annotation.Nonnull @@ -258,6 +269,44 @@ public void setUui(@javax.annotation.Nullable String uui) { } + public CreateCall requestedAttestationLevel(@javax.annotation.Nullable AttestationLevelEnum requestedAttestationLevel) { + this.requestedAttestationLevel = requestedAttestationLevel; + return this; + } + + /** + * The STIR/SHAKEN attestation level (`A`, `B`, or `C`) you request Bandwidth sign this call with. Applies to outbound calls to US destinations only, and only to accounts that use the <a href='/docs/voice/stir-shaken/hosted-signing-service'>Hosted Signing Service</a>; it is ignored for all other accounts. If omitted, the attestation policy configured on your account is used. Cannot be combined with `identity`. A request that includes both is rejected with a `400`, as is any value other than `A`, `B`, or `C`. + * @return requestedAttestationLevel + */ + @javax.annotation.Nullable + public AttestationLevelEnum getRequestedAttestationLevel() { + return requestedAttestationLevel; + } + + public void setRequestedAttestationLevel(@javax.annotation.Nullable AttestationLevelEnum requestedAttestationLevel) { + this.requestedAttestationLevel = requestedAttestationLevel; + } + + + public CreateCall identity(@javax.annotation.Nullable String identity) { + this.identity = identity; + return this; + } + + /** + * A complete SIP `Identity` header value that you signed yourself. It must be a valid STIR/SHAKEN PASSporT and may not exceed 2000 characters. Bandwidth sends it unmodified on the outbound call and does not sign the call. Bandwidth checks only the format and size of the value, not the signature. Applies to outbound calls to US destinations only. Cannot be combined with `requestedAttestationLevel`. A request that includes both, or a value that is too long or not in the expected format, is rejected with a `400`. + * @return identity + */ + @javax.annotation.Nullable + public String getIdentity() { + return identity; + } + + public void setIdentity(@javax.annotation.Nullable String identity) { + this.identity = identity; + } + + public CreateCall applicationId(@javax.annotation.Nonnull String applicationId) { this.applicationId = applicationId; return this; @@ -627,6 +676,8 @@ public boolean equals(Object o) { Objects.equals(this.privacy, createCall.privacy) && Objects.equals(this.displayName, createCall.displayName) && Objects.equals(this.uui, createCall.uui) && + Objects.equals(this.requestedAttestationLevel, createCall.requestedAttestationLevel) && + Objects.equals(this.identity, createCall.identity) && Objects.equals(this.applicationId, createCall.applicationId) && Objects.equals(this.answerUrl, createCall.answerUrl) && Objects.equals(this.answerMethod, createCall.answerMethod) && @@ -652,7 +703,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(to, from, privacy, displayName, uui, applicationId, answerUrl, answerMethod, username, password, answerFallbackUrl, answerFallbackMethod, fallbackUsername, fallbackPassword, disconnectUrl, disconnectMethod, callTimeout, callbackTimeout, machineDetection, priority, tag, additionalProperties); + return Objects.hash(to, from, privacy, displayName, uui, requestedAttestationLevel, identity, applicationId, answerUrl, answerMethod, username, password, answerFallbackUrl, answerFallbackMethod, fallbackUsername, fallbackPassword, disconnectUrl, disconnectMethod, callTimeout, callbackTimeout, machineDetection, priority, tag, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -671,6 +722,8 @@ public String toString() { sb.append(" privacy: ").append(toIndentedString(privacy)).append("\n"); sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); sb.append(" uui: ").append(toIndentedString(uui)).append("\n"); + sb.append(" requestedAttestationLevel: ").append(toIndentedString(requestedAttestationLevel)).append("\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n"); sb.append(" answerUrl: ").append(toIndentedString(answerUrl)).append("\n"); sb.append(" answerMethod: ").append(toIndentedString(answerMethod)).append("\n"); @@ -706,7 +759,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("to", "from", "privacy", "displayName", "uui", "applicationId", "answerUrl", "answerMethod", "username", "password", "answerFallbackUrl", "answerFallbackMethod", "fallbackUsername", "fallbackPassword", "disconnectUrl", "disconnectMethod", "callTimeout", "callbackTimeout", "machineDetection", "priority", "tag")); + openapiFields = new HashSet(Arrays.asList("to", "from", "privacy", "displayName", "uui", "requestedAttestationLevel", "identity", "applicationId", "answerUrl", "answerMethod", "username", "password", "answerFallbackUrl", "answerFallbackMethod", "fallbackUsername", "fallbackPassword", "disconnectUrl", "disconnectMethod", "callTimeout", "callbackTimeout", "machineDetection", "priority", "tag")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("to", "from", "applicationId", "answerUrl")); @@ -744,6 +797,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("uui") != null && !jsonObj.get("uui").isJsonNull()) && !jsonObj.get("uui").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `uui` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uui").toString())); } + // validate the optional field `requestedAttestationLevel` + if (jsonObj.get("requestedAttestationLevel") != null && !jsonObj.get("requestedAttestationLevel").isJsonNull()) { + AttestationLevelEnum.validateJsonElement(jsonObj.get("requestedAttestationLevel")); + } + if ((jsonObj.get("identity") != null && !jsonObj.get("identity").isJsonNull()) && !jsonObj.get("identity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `identity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identity").toString())); + } if (!jsonObj.get("applicationId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `applicationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applicationId").toString())); } diff --git a/src/main/java/com/bandwidth/sdk/model/CreateCallResponse.java b/src/main/java/com/bandwidth/sdk/model/CreateCallResponse.java index e68f369c..0994b326 100644 --- a/src/main/java/com/bandwidth/sdk/model/CreateCallResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/CreateCallResponse.java @@ -14,6 +14,7 @@ package com.bandwidth.sdk.model; import java.util.Objects; +import com.bandwidth.sdk.model.AttestationLevelEnum; import com.bandwidth.sdk.model.CallbackMethodEnum; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -160,6 +161,16 @@ public class CreateCallResponse { @javax.annotation.Nullable private Integer priority; + public static final String SERIALIZED_NAME_REQUESTED_ATTESTATION_LEVEL = "requestedAttestationLevel"; + @SerializedName(SERIALIZED_NAME_REQUESTED_ATTESTATION_LEVEL) + @javax.annotation.Nullable + private AttestationLevelEnum requestedAttestationLevel; + + public static final String SERIALIZED_NAME_IDENTITY = "identity"; + @SerializedName(SERIALIZED_NAME_IDENTITY) + @javax.annotation.Nullable + private String identity; + public CreateCallResponse() { } @@ -561,6 +572,44 @@ public void setPriority(@javax.annotation.Nullable Integer priority) { this.priority = priority; } + + public CreateCallResponse requestedAttestationLevel(@javax.annotation.Nullable AttestationLevelEnum requestedAttestationLevel) { + this.requestedAttestationLevel = requestedAttestationLevel; + return this; + } + + /** + * The `requestedAttestationLevel` provided in the Create Call request, if any. This is the level you requested, which can differ from the level the call is ultimately signed with. + * @return requestedAttestationLevel + */ + @javax.annotation.Nullable + public AttestationLevelEnum getRequestedAttestationLevel() { + return requestedAttestationLevel; + } + + public void setRequestedAttestationLevel(@javax.annotation.Nullable AttestationLevelEnum requestedAttestationLevel) { + this.requestedAttestationLevel = requestedAttestationLevel; + } + + + public CreateCallResponse identity(@javax.annotation.Nullable String identity) { + this.identity = identity; + return this; + } + + /** + * The `identity` value provided in the Create Call request, if any. + * @return identity + */ + @javax.annotation.Nullable + public String getIdentity() { + return identity; + } + + public void setIdentity(@javax.annotation.Nullable String identity) { + this.identity = identity; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -636,7 +685,9 @@ public boolean equals(Object o) { Objects.equals(this.password, createCallResponse.password) && Objects.equals(this.fallbackUsername, createCallResponse.fallbackUsername) && Objects.equals(this.fallbackPassword, createCallResponse.fallbackPassword) && - Objects.equals(this.priority, createCallResponse.priority)&& + Objects.equals(this.priority, createCallResponse.priority) && + Objects.equals(this.requestedAttestationLevel, createCallResponse.requestedAttestationLevel) && + Objects.equals(this.identity, createCallResponse.identity)&& Objects.equals(this.additionalProperties, createCallResponse.additionalProperties); } @@ -646,7 +697,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(applicationId, accountId, callId, to, from, enqueuedTime, callUrl, callTimeout, callbackTimeout, tag, answerMethod, answerUrl, answerFallbackMethod, answerFallbackUrl, disconnectMethod, disconnectUrl, username, password, fallbackUsername, fallbackPassword, priority, additionalProperties); + return Objects.hash(applicationId, accountId, callId, to, from, enqueuedTime, callUrl, callTimeout, callbackTimeout, tag, answerMethod, answerUrl, answerFallbackMethod, answerFallbackUrl, disconnectMethod, disconnectUrl, username, password, fallbackUsername, fallbackPassword, priority, requestedAttestationLevel, identity, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -681,6 +732,8 @@ public String toString() { sb.append(" fallbackUsername: ").append(toIndentedString(fallbackUsername)).append("\n"); sb.append(" fallbackPassword: ").append(toIndentedString(fallbackPassword)).append("\n"); sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" requestedAttestationLevel: ").append(toIndentedString(requestedAttestationLevel)).append("\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -700,7 +753,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("applicationId", "accountId", "callId", "to", "from", "enqueuedTime", "callUrl", "callTimeout", "callbackTimeout", "tag", "answerMethod", "answerUrl", "answerFallbackMethod", "answerFallbackUrl", "disconnectMethod", "disconnectUrl", "username", "password", "fallbackUsername", "fallbackPassword", "priority")); + openapiFields = new HashSet(Arrays.asList("applicationId", "accountId", "callId", "to", "from", "enqueuedTime", "callUrl", "callTimeout", "callbackTimeout", "tag", "answerMethod", "answerUrl", "answerFallbackMethod", "answerFallbackUrl", "disconnectMethod", "disconnectUrl", "username", "password", "fallbackUsername", "fallbackPassword", "priority", "requestedAttestationLevel", "identity")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("applicationId", "accountId", "callId", "to", "from", "callUrl", "answerMethod", "answerUrl", "disconnectMethod")); @@ -780,6 +833,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("fallbackPassword") != null && !jsonObj.get("fallbackPassword").isJsonNull()) && !jsonObj.get("fallbackPassword").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `fallbackPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fallbackPassword").toString())); } + // validate the optional field `requestedAttestationLevel` + if (jsonObj.get("requestedAttestationLevel") != null && !jsonObj.get("requestedAttestationLevel").isJsonNull()) { + AttestationLevelEnum.validateJsonElement(jsonObj.get("requestedAttestationLevel")); + } + if ((jsonObj.get("identity") != null && !jsonObj.get("identity").isJsonNull()) && !jsonObj.get("identity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `identity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identity").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/test/java/com/bandwidth/sdk/unit/api/CallsApiTest.java b/src/test/java/com/bandwidth/sdk/unit/api/CallsApiTest.java index 581a958f..d4f3296e 100644 --- a/src/test/java/com/bandwidth/sdk/unit/api/CallsApiTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/api/CallsApiTest.java @@ -7,6 +7,7 @@ import com.bandwidth.sdk.ApiException; import com.bandwidth.sdk.ApiResponse; import com.bandwidth.sdk.api.CallsApi; +import com.bandwidth.sdk.model.AttestationLevelEnum; import com.bandwidth.sdk.model.CallDirectionEnum; import com.bandwidth.sdk.model.CallState; import com.bandwidth.sdk.model.CallStateEnum; @@ -47,6 +48,7 @@ public class CallsApiTest { private static URI disconnectUrl = URI.create(BASE_CALLBACK_URL); private static Double callTimeout = 30.0; private static Double callbackTimeout = 15.0; + private static String identity = "eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=;alg=ES256;ppt=\"shaken\""; @BeforeAll public static void setUp() { @@ -78,7 +80,9 @@ public void testCreateCall() throws ApiException { .disconnectMethod(disconnectMethod) .machineDetection(machineDetectionConfiguration) .callTimeout(callTimeout) - .callbackTimeout(callbackTimeout); + .callbackTimeout(callbackTimeout) + .requestedAttestationLevel(AttestationLevelEnum.B) + .identity(identity); ApiResponse response = api.createCallWithHttpInfo(BW_ACCOUNT_ID, createCall); diff --git a/src/test/java/com/bandwidth/sdk/unit/models/AttestationLevelEnumTest.java b/src/test/java/com/bandwidth/sdk/unit/models/AttestationLevelEnumTest.java new file mode 100644 index 00000000..508aab72 --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/AttestationLevelEnumTest.java @@ -0,0 +1,36 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import com.bandwidth.sdk.model.AttestationLevelEnum; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; + +/** + * Model tests for AttestationLevelEnum + */ +public class AttestationLevelEnumTest { + /** + * Model tests for AttestationLevelEnum + */ + @Test + public void testAttestationLevelEnum() { + assertThat(AttestationLevelEnum.A.toString(), equalTo("A")); + assertThat(AttestationLevelEnum.B.toString(), equalTo("B")); + assertThat(AttestationLevelEnum.C.toString(), equalTo("C")); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/CreateCallResponseTest.java b/src/test/java/com/bandwidth/sdk/unit/models/CreateCallResponseTest.java index 6877817a..01b51ffb 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/CreateCallResponseTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/CreateCallResponseTest.java @@ -17,6 +17,7 @@ import java.net.URI; import java.time.OffsetDateTime; import com.bandwidth.sdk.model.CreateCallResponse; +import com.bandwidth.sdk.model.AttestationLevelEnum; import com.bandwidth.sdk.model.CallbackMethodEnum; import static org.hamcrest.MatcherAssert.assertThat; @@ -47,7 +48,9 @@ public class CreateCallResponseTest { .password("password") .fallbackUsername("fallbackUsername") .fallbackPassword("fallbackPassword") - .priority(1); + .priority(1) + .requestedAttestationLevel(AttestationLevelEnum.B) + .identity("eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=;alg=ES256;ppt=\"shaken\""); /** * Model tests for CreateCallResponse @@ -225,4 +228,20 @@ public void priorityTest() { assertThat(model.getPriority(), instanceOf(Integer.class)); } + /** + * Test the property 'requestedAttestationLevel' + */ + @Test + public void requestedAttestationLevelTest() { + assertThat(model.getRequestedAttestationLevel(), instanceOf(AttestationLevelEnum.class)); + } + + /** + * Test the property 'identity' + */ + @Test + public void identityTest() { + assertThat(model.getIdentity(), instanceOf(String.class)); + } + } diff --git a/src/test/java/com/bandwidth/sdk/unit/models/CreateCallTest.java b/src/test/java/com/bandwidth/sdk/unit/models/CreateCallTest.java index c3f62162..7c213d40 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/CreateCallTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/CreateCallTest.java @@ -16,6 +16,7 @@ import java.net.URI; import com.bandwidth.sdk.model.CreateCall; +import com.bandwidth.sdk.model.AttestationLevelEnum; import com.bandwidth.sdk.model.CallbackMethodEnum; import com.bandwidth.sdk.model.MachineDetectionConfiguration; @@ -32,6 +33,8 @@ public class CreateCallTest { .privacy(true) .displayName("displayName") .uui("uui") + .requestedAttestationLevel(AttestationLevelEnum.B) + .identity("eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=;alg=ES256;ppt=\"shaken\"") .applicationId("applicationId") .answerUrl(URI.create("http://example.com")) .answerMethod(CallbackMethodEnum.POST) @@ -97,6 +100,22 @@ public void uuiTest() { assertThat(model.getUui(), instanceOf(String.class)); } + /** + * Test the property 'requestedAttestationLevel' + */ + @Test + public void requestedAttestationLevelTest() { + assertThat(model.getRequestedAttestationLevel(), instanceOf(AttestationLevelEnum.class)); + } + + /** + * Test the property 'identity' + */ + @Test + public void identityTest() { + assertThat(model.getIdentity(), instanceOf(String.class)); + } + /** * Test the property 'applicationId' */