Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2494,6 +2494,14 @@ components:
description: Optional error code, applicable only when type is `message-failed`.
nullable: true
example: 4405
carrierName:
type: string
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.
nullable: true
example: AT&T
required:
- time
- type
Expand Down Expand Up @@ -5849,8 +5857,6 @@ components:
- VERIFIED
- UNVERIFIED
- PENDING
- PARTIALLY_VERIFIED
- INVALID_STATUS
example: VERIFIED
sharedSecretKey:
description: >-
Expand Down
11 changes: 9 additions & 2 deletions bandwidth/models/message_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ class MessageCallback(BaseModel):
description: StrictStr = Field(description="A detailed description of the event described by the callback.")
message: MessageCallbackMessage
error_code: Optional[StrictInt] = Field(default=None, description="Optional error code, applicable only when type is `message-failed`.", alias="errorCode")
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")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["time", "type", "to", "description", "message", "errorCode"]
__properties: ClassVar[List[str]] = ["time", "type", "to", "description", "message", "errorCode", "carrierName"]

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

# set to None if carrier_name (nullable) is None
# and model_fields_set contains the field
if self.carrier_name is None and "carrier_name" in self.model_fields_set:
_dict['carrierName'] = None

return _dict

@classmethod
Expand All @@ -110,7 +116,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"to": obj.get("to"),
"description": obj.get("description"),
"message": MessageCallbackMessage.from_dict(obj["message"]) if obj.get("message") is not None else None,
"errorCode": obj.get("errorCode")
"errorCode": obj.get("errorCode"),
"carrierName": obj.get("carrierName")
})
# store additional fields in additional_properties
for _key in obj.keys():
Expand Down
2 changes: 0 additions & 2 deletions bandwidth/models/tfv_status_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ class TfvStatusEnum(str, Enum):
VERIFIED = 'VERIFIED'
UNVERIFIED = 'UNVERIFIED'
PENDING = 'PENDING'
PARTIALLY_VERIFIED = 'PARTIALLY_VERIFIED'
INVALID_STATUS = 'INVALID_STATUS'

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down
1 change: 1 addition & 0 deletions docs/MessageCallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Name | Type | Description | Notes
**description** | **str** | A detailed description of the event described by the callback. |
**message** | [**MessageCallbackMessage**](MessageCallbackMessage.md) | |
**error_code** | **int** | Optional error code, applicable only when type is `message-failed`. | [optional]
**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]

## Example

Expand Down
4 changes: 0 additions & 4 deletions docs/TfvStatusEnum.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@

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

* `PARTIALLY_VERIFIED` (value: `'PARTIALLY_VERIFIED'`)

* `INVALID_STATUS` (value: `'INVALID_STATUS'`)

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


5 changes: 4 additions & 1 deletion test/unit/models/test_message_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def make_instance(self, include_optional) -> MessageCallback:
tag = 'custom string',
media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"],
priority = 'default', ),
error_code = 4405
error_code = 4405,
carrier_name = "AT&T"
)
else:
return MessageCallback(
Expand Down Expand Up @@ -97,6 +98,8 @@ def testMessageCallback(self):
assert instance.message.tag == 'custom string'
assert instance.message.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"]
assert instance.message.priority == 'default'
assert instance.error_code == 4405
assert instance.carrier_name == "AT&T"

if __name__ == '__main__':
unittest.main()
4 changes: 0 additions & 4 deletions test/unit/models/test_tfv_status_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,9 @@ def testTfvStatusEnum(self):
verified = TfvStatusEnum('VERIFIED')
unverified = TfvStatusEnum('UNVERIFIED')
pending = TfvStatusEnum('PENDING')
partially_verified = TfvStatusEnum('PARTIALLY_VERIFIED')
invalid_status = TfvStatusEnum('INVALID_STATUS')
assert verified == 'VERIFIED'
assert unverified == 'UNVERIFIED'
assert pending == 'PENDING'
assert partially_verified == 'PARTIALLY_VERIFIED'
assert invalid_status == 'INVALID_STATUS'

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