-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: refactored models, updated unit test, and added parameter i…
…n API call
- Loading branch information
1 parent
210f58e
commit 40521ae
Showing
11 changed files
with
70 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 7 additions & 5 deletions
12
sinch/domains/numbers/models/active/list_active_numbers_request.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 3 additions & 20 deletions
23
sinch/domains/numbers/models/available/activate_number_response.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,5 @@ | ||
from datetime import datetime | ||
from typing import Optional | ||
from pydantic import Field, StrictInt, StrictStr | ||
from sinch.domains.numbers.models.numbers import Money, SmsConfigurationResponse, VoiceConfigurationResponse | ||
from sinch.domains.numbers.models.base_model_numbers import BaseModelConfigResponse | ||
from sinch.domains.numbers.models.numbers import CapabilityType, NumberType | ||
from sinch.domains.numbers.models.numbers import ActiveNumber | ||
|
||
|
||
class ActivateNumberResponse(BaseModelConfigResponse): | ||
phone_number: Optional[StrictStr] = Field(default=None, alias="phoneNumber") | ||
project_id: Optional[StrictStr] = Field(default=None, alias="projectId") | ||
display_name: Optional[StrictStr] = Field(default=None, alias="displayName") | ||
region_code: Optional[StrictStr] = Field(default=None, alias="regionCode") | ||
type: Optional[NumberType] = Field(default=None) | ||
capability: Optional[CapabilityType] = Field(default=None) | ||
money: Optional[Money] = Field(default=None) | ||
payment_interval_months: Optional[StrictInt] = Field(default=None, alias="paymentIntervalMonths") | ||
next_charge_date: Optional[datetime] = Field(default=None, alias="nextChargeDate") | ||
expire_at: Optional[datetime] = Field(default=None, alias="expireAt") | ||
sms_configuration: Optional[SmsConfigurationResponse] = Field(default=None, alias="smsConfiguration") | ||
voice_configuration: Optional[VoiceConfigurationResponse] = Field(default=None, alias="voiceConfiguration") | ||
callback_url: Optional[StrictStr] = Field(default=None, alias="callbackUrl") | ||
class ActivateNumberResponse(ActiveNumber): | ||
pass |
10 changes: 6 additions & 4 deletions
10
sinch/domains/numbers/models/available/list_available_numbers_request.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
from typing import Optional | ||
from pydantic import Field, StrictInt, StrictStr | ||
from sinch.domains.numbers.models.base_model_numbers import BaseModelConfigRequest | ||
from sinch.domains.numbers.models.numbers import CapabilityType, NumberType, NumberSearchPatternType | ||
from sinch.domains.numbers.models.numbers import ( | ||
CapabilityTypeValuesList, NumberTypeValues, NumberSearchPatternTypeValues | ||
) | ||
|
||
|
||
class ListAvailableNumbersRequest(BaseModelConfigRequest): | ||
region_code: StrictStr = Field(alias="regionCode") | ||
number_type: NumberType = Field(alias="type") | ||
number_type: NumberTypeValues = Field(alias="type") | ||
page_size: Optional[StrictInt] = Field(default=None, alias="size") | ||
capabilities: Optional[CapabilityType] = Field(default=None) | ||
number_search_pattern: Optional[NumberSearchPatternType] = ( | ||
capabilities: Optional[CapabilityTypeValuesList] = Field(default=None) | ||
number_search_pattern: Optional[NumberSearchPatternTypeValues] = ( | ||
Field(default=None, alias="numberPattern.searchPattern")) | ||
number_pattern: Optional[StrictStr] = Field(default=None, alias="numberPattern.pattern") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters