|
29 | 29 | from stackit.serverupdate.models.enable_service_resource_payload import (
|
30 | 30 | EnableServiceResourcePayload,
|
31 | 31 | )
|
| 32 | +from stackit.serverupdate.models.get_update_policies_response import ( |
| 33 | + GetUpdatePoliciesResponse, |
| 34 | +) |
32 | 35 | from stackit.serverupdate.models.get_update_schedules_response import (
|
33 | 36 | GetUpdateSchedulesResponse,
|
34 | 37 | )
|
@@ -2420,6 +2423,235 @@ def _get_update_schedule_serialize(
|
2420 | 2423 | _request_auth=_request_auth,
|
2421 | 2424 | )
|
2422 | 2425 |
|
| 2426 | + @validate_call |
| 2427 | + def list_update_policies( |
| 2428 | + self, |
| 2429 | + project_id: Annotated[StrictStr, Field(description="project id")], |
| 2430 | + _request_timeout: Union[ |
| 2431 | + None, |
| 2432 | + Annotated[StrictFloat, Field(gt=0)], |
| 2433 | + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], |
| 2434 | + ] = None, |
| 2435 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 2436 | + _content_type: Optional[StrictStr] = None, |
| 2437 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 2438 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 2439 | + ) -> GetUpdatePoliciesResponse: |
| 2440 | + """get list of update policies |
| 2441 | +
|
| 2442 | +
|
| 2443 | + :param project_id: project id (required) |
| 2444 | + :type project_id: str |
| 2445 | + :param _request_timeout: timeout setting for this request. If one |
| 2446 | + number provided, it will be total request |
| 2447 | + timeout. It can also be a pair (tuple) of |
| 2448 | + (connection, read) timeouts. |
| 2449 | + :type _request_timeout: int, tuple(int, int), optional |
| 2450 | + :param _request_auth: set to override the auth_settings for an a single |
| 2451 | + request; this effectively ignores the |
| 2452 | + authentication in the spec for a single request. |
| 2453 | + :type _request_auth: dict, optional |
| 2454 | + :param _content_type: force content-type for the request. |
| 2455 | + :type _content_type: str, Optional |
| 2456 | + :param _headers: set to override the headers for a single |
| 2457 | + request; this effectively ignores the headers |
| 2458 | + in the spec for a single request. |
| 2459 | + :type _headers: dict, optional |
| 2460 | + :param _host_index: set to override the host_index for a single |
| 2461 | + request; this effectively ignores the host_index |
| 2462 | + in the spec for a single request. |
| 2463 | + :type _host_index: int, optional |
| 2464 | + :return: Returns the result object. |
| 2465 | + """ # noqa: E501 docstring might be too long |
| 2466 | + |
| 2467 | + _param = self._list_update_policies_serialize( |
| 2468 | + project_id=project_id, |
| 2469 | + _request_auth=_request_auth, |
| 2470 | + _content_type=_content_type, |
| 2471 | + _headers=_headers, |
| 2472 | + _host_index=_host_index, |
| 2473 | + ) |
| 2474 | + |
| 2475 | + _response_types_map: Dict[str, Optional[str]] = { |
| 2476 | + "200": "GetUpdatePoliciesResponse", |
| 2477 | + "400": None, |
| 2478 | + "404": None, |
| 2479 | + } |
| 2480 | + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) |
| 2481 | + response_data.read() |
| 2482 | + return self.api_client.response_deserialize( |
| 2483 | + response_data=response_data, |
| 2484 | + response_types_map=_response_types_map, |
| 2485 | + ).data |
| 2486 | + |
| 2487 | + @validate_call |
| 2488 | + def list_update_policies_with_http_info( |
| 2489 | + self, |
| 2490 | + project_id: Annotated[StrictStr, Field(description="project id")], |
| 2491 | + _request_timeout: Union[ |
| 2492 | + None, |
| 2493 | + Annotated[StrictFloat, Field(gt=0)], |
| 2494 | + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], |
| 2495 | + ] = None, |
| 2496 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 2497 | + _content_type: Optional[StrictStr] = None, |
| 2498 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 2499 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 2500 | + ) -> ApiResponse[GetUpdatePoliciesResponse]: |
| 2501 | + """get list of update policies |
| 2502 | +
|
| 2503 | +
|
| 2504 | + :param project_id: project id (required) |
| 2505 | + :type project_id: str |
| 2506 | + :param _request_timeout: timeout setting for this request. If one |
| 2507 | + number provided, it will be total request |
| 2508 | + timeout. It can also be a pair (tuple) of |
| 2509 | + (connection, read) timeouts. |
| 2510 | + :type _request_timeout: int, tuple(int, int), optional |
| 2511 | + :param _request_auth: set to override the auth_settings for an a single |
| 2512 | + request; this effectively ignores the |
| 2513 | + authentication in the spec for a single request. |
| 2514 | + :type _request_auth: dict, optional |
| 2515 | + :param _content_type: force content-type for the request. |
| 2516 | + :type _content_type: str, Optional |
| 2517 | + :param _headers: set to override the headers for a single |
| 2518 | + request; this effectively ignores the headers |
| 2519 | + in the spec for a single request. |
| 2520 | + :type _headers: dict, optional |
| 2521 | + :param _host_index: set to override the host_index for a single |
| 2522 | + request; this effectively ignores the host_index |
| 2523 | + in the spec for a single request. |
| 2524 | + :type _host_index: int, optional |
| 2525 | + :return: Returns the result object. |
| 2526 | + """ # noqa: E501 docstring might be too long |
| 2527 | + |
| 2528 | + _param = self._list_update_policies_serialize( |
| 2529 | + project_id=project_id, |
| 2530 | + _request_auth=_request_auth, |
| 2531 | + _content_type=_content_type, |
| 2532 | + _headers=_headers, |
| 2533 | + _host_index=_host_index, |
| 2534 | + ) |
| 2535 | + |
| 2536 | + _response_types_map: Dict[str, Optional[str]] = { |
| 2537 | + "200": "GetUpdatePoliciesResponse", |
| 2538 | + "400": None, |
| 2539 | + "404": None, |
| 2540 | + } |
| 2541 | + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) |
| 2542 | + response_data.read() |
| 2543 | + return self.api_client.response_deserialize( |
| 2544 | + response_data=response_data, |
| 2545 | + response_types_map=_response_types_map, |
| 2546 | + ) |
| 2547 | + |
| 2548 | + @validate_call |
| 2549 | + def list_update_policies_without_preload_content( |
| 2550 | + self, |
| 2551 | + project_id: Annotated[StrictStr, Field(description="project id")], |
| 2552 | + _request_timeout: Union[ |
| 2553 | + None, |
| 2554 | + Annotated[StrictFloat, Field(gt=0)], |
| 2555 | + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], |
| 2556 | + ] = None, |
| 2557 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 2558 | + _content_type: Optional[StrictStr] = None, |
| 2559 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 2560 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 2561 | + ) -> RESTResponseType: |
| 2562 | + """get list of update policies |
| 2563 | +
|
| 2564 | +
|
| 2565 | + :param project_id: project id (required) |
| 2566 | + :type project_id: str |
| 2567 | + :param _request_timeout: timeout setting for this request. If one |
| 2568 | + number provided, it will be total request |
| 2569 | + timeout. It can also be a pair (tuple) of |
| 2570 | + (connection, read) timeouts. |
| 2571 | + :type _request_timeout: int, tuple(int, int), optional |
| 2572 | + :param _request_auth: set to override the auth_settings for an a single |
| 2573 | + request; this effectively ignores the |
| 2574 | + authentication in the spec for a single request. |
| 2575 | + :type _request_auth: dict, optional |
| 2576 | + :param _content_type: force content-type for the request. |
| 2577 | + :type _content_type: str, Optional |
| 2578 | + :param _headers: set to override the headers for a single |
| 2579 | + request; this effectively ignores the headers |
| 2580 | + in the spec for a single request. |
| 2581 | + :type _headers: dict, optional |
| 2582 | + :param _host_index: set to override the host_index for a single |
| 2583 | + request; this effectively ignores the host_index |
| 2584 | + in the spec for a single request. |
| 2585 | + :type _host_index: int, optional |
| 2586 | + :return: Returns the result object. |
| 2587 | + """ # noqa: E501 docstring might be too long |
| 2588 | + |
| 2589 | + _param = self._list_update_policies_serialize( |
| 2590 | + project_id=project_id, |
| 2591 | + _request_auth=_request_auth, |
| 2592 | + _content_type=_content_type, |
| 2593 | + _headers=_headers, |
| 2594 | + _host_index=_host_index, |
| 2595 | + ) |
| 2596 | + |
| 2597 | + _response_types_map: Dict[str, Optional[str]] = { |
| 2598 | + "200": "GetUpdatePoliciesResponse", |
| 2599 | + "400": None, |
| 2600 | + "404": None, |
| 2601 | + } |
| 2602 | + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) |
| 2603 | + return response_data.response |
| 2604 | + |
| 2605 | + def _list_update_policies_serialize( |
| 2606 | + self, |
| 2607 | + project_id, |
| 2608 | + _request_auth, |
| 2609 | + _content_type, |
| 2610 | + _headers, |
| 2611 | + _host_index, |
| 2612 | + ) -> RequestSerialized: |
| 2613 | + |
| 2614 | + _host = None |
| 2615 | + |
| 2616 | + _collection_formats: Dict[str, str] = {} |
| 2617 | + |
| 2618 | + _path_params: Dict[str, str] = {} |
| 2619 | + _query_params: List[Tuple[str, str]] = [] |
| 2620 | + _header_params: Dict[str, Optional[str]] = _headers or {} |
| 2621 | + _form_params: List[Tuple[str, str]] = [] |
| 2622 | + _files: Dict[str, Union[str, bytes]] = {} |
| 2623 | + _body_params: Optional[bytes] = None |
| 2624 | + |
| 2625 | + # process the path parameters |
| 2626 | + if project_id is not None: |
| 2627 | + _path_params["projectId"] = project_id |
| 2628 | + # process the query parameters |
| 2629 | + # process the header parameters |
| 2630 | + # process the form parameters |
| 2631 | + # process the body parameter |
| 2632 | + |
| 2633 | + # set the HTTP header `Accept` |
| 2634 | + if "Accept" not in _header_params: |
| 2635 | + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) |
| 2636 | + |
| 2637 | + # authentication setting |
| 2638 | + _auth_settings: List[str] = [] |
| 2639 | + |
| 2640 | + return self.api_client.param_serialize( |
| 2641 | + method="GET", |
| 2642 | + resource_path="/v1/projects/{projectId}/update-policies", |
| 2643 | + path_params=_path_params, |
| 2644 | + query_params=_query_params, |
| 2645 | + header_params=_header_params, |
| 2646 | + body=_body_params, |
| 2647 | + post_params=_form_params, |
| 2648 | + files=_files, |
| 2649 | + auth_settings=_auth_settings, |
| 2650 | + collection_formats=_collection_formats, |
| 2651 | + _host=_host, |
| 2652 | + _request_auth=_request_auth, |
| 2653 | + ) |
| 2654 | + |
2423 | 2655 | @validate_call
|
2424 | 2656 | def list_update_schedules(
|
2425 | 2657 | self,
|
|
0 commit comments