5
5
6
6
from ... import errors
7
7
from ...client import Client
8
+ from ...models .build_catalog_action import BuildCatalogAction
8
9
from ...models .error import Error
9
- from ...types import Response
10
+ from ...types import UNSET , Response , Unset
10
11
11
12
12
13
def _get_kwargs (
13
14
* ,
14
15
client : Client ,
16
+ action : Union [Unset , None , BuildCatalogAction ] = UNSET ,
15
17
) -> Dict [str , Any ]:
16
18
url = "{}/build-catalog" .format (client .base_url )
17
19
18
20
headers : Dict [str , str ] = client .get_headers ()
19
21
cookies : Dict [str , Any ] = client .get_cookies ()
20
22
23
+ params : Dict [str , Any ] = {}
24
+ json_action : Union [Unset , None , str ] = UNSET
25
+ if not isinstance (action , Unset ):
26
+ json_action = action .value if action else None
27
+
28
+ params ["action" ] = json_action
29
+
30
+ params = {k : v for k , v in params .items () if v is not UNSET and v is not None }
31
+
21
32
# Set the proxies if the client has proxies set.
22
33
proxies = None
23
34
if hasattr (client , "proxies" ) and client .proxies is not None :
@@ -36,6 +47,7 @@ def _get_kwargs(
36
47
"cookies" : cookies ,
37
48
"timeout" : client .get_timeout (),
38
49
"proxies" : proxies ,
50
+ "params" : params ,
39
51
}
40
52
41
53
@@ -73,9 +85,13 @@ def _build_response(*, client: Client, response: httpx.Response) -> Response[Uni
73
85
def sync_detailed (
74
86
* ,
75
87
client : Client ,
88
+ action : Union [Unset , None , BuildCatalogAction ] = UNSET ,
76
89
) -> Response [Union [Any , Error ]]:
77
90
"""Build a catalog from the SPHN ontologies
78
91
92
+ Args:
93
+ action (Union[Unset, None, BuildCatalogAction]):
94
+
79
95
Raises:
80
96
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
81
97
httpx.TimeoutException: If the request takes longer than Client.timeout.
@@ -86,6 +102,7 @@ def sync_detailed(
86
102
87
103
kwargs = _get_kwargs (
88
104
client = client ,
105
+ action = action ,
89
106
)
90
107
91
108
response = httpx .request (
@@ -99,9 +116,13 @@ def sync_detailed(
99
116
def sync (
100
117
* ,
101
118
client : Client ,
119
+ action : Union [Unset , None , BuildCatalogAction ] = UNSET ,
102
120
) -> Optional [Union [Any , Error ]]:
103
121
"""Build a catalog from the SPHN ontologies
104
122
123
+ Args:
124
+ action (Union[Unset, None, BuildCatalogAction]):
125
+
105
126
Raises:
106
127
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
107
128
httpx.TimeoutException: If the request takes longer than Client.timeout.
@@ -112,15 +133,20 @@ def sync(
112
133
113
134
return sync_detailed (
114
135
client = client ,
136
+ action = action ,
115
137
).parsed
116
138
117
139
118
140
async def asyncio_detailed (
119
141
* ,
120
142
client : Client ,
143
+ action : Union [Unset , None , BuildCatalogAction ] = UNSET ,
121
144
) -> Response [Union [Any , Error ]]:
122
145
"""Build a catalog from the SPHN ontologies
123
146
147
+ Args:
148
+ action (Union[Unset, None, BuildCatalogAction]):
149
+
124
150
Raises:
125
151
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
126
152
httpx.TimeoutException: If the request takes longer than Client.timeout.
@@ -131,6 +157,7 @@ async def asyncio_detailed(
131
157
132
158
kwargs = _get_kwargs (
133
159
client = client ,
160
+ action = action ,
134
161
)
135
162
136
163
async with httpx .AsyncClient (verify = client .verify_ssl ) as _client :
@@ -142,9 +169,13 @@ async def asyncio_detailed(
142
169
async def asyncio (
143
170
* ,
144
171
client : Client ,
172
+ action : Union [Unset , None , BuildCatalogAction ] = UNSET ,
145
173
) -> Optional [Union [Any , Error ]]:
146
174
"""Build a catalog from the SPHN ontologies
147
175
176
+ Args:
177
+ action (Union[Unset, None, BuildCatalogAction]):
178
+
148
179
Raises:
149
180
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
150
181
httpx.TimeoutException: If the request takes longer than Client.timeout.
@@ -156,5 +187,6 @@ async def asyncio(
156
187
return (
157
188
await asyncio_detailed (
158
189
client = client ,
190
+ action = action ,
159
191
)
160
192
).parsed
0 commit comments