# fields-shared-refs
diagnostics []
generated modules 17
## client/resources/default/_async.py
# generated by datamodel-codegen:
#   filename:  fields-shared-refs.yaml

"""The asyncio operations of the default resource."""

from __future__ import annotations

from contextlib import AbstractAsyncContextManager
from functools import cached_property
from typing import Literal, overload

import models

from ... import _operations
from ..._runtime.client.client import AsyncClientCore
from ...options import UNSET, RequestOptions
from ...responses import AsyncRawResponse, Response
from ...types.default import CreateSharedResponse


class AsyncDefaultResource:
    """The default operations."""

    def __init__(self, core: AsyncClientCore) -> None:
        """Keep the client core the operations send through."""
        self._core = core

    @cached_property
    def with_response(self) -> AsyncDefaultWithResponse:
        """The same operations, returning each result with its response metadata."""
        return AsyncDefaultWithResponse(self._core)

    @cached_property
    def with_raw_response(self) -> AsyncDefaultWithRawResponse:
        """The same operations, returning each raw response with its body read into memory."""
        return AsyncDefaultWithRawResponse(self._core)

    @cached_property
    def with_streaming_response(self) -> AsyncDefaultWithStreamingResponse:
        """The same operations, returning blocks that send each call on entry and stream its response."""
        return AsyncDefaultWithStreamingResponse(self._core)

    @overload
    async def create_shared(
        self,
        *,
        body: models.D,
        a: UNSET = UNSET,
        c: UNSET = UNSET,
        b: UNSET = UNSET,
        d: UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> CreateSharedResponse: ...
    @overload
    async def create_shared(
        self,
        *,
        body: UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> CreateSharedResponse: ...
    async def create_shared(
        self,
        *,
        body: models.D | UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> CreateSharedResponse:
        """
        Call POST /shared.
        """
        return (await self._core.execute(
            _operations.OPERATION_0,
            (),
            body=body,
            fields=(a, c, b, d),
            media_type=media_type,
            options=options,
        )).data


class AsyncDefaultWithResponse:
    """The default operations, returning each result with its response metadata."""

    def __init__(self, core: AsyncClientCore) -> None:
        """Keep the client core the operations send through."""
        self._core = core

    @overload
    async def create_shared(
        self,
        *,
        body: models.D,
        a: UNSET = UNSET,
        c: UNSET = UNSET,
        b: UNSET = UNSET,
        d: UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> Response[CreateSharedResponse]: ...
    @overload
    async def create_shared(
        self,
        *,
        body: UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> Response[CreateSharedResponse]: ...
    async def create_shared(
        self,
        *,
        body: models.D | UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> Response[CreateSharedResponse]:
        """
        Call POST /shared.
        """
        return await self._core.execute(
            _operations.OPERATION_0,
            (),
            body=body,
            fields=(a, c, b, d),
            media_type=media_type,
            options=options,
        )


class AsyncDefaultWithRawResponse:
    """The default operations, returning each raw response with its body read into memory."""

    def __init__(self, core: AsyncClientCore) -> None:
        """Keep the client core the operations send through."""
        self._core = core

    @overload
    async def create_shared(
        self,
        *,
        body: models.D,
        a: UNSET = UNSET,
        c: UNSET = UNSET,
        b: UNSET = UNSET,
        d: UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> AsyncRawResponse: ...
    @overload
    async def create_shared(
        self,
        *,
        body: UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> AsyncRawResponse: ...
    async def create_shared(
        self,
        *,
        body: models.D | UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> AsyncRawResponse:
        """
        Call POST /shared.
        """
        return await self._core.execute_raw(
            _operations.OPERATION_0,
            (),
            body=body,
            fields=(a, c, b, d),
            media_type=media_type,
            options=options,
        )


class AsyncDefaultWithStreamingResponse:
    """The default operations, returning blocks that send each call on entry and stream its response."""

    def __init__(self, core: AsyncClientCore) -> None:
        """Keep the client core the operations send through."""
        self._core = core

    @overload
    def create_shared(
        self,
        *,
        body: models.D,
        a: UNSET = UNSET,
        c: UNSET = UNSET,
        b: UNSET = UNSET,
        d: UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> AbstractAsyncContextManager[AsyncRawResponse]: ...
    @overload
    def create_shared(
        self,
        *,
        body: UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> AbstractAsyncContextManager[AsyncRawResponse]: ...
    def create_shared(
        self,
        *,
        body: models.D | UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> AbstractAsyncContextManager[AsyncRawResponse]:
        """
        Call POST /shared.
        """
        return self._core.stream(
            _operations.OPERATION_0,
            (),
            body=body,
            fields=(a, c, b, d),
            media_type=media_type,
            options=options,
        )
## client/resources/default/_sync.py
# generated by datamodel-codegen:
#   filename:  fields-shared-refs.yaml

"""The synchronous operations of the default resource."""

from __future__ import annotations

from contextlib import AbstractContextManager
from functools import cached_property
from typing import Literal, overload

import models

from ... import _operations
from ..._runtime.client.client import ClientCore
from ...options import UNSET, RequestOptions
from ...responses import RawResponse, Response
from ...types.default import CreateSharedResponse


class DefaultResource:
    """The default operations."""

    def __init__(self, core: ClientCore) -> None:
        """Keep the client core the operations send through."""
        self._core = core

    @cached_property
    def with_response(self) -> DefaultWithResponse:
        """The same operations, returning each result with its response metadata."""
        return DefaultWithResponse(self._core)

    @cached_property
    def with_raw_response(self) -> DefaultWithRawResponse:
        """The same operations, returning each raw response with its body read into memory."""
        return DefaultWithRawResponse(self._core)

    @cached_property
    def with_streaming_response(self) -> DefaultWithStreamingResponse:
        """The same operations, returning blocks that send each call on entry and stream its response."""
        return DefaultWithStreamingResponse(self._core)

    @overload
    def create_shared(
        self,
        *,
        body: models.D,
        a: UNSET = UNSET,
        c: UNSET = UNSET,
        b: UNSET = UNSET,
        d: UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> CreateSharedResponse: ...
    @overload
    def create_shared(
        self,
        *,
        body: UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> CreateSharedResponse: ...
    def create_shared(
        self,
        *,
        body: models.D | UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> CreateSharedResponse:
        """
        Call POST /shared.
        """
        return self._core.execute(
            _operations.OPERATION_0,
            (),
            body=body,
            fields=(a, c, b, d),
            media_type=media_type,
            options=options,
        ).data


class DefaultWithResponse:
    """The default operations, returning each result with its response metadata."""

    def __init__(self, core: ClientCore) -> None:
        """Keep the client core the operations send through."""
        self._core = core

    @overload
    def create_shared(
        self,
        *,
        body: models.D,
        a: UNSET = UNSET,
        c: UNSET = UNSET,
        b: UNSET = UNSET,
        d: UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> Response[CreateSharedResponse]: ...
    @overload
    def create_shared(
        self,
        *,
        body: UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> Response[CreateSharedResponse]: ...
    def create_shared(
        self,
        *,
        body: models.D | UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> Response[CreateSharedResponse]:
        """
        Call POST /shared.
        """
        return self._core.execute(
            _operations.OPERATION_0,
            (),
            body=body,
            fields=(a, c, b, d),
            media_type=media_type,
            options=options,
        )


class DefaultWithRawResponse:
    """The default operations, returning each raw response with its body read into memory."""

    def __init__(self, core: ClientCore) -> None:
        """Keep the client core the operations send through."""
        self._core = core

    @overload
    def create_shared(
        self,
        *,
        body: models.D,
        a: UNSET = UNSET,
        c: UNSET = UNSET,
        b: UNSET = UNSET,
        d: UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> RawResponse: ...
    @overload
    def create_shared(
        self,
        *,
        body: UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> RawResponse: ...
    def create_shared(
        self,
        *,
        body: models.D | UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> RawResponse:
        """
        Call POST /shared.
        """
        return self._core.execute_raw(
            _operations.OPERATION_0,
            (),
            body=body,
            fields=(a, c, b, d),
            media_type=media_type,
            options=options,
        )


class DefaultWithStreamingResponse:
    """The default operations, returning blocks that send each call on entry and stream its response."""

    def __init__(self, core: ClientCore) -> None:
        """Keep the client core the operations send through."""
        self._core = core

    @overload
    def create_shared(
        self,
        *,
        body: models.D,
        a: UNSET = UNSET,
        c: UNSET = UNSET,
        b: UNSET = UNSET,
        d: UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> AbstractContextManager[RawResponse]: ...
    @overload
    def create_shared(
        self,
        *,
        body: UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> AbstractContextManager[RawResponse]: ...
    def create_shared(
        self,
        *,
        body: models.D | UNSET = UNSET,
        a: str | UNSET = UNSET,
        c: str | UNSET = UNSET,
        b: str | UNSET = UNSET,
        d: str | UNSET = UNSET,
        media_type: Literal['application/json'] | None = None,
        options: RequestOptions | None = None,
    ) -> AbstractContextManager[RawResponse]:
        """
        Call POST /shared.
        """
        return self._core.stream(
            _operations.OPERATION_0,
            (),
            body=body,
            fields=(a, c, b, d),
            media_type=media_type,
            options=options,
        )
## models.py
# generated by datamodel-codegen:
#   filename:  fields-shared-refs.yaml

from __future__ import annotations

from pydantic import BaseModel


class A(BaseModel):
    a: str | None = None


class B(A):
    b: str | None = None


class C(A):
    c: str | None = None


class D(B, C, A):
    d: str | None = None
