Skip to content

Commit 65db1ae

Browse files
fix: Regenerating clients with autorest
1 parent 5285c30 commit 65db1ae

File tree

4 files changed

+262
-0
lines changed

4 files changed

+262
-0
lines changed

diracx-client/src/diracx/client/_generated/aio/operations/_operations.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
build_auth_initiate_authorization_flow_request,
3535
build_auth_initiate_device_flow_request,
3636
build_auth_pilot_login_request,
37+
build_auth_refresh_pilot_tokens_request,
3738
build_auth_revoke_refresh_token_request,
3839
build_auth_userinfo_request,
3940
build_config_serve_config_request,
@@ -892,6 +893,60 @@ async def pilot_login(
892893

893894
return deserialized # type: ignore
894895

896+
@distributed_trace_async
897+
async def refresh_pilot_tokens(self, *, refresh_token: str, **kwargs: Any) -> Any:
898+
"""Refresh Pilot Tokens.
899+
900+
Endpoint where a pilot can exchange a refresh token against a token.
901+
902+
:keyword refresh_token: Required.
903+
:paramtype refresh_token: str
904+
:return: any
905+
:rtype: any
906+
:raises ~azure.core.exceptions.HttpResponseError:
907+
"""
908+
error_map: MutableMapping = {
909+
401: ClientAuthenticationError,
910+
404: ResourceNotFoundError,
911+
409: ResourceExistsError,
912+
304: ResourceNotModifiedError,
913+
}
914+
error_map.update(kwargs.pop("error_map", {}) or {})
915+
916+
_headers = kwargs.pop("headers", {}) or {}
917+
_params = kwargs.pop("params", {}) or {}
918+
919+
cls: ClsType[Any] = kwargs.pop("cls", None)
920+
921+
_request = build_auth_refresh_pilot_tokens_request(
922+
refresh_token=refresh_token,
923+
headers=_headers,
924+
params=_params,
925+
)
926+
_request.url = self._client.format_url(_request.url)
927+
928+
_stream = False
929+
pipeline_response: PipelineResponse = (
930+
await self._client._pipeline.run( # pylint: disable=protected-access
931+
_request, stream=_stream, **kwargs
932+
)
933+
)
934+
935+
response = pipeline_response.http_response
936+
937+
if response.status_code not in [200]:
938+
map_error(
939+
status_code=response.status_code, response=response, error_map=error_map
940+
)
941+
raise HttpResponseError(response=response)
942+
943+
deserialized = self._deserialize("object", pipeline_response.http_response)
944+
945+
if cls:
946+
return cls(pipeline_response, deserialized, {}) # type: ignore
947+
948+
return deserialized # type: ignore
949+
895950

896951
class ConfigOperations:
897952
"""

diracx-client/src/diracx/client/_generated/operations/_operations.py

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,28 @@ def build_auth_pilot_login_request(
288288
)
289289

290290

291+
def build_auth_refresh_pilot_tokens_request(
292+
*, refresh_token: str, **kwargs: Any
293+
) -> HttpRequest:
294+
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
295+
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
296+
297+
accept = _headers.pop("Accept", "application/json")
298+
299+
# Construct URL
300+
_url = "/api/auth/pilot-refresh-token"
301+
302+
# Construct parameters
303+
_params["refresh_token"] = _SERIALIZER.query("refresh_token", refresh_token, "str")
304+
305+
# Construct headers
306+
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
307+
308+
return HttpRequest(
309+
method="POST", url=_url, params=_params, headers=_headers, **kwargs
310+
)
311+
312+
291313
def build_config_serve_config_request(
292314
*,
293315
if_modified_since: Optional[str] = None,
@@ -1551,6 +1573,60 @@ def pilot_login(
15511573

15521574
return deserialized # type: ignore
15531575

1576+
@distributed_trace
1577+
def refresh_pilot_tokens(self, *, refresh_token: str, **kwargs: Any) -> Any:
1578+
"""Refresh Pilot Tokens.
1579+
1580+
Endpoint where a pilot can exchange a refresh token against a token.
1581+
1582+
:keyword refresh_token: Required.
1583+
:paramtype refresh_token: str
1584+
:return: any
1585+
:rtype: any
1586+
:raises ~azure.core.exceptions.HttpResponseError:
1587+
"""
1588+
error_map: MutableMapping = {
1589+
401: ClientAuthenticationError,
1590+
404: ResourceNotFoundError,
1591+
409: ResourceExistsError,
1592+
304: ResourceNotModifiedError,
1593+
}
1594+
error_map.update(kwargs.pop("error_map", {}) or {})
1595+
1596+
_headers = kwargs.pop("headers", {}) or {}
1597+
_params = kwargs.pop("params", {}) or {}
1598+
1599+
cls: ClsType[Any] = kwargs.pop("cls", None)
1600+
1601+
_request = build_auth_refresh_pilot_tokens_request(
1602+
refresh_token=refresh_token,
1603+
headers=_headers,
1604+
params=_params,
1605+
)
1606+
_request.url = self._client.format_url(_request.url)
1607+
1608+
_stream = False
1609+
pipeline_response: PipelineResponse = (
1610+
self._client._pipeline.run( # pylint: disable=protected-access
1611+
_request, stream=_stream, **kwargs
1612+
)
1613+
)
1614+
1615+
response = pipeline_response.http_response
1616+
1617+
if response.status_code not in [200]:
1618+
map_error(
1619+
status_code=response.status_code, response=response, error_map=error_map
1620+
)
1621+
raise HttpResponseError(response=response)
1622+
1623+
deserialized = self._deserialize("object", pipeline_response.http_response)
1624+
1625+
if cls:
1626+
return cls(pipeline_response, deserialized, {}) # type: ignore
1627+
1628+
return deserialized # type: ignore
1629+
15541630

15551631
class ConfigOperations:
15561632
"""

extensions/gubbins/gubbins-client/src/gubbins/client/_generated/aio/operations/_operations.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
build_auth_initiate_authorization_flow_request,
3535
build_auth_initiate_device_flow_request,
3636
build_auth_pilot_login_request,
37+
build_auth_refresh_pilot_tokens_request,
3738
build_auth_revoke_refresh_token_request,
3839
build_auth_userinfo_request,
3940
build_config_serve_config_request,
@@ -892,6 +893,60 @@ async def pilot_login(
892893

893894
return deserialized # type: ignore
894895

896+
@distributed_trace_async
897+
async def refresh_pilot_tokens(self, *, refresh_token: str, **kwargs: Any) -> Any:
898+
"""Refresh Pilot Tokens.
899+
900+
Endpoint where a pilot can exchange a refresh token against a token.
901+
902+
:keyword refresh_token: Required.
903+
:paramtype refresh_token: str
904+
:return: any
905+
:rtype: any
906+
:raises ~azure.core.exceptions.HttpResponseError:
907+
"""
908+
error_map: MutableMapping = {
909+
401: ClientAuthenticationError,
910+
404: ResourceNotFoundError,
911+
409: ResourceExistsError,
912+
304: ResourceNotModifiedError,
913+
}
914+
error_map.update(kwargs.pop("error_map", {}) or {})
915+
916+
_headers = kwargs.pop("headers", {}) or {}
917+
_params = kwargs.pop("params", {}) or {}
918+
919+
cls: ClsType[Any] = kwargs.pop("cls", None)
920+
921+
_request = build_auth_refresh_pilot_tokens_request(
922+
refresh_token=refresh_token,
923+
headers=_headers,
924+
params=_params,
925+
)
926+
_request.url = self._client.format_url(_request.url)
927+
928+
_stream = False
929+
pipeline_response: PipelineResponse = (
930+
await self._client._pipeline.run( # pylint: disable=protected-access
931+
_request, stream=_stream, **kwargs
932+
)
933+
)
934+
935+
response = pipeline_response.http_response
936+
937+
if response.status_code not in [200]:
938+
map_error(
939+
status_code=response.status_code, response=response, error_map=error_map
940+
)
941+
raise HttpResponseError(response=response)
942+
943+
deserialized = self._deserialize("object", pipeline_response.http_response)
944+
945+
if cls:
946+
return cls(pipeline_response, deserialized, {}) # type: ignore
947+
948+
return deserialized # type: ignore
949+
895950

896951
class ConfigOperations:
897952
"""

extensions/gubbins/gubbins-client/src/gubbins/client/_generated/operations/_operations.py

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,28 @@ def build_auth_pilot_login_request(
288288
)
289289

290290

291+
def build_auth_refresh_pilot_tokens_request(
292+
*, refresh_token: str, **kwargs: Any
293+
) -> HttpRequest:
294+
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
295+
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
296+
297+
accept = _headers.pop("Accept", "application/json")
298+
299+
# Construct URL
300+
_url = "/api/auth/pilot-refresh-token"
301+
302+
# Construct parameters
303+
_params["refresh_token"] = _SERIALIZER.query("refresh_token", refresh_token, "str")
304+
305+
# Construct headers
306+
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
307+
308+
return HttpRequest(
309+
method="POST", url=_url, params=_params, headers=_headers, **kwargs
310+
)
311+
312+
291313
def build_config_serve_config_request(
292314
*,
293315
if_modified_since: Optional[str] = None,
@@ -1551,6 +1573,60 @@ def pilot_login(
15511573

15521574
return deserialized # type: ignore
15531575

1576+
@distributed_trace
1577+
def refresh_pilot_tokens(self, *, refresh_token: str, **kwargs: Any) -> Any:
1578+
"""Refresh Pilot Tokens.
1579+
1580+
Endpoint where a pilot can exchange a refresh token against a token.
1581+
1582+
:keyword refresh_token: Required.
1583+
:paramtype refresh_token: str
1584+
:return: any
1585+
:rtype: any
1586+
:raises ~azure.core.exceptions.HttpResponseError:
1587+
"""
1588+
error_map: MutableMapping = {
1589+
401: ClientAuthenticationError,
1590+
404: ResourceNotFoundError,
1591+
409: ResourceExistsError,
1592+
304: ResourceNotModifiedError,
1593+
}
1594+
error_map.update(kwargs.pop("error_map", {}) or {})
1595+
1596+
_headers = kwargs.pop("headers", {}) or {}
1597+
_params = kwargs.pop("params", {}) or {}
1598+
1599+
cls: ClsType[Any] = kwargs.pop("cls", None)
1600+
1601+
_request = build_auth_refresh_pilot_tokens_request(
1602+
refresh_token=refresh_token,
1603+
headers=_headers,
1604+
params=_params,
1605+
)
1606+
_request.url = self._client.format_url(_request.url)
1607+
1608+
_stream = False
1609+
pipeline_response: PipelineResponse = (
1610+
self._client._pipeline.run( # pylint: disable=protected-access
1611+
_request, stream=_stream, **kwargs
1612+
)
1613+
)
1614+
1615+
response = pipeline_response.http_response
1616+
1617+
if response.status_code not in [200]:
1618+
map_error(
1619+
status_code=response.status_code, response=response, error_map=error_map
1620+
)
1621+
raise HttpResponseError(response=response)
1622+
1623+
deserialized = self._deserialize("object", pipeline_response.http_response)
1624+
1625+
if cls:
1626+
return cls(pipeline_response, deserialized, {}) # type: ignore
1627+
1628+
return deserialized # type: ignore
1629+
15541630

15551631
class ConfigOperations:
15561632
"""

0 commit comments

Comments
 (0)