Skip to content

Commit 6401d12

Browse files
Update API Client
1 parent 174c43d commit 6401d12

24 files changed

Lines changed: 621 additions & 2159 deletions

openapi.yaml

Lines changed: 95 additions & 431 deletions
Large diffs are not rendered by default.

src/splunk_ao/resources/api/jobs/get_job_jobs_job_id_get.py renamed to src/splunk_ao/resources/api/annotation_queue/count_annotation_queues_annotation_queues_count_post.py

Lines changed: 51 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,38 @@
1717
from splunk_ao.utils.headers_data import get_sdk_header
1818

1919
from ... import errors
20+
from ...models.annotation_queue_count_response import AnnotationQueueCountResponse
2021
from ...models.http_validation_error import HTTPValidationError
21-
from ...models.job_db import JobDB
22-
from ...types import Response
22+
from ...models.list_annotation_queue_params import ListAnnotationQueueParams
23+
from ...types import UNSET, Response, Unset
2324

2425

25-
def _get_kwargs(job_id: str) -> dict[str, Any]:
26+
def _get_kwargs(*, body: ListAnnotationQueueParams | Unset) -> dict[str, Any]:
2627
headers: dict[str, Any] = {}
2728

2829
_kwargs: dict[str, Any] = {
29-
"method": RequestMethod.GET,
30+
"method": RequestMethod.POST,
3031
"return_raw_response": True,
31-
"path": "/jobs/{job_id}".format(job_id=job_id),
32+
"path": "/annotation_queues/count",
3233
}
3334

35+
_kwargs["json"]: dict[str, Any] | Unset = UNSET
36+
if not isinstance(body, Unset):
37+
_kwargs["json"] = body.to_dict()
38+
39+
headers["Content-Type"] = "application/json"
40+
3441
headers["X-Galileo-SDK"] = get_sdk_header()
3542

3643
_kwargs["content_headers"] = headers
3744
return _kwargs
3845

3946

40-
def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError | JobDB:
47+
def _parse_response(
48+
*, client: ApiClient, response: httpx.Response
49+
) -> AnnotationQueueCountResponse | HTTPValidationError:
4150
if response.status_code == 200:
42-
response_200 = JobDB.from_dict(response.json())
51+
response_200 = AnnotationQueueCountResponse.from_dict(response.json())
4352

4453
return response_200
4554

@@ -66,7 +75,9 @@ def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValid
6675
raise errors.UnexpectedStatus(response.status_code, response.content)
6776

6877

69-
def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[HTTPValidationError | JobDB]:
78+
def _build_response(
79+
*, client: ApiClient, response: httpx.Response
80+
) -> Response[AnnotationQueueCountResponse | HTTPValidationError]:
7081
return Response(
7182
status_code=HTTPStatus(response.status_code),
7283
content=response.content,
@@ -75,85 +86,93 @@ def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[
7586
)
7687

7788

78-
def sync_detailed(job_id: str, *, client: ApiClient) -> Response[HTTPValidationError | JobDB]:
79-
"""Get Job
89+
def sync_detailed(
90+
*, client: ApiClient, body: ListAnnotationQueueParams | Unset
91+
) -> Response[AnnotationQueueCountResponse | HTTPValidationError]:
92+
"""Count Annotation Queues
8093
81-
Get a job by id.
94+
Count annotation queues in the user's organization with filtering.
8295
8396
Args:
84-
job_id (str):
97+
body (ListAnnotationQueueParams | Unset):
8598
8699
Raises:
87100
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
88101
httpx.TimeoutException: If the request takes longer than Client.timeout.
89102
90103
Returns:
91-
Response[HTTPValidationError | JobDB]
104+
Response[AnnotationQueueCountResponse | HTTPValidationError]
92105
"""
93106

94-
kwargs = _get_kwargs(job_id=job_id)
107+
kwargs = _get_kwargs(body=body)
95108

96109
response = client.request(**kwargs)
97110

98111
return _build_response(client=client, response=response)
99112

100113

101-
def sync(job_id: str, *, client: ApiClient) -> Optional[HTTPValidationError | JobDB]:
102-
"""Get Job
114+
def sync(
115+
*, client: ApiClient, body: ListAnnotationQueueParams | Unset
116+
) -> Optional[AnnotationQueueCountResponse | HTTPValidationError]:
117+
"""Count Annotation Queues
103118
104-
Get a job by id.
119+
Count annotation queues in the user's organization with filtering.
105120
106121
Args:
107-
job_id (str):
122+
body (ListAnnotationQueueParams | Unset):
108123
109124
Raises:
110125
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
111126
httpx.TimeoutException: If the request takes longer than Client.timeout.
112127
113128
Returns:
114-
HTTPValidationError | JobDB
129+
AnnotationQueueCountResponse | HTTPValidationError
115130
"""
116131

117-
return sync_detailed(job_id=job_id, client=client).parsed
132+
return sync_detailed(client=client, body=body).parsed
118133

119134

120-
async def asyncio_detailed(job_id: str, *, client: ApiClient) -> Response[HTTPValidationError | JobDB]:
121-
"""Get Job
135+
async def asyncio_detailed(
136+
*, client: ApiClient, body: ListAnnotationQueueParams | Unset
137+
) -> Response[AnnotationQueueCountResponse | HTTPValidationError]:
138+
"""Count Annotation Queues
122139
123-
Get a job by id.
140+
Count annotation queues in the user's organization with filtering.
124141
125142
Args:
126-
job_id (str):
143+
body (ListAnnotationQueueParams | Unset):
127144
128145
Raises:
129146
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
130147
httpx.TimeoutException: If the request takes longer than Client.timeout.
131148
132149
Returns:
133-
Response[HTTPValidationError | JobDB]
150+
Response[AnnotationQueueCountResponse | HTTPValidationError]
134151
"""
135152

136-
kwargs = _get_kwargs(job_id=job_id)
153+
kwargs = _get_kwargs(body=body)
137154

138155
response = await client.arequest(**kwargs)
139156

140157
return _build_response(client=client, response=response)
141158

142159

143-
async def asyncio(job_id: str, *, client: ApiClient) -> Optional[HTTPValidationError | JobDB]:
144-
"""Get Job
160+
async def asyncio(
161+
*, client: ApiClient, body: ListAnnotationQueueParams | Unset
162+
) -> Optional[AnnotationQueueCountResponse | HTTPValidationError]:
163+
"""Count Annotation Queues
145164
146-
Get a job by id.
165+
Count annotation queues in the user's organization with filtering.
147166
148167
Args:
149-
job_id (str):
168+
body (ListAnnotationQueueParams | Unset):
150169
151170
Raises:
152171
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
153172
httpx.TimeoutException: If the request takes longer than Client.timeout.
154173
155174
Returns:
156-
HTTPValidationError | JobDB
175+
AnnotationQueueCountResponse | HTTPValidationError
157176
"""
158177

159-
return (await asyncio_detailed(job_id=job_id, client=client)).parsed
178+
return (await asyncio_detailed(client=client, body=body)).parsed

0 commit comments

Comments
 (0)