Skip to content

Commit 24da4e0

Browse files
band-swi-release-engineering[bot]DX-Bandwidthckoegel
authored
SWI-11840 Update SDK Based on Recent Spec Changes (#251)
* Generate SDK with OpenAPI Generator Version * unit tests --------- Co-authored-by: DX-Bandwidth <dx@bandwidth.com> Co-authored-by: ckoegel <ckoegel1006@gmail.com>
1 parent e536082 commit 24da4e0

11 files changed

Lines changed: 323 additions & 12 deletions

File tree

api/openapi.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12379,6 +12379,13 @@ components:
1237912379
type: string
1238012380
machineDetectionResult:
1238112381
$ref: "#/components/schemas/machineDetectionResult"
12382+
sipCallId:
12383+
description: "(optional) The SIP Call-ID of the call's current SIP dialog\
12384+
\ with Bandwidth's SBC. Used to correlate dialogs and trace calls. Present\
12385+
\ on any call, inbound or outbound, once that dialog has been established;\
12386+
\ may be absent very early in a call before the dialog exists."
12387+
example: c95ac8d6e1a31c52eb38f419893c151633ec68f8d@sbc.bandwidth.com
12388+
type: string
1238212389
type: object
1238312390
bridgeCompleteCallback:
1238412391
description: "If the target call leaves the <Bridge>, then this callback is\
@@ -12958,6 +12965,19 @@ components:
1295812965
example: exampleTag
1295912966
nullable: true
1296012967
type: string
12968+
sipCallId:
12969+
description: "(optional) The SIP Call-ID of the call's current SIP dialog\
12970+
\ with Bandwidth's SBC. Used to correlate dialogs and trace calls. Present\
12971+
\ on any call, inbound or outbound, once that dialog has been established;\
12972+
\ may be absent very early in a call before the dialog exists."
12973+
example: c95ac8d6e1a31c52eb38f419893c151633ec68f8d@sbc.bandwidth.com
12974+
type: string
12975+
sipResponseCode:
12976+
description: "(optional) The SIP status code returned by Bandwidth's SBC\
12977+
\ when it rejected an outbound call's INVITE (e.g. 486 for busy, 603 for\
12978+
\ decline). Present only when an outbound call was rejected by the SBC."
12979+
example: 486
12980+
type: integer
1296112981
type: object
1296212982
dtmfCallback:
1296312983
description: The DTMF event is sent for every digit detected after a <StartGather>
@@ -13222,6 +13242,27 @@ components:
1322213242
example: bXktdXVp
1322313243
maxLength: 256
1322413244
type: string
13245+
sipCallId:
13246+
description: "(optional) The SIP Call-ID of the call's current SIP dialog\
13247+
\ with Bandwidth's SBC. Used to correlate dialogs and trace calls. Present\
13248+
\ on any call, inbound or outbound, once that dialog has been established;\
13249+
\ may be absent very early in a call before the dialog exists."
13250+
example: c95ac8d6e1a31c52eb38f419893c151633ec68f8d@sbc.bandwidth.com
13251+
type: string
13252+
sipHeaders:
13253+
additionalProperties:
13254+
type: string
13255+
description: "(optional) Map of customer-supplied X-* headers from the original\
13256+
\ INVITE. Keys are lowercase (SIP headers are case-insensitive). Present\
13257+
\ only for inbound SIP URI calls with custom headers. Note - keys preserve\
13258+
\ the original SIP header name in lowercase rather than Bandwidth's usual\
13259+
\ camelCase JSON convention, since these are passthrough values from the\
13260+
\ caller's SIP INVITE, not Bandwidth-defined fields. If the same header\
13261+
\ name is sent more than once in the INVITE, only the last value is kept."
13262+
example:
13263+
x-custom-header: customer-value
13264+
x-session-id: sess-12345
13265+
type: object
1322513266
type: object
1322613267
machineDetectionCompleteCallback:
1322713268
description: "This event is sent to the url informed when requesting a machine\
@@ -14309,6 +14350,33 @@ components:
1430914350
example: bXktdXVp
1431014351
maxLength: 256
1431114352
type: string
14353+
sipCallId:
14354+
description: "(optional) The SIP Call-ID of the call's current SIP dialog with\
14355+
\ Bandwidth's SBC. Used to correlate dialogs and trace calls. Present on any\
14356+
\ call, inbound or outbound, once that dialog has been established; may be\
14357+
\ absent very early in a call before the dialog exists."
14358+
example: c95ac8d6e1a31c52eb38f419893c151633ec68f8d@sbc.bandwidth.com
14359+
type: string
14360+
sipHeaders:
14361+
additionalProperties:
14362+
type: string
14363+
description: "(optional) Map of customer-supplied X-* headers from the original\
14364+
\ INVITE. Keys are lowercase (SIP headers are case-insensitive). Present only\
14365+
\ for inbound SIP URI calls with custom headers. Note - keys preserve the\
14366+
\ original SIP header name in lowercase rather than Bandwidth's usual camelCase\
14367+
\ JSON convention, since these are passthrough values from the caller's SIP\
14368+
\ INVITE, not Bandwidth-defined fields. If the same header name is sent more\
14369+
\ than once in the INVITE, only the last value is kept."
14370+
example:
14371+
x-custom-header: customer-value
14372+
x-session-id: sess-12345
14373+
type: object
14374+
sipResponseCode:
14375+
description: "(optional) The SIP status code returned by Bandwidth's SBC when\
14376+
\ it rejected an outbound call's INVITE (e.g. 486 for busy, 603 for decline).\
14377+
\ Present only when an outbound call was rejected by the SBC."
14378+
example: 486
14379+
type: integer
1431214380
codeRequest:
1431314381
properties:
1431414382
to:

bandwidth.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4568,6 +4568,8 @@ components:
45684568
$ref: '#/components/schemas/tag1'
45694569
machineDetectionResult:
45704570
$ref: '#/components/schemas/machineDetectionResult'
4571+
sipCallId:
4572+
$ref: '#/components/schemas/sipCallId'
45714573
bridgeCompleteCallback:
45724574
type: object
45734575
description: >-
@@ -4832,6 +4834,10 @@ components:
48324834
$ref: '#/components/schemas/errorId'
48334835
tag:
48344836
$ref: '#/components/schemas/tag1'
4837+
sipCallId:
4838+
$ref: '#/components/schemas/sipCallId'
4839+
sipResponseCode:
4840+
$ref: '#/components/schemas/sipResponseCode'
48354841
dtmfCallback:
48364842
type: object
48374843
description: >-
@@ -4948,6 +4954,10 @@ components:
49484954
$ref: '#/components/schemas/stirShaken'
49494955
uui:
49504956
$ref: '#/components/schemas/uui'
4957+
sipCallId:
4958+
$ref: '#/components/schemas/sipCallId'
4959+
sipHeaders:
4960+
$ref: '#/components/schemas/sipHeaders'
49514961
machineDetectionCompleteCallback:
49524962
type: object
49534963
description: >-
@@ -5595,6 +5605,36 @@ components:
55955605
value, including the encoding specifier, may not exceed 256 characters.
55965606
example: bXktdXVp
55975607
maxLength: 256
5608+
sipCallId:
5609+
type: string
5610+
description: >-
5611+
(optional) The SIP Call-ID of the call's current SIP dialog with
5612+
Bandwidth's SBC. Used to correlate dialogs and trace calls. Present on
5613+
any call, inbound or outbound, once that dialog has been established;
5614+
may be absent very early in a call before the dialog exists.
5615+
example: c95ac8d6e1a31c52eb38f419893c151633ec68f8d@sbc.bandwidth.com
5616+
sipHeaders:
5617+
type: object
5618+
additionalProperties:
5619+
type: string
5620+
description: >-
5621+
(optional) Map of customer-supplied X-* headers from the original
5622+
INVITE. Keys are lowercase (SIP headers are case-insensitive). Present
5623+
only for inbound SIP URI calls with custom headers. Note - keys preserve
5624+
the original SIP header name in lowercase rather than Bandwidth's usual
5625+
camelCase JSON convention, since these are passthrough values from the
5626+
caller's SIP INVITE, not Bandwidth-defined fields. If the same header
5627+
name is sent more than once in the INVITE, only the last value is kept.
5628+
example:
5629+
x-custom-header: customer-value
5630+
x-session-id: sess-12345
5631+
sipResponseCode:
5632+
type: integer
5633+
description: >-
5634+
(optional) The SIP status code returned by Bandwidth's SBC when it
5635+
rejected an outbound call's INVITE (e.g. 486 for busy, 603 for decline).
5636+
Present only when an outbound call was rejected by the SBC.
5637+
example: 486
55985638
codeRequest:
55995639
type: object
56005640
properties:

docs/AnswerCallback.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ The Answer event is sent to the answerUrl specified in the createCall request wh
2222
|**answerTime** | **OffsetDateTime** | Time the call was answered, in ISO 8601 format. | [optional] |
2323
|**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] |
2424
|**machineDetectionResult** | [**MachineDetectionResult**](MachineDetectionResult.md) | | [optional] |
25+
|**sipCallId** | **String** | (optional) The SIP Call-ID of the call&#39;s current SIP dialog with Bandwidth&#39;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] |
2526

2627

2728

docs/DisconnectCallback.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ The Disconnect event is fired when a call ends, for any reason.
2525
|**errorMessage** | **String** | Text explaining the reason that caused the call to fail in case of errors. | [optional] |
2626
|**errorId** | **String** | Bandwidth&#39;s internal id that references the error event. | [optional] |
2727
|**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] |
28+
|**sipCallId** | **String** | (optional) The SIP Call-ID of the call&#39;s current SIP dialog with Bandwidth&#39;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] |
29+
|**sipResponseCode** | **Integer** | (optional) The SIP status code returned by Bandwidth&#39;s SBC when it rejected an outbound call&#39;s INVITE (e.g. 486 for busy, 603 for decline). Present only when an outbound call was rejected by the SBC. | [optional] |
2830

2931

3032

docs/InitiateCallback.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ The Initiate event is fired when an inbound call is received for a Telephone Num
2121
|**diversion** | [**Diversion**](Diversion.md) | | [optional] |
2222
|**stirShaken** | [**StirShaken**](StirShaken.md) | | [optional] |
2323
|**uui** | **String** | The value of the &#x60;User-To-User&#x60; header to send within the initial &#x60;INVITE&#x60;. Must include the encoding parameter as specified in RFC 7433. Only &#x60;base64&#x60;, &#x60;jwt&#x60; and &#x60;hex&#x60; encoding are currently allowed. This value, including the encoding specifier, may not exceed 256 characters. | [optional] |
24+
|**sipCallId** | **String** | (optional) The SIP Call-ID of the call&#39;s current SIP dialog with Bandwidth&#39;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] |
25+
|**sipHeaders** | **Map&lt;String, String&gt;** | (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&#39;s usual camelCase JSON convention, since these are passthrough values from the caller&#39;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] |
2426

2527

2628

src/main/java/com/bandwidth/sdk/model/AnswerCallback.java

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ public class AnswerCallback {
127127
@javax.annotation.Nullable
128128
private MachineDetectionResult machineDetectionResult;
129129

130+
public static final String SERIALIZED_NAME_SIP_CALL_ID = "sipCallId";
131+
@SerializedName(SERIALIZED_NAME_SIP_CALL_ID)
132+
@javax.annotation.Nullable
133+
private String sipCallId;
134+
130135
public AnswerCallback() {
131136
}
132137

@@ -395,6 +400,25 @@ public void setMachineDetectionResult(@javax.annotation.Nullable MachineDetectio
395400
this.machineDetectionResult = machineDetectionResult;
396401
}
397402

403+
404+
public AnswerCallback sipCallId(@javax.annotation.Nullable String sipCallId) {
405+
this.sipCallId = sipCallId;
406+
return this;
407+
}
408+
409+
/**
410+
* (optional) The SIP Call-ID of the call&#39;s current SIP dialog with Bandwidth&#39;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.
411+
* @return sipCallId
412+
*/
413+
@javax.annotation.Nullable
414+
public String getSipCallId() {
415+
return sipCallId;
416+
}
417+
418+
public void setSipCallId(@javax.annotation.Nullable String sipCallId) {
419+
this.sipCallId = sipCallId;
420+
}
421+
398422
/**
399423
* A container for additional, undeclared properties.
400424
* This is a holder for any undeclared properties as specified with
@@ -463,7 +487,8 @@ public boolean equals(Object o) {
463487
Objects.equals(this.startTime, answerCallback.startTime) &&
464488
Objects.equals(this.answerTime, answerCallback.answerTime) &&
465489
Objects.equals(this.tag, answerCallback.tag) &&
466-
Objects.equals(this.machineDetectionResult, answerCallback.machineDetectionResult)&&
490+
Objects.equals(this.machineDetectionResult, answerCallback.machineDetectionResult) &&
491+
Objects.equals(this.sipCallId, answerCallback.sipCallId)&&
467492
Objects.equals(this.additionalProperties, answerCallback.additionalProperties);
468493
}
469494

@@ -473,7 +498,7 @@ private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b)
473498

474499
@Override
475500
public int hashCode() {
476-
return Objects.hash(eventType, eventTime, accountId, applicationId, from, to, direction, callId, callUrl, enqueuedTime, startTime, answerTime, tag, machineDetectionResult, additionalProperties);
501+
return Objects.hash(eventType, eventTime, accountId, applicationId, from, to, direction, callId, callUrl, enqueuedTime, startTime, answerTime, tag, machineDetectionResult, sipCallId, additionalProperties);
477502
}
478503

479504
private static <T> int hashCodeNullable(JsonNullable<T> a) {
@@ -501,6 +526,7 @@ public String toString() {
501526
sb.append(" answerTime: ").append(toIndentedString(answerTime)).append("\n");
502527
sb.append(" tag: ").append(toIndentedString(tag)).append("\n");
503528
sb.append(" machineDetectionResult: ").append(toIndentedString(machineDetectionResult)).append("\n");
529+
sb.append(" sipCallId: ").append(toIndentedString(sipCallId)).append("\n");
504530
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
505531
sb.append("}");
506532
return sb.toString();
@@ -523,7 +549,7 @@ private String toIndentedString(Object o) {
523549

524550
static {
525551
// a set of all properties/fields (JSON key names)
526-
openapiFields = new HashSet<String>(Arrays.asList("eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag", "machineDetectionResult"));
552+
openapiFields = new HashSet<String>(Arrays.asList("eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag", "machineDetectionResult", "sipCallId"));
527553

528554
// a set of required properties/fields (JSON key names)
529555
openapiRequiredFields = new HashSet<String>(0);
@@ -574,6 +600,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
574600
if (jsonObj.get("machineDetectionResult") != null && !jsonObj.get("machineDetectionResult").isJsonNull()) {
575601
MachineDetectionResult.validateJsonElement(jsonObj.get("machineDetectionResult"));
576602
}
603+
if ((jsonObj.get("sipCallId") != null && !jsonObj.get("sipCallId").isJsonNull()) && !jsonObj.get("sipCallId").isJsonPrimitive()) {
604+
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()));
605+
}
577606
}
578607

579608
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

0 commit comments

Comments
 (0)