wallaroo.wallaroo_ml_ops_api_client.api.assay.assays_list

  1from typing import Any, Dict, List, Optional, Union
  2
  3import httpx
  4
  5from ...client import Client
  6from ...models.assays_list_json_body import AssaysListJsonBody
  7from ...models.assays_list_response_200_item import AssaysListResponse200Item
  8from ...models.assays_list_response_400 import AssaysListResponse400
  9from ...models.assays_list_response_401 import AssaysListResponse401
 10from ...models.assays_list_response_500 import AssaysListResponse500
 11from ...types import Response
 12
 13
 14def _get_kwargs(
 15    *,
 16    client: Client,
 17    json_body: AssaysListJsonBody,
 18
 19) -> Dict[str, Any]:
 20    url = "{}/v1/api/assays/list".format(
 21        client.base_url)
 22
 23    headers: Dict[str, str] = client.get_headers()
 24    cookies: Dict[str, Any] = client.get_cookies()
 25
 26    
 27
 28    
 29
 30    
 31
 32    json_json_body = json_body.to_dict()
 33
 34
 35
 36    
 37
 38    return {
 39	    "method": "post",
 40        "url": url,
 41        "headers": headers,
 42        "cookies": cookies,
 43        "timeout": client.get_timeout(),
 44        "json": json_json_body,
 45    }
 46
 47
 48def _parse_response(*, response: httpx.Response) -> Optional[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]:
 49    if response.status_code == 500:
 50        response_500 = AssaysListResponse500.from_dict(response.json())
 51
 52
 53
 54        return response_500
 55    if response.status_code == 400:
 56        response_400 = AssaysListResponse400.from_dict(response.json())
 57
 58
 59
 60        return response_400
 61    if response.status_code == 401:
 62        response_401 = AssaysListResponse401.from_dict(response.json())
 63
 64
 65
 66        return response_401
 67    if response.status_code == 200:
 68        response_200 = []
 69        _response_200 = response.json()
 70        for response_200_item_data in (_response_200):
 71            response_200_item = AssaysListResponse200Item.from_dict(response_200_item_data)
 72
 73
 74
 75            response_200.append(response_200_item)
 76
 77        return response_200
 78    return None
 79
 80
 81def _build_response(*, response: httpx.Response) -> Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]:
 82    return Response(
 83        status_code=response.status_code,
 84        content=response.content,
 85        headers=response.headers,
 86        parsed=_parse_response(response=response),
 87    )
 88
 89
 90def sync_detailed(
 91    *,
 92    client: Client,
 93    json_body: AssaysListJsonBody,
 94
 95) -> Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]:
 96    """List assays
 97
 98     Returns the list of existing assays.
 99
100    Args:
101        json_body (AssaysListJsonBody):  Request for list of assays.
102
103    Returns:
104        Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]
105    """
106
107
108    kwargs = _get_kwargs(
109        client=client,
110json_body=json_body,
111
112    )
113
114    response = httpx.request(
115        verify=client.verify_ssl,
116        **kwargs,
117    )
118
119    return _build_response(response=response)
120
121def sync(
122    *,
123    client: Client,
124    json_body: AssaysListJsonBody,
125
126) -> Optional[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]:
127    """List assays
128
129     Returns the list of existing assays.
130
131    Args:
132        json_body (AssaysListJsonBody):  Request for list of assays.
133
134    Returns:
135        Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]
136    """
137
138
139    return sync_detailed(
140        client=client,
141json_body=json_body,
142
143    ).parsed
144
145async def asyncio_detailed(
146    *,
147    client: Client,
148    json_body: AssaysListJsonBody,
149
150) -> Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]:
151    """List assays
152
153     Returns the list of existing assays.
154
155    Args:
156        json_body (AssaysListJsonBody):  Request for list of assays.
157
158    Returns:
159        Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]
160    """
161
162
163    kwargs = _get_kwargs(
164        client=client,
165json_body=json_body,
166
167    )
168
169    async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
170        response = await _client.request(
171            **kwargs
172        )
173
174    return _build_response(response=response)
175
176async def asyncio(
177    *,
178    client: Client,
179    json_body: AssaysListJsonBody,
180
181) -> Optional[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]:
182    """List assays
183
184     Returns the list of existing assays.
185
186    Args:
187        json_body (AssaysListJsonBody):  Request for list of assays.
188
189    Returns:
190        Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]
191    """
192
193
194    return (await asyncio_detailed(
195        client=client,
196json_body=json_body,
197
198    )).parsed
 91def sync_detailed(
 92    *,
 93    client: Client,
 94    json_body: AssaysListJsonBody,
 95
 96) -> Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]:
 97    """List assays
 98
 99     Returns the list of existing assays.
100
101    Args:
102        json_body (AssaysListJsonBody):  Request for list of assays.
103
104    Returns:
105        Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]
106    """
107
108
109    kwargs = _get_kwargs(
110        client=client,
111json_body=json_body,
112
113    )
114
115    response = httpx.request(
116        verify=client.verify_ssl,
117        **kwargs,
118    )
119
120    return _build_response(response=response)

List assays

Returns the list of existing assays.

Args: json_body (AssaysListJsonBody): Request for list of assays.

Returns: Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]

122def sync(
123    *,
124    client: Client,
125    json_body: AssaysListJsonBody,
126
127) -> Optional[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]:
128    """List assays
129
130     Returns the list of existing assays.
131
132    Args:
133        json_body (AssaysListJsonBody):  Request for list of assays.
134
135    Returns:
136        Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]
137    """
138
139
140    return sync_detailed(
141        client=client,
142json_body=json_body,
143
144    ).parsed

List assays

Returns the list of existing assays.

Args: json_body (AssaysListJsonBody): Request for list of assays.

Returns: Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]

146async def asyncio_detailed(
147    *,
148    client: Client,
149    json_body: AssaysListJsonBody,
150
151) -> Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]:
152    """List assays
153
154     Returns the list of existing assays.
155
156    Args:
157        json_body (AssaysListJsonBody):  Request for list of assays.
158
159    Returns:
160        Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]
161    """
162
163
164    kwargs = _get_kwargs(
165        client=client,
166json_body=json_body,
167
168    )
169
170    async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
171        response = await _client.request(
172            **kwargs
173        )
174
175    return _build_response(response=response)

List assays

Returns the list of existing assays.

Args: json_body (AssaysListJsonBody): Request for list of assays.

Returns: Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]

177async def asyncio(
178    *,
179    client: Client,
180    json_body: AssaysListJsonBody,
181
182) -> Optional[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]:
183    """List assays
184
185     Returns the list of existing assays.
186
187    Args:
188        json_body (AssaysListJsonBody):  Request for list of assays.
189
190    Returns:
191        Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]
192    """
193
194
195    return (await asyncio_detailed(
196        client=client,
197json_body=json_body,
198
199    )).parsed

List assays

Returns the list of existing assays.

Args: json_body (AssaysListJsonBody): Request for list of assays.

Returns: Response[Union[AssaysListResponse400, AssaysListResponse401, AssaysListResponse500, List[AssaysListResponse200Item]]]