"""Typed TA API groups. Generated by scripts/generate_typed_ta_groups.py. Do not edit by hand."""

from __future__ import annotations

from typing import Any

from stax_sdk.ta._generated.stax_ta_client.models.document_archive_body import DocumentArchiveBody
from stax_sdk.ta._generated.stax_ta_client.models.document_copy_body import DocumentCopyBody
from stax_sdk.ta._generated.stax_ta_client.models.document_copy_response_200 import (
    DocumentCopyResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.document_create_body import DocumentCreateBody
from stax_sdk.ta._generated.stax_ta_client.models.document_create_response_200 import (
    DocumentCreateResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.document_duplicates_response_200 import (
    DocumentDuplicatesResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.document_get_response_200 import (
    DocumentGetResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.document_jobs_response_200 import (
    DocumentJobsResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.document_move_body import DocumentMoveBody
from stax_sdk.ta._generated.stax_ta_client.models.document_recent_response_200 import (
    DocumentRecentResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.document_remove_body import DocumentRemoveBody
from stax_sdk.ta._generated.stax_ta_client.models.document_restore_body import DocumentRestoreBody
from stax_sdk.ta._generated.stax_ta_client.models.document_search_sort_by import (
    DocumentSearchSortBy,
)
from stax_sdk.ta._generated.stax_ta_client.models.document_update_body import DocumentUpdateBody
from stax_sdk.ta._generated.stax_ta_client.models.document_upload_body import DocumentUploadBody
from stax_sdk.ta._generated.stax_ta_client.models.document_upload_response_200 import (
    DocumentUploadResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.error import Error
from stax_sdk.ta._generated.stax_ta_client.models.search_result import SearchResult
from stax_sdk.ta._generated.stax_ta_client.models.stack_all_response_200 import StackAllResponse200
from stax_sdk.ta._generated.stax_ta_client.models.stack_create_body import StackCreateBody
from stax_sdk.ta._generated.stax_ta_client.models.stack_create_response_200 import (
    StackCreateResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.stack_get_response_200 import StackGetResponse200
from stax_sdk.ta._generated.stax_ta_client.models.stack_list_dir import StackListDir
from stax_sdk.ta._generated.stax_ta_client.models.stack_list_response_200 import (
    StackListResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.stack_remove_body import StackRemoveBody
from stax_sdk.ta._generated.stax_ta_client.models.stack_update_body import StackUpdateBody
from stax_sdk.ta._generated.stax_ta_client.models.success_response import SuccessResponse
from stax_sdk.ta._generated.stax_ta_client.models.tpa_account_create_body import (
    TpaAccountCreateBody,
)
from stax_sdk.ta._generated.stax_ta_client.models.tpa_account_create_response_200 import (
    TpaAccountCreateResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.tpa_account_get_response_200 import (
    TpaAccountGetResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.tpa_account_list_response_200 import (
    TpaAccountListResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.tpa_plan_create_body import TpaPlanCreateBody
from stax_sdk.ta._generated.stax_ta_client.models.tpa_plan_create_response_200 import (
    TpaPlanCreateResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.tpa_plan_get_response_200 import (
    TpaPlanGetResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.tpa_plan_list_response_200 import (
    TpaPlanListResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.tpa_statement_attach_body import (
    TpaStatementAttachBody,
)
from stax_sdk.ta._generated.stax_ta_client.models.tpa_statement_attach_response_200 import (
    TpaStatementAttachResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.tpa_statement_confirm_body import (
    TpaStatementConfirmBody,
)
from stax_sdk.ta._generated.stax_ta_client.models.tpa_statement_list_response_200 import (
    TpaStatementListResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.tpa_transaction_create_body import (
    TpaTransactionCreateBody,
)
from stax_sdk.ta._generated.stax_ta_client.models.tpa_transaction_create_response_200 import (
    TpaTransactionCreateResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.models.tpa_transaction_list_response_200 import (
    TpaTransactionListResponse200,
)
from stax_sdk.ta._generated.stax_ta_client.types import Unset, UNSET, File

from stax_sdk.ta._generated.stax_ta_client.api.document.document_archive import (
    asyncio as _async_document_archive,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_archive import (
    sync as _sync_document_archive,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_copy import (
    asyncio as _async_document_copy,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_copy import (
    sync as _sync_document_copy,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_create import (
    asyncio as _async_document_create,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_create import (
    sync as _sync_document_create,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_download import (
    asyncio as _async_document_download,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_download import (
    sync as _sync_document_download,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_duplicates import (
    asyncio as _async_document_duplicates,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_duplicates import (
    sync as _sync_document_duplicates,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_get import (
    asyncio as _async_document_get,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_get import (
    sync as _sync_document_get,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_jobs import (
    asyncio as _async_document_jobs,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_jobs import (
    sync as _sync_document_jobs,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_move import (
    asyncio as _async_document_move,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_move import (
    sync as _sync_document_move,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_recent import (
    asyncio as _async_document_recent,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_recent import (
    sync as _sync_document_recent,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_remove import (
    asyncio as _async_document_remove,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_remove import (
    sync as _sync_document_remove,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_restore import (
    asyncio as _async_document_restore,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_restore import (
    sync as _sync_document_restore,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_search import (
    asyncio as _async_document_search,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_search import (
    sync as _sync_document_search,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_search_archive import (
    asyncio as _async_document_search_archive,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_search_archive import (
    sync as _sync_document_search_archive,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_update import (
    asyncio as _async_document_update,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_update import (
    sync as _sync_document_update,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_upload import (
    asyncio as _async_document_upload,
)
from stax_sdk.ta._generated.stax_ta_client.api.document.document_upload import (
    sync as _sync_document_upload,
)
from stax_sdk.ta._generated.stax_ta_client.api.stack.stack_all import asyncio as _async_stack_all
from stax_sdk.ta._generated.stax_ta_client.api.stack.stack_all import sync as _sync_stack_all
from stax_sdk.ta._generated.stax_ta_client.api.stack.stack_create import (
    asyncio as _async_stack_create,
)
from stax_sdk.ta._generated.stax_ta_client.api.stack.stack_create import sync as _sync_stack_create
from stax_sdk.ta._generated.stax_ta_client.api.stack.stack_get import asyncio as _async_stack_get
from stax_sdk.ta._generated.stax_ta_client.api.stack.stack_get import sync as _sync_stack_get
from stax_sdk.ta._generated.stax_ta_client.api.stack.stack_list import asyncio as _async_stack_list
from stax_sdk.ta._generated.stax_ta_client.api.stack.stack_list import sync as _sync_stack_list
from stax_sdk.ta._generated.stax_ta_client.api.stack.stack_remove import (
    asyncio as _async_stack_remove,
)
from stax_sdk.ta._generated.stax_ta_client.api.stack.stack_remove import sync as _sync_stack_remove
from stax_sdk.ta._generated.stax_ta_client.api.stack.stack_update import (
    asyncio as _async_stack_update,
)
from stax_sdk.ta._generated.stax_ta_client.api.stack.stack_update import sync as _sync_stack_update
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_account_create import (
    asyncio as _async_tpa_account_create,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_account_create import (
    sync as _sync_tpa_account_create,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_account_get import (
    asyncio as _async_tpa_account_get,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_account_get import (
    sync as _sync_tpa_account_get,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_account_list import (
    asyncio as _async_tpa_account_list,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_account_list import (
    sync as _sync_tpa_account_list,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_plan_create import (
    asyncio as _async_tpa_plan_create,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_plan_create import (
    sync as _sync_tpa_plan_create,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_plan_get import (
    asyncio as _async_tpa_plan_get,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_plan_get import sync as _sync_tpa_plan_get
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_plan_list import (
    asyncio as _async_tpa_plan_list,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_plan_list import sync as _sync_tpa_plan_list
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_statement_attach import (
    asyncio as _async_tpa_statement_attach,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_statement_attach import (
    sync as _sync_tpa_statement_attach,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_statement_confirm import (
    asyncio as _async_tpa_statement_confirm,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_statement_confirm import (
    sync as _sync_tpa_statement_confirm,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_statement_list import (
    asyncio as _async_tpa_statement_list,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_statement_list import (
    sync as _sync_tpa_statement_list,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_transaction_create import (
    asyncio as _async_tpa_transaction_create,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_transaction_create import (
    sync as _sync_tpa_transaction_create,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_transaction_list import (
    asyncio as _async_tpa_transaction_list,
)
from stax_sdk.ta._generated.stax_ta_client.api.tpa.tpa_transaction_list import (
    sync as _sync_tpa_transaction_list,
)


class TpaGroup:
    _client: Any

    def account_create(self, *, body: TpaAccountCreateBody) -> TpaAccountCreateResponse200 | None:
        return _sync_tpa_account_create(client=self._client, body=body)

    def account_get(self, *, account_id: str) -> TpaAccountGetResponse200 | None:
        return _sync_tpa_account_get(client=self._client, account_id=account_id)

    def account_list(self, *, plan_id: str | Unset = UNSET) -> TpaAccountListResponse200 | None:
        return _sync_tpa_account_list(client=self._client, plan_id=plan_id)

    def plan_create(self, *, body: TpaPlanCreateBody) -> TpaPlanCreateResponse200 | None:
        return _sync_tpa_plan_create(client=self._client, body=body)

    def plan_get(self, *, plan_id: str) -> TpaPlanGetResponse200 | None:
        return _sync_tpa_plan_get(client=self._client, plan_id=plan_id)

    def plan_list(self) -> TpaPlanListResponse200 | None:
        return _sync_tpa_plan_list(client=self._client)

    def statement_attach(
        self, *, body: TpaStatementAttachBody
    ) -> TpaStatementAttachResponse200 | None:
        return _sync_tpa_statement_attach(client=self._client, body=body)

    def statement_confirm(self, *, body: TpaStatementConfirmBody) -> SuccessResponse | None:
        return _sync_tpa_statement_confirm(client=self._client, body=body)

    def statement_list(
        self, *, plan_id: str | Unset = UNSET, account_id: str | Unset = UNSET
    ) -> TpaStatementListResponse200 | None:
        return _sync_tpa_statement_list(client=self._client, plan_id=plan_id, account_id=account_id)

    def transaction_create(
        self, *, body: TpaTransactionCreateBody
    ) -> TpaTransactionCreateResponse200 | None:
        return _sync_tpa_transaction_create(client=self._client, body=body)

    def transaction_list(self, *, statement_id: str) -> TpaTransactionListResponse200 | None:
        return _sync_tpa_transaction_list(client=self._client, statement_id=statement_id)


class AsyncTpaGroup:
    _client: Any

    async def account_create(
        self, *, body: TpaAccountCreateBody
    ) -> TpaAccountCreateResponse200 | None:
        return await _async_tpa_account_create(client=self._client, body=body)

    async def account_get(self, *, account_id: str) -> TpaAccountGetResponse200 | None:
        return await _async_tpa_account_get(client=self._client, account_id=account_id)

    async def account_list(
        self, *, plan_id: str | Unset = UNSET
    ) -> TpaAccountListResponse200 | None:
        return await _async_tpa_account_list(client=self._client, plan_id=plan_id)

    async def plan_create(self, *, body: TpaPlanCreateBody) -> TpaPlanCreateResponse200 | None:
        return await _async_tpa_plan_create(client=self._client, body=body)

    async def plan_get(self, *, plan_id: str) -> TpaPlanGetResponse200 | None:
        return await _async_tpa_plan_get(client=self._client, plan_id=plan_id)

    async def plan_list(self) -> TpaPlanListResponse200 | None:
        return await _async_tpa_plan_list(client=self._client)

    async def statement_attach(
        self, *, body: TpaStatementAttachBody
    ) -> TpaStatementAttachResponse200 | None:
        return await _async_tpa_statement_attach(client=self._client, body=body)

    async def statement_confirm(self, *, body: TpaStatementConfirmBody) -> SuccessResponse | None:
        return await _async_tpa_statement_confirm(client=self._client, body=body)

    async def statement_list(
        self, *, plan_id: str | Unset = UNSET, account_id: str | Unset = UNSET
    ) -> TpaStatementListResponse200 | None:
        return await _async_tpa_statement_list(
            client=self._client, plan_id=plan_id, account_id=account_id
        )

    async def transaction_create(
        self, *, body: TpaTransactionCreateBody
    ) -> TpaTransactionCreateResponse200 | None:
        return await _async_tpa_transaction_create(client=self._client, body=body)

    async def transaction_list(self, *, statement_id: str) -> TpaTransactionListResponse200 | None:
        return await _async_tpa_transaction_list(client=self._client, statement_id=statement_id)


class DocumentGroup:
    _client: Any

    def archive(self, *, body: DocumentArchiveBody) -> SuccessResponse | None:
        return _sync_document_archive(client=self._client, body=body)

    def copy(self, *, body: DocumentCopyBody) -> DocumentCopyResponse200 | None:
        return _sync_document_copy(client=self._client, body=body)

    def create(self, *, body: DocumentCreateBody) -> DocumentCreateResponse200 | None:
        return _sync_document_create(client=self._client, body=body)

    def download(self, *, doc_id: str | Unset = UNSET) -> Error | File | None:
        return _sync_document_download(client=self._client, doc_id=doc_id)

    def duplicates(self, *, doc_id: str | Unset = UNSET) -> DocumentDuplicatesResponse200 | None:
        return _sync_document_duplicates(client=self._client, doc_id=doc_id)

    def get(
        self,
        *,
        doc_id: str | Unset = UNSET,
        minimal: bool | Unset = UNSET,
        presigned: bool | Unset = UNSET,
        fields: str | Unset = UNSET,
        disable_review: bool | Unset = UNSET,
        statement: bool | Unset = UNSET,
    ) -> DocumentGetResponse200 | Error | None:
        return _sync_document_get(
            client=self._client,
            doc_id=doc_id,
            minimal=minimal,
            presigned=presigned,
            fields=fields,
            disable_review=disable_review,
            statement=statement,
        )

    def jobs(self, *, doc_id: str | Unset = UNSET) -> DocumentJobsResponse200 | None:
        return _sync_document_jobs(client=self._client, doc_id=doc_id)

    def move(self, *, body: DocumentMoveBody) -> SuccessResponse | None:
        return _sync_document_move(client=self._client, body=body)

    def recent(self) -> DocumentRecentResponse200 | None:
        return _sync_document_recent(client=self._client)

    def remove(self, *, body: DocumentRemoveBody) -> Error | SuccessResponse | None:
        return _sync_document_remove(client=self._client, body=body)

    def restore(self, *, body: DocumentRestoreBody) -> SuccessResponse | None:
        return _sync_document_restore(client=self._client, body=body)

    def search(
        self,
        *,
        search_query: str,
        search_offset: float | Unset = 0.0,
        search_limit: float | Unset = 10.0,
        stack_id: str | Unset = UNSET,
        format_: str | Unset = UNSET,
        field: str | Unset = UNSET,
        value: str | Unset = UNSET,
        sort_by: DocumentSearchSortBy | Unset = UNSET,
    ) -> Error | SearchResult | None:
        return _sync_document_search(
            client=self._client,
            search_query=search_query,
            search_offset=search_offset,
            search_limit=search_limit,
            stack_id=stack_id,
            format_=format_,
            field=field,
            value=value,
            sort_by=sort_by,
        )

    def search_archive(
        self,
        *,
        search_query: str,
        search_offset: float | Unset = UNSET,
        search_limit: float | Unset = UNSET,
    ) -> SearchResult | None:
        return _sync_document_search_archive(
            client=self._client,
            search_query=search_query,
            search_offset=search_offset,
            search_limit=search_limit,
        )

    def update(self, *, body: DocumentUpdateBody) -> Error | SuccessResponse | None:
        return _sync_document_update(client=self._client, body=body)

    def upload(self, *, body: DocumentUploadBody) -> DocumentUploadResponse200 | Error | None:
        return _sync_document_upload(client=self._client, body=body)


class AsyncDocumentGroup:
    _client: Any

    async def archive(self, *, body: DocumentArchiveBody) -> SuccessResponse | None:
        return await _async_document_archive(client=self._client, body=body)

    async def copy(self, *, body: DocumentCopyBody) -> DocumentCopyResponse200 | None:
        return await _async_document_copy(client=self._client, body=body)

    async def create(self, *, body: DocumentCreateBody) -> DocumentCreateResponse200 | None:
        return await _async_document_create(client=self._client, body=body)

    async def download(self, *, doc_id: str | Unset = UNSET) -> Error | File | None:
        return await _async_document_download(client=self._client, doc_id=doc_id)

    async def duplicates(
        self, *, doc_id: str | Unset = UNSET
    ) -> DocumentDuplicatesResponse200 | None:
        return await _async_document_duplicates(client=self._client, doc_id=doc_id)

    async def get(
        self,
        *,
        doc_id: str | Unset = UNSET,
        minimal: bool | Unset = UNSET,
        presigned: bool | Unset = UNSET,
        fields: str | Unset = UNSET,
        disable_review: bool | Unset = UNSET,
        statement: bool | Unset = UNSET,
    ) -> DocumentGetResponse200 | Error | None:
        return await _async_document_get(
            client=self._client,
            doc_id=doc_id,
            minimal=minimal,
            presigned=presigned,
            fields=fields,
            disable_review=disable_review,
            statement=statement,
        )

    async def jobs(self, *, doc_id: str | Unset = UNSET) -> DocumentJobsResponse200 | None:
        return await _async_document_jobs(client=self._client, doc_id=doc_id)

    async def move(self, *, body: DocumentMoveBody) -> SuccessResponse | None:
        return await _async_document_move(client=self._client, body=body)

    async def recent(self) -> DocumentRecentResponse200 | None:
        return await _async_document_recent(client=self._client)

    async def remove(self, *, body: DocumentRemoveBody) -> Error | SuccessResponse | None:
        return await _async_document_remove(client=self._client, body=body)

    async def restore(self, *, body: DocumentRestoreBody) -> SuccessResponse | None:
        return await _async_document_restore(client=self._client, body=body)

    async def search(
        self,
        *,
        search_query: str,
        search_offset: float | Unset = 0.0,
        search_limit: float | Unset = 10.0,
        stack_id: str | Unset = UNSET,
        format_: str | Unset = UNSET,
        field: str | Unset = UNSET,
        value: str | Unset = UNSET,
        sort_by: DocumentSearchSortBy | Unset = UNSET,
    ) -> Error | SearchResult | None:
        return await _async_document_search(
            client=self._client,
            search_query=search_query,
            search_offset=search_offset,
            search_limit=search_limit,
            stack_id=stack_id,
            format_=format_,
            field=field,
            value=value,
            sort_by=sort_by,
        )

    async def search_archive(
        self,
        *,
        search_query: str,
        search_offset: float | Unset = UNSET,
        search_limit: float | Unset = UNSET,
    ) -> SearchResult | None:
        return await _async_document_search_archive(
            client=self._client,
            search_query=search_query,
            search_offset=search_offset,
            search_limit=search_limit,
        )

    async def update(self, *, body: DocumentUpdateBody) -> Error | SuccessResponse | None:
        return await _async_document_update(client=self._client, body=body)

    async def upload(self, *, body: DocumentUploadBody) -> DocumentUploadResponse200 | Error | None:
        return await _async_document_upload(client=self._client, body=body)


class StackGroup:
    _client: Any

    def all(self) -> StackAllResponse200 | None:
        return _sync_stack_all(client=self._client)

    def create(self, *, body: StackCreateBody) -> Error | StackCreateResponse200 | None:
        return _sync_stack_create(client=self._client, body=body)

    def get(
        self, *, stack_id: str | Unset = UNSET, stack_tag: str | Unset = UNSET
    ) -> Error | StackGetResponse200 | None:
        return _sync_stack_get(client=self._client, stack_id=stack_id, stack_tag=stack_tag)

    def list(
        self,
        *,
        stack_id: str | Unset = UNSET,
        result_offset: float | Unset = 0.0,
        result_limit: float | Unset = 100.0,
        sort: str | Unset = UNSET,
        dir_: StackListDir | Unset = UNSET,
        recursive: bool | Unset = UNSET,
        ignore_duplicates: bool | Unset = UNSET,
        minimal: bool | Unset = UNSET,
        fields: str | Unset = UNSET,
    ) -> StackListResponse200 | None:
        return _sync_stack_list(
            client=self._client,
            stack_id=stack_id,
            result_offset=result_offset,
            result_limit=result_limit,
            sort=sort,
            dir_=dir_,
            recursive=recursive,
            ignore_duplicates=ignore_duplicates,
            minimal=minimal,
            fields=fields,
        )

    def remove(self, *, body: StackRemoveBody) -> Error | SuccessResponse | None:
        return _sync_stack_remove(client=self._client, body=body)

    def update(self, *, body: StackUpdateBody) -> Error | SuccessResponse | None:
        return _sync_stack_update(client=self._client, body=body)


class AsyncStackGroup:
    _client: Any

    async def all(self) -> StackAllResponse200 | None:
        return await _async_stack_all(client=self._client)

    async def create(self, *, body: StackCreateBody) -> Error | StackCreateResponse200 | None:
        return await _async_stack_create(client=self._client, body=body)

    async def get(
        self, *, stack_id: str | Unset = UNSET, stack_tag: str | Unset = UNSET
    ) -> Error | StackGetResponse200 | None:
        return await _async_stack_get(client=self._client, stack_id=stack_id, stack_tag=stack_tag)

    async def list(
        self,
        *,
        stack_id: str | Unset = UNSET,
        result_offset: float | Unset = 0.0,
        result_limit: float | Unset = 100.0,
        sort: str | Unset = UNSET,
        dir_: StackListDir | Unset = UNSET,
        recursive: bool | Unset = UNSET,
        ignore_duplicates: bool | Unset = UNSET,
        minimal: bool | Unset = UNSET,
        fields: str | Unset = UNSET,
    ) -> StackListResponse200 | None:
        return await _async_stack_list(
            client=self._client,
            stack_id=stack_id,
            result_offset=result_offset,
            result_limit=result_limit,
            sort=sort,
            dir_=dir_,
            recursive=recursive,
            ignore_duplicates=ignore_duplicates,
            minimal=minimal,
            fields=fields,
        )

    async def remove(self, *, body: StackRemoveBody) -> Error | SuccessResponse | None:
        return await _async_stack_remove(client=self._client, body=body)

    async def update(self, *, body: StackUpdateBody) -> Error | SuccessResponse | None:
        return await _async_stack_update(client=self._client, body=body)


class TaAPI:
    """Sync TA API client. Use TaAPI(...) for sync, AsyncTaAPI(...) for async."""

    _client: Any
    tpa: TpaGroup
    document: DocumentGroup
    stack: StackGroup

    def __init__(self, base_url: str = "https://api.stax.ai", inject_headers: Any = None) -> None:
        from stax_sdk._http import sync_client
        from stax_sdk.ta._generated.stax_ta_client.client import AuthenticatedClient

        url = base_url.rstrip("/")
        httpx_client = sync_client(base_url=url, inject_headers=inject_headers)
        gen_client = AuthenticatedClient(base_url=url, token="")
        gen_client.set_httpx_client(httpx_client)
        self._client = gen_client
        tpa = TpaGroup()
        tpa._client = gen_client
        self.tpa = tpa
        document = DocumentGroup()
        document._client = gen_client
        self.document = document
        stack = StackGroup()
        stack._client = gen_client
        self.stack = stack


class AsyncTaAPI:
    """Async TA API client."""

    _client: Any
    tpa: AsyncTpaGroup
    document: AsyncDocumentGroup
    stack: AsyncStackGroup

    def __init__(self, base_url: str = "https://api.stax.ai", inject_headers: Any = None) -> None:
        from stax_sdk._http import async_client
        from stax_sdk.ta._generated.stax_ta_client.client import AuthenticatedClient

        url = base_url.rstrip("/")
        async_httpx = async_client(base_url=url, inject_headers=inject_headers)
        gen_client = AuthenticatedClient(base_url=url, token="")
        gen_client.set_async_httpx_client(async_httpx)
        self._client = gen_client
        self.tpa = AsyncTpaGroup()
        self.tpa._client = gen_client
        self.document = AsyncDocumentGroup()
        self.document._client = gen_client
        self.stack = AsyncStackGroup()
        self.stack._client = gen_client
