| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 46c3cec commit ab25412
10 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - configured_endpoints: 2323 | ||
| 2 | - openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare/cloudflare-baa9c57c8cec8fa2999dd365dc419d59f0c5be8b772344ceb722e4cd08563c6f.yml | ||
| 1 | + configured_endpoints: 2325 | ||
| 2 | + openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare/cloudflare-eeab7a57d84f76af6bb611b6eb115f3ab818505d7f8d09c35751d4ba4bb0788e.yml | ||
| 3 | 3 | openapi_spec_hash: 63308a10826084e5f64b82f361d8dcd2 | |
| 4 | - config_hash: d356305f9e4bef414359ff0156867a23 | ||
| 4 | + config_hash: 3e02eec9f8dbb1c042399a4bea3363d2 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,6 +28,7 @@ from cloudflare.types.workflows import ( | |||
| 28 | 28 | InstanceListResponse, | |
| 29 | 29 | InstanceBulkResponse, | |
| 30 | 30 | InstanceGetResponse, | |
| 31 | + InstanceStepResponse, | ||
| 31 | 32 | ) | |
| 32 | 33 | ``` | |
| 33 | 34 | ||
@@ -37,6 +38,7 @@ Methods: | |||
| 37 | 38 | - <code title="get /accounts/{account_id}/workflows/{workflow_name}/instances">client.workflows.instances.<a href="./src/cloudflare/resources/workflows/instances/instances.py">list</a>(workflow_name, \*, account_id, \*\*<a href="src/cloudflare/types/workflows/instance_list_params.py">params</a>) -> <a href="./src/cloudflare/types/workflows/instance_list_response.py">SyncV4PagePaginationArray[InstanceListResponse]</a></code> | |
| 38 | 39 | - <code title="post /accounts/{account_id}/workflows/{workflow_name}/instances/batch">client.workflows.instances.<a href="./src/cloudflare/resources/workflows/instances/instances.py">bulk</a>(workflow_name, \*, account_id, \*\*<a href="src/cloudflare/types/workflows/instance_bulk_params.py">params</a>) -> <a href="./src/cloudflare/types/workflows/instance_bulk_response.py">SyncSinglePage[InstanceBulkResponse]</a></code> | |
| 39 | 40 | - <code title="get /accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}">client.workflows.instances.<a href="./src/cloudflare/resources/workflows/instances/instances.py">get</a>(instance_id, \*, account_id, workflow_name, \*\*<a href="src/cloudflare/types/workflows/instance_get_params.py">params</a>) -> <a href="./src/cloudflare/types/workflows/instance_get_response.py">InstanceGetResponse</a></code> | |
| 41 | + - <code title="get /accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}/step">client.workflows.instances.<a href="./src/cloudflare/resources/workflows/instances/instances.py">step</a>(instance_id, \*, account_id, workflow_name, \*\*<a href="src/cloudflare/types/workflows/instance_step_params.py">params</a>) -> <a href="./src/cloudflare/types/workflows/instance_step_response.py">InstanceStepResponse</a></code> | ||
| 40 | 42 | ||
| 41 | 43 | ### Status | |
| 42 | 44 | ||
@@ -61,10 +63,11 @@ Methods: | |||
| 61 | 63 | Types: | |
| 62 | 64 | ||
| 63 | 65 | ```python | |
| 64 | - from cloudflare.types.workflows import VersionListResponse, VersionGetResponse | ||
| 66 | + from cloudflare.types.workflows import VersionListResponse, VersionGetResponse, VersionGraphResponse | ||
| 65 | 67 | ``` | |
| 66 | 68 | ||
| 67 | 69 | Methods: | |
| 68 | 70 | ||
| 69 | 71 | - <code title="get /accounts/{account_id}/workflows/{workflow_name}/versions">client.workflows.versions.<a href="./src/cloudflare/resources/workflows/versions.py">list</a>(workflow_name, \*, account_id, \*\*<a href="src/cloudflare/types/workflows/version_list_params.py">params</a>) -> <a href="./src/cloudflare/types/workflows/version_list_response.py">SyncV4PagePaginationArray[VersionListResponse]</a></code> | |
| 70 | 72 | - <code title="get /accounts/{account_id}/workflows/{workflow_name}/versions/{version_id}">client.workflows.versions.<a href="./src/cloudflare/resources/workflows/versions.py">get</a>(version_id, \*, account_id, workflow_name) -> <a href="./src/cloudflare/types/workflows/version_get_response.py">VersionGetResponse</a></code> | |
| 73 | + - <code title="get /accounts/{account_id}/workflows/{workflow_name}/versions/{version_id}/graph">client.workflows.versions.<a href="./src/cloudflare/resources/workflows/versions.py">graph</a>(version_id, \*, account_id, workflow_name) -> <a href="./src/cloudflare/types/workflows/version_graph_response.py">VersionGraphResponse</a></code> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,10 +37,17 @@ | |||
| 37 | 37 | from ...._wrappers import ResultWrapper | |
| 38 | 38 | from ....pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray | |
| 39 | 39 | from ...._base_client import AsyncPaginator, make_request_options | |
| 40 | - from ....types.workflows import instance_get_params, instance_bulk_params, instance_list_params, instance_create_params | ||
| 40 | + from ....types.workflows import ( | ||
| 41 | + instance_get_params, | ||
| 42 | + instance_bulk_params, | ||
| 43 | + instance_list_params, | ||
| 44 | + instance_step_params, | ||
| 45 | + instance_create_params, | ||
| 46 | + ) | ||
| 41 | 47 | from ....types.workflows.instance_get_response import InstanceGetResponse | |
| 42 | 48 | from ....types.workflows.instance_bulk_response import InstanceBulkResponse | |
| 43 | 49 | from ....types.workflows.instance_list_response import InstanceListResponse | |
| 50 | + from ....types.workflows.instance_step_response import InstanceStepResponse | ||
| 44 | 51 | from ....types.workflows.instance_create_response import InstanceCreateResponse | |
| 45 | 52 | ||
| 46 | 53 | __all__ = ["InstancesResource", "AsyncInstancesResource"] | |
@@ -318,6 +325,80 @@ def get( | |||
| 318 | 325 | cast_to=cast(Type[InstanceGetResponse], ResultWrapper[InstanceGetResponse]), | |
| 319 | 326 | ) | |
| 320 | 327 | ||
| 328 | + def step( | ||
| 329 | + self, | ||
| 330 | + instance_id: str, | ||
| 331 | + *, | ||
| 332 | + account_id: str, | ||
| 333 | + workflow_name: str, | ||
| 334 | + name: str, | ||
| 335 | + type: Literal["step", "waitForEvent"], | ||
| 336 | + attempt: int | Omit = omit, | ||
| 337 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. | ||
| 338 | + # The extra values given here take precedence over values defined on the client or passed to this method. | ||
| 339 | + extra_headers: Headers | None = None, | ||
| 340 | + extra_query: Query | None = None, | ||
| 341 | + extra_body: Body | None = None, | ||
| 342 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, | ||
| 343 | + ) -> InstanceStepResponse: | ||
| 344 | + """ | ||
| 345 | + Retrieves the full, untruncated output for a specific step on a workflow | ||
| 346 | + instance. Returns a flat status-shaped JSON body with step `status` ('running' | | ||
| 347 | + 'waiting' | 'complete' | 'errored'), `error` (nullable), and `output` (the step | ||
| 348 | + value, or null while running/waiting/errored). When the step returned a | ||
| 349 | + ReadableStream from step.do, the response is served as | ||
| 350 | + 'application/octet-stream' with the raw bytes as the body instead of JSON. A | ||
| 351 | + `status='running'` response with non-null `error` indicates the step is | ||
| 352 | + currently retrying after a prior attempt failed. | ||
| 353 | + | ||
| 354 | + Args: | ||
| 355 | + name: Exact step name from the instance logs response, including the generated counter | ||
| 356 | + suffix. | ||
| 357 | + | ||
| 358 | + type: Step type to disambiguate step.do and waitForEvent entries that share the same | ||
| 359 | + name. | ||
| 360 | + | ||
| 361 | + attempt: Specific attempt number to retrieve output or error for. | ||
| 362 | + | ||
| 363 | + extra_headers: Send extra headers | ||
| 364 | + | ||
| 365 | + extra_query: Add additional query parameters to the request | ||
| 366 | + | ||
| 367 | + extra_body: Add additional JSON properties to the request | ||
| 368 | + | ||
| 369 | + timeout: Override the client-level default timeout for this request, in seconds | ||
| 370 | + """ | ||
| 371 | + if not account_id: | ||
| 372 | + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") | ||
| 373 | + if not workflow_name: | ||
| 374 | + raise ValueError(f"Expected a non-empty value for `workflow_name` but received {workflow_name!r}") | ||
| 375 | + if not instance_id: | ||
| 376 | + raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}") | ||
| 377 | + return self._get( | ||
| 378 | + path_template( | ||
| 379 | + "/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}/step", | ||
| 380 | + account_id=account_id, | ||
| 381 | + workflow_name=workflow_name, | ||
| 382 | + instance_id=instance_id, | ||
| 383 | + ), | ||
| 384 | + options=make_request_options( | ||
| 385 | + extra_headers=extra_headers, | ||
| 386 | + extra_query=extra_query, | ||
| 387 | + extra_body=extra_body, | ||
| 388 | + timeout=timeout, | ||
| 389 | + query=maybe_transform( | ||
| 390 | + { | ||
| 391 | + "name": name, | ||
| 392 | + "type": type, | ||
| 393 | + "attempt": attempt, | ||
| 394 | + }, | ||
| 395 | + instance_step_params.InstanceStepParams, | ||
| 396 | + ), | ||
| 397 | + post_parser=ResultWrapper[InstanceStepResponse]._unwrapper, | ||
| 398 | + ), | ||
| 399 | + cast_to=cast(Type[InstanceStepResponse], ResultWrapper[InstanceStepResponse]), | ||
| 400 | + ) | ||
| 401 | + | ||
| 321 | 402 | ||
| 322 | 403 | class AsyncInstancesResource(AsyncAPIResource): | |
| 323 | 404 | @cached_property | |
@@ -591,6 +672,80 @@ async def get( | |||
| 591 | 672 | cast_to=cast(Type[InstanceGetResponse], ResultWrapper[InstanceGetResponse]), | |
| 592 | 673 | ) | |
| 593 | 674 | ||
| 675 | + async def step( | ||
| 676 | + self, | ||
| 677 | + instance_id: str, | ||
| 678 | + *, | ||
| 679 | + account_id: str, | ||
| 680 | + workflow_name: str, | ||
| 681 | + name: str, | ||
| 682 | + type: Literal["step", "waitForEvent"], | ||
| 683 | + attempt: int | Omit = omit, | ||
| 684 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. | ||
| 685 | + # The extra values given here take precedence over values defined on the client or passed to this method. | ||
| 686 | + extra_headers: Headers | None = None, | ||
| 687 | + extra_query: Query | None = None, | ||
| 688 | + extra_body: Body | None = None, | ||
| 689 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, | ||
| 690 | + ) -> InstanceStepResponse: | ||
| 691 | + """ | ||
| 692 | + Retrieves the full, untruncated output for a specific step on a workflow | ||
| 693 | + instance. Returns a flat status-shaped JSON body with step `status` ('running' | | ||
| 694 | + 'waiting' | 'complete' | 'errored'), `error` (nullable), and `output` (the step | ||
| 695 | + value, or null while running/waiting/errored). When the step returned a | ||
| 696 | + ReadableStream from step.do, the response is served as | ||
| 697 | + 'application/octet-stream' with the raw bytes as the body instead of JSON. A | ||
| 698 | + `status='running'` response with non-null `error` indicates the step is | ||
| 699 | + currently retrying after a prior attempt failed. | ||
| 700 | + | ||
| 701 | + Args: | ||
| 702 | + name: Exact step name from the instance logs response, including the generated counter | ||
| 703 | + suffix. | ||
| 704 | + | ||
| 705 | + type: Step type to disambiguate step.do and waitForEvent entries that share the same | ||
| 706 | + name. | ||
| 707 | + | ||
| 708 | + attempt: Specific attempt number to retrieve output or error for. | ||
| 709 | + | ||
| 710 | + extra_headers: Send extra headers | ||
| 711 | + | ||
| 712 | + extra_query: Add additional query parameters to the request | ||
| 713 | + | ||
| 714 | + extra_body: Add additional JSON properties to the request | ||
| 715 | + | ||
| 716 | + timeout: Override the client-level default timeout for this request, in seconds | ||
| 717 | + """ | ||
| 718 | + if not account_id: | ||
| 719 | + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") | ||
| 720 | + if not workflow_name: | ||
| 721 | + raise ValueError(f"Expected a non-empty value for `workflow_name` but received {workflow_name!r}") | ||
| 722 | + if not instance_id: | ||
| 723 | + raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}") | ||
| 724 | + return await self._get( | ||
| 725 | + path_template( | ||
| 726 | + "/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}/step", | ||
| 727 | + account_id=account_id, | ||
| 728 | + workflow_name=workflow_name, | ||
| 729 | + instance_id=instance_id, | ||
| 730 | + ), | ||
| 731 | + options=make_request_options( | ||
| 732 | + extra_headers=extra_headers, | ||
| 733 | + extra_query=extra_query, | ||
| 734 | + extra_body=extra_body, | ||
| 735 | + timeout=timeout, | ||
| 736 | + query=await async_maybe_transform( | ||
| 737 | + { | ||
| 738 | + "name": name, | ||
| 739 | + "type": type, | ||
| 740 | + "attempt": attempt, | ||
| 741 | + }, | ||
| 742 | + instance_step_params.InstanceStepParams, | ||
| 743 | + ), | ||
| 744 | + post_parser=ResultWrapper[InstanceStepResponse]._unwrapper, | ||
| 745 | + ), | ||
| 746 | + cast_to=cast(Type[InstanceStepResponse], ResultWrapper[InstanceStepResponse]), | ||
| 747 | + ) | ||
| 748 | + | ||
| 594 | 749 | ||
| 595 | 750 | class InstancesResourceWithRawResponse: | |
| 596 | 751 | def __init__(self, instances: InstancesResource) -> None: | |
@@ -608,6 +763,9 @@ def __init__(self, instances: InstancesResource) -> None: | |||
| 608 | 763 | self.get = to_raw_response_wrapper( | |
| 609 | 764 | instances.get, | |
| 610 | 765 | ) | |
| 766 | + self.step = to_raw_response_wrapper( | ||
| 767 | + instances.step, | ||
| 768 | + ) | ||
| 611 | 769 | ||
| 612 | 770 | @cached_property | |
| 613 | 771 | def status(self) -> StatusResourceWithRawResponse: | |
@@ -634,6 +792,9 @@ def __init__(self, instances: AsyncInstancesResource) -> None: | |||
| 634 | 792 | self.get = async_to_raw_response_wrapper( | |
| 635 | 793 | instances.get, | |
| 636 | 794 | ) | |
| 795 | + self.step = async_to_raw_response_wrapper( | ||
| 796 | + instances.step, | ||
| 797 | + ) | ||
| 637 | 798 | ||
| 638 | 799 | @cached_property | |
| 639 | 800 | def status(self) -> AsyncStatusResourceWithRawResponse: | |
@@ -660,6 +821,9 @@ def __init__(self, instances: InstancesResource) -> None: | |||
| 660 | 821 | self.get = to_streamed_response_wrapper( | |
| 661 | 822 | instances.get, | |
| 662 | 823 | ) | |
| 824 | + self.step = to_streamed_response_wrapper( | ||
| 825 | + instances.step, | ||
| 826 | + ) | ||
| 663 | 827 | ||
| 664 | 828 | @cached_property | |
| 665 | 829 | def status(self) -> StatusResourceWithStreamingResponse: | |
@@ -686,6 +850,9 @@ def __init__(self, instances: AsyncInstancesResource) -> None: | |||
| 686 | 850 | self.get = async_to_streamed_response_wrapper( | |
| 687 | 851 | instances.get, | |
| 688 | 852 | ) | |
| 853 | + self.step = async_to_streamed_response_wrapper( | ||
| 854 | + instances.step, | ||
| 855 | + ) | ||
| 689 | 856 | ||
| 690 | 857 | @cached_property | |
| 691 | 858 | def status(self) -> AsyncStatusResourceWithStreamingResponse: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments