v1.0.13 (#4674)
This commit is contained in:
@@ -1111,6 +1111,124 @@ class RawSkyvern:
|
||||
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
||||
|
||||
def get_workflow(
|
||||
self,
|
||||
workflow_permanent_id: str,
|
||||
*,
|
||||
version: typing.Optional[int] = None,
|
||||
template: typing.Optional[bool] = None,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
) -> HttpResponse[Workflow]:
|
||||
"""
|
||||
Parameters
|
||||
----------
|
||||
workflow_permanent_id : str
|
||||
|
||||
version : typing.Optional[int]
|
||||
|
||||
template : typing.Optional[bool]
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
HttpResponse[Workflow]
|
||||
Successful Response
|
||||
"""
|
||||
_response = self._client_wrapper.httpx_client.request(
|
||||
f"v1/workflows/{jsonable_encoder(workflow_permanent_id)}",
|
||||
method="GET",
|
||||
params={
|
||||
"version": version,
|
||||
"template": template,
|
||||
},
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
_data = typing.cast(
|
||||
Workflow,
|
||||
parse_obj_as(
|
||||
type_=Workflow, # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
return HttpResponse(response=_response, data=_data)
|
||||
if _response.status_code == 422:
|
||||
raise UnprocessableEntityError(
|
||||
headers=dict(_response.headers),
|
||||
body=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, headers=dict(_response.headers), body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
||||
|
||||
def get_workflow_versions(
|
||||
self,
|
||||
workflow_permanent_id: str,
|
||||
*,
|
||||
template: typing.Optional[bool] = None,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
) -> HttpResponse[typing.List[Workflow]]:
|
||||
"""
|
||||
Get all versions of a workflow by its permanent ID.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
workflow_permanent_id : str
|
||||
|
||||
template : typing.Optional[bool]
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
HttpResponse[typing.List[Workflow]]
|
||||
Successful Response
|
||||
"""
|
||||
_response = self._client_wrapper.httpx_client.request(
|
||||
f"v1/workflows/{jsonable_encoder(workflow_permanent_id)}/versions",
|
||||
method="GET",
|
||||
params={
|
||||
"template": template,
|
||||
},
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
_data = typing.cast(
|
||||
typing.List[Workflow],
|
||||
parse_obj_as(
|
||||
type_=typing.List[Workflow], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
return HttpResponse(response=_response, data=_data)
|
||||
if _response.status_code == 422:
|
||||
raise UnprocessableEntityError(
|
||||
headers=dict(_response.headers),
|
||||
body=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, headers=dict(_response.headers), body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
||||
|
||||
def upload_file(
|
||||
self, *, file: core.File, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> HttpResponse[UploadFileResponse]:
|
||||
@@ -3943,6 +4061,124 @@ class AsyncRawSkyvern:
|
||||
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
||||
|
||||
async def get_workflow(
|
||||
self,
|
||||
workflow_permanent_id: str,
|
||||
*,
|
||||
version: typing.Optional[int] = None,
|
||||
template: typing.Optional[bool] = None,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
) -> AsyncHttpResponse[Workflow]:
|
||||
"""
|
||||
Parameters
|
||||
----------
|
||||
workflow_permanent_id : str
|
||||
|
||||
version : typing.Optional[int]
|
||||
|
||||
template : typing.Optional[bool]
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
AsyncHttpResponse[Workflow]
|
||||
Successful Response
|
||||
"""
|
||||
_response = await self._client_wrapper.httpx_client.request(
|
||||
f"v1/workflows/{jsonable_encoder(workflow_permanent_id)}",
|
||||
method="GET",
|
||||
params={
|
||||
"version": version,
|
||||
"template": template,
|
||||
},
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
_data = typing.cast(
|
||||
Workflow,
|
||||
parse_obj_as(
|
||||
type_=Workflow, # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
return AsyncHttpResponse(response=_response, data=_data)
|
||||
if _response.status_code == 422:
|
||||
raise UnprocessableEntityError(
|
||||
headers=dict(_response.headers),
|
||||
body=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, headers=dict(_response.headers), body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
||||
|
||||
async def get_workflow_versions(
|
||||
self,
|
||||
workflow_permanent_id: str,
|
||||
*,
|
||||
template: typing.Optional[bool] = None,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
) -> AsyncHttpResponse[typing.List[Workflow]]:
|
||||
"""
|
||||
Get all versions of a workflow by its permanent ID.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
workflow_permanent_id : str
|
||||
|
||||
template : typing.Optional[bool]
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
AsyncHttpResponse[typing.List[Workflow]]
|
||||
Successful Response
|
||||
"""
|
||||
_response = await self._client_wrapper.httpx_client.request(
|
||||
f"v1/workflows/{jsonable_encoder(workflow_permanent_id)}/versions",
|
||||
method="GET",
|
||||
params={
|
||||
"template": template,
|
||||
},
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
_data = typing.cast(
|
||||
typing.List[Workflow],
|
||||
parse_obj_as(
|
||||
type_=typing.List[Workflow], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
return AsyncHttpResponse(response=_response, data=_data)
|
||||
if _response.status_code == 422:
|
||||
raise UnprocessableEntityError(
|
||||
headers=dict(_response.headers),
|
||||
body=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, headers=dict(_response.headers), body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
||||
|
||||
async def upload_file(
|
||||
self, *, file: core.File, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> AsyncHttpResponse[UploadFileResponse]:
|
||||
|
||||
Reference in New Issue
Block a user