Skip to content

Commit 6654eed

Browse files
committed
Generate SDK with OpenAPI Generator Version
1 parent 7497d63 commit 6654eed

21 files changed

Lines changed: 110 additions & 50 deletions

bandwidth.yml

Lines changed: 58 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2436,6 +2436,7 @@ components:
24362436
- media
24372437
rbmCardContent:
24382438
type: object
2439+
description: Must contain at least one of title, description, or media to be valid.
24392440
properties:
24402441
title:
24412442
type: string
@@ -2478,7 +2479,6 @@ components:
24782479
$ref: '#/components/schemas/multiChannelFullActions'
24792480
required:
24802481
- orientation
2481-
- thumbnailImageAlignment
24822482
- cardContent
24832483
standaloneCardOrientationEnum:
24842484
type: string
@@ -2489,8 +2489,8 @@ components:
24892489
thumbnailAlignmentEnum:
24902490
type: string
24912491
description: >-
2492-
The alignment of the thumbnail image in the card. Only applicable if the
2493-
card using horizontal orientation.
2492+
The alignment of the thumbnail image in the card. Required when
2493+
orientation is HORIZONTAL.
24942494
enum:
24952495
- LEFT
24962496
- RIGHT
@@ -2505,6 +2505,7 @@ components:
25052505
type: array
25062506
items:
25072507
$ref: '#/components/schemas/rbmCardContent'
2508+
minItems: 2
25082509
maxItems: 10
25092510
suggestions:
25102511
$ref: '#/components/schemas/multiChannelFullActions'
@@ -2568,7 +2569,11 @@ components:
25682569
type: string
25692570
description: >-
25702571
Defines the layout of the WebView on a mobile device. It must be defined
2571-
when application is set to `WEBVIEW`
2572+
2573+
when application is set to `WEBVIEW` and must not be set when
2574+
application
2575+
2576+
is set to `BROWSER`.
25722577
25732578
- `FULL` WebView takes the full screen.
25742579
@@ -2626,12 +2631,16 @@ components:
26262631
latitude:
26272632
type: string
26282633
format: double
2629-
description: The latitude of the location.
2634+
description: >-
2635+
The latitude of the location. Must be in range [-90.000000,
2636+
90.000000].
26302637
example: '37.7749'
26312638
longitude:
26322639
type: string
26332640
format: double
2634-
description: The longitude of the location.
2641+
description: >-
2642+
The longitude of the location. Must be in range [-180.000000,
2643+
180.000000].
26352644
example: '-122.4194'
26362645
label:
26372646
type: string
@@ -2655,12 +2664,16 @@ components:
26552664
startTime:
26562665
type: string
26572666
format: date-time
2658-
description: The start time of the event.
2667+
description: >-
2668+
The start time of the event. Must be a valid RFC-3339 value,
2669+
e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00.
26592670
example: 2022-09-14T18:20:16.000Z
26602671
endTime:
26612672
type: string
26622673
format: date-time
2663-
description: The end time of the event.
2674+
description: >-
2675+
The end time of the event. Must be a valid RFC-3339 value, e.g.,
2676+
2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00.
26642677
example: 2022-09-14T18:20:16.000Z
26652678
description:
26662679
type: string
@@ -2680,7 +2693,7 @@ components:
26802693
url:
26812694
type: string
26822695
format: uri
2683-
description: The URL to open in browser.
2696+
description: The URL to open in browser. Must use http:// or https:// scheme.
26842697
example: https://dev.bandwidth.com
26852698
maxLength: 2048
26862699
application:
@@ -6021,12 +6034,30 @@ components:
60216034
description: Reason code for denial.
60226035
type: integer
60236036
example: 511
6037+
denialStatusCodeNullable:
6038+
description: Reason code for denial.
6039+
nullable: true
6040+
type: integer
6041+
example: 511
60246042
resubmitAllowed:
60256043
description: >-
60266044
Whether a Toll-Free Verification request qualifies for resubmission via
60276045
PUT.
60286046
example: true
60296047
type: boolean
6048+
additionalDenialReason:
6049+
type: object
6050+
properties:
6051+
statusCode:
6052+
$ref: '#/components/schemas/denialStatusCode'
6053+
reason:
6054+
$ref: '#/components/schemas/declineReasonDescription'
6055+
resubmitAllowed:
6056+
$ref: '#/components/schemas/resubmitAllowed'
6057+
required:
6058+
- statusCode
6059+
- reason
6060+
- resubmitAllowed
60306061
blocked:
60316062
description: >-
60326063
Whether a Toll-Free Verification is blocked. This attribute will only be
@@ -6181,19 +6212,6 @@ components:
61816212
type: boolean
61826213
description: Indicates whether the content is age-gated.
61836214
example: false
6184-
additionalDenialReason:
6185-
properties:
6186-
statusCode:
6187-
$ref: '#/components/schemas/denialStatusCode'
6188-
reason:
6189-
$ref: '#/components/schemas/declineReasonDescription'
6190-
resubmitAllowed:
6191-
$ref: '#/components/schemas/resubmitAllowed'
6192-
required:
6193-
- statusCode
6194-
- reason
6195-
- resubmitAllowed
6196-
type: object
61976215
internalTicketNumber:
61986216
type: string
61996217
description: >-
@@ -6389,6 +6407,7 @@ components:
63896407
description: >-
63906408
An optional list of denial reasons in addition to
63916409
declineReasonDescription when multiple reasons apply.
6410+
type: array
63926411
items:
63936412
$ref: '#/components/schemas/additionalDenialReason'
63946413
example:
@@ -6398,7 +6417,6 @@ components:
63986417
- statusCode: 513
63996418
reason: Reason B
64006419
resubmitAllowed: true
6401-
type: array
64026420
declineReasonDescription:
64036421
$ref: '#/components/schemas/declineReasonDescription'
64046422
denialStatusCode:
@@ -6766,6 +6784,23 @@ components:
67666784
$ref: '#/components/schemas/internalTicketNumber'
67676785
declineReasonDescription:
67686786
$ref: '#/components/schemas/declineReasonDescription'
6787+
denialStatusCode:
6788+
$ref: '#/components/schemas/denialStatusCodeNullable'
6789+
additionalDenialReasons:
6790+
description: >-
6791+
An optional list of denial reasons in addition to
6792+
declineReasonDescription when multiple reasons apply.
6793+
nullable: true
6794+
type: array
6795+
items:
6796+
$ref: '#/components/schemas/additionalDenialReason'
6797+
example:
6798+
- statusCode: 512
6799+
reason: Reason A
6800+
resubmitAllowed: true
6801+
- statusCode: 513
6802+
reason: Reason B
6803+
resubmitAllowed: true
67696804
resubmitAllowed:
67706805
$ref: '#/components/schemas/resubmitAllowed'
67716806
createdDateTime:

bandwidth/models/multi_channel_action_calendar_event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class MultiChannelActionCalendarEvent(BaseModel):
3434
text: Annotated[str, Field(strict=True, max_length=25)] = Field(description="Displayed text for user to click")
3535
postback_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postbackData")
3636
title: Annotated[str, Field(strict=True, max_length=100)] = Field(description="The title of the event.")
37-
start_time: datetime = Field(description="The start time of the event.", alias="startTime")
38-
end_time: datetime = Field(description="The end time of the event.", alias="endTime")
37+
start_time: datetime = Field(description="The start time of the event. Must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00.", alias="startTime")
38+
end_time: datetime = Field(description="The end time of the event. Must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00.", alias="endTime")
3939
description: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="The description of the event.")
4040
additional_properties: Dict[str, Any] = {}
4141
__properties: ClassVar[List[str]] = ["type", "text", "postbackData", "title", "startTime", "endTime", "description"]

bandwidth/models/rbm_action_open_url.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class RbmActionOpenUrl(BaseModel):
3434
type: RbmActionTypeEnum
3535
text: Annotated[str, Field(strict=True, max_length=25)] = Field(description="Displayed text for user to click")
3636
postback_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postbackData")
37-
url: Annotated[str, Field(strict=True, max_length=2048)] = Field(description="The URL to open in browser.")
37+
url: Annotated[str, Field(strict=True, max_length=2048)] = Field(description="The URL to open in browser. Must use http:// or https:// scheme.")
3838
application: Optional[RbmOpenUrlEnum] = None
3939
webview_view_mode: Optional[RbmWebViewEnum] = Field(default=None, alias="webviewViewMode")
4040
additional_properties: Dict[str, Any] = {}

bandwidth/models/rbm_action_view_location.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class RbmActionViewLocation(BaseModel):
3232
type: RbmActionTypeEnum
3333
text: Annotated[str, Field(strict=True, max_length=25)] = Field(description="Displayed text for user to click")
3434
postback_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postbackData")
35-
latitude: StrictStr = Field(description="The latitude of the location.")
36-
longitude: StrictStr = Field(description="The longitude of the location.")
35+
latitude: StrictStr = Field(description="The latitude of the location. Must be in range [-90.000000, 90.000000].")
36+
longitude: StrictStr = Field(description="The longitude of the location. Must be in range [-180.000000, 180.000000].")
3737
label: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="The label of the location.")
3838
additional_properties: Dict[str, Any] = {}
3939
__properties: ClassVar[List[str]] = ["type", "text", "postbackData", "latitude", "longitude", "label"]

bandwidth/models/rbm_card_content.py

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

2929
class RbmCardContent(BaseModel):
3030
"""
31-
RbmCardContent
31+
Must contain at least one of title, description, or media to be valid.
3232
""" # noqa: E501
3333
title: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="The title of the card. Must be 200 characters or less.")
3434
description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = Field(default=None, description="The description of the card. Must be 2000 characters or less.")

bandwidth/models/rbm_message_carousel_card.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class RbmMessageCarouselCard(BaseModel):
3232
RbmMessageCarouselCard
3333
""" # noqa: E501
3434
card_width: CardWidthEnum = Field(alias="cardWidth")
35-
card_contents: Annotated[List[RbmCardContent], Field(max_length=10)] = Field(alias="cardContents")
35+
card_contents: Annotated[List[RbmCardContent], Field(min_length=2, max_length=10)] = Field(alias="cardContents")
3636
suggestions: Optional[Annotated[List[MultiChannelAction], Field(max_length=11)]] = Field(default=None, description="An array of suggested actions for the recipient.")
3737
additional_properties: Dict[str, Any] = {}
3838
__properties: ClassVar[List[str]] = ["cardWidth", "cardContents", "suggestions"]

bandwidth/models/rbm_standalone_card.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class RbmStandaloneCard(BaseModel):
3333
RbmStandaloneCard
3434
""" # noqa: E501
3535
orientation: StandaloneCardOrientationEnum
36-
thumbnail_image_alignment: ThumbnailAlignmentEnum = Field(alias="thumbnailImageAlignment")
36+
thumbnail_image_alignment: Optional[ThumbnailAlignmentEnum] = Field(default=None, alias="thumbnailImageAlignment")
3737
card_content: RbmCardContent = Field(alias="cardContent")
3838
suggestions: Optional[Annotated[List[MultiChannelAction], Field(max_length=11)]] = Field(default=None, description="An array of suggested actions for the recipient.")
3939
additional_properties: Dict[str, Any] = {}

bandwidth/models/rbm_web_view_enum.py

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

2222
class RbmWebViewEnum(str, Enum):
2323
"""
24-
Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen.
24+
Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` and must not be set when application is set to `BROWSER`. - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen.
2525
"""
2626

2727
"""

bandwidth/models/tfv_status.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
import json
2020

2121
from datetime import datetime
22-
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
22+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
2323
from typing import Any, ClassVar, Dict, List, Optional
2424
from typing_extensions import Annotated
25+
from bandwidth.models.additional_denial_reason import AdditionalDenialReason
2526
from bandwidth.models.tfv_status_enum import TfvStatusEnum
2627
from bandwidth.models.tfv_submission_info import TfvSubmissionInfo
2728
from typing import Optional, Set
@@ -35,6 +36,8 @@ class TfvStatus(BaseModel):
3536
status: Optional[TfvStatusEnum] = None
3637
internal_ticket_number: Optional[StrictStr] = Field(default=None, description="Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number - included in all webhook payloads.", alias="internalTicketNumber")
3738
decline_reason_description: Optional[StrictStr] = Field(default=None, description="Explanation for why a verification request was declined.", alias="declineReasonDescription")
39+
denial_status_code: Optional[StrictInt] = Field(default=None, description="Reason code for denial.", alias="denialStatusCode")
40+
additional_denial_reasons: Optional[List[AdditionalDenialReason]] = Field(default=None, description="An optional list of denial reasons in addition to declineReasonDescription when multiple reasons apply.", alias="additionalDenialReasons")
3841
resubmit_allowed: Optional[StrictBool] = Field(default=None, description="Whether a Toll-Free Verification request qualifies for resubmission via PUT.", alias="resubmitAllowed")
3942
created_date_time: Optional[datetime] = Field(default=None, description="Date and time the verification request was created.", alias="createdDateTime")
4043
modified_date_time: Optional[datetime] = Field(default=None, description="Date and time the verification request was last modified.", alias="modifiedDateTime")
@@ -43,7 +46,7 @@ class TfvStatus(BaseModel):
4346
blocked_reason: Optional[StrictStr] = Field(default=None, description="The reason why the Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked.", alias="blockedReason")
4447
cv_token: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=500)]] = Field(default=None, description="The token provided by Campaign Verify to validate your political use case. Only required for 527 political organizations. If you are not a 527 political organization, this field should be omitted. Supplying an empty string will likely result in rejection.", alias="cvToken")
4548
additional_properties: Dict[str, Any] = {}
46-
__properties: ClassVar[List[str]] = ["phoneNumber", "status", "internalTicketNumber", "declineReasonDescription", "resubmitAllowed", "createdDateTime", "modifiedDateTime", "submission", "blocked", "blockedReason", "cvToken"]
49+
__properties: ClassVar[List[str]] = ["phoneNumber", "status", "internalTicketNumber", "declineReasonDescription", "denialStatusCode", "additionalDenialReasons", "resubmitAllowed", "createdDateTime", "modifiedDateTime", "submission", "blocked", "blockedReason", "cvToken"]
4750

4851
@field_validator('phone_number')
4952
def phone_number_validate_regular_expression(cls, value):
@@ -96,6 +99,13 @@ def to_dict(self) -> Dict[str, Any]:
9699
exclude=excluded_fields,
97100
exclude_none=True,
98101
)
102+
# override the default output from pydantic by calling `to_dict()` of each item in additional_denial_reasons (list)
103+
_items = []
104+
if self.additional_denial_reasons:
105+
for _item_additional_denial_reasons in self.additional_denial_reasons:
106+
if _item_additional_denial_reasons:
107+
_items.append(_item_additional_denial_reasons.to_dict())
108+
_dict['additionalDenialReasons'] = _items
99109
# override the default output from pydantic by calling `to_dict()` of submission
100110
if self.submission:
101111
_dict['submission'] = self.submission.to_dict()
@@ -104,6 +114,16 @@ def to_dict(self) -> Dict[str, Any]:
104114
for _key, _value in self.additional_properties.items():
105115
_dict[_key] = _value
106116

117+
# set to None if denial_status_code (nullable) is None
118+
# and model_fields_set contains the field
119+
if self.denial_status_code is None and "denial_status_code" in self.model_fields_set:
120+
_dict['denialStatusCode'] = None
121+
122+
# set to None if additional_denial_reasons (nullable) is None
123+
# and model_fields_set contains the field
124+
if self.additional_denial_reasons is None and "additional_denial_reasons" in self.model_fields_set:
125+
_dict['additionalDenialReasons'] = None
126+
107127
# set to None if cv_token (nullable) is None
108128
# and model_fields_set contains the field
109129
if self.cv_token is None and "cv_token" in self.model_fields_set:
@@ -125,6 +145,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
125145
"status": obj.get("status"),
126146
"internalTicketNumber": obj.get("internalTicketNumber"),
127147
"declineReasonDescription": obj.get("declineReasonDescription"),
148+
"denialStatusCode": obj.get("denialStatusCode"),
149+
"additionalDenialReasons": [AdditionalDenialReason.from_dict(_item) for _item in obj["additionalDenialReasons"]] if obj.get("additionalDenialReasons") is not None else None,
128150
"resubmitAllowed": obj.get("resubmitAllowed"),
129151
"createdDateTime": obj.get("createdDateTime"),
130152
"modifiedDateTime": obj.get("modifiedDateTime"),

bandwidth/models/thumbnail_alignment_enum.py

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

2222
class ThumbnailAlignmentEnum(str, Enum):
2323
"""
24-
The alignment of the thumbnail image in the card. Only applicable if the card using horizontal orientation.
24+
The alignment of the thumbnail image in the card. Required when orientation is HORIZONTAL.
2525
"""
2626

2727
"""

0 commit comments

Comments
 (0)