|
21 | 21 | from typing import List, Optional |
22 | 22 | from typing_extensions import Annotated |
23 | 23 | from uuid import UUID |
| 24 | +from authentik_client.models.global_task_status import GlobalTaskStatus |
24 | 25 | from authentik_client.models.paginated_schedule_list import PaginatedScheduleList |
25 | 26 | from authentik_client.models.paginated_task_list import PaginatedTaskList |
26 | 27 | from authentik_client.models.patched_schedule_request import PatchedScheduleRequest |
@@ -2575,6 +2576,258 @@ def _tasks_tasks_retry_create_serialize( |
2575 | 2576 |
|
2576 | 2577 |
|
2577 | 2578 |
|
| 2579 | + @validate_call |
| 2580 | + def tasks_tasks_status_retrieve( |
| 2581 | + self, |
| 2582 | + _request_timeout: Union[ |
| 2583 | + None, |
| 2584 | + Annotated[StrictFloat, Field(gt=0)], |
| 2585 | + Tuple[ |
| 2586 | + Annotated[StrictFloat, Field(gt=0)], |
| 2587 | + Annotated[StrictFloat, Field(gt=0)] |
| 2588 | + ] |
| 2589 | + ] = None, |
| 2590 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 2591 | + _content_type: Optional[StrictStr] = None, |
| 2592 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 2593 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 2594 | + ) -> GlobalTaskStatus: |
| 2595 | + """tasks_tasks_status_retrieve |
| 2596 | +
|
| 2597 | + Global status summary for all tasks |
| 2598 | +
|
| 2599 | + :param _request_timeout: timeout setting for this request. If one |
| 2600 | + number provided, it will be total request |
| 2601 | + timeout. It can also be a pair (tuple) of |
| 2602 | + (connection, read) timeouts. |
| 2603 | + :type _request_timeout: int, tuple(int, int), optional |
| 2604 | + :param _request_auth: set to override the auth_settings for an a single |
| 2605 | + request; this effectively ignores the |
| 2606 | + authentication in the spec for a single request. |
| 2607 | + :type _request_auth: dict, optional |
| 2608 | + :param _content_type: force content-type for the request. |
| 2609 | + :type _content_type: str, Optional |
| 2610 | + :param _headers: set to override the headers for a single |
| 2611 | + request; this effectively ignores the headers |
| 2612 | + in the spec for a single request. |
| 2613 | + :type _headers: dict, optional |
| 2614 | + :param _host_index: set to override the host_index for a single |
| 2615 | + request; this effectively ignores the host_index |
| 2616 | + in the spec for a single request. |
| 2617 | + :type _host_index: int, optional |
| 2618 | + :return: Returns the result object. |
| 2619 | + """ # noqa: E501 |
| 2620 | + |
| 2621 | + _param = self._tasks_tasks_status_retrieve_serialize( |
| 2622 | + _request_auth=_request_auth, |
| 2623 | + _content_type=_content_type, |
| 2624 | + _headers=_headers, |
| 2625 | + _host_index=_host_index |
| 2626 | + ) |
| 2627 | + |
| 2628 | + _response_types_map: Dict[str, Optional[str]] = { |
| 2629 | + '200': "GlobalTaskStatus", |
| 2630 | + '400': "ValidationError", |
| 2631 | + '403': "GenericError", |
| 2632 | + } |
| 2633 | + response_data = self.api_client.call_api( |
| 2634 | + *_param, |
| 2635 | + _request_timeout=_request_timeout |
| 2636 | + ) |
| 2637 | + response_data.read() |
| 2638 | + return self.api_client.response_deserialize( |
| 2639 | + response_data=response_data, |
| 2640 | + response_types_map=_response_types_map, |
| 2641 | + ).data |
| 2642 | + |
| 2643 | + |
| 2644 | + @validate_call |
| 2645 | + def tasks_tasks_status_retrieve_with_http_info( |
| 2646 | + self, |
| 2647 | + _request_timeout: Union[ |
| 2648 | + None, |
| 2649 | + Annotated[StrictFloat, Field(gt=0)], |
| 2650 | + Tuple[ |
| 2651 | + Annotated[StrictFloat, Field(gt=0)], |
| 2652 | + Annotated[StrictFloat, Field(gt=0)] |
| 2653 | + ] |
| 2654 | + ] = None, |
| 2655 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 2656 | + _content_type: Optional[StrictStr] = None, |
| 2657 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 2658 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 2659 | + ) -> ApiResponse[GlobalTaskStatus]: |
| 2660 | + """tasks_tasks_status_retrieve |
| 2661 | +
|
| 2662 | + Global status summary for all tasks |
| 2663 | +
|
| 2664 | + :param _request_timeout: timeout setting for this request. If one |
| 2665 | + number provided, it will be total request |
| 2666 | + timeout. It can also be a pair (tuple) of |
| 2667 | + (connection, read) timeouts. |
| 2668 | + :type _request_timeout: int, tuple(int, int), optional |
| 2669 | + :param _request_auth: set to override the auth_settings for an a single |
| 2670 | + request; this effectively ignores the |
| 2671 | + authentication in the spec for a single request. |
| 2672 | + :type _request_auth: dict, optional |
| 2673 | + :param _content_type: force content-type for the request. |
| 2674 | + :type _content_type: str, Optional |
| 2675 | + :param _headers: set to override the headers for a single |
| 2676 | + request; this effectively ignores the headers |
| 2677 | + in the spec for a single request. |
| 2678 | + :type _headers: dict, optional |
| 2679 | + :param _host_index: set to override the host_index for a single |
| 2680 | + request; this effectively ignores the host_index |
| 2681 | + in the spec for a single request. |
| 2682 | + :type _host_index: int, optional |
| 2683 | + :return: Returns the result object. |
| 2684 | + """ # noqa: E501 |
| 2685 | + |
| 2686 | + _param = self._tasks_tasks_status_retrieve_serialize( |
| 2687 | + _request_auth=_request_auth, |
| 2688 | + _content_type=_content_type, |
| 2689 | + _headers=_headers, |
| 2690 | + _host_index=_host_index |
| 2691 | + ) |
| 2692 | + |
| 2693 | + _response_types_map: Dict[str, Optional[str]] = { |
| 2694 | + '200': "GlobalTaskStatus", |
| 2695 | + '400': "ValidationError", |
| 2696 | + '403': "GenericError", |
| 2697 | + } |
| 2698 | + response_data = self.api_client.call_api( |
| 2699 | + *_param, |
| 2700 | + _request_timeout=_request_timeout |
| 2701 | + ) |
| 2702 | + response_data.read() |
| 2703 | + return self.api_client.response_deserialize( |
| 2704 | + response_data=response_data, |
| 2705 | + response_types_map=_response_types_map, |
| 2706 | + ) |
| 2707 | + |
| 2708 | + |
| 2709 | + @validate_call |
| 2710 | + def tasks_tasks_status_retrieve_without_preload_content( |
| 2711 | + self, |
| 2712 | + _request_timeout: Union[ |
| 2713 | + None, |
| 2714 | + Annotated[StrictFloat, Field(gt=0)], |
| 2715 | + Tuple[ |
| 2716 | + Annotated[StrictFloat, Field(gt=0)], |
| 2717 | + Annotated[StrictFloat, Field(gt=0)] |
| 2718 | + ] |
| 2719 | + ] = None, |
| 2720 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 2721 | + _content_type: Optional[StrictStr] = None, |
| 2722 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 2723 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 2724 | + ) -> RESTResponseType: |
| 2725 | + """tasks_tasks_status_retrieve |
| 2726 | +
|
| 2727 | + Global status summary for all tasks |
| 2728 | +
|
| 2729 | + :param _request_timeout: timeout setting for this request. If one |
| 2730 | + number provided, it will be total request |
| 2731 | + timeout. It can also be a pair (tuple) of |
| 2732 | + (connection, read) timeouts. |
| 2733 | + :type _request_timeout: int, tuple(int, int), optional |
| 2734 | + :param _request_auth: set to override the auth_settings for an a single |
| 2735 | + request; this effectively ignores the |
| 2736 | + authentication in the spec for a single request. |
| 2737 | + :type _request_auth: dict, optional |
| 2738 | + :param _content_type: force content-type for the request. |
| 2739 | + :type _content_type: str, Optional |
| 2740 | + :param _headers: set to override the headers for a single |
| 2741 | + request; this effectively ignores the headers |
| 2742 | + in the spec for a single request. |
| 2743 | + :type _headers: dict, optional |
| 2744 | + :param _host_index: set to override the host_index for a single |
| 2745 | + request; this effectively ignores the host_index |
| 2746 | + in the spec for a single request. |
| 2747 | + :type _host_index: int, optional |
| 2748 | + :return: Returns the result object. |
| 2749 | + """ # noqa: E501 |
| 2750 | + |
| 2751 | + _param = self._tasks_tasks_status_retrieve_serialize( |
| 2752 | + _request_auth=_request_auth, |
| 2753 | + _content_type=_content_type, |
| 2754 | + _headers=_headers, |
| 2755 | + _host_index=_host_index |
| 2756 | + ) |
| 2757 | + |
| 2758 | + _response_types_map: Dict[str, Optional[str]] = { |
| 2759 | + '200': "GlobalTaskStatus", |
| 2760 | + '400': "ValidationError", |
| 2761 | + '403': "GenericError", |
| 2762 | + } |
| 2763 | + response_data = self.api_client.call_api( |
| 2764 | + *_param, |
| 2765 | + _request_timeout=_request_timeout |
| 2766 | + ) |
| 2767 | + return response_data.response |
| 2768 | + |
| 2769 | + |
| 2770 | + def _tasks_tasks_status_retrieve_serialize( |
| 2771 | + self, |
| 2772 | + _request_auth, |
| 2773 | + _content_type, |
| 2774 | + _headers, |
| 2775 | + _host_index, |
| 2776 | + ) -> RequestSerialized: |
| 2777 | + |
| 2778 | + _host = None |
| 2779 | + |
| 2780 | + _collection_formats: Dict[str, str] = { |
| 2781 | + } |
| 2782 | + |
| 2783 | + _path_params: Dict[str, str] = {} |
| 2784 | + _query_params: List[Tuple[str, str]] = [] |
| 2785 | + _header_params: Dict[str, Optional[str]] = _headers or {} |
| 2786 | + _form_params: List[Tuple[str, str]] = [] |
| 2787 | + _files: Dict[ |
| 2788 | + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] |
| 2789 | + ] = {} |
| 2790 | + _body_params: Optional[bytes] = None |
| 2791 | + |
| 2792 | + # process the path parameters |
| 2793 | + # process the query parameters |
| 2794 | + # process the header parameters |
| 2795 | + # process the form parameters |
| 2796 | + # process the body parameter |
| 2797 | + |
| 2798 | + |
| 2799 | + # set the HTTP header `Accept` |
| 2800 | + if 'Accept' not in _header_params: |
| 2801 | + _header_params['Accept'] = self.api_client.select_header_accept( |
| 2802 | + [ |
| 2803 | + 'application/json' |
| 2804 | + ] |
| 2805 | + ) |
| 2806 | + |
| 2807 | + |
| 2808 | + # authentication setting |
| 2809 | + _auth_settings: List[str] = [ |
| 2810 | + 'authentik' |
| 2811 | + ] |
| 2812 | + |
| 2813 | + return self.api_client.param_serialize( |
| 2814 | + method='GET', |
| 2815 | + resource_path='/tasks/tasks/status/', |
| 2816 | + path_params=_path_params, |
| 2817 | + query_params=_query_params, |
| 2818 | + header_params=_header_params, |
| 2819 | + body=_body_params, |
| 2820 | + post_params=_form_params, |
| 2821 | + files=_files, |
| 2822 | + auth_settings=_auth_settings, |
| 2823 | + collection_formats=_collection_formats, |
| 2824 | + _host=_host, |
| 2825 | + _request_auth=_request_auth |
| 2826 | + ) |
| 2827 | + |
| 2828 | + |
| 2829 | + |
| 2830 | + |
2578 | 2831 | @validate_call |
2579 | 2832 | def tasks_workers_list( |
2580 | 2833 | self, |
|
0 commit comments