Skip to content

Commit

Permalink
SWI-5381 Update SDK Based on Recent Spec Changes (#136)
Browse files Browse the repository at this point in the history
* Generate SDK with OpenAPI Generator Version 7.0.0

* Clean SDK using Rubocop

* update calls tests to include privacy

---------

Co-authored-by: DX-Bandwidth <[email protected]>
Co-authored-by: ckoegel <[email protected]>
  • Loading branch information
3 people authored Jun 6, 2024
1 parent e686cc7 commit 8375228
Show file tree
Hide file tree
Showing 44 changed files with 102 additions and 76 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ end

api_instance = Bandwidth::CallsApi.new
account_id = '9900000' # String | Your Bandwidth Account ID.
create_call = Bandwidth::CreateCall.new({to: '+19195551234', from: '+19195554321', application_id: '1234-qwer-5679-tyui', answer_url: 'https://www.myCallbackServer.example/webhooks/answer'}) # CreateCall | JSON object containing information to create an outbound call
create_call = Bandwidth::CreateCall.new({to: '+19195551234', from: '+15555551212', application_id: '1234-qwer-5679-tyui', answer_url: 'https://www.myCallbackServer.example/webhooks/answer'}) # CreateCall | JSON object containing information to create an outbound call

begin
#Create Call
Expand Down
31 changes: 20 additions & 11 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2152,11 +2152,16 @@ components:
description: >-
A Bandwidth phone number on your account the call should come
from (must be in E.164 format, like `+15555551212`, or be one of the
following
strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`).
example: '+19195554321'
from (must be in E.164 format, like `+15555551212`) even if
`privacy` is set to true.
example: '+15555551212'
privacy:
nullable: true
type: boolean
description: >-
Hide the calling number. The `displayName` field can be used to
customize the displayed name.
example: false
displayName:
nullable: true
type: string
Expand All @@ -2165,6 +2170,9 @@ components:
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`.
maxLength: 256
example: John Doe
uui:
Expand Down Expand Up @@ -3023,7 +3031,10 @@ components:
description: >-
The machine detection request used to perform <a
href='/docs/voice/guides/machineDetection'>machine detection</a> on the
call.
call. Currently, there is an issue where decimal values are not getting
processed correctly. Please use whole number values. We are working to
resolve this issue. Please contact Bandwidth Support if you need more
information.
properties:
mode:
$ref: '#/components/schemas/machineDetectionModeEnum'
Expand Down Expand Up @@ -4142,9 +4153,8 @@ components:
from:
type: string
description: >-
The provided identifier of the caller: can be a phone number in E.164
format (e.g. +15555555555) or one of Private, Restricted, Unavailable,
or Anonymous.
The provided identifier of the caller. Must be a phone number in E.164
format (e.g. +15555555555).
example: '+15555555555'
conferenceId:
type: string
Expand Down Expand Up @@ -4223,8 +4233,7 @@ components:
type: string
description: >-
The phone number used as the from field of the B-leg call, in E.164
format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or
Unavailable.
format (e.g. +15555555555).
example: '+15555555555'
transferTo:
type: string
Expand Down
2 changes: 1 addition & 1 deletion docs/AnswerCallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
| **account_id** | **String** | The user account associated with the call. | [optional] |
| **application_id** | **String** | The id of the application associated with the call. | [optional] |
| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
| **from** | **String** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] |
| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
| **call_id** | **String** | The call id associated with the event. | [optional] |
Expand Down
2 changes: 1 addition & 1 deletion docs/BridgeCompleteCallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
| **account_id** | **String** | The user account associated with the call. | [optional] |
| **application_id** | **String** | The id of the application associated with the call. | [optional] |
| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
| **from** | **String** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] |
| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
| **call_id** | **String** | The call id associated with the event. | [optional] |
Expand Down
2 changes: 1 addition & 1 deletion docs/BridgeTargetCompleteCallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
| **account_id** | **String** | The user account associated with the call. | [optional] |
| **application_id** | **String** | The id of the application associated with the call. | [optional] |
| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
| **from** | **String** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] |
| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
| **call_id** | **String** | The call id associated with the event. | [optional] |
Expand Down
4 changes: 2 additions & 2 deletions docs/CallRecordingMetadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
| **parent_call_id** | **String** | (optional) If the event is related to the B leg of a &lt;Transfer&gt;, the call id of the original call leg that executed the &lt;Transfer&gt;. Otherwise, this field will not be present. | [optional] |
| **recording_id** | **String** | The unique ID of this recording | [optional] |
| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] |
| **from** | **String** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] |
| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
| **transfer_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
| **duration** | **String** | The duration of the recording in ISO-8601 format | [optional] |
| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
Expand Down
2 changes: 1 addition & 1 deletion docs/CallsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ end

api_instance = Bandwidth::CallsApi.new
account_id = '9900000' # String | Your Bandwidth Account ID.
create_call = Bandwidth::CreateCall.new({to: '+19195551234', from: '+19195554321', application_id: '1234-qwer-5679-tyui', answer_url: 'https://www.myCallbackServer.example/webhooks/answer'}) # CreateCall | JSON object containing information to create an outbound call
create_call = Bandwidth::CreateCall.new({to: '+19195551234', from: '+15555551212', application_id: '1234-qwer-5679-tyui', answer_url: 'https://www.myCallbackServer.example/webhooks/answer'}) # CreateCall | JSON object containing information to create an outbound call

begin
# Create Call
Expand Down
2 changes: 1 addition & 1 deletion docs/ConferenceMemberExitCallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
| **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] |
| **name** | **String** | The user-specified name of the conference that was recorded | [optional] |
| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
| **from** | **String** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] |
| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
| **call_id** | **String** | The call id associated with the 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] |
Expand Down
2 changes: 1 addition & 1 deletion docs/ConferenceMemberJoinCallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
| **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] |
| **name** | **String** | The user-specified name of the conference that was recorded | [optional] |
| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
| **from** | **String** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] |
| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
| **call_id** | **String** | The call id associated with the 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] |
Expand Down
8 changes: 5 additions & 3 deletions docs/CreateCall.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **to** | **String** | The destination to call (must be an E.164 formatted number (e.g. &#x60;+15555551212&#x60;) or a SIP URI (e.g. &#x60;sip:user@server.example&#x60;)). | |
| **from** | **String** | A Bandwidth phone number on your account the call should come from (must be in E.164 format, like &#x60;+15555551212&#x60;, or be one of the following strings: &#x60;Restricted&#x60;, &#x60;Anonymous&#x60;, &#x60;Private&#x60;, or &#x60;Unavailable&#x60;). | |
| **display_name** | **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. | [optional] |
| **from** | **String** | A Bandwidth phone number on your account the call should come from (must be in E.164 format, like &#x60;+15555551212&#x60;) even if &#x60;privacy&#x60; is set to true. | |
| **privacy** | **Boolean** | Hide the calling number. The &#x60;displayName&#x60; field can be used to customize the displayed name. | [optional] |
| **display_name** | **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 &#x60;privacy&#x60; is true, only the following values are valid: &#x60;Restricted&#x60;, &#x60;Anonymous&#x60;, &#x60;Private&#x60;, or &#x60;Unavailable&#x60;. | [optional] |
| **uui** | **String** | A comma-separated list of &#39;User-To-User&#39; headers to be sent in the INVITE when calling a SIP URI. Each value must end with an &#39;encoding&#39; parameter as described in &lt;a href&#x3D;&#39;https://tools.ietf.org/html/rfc7433&#39;&gt;RFC 7433&lt;/a&gt;. Only &#39;jwt&#39; and &#39;base64&#39; encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional] |
| **application_id** | **String** | The id of the application associated with the &#x60;from&#x60; number. | |
| **answer_url** | **String** | The full URL to send the &lt;a href&#x3D;&#39;/docs/voice/webhooks/answer&#39;&gt;Answer&lt;/a&gt; event to when the called party answers. This endpoint should return the first &lt;a href&#x3D;&#39;/docs/voice/bxml&#39;&gt;BXML document&lt;/a&gt; to be executed in the call. Must use &#x60;https&#x60; if specifying &#x60;username&#x60; and &#x60;password&#x60;. | |
Expand All @@ -32,7 +33,8 @@ require 'bandwidth-sdk'

instance = Bandwidth::CreateCall.new(
to: +19195551234,
from: +19195554321,
from: +15555551212,
privacy: false,
display_name: John Doe,
uui: eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding&#x3D;jwt,aGVsbG8gd29ybGQ;encoding&#x3D;base64,
application_id: 1234-qwer-5679-tyui,
Expand Down
2 changes: 1 addition & 1 deletion docs/DisconnectCallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
| **account_id** | **String** | The user account associated with the call. | [optional] |
| **application_id** | **String** | The id of the application associated with the call. | [optional] |
| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
| **from** | **String** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] |
| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
| **call_id** | **String** | The call id associated with the event. | [optional] |
| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
Expand Down
4 changes: 2 additions & 2 deletions docs/DtmfCallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
| **account_id** | **String** | The user account associated with the call. | [optional] |
| **application_id** | **String** | The id of the application associated with the call. | [optional] |
| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
| **from** | **String** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] |
| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
| **call_id** | **String** | The call id associated with the event. | [optional] |
| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
Expand All @@ -18,7 +18,7 @@
| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
| **parent_call_id** | **String** | (optional) If the event is related to the B leg of a &lt;Transfer&gt;, the call id of the original call leg that executed the &lt;Transfer&gt;. Otherwise, this field will not be present. | [optional] |
| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] |
| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
| **transfer_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [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] |

Expand Down
4 changes: 2 additions & 2 deletions docs/GatherCallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
| **account_id** | **String** | The user account associated with the call. | [optional] |
| **application_id** | **String** | The id of the application associated with the call. | [optional] |
| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
| **from** | **String** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] |
| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
| **call_id** | **String** | The call id associated with the event. | [optional] |
Expand All @@ -19,7 +19,7 @@
| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
| **parent_call_id** | **String** | (optional) If the event is related to the B leg of a &lt;Transfer&gt;, the call id of the original call leg that executed the &lt;Transfer&gt;. Otherwise, this field will not be present. | [optional] |
| **terminating_digit** | **String** | (optional) The digit the user pressed to end the gather. Empty string value if no terminating digit was pressed. | [optional] |
| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] |
| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
| **transfer_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [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] |

Expand Down
2 changes: 1 addition & 1 deletion docs/InitiateCallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
| **account_id** | **String** | The user account associated with the call. | [optional] |
| **application_id** | **String** | The id of the application associated with the call. | [optional] |
| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
| **from** | **String** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] |
| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
| **call_id** | **String** | The call id associated with the event. | [optional] |
Expand Down
Loading

0 comments on commit 8375228

Please sign in to comment.