hatchet-sdk 1.9.1__py3-none-any.whl → 1.10.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of hatchet-sdk might be problematic. Click here for more details.

Files changed (43) hide show
  1. hatchet_sdk/__init__.py +5 -1
  2. hatchet_sdk/client.py +2 -0
  3. hatchet_sdk/clients/admin.py +2 -6
  4. hatchet_sdk/clients/dispatcher/action_listener.py +43 -23
  5. hatchet_sdk/clients/events.py +58 -8
  6. hatchet_sdk/clients/rest/__init__.py +11 -0
  7. hatchet_sdk/clients/rest/api/__init__.py +1 -0
  8. hatchet_sdk/clients/rest/api/event_api.py +335 -0
  9. hatchet_sdk/clients/rest/api/filter_api.py +1305 -0
  10. hatchet_sdk/clients/rest/api/task_api.py +51 -0
  11. hatchet_sdk/clients/rest/api/workflow_runs_api.py +34 -0
  12. hatchet_sdk/clients/rest/models/__init__.py +10 -0
  13. hatchet_sdk/clients/rest/models/create_event_request.py +16 -2
  14. hatchet_sdk/clients/rest/models/v1_create_filter_request.py +99 -0
  15. hatchet_sdk/clients/rest/models/v1_event.py +142 -0
  16. hatchet_sdk/clients/rest/models/v1_event_list.py +110 -0
  17. hatchet_sdk/clients/rest/models/v1_event_workflow_run_summary.py +101 -0
  18. hatchet_sdk/clients/rest/models/v1_filter.py +127 -0
  19. hatchet_sdk/clients/rest/models/v1_filter_list.py +110 -0
  20. hatchet_sdk/clients/rest/models/v1_log_line.py +21 -2
  21. hatchet_sdk/clients/rest/models/v1_task_event.py +12 -0
  22. hatchet_sdk/clients/rest/models/v1_task_summary.py +12 -0
  23. hatchet_sdk/clients/rest/models/v1_task_timing.py +19 -0
  24. hatchet_sdk/clients/rest/models/workflow.py +5 -0
  25. hatchet_sdk/config.py +42 -0
  26. hatchet_sdk/context/context.py +1 -0
  27. hatchet_sdk/contracts/events_pb2.py +20 -20
  28. hatchet_sdk/contracts/events_pb2.pyi +14 -6
  29. hatchet_sdk/features/cron.py +1 -1
  30. hatchet_sdk/features/filters.py +181 -0
  31. hatchet_sdk/features/runs.py +7 -1
  32. hatchet_sdk/features/scheduled.py +1 -1
  33. hatchet_sdk/features/workflows.py +1 -1
  34. hatchet_sdk/hatchet.py +82 -71
  35. hatchet_sdk/opentelemetry/instrumentor.py +7 -2
  36. hatchet_sdk/runnables/standalone.py +6 -0
  37. hatchet_sdk/runnables/workflow.py +29 -2
  38. hatchet_sdk/utils/opentelemetry.py +19 -0
  39. hatchet_sdk/worker/worker.py +1 -1
  40. {hatchet_sdk-1.9.1.dist-info → hatchet_sdk-1.10.1.dist-info}/METADATA +1 -1
  41. {hatchet_sdk-1.9.1.dist-info → hatchet_sdk-1.10.1.dist-info}/RECORD +43 -34
  42. {hatchet_sdk-1.9.1.dist-info → hatchet_sdk-1.10.1.dist-info}/WHEEL +0 -0
  43. {hatchet_sdk-1.9.1.dist-info → hatchet_sdk-1.10.1.dist-info}/entry_points.txt +0 -0
@@ -37,6 +37,7 @@ from hatchet_sdk.clients.rest.models.event_update_cancel200_response import (
37
37
  )
38
38
  from hatchet_sdk.clients.rest.models.events import Events
39
39
  from hatchet_sdk.clients.rest.models.replay_event_request import ReplayEventRequest
40
+ from hatchet_sdk.clients.rest.models.v1_event_list import V1EventList
40
41
  from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus
41
42
  from hatchet_sdk.clients.rest.rest import RESTResponseType
42
43
 
@@ -2546,3 +2547,337 @@ class EventApi:
2546
2547
  _host=_host,
2547
2548
  _request_auth=_request_auth,
2548
2549
  )
2550
+
2551
+ @validate_call
2552
+ def v1_event_list(
2553
+ self,
2554
+ tenant: Annotated[
2555
+ str,
2556
+ Field(
2557
+ min_length=36, strict=True, max_length=36, description="The tenant id"
2558
+ ),
2559
+ ],
2560
+ offset: Annotated[
2561
+ Optional[StrictInt], Field(description="The number to skip")
2562
+ ] = None,
2563
+ limit: Annotated[
2564
+ Optional[StrictInt], Field(description="The number to limit by")
2565
+ ] = None,
2566
+ keys: Annotated[
2567
+ Optional[List[StrictStr]], Field(description="A list of keys to filter by")
2568
+ ] = None,
2569
+ _request_timeout: Union[
2570
+ None,
2571
+ Annotated[StrictFloat, Field(gt=0)],
2572
+ Tuple[
2573
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2574
+ ],
2575
+ ] = None,
2576
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2577
+ _content_type: Optional[StrictStr] = None,
2578
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2579
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2580
+ ) -> V1EventList:
2581
+ """List events
2582
+
2583
+ Lists all events for a tenant.
2584
+
2585
+ :param tenant: The tenant id (required)
2586
+ :type tenant: str
2587
+ :param offset: The number to skip
2588
+ :type offset: int
2589
+ :param limit: The number to limit by
2590
+ :type limit: int
2591
+ :param keys: A list of keys to filter by
2592
+ :type keys: List[str]
2593
+ :param _request_timeout: timeout setting for this request. If one
2594
+ number provided, it will be total request
2595
+ timeout. It can also be a pair (tuple) of
2596
+ (connection, read) timeouts.
2597
+ :type _request_timeout: int, tuple(int, int), optional
2598
+ :param _request_auth: set to override the auth_settings for an a single
2599
+ request; this effectively ignores the
2600
+ authentication in the spec for a single request.
2601
+ :type _request_auth: dict, optional
2602
+ :param _content_type: force content-type for the request.
2603
+ :type _content_type: str, Optional
2604
+ :param _headers: set to override the headers for a single
2605
+ request; this effectively ignores the headers
2606
+ in the spec for a single request.
2607
+ :type _headers: dict, optional
2608
+ :param _host_index: set to override the host_index for a single
2609
+ request; this effectively ignores the host_index
2610
+ in the spec for a single request.
2611
+ :type _host_index: int, optional
2612
+ :return: Returns the result object.
2613
+ """ # noqa: E501
2614
+
2615
+ _param = self._v1_event_list_serialize(
2616
+ tenant=tenant,
2617
+ offset=offset,
2618
+ limit=limit,
2619
+ keys=keys,
2620
+ _request_auth=_request_auth,
2621
+ _content_type=_content_type,
2622
+ _headers=_headers,
2623
+ _host_index=_host_index,
2624
+ )
2625
+
2626
+ _response_types_map: Dict[str, Optional[str]] = {
2627
+ "200": "V1EventList",
2628
+ "400": "APIErrors",
2629
+ "403": "APIErrors",
2630
+ }
2631
+ response_data = self.api_client.call_api(
2632
+ *_param, _request_timeout=_request_timeout
2633
+ )
2634
+ response_data.read()
2635
+ return self.api_client.response_deserialize(
2636
+ response_data=response_data,
2637
+ response_types_map=_response_types_map,
2638
+ ).data
2639
+
2640
+ @validate_call
2641
+ def v1_event_list_with_http_info(
2642
+ self,
2643
+ tenant: Annotated[
2644
+ str,
2645
+ Field(
2646
+ min_length=36, strict=True, max_length=36, description="The tenant id"
2647
+ ),
2648
+ ],
2649
+ offset: Annotated[
2650
+ Optional[StrictInt], Field(description="The number to skip")
2651
+ ] = None,
2652
+ limit: Annotated[
2653
+ Optional[StrictInt], Field(description="The number to limit by")
2654
+ ] = None,
2655
+ keys: Annotated[
2656
+ Optional[List[StrictStr]], Field(description="A list of keys to filter by")
2657
+ ] = None,
2658
+ _request_timeout: Union[
2659
+ None,
2660
+ Annotated[StrictFloat, Field(gt=0)],
2661
+ Tuple[
2662
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2663
+ ],
2664
+ ] = None,
2665
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2666
+ _content_type: Optional[StrictStr] = None,
2667
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2668
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2669
+ ) -> ApiResponse[V1EventList]:
2670
+ """List events
2671
+
2672
+ Lists all events for a tenant.
2673
+
2674
+ :param tenant: The tenant id (required)
2675
+ :type tenant: str
2676
+ :param offset: The number to skip
2677
+ :type offset: int
2678
+ :param limit: The number to limit by
2679
+ :type limit: int
2680
+ :param keys: A list of keys to filter by
2681
+ :type keys: List[str]
2682
+ :param _request_timeout: timeout setting for this request. If one
2683
+ number provided, it will be total request
2684
+ timeout. It can also be a pair (tuple) of
2685
+ (connection, read) timeouts.
2686
+ :type _request_timeout: int, tuple(int, int), optional
2687
+ :param _request_auth: set to override the auth_settings for an a single
2688
+ request; this effectively ignores the
2689
+ authentication in the spec for a single request.
2690
+ :type _request_auth: dict, optional
2691
+ :param _content_type: force content-type for the request.
2692
+ :type _content_type: str, Optional
2693
+ :param _headers: set to override the headers for a single
2694
+ request; this effectively ignores the headers
2695
+ in the spec for a single request.
2696
+ :type _headers: dict, optional
2697
+ :param _host_index: set to override the host_index for a single
2698
+ request; this effectively ignores the host_index
2699
+ in the spec for a single request.
2700
+ :type _host_index: int, optional
2701
+ :return: Returns the result object.
2702
+ """ # noqa: E501
2703
+
2704
+ _param = self._v1_event_list_serialize(
2705
+ tenant=tenant,
2706
+ offset=offset,
2707
+ limit=limit,
2708
+ keys=keys,
2709
+ _request_auth=_request_auth,
2710
+ _content_type=_content_type,
2711
+ _headers=_headers,
2712
+ _host_index=_host_index,
2713
+ )
2714
+
2715
+ _response_types_map: Dict[str, Optional[str]] = {
2716
+ "200": "V1EventList",
2717
+ "400": "APIErrors",
2718
+ "403": "APIErrors",
2719
+ }
2720
+ response_data = self.api_client.call_api(
2721
+ *_param, _request_timeout=_request_timeout
2722
+ )
2723
+ response_data.read()
2724
+ return self.api_client.response_deserialize(
2725
+ response_data=response_data,
2726
+ response_types_map=_response_types_map,
2727
+ )
2728
+
2729
+ @validate_call
2730
+ def v1_event_list_without_preload_content(
2731
+ self,
2732
+ tenant: Annotated[
2733
+ str,
2734
+ Field(
2735
+ min_length=36, strict=True, max_length=36, description="The tenant id"
2736
+ ),
2737
+ ],
2738
+ offset: Annotated[
2739
+ Optional[StrictInt], Field(description="The number to skip")
2740
+ ] = None,
2741
+ limit: Annotated[
2742
+ Optional[StrictInt], Field(description="The number to limit by")
2743
+ ] = None,
2744
+ keys: Annotated[
2745
+ Optional[List[StrictStr]], Field(description="A list of keys to filter by")
2746
+ ] = None,
2747
+ _request_timeout: Union[
2748
+ None,
2749
+ Annotated[StrictFloat, Field(gt=0)],
2750
+ Tuple[
2751
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2752
+ ],
2753
+ ] = None,
2754
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2755
+ _content_type: Optional[StrictStr] = None,
2756
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2757
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2758
+ ) -> RESTResponseType:
2759
+ """List events
2760
+
2761
+ Lists all events for a tenant.
2762
+
2763
+ :param tenant: The tenant id (required)
2764
+ :type tenant: str
2765
+ :param offset: The number to skip
2766
+ :type offset: int
2767
+ :param limit: The number to limit by
2768
+ :type limit: int
2769
+ :param keys: A list of keys to filter by
2770
+ :type keys: List[str]
2771
+ :param _request_timeout: timeout setting for this request. If one
2772
+ number provided, it will be total request
2773
+ timeout. It can also be a pair (tuple) of
2774
+ (connection, read) timeouts.
2775
+ :type _request_timeout: int, tuple(int, int), optional
2776
+ :param _request_auth: set to override the auth_settings for an a single
2777
+ request; this effectively ignores the
2778
+ authentication in the spec for a single request.
2779
+ :type _request_auth: dict, optional
2780
+ :param _content_type: force content-type for the request.
2781
+ :type _content_type: str, Optional
2782
+ :param _headers: set to override the headers for a single
2783
+ request; this effectively ignores the headers
2784
+ in the spec for a single request.
2785
+ :type _headers: dict, optional
2786
+ :param _host_index: set to override the host_index for a single
2787
+ request; this effectively ignores the host_index
2788
+ in the spec for a single request.
2789
+ :type _host_index: int, optional
2790
+ :return: Returns the result object.
2791
+ """ # noqa: E501
2792
+
2793
+ _param = self._v1_event_list_serialize(
2794
+ tenant=tenant,
2795
+ offset=offset,
2796
+ limit=limit,
2797
+ keys=keys,
2798
+ _request_auth=_request_auth,
2799
+ _content_type=_content_type,
2800
+ _headers=_headers,
2801
+ _host_index=_host_index,
2802
+ )
2803
+
2804
+ _response_types_map: Dict[str, Optional[str]] = {
2805
+ "200": "V1EventList",
2806
+ "400": "APIErrors",
2807
+ "403": "APIErrors",
2808
+ }
2809
+ response_data = self.api_client.call_api(
2810
+ *_param, _request_timeout=_request_timeout
2811
+ )
2812
+ return response_data.response
2813
+
2814
+ def _v1_event_list_serialize(
2815
+ self,
2816
+ tenant,
2817
+ offset,
2818
+ limit,
2819
+ keys,
2820
+ _request_auth,
2821
+ _content_type,
2822
+ _headers,
2823
+ _host_index,
2824
+ ) -> RequestSerialized:
2825
+
2826
+ _host = None
2827
+
2828
+ _collection_formats: Dict[str, str] = {
2829
+ "keys": "multi",
2830
+ }
2831
+
2832
+ _path_params: Dict[str, str] = {}
2833
+ _query_params: List[Tuple[str, str]] = []
2834
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2835
+ _form_params: List[Tuple[str, str]] = []
2836
+ _files: Dict[
2837
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2838
+ ] = {}
2839
+ _body_params: Optional[bytes] = None
2840
+
2841
+ # process the path parameters
2842
+ if tenant is not None:
2843
+ _path_params["tenant"] = tenant
2844
+ # process the query parameters
2845
+ if offset is not None:
2846
+
2847
+ _query_params.append(("offset", offset))
2848
+
2849
+ if limit is not None:
2850
+
2851
+ _query_params.append(("limit", limit))
2852
+
2853
+ if keys is not None:
2854
+
2855
+ _query_params.append(("keys", keys))
2856
+
2857
+ # process the header parameters
2858
+ # process the form parameters
2859
+ # process the body parameter
2860
+
2861
+ # set the HTTP header `Accept`
2862
+ if "Accept" not in _header_params:
2863
+ _header_params["Accept"] = self.api_client.select_header_accept(
2864
+ ["application/json"]
2865
+ )
2866
+
2867
+ # authentication setting
2868
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
2869
+
2870
+ return self.api_client.param_serialize(
2871
+ method="GET",
2872
+ resource_path="/api/v1/stable/tenants/{tenant}/events",
2873
+ path_params=_path_params,
2874
+ query_params=_query_params,
2875
+ header_params=_header_params,
2876
+ body=_body_params,
2877
+ post_params=_form_params,
2878
+ files=_files,
2879
+ auth_settings=_auth_settings,
2880
+ collection_formats=_collection_formats,
2881
+ _host=_host,
2882
+ _request_auth=_request_auth,
2883
+ )