Skip to content

Commit 5cb755c

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

23 files changed

+324
-53
lines changed

.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ bandwidth/models/blocked_webhook.py
2828
bandwidth/models/bridge_complete_callback.py
2929
bandwidth/models/bridge_target_complete_callback.py
3030
bandwidth/models/business_entity_type_enum.py
31+
bandwidth/models/business_registration_issuing_country_enum.py
3132
bandwidth/models/business_registration_type_enum.py
3233
bandwidth/models/call_direction_enum.py
3334
bandwidth/models/call_recording_metadata.py
@@ -206,6 +207,7 @@ docs/BlockedWebhook.md
206207
docs/BridgeCompleteCallback.md
207208
docs/BridgeTargetCompleteCallback.md
208209
docs/BusinessEntityTypeEnum.md
210+
docs/BusinessRegistrationIssuingCountryEnum.md
209211
docs/BusinessRegistrationTypeEnum.md
210212
docs/CallDirectionEnum.md
211213
docs/CallRecordingMetadata.md

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ Class | Method | HTTP request | Description
166166
- [BridgeCompleteCallback](docs/BridgeCompleteCallback.md)
167167
- [BridgeTargetCompleteCallback](docs/BridgeTargetCompleteCallback.md)
168168
- [BusinessEntityTypeEnum](docs/BusinessEntityTypeEnum.md)
169+
- [BusinessRegistrationIssuingCountryEnum](docs/BusinessRegistrationIssuingCountryEnum.md)
169170
- [BusinessRegistrationTypeEnum](docs/BusinessRegistrationTypeEnum.md)
170171
- [CallDirectionEnum](docs/CallDirectionEnum.md)
171172
- [CallRecordingMetadata](docs/CallRecordingMetadata.md)

bandwidth.yml

Lines changed: 88 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5828,38 +5828,106 @@ components:
58285828
type: string
58295829
businessRegistrationNumber:
58305830
type: string
5831-
description: >-
5832-
US Federal Tax ID Number (EIN) or Canada Business Number (CBN). Optional
5833-
until early 2026. If a value is provided for this field, a value must be
5834-
provided for `businessRegistrationType` and `businessEntityType`.
5835-
Available starting October 1st, 2025.
5831+
description: Government-issued business identifying number.
58365832
nullable: true
58375833
maxLength: 500
58385834
example: 12-3456789
58395835
businessRegistrationTypeEnum:
58405836
type: string
5841-
description: >-
5842-
The type of business registration number. Optional until early 2026;
5843-
required if `businessRegistrationNumber` is provided. Available starting
5844-
October 1st, 2025.
5837+
description: The type of business registration number.
58455838
enum:
58465839
- EIN
58475840
- CBN
5841+
- NEQ
5842+
- PROVINCIAL_NUMBER
5843+
- CRN
5844+
- VAT
5845+
- ACN
5846+
- ABN
5847+
- BRN
5848+
- SIREN
5849+
- SIRET
5850+
- NZBN
5851+
- UST_IDNR
5852+
- CIF
5853+
- NIF
5854+
- CNPJ
5855+
- UID
5856+
- OTHER
58485857
nullable: true
5858+
businessRegistrationIssuingCountryEnum:
5859+
type: string
5860+
description: >-
5861+
The country issuing the business registration in ISO-3166-1 alpha-3
5862+
format.
5863+
5864+
5865+
| Registration Type | Supported Countries |
5866+
5867+
|----------------------|------------------------------------|
5868+
5869+
| EIN | USA |
5870+
5871+
| CBN | CAN |
5872+
5873+
| NEQ | CAN |
5874+
5875+
| PROVINCIAL_NUMBER | CAN |
5876+
5877+
| CRN | GBR, HKG |
5878+
5879+
| VAT | GBR, IRL, BRA, NLD |
5880+
5881+
| ACN | AUS |
5882+
5883+
| ABN | AUS |
5884+
5885+
| BRN | HKG |
5886+
5887+
| SIREN | FRA |
5888+
5889+
| SIRET | FRA |
5890+
5891+
| NZBN | NZL |
5892+
5893+
| UST_IDNR | DEU |
5894+
5895+
| CIF | ESP |
5896+
5897+
| NIF | ESP |
5898+
5899+
| CNPJ | BRA |
5900+
5901+
| UID | CHE |
5902+
5903+
| OTHER | Must Provide Country Code |
5904+
enum:
5905+
- USA
5906+
- CAN
5907+
- HKG
5908+
- GBR
5909+
- IRL
5910+
- BRA
5911+
- NLD
5912+
- AUS
5913+
- FRA
5914+
- NZL
5915+
- DEU
5916+
- ESP
5917+
- CHE
5918+
nullable: false
58495919
businessEntityTypeEnum:
58505920
type: string
58515921
description: >-
58525922
The type of registered business. If no option is applicable, please
5853-
provide "SOLE_PROPRIETOR" as a value. Optional until early 2026;
5854-
required if `businessRegistrationNumber` is provided. Available starting
5855-
October 1st, 2025.
5923+
provide "SOLE_PROPRIETOR" as a value.
58565924
enum:
58575925
- SOLE_PROPRIETOR
58585926
- PRIVATE_PROFIT
58595927
- PUBLIC_PROFIT
58605928
- NON_PROFIT
58615929
- GOVERNMENT
5862-
nullable: true
5930+
nullable: false
58635931
helpMessageResponse:
58645932
type: string
58655933
description: A message that gets sent to users requesting help.
@@ -5914,6 +5982,7 @@ components:
59145982
- useCaseSummary
59155983
- productionMessageContent
59165984
- optInWorkflow
5985+
- businessEntityType
59175986
properties:
59185987
businessAddress:
59195988
$ref: '#/components/schemas/address'
@@ -5958,6 +6027,8 @@ components:
59586027
$ref: '#/components/schemas/businessRegistrationNumber'
59596028
businessRegistrationType:
59606029
$ref: '#/components/schemas/businessRegistrationTypeEnum'
6030+
businessRegistrationIssuingCountry:
6031+
$ref: '#/components/schemas/businessRegistrationIssuingCountryEnum'
59616032
businessEntityType:
59626033
$ref: '#/components/schemas/businessEntityTypeEnum'
59636034
helpMessageResponse:
@@ -6011,6 +6082,8 @@ components:
60116082
$ref: '#/components/schemas/businessRegistrationTypeEnum'
60126083
businessEntityType:
60136084
$ref: '#/components/schemas/businessEntityTypeEnum'
6085+
businessRegistrationIssuingCountry:
6086+
$ref: '#/components/schemas/businessRegistrationIssuingCountryEnum'
60146087
helpMessageResponse:
60156088
$ref: '#/components/schemas/helpMessageResponse'
60166089
ageGatedContent:
@@ -6503,20 +6576,12 @@ components:
65036576
$ref: '#/components/schemas/businessDba'
65046577
businessRegistrationNumber:
65056578
$ref: '#/components/schemas/businessRegistrationNumber'
6506-
description: >-
6507-
US Federal Tax ID Number (EIN) or Canada Business Number (CBN).
6508-
Available starting October 1st, 2025.
65096579
businessRegistrationType:
65106580
$ref: '#/components/schemas/businessRegistrationTypeEnum'
6511-
description: >-
6512-
The type of business registration number. Available starting October
6513-
1st, 2025.
6581+
businessRegistrationIssuingCountry:
6582+
$ref: '#/components/schemas/businessRegistrationIssuingCountryEnum'
65146583
businessEntityType:
65156584
$ref: '#/components/schemas/businessEntityTypeEnum'
6516-
description: >-
6517-
The type of registered business. If no option is applicable, please
6518-
provide "SOLE_PROPRIETOR" as a value. Available starting October
6519-
1st, 2025.
65206585
tfvStatusEnum:
65216586
type: string
65226587
enum:

bandwidth/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"BridgeCompleteCallback",
4949
"BridgeTargetCompleteCallback",
5050
"BusinessEntityTypeEnum",
51+
"BusinessRegistrationIssuingCountryEnum",
5152
"BusinessRegistrationTypeEnum",
5253
"CallDirectionEnum",
5354
"CallRecordingMetadata",
@@ -251,6 +252,7 @@
251252
from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback as BridgeCompleteCallback
252253
from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback as BridgeTargetCompleteCallback
253254
from bandwidth.models.business_entity_type_enum import BusinessEntityTypeEnum as BusinessEntityTypeEnum
255+
from bandwidth.models.business_registration_issuing_country_enum import BusinessRegistrationIssuingCountryEnum as BusinessRegistrationIssuingCountryEnum
254256
from bandwidth.models.business_registration_type_enum import BusinessRegistrationTypeEnum as BusinessRegistrationTypeEnum
255257
from bandwidth.models.call_direction_enum import CallDirectionEnum as CallDirectionEnum
256258
from bandwidth.models.call_recording_metadata import CallRecordingMetadata as CallRecordingMetadata

bandwidth/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback
2424
from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback
2525
from bandwidth.models.business_entity_type_enum import BusinessEntityTypeEnum
26+
from bandwidth.models.business_registration_issuing_country_enum import BusinessRegistrationIssuingCountryEnum
2627
from bandwidth.models.business_registration_type_enum import BusinessRegistrationTypeEnum
2728
from bandwidth.models.call_direction_enum import CallDirectionEnum
2829
from bandwidth.models.call_recording_metadata import CallRecordingMetadata

bandwidth/models/business_entity_type_enum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class BusinessEntityTypeEnum(str, Enum):
2323
"""
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.
24+
The type of registered business. If no option is applicable, please provide \"SOLE_PROPRIETOR\" as a value.
2525
"""
2626

2727
"""
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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 BusinessRegistrationIssuingCountryEnum(str, Enum):
23+
"""
24+
The country issuing the business registration in ISO-3166-1 alpha-3 format. | Registration Type | Supported Countries | |----------------------|------------------------------------| | EIN | USA | | CBN | CAN | | NEQ | CAN | | PROVINCIAL_NUMBER | CAN | | CRN | GBR, HKG | | VAT | GBR, IRL, BRA, NLD | | ACN | AUS | | ABN | AUS | | BRN | HKG | | SIREN | FRA | | SIRET | FRA | | NZBN | NZL | | UST_IDNR | DEU | | CIF | ESP | | NIF | ESP | | CNPJ | BRA | | UID | CHE | | OTHER | Must Provide Country Code |
25+
"""
26+
27+
"""
28+
allowed enum values
29+
"""
30+
USA = 'USA'
31+
CAN = 'CAN'
32+
HKG = 'HKG'
33+
GBR = 'GBR'
34+
IRL = 'IRL'
35+
BRA = 'BRA'
36+
NLD = 'NLD'
37+
AUS = 'AUS'
38+
FRA = 'FRA'
39+
NZL = 'NZL'
40+
DEU = 'DEU'
41+
ESP = 'ESP'
42+
CHE = 'CHE'
43+
44+
@classmethod
45+
def from_json(cls, json_str: str) -> Self:
46+
"""Create an instance of BusinessRegistrationIssuingCountryEnum from a JSON string"""
47+
return cls(json.loads(json_str))
48+
49+

bandwidth/models/business_registration_type_enum.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,30 @@
2121

2222
class BusinessRegistrationTypeEnum(str, Enum):
2323
"""
24-
The type of business registration number. Optional until early 2026; required if `businessRegistrationNumber` is provided. Available starting October 1st, 2025.
24+
The type of business registration number.
2525
"""
2626

2727
"""
2828
allowed enum values
2929
"""
3030
EIN = 'EIN'
3131
CBN = 'CBN'
32+
NEQ = 'NEQ'
33+
PROVINCIAL_NUMBER = 'PROVINCIAL_NUMBER'
34+
CRN = 'CRN'
35+
VAT = 'VAT'
36+
ACN = 'ACN'
37+
ABN = 'ABN'
38+
BRN = 'BRN'
39+
SIREN = 'SIREN'
40+
SIRET = 'SIRET'
41+
NZBN = 'NZBN'
42+
UST_IDNR = 'UST_IDNR'
43+
CIF = 'CIF'
44+
NIF = 'NIF'
45+
CNPJ = 'CNPJ'
46+
UID = 'UID'
47+
OTHER = 'OTHER'
3248

3349
@classmethod
3450
def from_json(cls, json_str: str) -> Self:

bandwidth/models/tfv_submission_info.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from typing_extensions import Annotated
2424
from bandwidth.models.address import Address
2525
from bandwidth.models.business_entity_type_enum import BusinessEntityTypeEnum
26+
from bandwidth.models.business_registration_issuing_country_enum import BusinessRegistrationIssuingCountryEnum
2627
from bandwidth.models.business_registration_type_enum import BusinessRegistrationTypeEnum
2728
from bandwidth.models.contact import Contact
2829
from bandwidth.models.opt_in_workflow import OptInWorkflow
@@ -45,11 +46,12 @@ class TfvSubmissionInfo(BaseModel):
4546
privacy_policy_url: Optional[StrictStr] = Field(default=None, description="The Toll-Free Verification request privacy policy URL.", alias="privacyPolicyUrl")
4647
terms_and_conditions_url: Optional[StrictStr] = Field(default=None, description="The Toll-Free Verification request terms and conditions policy URL.", alias="termsAndConditionsUrl")
4748
business_dba: Optional[StrictStr] = Field(default=None, description="The company 'Doing Business As'.", alias="businessDba")
48-
business_registration_number: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="US Federal Tax ID Number (EIN) or Canada Business Number (CBN). Optional until early 2026. If a value is provided for this field, a value must be provided for `businessRegistrationType` and `businessEntityType`. Available starting October 1st, 2025.", alias="businessRegistrationNumber")
49+
business_registration_number: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="Government-issued business identifying number.", alias="businessRegistrationNumber")
4950
business_registration_type: Optional[BusinessRegistrationTypeEnum] = Field(default=None, alias="businessRegistrationType")
51+
business_registration_issuing_country: Optional[BusinessRegistrationIssuingCountryEnum] = Field(default=None, alias="businessRegistrationIssuingCountry")
5052
business_entity_type: Optional[BusinessEntityTypeEnum] = Field(default=None, alias="businessEntityType")
5153
additional_properties: Dict[str, Any] = {}
52-
__properties: ClassVar[List[str]] = ["businessAddress", "businessContact", "messageVolume", "useCase", "useCaseSummary", "productionMessageContent", "optInWorkflow", "additionalInformation", "isvReseller", "privacyPolicyUrl", "termsAndConditionsUrl", "businessDba", "businessRegistrationNumber", "businessRegistrationType", "businessEntityType"]
54+
__properties: ClassVar[List[str]] = ["businessAddress", "businessContact", "messageVolume", "useCase", "useCaseSummary", "productionMessageContent", "optInWorkflow", "additionalInformation", "isvReseller", "privacyPolicyUrl", "termsAndConditionsUrl", "businessDba", "businessRegistrationNumber", "businessRegistrationType", "businessRegistrationIssuingCountry", "businessEntityType"]
5355

5456
model_config = ConfigDict(
5557
populate_by_name=True,
@@ -126,11 +128,6 @@ def to_dict(self) -> Dict[str, Any]:
126128
if self.business_registration_type is None and "business_registration_type" in self.model_fields_set:
127129
_dict['businessRegistrationType'] = None
128130

129-
# set to None if business_entity_type (nullable) is None
130-
# and model_fields_set contains the field
131-
if self.business_entity_type is None and "business_entity_type" in self.model_fields_set:
132-
_dict['businessEntityType'] = None
133-
134131
return _dict
135132

136133
@classmethod
@@ -157,6 +154,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
157154
"businessDba": obj.get("businessDba"),
158155
"businessRegistrationNumber": obj.get("businessRegistrationNumber"),
159156
"businessRegistrationType": obj.get("businessRegistrationType"),
157+
"businessRegistrationIssuingCountry": obj.get("businessRegistrationIssuingCountry"),
160158
"businessEntityType": obj.get("businessEntityType")
161159
})
162160
# store additional fields in additional_properties

0 commit comments

Comments
 (0)