Skip to content

Commit baea14d

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

32 files changed

+569
-29
lines changed

.openapi-generator/FILES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ bandwidth/models/answer_callback.py
2626
bandwidth/models/blocked_webhook.py
2727
bandwidth/models/bridge_complete_callback.py
2828
bandwidth/models/bridge_target_complete_callback.py
29+
bandwidth/models/business_entity_type_enum.py
30+
bandwidth/models/business_registration_type_enum.py
2931
bandwidth/models/call_direction_enum.py
3032
bandwidth/models/call_recording_metadata.py
3133
bandwidth/models/call_state.py
@@ -180,6 +182,8 @@ docs/AnswerCallback.md
180182
docs/BlockedWebhook.md
181183
docs/BridgeCompleteCallback.md
182184
docs/BridgeTargetCompleteCallback.md
185+
docs/BusinessEntityTypeEnum.md
186+
docs/BusinessRegistrationTypeEnum.md
183187
docs/CallDirectionEnum.md
184188
docs/CallRecordingMetadata.md
185189
docs/CallState.md

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ Class | Method | HTTP request | Description
157157
- [BlockedWebhook](docs/BlockedWebhook.md)
158158
- [BridgeCompleteCallback](docs/BridgeCompleteCallback.md)
159159
- [BridgeTargetCompleteCallback](docs/BridgeTargetCompleteCallback.md)
160+
- [BusinessEntityTypeEnum](docs/BusinessEntityTypeEnum.md)
161+
- [BusinessRegistrationTypeEnum](docs/BusinessRegistrationTypeEnum.md)
160162
- [CallDirectionEnum](docs/CallDirectionEnum.md)
161163
- [CallRecordingMetadata](docs/CallRecordingMetadata.md)
162164
- [CallState](docs/CallState.md)

bandwidth.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ paths:
183183
- $ref: '#/components/parameters/bwQueued'
184184
- $ref: '#/components/parameters/product'
185185
- $ref: '#/components/parameters/location'
186+
- $ref: '#/components/parameters/carrierQueued'
187+
- $ref: '#/components/parameters/fromCarrierLatency'
186188
- $ref: '#/components/parameters/callingNumberCountryA3'
187189
- $ref: '#/components/parameters/calledNumberCountryA3'
188190
- $ref: '#/components/parameters/fromSegmentCount'
@@ -1851,6 +1853,14 @@ components:
18511853
accounts with the Advanced Quality Metrics feature enabled.
18521854
nullable: true
18531855
example: 20
1856+
carrierLatency:
1857+
type: integer
1858+
description: >-
1859+
The carrier latency of the message in seconds. Only available for
1860+
OUTBOUND messages from accounts with the Advanced Quality Metrics
1861+
feature enabled.
1862+
nullable: true
1863+
example: 20
18541864
callingNumberCountryA3:
18551865
type: string
18561866
description: The A3 country code of the calling number.
@@ -5530,6 +5540,50 @@ components:
55305540
description: The company 'Doing Business As'.
55315541
example: Another Company Name Inc.
55325542
type: string
5543+
businessRegistrationNumber:
5544+
type: string
5545+
description: >-
5546+
US Federal Tax ID Number (EIN) or Canada Business Number (CBN). Optional
5547+
until early 2026. If a value is provided for this field, a value must be
5548+
provided for `businessRegistrationType` and `businessEntityType`.
5549+
Available starting October 1st, 2025.
5550+
nullable: true
5551+
maxLength: 500
5552+
example: 12-3456789
5553+
businessRegistrationTypeEnum:
5554+
type: string
5555+
description: >-
5556+
The type of business registration number. Optional until early 2026;
5557+
required if `businessRegistrationNumber` is provided. Available starting
5558+
October 1st, 2025.
5559+
enum:
5560+
- EIN
5561+
- CBN
5562+
nullable: true
5563+
businessEntityTypeEnum:
5564+
type: string
5565+
description: >-
5566+
The type of registered business. If no option is applicable, please
5567+
provide "SOLE_PROPRIETOR" as a value. Optional until early 2026;
5568+
required if `businessRegistrationNumber` is provided. Available starting
5569+
October 1st, 2025.
5570+
enum:
5571+
- SOLE_PROPRIETOR
5572+
- PRIVATE_PROFIT
5573+
- PUBLIC_PROFIT
5574+
- NON_PROFIT
5575+
- GOVERNMENT
5576+
nullable: true
5577+
helpMessageResponse:
5578+
type: string
5579+
description: A message that gets sent to users requesting help.
5580+
nullable: true
5581+
maxLength: 500
5582+
example: Please contact support for assistance.
5583+
ageGatedContent:
5584+
type: boolean
5585+
description: Indicates whether the content is age-gated.
5586+
example: false
55335587
additionalDenialReason:
55345588
properties:
55355589
statusCode:
@@ -5616,6 +5670,16 @@ components:
56165670
$ref: '#/components/schemas/termsAndConditionsUrl'
56175671
businessDba:
56185672
$ref: '#/components/schemas/businessDba'
5673+
businessRegistrationNumber:
5674+
$ref: '#/components/schemas/businessRegistrationNumber'
5675+
businessRegistrationType:
5676+
$ref: '#/components/schemas/businessRegistrationTypeEnum'
5677+
businessEntityType:
5678+
$ref: '#/components/schemas/businessEntityTypeEnum'
5679+
helpMessageResponse:
5680+
$ref: '#/components/schemas/helpMessageResponse'
5681+
ageGatedContent:
5682+
$ref: '#/components/schemas/ageGatedContent'
56195683
verificationUpdateRequest:
56205684
type: object
56215685
required:
@@ -5655,6 +5719,16 @@ components:
56555719
$ref: '#/components/schemas/termsAndConditionsUrl'
56565720
businessDba:
56575721
$ref: '#/components/schemas/businessDba'
5722+
businessRegistrationNumber:
5723+
$ref: '#/components/schemas/businessRegistrationNumber'
5724+
businessRegistrationType:
5725+
$ref: '#/components/schemas/businessRegistrationTypeEnum'
5726+
businessEntityType:
5727+
$ref: '#/components/schemas/businessEntityTypeEnum'
5728+
helpMessageResponse:
5729+
$ref: '#/components/schemas/helpMessageResponse'
5730+
ageGatedContent:
5731+
$ref: '#/components/schemas/ageGatedContent'
56585732
tfvBasicAuthentication:
56595733
type: object
56605734
properties:
@@ -5858,6 +5932,12 @@ components:
58585932
example: https://www.example.com/path/to/resource
58595933
pattern: >-
58605934
^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*)
5935+
confirmationResponse:
5936+
type: string
5937+
minLength: 0
5938+
maxLength: 500
5939+
nullable: true
5940+
example: Thank you for opting in!
58615941
isvReseller:
58625942
type: string
58635943
description: ISV name.
@@ -6131,6 +6211,22 @@ components:
61316211
$ref: '#/components/schemas/termsAndConditionsUrl'
61326212
businessDba:
61336213
$ref: '#/components/schemas/businessDba'
6214+
businessRegistrationNumber:
6215+
$ref: '#/components/schemas/businessRegistrationNumber'
6216+
description: >-
6217+
US Federal Tax ID Number (EIN) or Canada Business Number (CBN).
6218+
Available starting October 1st, 2025.
6219+
businessRegistrationType:
6220+
$ref: '#/components/schemas/businessRegistrationTypeEnum'
6221+
description: >-
6222+
The type of business registration number. Available starting October
6223+
1st, 2025.
6224+
businessEntityType:
6225+
$ref: '#/components/schemas/businessEntityTypeEnum'
6226+
description: >-
6227+
The type of registered business. If no option is applicable, please
6228+
provide "SOLE_PROPRIETOR" as a value. Available starting October
6229+
1st, 2025.
61346230
tfvStatusEnum:
61356231
type: string
61366232
enum:
@@ -7028,6 +7124,28 @@ components:
70287124
example: 123ABC
70297125
schema:
70307126
type: string
7127+
carrierQueued:
7128+
in: query
7129+
name: carrierQueued
7130+
required: false
7131+
description: >-
7132+
A boolean value indicating whether the message is queued in the carrier
7133+
network. Only available for OUTBOUND messages from accounts with the
7134+
Advanced Quality Metrics feature enabled.
7135+
example: true
7136+
schema:
7137+
type: boolean
7138+
fromCarrierLatency:
7139+
in: query
7140+
name: fromCarrierLatency
7141+
required: false
7142+
description: >-
7143+
The minimum carrier latency of the message in seconds. Only available
7144+
for OUTBOUND messages from accounts with the Advanced Quality Metrics
7145+
feature enabled.
7146+
example: 50
7147+
schema:
7148+
type: integer
70317149
callingNumberCountryA3:
70327150
in: query
70337151
name: callingNumberCountryA3

bandwidth/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
from bandwidth.models.blocked_webhook import BlockedWebhook
5050
from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback
5151
from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback
52+
from bandwidth.models.business_entity_type_enum import BusinessEntityTypeEnum
53+
from bandwidth.models.business_registration_type_enum import BusinessRegistrationTypeEnum
5254
from bandwidth.models.call_direction_enum import CallDirectionEnum
5355
from bandwidth.models.call_recording_metadata import CallRecordingMetadata
5456
from bandwidth.models.call_state import CallState

bandwidth/api/messages_api.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from bandwidth.models.message_type_enum import MessageTypeEnum
2828
from bandwidth.models.messages_list import MessagesList
2929
from bandwidth.models.product_type_enum import ProductTypeEnum
30+
from bandwidth.models.product_type_enum import ProductTypeEnum
3031

3132
from bandwidth.api_client import ApiClient, RequestSerialized
3233
from bandwidth.api_response import ApiResponse
@@ -384,6 +385,8 @@ def list_messages(
384385
bw_queued: Annotated[Optional[StrictBool], Field(description="A boolean value indicating whether the message is queued in the Bandwidth network.")] = None,
385386
product: Annotated[Optional[ProductTypeEnum], Field(description="Messaging product associated with the message.")] = None,
386387
location: Annotated[Optional[StrictStr], Field(description="Location Id associated with the message.")] = None,
388+
carrier_queued: Annotated[Optional[StrictBool], Field(description="A boolean value indicating whether the message is queued in the carrier network. Only available for OUTBOUND messages from accounts with the Advanced Quality Metrics feature enabled.")] = None,
389+
from_carrier_latency: Annotated[Optional[StrictInt], Field(description="The minimum carrier latency of the message in seconds. Only available for OUTBOUND messages from accounts with the Advanced Quality Metrics feature enabled.")] = None,
387390
calling_number_country_a3: Annotated[Optional[StrictStr], Field(description="Calling number country in A3 format.")] = None,
388391
called_number_country_a3: Annotated[Optional[StrictStr], Field(description="Called number country in A3 format.")] = None,
389392
from_segment_count: Annotated[Optional[StrictInt], Field(description="Segment count (start range).")] = None,
@@ -443,6 +446,10 @@ def list_messages(
443446
:type product: ProductTypeEnum
444447
:param location: Location Id associated with the message.
445448
:type location: str
449+
:param carrier_queued: A boolean value indicating whether the message is queued in the carrier network. Only available for OUTBOUND messages from accounts with the Advanced Quality Metrics feature enabled.
450+
:type carrier_queued: bool
451+
:param from_carrier_latency: The minimum carrier latency of the message in seconds. Only available for OUTBOUND messages from accounts with the Advanced Quality Metrics feature enabled.
452+
:type from_carrier_latency: int
446453
:param calling_number_country_a3: Calling number country in A3 format.
447454
:type calling_number_country_a3: str
448455
:param called_number_country_a3: Called number country in A3 format.
@@ -502,6 +509,8 @@ def list_messages(
502509
bw_queued=bw_queued,
503510
product=product,
504511
location=location,
512+
carrier_queued=carrier_queued,
513+
from_carrier_latency=from_carrier_latency,
505514
calling_number_country_a3=calling_number_country_a3,
506515
called_number_country_a3=called_number_country_a3,
507516
from_segment_count=from_segment_count,
@@ -558,6 +567,8 @@ def list_messages_with_http_info(
558567
bw_queued: Annotated[Optional[StrictBool], Field(description="A boolean value indicating whether the message is queued in the Bandwidth network.")] = None,
559568
product: Annotated[Optional[ProductTypeEnum], Field(description="Messaging product associated with the message.")] = None,
560569
location: Annotated[Optional[StrictStr], Field(description="Location Id associated with the message.")] = None,
570+
carrier_queued: Annotated[Optional[StrictBool], Field(description="A boolean value indicating whether the message is queued in the carrier network. Only available for OUTBOUND messages from accounts with the Advanced Quality Metrics feature enabled.")] = None,
571+
from_carrier_latency: Annotated[Optional[StrictInt], Field(description="The minimum carrier latency of the message in seconds. Only available for OUTBOUND messages from accounts with the Advanced Quality Metrics feature enabled.")] = None,
561572
calling_number_country_a3: Annotated[Optional[StrictStr], Field(description="Calling number country in A3 format.")] = None,
562573
called_number_country_a3: Annotated[Optional[StrictStr], Field(description="Called number country in A3 format.")] = None,
563574
from_segment_count: Annotated[Optional[StrictInt], Field(description="Segment count (start range).")] = None,
@@ -617,6 +628,10 @@ def list_messages_with_http_info(
617628
:type product: ProductTypeEnum
618629
:param location: Location Id associated with the message.
619630
:type location: str
631+
:param carrier_queued: A boolean value indicating whether the message is queued in the carrier network. Only available for OUTBOUND messages from accounts with the Advanced Quality Metrics feature enabled.
632+
:type carrier_queued: bool
633+
:param from_carrier_latency: The minimum carrier latency of the message in seconds. Only available for OUTBOUND messages from accounts with the Advanced Quality Metrics feature enabled.
634+
:type from_carrier_latency: int
620635
:param calling_number_country_a3: Calling number country in A3 format.
621636
:type calling_number_country_a3: str
622637
:param called_number_country_a3: Called number country in A3 format.
@@ -676,6 +691,8 @@ def list_messages_with_http_info(
676691
bw_queued=bw_queued,
677692
product=product,
678693
location=location,
694+
carrier_queued=carrier_queued,
695+
from_carrier_latency=from_carrier_latency,
679696
calling_number_country_a3=calling_number_country_a3,
680697
called_number_country_a3=called_number_country_a3,
681698
from_segment_count=from_segment_count,
@@ -732,6 +749,8 @@ def list_messages_without_preload_content(
732749
bw_queued: Annotated[Optional[StrictBool], Field(description="A boolean value indicating whether the message is queued in the Bandwidth network.")] = None,
733750
product: Annotated[Optional[ProductTypeEnum], Field(description="Messaging product associated with the message.")] = None,
734751
location: Annotated[Optional[StrictStr], Field(description="Location Id associated with the message.")] = None,
752+
carrier_queued: Annotated[Optional[StrictBool], Field(description="A boolean value indicating whether the message is queued in the carrier network. Only available for OUTBOUND messages from accounts with the Advanced Quality Metrics feature enabled.")] = None,
753+
from_carrier_latency: Annotated[Optional[StrictInt], Field(description="The minimum carrier latency of the message in seconds. Only available for OUTBOUND messages from accounts with the Advanced Quality Metrics feature enabled.")] = None,
735754
calling_number_country_a3: Annotated[Optional[StrictStr], Field(description="Calling number country in A3 format.")] = None,
736755
called_number_country_a3: Annotated[Optional[StrictStr], Field(description="Called number country in A3 format.")] = None,
737756
from_segment_count: Annotated[Optional[StrictInt], Field(description="Segment count (start range).")] = None,
@@ -791,6 +810,10 @@ def list_messages_without_preload_content(
791810
:type product: ProductTypeEnum
792811
:param location: Location Id associated with the message.
793812
:type location: str
813+
:param carrier_queued: A boolean value indicating whether the message is queued in the carrier network. Only available for OUTBOUND messages from accounts with the Advanced Quality Metrics feature enabled.
814+
:type carrier_queued: bool
815+
:param from_carrier_latency: The minimum carrier latency of the message in seconds. Only available for OUTBOUND messages from accounts with the Advanced Quality Metrics feature enabled.
816+
:type from_carrier_latency: int
794817
:param calling_number_country_a3: Calling number country in A3 format.
795818
:type calling_number_country_a3: str
796819
:param called_number_country_a3: Called number country in A3 format.
@@ -850,6 +873,8 @@ def list_messages_without_preload_content(
850873
bw_queued=bw_queued,
851874
product=product,
852875
location=location,
876+
carrier_queued=carrier_queued,
877+
from_carrier_latency=from_carrier_latency,
853878
calling_number_country_a3=calling_number_country_a3,
854879
called_number_country_a3=called_number_country_a3,
855880
from_segment_count=from_segment_count,
@@ -901,6 +926,8 @@ def _list_messages_serialize(
901926
bw_queued,
902927
product,
903928
location,
929+
carrier_queued,
930+
from_carrier_latency,
904931
calling_number_country_a3,
905932
called_number_country_a3,
906933
from_segment_count,
@@ -998,6 +1025,14 @@ def _list_messages_serialize(
9981025

9991026
_query_params.append(('location', location))
10001027

1028+
if carrier_queued is not None:
1029+
1030+
_query_params.append(('carrierQueued', carrier_queued))
1031+
1032+
if from_carrier_latency is not None:
1033+
1034+
_query_params.append(('fromCarrierLatency', from_carrier_latency))
1035+
10011036
if calling_number_country_a3 is not None:
10021037

10031038
_query_params.append(('callingNumberCountryA3', calling_number_country_a3))

bandwidth/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
from bandwidth.models.blocked_webhook import BlockedWebhook
2323
from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback
2424
from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback
25+
from bandwidth.models.business_entity_type_enum import BusinessEntityTypeEnum
26+
from bandwidth.models.business_registration_type_enum import BusinessRegistrationTypeEnum
2527
from bandwidth.models.call_direction_enum import CallDirectionEnum
2628
from bandwidth.models.call_recording_metadata import CallRecordingMetadata
2729
from bandwidth.models.call_state import CallState
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# coding: utf-8
2+
3+
"""
4+
Bandwidth
5+
6+
Bandwidth's Communication APIs
7+
8+
The version of the OpenAPI document: 1.0.0
9+
Contact: letstalk@bandwidth.com
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
16+
from __future__ import annotations
17+
import json
18+
from enum import Enum
19+
from typing_extensions import Self
20+
21+
22+
class BusinessEntityTypeEnum(str, Enum):
23+
"""
24+
The type of registered business. If no option is applicable, please provide \"SOLE_PROPRIETOR\" as a value. Optional until early 2026; required if `businessRegistrationNumber` is provided. Available starting October 1st, 2025.
25+
"""
26+
27+
"""
28+
allowed enum values
29+
"""
30+
SOLE_PROPRIETOR = 'SOLE_PROPRIETOR'
31+
PRIVATE_PROFIT = 'PRIVATE_PROFIT'
32+
PUBLIC_PROFIT = 'PUBLIC_PROFIT'
33+
NON_PROFIT = 'NON_PROFIT'
34+
GOVERNMENT = 'GOVERNMENT'
35+
36+
@classmethod
37+
def from_json(cls, json_str: str) -> Self:
38+
"""Create an instance of BusinessEntityTypeEnum from a JSON string"""
39+
return cls(json.loads(json_str))
40+
41+

0 commit comments

Comments
 (0)