Skip to content

Commit 4949e43

Browse files
committed
Merge branch 'brtc-python-sdk' of https://github.com/Bandwidth/python-sdk into brtc-python-sdk
2 parents 037cb55 + 4d2fb69 commit 4949e43

11 files changed

+74
-10
lines changed

bandwidth.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6116,6 +6116,8 @@ components:
61166116
$ref: '#/components/schemas/helpMessageResponse'
61176117
ageGatedContent:
61186118
$ref: '#/components/schemas/ageGatedContent'
6119+
cvToken:
6120+
$ref: '#/components/schemas/cvToken'
61196121
verificationUpdateRequest:
61206122
type: object
61216123
required:
@@ -6165,6 +6167,8 @@ components:
61656167
$ref: '#/components/schemas/helpMessageResponse'
61666168
ageGatedContent:
61676169
$ref: '#/components/schemas/ageGatedContent'
6170+
cvToken:
6171+
$ref: '#/components/schemas/cvToken'
61686172
tfvBasicAuthentication:
61696173
type: object
61706174
properties:
@@ -6616,6 +6620,8 @@ components:
66166620
$ref: '#/components/schemas/blocked'
66176621
blockedReason:
66186622
$ref: '#/components/schemas/blockedReason'
6623+
cvToken:
6624+
$ref: '#/components/schemas/cvToken'
66196625
tfvSubmissionInfo:
66206626
type: object
66216627
properties:
@@ -6977,6 +6983,18 @@ components:
69776983
- links
69786984
- data
69796985
- errors
6986+
cvToken:
6987+
type: string
6988+
description: >-
6989+
The token provided by Campaign Verify to validate your political use
6990+
case. Only required for 527 political organizations. If you are not a
6991+
527 political organization, this field should be omitted. If you pass an
6992+
empty string, it will be passed along and potentially rejected.
6993+
minLength: 0
6994+
maxLength: 500
6995+
nullable: true
6996+
example: >-
6997+
cv.user123|sess456|mno|tfree|read_write|X7yZ9aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVw
69806998
responses:
69816999
createMessageResponse:
69827000
description: Accepted

bandwidth/models/tfv_status.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ class TfvStatus(BaseModel):
4242
submission: Optional[TfvSubmissionInfo] = None
4343
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.")
4444
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")
45+
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")
4546
additional_properties: Dict[str, Any] = {}
46-
__properties: ClassVar[List[str]] = ["phoneNumber", "status", "internalTicketNumber", "declineReasonDescription", "resubmitAllowed", "createdDateTime", "modifiedDateTime", "submission", "blocked", "blockedReason"]
47+
__properties: ClassVar[List[str]] = ["phoneNumber", "status", "internalTicketNumber", "declineReasonDescription", "resubmitAllowed", "createdDateTime", "modifiedDateTime", "submission", "blocked", "blockedReason", "cvToken"]
4748

4849
@field_validator('phone_number')
4950
def phone_number_validate_regular_expression(cls, value):
@@ -104,6 +105,11 @@ def to_dict(self) -> Dict[str, Any]:
104105
for _key, _value in self.additional_properties.items():
105106
_dict[_key] = _value
106107

108+
# set to None if cv_token (nullable) is None
109+
# and model_fields_set contains the field
110+
if self.cv_token is None and "cv_token" in self.model_fields_set:
111+
_dict['cvToken'] = None
112+
107113
return _dict
108114

109115
@classmethod
@@ -125,7 +131,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
125131
"modifiedDateTime": obj.get("modifiedDateTime"),
126132
"submission": TfvSubmissionInfo.from_dict(obj["submission"]) if obj.get("submission") is not None else None,
127133
"blocked": obj.get("blocked"),
128-
"blockedReason": obj.get("blockedReason")
134+
"blockedReason": obj.get("blockedReason"),
135+
"cvToken": obj.get("cvToken")
129136
})
130137
# store additional fields in additional_properties
131138
for _key in obj.keys():

bandwidth/models/verification_request.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ class VerificationRequest(BaseModel):
5151
business_entity_type: Optional[BusinessEntityTypeEnum] = Field(default=None, alias="businessEntityType")
5252
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")
5353
age_gated_content: Optional[StrictBool] = Field(default=None, description="Indicates whether the content is age-gated.", alias="ageGatedContent")
54+
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")
5455
additional_properties: Dict[str, Any] = {}
55-
__properties: ClassVar[List[str]] = ["businessAddress", "businessContact", "messageVolume", "phoneNumbers", "useCase", "useCaseSummary", "productionMessageContent", "optInWorkflow", "additionalInformation", "isvReseller", "privacyPolicyUrl", "termsAndConditionsUrl", "businessDba", "businessRegistrationNumber", "businessRegistrationType", "businessEntityType", "helpMessageResponse", "ageGatedContent"]
56+
__properties: ClassVar[List[str]] = ["businessAddress", "businessContact", "messageVolume", "phoneNumbers", "useCase", "useCaseSummary", "productionMessageContent", "optInWorkflow", "additionalInformation", "isvReseller", "privacyPolicyUrl", "termsAndConditionsUrl", "businessDba", "businessRegistrationNumber", "businessRegistrationType", "businessEntityType", "helpMessageResponse", "ageGatedContent", "cvToken"]
5657

5758
model_config = ConfigDict(
5859
populate_by_name=True,
@@ -139,6 +140,11 @@ def to_dict(self) -> Dict[str, Any]:
139140
if self.help_message_response is None and "help_message_response" in self.model_fields_set:
140141
_dict['helpMessageResponse'] = None
141142

143+
# set to None if cv_token (nullable) is None
144+
# and model_fields_set contains the field
145+
if self.cv_token is None and "cv_token" in self.model_fields_set:
146+
_dict['cvToken'] = None
147+
142148
return _dict
143149

144150
@classmethod
@@ -168,7 +174,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
168174
"businessRegistrationType": obj.get("businessRegistrationType"),
169175
"businessEntityType": obj.get("businessEntityType"),
170176
"helpMessageResponse": obj.get("helpMessageResponse"),
171-
"ageGatedContent": obj.get("ageGatedContent")
177+
"ageGatedContent": obj.get("ageGatedContent"),
178+
"cvToken": obj.get("cvToken")
172179
})
173180
# store additional fields in additional_properties
174181
for _key in obj.keys():

bandwidth/models/verification_update_request.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ class VerificationUpdateRequest(BaseModel):
5050
business_entity_type: Optional[BusinessEntityTypeEnum] = Field(default=None, alias="businessEntityType")
5151
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")
5252
age_gated_content: Optional[StrictBool] = Field(default=None, description="Indicates whether the content is age-gated.", alias="ageGatedContent")
53+
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")
5354
additional_properties: Dict[str, Any] = {}
54-
__properties: ClassVar[List[str]] = ["businessAddress", "businessContact", "messageVolume", "useCase", "useCaseSummary", "productionMessageContent", "optInWorkflow", "additionalInformation", "isvReseller", "privacyPolicyUrl", "termsAndConditionsUrl", "businessDba", "businessRegistrationNumber", "businessRegistrationType", "businessEntityType", "helpMessageResponse", "ageGatedContent"]
55+
__properties: ClassVar[List[str]] = ["businessAddress", "businessContact", "messageVolume", "useCase", "useCaseSummary", "productionMessageContent", "optInWorkflow", "additionalInformation", "isvReseller", "privacyPolicyUrl", "termsAndConditionsUrl", "businessDba", "businessRegistrationNumber", "businessRegistrationType", "businessEntityType", "helpMessageResponse", "ageGatedContent", "cvToken"]
5556

5657
model_config = ConfigDict(
5758
populate_by_name=True,
@@ -138,6 +139,11 @@ def to_dict(self) -> Dict[str, Any]:
138139
if self.help_message_response is None and "help_message_response" in self.model_fields_set:
139140
_dict['helpMessageResponse'] = None
140141

142+
# set to None if cv_token (nullable) is None
143+
# and model_fields_set contains the field
144+
if self.cv_token is None and "cv_token" in self.model_fields_set:
145+
_dict['cvToken'] = None
146+
141147
return _dict
142148

143149
@classmethod
@@ -166,7 +172,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
166172
"businessRegistrationType": obj.get("businessRegistrationType"),
167173
"businessEntityType": obj.get("businessEntityType"),
168174
"helpMessageResponse": obj.get("helpMessageResponse"),
169-
"ageGatedContent": obj.get("ageGatedContent")
175+
"ageGatedContent": obj.get("ageGatedContent"),
176+
"cvToken": obj.get("cvToken")
170177
})
171178
# store additional fields in additional_properties
172179
for _key in obj.keys():

docs/TfvStatus.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Name | Type | Description | Notes
1515
**submission** | [**TfvSubmissionInfo**](TfvSubmissionInfo.md) | | [optional]
1616
**blocked** | **bool** | Whether a Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked. | [optional]
1717
**blocked_reason** | **str** | The reason why the Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked. | [optional]
18+
**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]
1819

1920
## Example
2021

docs/VerificationRequest.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Name | Type | Description | Notes
2323
**business_entity_type** | [**BusinessEntityTypeEnum**](BusinessEntityTypeEnum.md) | | [optional]
2424
**help_message_response** | **str** | A message that gets sent to users requesting help. | [optional]
2525
**age_gated_content** | **bool** | Indicates whether the content is age-gated. | [optional]
26+
**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]
2627

2728
## Example
2829

docs/VerificationUpdateRequest.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Name | Type | Description | Notes
2222
**business_entity_type** | [**BusinessEntityTypeEnum**](BusinessEntityTypeEnum.md) | | [optional]
2323
**help_message_response** | **str** | A message that gets sent to users requesting help. | [optional]
2424
**age_gated_content** | **bool** | Indicates whether the content is age-gated. | [optional]
25+
**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]
2526

2627
## Example
2728

test/unit/api/test_toll_free_verification_api.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
from bandwidth.models.opt_in_workflow import OptInWorkflow
3737
from bandwidth.models.verification_request import VerificationRequest
3838
from bandwidth.models.tfv_submission_wrapper import TfvSubmissionWrapper
39+
from bandwidth.models.tfv_submission_info import TfvSubmissionInfo
40+
from bandwidth.models.business_registration_type_enum import BusinessRegistrationTypeEnum
41+
from bandwidth.models.business_entity_type_enum import BusinessEntityTypeEnum
3942

4043

4144
class TestTollFreeVerificationApi(unittest.TestCase):
@@ -90,7 +93,16 @@ def setUpClass(cls) -> None:
9093
confirmation_response='confirmationResponse'
9194
),
9295
'additionalInformation': 'additionalInformation',
93-
'isvReseller': 'isvReseller'
96+
'isvReseller': 'isvReseller',
97+
'privacyPolicyUrl': 'https://example.com',
98+
'termsAndConditionsUrl': 'https://example.com',
99+
'businessDba': 'businessDba',
100+
'businessRegistrationNumber': 'businessRegistrationNumber',
101+
'businessRegistrationType': BusinessRegistrationTypeEnum.EIN,
102+
'businessEntityType': BusinessEntityTypeEnum.NON_PROFIT,
103+
'helpMessageResponse': 'helpMessageResponse',
104+
'ageGatedContent': True,
105+
'cvToken': 'cvToken'
94106
}
95107

96108
def test_create_webhook_subscription(self) -> None:
@@ -137,6 +149,10 @@ def test_get_toll_free_verification_status(self) -> None:
137149
assert_that(response.data.resubmit_allowed, instance_of(bool))
138150
assert_that(response.data.created_date_time, instance_of(datetime))
139151
assert_that(response.data.modified_date_time, instance_of(datetime))
152+
assert_that(response.data.submission, instance_of(TfvSubmissionInfo))
153+
assert_that(response.data.blocked, instance_of(bool))
154+
assert_that(response.data.blocked_reason, instance_of(str))
155+
assert_that(response.data.cv_token, instance_of(str))
140156

141157
def test_delete_verification_request(self) -> None:
142158
"""Test case for delete_verification_request

test/unit/models/test_tfv_status.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ def make_instance(self, include_optional) -> TfvStatus:
8080
business_entity_type = 'SOLE_PROPRIETOR'
8181
),
8282
blocked = False,
83-
blocked_reason = 'Blocked Reason'
83+
blocked_reason = 'Blocked Reason',
84+
cv_token = 'cvToken'
8485
)
8586
else:
8687
return TfvStatus(
@@ -133,6 +134,7 @@ def testTfvStatus(self):
133134
assert instance.submission.additional_information == 'Any additional information'
134135
assert instance.blocked == False
135136
assert instance.blocked_reason == 'Blocked Reason'
137+
assert instance.cv_token == 'cvToken'
136138

137139

138140
if __name__ == '__main__':

test/unit/models/test_verification_request.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def make_instance(self, include_optional) -> VerificationRequest:
7171
business_registration_type = 'EIN',
7272
business_entity_type = 'SOLE_PROPRIETOR',
7373
help_message_response = 'Please contact support for assistance.',
74-
age_gated_content = False
74+
age_gated_content = False,
75+
cv_token = 'cvToken'
7576
)
7677
else:
7778
return VerificationRequest(
@@ -144,6 +145,7 @@ def testVerificationRequest(self):
144145
assert instance.business_entity_type == 'SOLE_PROPRIETOR'
145146
assert instance.help_message_response == 'Please contact support for assistance.'
146147
assert instance.age_gated_content == False
148+
assert instance.cv_token == 'cvToken'
147149

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

0 commit comments

Comments
 (0)