File size: 4,112 Bytes
9410704
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# This file was auto-generated by Fern from our API Definition.

from __future__ import annotations

import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from .raw_client import AsyncRawFlowsClient, RawFlowsClient

if typing.TYPE_CHECKING:
    from .image.client import AsyncImageClient, ImageClient
    from .templates.client import AsyncTemplatesClient, TemplatesClient
    from .text_to_speech.client import AsyncTextToSpeechClient, TextToSpeechClient
    from .video.client import AsyncVideoClient, VideoClient


class FlowsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawFlowsClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._video: typing.Optional[VideoClient] = None
        self._image: typing.Optional[ImageClient] = None
        self._text_to_speech: typing.Optional[TextToSpeechClient] = None
        self._templates: typing.Optional[TemplatesClient] = None

    @property
    def with_raw_response(self) -> RawFlowsClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawFlowsClient
        """
        return self._raw_client

    @property
    def video(self):
        if self._video is None:
            from .video.client import VideoClient  # noqa: E402

            self._video = VideoClient(client_wrapper=self._client_wrapper)
        return self._video

    @property
    def image(self):
        if self._image is None:
            from .image.client import ImageClient  # noqa: E402

            self._image = ImageClient(client_wrapper=self._client_wrapper)
        return self._image

    @property
    def text_to_speech(self):
        if self._text_to_speech is None:
            from .text_to_speech.client import TextToSpeechClient  # noqa: E402

            self._text_to_speech = TextToSpeechClient(client_wrapper=self._client_wrapper)
        return self._text_to_speech

    @property
    def templates(self):
        if self._templates is None:
            from .templates.client import TemplatesClient  # noqa: E402

            self._templates = TemplatesClient(client_wrapper=self._client_wrapper)
        return self._templates


class AsyncFlowsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawFlowsClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._video: typing.Optional[AsyncVideoClient] = None
        self._image: typing.Optional[AsyncImageClient] = None
        self._text_to_speech: typing.Optional[AsyncTextToSpeechClient] = None
        self._templates: typing.Optional[AsyncTemplatesClient] = None

    @property
    def with_raw_response(self) -> AsyncRawFlowsClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawFlowsClient
        """
        return self._raw_client

    @property
    def video(self):
        if self._video is None:
            from .video.client import AsyncVideoClient  # noqa: E402

            self._video = AsyncVideoClient(client_wrapper=self._client_wrapper)
        return self._video

    @property
    def image(self):
        if self._image is None:
            from .image.client import AsyncImageClient  # noqa: E402

            self._image = AsyncImageClient(client_wrapper=self._client_wrapper)
        return self._image

    @property
    def text_to_speech(self):
        if self._text_to_speech is None:
            from .text_to_speech.client import AsyncTextToSpeechClient  # noqa: E402

            self._text_to_speech = AsyncTextToSpeechClient(client_wrapper=self._client_wrapper)
        return self._text_to_speech

    @property
    def templates(self):
        if self._templates is None:
            from .templates.client import AsyncTemplatesClient  # noqa: E402

            self._templates = AsyncTemplatesClient(client_wrapper=self._client_wrapper)
        return self._templates