Skip to content

Commit

Permalink
new client for new openapi spec v241023
Browse files Browse the repository at this point in the history
  • Loading branch information
lua authored and lua committed Oct 24, 2024
1 parent 1f5ff6b commit abfc2dc
Show file tree
Hide file tree
Showing 62 changed files with 116,823 additions and 272 deletions.
9,502 changes: 9,502 additions & 0 deletions openapi_specs/latest/openapi-v241023-MAJOR-manually-fixed-trimmed-down.json

Large diffs are not rendered by default.

53,514 changes: 53,514 additions & 0 deletions openapi_specs/latest/openapi-v241023-MAJOR-manually-fixed.json

Large diffs are not rendered by default.

53,521 changes: 53,521 additions & 0 deletions openapi_specs/latest/openapi-v241023-MAJOR.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.app_store_purchase import AppStorePurchase
from ...models.app_store_purchase_list import AppStorePurchaseList
from ...models.apple_app_store_purchase_addition import AppleAppStorePurchaseAddition
from ...models.error_result import ErrorResult
Expand Down Expand Up @@ -42,31 +41,9 @@ def _get_kwargs(

def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[Union[ErrorResult, ErrorResultBase, Union["AppStorePurchase", "AppStorePurchaseList"]]]:
) -> Optional[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]]:
if response.status_code == HTTPStatus.CREATED:

def _parse_response_201(data: object) -> Union["AppStorePurchase", "AppStorePurchaseList"]:
# Try to parse the data as AppStorePurchase
try:
if not isinstance(data, dict):
raise TypeError()
response_201_type_0 = AppStorePurchase.from_dict(data)

return response_201_type_0
except: # noqa: E722
pass

# In order to parse the one remaining property in the union,
# data must be a dict
if not isinstance(data, dict):
raise TypeError()

# Finally, parse the data as AppStorePurchaseList
response_201_type_1 = AppStorePurchaseList.from_dict(data)

return response_201_type_1

response_201 = _parse_response_201(response.json())
response_201 = AppStorePurchaseList.from_dict(response.json())

return response_201
if response.status_code == HTTPStatus.BAD_REQUEST:
Expand Down Expand Up @@ -97,7 +74,7 @@ def _parse_response_201(data: object) -> Union["AppStorePurchase", "AppStorePurc

def _build_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Response[Union[ErrorResult, ErrorResultBase, Union["AppStorePurchase", "AppStorePurchaseList"]]]:
) -> Response[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -115,7 +92,7 @@ def sync_detailed(
*,
client: AuthenticatedClient,
body: AppleAppStorePurchaseAddition,
) -> Response[Union[ErrorResult, ErrorResultBase, Union["AppStorePurchase", "AppStorePurchaseList"]]]:
) -> Response[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]]:
"""Add Apple purchase
Add an Apple app store purchase to the plenigo system and retrieve a token for further processing.
Expand All @@ -128,7 +105,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Union[ErrorResult, ErrorResultBase, Union['AppStorePurchase', 'AppStorePurchaseList']]]
Response[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]]
"""

kwargs = _get_kwargs(
Expand All @@ -146,7 +123,7 @@ def sync(
*,
client: AuthenticatedClient,
body: AppleAppStorePurchaseAddition,
) -> Optional[Union[ErrorResult, ErrorResultBase, Union["AppStorePurchase", "AppStorePurchaseList"]]]:
) -> Optional[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]]:
"""Add Apple purchase
Add an Apple app store purchase to the plenigo system and retrieve a token for further processing.
Expand All @@ -159,7 +136,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[ErrorResult, ErrorResultBase, Union['AppStorePurchase', 'AppStorePurchaseList']]
Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]
"""

return sync_detailed(
Expand All @@ -177,7 +154,7 @@ async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: AppleAppStorePurchaseAddition,
) -> Response[Union[ErrorResult, ErrorResultBase, Union["AppStorePurchase", "AppStorePurchaseList"]]]:
) -> Response[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]]:
"""Add Apple purchase
Add an Apple app store purchase to the plenigo system and retrieve a token for further processing.
Expand All @@ -190,7 +167,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Union[ErrorResult, ErrorResultBase, Union['AppStorePurchase', 'AppStorePurchaseList']]]
Response[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]]
"""

kwargs = _get_kwargs(
Expand All @@ -206,7 +183,7 @@ async def asyncio(
*,
client: AuthenticatedClient,
body: AppleAppStorePurchaseAddition,
) -> Optional[Union[ErrorResult, ErrorResultBase, Union["AppStorePurchase", "AppStorePurchaseList"]]]:
) -> Optional[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]]:
"""Add Apple purchase
Add an Apple app store purchase to the plenigo system and retrieve a token for further processing.
Expand All @@ -219,7 +196,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[ErrorResult, ErrorResultBase, Union['AppStorePurchase', 'AppStorePurchaseList']]
Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]
"""

return (
Expand Down
24 changes: 24 additions & 0 deletions plenigo-client/plenigo/api/invoices/search_invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from ...models.error_result import ErrorResult
from ...models.error_result_base import ErrorResultBase
from ...models.invoices import Invoices
from ...models.search_invoices_invoice_type import SearchInvoicesInvoiceType
from ...models.search_invoices_sort import SearchInvoicesSort
from ...types import UNSET, Response, Unset

Expand All @@ -28,6 +29,7 @@ def _get_kwargs(
order_id: Union[Unset, int] = UNSET,
subscription_item_id: Union[Unset, int] = UNSET,
filter_by_invoice_date: Union[Unset, bool] = UNSET,
invoice_type: Union[Unset, SearchInvoicesInvoiceType] = UNSET,
) -> Dict[str, Any]:
params: Dict[str, Any] = {}

Expand Down Expand Up @@ -59,6 +61,12 @@ def _get_kwargs(

params["filterByInvoiceDate"] = filter_by_invoice_date

json_invoice_type: Union[Unset, str] = UNSET
if not isinstance(invoice_type, Unset):
json_invoice_type = invoice_type.value

params["invoiceType"] = json_invoice_type

params = {k: v for k, v in params.items() if v is not UNSET and v is not None}

_kwargs: Dict[str, Any] = {
Expand Down Expand Up @@ -128,6 +136,7 @@ def sync_all(
order_id: Union[Unset, int] = UNSET,
subscription_item_id: Union[Unset, int] = UNSET,
filter_by_invoice_date: Union[Unset, bool] = UNSET,
invoice_type: Union[Unset, SearchInvoicesInvoiceType] = UNSET,
) -> Optional[Union[ErrorResult, ErrorResultBase, Invoices]]:
all_results = Invoices(items=[])
# type: ignore
Expand All @@ -145,6 +154,7 @@ def sync_all(
order_id=order_id,
subscription_item_id=subscription_item_id,
filter_by_invoice_date=filter_by_invoice_date,
invoice_type=invoice_type,
).parsed

if results and not isinstance(results, ErrorResultBase) and not isinstance(results.items, Unset):
Expand Down Expand Up @@ -181,6 +191,7 @@ def sync_detailed(
order_id: Union[Unset, int] = UNSET,
subscription_item_id: Union[Unset, int] = UNSET,
filter_by_invoice_date: Union[Unset, bool] = UNSET,
invoice_type: Union[Unset, SearchInvoicesInvoiceType] = UNSET,
) -> Response[Union[ErrorResult, ErrorResultBase, Invoices]]:
"""Search
Expand All @@ -196,6 +207,7 @@ def sync_detailed(
order_id (Union[Unset, int]):
subscription_item_id (Union[Unset, int]):
filter_by_invoice_date (Union[Unset, bool]):
invoice_type (Union[Unset, SearchInvoicesInvoiceType]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -215,6 +227,7 @@ def sync_detailed(
order_id=order_id,
subscription_item_id=subscription_item_id,
filter_by_invoice_date=filter_by_invoice_date,
invoice_type=invoice_type,
)

response = client.get_httpx_client().request(
Expand All @@ -236,6 +249,7 @@ def sync(
order_id: Union[Unset, int] = UNSET,
subscription_item_id: Union[Unset, int] = UNSET,
filter_by_invoice_date: Union[Unset, bool] = UNSET,
invoice_type: Union[Unset, SearchInvoicesInvoiceType] = UNSET,
) -> Optional[Union[ErrorResult, ErrorResultBase, Invoices]]:
"""Search
Expand All @@ -251,6 +265,7 @@ def sync(
order_id (Union[Unset, int]):
subscription_item_id (Union[Unset, int]):
filter_by_invoice_date (Union[Unset, bool]):
invoice_type (Union[Unset, SearchInvoicesInvoiceType]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -271,6 +286,7 @@ def sync(
order_id=order_id,
subscription_item_id=subscription_item_id,
filter_by_invoice_date=filter_by_invoice_date,
invoice_type=invoice_type,
).parsed


Expand All @@ -291,6 +307,7 @@ async def asyncio_detailed(
order_id: Union[Unset, int] = UNSET,
subscription_item_id: Union[Unset, int] = UNSET,
filter_by_invoice_date: Union[Unset, bool] = UNSET,
invoice_type: Union[Unset, SearchInvoicesInvoiceType] = UNSET,
) -> Response[Union[ErrorResult, ErrorResultBase, Invoices]]:
"""Search
Expand All @@ -306,6 +323,7 @@ async def asyncio_detailed(
order_id (Union[Unset, int]):
subscription_item_id (Union[Unset, int]):
filter_by_invoice_date (Union[Unset, bool]):
invoice_type (Union[Unset, SearchInvoicesInvoiceType]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -325,6 +343,7 @@ async def asyncio_detailed(
order_id=order_id,
subscription_item_id=subscription_item_id,
filter_by_invoice_date=filter_by_invoice_date,
invoice_type=invoice_type,
)

response = await client.get_async_httpx_client().request(**kwargs)
Expand All @@ -344,6 +363,7 @@ async def asyncio_all(
order_id: Union[Unset, int] = UNSET,
subscription_item_id: Union[Unset, int] = UNSET,
filter_by_invoice_date: Union[Unset, bool] = UNSET,
invoice_type: Union[Unset, SearchInvoicesInvoiceType] = UNSET,
) -> Response[Union[ErrorResult, ErrorResultBase, Invoices]]:
all_results = Invoices(items=[])
# type: ignore
Expand All @@ -362,6 +382,7 @@ async def asyncio_all(
order_id=order_id,
subscription_item_id=subscription_item_id,
filter_by_invoice_date=filter_by_invoice_date,
invoice_type=invoice_type,
)
).parsed

Expand Down Expand Up @@ -394,6 +415,7 @@ async def asyncio(
order_id: Union[Unset, int] = UNSET,
subscription_item_id: Union[Unset, int] = UNSET,
filter_by_invoice_date: Union[Unset, bool] = UNSET,
invoice_type: Union[Unset, SearchInvoicesInvoiceType] = UNSET,
) -> Optional[Union[ErrorResult, ErrorResultBase, Invoices]]:
"""Search
Expand All @@ -409,6 +431,7 @@ async def asyncio(
order_id (Union[Unset, int]):
subscription_item_id (Union[Unset, int]):
filter_by_invoice_date (Union[Unset, bool]):
invoice_type (Union[Unset, SearchInvoicesInvoiceType]):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -430,5 +453,6 @@ async def asyncio(
order_id=order_id,
subscription_item_id=subscription_item_id,
filter_by_invoice_date=filter_by_invoice_date,
invoice_type=invoice_type,
)
).parsed
2 changes: 2 additions & 0 deletions plenigo-client/plenigo/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
from .search_apple_app_store_purchases_sort import SearchAppleAppStorePurchasesSort
from .search_customers_sort import SearchCustomersSort
from .search_google_play_store_purchases_sort import SearchGooglePlayStorePurchasesSort
from .search_invoices_invoice_type import SearchInvoicesInvoiceType
from .search_invoices_sort import SearchInvoicesSort
from .search_orders_sort import SearchOrdersSort
from .search_product_offers_sort import SearchProductOffersSort
Expand Down Expand Up @@ -395,6 +396,7 @@
"SearchAppStoreOrdersSort",
"SearchCustomersSort",
"SearchGooglePlayStorePurchasesSort",
"SearchInvoicesInvoiceType",
"SearchInvoicesSort",
"SearchOrdersSort",
"SearchProductOffersSort",
Expand Down
8 changes: 4 additions & 4 deletions plenigo-client/plenigo/models/additional_order_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ def _parse_created_date(data: object) -> Union[None, Unset, datetime.datetime]:
try:
if not isinstance(data, str):
raise TypeError()
created_date_type_1 = isoparse(data)
created_date_type_0 = isoparse(data)

return created_date_type_1
return created_date_type_0
except: # noqa: E722
pass

Expand All @@ -137,9 +137,9 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]:
try:
if not isinstance(data, str):
raise TypeError()
changed_date_type_1 = isoparse(data)
changed_date_type_0 = isoparse(data)

return changed_date_type_1
return changed_date_type_0
except: # noqa: E722
pass

Expand Down
8 changes: 4 additions & 4 deletions plenigo-client/plenigo/models/api_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ def _parse_created_date(data: object) -> Union[None, Unset, datetime.datetime]:
try:
if not isinstance(data, str):
raise TypeError()
created_date_type_1 = isoparse(data)
created_date_type_0 = isoparse(data)

return created_date_type_1
return created_date_type_0
except: # noqa: E722
pass

Expand All @@ -125,9 +125,9 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]:
try:
if not isinstance(data, str):
raise TypeError()
changed_date_type_1 = isoparse(data)
changed_date_type_0 = isoparse(data)

return changed_date_type_1
return changed_date_type_0
except: # noqa: E722
pass

Expand Down
8 changes: 4 additions & 4 deletions plenigo-client/plenigo/models/api_base_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def _parse_created_date(data: object) -> Union[None, Unset, datetime.datetime]:
try:
if not isinstance(data, str):
raise TypeError()
created_date_type_1 = isoparse(data)
created_date_type_0 = isoparse(data)

return created_date_type_1
return created_date_type_0
except: # noqa: E722
pass

Expand All @@ -95,9 +95,9 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]:
try:
if not isinstance(data, str):
raise TypeError()
changed_date_type_1 = isoparse(data)
changed_date_type_0 = isoparse(data)

return changed_date_type_1
return changed_date_type_0
except: # noqa: E722
pass

Expand Down
8 changes: 4 additions & 4 deletions plenigo-client/plenigo/models/api_campaign_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ def _parse_created_date(data: object) -> Union[None, Unset, datetime.datetime]:
try:
if not isinstance(data, str):
raise TypeError()
created_date_type_1 = isoparse(data)
created_date_type_0 = isoparse(data)

return created_date_type_1
return created_date_type_0
except: # noqa: E722
pass

Expand All @@ -206,9 +206,9 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]:
try:
if not isinstance(data, str):
raise TypeError()
changed_date_type_1 = isoparse(data)
changed_date_type_0 = isoparse(data)

return changed_date_type_1
return changed_date_type_0
except: # noqa: E722
pass

Expand Down
Loading

0 comments on commit abfc2dc

Please sign in to comment.