diff --git a/api/openapi.yaml b/api/openapi.yaml index cacef410..7bb41d49 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -12379,6 +12379,13 @@ components: type: string machineDetectionResult: $ref: "#/components/schemas/machineDetectionResult" + sipCallId: + description: "(optional) The SIP Call-ID of the call's current SIP dialog\ + \ with Bandwidth's SBC. Used to correlate dialogs and trace calls. Present\ + \ on any call, inbound or outbound, once that dialog has been established;\ + \ may be absent very early in a call before the dialog exists." + example: c95ac8d6e1a31c52eb38f419893c151633ec68f8d@sbc.bandwidth.com + type: string type: object bridgeCompleteCallback: description: "If the target call leaves the , then this callback is\ @@ -12958,6 +12965,19 @@ components: example: exampleTag nullable: true type: string + sipCallId: + description: "(optional) The SIP Call-ID of the call's current SIP dialog\ + \ with Bandwidth's SBC. Used to correlate dialogs and trace calls. Present\ + \ on any call, inbound or outbound, once that dialog has been established;\ + \ may be absent very early in a call before the dialog exists." + example: c95ac8d6e1a31c52eb38f419893c151633ec68f8d@sbc.bandwidth.com + type: string + sipResponseCode: + description: "(optional) The SIP status code returned by Bandwidth's SBC\ + \ when it rejected an outbound call's INVITE (e.g. 486 for busy, 603 for\ + \ decline). Present only when an outbound call was rejected by the SBC." + example: 486 + type: integer type: object dtmfCallback: description: The DTMF event is sent for every digit detected after a @@ -13222,6 +13242,27 @@ components: example: bXktdXVp maxLength: 256 type: string + sipCallId: + description: "(optional) The SIP Call-ID of the call's current SIP dialog\ + \ with Bandwidth's SBC. Used to correlate dialogs and trace calls. Present\ + \ on any call, inbound or outbound, once that dialog has been established;\ + \ may be absent very early in a call before the dialog exists." + example: c95ac8d6e1a31c52eb38f419893c151633ec68f8d@sbc.bandwidth.com + type: string + sipHeaders: + additionalProperties: + type: string + description: "(optional) Map of customer-supplied X-* headers from the original\ + \ INVITE. Keys are lowercase (SIP headers are case-insensitive). Present\ + \ only for inbound SIP URI calls with custom headers. Note - keys preserve\ + \ the original SIP header name in lowercase rather than Bandwidth's usual\ + \ camelCase JSON convention, since these are passthrough values from the\ + \ caller's SIP INVITE, not Bandwidth-defined fields. If the same header\ + \ name is sent more than once in the INVITE, only the last value is kept." + example: + x-custom-header: customer-value + x-session-id: sess-12345 + type: object type: object machineDetectionCompleteCallback: description: "This event is sent to the url informed when requesting a machine\ @@ -14309,6 +14350,33 @@ components: example: bXktdXVp maxLength: 256 type: string + sipCallId: + description: "(optional) The SIP Call-ID of the call's current SIP dialog with\ + \ Bandwidth's SBC. Used to correlate dialogs and trace calls. Present on any\ + \ call, inbound or outbound, once that dialog has been established; may be\ + \ absent very early in a call before the dialog exists." + example: c95ac8d6e1a31c52eb38f419893c151633ec68f8d@sbc.bandwidth.com + type: string + sipHeaders: + additionalProperties: + type: string + description: "(optional) Map of customer-supplied X-* headers from the original\ + \ INVITE. Keys are lowercase (SIP headers are case-insensitive). Present only\ + \ for inbound SIP URI calls with custom headers. Note - keys preserve the\ + \ original SIP header name in lowercase rather than Bandwidth's usual camelCase\ + \ JSON convention, since these are passthrough values from the caller's SIP\ + \ INVITE, not Bandwidth-defined fields. If the same header name is sent more\ + \ than once in the INVITE, only the last value is kept." + example: + x-custom-header: customer-value + x-session-id: sess-12345 + type: object + sipResponseCode: + description: "(optional) The SIP status code returned by Bandwidth's SBC when\ + \ it rejected an outbound call's INVITE (e.g. 486 for busy, 603 for decline).\ + \ Present only when an outbound call was rejected by the SBC." + example: 486 + type: integer codeRequest: properties: to: diff --git a/bandwidth.yml b/bandwidth.yml index 52ceffd4..305a40b7 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -4568,6 +4568,8 @@ components: $ref: '#/components/schemas/tag1' machineDetectionResult: $ref: '#/components/schemas/machineDetectionResult' + sipCallId: + $ref: '#/components/schemas/sipCallId' bridgeCompleteCallback: type: object description: >- @@ -4832,6 +4834,10 @@ components: $ref: '#/components/schemas/errorId' tag: $ref: '#/components/schemas/tag1' + sipCallId: + $ref: '#/components/schemas/sipCallId' + sipResponseCode: + $ref: '#/components/schemas/sipResponseCode' dtmfCallback: type: object description: >- @@ -4948,6 +4954,10 @@ components: $ref: '#/components/schemas/stirShaken' uui: $ref: '#/components/schemas/uui' + sipCallId: + $ref: '#/components/schemas/sipCallId' + sipHeaders: + $ref: '#/components/schemas/sipHeaders' machineDetectionCompleteCallback: type: object description: >- @@ -5595,6 +5605,36 @@ components: value, including the encoding specifier, may not exceed 256 characters. example: bXktdXVp maxLength: 256 + sipCallId: + type: string + description: >- + (optional) The SIP Call-ID of the call's current SIP dialog with + Bandwidth's SBC. Used to correlate dialogs and trace calls. Present on + any call, inbound or outbound, once that dialog has been established; + may be absent very early in a call before the dialog exists. + example: c95ac8d6e1a31c52eb38f419893c151633ec68f8d@sbc.bandwidth.com + sipHeaders: + type: object + additionalProperties: + type: string + description: >- + (optional) Map of customer-supplied X-* headers from the original + INVITE. Keys are lowercase (SIP headers are case-insensitive). Present + only for inbound SIP URI calls with custom headers. Note - keys preserve + the original SIP header name in lowercase rather than Bandwidth's usual + camelCase JSON convention, since these are passthrough values from the + caller's SIP INVITE, not Bandwidth-defined fields. If the same header + name is sent more than once in the INVITE, only the last value is kept. + example: + x-custom-header: customer-value + x-session-id: sess-12345 + sipResponseCode: + type: integer + description: >- + (optional) The SIP status code returned by Bandwidth's SBC when it + rejected an outbound call's INVITE (e.g. 486 for busy, 603 for decline). + Present only when an outbound call was rejected by the SBC. + example: 486 codeRequest: type: object properties: diff --git a/docs/AnswerCallback.md b/docs/AnswerCallback.md index 1db1cdcd..fce1cb0f 100644 --- a/docs/AnswerCallback.md +++ b/docs/AnswerCallback.md @@ -22,6 +22,7 @@ The Answer event is sent to the answerUrl specified in the createCall request wh |**answerTime** | **OffsetDateTime** | Time the call was answered, in ISO 8601 format. | [optional] | |**tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | |**machineDetectionResult** | [**MachineDetectionResult**](MachineDetectionResult.md) | | [optional] | +|**sipCallId** | **String** | (optional) The SIP Call-ID of the call's current SIP dialog with Bandwidth's SBC. Used to correlate dialogs and trace calls. Present on any call, inbound or outbound, once that dialog has been established; may be absent very early in a call before the dialog exists. | [optional] | diff --git a/docs/DisconnectCallback.md b/docs/DisconnectCallback.md index d2fd7545..816d3a90 100644 --- a/docs/DisconnectCallback.md +++ b/docs/DisconnectCallback.md @@ -25,6 +25,8 @@ The Disconnect event is fired when a call ends, for any reason. |**errorMessage** | **String** | Text explaining the reason that caused the call to fail in case of errors. | [optional] | |**errorId** | **String** | Bandwidth's internal id that references the error event. | [optional] | |**tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | +|**sipCallId** | **String** | (optional) The SIP Call-ID of the call's current SIP dialog with Bandwidth's SBC. Used to correlate dialogs and trace calls. Present on any call, inbound or outbound, once that dialog has been established; may be absent very early in a call before the dialog exists. | [optional] | +|**sipResponseCode** | **Integer** | (optional) The SIP status code returned by Bandwidth's SBC when it rejected an outbound call's INVITE (e.g. 486 for busy, 603 for decline). Present only when an outbound call was rejected by the SBC. | [optional] | diff --git a/docs/InitiateCallback.md b/docs/InitiateCallback.md index 9a841ae8..0b0d0d7e 100644 --- a/docs/InitiateCallback.md +++ b/docs/InitiateCallback.md @@ -21,6 +21,8 @@ The Initiate event is fired when an inbound call is received for a Telephone Num |**diversion** | [**Diversion**](Diversion.md) | | [optional] | |**stirShaken** | [**StirShaken**](StirShaken.md) | | [optional] | |**uui** | **String** | The value of the `User-To-User` header to send within the initial `INVITE`. Must include the encoding parameter as specified in RFC 7433. Only `base64`, `jwt` and `hex` encoding are currently allowed. This value, including the encoding specifier, may not exceed 256 characters. | [optional] | +|**sipCallId** | **String** | (optional) The SIP Call-ID of the call's current SIP dialog with Bandwidth's SBC. Used to correlate dialogs and trace calls. Present on any call, inbound or outbound, once that dialog has been established; may be absent very early in a call before the dialog exists. | [optional] | +|**sipHeaders** | **Map<String, String>** | (optional) Map of customer-supplied X-* headers from the original INVITE. Keys are lowercase (SIP headers are case-insensitive). Present only for inbound SIP URI calls with custom headers. Note - keys preserve the original SIP header name in lowercase rather than Bandwidth's usual camelCase JSON convention, since these are passthrough values from the caller's SIP INVITE, not Bandwidth-defined fields. If the same header name is sent more than once in the INVITE, only the last value is kept. | [optional] | diff --git a/src/main/java/com/bandwidth/sdk/model/AnswerCallback.java b/src/main/java/com/bandwidth/sdk/model/AnswerCallback.java index 15b47454..79a372c0 100644 --- a/src/main/java/com/bandwidth/sdk/model/AnswerCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/AnswerCallback.java @@ -127,6 +127,11 @@ public class AnswerCallback { @javax.annotation.Nullable private MachineDetectionResult machineDetectionResult; + public static final String SERIALIZED_NAME_SIP_CALL_ID = "sipCallId"; + @SerializedName(SERIALIZED_NAME_SIP_CALL_ID) + @javax.annotation.Nullable + private String sipCallId; + public AnswerCallback() { } @@ -395,6 +400,25 @@ public void setMachineDetectionResult(@javax.annotation.Nullable MachineDetectio this.machineDetectionResult = machineDetectionResult; } + + public AnswerCallback sipCallId(@javax.annotation.Nullable String sipCallId) { + this.sipCallId = sipCallId; + return this; + } + + /** + * (optional) The SIP Call-ID of the call's current SIP dialog with Bandwidth's SBC. Used to correlate dialogs and trace calls. Present on any call, inbound or outbound, once that dialog has been established; may be absent very early in a call before the dialog exists. + * @return sipCallId + */ + @javax.annotation.Nullable + public String getSipCallId() { + return sipCallId; + } + + public void setSipCallId(@javax.annotation.Nullable String sipCallId) { + this.sipCallId = sipCallId; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -463,7 +487,8 @@ public boolean equals(Object o) { Objects.equals(this.startTime, answerCallback.startTime) && Objects.equals(this.answerTime, answerCallback.answerTime) && Objects.equals(this.tag, answerCallback.tag) && - Objects.equals(this.machineDetectionResult, answerCallback.machineDetectionResult)&& + Objects.equals(this.machineDetectionResult, answerCallback.machineDetectionResult) && + Objects.equals(this.sipCallId, answerCallback.sipCallId)&& Objects.equals(this.additionalProperties, answerCallback.additionalProperties); } @@ -473,7 +498,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(eventType, eventTime, accountId, applicationId, from, to, direction, callId, callUrl, enqueuedTime, startTime, answerTime, tag, machineDetectionResult, additionalProperties); + return Objects.hash(eventType, eventTime, accountId, applicationId, from, to, direction, callId, callUrl, enqueuedTime, startTime, answerTime, tag, machineDetectionResult, sipCallId, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -501,6 +526,7 @@ public String toString() { sb.append(" answerTime: ").append(toIndentedString(answerTime)).append("\n"); sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); sb.append(" machineDetectionResult: ").append(toIndentedString(machineDetectionResult)).append("\n"); + sb.append(" sipCallId: ").append(toIndentedString(sipCallId)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -523,7 +549,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag", "machineDetectionResult")); + openapiFields = new HashSet(Arrays.asList("eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag", "machineDetectionResult", "sipCallId")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -574,6 +600,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("machineDetectionResult") != null && !jsonObj.get("machineDetectionResult").isJsonNull()) { MachineDetectionResult.validateJsonElement(jsonObj.get("machineDetectionResult")); } + if ((jsonObj.get("sipCallId") != null && !jsonObj.get("sipCallId").isJsonNull()) && !jsonObj.get("sipCallId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `sipCallId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sipCallId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/bandwidth/sdk/model/DisconnectCallback.java b/src/main/java/com/bandwidth/sdk/model/DisconnectCallback.java index fe8e1c31..12977642 100644 --- a/src/main/java/com/bandwidth/sdk/model/DisconnectCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/DisconnectCallback.java @@ -141,6 +141,16 @@ public class DisconnectCallback { @javax.annotation.Nullable private String tag; + public static final String SERIALIZED_NAME_SIP_CALL_ID = "sipCallId"; + @SerializedName(SERIALIZED_NAME_SIP_CALL_ID) + @javax.annotation.Nullable + private String sipCallId; + + public static final String SERIALIZED_NAME_SIP_RESPONSE_CODE = "sipResponseCode"; + @SerializedName(SERIALIZED_NAME_SIP_RESPONSE_CODE) + @javax.annotation.Nullable + private Integer sipResponseCode; + public DisconnectCallback() { } @@ -466,6 +476,44 @@ public void setTag(@javax.annotation.Nullable String tag) { this.tag = tag; } + + public DisconnectCallback sipCallId(@javax.annotation.Nullable String sipCallId) { + this.sipCallId = sipCallId; + return this; + } + + /** + * (optional) The SIP Call-ID of the call's current SIP dialog with Bandwidth's SBC. Used to correlate dialogs and trace calls. Present on any call, inbound or outbound, once that dialog has been established; may be absent very early in a call before the dialog exists. + * @return sipCallId + */ + @javax.annotation.Nullable + public String getSipCallId() { + return sipCallId; + } + + public void setSipCallId(@javax.annotation.Nullable String sipCallId) { + this.sipCallId = sipCallId; + } + + + public DisconnectCallback sipResponseCode(@javax.annotation.Nullable Integer sipResponseCode) { + this.sipResponseCode = sipResponseCode; + return this; + } + + /** + * (optional) The SIP status code returned by Bandwidth's SBC when it rejected an outbound call's INVITE (e.g. 486 for busy, 603 for decline). Present only when an outbound call was rejected by the SBC. + * @return sipResponseCode + */ + @javax.annotation.Nullable + public Integer getSipResponseCode() { + return sipResponseCode; + } + + public void setSipResponseCode(@javax.annotation.Nullable Integer sipResponseCode) { + this.sipResponseCode = sipResponseCode; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -537,7 +585,9 @@ public boolean equals(Object o) { Objects.equals(this.cause, disconnectCallback.cause) && Objects.equals(this.errorMessage, disconnectCallback.errorMessage) && Objects.equals(this.errorId, disconnectCallback.errorId) && - Objects.equals(this.tag, disconnectCallback.tag)&& + Objects.equals(this.tag, disconnectCallback.tag) && + Objects.equals(this.sipCallId, disconnectCallback.sipCallId) && + Objects.equals(this.sipResponseCode, disconnectCallback.sipResponseCode)&& Objects.equals(this.additionalProperties, disconnectCallback.additionalProperties); } @@ -547,7 +597,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(eventType, eventTime, accountId, applicationId, from, to, callId, direction, callUrl, enqueuedTime, startTime, answerTime, endTime, cause, errorMessage, errorId, tag, additionalProperties); + return Objects.hash(eventType, eventTime, accountId, applicationId, from, to, callId, direction, callUrl, enqueuedTime, startTime, answerTime, endTime, cause, errorMessage, errorId, tag, sipCallId, sipResponseCode, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -578,6 +628,8 @@ public String toString() { sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); sb.append(" errorId: ").append(toIndentedString(errorId)).append("\n"); sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" sipCallId: ").append(toIndentedString(sipCallId)).append("\n"); + sb.append(" sipResponseCode: ").append(toIndentedString(sipResponseCode)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -600,7 +652,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("eventType", "eventTime", "accountId", "applicationId", "from", "to", "callId", "direction", "callUrl", "enqueuedTime", "startTime", "answerTime", "endTime", "cause", "errorMessage", "errorId", "tag")); + openapiFields = new HashSet(Arrays.asList("eventType", "eventTime", "accountId", "applicationId", "from", "to", "callId", "direction", "callUrl", "enqueuedTime", "startTime", "answerTime", "endTime", "cause", "errorMessage", "errorId", "tag", "sipCallId", "sipResponseCode")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -656,6 +708,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString())); } + if ((jsonObj.get("sipCallId") != null && !jsonObj.get("sipCallId").isJsonNull()) && !jsonObj.get("sipCallId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `sipCallId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sipCallId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/bandwidth/sdk/model/InitiateCallback.java b/src/main/java/com/bandwidth/sdk/model/InitiateCallback.java index 871ac648..f036e384 100644 --- a/src/main/java/com/bandwidth/sdk/model/InitiateCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/InitiateCallback.java @@ -27,6 +27,8 @@ import java.net.URI; import java.time.OffsetDateTime; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -122,6 +124,16 @@ public class InitiateCallback { @javax.annotation.Nullable private String uui; + public static final String SERIALIZED_NAME_SIP_CALL_ID = "sipCallId"; + @SerializedName(SERIALIZED_NAME_SIP_CALL_ID) + @javax.annotation.Nullable + private String sipCallId; + + public static final String SERIALIZED_NAME_SIP_HEADERS = "sipHeaders"; + @SerializedName(SERIALIZED_NAME_SIP_HEADERS) + @javax.annotation.Nullable + private Map sipHeaders = new HashMap<>(); + public InitiateCallback() { } @@ -371,6 +383,52 @@ public void setUui(@javax.annotation.Nullable String uui) { this.uui = uui; } + + public InitiateCallback sipCallId(@javax.annotation.Nullable String sipCallId) { + this.sipCallId = sipCallId; + return this; + } + + /** + * (optional) The SIP Call-ID of the call's current SIP dialog with Bandwidth's SBC. Used to correlate dialogs and trace calls. Present on any call, inbound or outbound, once that dialog has been established; may be absent very early in a call before the dialog exists. + * @return sipCallId + */ + @javax.annotation.Nullable + public String getSipCallId() { + return sipCallId; + } + + public void setSipCallId(@javax.annotation.Nullable String sipCallId) { + this.sipCallId = sipCallId; + } + + + public InitiateCallback sipHeaders(@javax.annotation.Nullable Map sipHeaders) { + this.sipHeaders = sipHeaders; + return this; + } + + public InitiateCallback putSipHeadersItem(String key, String sipHeadersItem) { + if (this.sipHeaders == null) { + this.sipHeaders = new HashMap<>(); + } + this.sipHeaders.put(key, sipHeadersItem); + return this; + } + + /** + * (optional) Map of customer-supplied X-* headers from the original INVITE. Keys are lowercase (SIP headers are case-insensitive). Present only for inbound SIP URI calls with custom headers. Note - keys preserve the original SIP header name in lowercase rather than Bandwidth's usual camelCase JSON convention, since these are passthrough values from the caller's SIP INVITE, not Bandwidth-defined fields. If the same header name is sent more than once in the INVITE, only the last value is kept. + * @return sipHeaders + */ + @javax.annotation.Nullable + public Map getSipHeaders() { + return sipHeaders; + } + + public void setSipHeaders(@javax.annotation.Nullable Map sipHeaders) { + this.sipHeaders = sipHeaders; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -438,13 +496,15 @@ public boolean equals(Object o) { Objects.equals(this.startTime, initiateCallback.startTime) && Objects.equals(this.diversion, initiateCallback.diversion) && Objects.equals(this.stirShaken, initiateCallback.stirShaken) && - Objects.equals(this.uui, initiateCallback.uui)&& + Objects.equals(this.uui, initiateCallback.uui) && + Objects.equals(this.sipCallId, initiateCallback.sipCallId) && + Objects.equals(this.sipHeaders, initiateCallback.sipHeaders)&& Objects.equals(this.additionalProperties, initiateCallback.additionalProperties); } @Override public int hashCode() { - return Objects.hash(eventType, eventTime, accountId, applicationId, from, to, direction, callId, callUrl, startTime, diversion, stirShaken, uui, additionalProperties); + return Objects.hash(eventType, eventTime, accountId, applicationId, from, to, direction, callId, callUrl, startTime, diversion, stirShaken, uui, sipCallId, sipHeaders, additionalProperties); } @Override @@ -464,6 +524,8 @@ public String toString() { sb.append(" diversion: ").append(toIndentedString(diversion)).append("\n"); sb.append(" stirShaken: ").append(toIndentedString(stirShaken)).append("\n"); sb.append(" uui: ").append(toIndentedString(uui)).append("\n"); + sb.append(" sipCallId: ").append(toIndentedString(sipCallId)).append("\n"); + sb.append(" sipHeaders: ").append(toIndentedString(sipHeaders)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -486,7 +548,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "startTime", "diversion", "stirShaken", "uui")); + openapiFields = new HashSet(Arrays.asList("eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "startTime", "diversion", "stirShaken", "uui", "sipCallId", "sipHeaders")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -541,6 +603,9 @@ 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(Locale.ROOT, "Expected the field `uui` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uui").toString())); } + if ((jsonObj.get("sipCallId") != null && !jsonObj.get("sipCallId").isJsonNull()) && !jsonObj.get("sipCallId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `sipCallId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sipCallId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/test/java/com/bandwidth/sdk/unit/models/AnswerCallbackTest.java b/src/test/java/com/bandwidth/sdk/unit/models/AnswerCallbackTest.java index e8655730..114ecada 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/AnswerCallbackTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/AnswerCallbackTest.java @@ -43,7 +43,8 @@ public class AnswerCallbackTest { .tag("tag") .machineDetectionResult(new MachineDetectionResult() .value("answering-machine") - .duration("PT4.9891287S")); + .duration("PT4.9891287S")) + .sipCallId("sipCallId"); /** * Model tests for AnswerCallback @@ -165,4 +166,12 @@ public void machineDetectionResultTest() { assertThat(model.getMachineDetectionResult(), instanceOf(MachineDetectionResult.class)); } + /** + * Test the property 'sipCallId' + */ + @Test + public void sipCallIdTest() { + assertThat(model.getSipCallId(), instanceOf(String.class)); + } + } diff --git a/src/test/java/com/bandwidth/sdk/unit/models/DisconnectCallbackTest.java b/src/test/java/com/bandwidth/sdk/unit/models/DisconnectCallbackTest.java index 5d05e41f..024219e5 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/DisconnectCallbackTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/DisconnectCallbackTest.java @@ -43,7 +43,9 @@ public class DisconnectCallbackTest { .cause("cause") .errorMessage("errorMessage") .errorId("errorId") - .tag("tag"); + .tag("tag") + .sipCallId("sipCallId") + .sipResponseCode(200); /** * Model tests for DisconnectCallback @@ -189,4 +191,19 @@ public void tagTest() { assertThat(model.getTag(), instanceOf(String.class)); } + /** + * Test the property 'sipCallId' + */ + @Test + public void sipCallIdTest() { + assertThat(model.getSipCallId(), instanceOf(String.class)); + } + + /** + * Test the property 'sipResponseCode' + */ + @Test + public void sipResponseCodeTest() { + assertThat(model.getSipResponseCode(), instanceOf(Integer.class)); + } } diff --git a/src/test/java/com/bandwidth/sdk/unit/models/InitiateCallbackTest.java b/src/test/java/com/bandwidth/sdk/unit/models/InitiateCallbackTest.java index f8e2bd8d..403e1bf7 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/InitiateCallbackTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/InitiateCallbackTest.java @@ -16,6 +16,8 @@ import java.net.URI; import java.time.OffsetDateTime; +import java.util.Map; + import com.bandwidth.sdk.model.InitiateCallback; import com.bandwidth.sdk.model.Diversion; import com.bandwidth.sdk.model.StirShaken; @@ -41,9 +43,14 @@ public class InitiateCallbackTest { .startTime(OffsetDateTime.now()) .diversion(new Diversion()) .stirShaken(new StirShaken()) - .uui("uui"); + .uui("uui") + .sipCallId("sipCallId") + .sipHeaders(Map.of( + "x-header1", + "x-header2")); /** + * * Model tests for InitiateCallback */ @Test @@ -155,4 +162,20 @@ public void uuiTest() { assertThat(model.getUui(), instanceOf(String.class)); } + /** + * Test the property 'sipCallId' + */ + @Test + public void sipCallIdTest() { + assertThat(model.getSipCallId(), instanceOf(String.class)); + } + + /** + * Test the property 'sipHeaders' + */ + @Test + public void sipHeadersTest() { + assertThat(model.getSipHeaders(), instanceOf(Map.class)); + } + }