I have generated the latest API!

This commit is contained in:
github-actions[bot]
2022-07-08 00:56:43 +00:00
parent 3802dd36fc
commit 4623f854af
19 changed files with 9574 additions and 8364 deletions

View File

@ -3,6 +3,7 @@ from typing import Any, Dict, Optional, Union, cast
import httpx
from ...client import Client
from ...models.verification_token import VerificationToken
from ...models.error import Error
from ...models.email_authentication_form import EmailAuthenticationForm
from ...types import Response
@ -26,10 +27,10 @@ def _get_kwargs(
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]:
if response.status_code == 204:
response_204 = None
return response_204
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, VerificationToken, Error]]:
if response.status_code == 201:
response_201 = VerificationToken.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
@ -39,7 +40,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]:
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]:
def _build_response(*, response: httpx.Response) -> Response[Union[Any, VerificationToken, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
@ -52,7 +53,7 @@ def sync_detailed(
body: EmailAuthenticationForm,
*,
client: Client,
) -> Response[Union[Any, Error]]:
) -> Response[Union[Any, VerificationToken, Error]]:
kwargs = _get_kwargs(
body=body,
client=client,
@ -70,7 +71,7 @@ def sync(
body: EmailAuthenticationForm,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
) -> Optional[Union[Any, VerificationToken, Error]]:
return sync_detailed(
body=body,
@ -82,7 +83,7 @@ async def asyncio_detailed(
body: EmailAuthenticationForm,
*,
client: Client,
) -> Response[Union[Any, Error]]:
) -> Response[Union[Any, VerificationToken, Error]]:
kwargs = _get_kwargs(
body=body,
client=client,
@ -98,7 +99,7 @@ async def asyncio(
body: EmailAuthenticationForm,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
) -> Optional[Union[Any, VerificationToken, Error]]:
return (
await asyncio_detailed(

View File

@ -0,0 +1,101 @@
from typing import Any, Dict, Optional, Union, cast
import httpx
from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user".format(client.base_url)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]:
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It deletes the authenticated user from KittyCAD's database.
This call will only succeed if all invoices associated with the user have been paid in full and there is no outstanding balance. """
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It deletes the authenticated user from KittyCAD's database.
This call will only succeed if all invoices associated with the user have been paid in full and there is no outstanding balance. """
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -12,7 +12,6 @@ from .api_token_results_page import ApiTokenResultsPage
from .async_api_call import AsyncApiCall
from .async_api_call_results_page import AsyncApiCallResultsPage
from .async_api_call_type import AsyncApiCallType
from .base64_data import Base64Data
from .billing_info import BillingInfo
from .cache_metadata import CacheMetadata
from .card_details import CardDetails
@ -28,7 +27,6 @@ from .device_access_token_request_form import DeviceAccessTokenRequestForm
from .device_auth_request_form import DeviceAuthRequestForm
from .device_auth_verify_params import DeviceAuthVerifyParams
from .docker_system_info import DockerSystemInfo
from .duration import Duration
from .email_authentication_form import EmailAuthenticationForm
from .engine_metadata import EngineMetadata
from .environment import Environment
@ -48,7 +46,6 @@ from .index_info import IndexInfo
from .invoice import Invoice
from .invoice_line_item import InvoiceLineItem
from .invoice_status import InvoiceStatus
from .ip_addr import IpAddr
from .jetstream import Jetstream
from .jetstream_api_stats import JetstreamApiStats
from .jetstream_config import JetstreamConfig
@ -64,13 +61,11 @@ from .payment_intent import PaymentIntent
from .payment_method import PaymentMethod
from .payment_method_card_checks import PaymentMethodCardChecks
from .payment_method_type import PaymentMethodType
from .phone_number import PhoneNumber
from .plugins_info import PluginsInfo
from .pong import Pong
from .registry_service_config import RegistryServiceConfig
from .runtime import Runtime
from .session import Session
from .status_code import StatusCode
from .system_info_cgroup_driver_enum import SystemInfoCgroupDriverEnum
from .system_info_cgroup_version_enum import SystemInfoCgroupVersionEnum
from .system_info_default_address_pools import SystemInfoDefaultAddressPools
@ -81,3 +76,4 @@ from .update_user import UpdateUser
from .user import User
from .user_results_page import UserResultsPage
from .uuid import Uuid
from .verification_token import VerificationToken

View File

@ -4,11 +4,8 @@ from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from dateutil.parser import isoparse
from ..models.duration import Duration
from ..models.uuid import Uuid
from ..models.ip_addr import IpAddr
from ..models.method import Method
from ..models.status_code import StatusCode
from ..types import UNSET, Unset
T = TypeVar("T", bound="ApiCallWithPrice")
@ -19,11 +16,11 @@ class ApiCallWithPrice:
""" """
completed_at: Union[Unset, datetime.datetime] = UNSET
created_at: Union[Unset, datetime.datetime] = UNSET
duration: Union[Unset, Duration] = UNSET
duration: Union[Unset, int] = UNSET
email: Union[Unset, str] = UNSET
endpoint: Union[Unset, str] = UNSET
id: Union[Unset, str] = UNSET
ip_address: Union[Unset, IpAddr] = UNSET
ip_address: Union[Unset, str] = UNSET
method: Union[Unset, Method] = UNSET
minutes: Union[Unset, int] = UNSET
origin: Union[Unset, str] = UNSET
@ -32,7 +29,7 @@ class ApiCallWithPrice:
request_query_params: Union[Unset, str] = UNSET
response_body: Union[Unset, str] = UNSET
started_at: Union[Unset, datetime.datetime] = UNSET
status_code: Union[Unset, StatusCode] = UNSET
status_code: Union[Unset, int] = UNSET
stripe_invoice_item_id: Union[Unset, str] = UNSET
token: Union[Unset, str] = UNSET
updated_at: Union[Unset, datetime.datetime] = UNSET
@ -48,15 +45,11 @@ class ApiCallWithPrice:
created_at: Union[Unset, str] = UNSET
if not isinstance(self.created_at, Unset):
created_at = self.created_at.isoformat()
duration: Union[Unset, str] = UNSET
if not isinstance(self.duration, Unset):
duration = self.duration.value
duration = self.duration
email = self.email
endpoint = self.endpoint
id = self.id
ip_address: Union[Unset, str] = UNSET
if not isinstance(self.ip_address, Unset):
ip_address = self.ip_address.value
ip_address = self.ip_address
method: Union[Unset, str] = UNSET
if not isinstance(self.method, Unset):
method = self.method.value
@ -69,9 +62,7 @@ class ApiCallWithPrice:
started_at: Union[Unset, str] = UNSET
if not isinstance(self.started_at, Unset):
started_at = self.started_at.isoformat()
status_code: Union[Unset, str] = UNSET
if not isinstance(self.status_code, Unset):
status_code = self.status_code.value
status_code = self.status_code
stripe_invoice_item_id = self.stripe_invoice_item_id
token = self.token
updated_at: Union[Unset, str] = UNSET
@ -145,12 +136,7 @@ class ApiCallWithPrice:
else:
created_at = isoparse(_created_at)
_duration = d.pop("duration", UNSET)
duration: Union[Unset, Duration]
if isinstance(_duration, Unset):
duration = UNSET
else:
duration = Duration(_duration)
duration = d.pop("duration", UNSET)
email = d.pop("email", UNSET)
@ -158,12 +144,7 @@ class ApiCallWithPrice:
id = d.pop("id", UNSET)
_ip_address = d.pop("ip_address", UNSET)
ip_address: Union[Unset, IpAddr]
if isinstance(_ip_address, Unset):
ip_address = UNSET
else:
ip_address = IpAddr(_ip_address)
ip_address = d.pop("ip_address", UNSET)
_method = d.pop("method", UNSET)
method: Union[Unset, Method]
@ -191,12 +172,7 @@ class ApiCallWithPrice:
else:
started_at = isoparse(_started_at)
_status_code = d.pop("status_code", UNSET)
status_code: Union[Unset, StatusCode]
if isinstance(_status_code, Unset):
status_code = UNSET
else:
status_code = StatusCode(_status_code)
status_code = d.pop("status_code", UNSET)
stripe_invoice_item_id = d.pop("stripe_invoice_item_id", UNSET)

View File

@ -1,4 +0,0 @@
class Base64Data(str):
def __str__(self) -> str:
return self

View File

@ -3,7 +3,6 @@ from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from ..models.address import Address
from ..models.phone_number import PhoneNumber
from ..types import UNSET, Unset
T = TypeVar("T", bound="BillingInfo")
@ -14,7 +13,7 @@ class BillingInfo:
""" """
address: Union[Unset, Address] = UNSET
name: Union[Unset, str] = UNSET
phone: Union[Unset, PhoneNumber] = UNSET
phone: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
@ -23,9 +22,7 @@ class BillingInfo:
if not isinstance(self.address, Unset):
address = self.address.value
name = self.name
phone: Union[Unset, str] = UNSET
if not isinstance(self.phone, Unset):
phone = self.phone.value
phone = self.phone
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
@ -51,12 +48,7 @@ class BillingInfo:
name = d.pop("name", UNSET)
_phone = d.pop("phone", UNSET)
phone: Union[Unset, PhoneNumber]
if isinstance(_phone, Unset):
phone = UNSET
else:
phone = PhoneNumber(_phone)
phone = d.pop("phone", UNSET)
billing_info = cls(
address=address,

View File

@ -6,7 +6,6 @@ from dateutil.parser import isoparse
from ..models.address import Address
from ..models.currency import Currency
from ..models.phone_number import PhoneNumber
from ..types import UNSET, Unset
T = TypeVar("T", bound="Customer")
@ -16,7 +15,7 @@ T = TypeVar("T", bound="Customer")
class Customer:
""" """
address: Union[Unset, Address] = UNSET
balance: Union[Unset, int] = UNSET
balance: Union[Unset, float] = UNSET
created_at: Union[Unset, datetime.datetime] = UNSET
currency: Union[Unset, Currency] = UNSET
delinquent: Union[Unset, bool] = False
@ -24,7 +23,7 @@ class Customer:
id: Union[Unset, str] = UNSET
metadata: Union[Unset, Any] = UNSET
name: Union[Unset, str] = UNSET
phone: Union[Unset, PhoneNumber] = UNSET
phone: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
@ -44,9 +43,7 @@ class Customer:
id = self.id
metadata = self.metadata
name = self.name
phone: Union[Unset, str] = UNSET
if not isinstance(self.phone, Unset):
phone = self.phone.value
phone = self.phone
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
@ -109,12 +106,7 @@ class Customer:
metadata = d.pop("metadata", UNSET)
name = d.pop("name", UNSET)
_phone = d.pop("phone", UNSET)
phone: Union[Unset, PhoneNumber]
if isinstance(_phone, Unset):
phone = UNSET
else:
phone = PhoneNumber(_phone)
phone = d.pop("phone", UNSET)
customer = cls(
address=address,

View File

@ -1,4 +0,0 @@
class Duration(int):
def __int__(self) -> int:
return self

View File

@ -4,7 +4,6 @@ from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from dateutil.parser import isoparse
from ..models.phone_number import PhoneNumber
from ..types import UNSET, Unset
T = TypeVar("T", bound="ExtendedUser")
@ -25,7 +24,7 @@ class ExtendedUser:
last_name: Union[Unset, str] = UNSET
mailchimp_id: Union[Unset, str] = UNSET
name: Union[Unset, str] = UNSET
phone: Union[Unset, PhoneNumber] = UNSET
phone: Union[Unset, str] = UNSET
stripe_id: Union[Unset, str] = UNSET
updated_at: Union[Unset, datetime.datetime] = UNSET
zendesk_id: Union[Unset, str] = UNSET
@ -49,9 +48,7 @@ class ExtendedUser:
last_name = self.last_name
mailchimp_id = self.mailchimp_id
name = self.name
phone: Union[Unset, str] = UNSET
if not isinstance(self.phone, Unset):
phone = self.phone.value
phone = self.phone
stripe_id = self.stripe_id
updated_at: Union[Unset, str] = UNSET
if not isinstance(self.updated_at, Unset):
@ -133,12 +130,7 @@ class ExtendedUser:
name = d.pop("name", UNSET)
_phone = d.pop("phone", UNSET)
phone: Union[Unset, PhoneNumber]
if isinstance(_phone, Unset):
phone = UNSET
else:
phone = PhoneNumber(_phone)
phone = d.pop("phone", UNSET)
stripe_id = d.pop("stripe_id", UNSET)

View File

@ -5,7 +5,6 @@ import attr
from dateutil.parser import isoparse
from ..models.uuid import Uuid
from ..models.base64_data import Base64Data
from ..models.file_output_format import FileOutputFormat
from ..models.file_source_format import FileSourceFormat
from ..models.api_call_status import ApiCallStatus
@ -21,7 +20,7 @@ class FileConversion:
created_at: Union[Unset, datetime.datetime] = UNSET
error: Union[Unset, str] = UNSET
id: Union[Unset, str] = UNSET
output: Union[Unset, Base64Data] = UNSET
output: Union[Unset, str] = UNSET
output_format: Union[Unset, FileOutputFormat] = UNSET
src_format: Union[Unset, FileSourceFormat] = UNSET
started_at: Union[Unset, datetime.datetime] = UNSET
@ -40,9 +39,7 @@ class FileConversion:
created_at = self.created_at.isoformat()
error = self.error
id = self.id
output: Union[Unset, str] = UNSET
if not isinstance(self.output, Unset):
output = self.output.value
output = self.output
output_format: Union[Unset, str] = UNSET
if not isinstance(self.output_format, Unset):
output_format = self.output_format.value
@ -109,12 +106,7 @@ class FileConversion:
id = d.pop("id", UNSET)
_output = d.pop("output", UNSET)
output: Union[Unset, Base64Data]
if isinstance(_output, Unset):
output = UNSET
else:
output = Base64Data(_output)
output = d.pop("output", UNSET)
_output_format = d.pop("output_format", UNSET)
output_format: Union[Unset, FileOutputFormat]

View File

@ -14,9 +14,9 @@ T = TypeVar("T", bound="Invoice")
@attr.s(auto_attribs=True)
class Invoice:
""" """
amount_due: Union[Unset, int] = UNSET
amount_paid: Union[Unset, int] = UNSET
amount_remaining: Union[Unset, int] = UNSET
amount_due: Union[Unset, float] = UNSET
amount_paid: Union[Unset, float] = UNSET
amount_remaining: Union[Unset, float] = UNSET
attempt_count: Union[Unset, int] = UNSET
attempted: Union[Unset, bool] = False
created_at: Union[Unset, datetime.datetime] = UNSET
@ -35,9 +35,9 @@ class Invoice:
receipt_number: Union[Unset, str] = UNSET
statement_descriptor: Union[Unset, str] = UNSET
status: Union[Unset, InvoiceStatus] = UNSET
subtotal: Union[Unset, int] = UNSET
tax: Union[Unset, int] = UNSET
total: Union[Unset, int] = UNSET
subtotal: Union[Unset, float] = UNSET
tax: Union[Unset, float] = UNSET
total: Union[Unset, float] = UNSET
url: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

View File

@ -11,7 +11,7 @@ T = TypeVar("T", bound="InvoiceLineItem")
@attr.s(auto_attribs=True)
class InvoiceLineItem:
""" """
amount: Union[Unset, int] = UNSET
amount: Union[Unset, float] = UNSET
currency: Union[Unset, Currency] = UNSET
description: Union[Unset, str] = UNSET
id: Union[Unset, str] = UNSET

View File

@ -1,4 +0,0 @@
class IpAddr(str):
def __str__(self) -> str:
return self

View File

@ -1,4 +0,0 @@
class PhoneNumber(str):
def __str__(self) -> str:
return self

View File

@ -1,4 +0,0 @@
class StatusCode(int):
def __int__(self) -> int:
return self

View File

@ -2,7 +2,6 @@ from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from ..models.phone_number import PhoneNumber
from ..types import UNSET, Unset
T = TypeVar("T", bound="UpdateUser")
@ -16,7 +15,7 @@ class UpdateUser:
first_name: Union[Unset, str] = UNSET
github: Union[Unset, str] = UNSET
last_name: Union[Unset, str] = UNSET
phone: Union[Unset, PhoneNumber] = UNSET
phone: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
@ -26,9 +25,7 @@ class UpdateUser:
first_name = self.first_name
github = self.github
last_name = self.last_name
phone: Union[Unset, str] = UNSET
if not isinstance(self.phone, Unset):
phone = self.phone.value
phone = self.phone
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
@ -61,12 +58,7 @@ class UpdateUser:
last_name = d.pop("last_name", UNSET)
_phone = d.pop("phone", UNSET)
phone: Union[Unset, PhoneNumber]
if isinstance(_phone, Unset):
phone = UNSET
else:
phone = PhoneNumber(_phone)
phone = d.pop("phone", UNSET)
update_user = cls(
company=company,

View File

@ -4,7 +4,6 @@ from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from dateutil.parser import isoparse
from ..models.phone_number import PhoneNumber
from ..types import UNSET, Unset
T = TypeVar("T", bound="User")
@ -24,7 +23,7 @@ class User:
image: Union[Unset, str] = UNSET
last_name: Union[Unset, str] = UNSET
name: Union[Unset, str] = UNSET
phone: Union[Unset, PhoneNumber] = UNSET
phone: Union[Unset, str] = UNSET
updated_at: Union[Unset, datetime.datetime] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
@ -45,9 +44,7 @@ class User:
image = self.image
last_name = self.last_name
name = self.name
phone: Union[Unset, str] = UNSET
if not isinstance(self.phone, Unset):
phone = self.phone.value
phone = self.phone
updated_at: Union[Unset, str] = UNSET
if not isinstance(self.updated_at, Unset):
updated_at = self.updated_at.isoformat()
@ -119,12 +116,7 @@ class User:
name = d.pop("name", UNSET)
_phone = d.pop("phone", UNSET)
phone: Union[Unset, PhoneNumber]
if isinstance(_phone, Unset):
phone = UNSET
else:
phone = PhoneNumber(_phone)
phone = d.pop("phone", UNSET)
_updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime]

View File

@ -0,0 +1,105 @@
import datetime
from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from dateutil.parser import isoparse
from ..types import UNSET, Unset
T = TypeVar("T", bound="VerificationToken")
@attr.s(auto_attribs=True)
class VerificationToken:
""" """
created_at: Union[Unset, datetime.datetime] = UNSET
expires: Union[Unset, datetime.datetime] = UNSET
id: Union[Unset, str] = UNSET
identifier: Union[Unset, str] = UNSET
updated_at: Union[Unset, datetime.datetime] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
created_at: Union[Unset, str] = UNSET
if not isinstance(self.created_at, Unset):
created_at = self.created_at.isoformat()
expires: Union[Unset, str] = UNSET
if not isinstance(self.expires, Unset):
expires = self.expires.isoformat()
id = self.id
identifier = self.identifier
updated_at: Union[Unset, str] = UNSET
if not isinstance(self.updated_at, Unset):
updated_at = self.updated_at.isoformat()
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if created_at is not UNSET:
field_dict['created_at'] = created_at
if expires is not UNSET:
field_dict['expires'] = expires
if id is not UNSET:
field_dict['id'] = id
if identifier is not UNSET:
field_dict['identifier'] = identifier
if updated_at is not UNSET:
field_dict['updated_at'] = updated_at
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
_created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime]
if isinstance(_created_at, Unset):
created_at = UNSET
else:
created_at = isoparse(_created_at)
_expires = d.pop("expires", UNSET)
expires: Union[Unset, datetime.datetime]
if isinstance(_expires, Unset):
expires = UNSET
else:
expires = isoparse(_expires)
id = d.pop("id", UNSET)
identifier = d.pop("identifier", UNSET)
_updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime]
if isinstance(_updated_at, Unset):
updated_at = UNSET
else:
updated_at = isoparse(_updated_at)
verification_token = cls(
created_at=created_at,
expires=expires,
id=id,
identifier=identifier,
updated_at=updated_at,
)
verification_token.additional_properties = d
return verification_token
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

1615
spec.json

File diff suppressed because it is too large Load Diff