|
5 | 5 | from typing_extensions import Annotated |
6 | 6 |
|
7 | 7 |
|
| 8 | +from onelens_backend_client_v2.models import BulkUpsertInsightsTrackerRequest |
| 9 | + |
| 10 | + |
| 11 | +from onelens_backend_client_v2.models import BulkUpsertInsightsTrackerResponse |
| 12 | + |
| 13 | + |
8 | 14 | from onelens_backend_client_v2.models import S3BucketDetailsExportAPIRequest |
9 | 15 |
|
10 | 16 |
|
|
17 | 23 | from onelens_backend_client_v2.models import GetS3CostDetailsRequest |
18 | 24 |
|
19 | 25 |
|
| 26 | +from onelens_backend_client_v2.models import S3OptimisationCostDetailsResponse |
| 27 | + |
| 28 | + |
20 | 29 | from onelens_backend_client_v2.models import S3OptimisationGridDataRequest |
21 | 30 |
|
22 | 31 |
|
@@ -46,6 +55,127 @@ def __init__(self, api_client=None) -> None: |
46 | 55 | api_client = ApiClient.get_default() |
47 | 56 | self.api_client = api_client |
48 | 57 |
|
| 58 | + @validate_call |
| 59 | + def bulk_upsert_s3_insights_tracker( |
| 60 | + self, |
| 61 | + request: BulkUpsertInsightsTrackerRequest, |
| 62 | + _request_timeout: Union[ |
| 63 | + None, |
| 64 | + Annotated[StrictFloat, Field(gt=0)], |
| 65 | + Tuple[ |
| 66 | + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] |
| 67 | + ], |
| 68 | + ] = None, |
| 69 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 70 | + _content_type: Optional[StrictStr] = None, |
| 71 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 72 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 73 | + ) -> BulkUpsertInsightsTrackerResponse: |
| 74 | + """Bulk Upsert S3 Insights Tracker |
| 75 | +
|
| 76 | +
|
| 77 | +
|
| 78 | + :param request: (required) |
| 79 | + :type request: BulkUpsertInsightsTrackerRequest |
| 80 | + :param _request_timeout: timeout setting for this request. If one |
| 81 | + number provided, it will be total request |
| 82 | + timeout. It can also be a pair (tuple) of |
| 83 | + (connection, read) timeouts. |
| 84 | + :type _request_timeout: int, tuple(int, int), optional |
| 85 | + :param _request_auth: set to override the auth_settings for an a single |
| 86 | + request; this effectively ignores the |
| 87 | + authentication in the spec for a single request. |
| 88 | + :type _request_auth: dict, optional |
| 89 | + :param _content_type: force content-type for the request. |
| 90 | + :type _content_type: str, Optional |
| 91 | + :param _headers: set to override the headers for a single |
| 92 | + request; this effectively ignores the headers |
| 93 | + in the spec for a single request. |
| 94 | + :type _headers: dict, optional |
| 95 | + :param _host_index: set to override the host_index for a single |
| 96 | + request; this effectively ignores the host_index |
| 97 | + in the spec for a single request. |
| 98 | + :type _host_index: int, optional |
| 99 | + :return: Returns the result object. |
| 100 | + """ |
| 101 | + |
| 102 | + _param = self._bulk_upsert_s3_insights_tracker_serialize( |
| 103 | + request=request, |
| 104 | + _request_auth=_request_auth, |
| 105 | + _content_type=_content_type, |
| 106 | + _headers=_headers, |
| 107 | + _host_index=_host_index, |
| 108 | + ) |
| 109 | + |
| 110 | + _response_types_map: Dict[str, Optional[str]] = { |
| 111 | + "200": "BulkUpsertInsightsTrackerResponse", |
| 112 | + "422": "HTTPValidationError", |
| 113 | + } |
| 114 | + response_data = self.api_client.call_api( |
| 115 | + *_param, _request_timeout=_request_timeout |
| 116 | + ) |
| 117 | + response_data.read() |
| 118 | + return self.api_client.response_deserialize( |
| 119 | + response_data=response_data, |
| 120 | + response_types_map=_response_types_map, |
| 121 | + ).data |
| 122 | + |
| 123 | + def _bulk_upsert_s3_insights_tracker_serialize( |
| 124 | + self, |
| 125 | + request: BulkUpsertInsightsTrackerRequest, |
| 126 | + _request_auth, |
| 127 | + _content_type, |
| 128 | + _headers, |
| 129 | + _host_index, |
| 130 | + ) -> RequestSerialized: |
| 131 | + _host = None |
| 132 | + |
| 133 | + _collection_formats: Dict[str, str] = {} |
| 134 | + |
| 135 | + _path_params: Dict[str, str] = {} |
| 136 | + _query_params: List[Tuple[str, str]] = [] |
| 137 | + _header_params: Dict[str, Optional[str]] = _headers or {} |
| 138 | + _form_params: List[Tuple[str, str]] = [] |
| 139 | + _files: Dict[str, Union[str, bytes]] = {} |
| 140 | + _body_params: Optional[bytes] = None |
| 141 | + |
| 142 | + # process the body parameter |
| 143 | + if request is not None: |
| 144 | + _body_params = request |
| 145 | + |
| 146 | + # set the HTTP header `Accept` |
| 147 | + _header_params["Accept"] = self.api_client.select_header_accept( |
| 148 | + ["application/json"] |
| 149 | + ) |
| 150 | + |
| 151 | + # set the HTTP header `Content-Type` |
| 152 | + if _content_type: |
| 153 | + _header_params["Content-Type"] = _content_type |
| 154 | + else: |
| 155 | + _default_content_type = self.api_client.select_header_content_type( |
| 156 | + ["application/json"] |
| 157 | + ) |
| 158 | + if _default_content_type is not None: |
| 159 | + _header_params["Content-Type"] = _default_content_type |
| 160 | + |
| 161 | + # authentication setting |
| 162 | + _auth_settings: List[str] = [] |
| 163 | + |
| 164 | + return self.api_client.param_serialize( |
| 165 | + method="POST", |
| 166 | + resource_path="/rpc/s3_optimisation_service/bulk_upsert_s3_insights_tracker", |
| 167 | + path_params=_path_params, |
| 168 | + query_params=_query_params, |
| 169 | + header_params=_header_params, |
| 170 | + body=_body_params, |
| 171 | + post_params=_form_params, |
| 172 | + files=_files, |
| 173 | + auth_settings=_auth_settings, |
| 174 | + collection_formats=_collection_formats, |
| 175 | + _host=_host, |
| 176 | + _request_auth=_request_auth, |
| 177 | + ) |
| 178 | + |
49 | 179 | @validate_call |
50 | 180 | def export_s3_bucket_details( |
51 | 181 | self, |
@@ -303,7 +433,7 @@ def get_s3_optimisation_cost_details( |
303 | 433 | _content_type: Optional[StrictStr] = None, |
304 | 434 | _headers: Optional[Dict[StrictStr, Any]] = None, |
305 | 435 | _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
306 | | - ) -> Any: |
| 436 | + ) -> S3OptimisationCostDetailsResponse: |
307 | 437 | """Get S3 Optimisation Cost Details |
308 | 438 |
|
309 | 439 |
|
@@ -341,7 +471,7 @@ def get_s3_optimisation_cost_details( |
341 | 471 | ) |
342 | 472 |
|
343 | 473 | _response_types_map: Dict[str, Optional[str]] = { |
344 | | - "200": "Any", |
| 474 | + "200": "S3OptimisationCostDetailsResponse", |
345 | 475 | "422": "HTTPValidationError", |
346 | 476 | } |
347 | 477 | response_data = self.api_client.call_api( |
|
0 commit comments