Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions robosystems_client/api/connections/sync_connection.py
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.error_response import ErrorResponse
from ...models.http_validation_error import HTTPValidationError
from ...models.operation_envelope import OperationEnvelope
from ...models.sync_connection_request import SyncConnectionRequest
from ...types import UNSET, Response, Unset
Expand Down Expand Up @@ -42,7 +41,7 @@ def _get_kwargs(

def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Any | ErrorResponse | HTTPValidationError | OperationEnvelope | None:
) -> Any | ErrorResponse | OperationEnvelope | None:
if response.status_code == 202:
response_202 = OperationEnvelope.from_dict(response.json())

Expand Down Expand Up @@ -74,7 +73,7 @@ def _parse_response(
return response_409

if response.status_code == 422:
response_422 = HTTPValidationError.from_dict(response.json())
response_422 = ErrorResponse.from_dict(response.json())

return response_422

Expand All @@ -100,7 +99,7 @@ def _parse_response(

def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[Any | ErrorResponse | HTTPValidationError | OperationEnvelope]:
) -> Response[Any | ErrorResponse | OperationEnvelope]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -116,7 +115,7 @@ def sync_detailed(
client: AuthenticatedClient,
body: SyncConnectionRequest,
idempotency_key: None | str | Unset = UNSET,
) -> Response[Any | ErrorResponse | HTTPValidationError | OperationEnvelope]:
) -> Response[Any | ErrorResponse | OperationEnvelope]:
"""Sync Connection

SEC: downloads latest EDGAR filings (5-10 min). QuickBooks: fetches transactions, balances, and
Expand All @@ -134,7 +133,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Any | ErrorResponse | HTTPValidationError | OperationEnvelope]
Response[Any | ErrorResponse | OperationEnvelope]
"""

kwargs = _get_kwargs(
Expand All @@ -158,7 +157,7 @@ def sync(
client: AuthenticatedClient,
body: SyncConnectionRequest,
idempotency_key: None | str | Unset = UNSET,
) -> Any | ErrorResponse | HTTPValidationError | OperationEnvelope | None:
) -> Any | ErrorResponse | OperationEnvelope | None:
"""Sync Connection

SEC: downloads latest EDGAR filings (5-10 min). QuickBooks: fetches transactions, balances, and
Expand All @@ -176,7 +175,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Any | ErrorResponse | HTTPValidationError | OperationEnvelope
Any | ErrorResponse | OperationEnvelope
"""

return sync_detailed(
Expand All @@ -195,7 +194,7 @@ async def asyncio_detailed(
client: AuthenticatedClient,
body: SyncConnectionRequest,
idempotency_key: None | str | Unset = UNSET,
) -> Response[Any | ErrorResponse | HTTPValidationError | OperationEnvelope]:
) -> Response[Any | ErrorResponse | OperationEnvelope]:
"""Sync Connection

SEC: downloads latest EDGAR filings (5-10 min). QuickBooks: fetches transactions, balances, and
Expand All @@ -213,7 +212,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Any | ErrorResponse | HTTPValidationError | OperationEnvelope]
Response[Any | ErrorResponse | OperationEnvelope]
"""

kwargs = _get_kwargs(
Expand All @@ -235,7 +234,7 @@ async def asyncio(
client: AuthenticatedClient,
body: SyncConnectionRequest,
idempotency_key: None | str | Unset = UNSET,
) -> Any | ErrorResponse | HTTPValidationError | OperationEnvelope | None:
) -> Any | ErrorResponse | OperationEnvelope | None:
"""Sync Connection

SEC: downloads latest EDGAR filings (5-10 min). QuickBooks: fetches transactions, balances, and
Expand All @@ -253,7 +252,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Any | ErrorResponse | HTTPValidationError | OperationEnvelope
Any | ErrorResponse | OperationEnvelope
"""

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
from http import HTTPStatus
from typing import Any, cast
from typing import Any
from urllib.parse import quote

import httpx

from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.create_portfolio_block_request import CreatePortfolioBlockRequest
from ...models.http_validation_error import HTTPValidationError
from ...models.error_response import ErrorResponse
from ...models.operation_envelope_portfolio_block_envelope import (
OperationEnvelopePortfolioBlockEnvelope,
)
from ...models.operation_error import OperationError
from ...types import UNSET, Response, Unset


Expand Down Expand Up @@ -42,52 +41,50 @@ def _get_kwargs(

def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> (
Any
| HTTPValidationError
| OperationEnvelopePortfolioBlockEnvelope
| OperationError
| None
):
) -> ErrorResponse | OperationEnvelopePortfolioBlockEnvelope | None:
if response.status_code == 200:
response_200 = OperationEnvelopePortfolioBlockEnvelope.from_dict(response.json())

return response_200

if response.status_code == 400:
response_400 = OperationError.from_dict(response.json())
response_400 = ErrorResponse.from_dict(response.json())

return response_400

if response.status_code == 401:
response_401 = cast(Any, None)
response_401 = ErrorResponse.from_dict(response.json())

return response_401

if response.status_code == 403:
response_403 = cast(Any, None)
response_403 = ErrorResponse.from_dict(response.json())

return response_403

if response.status_code == 404:
response_404 = OperationError.from_dict(response.json())
response_404 = ErrorResponse.from_dict(response.json())

return response_404

if response.status_code == 409:
response_409 = OperationError.from_dict(response.json())
response_409 = ErrorResponse.from_dict(response.json())

return response_409

if response.status_code == 422:
response_422 = HTTPValidationError.from_dict(response.json())
response_422 = ErrorResponse.from_dict(response.json())

return response_422

if response.status_code == 429:
response_429 = cast(Any, None)
response_429 = ErrorResponse.from_dict(response.json())

return response_429

if response.status_code == 500:
response_500 = cast(Any, None)
response_500 = ErrorResponse.from_dict(response.json())

return response_500

if client.raise_on_unexpected_status:
Expand All @@ -98,9 +95,7 @@ def _parse_response(

def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[
Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError
]:
) -> Response[ErrorResponse | OperationEnvelopePortfolioBlockEnvelope]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -115,9 +110,7 @@ def sync_detailed(
client: AuthenticatedClient,
body: CreatePortfolioBlockRequest,
idempotency_key: None | str | Unset = UNSET,
) -> Response[
Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError
]:
) -> Response[ErrorResponse | OperationEnvelopePortfolioBlockEnvelope]:
"""Create Portfolio Block

Create a portfolio with optional initial positions in a single atomic envelope. Each position
Expand All @@ -142,7 +135,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError]
Response[ErrorResponse | OperationEnvelopePortfolioBlockEnvelope]
"""

kwargs = _get_kwargs(
Expand All @@ -164,13 +157,7 @@ def sync(
client: AuthenticatedClient,
body: CreatePortfolioBlockRequest,
idempotency_key: None | str | Unset = UNSET,
) -> (
Any
| HTTPValidationError
| OperationEnvelopePortfolioBlockEnvelope
| OperationError
| None
):
) -> ErrorResponse | OperationEnvelopePortfolioBlockEnvelope | None:
"""Create Portfolio Block

Create a portfolio with optional initial positions in a single atomic envelope. Each position
Expand All @@ -195,7 +182,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError
ErrorResponse | OperationEnvelopePortfolioBlockEnvelope
"""

return sync_detailed(
Expand All @@ -212,9 +199,7 @@ async def asyncio_detailed(
client: AuthenticatedClient,
body: CreatePortfolioBlockRequest,
idempotency_key: None | str | Unset = UNSET,
) -> Response[
Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError
]:
) -> Response[ErrorResponse | OperationEnvelopePortfolioBlockEnvelope]:
"""Create Portfolio Block

Create a portfolio with optional initial positions in a single atomic envelope. Each position
Expand All @@ -239,7 +224,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError]
Response[ErrorResponse | OperationEnvelopePortfolioBlockEnvelope]
"""

kwargs = _get_kwargs(
Expand All @@ -259,13 +244,7 @@ async def asyncio(
client: AuthenticatedClient,
body: CreatePortfolioBlockRequest,
idempotency_key: None | str | Unset = UNSET,
) -> (
Any
| HTTPValidationError
| OperationEnvelopePortfolioBlockEnvelope
| OperationError
| None
):
) -> ErrorResponse | OperationEnvelopePortfolioBlockEnvelope | None:
"""Create Portfolio Block

Create a portfolio with optional initial positions in a single atomic envelope. Each position
Expand All @@ -290,7 +269,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError
ErrorResponse | OperationEnvelopePortfolioBlockEnvelope
"""

return (
Expand Down
Loading
Loading