@ -47,6 +47,7 @@ from .payment_intent import PaymentIntent
|
|||||||
from .payment_method import PaymentMethod
|
from .payment_method import PaymentMethod
|
||||||
from .payment_method_card_checks import PaymentMethodCardChecks
|
from .payment_method_card_checks import PaymentMethodCardChecks
|
||||||
from .payment_method_type import PaymentMethodType
|
from .payment_method_type import PaymentMethodType
|
||||||
|
from .phone_number import PhoneNumber
|
||||||
from .pong import Pong
|
from .pong import Pong
|
||||||
from .session import Session
|
from .session import Session
|
||||||
from .status_code import StatusCode
|
from .status_code import StatusCode
|
||||||
|
@ -3,6 +3,7 @@ from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
|||||||
import attr
|
import attr
|
||||||
|
|
||||||
from ..models.address import Address
|
from ..models.address import Address
|
||||||
|
from ..models.phone_number import PhoneNumber
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
T = TypeVar("T", bound="BillingInfo")
|
T = TypeVar("T", bound="BillingInfo")
|
||||||
@ -13,7 +14,7 @@ class BillingInfo:
|
|||||||
""" """
|
""" """
|
||||||
address: Union[Unset, Address] = UNSET
|
address: Union[Unset, Address] = UNSET
|
||||||
name: Union[Unset, str] = UNSET
|
name: Union[Unset, str] = UNSET
|
||||||
phone: Union[Unset, str] = UNSET
|
phone: Union[Unset, PhoneNumber] = UNSET
|
||||||
|
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
@ -22,7 +23,9 @@ class BillingInfo:
|
|||||||
if not isinstance(self.address, Unset):
|
if not isinstance(self.address, Unset):
|
||||||
address = self.address.value
|
address = self.address.value
|
||||||
name = self.name
|
name = self.name
|
||||||
phone = self.phone
|
phone: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.phone, Unset):
|
||||||
|
phone = self.phone.value
|
||||||
|
|
||||||
field_dict: Dict[str, Any] = {}
|
field_dict: Dict[str, Any] = {}
|
||||||
field_dict.update(self.additional_properties)
|
field_dict.update(self.additional_properties)
|
||||||
@ -48,7 +51,12 @@ class BillingInfo:
|
|||||||
|
|
||||||
name = d.pop("name", UNSET)
|
name = d.pop("name", UNSET)
|
||||||
|
|
||||||
phone = d.pop("phone", UNSET)
|
_phone = d.pop("phone", UNSET)
|
||||||
|
phone: Union[Unset, PhoneNumber]
|
||||||
|
if isinstance(_phone, Unset):
|
||||||
|
phone = UNSET
|
||||||
|
else:
|
||||||
|
phone = PhoneNumber(_phone)
|
||||||
|
|
||||||
billing_info = cls(
|
billing_info = cls(
|
||||||
address=address,
|
address=address,
|
||||||
|
@ -6,6 +6,7 @@ from dateutil.parser import isoparse
|
|||||||
|
|
||||||
from ..models.address import Address
|
from ..models.address import Address
|
||||||
from ..models.currency import Currency
|
from ..models.currency import Currency
|
||||||
|
from ..models.phone_number import PhoneNumber
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
T = TypeVar("T", bound="Customer")
|
T = TypeVar("T", bound="Customer")
|
||||||
|
@ -4,6 +4,7 @@ from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
|||||||
import attr
|
import attr
|
||||||
from dateutil.parser import isoparse
|
from dateutil.parser import isoparse
|
||||||
|
|
||||||
|
from ..models.phone_number import PhoneNumber
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
T = TypeVar("T", bound="ExtendedUser")
|
T = TypeVar("T", bound="ExtendedUser")
|
||||||
@ -24,7 +25,7 @@ class ExtendedUser:
|
|||||||
last_name: Union[Unset, str] = UNSET
|
last_name: Union[Unset, str] = UNSET
|
||||||
mailchimp_id: Union[Unset, str] = UNSET
|
mailchimp_id: Union[Unset, str] = UNSET
|
||||||
name: Union[Unset, str] = UNSET
|
name: Union[Unset, str] = UNSET
|
||||||
phone: Union[Unset, str] = UNSET
|
phone: Union[Unset, PhoneNumber] = UNSET
|
||||||
stripe_id: Union[Unset, str] = UNSET
|
stripe_id: Union[Unset, str] = UNSET
|
||||||
updated_at: Union[Unset, datetime.datetime] = UNSET
|
updated_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
zendesk_id: Union[Unset, str] = UNSET
|
zendesk_id: Union[Unset, str] = UNSET
|
||||||
@ -48,7 +49,9 @@ class ExtendedUser:
|
|||||||
last_name = self.last_name
|
last_name = self.last_name
|
||||||
mailchimp_id = self.mailchimp_id
|
mailchimp_id = self.mailchimp_id
|
||||||
name = self.name
|
name = self.name
|
||||||
phone = self.phone
|
phone: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.phone, Unset):
|
||||||
|
phone = self.phone.value
|
||||||
stripe_id = self.stripe_id
|
stripe_id = self.stripe_id
|
||||||
updated_at: Union[Unset, str] = UNSET
|
updated_at: Union[Unset, str] = UNSET
|
||||||
if not isinstance(self.updated_at, Unset):
|
if not isinstance(self.updated_at, Unset):
|
||||||
@ -130,7 +133,12 @@ class ExtendedUser:
|
|||||||
|
|
||||||
name = d.pop("name", UNSET)
|
name = d.pop("name", UNSET)
|
||||||
|
|
||||||
phone = d.pop("phone", UNSET)
|
_phone = d.pop("phone", UNSET)
|
||||||
|
phone: Union[Unset, PhoneNumber]
|
||||||
|
if isinstance(_phone, Unset):
|
||||||
|
phone = UNSET
|
||||||
|
else:
|
||||||
|
phone = PhoneNumber(_phone)
|
||||||
|
|
||||||
stripe_id = d.pop("stripe_id", UNSET)
|
stripe_id = d.pop("stripe_id", UNSET)
|
||||||
|
|
||||||
|
4
kittycad/models/phone_number.py
Normal file
4
kittycad/models/phone_number.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
class PhoneNumber(str):
|
||||||
|
|
||||||
|
def __str__(self) -> str:
|
||||||
|
return self
|
@ -2,6 +2,7 @@ from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
|||||||
|
|
||||||
import attr
|
import attr
|
||||||
|
|
||||||
|
from ..models.phone_number import PhoneNumber
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
T = TypeVar("T", bound="UpdateUser")
|
T = TypeVar("T", bound="UpdateUser")
|
||||||
@ -15,7 +16,7 @@ class UpdateUser:
|
|||||||
first_name: Union[Unset, str] = UNSET
|
first_name: Union[Unset, str] = UNSET
|
||||||
github: Union[Unset, str] = UNSET
|
github: Union[Unset, str] = UNSET
|
||||||
last_name: Union[Unset, str] = UNSET
|
last_name: Union[Unset, str] = UNSET
|
||||||
phone: Union[Unset, str] = UNSET
|
phone: Union[Unset, PhoneNumber] = UNSET
|
||||||
|
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
@ -25,7 +26,9 @@ class UpdateUser:
|
|||||||
first_name = self.first_name
|
first_name = self.first_name
|
||||||
github = self.github
|
github = self.github
|
||||||
last_name = self.last_name
|
last_name = self.last_name
|
||||||
phone = self.phone
|
phone: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.phone, Unset):
|
||||||
|
phone = self.phone.value
|
||||||
|
|
||||||
field_dict: Dict[str, Any] = {}
|
field_dict: Dict[str, Any] = {}
|
||||||
field_dict.update(self.additional_properties)
|
field_dict.update(self.additional_properties)
|
||||||
@ -58,7 +61,12 @@ class UpdateUser:
|
|||||||
|
|
||||||
last_name = d.pop("last_name", UNSET)
|
last_name = d.pop("last_name", UNSET)
|
||||||
|
|
||||||
phone = d.pop("phone", UNSET)
|
_phone = d.pop("phone", UNSET)
|
||||||
|
phone: Union[Unset, PhoneNumber]
|
||||||
|
if isinstance(_phone, Unset):
|
||||||
|
phone = UNSET
|
||||||
|
else:
|
||||||
|
phone = PhoneNumber(_phone)
|
||||||
|
|
||||||
update_user = cls(
|
update_user = cls(
|
||||||
company=company,
|
company=company,
|
||||||
|
@ -4,6 +4,7 @@ from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
|||||||
import attr
|
import attr
|
||||||
from dateutil.parser import isoparse
|
from dateutil.parser import isoparse
|
||||||
|
|
||||||
|
from ..models.phone_number import PhoneNumber
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
T = TypeVar("T", bound="User")
|
T = TypeVar("T", bound="User")
|
||||||
@ -23,7 +24,7 @@ class User:
|
|||||||
image: Union[Unset, str] = UNSET
|
image: Union[Unset, str] = UNSET
|
||||||
last_name: Union[Unset, str] = UNSET
|
last_name: Union[Unset, str] = UNSET
|
||||||
name: Union[Unset, str] = UNSET
|
name: Union[Unset, str] = UNSET
|
||||||
phone: Union[Unset, str] = UNSET
|
phone: Union[Unset, PhoneNumber] = UNSET
|
||||||
updated_at: Union[Unset, datetime.datetime] = UNSET
|
updated_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
|
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
@ -44,7 +45,9 @@ class User:
|
|||||||
image = self.image
|
image = self.image
|
||||||
last_name = self.last_name
|
last_name = self.last_name
|
||||||
name = self.name
|
name = self.name
|
||||||
phone = self.phone
|
phone: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.phone, Unset):
|
||||||
|
phone = self.phone.value
|
||||||
updated_at: Union[Unset, str] = UNSET
|
updated_at: Union[Unset, str] = UNSET
|
||||||
if not isinstance(self.updated_at, Unset):
|
if not isinstance(self.updated_at, Unset):
|
||||||
updated_at = self.updated_at.isoformat()
|
updated_at = self.updated_at.isoformat()
|
||||||
@ -116,7 +119,12 @@ class User:
|
|||||||
|
|
||||||
name = d.pop("name", UNSET)
|
name = d.pop("name", UNSET)
|
||||||
|
|
||||||
phone = d.pop("phone", UNSET)
|
_phone = d.pop("phone", UNSET)
|
||||||
|
phone: Union[Unset, PhoneNumber]
|
||||||
|
if isinstance(_phone, Unset):
|
||||||
|
phone = UNSET
|
||||||
|
else:
|
||||||
|
phone = PhoneNumber(_phone)
|
||||||
|
|
||||||
_updated_at = d.pop("updated_at", UNSET)
|
_updated_at = d.pop("updated_at", UNSET)
|
||||||
updated_at: Union[Unset, datetime.datetime]
|
updated_at: Union[Unset, datetime.datetime]
|
||||||
|
Reference in New Issue
Block a user