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
65 changes: 60 additions & 5 deletions robosystems_client/api/connections/delete_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,38 @@

from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.delete_connection_disposition import DeleteConnectionDisposition
from ...models.error_response import ErrorResponse
from ...models.http_validation_error import HTTPValidationError
from ...models.success_response import SuccessResponse
from ...types import Response
from ...types import UNSET, Response, Unset


def _get_kwargs(
graph_id: str,
connection_id: str,
*,
disposition: DeleteConnectionDisposition
| Unset = DeleteConnectionDisposition.DISCONNECT,
) -> dict[str, Any]:

params: dict[str, Any] = {}

json_disposition: str | Unset = UNSET
if not isinstance(disposition, Unset):
json_disposition = disposition.value

params["disposition"] = json_disposition

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

_kwargs: dict[str, Any] = {
"method": "delete",
"url": "/v1/graphs/{graph_id}/connections/{connection_id}".format(
graph_id=quote(str(graph_id), safe=""),
connection_id=quote(str(connection_id), safe=""),
),
"params": params,
}

return _kwargs
Expand Down Expand Up @@ -93,15 +108,24 @@ def sync_detailed(
connection_id: str,
*,
client: AuthenticatedClient,
disposition: DeleteConnectionDisposition
| Unset = DeleteConnectionDisposition.DISCONNECT,
) -> Response[ErrorResponse | HTTPValidationError | SuccessResponse]:
"""Delete Connection

Removes the connection and revokes credentials. Imported data is preserved in the graph. Requires
admin role.
admin role. `disposition=sever` (QuickBooks only) is the cutover to native books: the chart
QuickBooks created becomes the tenant's own and QuickBooks can never resume over it; the default
`disconnect` keeps the connection reconnectable.

Args:
graph_id (str):
connection_id (str): Connection identifier
disposition (DeleteConnectionDisposition | Unset): `disconnect` (default): soft-delete; a
later re-OAuth to the same realm revives the connection. `sever`: the native-accounting
cutover — QuickBooks only; the chart it created is stamped native-owned, write_policy
drops to native, and the connection is never revived. Default:
DeleteConnectionDisposition.DISCONNECT.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -114,6 +138,7 @@ def sync_detailed(
kwargs = _get_kwargs(
graph_id=graph_id,
connection_id=connection_id,
disposition=disposition,
)

response = client.get_httpx_client().request(
Expand All @@ -128,15 +153,24 @@ def sync(
connection_id: str,
*,
client: AuthenticatedClient,
disposition: DeleteConnectionDisposition
| Unset = DeleteConnectionDisposition.DISCONNECT,
) -> ErrorResponse | HTTPValidationError | SuccessResponse | None:
"""Delete Connection

Removes the connection and revokes credentials. Imported data is preserved in the graph. Requires
admin role.
admin role. `disposition=sever` (QuickBooks only) is the cutover to native books: the chart
QuickBooks created becomes the tenant's own and QuickBooks can never resume over it; the default
`disconnect` keeps the connection reconnectable.

Args:
graph_id (str):
connection_id (str): Connection identifier
disposition (DeleteConnectionDisposition | Unset): `disconnect` (default): soft-delete; a
later re-OAuth to the same realm revives the connection. `sever`: the native-accounting
cutover — QuickBooks only; the chart it created is stamped native-owned, write_policy
drops to native, and the connection is never revived. Default:
DeleteConnectionDisposition.DISCONNECT.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -150,6 +184,7 @@ def sync(
graph_id=graph_id,
connection_id=connection_id,
client=client,
disposition=disposition,
).parsed


Expand All @@ -158,15 +193,24 @@ async def asyncio_detailed(
connection_id: str,
*,
client: AuthenticatedClient,
disposition: DeleteConnectionDisposition
| Unset = DeleteConnectionDisposition.DISCONNECT,
) -> Response[ErrorResponse | HTTPValidationError | SuccessResponse]:
"""Delete Connection

Removes the connection and revokes credentials. Imported data is preserved in the graph. Requires
admin role.
admin role. `disposition=sever` (QuickBooks only) is the cutover to native books: the chart
QuickBooks created becomes the tenant's own and QuickBooks can never resume over it; the default
`disconnect` keeps the connection reconnectable.

Args:
graph_id (str):
connection_id (str): Connection identifier
disposition (DeleteConnectionDisposition | Unset): `disconnect` (default): soft-delete; a
later re-OAuth to the same realm revives the connection. `sever`: the native-accounting
cutover — QuickBooks only; the chart it created is stamped native-owned, write_policy
drops to native, and the connection is never revived. Default:
DeleteConnectionDisposition.DISCONNECT.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -179,6 +223,7 @@ async def asyncio_detailed(
kwargs = _get_kwargs(
graph_id=graph_id,
connection_id=connection_id,
disposition=disposition,
)

response = await client.get_async_httpx_client().request(**kwargs)
Expand All @@ -191,15 +236,24 @@ async def asyncio(
connection_id: str,
*,
client: AuthenticatedClient,
disposition: DeleteConnectionDisposition
| Unset = DeleteConnectionDisposition.DISCONNECT,
) -> ErrorResponse | HTTPValidationError | SuccessResponse | None:
"""Delete Connection

Removes the connection and revokes credentials. Imported data is preserved in the graph. Requires
admin role.
admin role. `disposition=sever` (QuickBooks only) is the cutover to native books: the chart
QuickBooks created becomes the tenant's own and QuickBooks can never resume over it; the default
`disconnect` keeps the connection reconnectable.

Args:
graph_id (str):
connection_id (str): Connection identifier
disposition (DeleteConnectionDisposition | Unset): `disconnect` (default): soft-delete; a
later re-OAuth to the same realm revives the connection. `sever`: the native-accounting
cutover — QuickBooks only; the chart it created is stamped native-owned, write_policy
drops to native, and the connection is never revived. Default:
DeleteConnectionDisposition.DISCONNECT.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -214,5 +268,6 @@ async def asyncio(
graph_id=graph_id,
connection_id=connection_id,
client=client,
disposition=disposition,
)
).parsed
Loading