hatchet-sdk 1.20.0__py3-none-any.whl → 1.20.2__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.

@@ -34,6 +34,9 @@ from hatchet_sdk.clients.rest.models.scheduled_workflows_order_by_field import (
34
34
  ScheduledWorkflowsOrderByField,
35
35
  )
36
36
  from hatchet_sdk.clients.rest.models.tenant_queue_metrics import TenantQueueMetrics
37
+ from hatchet_sdk.clients.rest.models.update_cron_workflow_trigger_request import (
38
+ UpdateCronWorkflowTriggerRequest,
39
+ )
37
40
  from hatchet_sdk.clients.rest.models.workflow import Workflow
38
41
  from hatchet_sdk.clients.rest.models.workflow_kind import WorkflowKind
39
42
  from hatchet_sdk.clients.rest.models.workflow_list import WorkflowList
@@ -1437,6 +1440,330 @@ class WorkflowApi:
1437
1440
  _request_auth=_request_auth,
1438
1441
  )
1439
1442
 
1443
+ @validate_call
1444
+ def workflow_cron_update(
1445
+ self,
1446
+ tenant: Annotated[
1447
+ str,
1448
+ Field(
1449
+ min_length=36, strict=True, max_length=36, description="The tenant id"
1450
+ ),
1451
+ ],
1452
+ cron_workflow: Annotated[
1453
+ str,
1454
+ Field(
1455
+ min_length=36, strict=True, max_length=36, description="The cron job id"
1456
+ ),
1457
+ ],
1458
+ update_cron_workflow_trigger_request: Annotated[
1459
+ UpdateCronWorkflowTriggerRequest, Field(description="The input for updates")
1460
+ ],
1461
+ _request_timeout: Union[
1462
+ None,
1463
+ Annotated[StrictFloat, Field(gt=0)],
1464
+ Tuple[
1465
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1466
+ ],
1467
+ ] = None,
1468
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1469
+ _content_type: Optional[StrictStr] = None,
1470
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1471
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1472
+ ) -> None:
1473
+ """Update cron job workflow run
1474
+
1475
+ Update a cron workflow for a tenant
1476
+
1477
+ :param tenant: The tenant id (required)
1478
+ :type tenant: str
1479
+ :param cron_workflow: The cron job id (required)
1480
+ :type cron_workflow: str
1481
+ :param update_cron_workflow_trigger_request: The input for updates (required)
1482
+ :type update_cron_workflow_trigger_request: UpdateCronWorkflowTriggerRequest
1483
+ :param _request_timeout: timeout setting for this request. If one
1484
+ number provided, it will be total request
1485
+ timeout. It can also be a pair (tuple) of
1486
+ (connection, read) timeouts.
1487
+ :type _request_timeout: int, tuple(int, int), optional
1488
+ :param _request_auth: set to override the auth_settings for an a single
1489
+ request; this effectively ignores the
1490
+ authentication in the spec for a single request.
1491
+ :type _request_auth: dict, optional
1492
+ :param _content_type: force content-type for the request.
1493
+ :type _content_type: str, Optional
1494
+ :param _headers: set to override the headers for a single
1495
+ request; this effectively ignores the headers
1496
+ in the spec for a single request.
1497
+ :type _headers: dict, optional
1498
+ :param _host_index: set to override the host_index for a single
1499
+ request; this effectively ignores the host_index
1500
+ in the spec for a single request.
1501
+ :type _host_index: int, optional
1502
+ :return: Returns the result object.
1503
+ """ # noqa: E501
1504
+
1505
+ _param = self._workflow_cron_update_serialize(
1506
+ tenant=tenant,
1507
+ cron_workflow=cron_workflow,
1508
+ update_cron_workflow_trigger_request=update_cron_workflow_trigger_request,
1509
+ _request_auth=_request_auth,
1510
+ _content_type=_content_type,
1511
+ _headers=_headers,
1512
+ _host_index=_host_index,
1513
+ )
1514
+
1515
+ _response_types_map: Dict[str, Optional[str]] = {
1516
+ "204": None,
1517
+ "400": "APIErrors",
1518
+ "403": "APIError",
1519
+ }
1520
+ response_data = self.api_client.call_api(
1521
+ *_param, _request_timeout=_request_timeout
1522
+ )
1523
+ response_data.read()
1524
+ return self.api_client.response_deserialize(
1525
+ response_data=response_data,
1526
+ response_types_map=_response_types_map,
1527
+ ).data
1528
+
1529
+ @validate_call
1530
+ def workflow_cron_update_with_http_info(
1531
+ self,
1532
+ tenant: Annotated[
1533
+ str,
1534
+ Field(
1535
+ min_length=36, strict=True, max_length=36, description="The tenant id"
1536
+ ),
1537
+ ],
1538
+ cron_workflow: Annotated[
1539
+ str,
1540
+ Field(
1541
+ min_length=36, strict=True, max_length=36, description="The cron job id"
1542
+ ),
1543
+ ],
1544
+ update_cron_workflow_trigger_request: Annotated[
1545
+ UpdateCronWorkflowTriggerRequest, Field(description="The input for updates")
1546
+ ],
1547
+ _request_timeout: Union[
1548
+ None,
1549
+ Annotated[StrictFloat, Field(gt=0)],
1550
+ Tuple[
1551
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1552
+ ],
1553
+ ] = None,
1554
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1555
+ _content_type: Optional[StrictStr] = None,
1556
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1557
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1558
+ ) -> ApiResponse[None]:
1559
+ """Update cron job workflow run
1560
+
1561
+ Update a cron workflow for a tenant
1562
+
1563
+ :param tenant: The tenant id (required)
1564
+ :type tenant: str
1565
+ :param cron_workflow: The cron job id (required)
1566
+ :type cron_workflow: str
1567
+ :param update_cron_workflow_trigger_request: The input for updates (required)
1568
+ :type update_cron_workflow_trigger_request: UpdateCronWorkflowTriggerRequest
1569
+ :param _request_timeout: timeout setting for this request. If one
1570
+ number provided, it will be total request
1571
+ timeout. It can also be a pair (tuple) of
1572
+ (connection, read) timeouts.
1573
+ :type _request_timeout: int, tuple(int, int), optional
1574
+ :param _request_auth: set to override the auth_settings for an a single
1575
+ request; this effectively ignores the
1576
+ authentication in the spec for a single request.
1577
+ :type _request_auth: dict, optional
1578
+ :param _content_type: force content-type for the request.
1579
+ :type _content_type: str, Optional
1580
+ :param _headers: set to override the headers for a single
1581
+ request; this effectively ignores the headers
1582
+ in the spec for a single request.
1583
+ :type _headers: dict, optional
1584
+ :param _host_index: set to override the host_index for a single
1585
+ request; this effectively ignores the host_index
1586
+ in the spec for a single request.
1587
+ :type _host_index: int, optional
1588
+ :return: Returns the result object.
1589
+ """ # noqa: E501
1590
+
1591
+ _param = self._workflow_cron_update_serialize(
1592
+ tenant=tenant,
1593
+ cron_workflow=cron_workflow,
1594
+ update_cron_workflow_trigger_request=update_cron_workflow_trigger_request,
1595
+ _request_auth=_request_auth,
1596
+ _content_type=_content_type,
1597
+ _headers=_headers,
1598
+ _host_index=_host_index,
1599
+ )
1600
+
1601
+ _response_types_map: Dict[str, Optional[str]] = {
1602
+ "204": None,
1603
+ "400": "APIErrors",
1604
+ "403": "APIError",
1605
+ }
1606
+ response_data = self.api_client.call_api(
1607
+ *_param, _request_timeout=_request_timeout
1608
+ )
1609
+ response_data.read()
1610
+ return self.api_client.response_deserialize(
1611
+ response_data=response_data,
1612
+ response_types_map=_response_types_map,
1613
+ )
1614
+
1615
+ @validate_call
1616
+ def workflow_cron_update_without_preload_content(
1617
+ self,
1618
+ tenant: Annotated[
1619
+ str,
1620
+ Field(
1621
+ min_length=36, strict=True, max_length=36, description="The tenant id"
1622
+ ),
1623
+ ],
1624
+ cron_workflow: Annotated[
1625
+ str,
1626
+ Field(
1627
+ min_length=36, strict=True, max_length=36, description="The cron job id"
1628
+ ),
1629
+ ],
1630
+ update_cron_workflow_trigger_request: Annotated[
1631
+ UpdateCronWorkflowTriggerRequest, Field(description="The input for updates")
1632
+ ],
1633
+ _request_timeout: Union[
1634
+ None,
1635
+ Annotated[StrictFloat, Field(gt=0)],
1636
+ Tuple[
1637
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1638
+ ],
1639
+ ] = None,
1640
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1641
+ _content_type: Optional[StrictStr] = None,
1642
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1643
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1644
+ ) -> RESTResponseType:
1645
+ """Update cron job workflow run
1646
+
1647
+ Update a cron workflow for a tenant
1648
+
1649
+ :param tenant: The tenant id (required)
1650
+ :type tenant: str
1651
+ :param cron_workflow: The cron job id (required)
1652
+ :type cron_workflow: str
1653
+ :param update_cron_workflow_trigger_request: The input for updates (required)
1654
+ :type update_cron_workflow_trigger_request: UpdateCronWorkflowTriggerRequest
1655
+ :param _request_timeout: timeout setting for this request. If one
1656
+ number provided, it will be total request
1657
+ timeout. It can also be a pair (tuple) of
1658
+ (connection, read) timeouts.
1659
+ :type _request_timeout: int, tuple(int, int), optional
1660
+ :param _request_auth: set to override the auth_settings for an a single
1661
+ request; this effectively ignores the
1662
+ authentication in the spec for a single request.
1663
+ :type _request_auth: dict, optional
1664
+ :param _content_type: force content-type for the request.
1665
+ :type _content_type: str, Optional
1666
+ :param _headers: set to override the headers for a single
1667
+ request; this effectively ignores the headers
1668
+ in the spec for a single request.
1669
+ :type _headers: dict, optional
1670
+ :param _host_index: set to override the host_index for a single
1671
+ request; this effectively ignores the host_index
1672
+ in the spec for a single request.
1673
+ :type _host_index: int, optional
1674
+ :return: Returns the result object.
1675
+ """ # noqa: E501
1676
+
1677
+ _param = self._workflow_cron_update_serialize(
1678
+ tenant=tenant,
1679
+ cron_workflow=cron_workflow,
1680
+ update_cron_workflow_trigger_request=update_cron_workflow_trigger_request,
1681
+ _request_auth=_request_auth,
1682
+ _content_type=_content_type,
1683
+ _headers=_headers,
1684
+ _host_index=_host_index,
1685
+ )
1686
+
1687
+ _response_types_map: Dict[str, Optional[str]] = {
1688
+ "204": None,
1689
+ "400": "APIErrors",
1690
+ "403": "APIError",
1691
+ }
1692
+ response_data = self.api_client.call_api(
1693
+ *_param, _request_timeout=_request_timeout
1694
+ )
1695
+ return response_data.response
1696
+
1697
+ def _workflow_cron_update_serialize(
1698
+ self,
1699
+ tenant,
1700
+ cron_workflow,
1701
+ update_cron_workflow_trigger_request,
1702
+ _request_auth,
1703
+ _content_type,
1704
+ _headers,
1705
+ _host_index,
1706
+ ) -> RequestSerialized:
1707
+
1708
+ _host = None
1709
+
1710
+ _collection_formats: Dict[str, str] = {}
1711
+
1712
+ _path_params: Dict[str, str] = {}
1713
+ _query_params: List[Tuple[str, str]] = []
1714
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1715
+ _form_params: List[Tuple[str, str]] = []
1716
+ _files: Dict[
1717
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1718
+ ] = {}
1719
+ _body_params: Optional[bytes] = None
1720
+
1721
+ # process the path parameters
1722
+ if tenant is not None:
1723
+ _path_params["tenant"] = tenant
1724
+ if cron_workflow is not None:
1725
+ _path_params["cron-workflow"] = cron_workflow
1726
+ # process the query parameters
1727
+ # process the header parameters
1728
+ # process the form parameters
1729
+ # process the body parameter
1730
+ if update_cron_workflow_trigger_request is not None:
1731
+ _body_params = update_cron_workflow_trigger_request
1732
+
1733
+ # set the HTTP header `Accept`
1734
+ if "Accept" not in _header_params:
1735
+ _header_params["Accept"] = self.api_client.select_header_accept(
1736
+ ["application/json"]
1737
+ )
1738
+
1739
+ # set the HTTP header `Content-Type`
1740
+ if _content_type:
1741
+ _header_params["Content-Type"] = _content_type
1742
+ else:
1743
+ _default_content_type = self.api_client.select_header_content_type(
1744
+ ["application/json"]
1745
+ )
1746
+ if _default_content_type is not None:
1747
+ _header_params["Content-Type"] = _default_content_type
1748
+
1749
+ # authentication setting
1750
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
1751
+
1752
+ return self.api_client.param_serialize(
1753
+ method="PATCH",
1754
+ resource_path="/api/v1/tenants/{tenant}/workflows/crons/{cron-workflow}",
1755
+ path_params=_path_params,
1756
+ query_params=_query_params,
1757
+ header_params=_header_params,
1758
+ body=_body_params,
1759
+ post_params=_form_params,
1760
+ files=_files,
1761
+ auth_settings=_auth_settings,
1762
+ collection_formats=_collection_formats,
1763
+ _host=_host,
1764
+ _request_auth=_request_auth,
1765
+ )
1766
+
1440
1767
  @validate_call
1441
1768
  def workflow_delete(
1442
1769
  self,