Skip to content

Commit 5295e5f

Browse files
band-swi-release-engineering[bot]DX-Bandwidthckoegel
authored
SWI-7821 Update SDK Based on Recent Spec Changes (#252)
* Generate SDK with OpenAPI Generator Version * unit tests --------- Co-authored-by: DX-Bandwidth <[email protected]> Co-authored-by: ckoegel <[email protected]>
1 parent e4b3a69 commit 5295e5f

File tree

7 files changed

+22
-15
lines changed

7 files changed

+22
-15
lines changed

bandwidth.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2494,6 +2494,14 @@ components:
24942494
description: Optional error code, applicable only when type is `message-failed`.
24952495
nullable: true
24962496
example: 4405
2497+
carrierName:
2498+
type: string
2499+
description: >-
2500+
The name of the Authorized Message Provider (AMP) that handled this
2501+
message. In the US, this is the carrier that the message was sent
2502+
to.
2503+
nullable: true
2504+
example: AT&T
24972505
required:
24982506
- time
24992507
- type
@@ -5849,8 +5857,6 @@ components:
58495857
- VERIFIED
58505858
- UNVERIFIED
58515859
- PENDING
5852-
- PARTIALLY_VERIFIED
5853-
- INVALID_STATUS
58545860
example: VERIFIED
58555861
sharedSecretKey:
58565862
description: >-

bandwidth/models/message_callback.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ class MessageCallback(BaseModel):
3636
description: StrictStr = Field(description="A detailed description of the event described by the callback.")
3737
message: MessageCallbackMessage
3838
error_code: Optional[StrictInt] = Field(default=None, description="Optional error code, applicable only when type is `message-failed`.", alias="errorCode")
39+
carrier_name: Optional[StrictStr] = Field(default=None, description="The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to.", alias="carrierName")
3940
additional_properties: Dict[str, Any] = {}
40-
__properties: ClassVar[List[str]] = ["time", "type", "to", "description", "message", "errorCode"]
41+
__properties: ClassVar[List[str]] = ["time", "type", "to", "description", "message", "errorCode", "carrierName"]
4142

4243
model_config = ConfigDict(
4344
populate_by_name=True,
@@ -93,6 +94,11 @@ def to_dict(self) -> Dict[str, Any]:
9394
if self.error_code is None and "error_code" in self.model_fields_set:
9495
_dict['errorCode'] = None
9596

97+
# set to None if carrier_name (nullable) is None
98+
# and model_fields_set contains the field
99+
if self.carrier_name is None and "carrier_name" in self.model_fields_set:
100+
_dict['carrierName'] = None
101+
96102
return _dict
97103

98104
@classmethod
@@ -110,7 +116,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
110116
"to": obj.get("to"),
111117
"description": obj.get("description"),
112118
"message": MessageCallbackMessage.from_dict(obj["message"]) if obj.get("message") is not None else None,
113-
"errorCode": obj.get("errorCode")
119+
"errorCode": obj.get("errorCode"),
120+
"carrierName": obj.get("carrierName")
114121
})
115122
# store additional fields in additional_properties
116123
for _key in obj.keys():

bandwidth/models/tfv_status_enum.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ class TfvStatusEnum(str, Enum):
3030
VERIFIED = 'VERIFIED'
3131
UNVERIFIED = 'UNVERIFIED'
3232
PENDING = 'PENDING'
33-
PARTIALLY_VERIFIED = 'PARTIALLY_VERIFIED'
34-
INVALID_STATUS = 'INVALID_STATUS'
3533

3634
@classmethod
3735
def from_json(cls, json_str: str) -> Self:

docs/MessageCallback.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Name | Type | Description | Notes
1212
**description** | **str** | A detailed description of the event described by the callback. |
1313
**message** | [**MessageCallbackMessage**](MessageCallbackMessage.md) | |
1414
**error_code** | **int** | Optional error code, applicable only when type is &#x60;message-failed&#x60;. | [optional]
15+
**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. | [optional]
1516

1617
## Example
1718

docs/TfvStatusEnum.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99

1010
* `PENDING` (value: `'PENDING'`)
1111

12-
* `PARTIALLY_VERIFIED` (value: `'PARTIALLY_VERIFIED'`)
13-
14-
* `INVALID_STATUS` (value: `'INVALID_STATUS'`)
15-
1612
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1713

1814

test/unit/models/test_message_callback.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def make_instance(self, include_optional) -> MessageCallback:
5252
tag = 'custom string',
5353
media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"],
5454
priority = 'default', ),
55-
error_code = 4405
55+
error_code = 4405,
56+
carrier_name = "AT&T"
5657
)
5758
else:
5859
return MessageCallback(
@@ -97,6 +98,8 @@ def testMessageCallback(self):
9798
assert instance.message.tag == 'custom string'
9899
assert instance.message.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"]
99100
assert instance.message.priority == 'default'
101+
assert instance.error_code == 4405
102+
assert instance.carrier_name == "AT&T"
100103

101104
if __name__ == '__main__':
102105
unittest.main()

test/unit/models/test_tfv_status_enum.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,9 @@ def testTfvStatusEnum(self):
3131
verified = TfvStatusEnum('VERIFIED')
3232
unverified = TfvStatusEnum('UNVERIFIED')
3333
pending = TfvStatusEnum('PENDING')
34-
partially_verified = TfvStatusEnum('PARTIALLY_VERIFIED')
35-
invalid_status = TfvStatusEnum('INVALID_STATUS')
3634
assert verified == 'VERIFIED'
3735
assert unverified == 'UNVERIFIED'
3836
assert pending == 'PENDING'
39-
assert partially_verified == 'PARTIALLY_VERIFIED'
40-
assert invalid_status == 'INVALID_STATUS'
4137

4238
if __name__ == '__main__':
4339
unittest.main()

0 commit comments

Comments
 (0)