v0.1.83 - sdk update (#2379)
This commit is contained in:
@@ -37,7 +37,7 @@ class CredentialsClient:
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
) -> TotpCode:
|
||||
"""
|
||||
Forward a TOTP (2FA, MFA) code to Skyvern
|
||||
Forward a TOTP (2FA, MFA) email or sms message containing the code to Skyvern
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -282,6 +282,57 @@ class CredentialsClient:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
|
||||
def delete_credential(self, credential_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
||||
"""
|
||||
Deletes a specific credential by its ID
|
||||
|
||||
Parameters
|
||||
----------
|
||||
credential_id : str
|
||||
The unique identifier of the credential to delete
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
None
|
||||
|
||||
Examples
|
||||
--------
|
||||
from skyvern import Skyvern
|
||||
|
||||
client = Skyvern(
|
||||
api_key="YOUR_API_KEY",
|
||||
authorization="YOUR_AUTHORIZATION",
|
||||
)
|
||||
client.credentials.delete_credential(
|
||||
credential_id="cred_1234567890",
|
||||
)
|
||||
"""
|
||||
_response = self._client_wrapper.httpx_client.request(
|
||||
f"v1/credentials/{jsonable_encoder(credential_id)}/delete",
|
||||
method="POST",
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
return
|
||||
if _response.status_code == 422:
|
||||
raise UnprocessableEntityError(
|
||||
typing.cast(
|
||||
typing.Optional[typing.Any],
|
||||
parse_obj_as(
|
||||
type_=typing.Optional[typing.Any], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
)
|
||||
_response_json = _response.json()
|
||||
except JSONDecodeError:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
|
||||
def get_credential(
|
||||
self, credential_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> CredentialResponse:
|
||||
@@ -342,57 +393,6 @@ class CredentialsClient:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
|
||||
def delete_credential(self, credential_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
||||
"""
|
||||
Deletes a specific credential by its ID
|
||||
|
||||
Parameters
|
||||
----------
|
||||
credential_id : str
|
||||
The unique identifier of the credential to delete
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
None
|
||||
|
||||
Examples
|
||||
--------
|
||||
from skyvern import Skyvern
|
||||
|
||||
client = Skyvern(
|
||||
api_key="YOUR_API_KEY",
|
||||
authorization="YOUR_AUTHORIZATION",
|
||||
)
|
||||
client.credentials.delete_credential(
|
||||
credential_id="cred_1234567890",
|
||||
)
|
||||
"""
|
||||
_response = self._client_wrapper.httpx_client.request(
|
||||
f"v1/credentials/{jsonable_encoder(credential_id)}/delete",
|
||||
method="POST",
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
return
|
||||
if _response.status_code == 422:
|
||||
raise UnprocessableEntityError(
|
||||
typing.cast(
|
||||
typing.Optional[typing.Any],
|
||||
parse_obj_as(
|
||||
type_=typing.Optional[typing.Any], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
)
|
||||
_response_json = _response.json()
|
||||
except JSONDecodeError:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
|
||||
|
||||
class AsyncCredentialsClient:
|
||||
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
||||
@@ -411,7 +411,7 @@ class AsyncCredentialsClient:
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
) -> TotpCode:
|
||||
"""
|
||||
Forward a TOTP (2FA, MFA) code to Skyvern
|
||||
Forward a TOTP (2FA, MFA) email or sms message containing the code to Skyvern
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -680,6 +680,67 @@ class AsyncCredentialsClient:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
|
||||
async def delete_credential(
|
||||
self, credential_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> None:
|
||||
"""
|
||||
Deletes a specific credential by its ID
|
||||
|
||||
Parameters
|
||||
----------
|
||||
credential_id : str
|
||||
The unique identifier of the credential to delete
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
None
|
||||
|
||||
Examples
|
||||
--------
|
||||
import asyncio
|
||||
|
||||
from skyvern import AsyncSkyvern
|
||||
|
||||
client = AsyncSkyvern(
|
||||
api_key="YOUR_API_KEY",
|
||||
authorization="YOUR_AUTHORIZATION",
|
||||
)
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
await client.credentials.delete_credential(
|
||||
credential_id="cred_1234567890",
|
||||
)
|
||||
|
||||
|
||||
asyncio.run(main())
|
||||
"""
|
||||
_response = await self._client_wrapper.httpx_client.request(
|
||||
f"v1/credentials/{jsonable_encoder(credential_id)}/delete",
|
||||
method="POST",
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
return
|
||||
if _response.status_code == 422:
|
||||
raise UnprocessableEntityError(
|
||||
typing.cast(
|
||||
typing.Optional[typing.Any],
|
||||
parse_obj_as(
|
||||
type_=typing.Optional[typing.Any], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
)
|
||||
_response_json = _response.json()
|
||||
except JSONDecodeError:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
|
||||
async def get_credential(
|
||||
self, credential_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> CredentialResponse:
|
||||
@@ -747,64 +808,3 @@ class AsyncCredentialsClient:
|
||||
except JSONDecodeError:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
|
||||
async def delete_credential(
|
||||
self, credential_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> None:
|
||||
"""
|
||||
Deletes a specific credential by its ID
|
||||
|
||||
Parameters
|
||||
----------
|
||||
credential_id : str
|
||||
The unique identifier of the credential to delete
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
None
|
||||
|
||||
Examples
|
||||
--------
|
||||
import asyncio
|
||||
|
||||
from skyvern import AsyncSkyvern
|
||||
|
||||
client = AsyncSkyvern(
|
||||
api_key="YOUR_API_KEY",
|
||||
authorization="YOUR_AUTHORIZATION",
|
||||
)
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
await client.credentials.delete_credential(
|
||||
credential_id="cred_1234567890",
|
||||
)
|
||||
|
||||
|
||||
asyncio.run(main())
|
||||
"""
|
||||
_response = await self._client_wrapper.httpx_client.request(
|
||||
f"v1/credentials/{jsonable_encoder(credential_id)}/delete",
|
||||
method="POST",
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
return
|
||||
if _response.status_code == 422:
|
||||
raise UnprocessableEntityError(
|
||||
typing.cast(
|
||||
typing.Optional[typing.Any],
|
||||
parse_obj_as(
|
||||
type_=typing.Optional[typing.Any], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
)
|
||||
_response_json = _response.json()
|
||||
except JSONDecodeError:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
|
||||
Reference in New Issue
Block a user