diff --git a/bandwidth.yml b/bandwidth.yml index e41dd6a6..e180a94b 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -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 @@ -5849,8 +5857,6 @@ components: - VERIFIED - UNVERIFIED - PENDING - - PARTIALLY_VERIFIED - - INVALID_STATUS example: VERIFIED sharedSecretKey: description: >- diff --git a/bandwidth/models/message_callback.py b/bandwidth/models/message_callback.py index 5006aadc..f3afa89d 100644 --- a/bandwidth/models/message_callback.py +++ b/bandwidth/models/message_callback.py @@ -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, @@ -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 @@ -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(): diff --git a/bandwidth/models/tfv_status_enum.py b/bandwidth/models/tfv_status_enum.py index 61607290..c71065fd 100644 --- a/bandwidth/models/tfv_status_enum.py +++ b/bandwidth/models/tfv_status_enum.py @@ -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: diff --git a/docs/MessageCallback.md b/docs/MessageCallback.md index 1a1d3da1..de2577d1 100644 --- a/docs/MessageCallback.md +++ b/docs/MessageCallback.md @@ -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 diff --git a/docs/TfvStatusEnum.md b/docs/TfvStatusEnum.md index c022f0fd..c316ece4 100644 --- a/docs/TfvStatusEnum.md +++ b/docs/TfvStatusEnum.md @@ -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) diff --git a/test/unit/models/test_message_callback.py b/test/unit/models/test_message_callback.py index e2c4ae02..495fed8f 100644 --- a/test/unit/models/test_message_callback.py +++ b/test/unit/models/test_message_callback.py @@ -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( @@ -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() diff --git a/test/unit/models/test_tfv_status_enum.py b/test/unit/models/test_tfv_status_enum.py index 12563926..3388982a 100644 --- a/test/unit/models/test_tfv_status_enum.py +++ b/test/unit/models/test_tfv_status_enum.py @@ -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()