Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion codegen_templates/endpoint_module.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def _get_kwargs(
{% endif %}
{% endif %}

headers["X-Galileo-SDK"] = get_sdk_header()
headers["Splunk-AO-SDK"] = get_sdk_header()

_kwargs["content_headers"] = headers
return _kwargs
Expand Down
2 changes: 1 addition & 1 deletion scripts/patch_http_validation_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
``scripts/auto-generate-api-client.sh``::
python scripts/patch_http_validation_error.py \\
src/galileo/resources/models/http_validation_error.py
src/splunk_ao/resources/models/http_validation_error.py
Exit codes
----------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from http import HTTPStatus
from typing import Any, Optional, Union
from typing import Any, Optional

import httpx

Expand Down Expand Up @@ -32,15 +32,13 @@ def _get_kwargs(*, body: CreateAnnotationQueueRequest) -> dict[str, Any]:

headers["Content-Type"] = "application/json"

headers["X-Galileo-SDK"] = get_sdk_header()
headers["Splunk-AO-SDK"] = get_sdk_header()

_kwargs["content_headers"] = headers
return _kwargs


def _parse_response(
*, client: ApiClient, response: httpx.Response
) -> Union[AnnotationQueueResponse, HTTPValidationError]:
def _parse_response(*, client: ApiClient, response: httpx.Response) -> AnnotationQueueResponse | HTTPValidationError:
if response.status_code == 200:
response_200 = AnnotationQueueResponse.from_dict(response.json())

Expand Down Expand Up @@ -71,7 +69,7 @@ def _parse_response(

def _build_response(
*, client: ApiClient, response: httpx.Response
) -> Response[Union[AnnotationQueueResponse, HTTPValidationError]]:
) -> Response[AnnotationQueueResponse | HTTPValidationError]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -82,7 +80,7 @@ def _build_response(

def sync_detailed(
*, client: ApiClient, body: CreateAnnotationQueueRequest
) -> Response[Union[AnnotationQueueResponse, HTTPValidationError]]:
) -> Response[AnnotationQueueResponse | HTTPValidationError]:
"""Create Annotation Queue

Create an annotation queue at the organization level.
Expand All @@ -100,7 +98,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[AnnotationQueueResponse, HTTPValidationError]]
Response[AnnotationQueueResponse | HTTPValidationError]
"""

kwargs = _get_kwargs(body=body)
Expand All @@ -112,7 +110,7 @@ def sync_detailed(

def sync(
*, client: ApiClient, body: CreateAnnotationQueueRequest
) -> Optional[Union[AnnotationQueueResponse, HTTPValidationError]]:
) -> Optional[AnnotationQueueResponse | HTTPValidationError]:
"""Create Annotation Queue

Create an annotation queue at the organization level.
Expand All @@ -130,15 +128,15 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[AnnotationQueueResponse, HTTPValidationError]
AnnotationQueueResponse | HTTPValidationError
"""

return sync_detailed(client=client, body=body).parsed


async def asyncio_detailed(
*, client: ApiClient, body: CreateAnnotationQueueRequest
) -> Response[Union[AnnotationQueueResponse, HTTPValidationError]]:
) -> Response[AnnotationQueueResponse | HTTPValidationError]:
"""Create Annotation Queue

Create an annotation queue at the organization level.
Expand All @@ -156,7 +154,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[AnnotationQueueResponse, HTTPValidationError]]
Response[AnnotationQueueResponse | HTTPValidationError]
"""

kwargs = _get_kwargs(body=body)
Expand All @@ -168,7 +166,7 @@ async def asyncio_detailed(

async def asyncio(
*, client: ApiClient, body: CreateAnnotationQueueRequest
) -> Optional[Union[AnnotationQueueResponse, HTTPValidationError]]:
) -> Optional[AnnotationQueueResponse | HTTPValidationError]:
"""Create Annotation Queue

Create an annotation queue at the organization level.
Expand All @@ -186,7 +184,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[AnnotationQueueResponse, HTTPValidationError]
AnnotationQueueResponse | HTTPValidationError
"""

return (await asyncio_detailed(client=client, body=body)).parsed
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from http import HTTPStatus
from typing import Any, Optional, Union
from typing import Any, Optional

import httpx

Expand Down Expand Up @@ -36,15 +36,13 @@ def _get_kwargs(queue_id: str, *, body: CreateQueueTemplateRequest) -> dict[str,

headers["Content-Type"] = "application/json"

headers["X-Galileo-SDK"] = get_sdk_header()
headers["Splunk-AO-SDK"] = get_sdk_header()

_kwargs["content_headers"] = headers
return _kwargs


def _parse_response(
*, client: ApiClient, response: httpx.Response
) -> Union[HTTPValidationError, list["AnnotationTemplateDB"]]:
def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError | list[AnnotationTemplateDB]:
if response.status_code == 200:
response_200 = []
_response_200 = response.json()
Expand Down Expand Up @@ -80,7 +78,7 @@ def _parse_response(

def _build_response(
*, client: ApiClient, response: httpx.Response
) -> Response[Union[HTTPValidationError, list["AnnotationTemplateDB"]]]:
) -> Response[HTTPValidationError | list[AnnotationTemplateDB]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -91,7 +89,7 @@ def _build_response(

def sync_detailed(
queue_id: str, *, client: ApiClient, body: CreateQueueTemplateRequest
) -> Response[Union[HTTPValidationError, list["AnnotationTemplateDB"]]]:
) -> Response[HTTPValidationError | list[AnnotationTemplateDB]]:
"""Create Queue Template

Create template(s) in an annotation queue.
Expand All @@ -113,7 +111,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[HTTPValidationError, list['AnnotationTemplateDB']]]
Response[HTTPValidationError | list[AnnotationTemplateDB]]
"""

kwargs = _get_kwargs(queue_id=queue_id, body=body)
Expand All @@ -125,7 +123,7 @@ def sync_detailed(

def sync(
queue_id: str, *, client: ApiClient, body: CreateQueueTemplateRequest
) -> Optional[Union[HTTPValidationError, list["AnnotationTemplateDB"]]]:
) -> Optional[HTTPValidationError | list[AnnotationTemplateDB]]:
"""Create Queue Template

Create template(s) in an annotation queue.
Expand All @@ -147,15 +145,15 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[HTTPValidationError, list['AnnotationTemplateDB']]
HTTPValidationError | list[AnnotationTemplateDB]
"""

return sync_detailed(queue_id=queue_id, client=client, body=body).parsed


async def asyncio_detailed(
queue_id: str, *, client: ApiClient, body: CreateQueueTemplateRequest
) -> Response[Union[HTTPValidationError, list["AnnotationTemplateDB"]]]:
) -> Response[HTTPValidationError | list[AnnotationTemplateDB]]:
"""Create Queue Template

Create template(s) in an annotation queue.
Expand All @@ -177,7 +175,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[HTTPValidationError, list['AnnotationTemplateDB']]]
Response[HTTPValidationError | list[AnnotationTemplateDB]]
"""

kwargs = _get_kwargs(queue_id=queue_id, body=body)
Expand All @@ -189,7 +187,7 @@ async def asyncio_detailed(

async def asyncio(
queue_id: str, *, client: ApiClient, body: CreateQueueTemplateRequest
) -> Optional[Union[HTTPValidationError, list["AnnotationTemplateDB"]]]:
) -> Optional[HTTPValidationError | list[AnnotationTemplateDB]]:
"""Create Queue Template

Create template(s) in an annotation queue.
Expand All @@ -211,7 +209,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[HTTPValidationError, list['AnnotationTemplateDB']]
HTTPValidationError | list[AnnotationTemplateDB]
"""

return (await asyncio_detailed(queue_id=queue_id, client=client, body=body)).parsed
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from http import HTTPStatus
from typing import Any, Optional, Union
from typing import Any, Optional

import httpx

Expand Down Expand Up @@ -30,13 +30,13 @@ def _get_kwargs(queue_id: str) -> dict[str, Any]:
"path": "/annotation_queues/{queue_id}".format(queue_id=queue_id),
}

headers["X-Galileo-SDK"] = get_sdk_header()
headers["Splunk-AO-SDK"] = get_sdk_header()

_kwargs["content_headers"] = headers
return _kwargs


def _parse_response(*, client: ApiClient, response: httpx.Response) -> Union[Any, HTTPValidationError]:
def _parse_response(*, client: ApiClient, response: httpx.Response) -> Any | HTTPValidationError:
if response.status_code == 200:
response_200 = response.json()
return response_200
Expand Down Expand Up @@ -64,7 +64,7 @@ def _parse_response(*, client: ApiClient, response: httpx.Response) -> Union[Any
raise errors.UnexpectedStatus(response.status_code, response.content)


def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[Union[Any, HTTPValidationError]]:
def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[Any | HTTPValidationError]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -73,7 +73,7 @@ def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[
)


def sync_detailed(queue_id: str, *, client: ApiClient) -> Response[Union[Any, HTTPValidationError]]:
def sync_detailed(queue_id: str, *, client: ApiClient) -> Response[Any | HTTPValidationError]:
"""Delete Annotation Queue

Delete an annotation queue.
Expand All @@ -86,7 +86,7 @@ def sync_detailed(queue_id: str, *, client: ApiClient) -> Response[Union[Any, HT
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[Any, HTTPValidationError]]
Response[Any | HTTPValidationError]
"""

kwargs = _get_kwargs(queue_id=queue_id)
Expand All @@ -96,7 +96,7 @@ def sync_detailed(queue_id: str, *, client: ApiClient) -> Response[Union[Any, HT
return _build_response(client=client, response=response)


def sync(queue_id: str, *, client: ApiClient) -> Optional[Union[Any, HTTPValidationError]]:
def sync(queue_id: str, *, client: ApiClient) -> Optional[Any | HTTPValidationError]:
"""Delete Annotation Queue

Delete an annotation queue.
Expand All @@ -109,13 +109,13 @@ def sync(queue_id: str, *, client: ApiClient) -> Optional[Union[Any, HTTPValidat
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[Any, HTTPValidationError]
Any | HTTPValidationError
"""

return sync_detailed(queue_id=queue_id, client=client).parsed


async def asyncio_detailed(queue_id: str, *, client: ApiClient) -> Response[Union[Any, HTTPValidationError]]:
async def asyncio_detailed(queue_id: str, *, client: ApiClient) -> Response[Any | HTTPValidationError]:
"""Delete Annotation Queue

Delete an annotation queue.
Expand All @@ -128,7 +128,7 @@ async def asyncio_detailed(queue_id: str, *, client: ApiClient) -> Response[Unio
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[Any, HTTPValidationError]]
Response[Any | HTTPValidationError]
"""

kwargs = _get_kwargs(queue_id=queue_id)
Expand All @@ -138,7 +138,7 @@ async def asyncio_detailed(queue_id: str, *, client: ApiClient) -> Response[Unio
return _build_response(client=client, response=response)


async def asyncio(queue_id: str, *, client: ApiClient) -> Optional[Union[Any, HTTPValidationError]]:
async def asyncio(queue_id: str, *, client: ApiClient) -> Optional[Any | HTTPValidationError]:
"""Delete Annotation Queue

Delete an annotation queue.
Expand All @@ -151,7 +151,7 @@ async def asyncio(queue_id: str, *, client: ApiClient) -> Optional[Union[Any, HT
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[Any, HTTPValidationError]
Any | HTTPValidationError
"""

return (await asyncio_detailed(queue_id=queue_id, client=client)).parsed
Loading
Loading