diff --git a/bandwidth.yml b/bandwidth.yml index d7c32953..22b13cec 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -5956,6 +5956,8 @@ components: $ref: '#/components/schemas/helpMessageResponse' ageGatedContent: $ref: '#/components/schemas/ageGatedContent' + cvToken: + $ref: '#/components/schemas/cvToken' verificationUpdateRequest: type: object required: @@ -6005,6 +6007,8 @@ components: $ref: '#/components/schemas/helpMessageResponse' ageGatedContent: $ref: '#/components/schemas/ageGatedContent' + cvToken: + $ref: '#/components/schemas/cvToken' tfvBasicAuthentication: type: object properties: @@ -6456,6 +6460,8 @@ components: $ref: '#/components/schemas/blocked' blockedReason: $ref: '#/components/schemas/blockedReason' + cvToken: + $ref: '#/components/schemas/cvToken' tfvSubmissionInfo: type: object properties: @@ -6520,6 +6526,18 @@ components: nullable: true pattern: ^[ -~]{16,64}$ type: string + cvToken: + type: string + 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. If you pass an + empty string, it will be passed along and potentially rejected. + minLength: 0 + maxLength: 500 + nullable: true + example: >- + cv.user123|sess456|mno|tfree|read_write|X7yZ9aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVw responses: createMessageResponse: description: Accepted diff --git a/bandwidth/models/tfv_status.py b/bandwidth/models/tfv_status.py index 0bc7737a..3a10fb79 100644 --- a/bandwidth/models/tfv_status.py +++ b/bandwidth/models/tfv_status.py @@ -42,8 +42,9 @@ class TfvStatus(BaseModel): submission: Optional[TfvSubmissionInfo] = None blocked: Optional[StrictBool] = Field(default=None, description="Whether a Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked.") 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") + 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. If you pass an empty string, it will be passed along and potentially rejected.", alias="cvToken") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["phoneNumber", "status", "internalTicketNumber", "declineReasonDescription", "resubmitAllowed", "createdDateTime", "modifiedDateTime", "submission", "blocked", "blockedReason"] + __properties: ClassVar[List[str]] = ["phoneNumber", "status", "internalTicketNumber", "declineReasonDescription", "resubmitAllowed", "createdDateTime", "modifiedDateTime", "submission", "blocked", "blockedReason", "cvToken"] @field_validator('phone_number') def phone_number_validate_regular_expression(cls, value): @@ -104,6 +105,11 @@ def to_dict(self) -> Dict[str, Any]: for _key, _value in self.additional_properties.items(): _dict[_key] = _value + # set to None if cv_token (nullable) is None + # and model_fields_set contains the field + if self.cv_token is None and "cv_token" in self.model_fields_set: + _dict['cvToken'] = None + return _dict @classmethod @@ -125,7 +131,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "modifiedDateTime": obj.get("modifiedDateTime"), "submission": TfvSubmissionInfo.from_dict(obj["submission"]) if obj.get("submission") is not None else None, "blocked": obj.get("blocked"), - "blockedReason": obj.get("blockedReason") + "blockedReason": obj.get("blockedReason"), + "cvToken": obj.get("cvToken") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/verification_request.py b/bandwidth/models/verification_request.py index 20a5d01c..943ebffd 100644 --- a/bandwidth/models/verification_request.py +++ b/bandwidth/models/verification_request.py @@ -51,8 +51,9 @@ class VerificationRequest(BaseModel): business_entity_type: Optional[BusinessEntityTypeEnum] = Field(default=None, alias="businessEntityType") help_message_response: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="A message that gets sent to users requesting help.", alias="helpMessageResponse") age_gated_content: Optional[StrictBool] = Field(default=None, description="Indicates whether the content is age-gated.", alias="ageGatedContent") + 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. If you pass an empty string, it will be passed along and potentially rejected.", alias="cvToken") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["businessAddress", "businessContact", "messageVolume", "phoneNumbers", "useCase", "useCaseSummary", "productionMessageContent", "optInWorkflow", "additionalInformation", "isvReseller", "privacyPolicyUrl", "termsAndConditionsUrl", "businessDba", "businessRegistrationNumber", "businessRegistrationType", "businessEntityType", "helpMessageResponse", "ageGatedContent"] + __properties: ClassVar[List[str]] = ["businessAddress", "businessContact", "messageVolume", "phoneNumbers", "useCase", "useCaseSummary", "productionMessageContent", "optInWorkflow", "additionalInformation", "isvReseller", "privacyPolicyUrl", "termsAndConditionsUrl", "businessDba", "businessRegistrationNumber", "businessRegistrationType", "businessEntityType", "helpMessageResponse", "ageGatedContent", "cvToken"] model_config = ConfigDict( populate_by_name=True, @@ -139,6 +140,11 @@ def to_dict(self) -> Dict[str, Any]: if self.help_message_response is None and "help_message_response" in self.model_fields_set: _dict['helpMessageResponse'] = None + # set to None if cv_token (nullable) is None + # and model_fields_set contains the field + if self.cv_token is None and "cv_token" in self.model_fields_set: + _dict['cvToken'] = None + return _dict @classmethod @@ -168,7 +174,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "businessRegistrationType": obj.get("businessRegistrationType"), "businessEntityType": obj.get("businessEntityType"), "helpMessageResponse": obj.get("helpMessageResponse"), - "ageGatedContent": obj.get("ageGatedContent") + "ageGatedContent": obj.get("ageGatedContent"), + "cvToken": obj.get("cvToken") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/verification_update_request.py b/bandwidth/models/verification_update_request.py index 606b2640..8d0dd6bb 100644 --- a/bandwidth/models/verification_update_request.py +++ b/bandwidth/models/verification_update_request.py @@ -50,8 +50,9 @@ class VerificationUpdateRequest(BaseModel): business_entity_type: Optional[BusinessEntityTypeEnum] = Field(default=None, alias="businessEntityType") help_message_response: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="A message that gets sent to users requesting help.", alias="helpMessageResponse") age_gated_content: Optional[StrictBool] = Field(default=None, description="Indicates whether the content is age-gated.", alias="ageGatedContent") + 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. If you pass an empty string, it will be passed along and potentially rejected.", alias="cvToken") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["businessAddress", "businessContact", "messageVolume", "useCase", "useCaseSummary", "productionMessageContent", "optInWorkflow", "additionalInformation", "isvReseller", "privacyPolicyUrl", "termsAndConditionsUrl", "businessDba", "businessRegistrationNumber", "businessRegistrationType", "businessEntityType", "helpMessageResponse", "ageGatedContent"] + __properties: ClassVar[List[str]] = ["businessAddress", "businessContact", "messageVolume", "useCase", "useCaseSummary", "productionMessageContent", "optInWorkflow", "additionalInformation", "isvReseller", "privacyPolicyUrl", "termsAndConditionsUrl", "businessDba", "businessRegistrationNumber", "businessRegistrationType", "businessEntityType", "helpMessageResponse", "ageGatedContent", "cvToken"] model_config = ConfigDict( populate_by_name=True, @@ -138,6 +139,11 @@ def to_dict(self) -> Dict[str, Any]: if self.help_message_response is None and "help_message_response" in self.model_fields_set: _dict['helpMessageResponse'] = None + # set to None if cv_token (nullable) is None + # and model_fields_set contains the field + if self.cv_token is None and "cv_token" in self.model_fields_set: + _dict['cvToken'] = None + return _dict @classmethod @@ -166,7 +172,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "businessRegistrationType": obj.get("businessRegistrationType"), "businessEntityType": obj.get("businessEntityType"), "helpMessageResponse": obj.get("helpMessageResponse"), - "ageGatedContent": obj.get("ageGatedContent") + "ageGatedContent": obj.get("ageGatedContent"), + "cvToken": obj.get("cvToken") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/docs/TfvStatus.md b/docs/TfvStatus.md index eff31db4..59ff69b7 100644 --- a/docs/TfvStatus.md +++ b/docs/TfvStatus.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **submission** | [**TfvSubmissionInfo**](TfvSubmissionInfo.md) | | [optional] **blocked** | **bool** | Whether a Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked. | [optional] **blocked_reason** | **str** | The reason why the Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked. | [optional] +**cv_token** | **str** | 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. If you pass an empty string, it will be passed along and potentially rejected. | [optional] ## Example diff --git a/docs/VerificationRequest.md b/docs/VerificationRequest.md index 7a1076a6..afcdcc5f 100644 --- a/docs/VerificationRequest.md +++ b/docs/VerificationRequest.md @@ -23,6 +23,7 @@ Name | Type | Description | Notes **business_entity_type** | [**BusinessEntityTypeEnum**](BusinessEntityTypeEnum.md) | | [optional] **help_message_response** | **str** | A message that gets sent to users requesting help. | [optional] **age_gated_content** | **bool** | Indicates whether the content is age-gated. | [optional] +**cv_token** | **str** | 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. If you pass an empty string, it will be passed along and potentially rejected. | [optional] ## Example diff --git a/docs/VerificationUpdateRequest.md b/docs/VerificationUpdateRequest.md index 34c64757..1da5bd0a 100644 --- a/docs/VerificationUpdateRequest.md +++ b/docs/VerificationUpdateRequest.md @@ -22,6 +22,7 @@ Name | Type | Description | Notes **business_entity_type** | [**BusinessEntityTypeEnum**](BusinessEntityTypeEnum.md) | | [optional] **help_message_response** | **str** | A message that gets sent to users requesting help. | [optional] **age_gated_content** | **bool** | Indicates whether the content is age-gated. | [optional] +**cv_token** | **str** | 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. If you pass an empty string, it will be passed along and potentially rejected. | [optional] ## Example diff --git a/test/unit/api/test_toll_free_verification_api.py b/test/unit/api/test_toll_free_verification_api.py index ad137c85..371bc20c 100644 --- a/test/unit/api/test_toll_free_verification_api.py +++ b/test/unit/api/test_toll_free_verification_api.py @@ -36,6 +36,9 @@ from bandwidth.models.opt_in_workflow import OptInWorkflow from bandwidth.models.verification_request import VerificationRequest from bandwidth.models.tfv_submission_wrapper import TfvSubmissionWrapper +from bandwidth.models.tfv_submission_info import TfvSubmissionInfo +from bandwidth.models.business_registration_type_enum import BusinessRegistrationTypeEnum +from bandwidth.models.business_entity_type_enum import BusinessEntityTypeEnum class TestTollFreeVerificationApi(unittest.TestCase): @@ -90,7 +93,16 @@ def setUpClass(cls) -> None: confirmation_response='confirmationResponse' ), 'additionalInformation': 'additionalInformation', - 'isvReseller': 'isvReseller' + 'isvReseller': 'isvReseller', + 'privacyPolicyUrl': 'https://example.com', + 'termsAndConditionsUrl': 'https://example.com', + 'businessDba': 'businessDba', + 'businessRegistrationNumber': 'businessRegistrationNumber', + 'businessRegistrationType': BusinessRegistrationTypeEnum.EIN, + 'businessEntityType': BusinessEntityTypeEnum.NON_PROFIT, + 'helpMessageResponse': 'helpMessageResponse', + 'ageGatedContent': True, + 'cvToken': 'cvToken' } def test_create_webhook_subscription(self) -> None: @@ -137,6 +149,10 @@ def test_get_toll_free_verification_status(self) -> None: assert_that(response.data.resubmit_allowed, instance_of(bool)) assert_that(response.data.created_date_time, instance_of(datetime)) assert_that(response.data.modified_date_time, instance_of(datetime)) + assert_that(response.data.submission, instance_of(TfvSubmissionInfo)) + assert_that(response.data.blocked, instance_of(bool)) + assert_that(response.data.blocked_reason, instance_of(str)) + assert_that(response.data.cv_token, instance_of(str)) def test_delete_verification_request(self) -> None: """Test case for delete_verification_request diff --git a/test/unit/models/test_tfv_status.py b/test/unit/models/test_tfv_status.py index 2bd8e243..9701bb98 100644 --- a/test/unit/models/test_tfv_status.py +++ b/test/unit/models/test_tfv_status.py @@ -80,7 +80,8 @@ def make_instance(self, include_optional) -> TfvStatus: business_entity_type = 'SOLE_PROPRIETOR' ), blocked = False, - blocked_reason = 'Blocked Reason' + blocked_reason = 'Blocked Reason', + cv_token = 'cvToken' ) else: return TfvStatus( @@ -133,6 +134,7 @@ def testTfvStatus(self): assert instance.submission.additional_information == 'Any additional information' assert instance.blocked == False assert instance.blocked_reason == 'Blocked Reason' + assert instance.cv_token == 'cvToken' if __name__ == '__main__': diff --git a/test/unit/models/test_verification_request.py b/test/unit/models/test_verification_request.py index dc94c261..d4fa76ce 100644 --- a/test/unit/models/test_verification_request.py +++ b/test/unit/models/test_verification_request.py @@ -71,7 +71,8 @@ def make_instance(self, include_optional) -> VerificationRequest: business_registration_type = 'EIN', business_entity_type = 'SOLE_PROPRIETOR', help_message_response = 'Please contact support for assistance.', - age_gated_content = False + age_gated_content = False, + cv_token = 'cvToken' ) else: return VerificationRequest( @@ -144,6 +145,7 @@ def testVerificationRequest(self): assert instance.business_entity_type == 'SOLE_PROPRIETOR' assert instance.help_message_response == 'Please contact support for assistance.' assert instance.age_gated_content == False + assert instance.cv_token == 'cvToken' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_verification_update_request.py b/test/unit/models/test_verification_update_request.py index c51b42c8..ea60a3fb 100644 --- a/test/unit/models/test_verification_update_request.py +++ b/test/unit/models/test_verification_update_request.py @@ -68,7 +68,8 @@ def make_instance(self, include_optional) -> VerificationUpdateRequest: business_registration_type = 'EIN', business_entity_type = 'SOLE_PROPRIETOR', help_message_response = 'Please contact support for assistance.', - age_gated_content = False + age_gated_content = False, + cv_token = 'cvToken' ) else: return VerificationUpdateRequest( @@ -135,6 +136,7 @@ def testVerificationUpdateRequest(self): assert instance.business_entity_type == 'SOLE_PROPRIETOR' assert instance.help_message_response == 'Please contact support for assistance.' assert instance.age_gated_content == False + assert instance.cv_token == 'cvToken' if __name__ == '__main__': unittest.main()