Skip to content

Commit 7be06f9

Browse files
committed
chore: Upgrade python client
1 parent d555f80 commit 7be06f9

11 files changed

Lines changed: 692 additions & 103 deletions

src/tower/tower_api_client/api/default/delete_secret.py

Lines changed: 71 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from ... import errors
77
from ...client import AuthenticatedClient, Client
8+
from ...models.delete_secret_response import DeleteSecretResponse
89
from ...types import UNSET, Response, Unset
910

1011

@@ -32,9 +33,11 @@ def _get_kwargs(
3233

3334
def _parse_response(
3435
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
35-
) -> Optional[Any]:
36-
if response.status_code == 204:
37-
return None
36+
) -> Optional[DeleteSecretResponse]:
37+
if response.status_code == 200:
38+
response_200 = DeleteSecretResponse.from_dict(response.json())
39+
40+
return response_200
3841
if client.raise_on_unexpected_status:
3942
raise errors.UnexpectedStatus(response.status_code, response.content)
4043
else:
@@ -43,7 +46,7 @@ def _parse_response(
4346

4447
def _build_response(
4548
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
46-
) -> Response[Any]:
49+
) -> Response[DeleteSecretResponse]:
4750
return Response(
4851
status_code=HTTPStatus(response.status_code),
4952
content=response.content,
@@ -57,7 +60,7 @@ def sync_detailed(
5760
*,
5861
client: AuthenticatedClient,
5962
environment: Union[Unset, str] = UNSET,
60-
) -> Response[Any]:
63+
) -> Response[DeleteSecretResponse]:
6164
"""Delete secret
6265
6366
Delete a secret by name.
@@ -71,7 +74,7 @@ def sync_detailed(
7174
httpx.TimeoutException: If the request takes longer than Client.timeout.
7275
7376
Returns:
74-
Response[Any]
77+
Response[DeleteSecretResponse]
7578
"""
7679

7780
kwargs = _get_kwargs(
@@ -86,12 +89,41 @@ def sync_detailed(
8689
return _build_response(client=client, response=response)
8790

8891

92+
def sync(
93+
name: str,
94+
*,
95+
client: AuthenticatedClient,
96+
environment: Union[Unset, str] = UNSET,
97+
) -> Optional[DeleteSecretResponse]:
98+
"""Delete secret
99+
100+
Delete a secret by name.
101+
102+
Args:
103+
name (str): The name of the secret to delete.
104+
environment (Union[Unset, str]): The environment of the secret to delete.
105+
106+
Raises:
107+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
108+
httpx.TimeoutException: If the request takes longer than Client.timeout.
109+
110+
Returns:
111+
DeleteSecretResponse
112+
"""
113+
114+
return sync_detailed(
115+
name=name,
116+
client=client,
117+
environment=environment,
118+
).parsed
119+
120+
89121
async def asyncio_detailed(
90122
name: str,
91123
*,
92124
client: AuthenticatedClient,
93125
environment: Union[Unset, str] = UNSET,
94-
) -> Response[Any]:
126+
) -> Response[DeleteSecretResponse]:
95127
"""Delete secret
96128
97129
Delete a secret by name.
@@ -105,7 +137,7 @@ async def asyncio_detailed(
105137
httpx.TimeoutException: If the request takes longer than Client.timeout.
106138
107139
Returns:
108-
Response[Any]
140+
Response[DeleteSecretResponse]
109141
"""
110142

111143
kwargs = _get_kwargs(
@@ -116,3 +148,34 @@ async def asyncio_detailed(
116148
response = await client.get_async_httpx_client().request(**kwargs)
117149

118150
return _build_response(client=client, response=response)
151+
152+
153+
async def asyncio(
154+
name: str,
155+
*,
156+
client: AuthenticatedClient,
157+
environment: Union[Unset, str] = UNSET,
158+
) -> Optional[DeleteSecretResponse]:
159+
"""Delete secret
160+
161+
Delete a secret by name.
162+
163+
Args:
164+
name (str): The name of the secret to delete.
165+
environment (Union[Unset, str]): The environment of the secret to delete.
166+
167+
Raises:
168+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
169+
httpx.TimeoutException: If the request takes longer than Client.timeout.
170+
171+
Returns:
172+
DeleteSecretResponse
173+
"""
174+
175+
return (
176+
await asyncio_detailed(
177+
name=name,
178+
client=client,
179+
environment=environment,
180+
)
181+
).parsed
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
from http import HTTPStatus
2+
from typing import Any, Optional, Union
3+
4+
import httpx
5+
6+
from ... import errors
7+
from ...client import AuthenticatedClient, Client
8+
from ...models.export_catalogs_params import ExportCatalogsParams
9+
from ...models.export_catalogs_response import ExportCatalogsResponse
10+
from ...types import Response
11+
12+
13+
def _get_kwargs(
14+
*,
15+
body: ExportCatalogsParams,
16+
) -> dict[str, Any]:
17+
headers: dict[str, Any] = {}
18+
19+
_kwargs: dict[str, Any] = {
20+
"method": "post",
21+
"url": "/catalogs/export",
22+
}
23+
24+
_body = body.to_dict()
25+
26+
_kwargs["json"] = _body
27+
headers["Content-Type"] = "application/json"
28+
29+
_kwargs["headers"] = headers
30+
return _kwargs
31+
32+
33+
def _parse_response(
34+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
35+
) -> Optional[ExportCatalogsResponse]:
36+
if response.status_code == 200:
37+
response_200 = ExportCatalogsResponse.from_dict(response.json())
38+
39+
return response_200
40+
if client.raise_on_unexpected_status:
41+
raise errors.UnexpectedStatus(response.status_code, response.content)
42+
else:
43+
return None
44+
45+
46+
def _build_response(
47+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
48+
) -> Response[ExportCatalogsResponse]:
49+
return Response(
50+
status_code=HTTPStatus(response.status_code),
51+
content=response.content,
52+
headers=response.headers,
53+
parsed=_parse_response(client=client, response=response),
54+
)
55+
56+
57+
def sync_detailed(
58+
*,
59+
client: AuthenticatedClient,
60+
body: ExportCatalogsParams,
61+
) -> Response[ExportCatalogsResponse]:
62+
"""Export catalogs
63+
64+
Lists all the catalogs in your current account and re-encrypt them with the public key you supplied.
65+
66+
Args:
67+
body (ExportCatalogsParams):
68+
69+
Raises:
70+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
71+
httpx.TimeoutException: If the request takes longer than Client.timeout.
72+
73+
Returns:
74+
Response[ExportCatalogsResponse]
75+
"""
76+
77+
kwargs = _get_kwargs(
78+
body=body,
79+
)
80+
81+
response = client.get_httpx_client().request(
82+
**kwargs,
83+
)
84+
85+
return _build_response(client=client, response=response)
86+
87+
88+
def sync(
89+
*,
90+
client: AuthenticatedClient,
91+
body: ExportCatalogsParams,
92+
) -> Optional[ExportCatalogsResponse]:
93+
"""Export catalogs
94+
95+
Lists all the catalogs in your current account and re-encrypt them with the public key you supplied.
96+
97+
Args:
98+
body (ExportCatalogsParams):
99+
100+
Raises:
101+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
102+
httpx.TimeoutException: If the request takes longer than Client.timeout.
103+
104+
Returns:
105+
ExportCatalogsResponse
106+
"""
107+
108+
return sync_detailed(
109+
client=client,
110+
body=body,
111+
).parsed
112+
113+
114+
async def asyncio_detailed(
115+
*,
116+
client: AuthenticatedClient,
117+
body: ExportCatalogsParams,
118+
) -> Response[ExportCatalogsResponse]:
119+
"""Export catalogs
120+
121+
Lists all the catalogs in your current account and re-encrypt them with the public key you supplied.
122+
123+
Args:
124+
body (ExportCatalogsParams):
125+
126+
Raises:
127+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
128+
httpx.TimeoutException: If the request takes longer than Client.timeout.
129+
130+
Returns:
131+
Response[ExportCatalogsResponse]
132+
"""
133+
134+
kwargs = _get_kwargs(
135+
body=body,
136+
)
137+
138+
response = await client.get_async_httpx_client().request(**kwargs)
139+
140+
return _build_response(client=client, response=response)
141+
142+
143+
async def asyncio(
144+
*,
145+
client: AuthenticatedClient,
146+
body: ExportCatalogsParams,
147+
) -> Optional[ExportCatalogsResponse]:
148+
"""Export catalogs
149+
150+
Lists all the catalogs in your current account and re-encrypt them with the public key you supplied.
151+
152+
Args:
153+
body (ExportCatalogsParams):
154+
155+
Raises:
156+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
157+
httpx.TimeoutException: If the request takes longer than Client.timeout.
158+
159+
Returns:
160+
ExportCatalogsResponse
161+
"""
162+
163+
return (
164+
await asyncio_detailed(
165+
client=client,
166+
body=body,
167+
)
168+
).parsed

0 commit comments

Comments
 (0)