From 8cb884c6af6e67a4e5de64d753ac828adb4b345f Mon Sep 17 00:00:00 2001 From: parteek65 Date: Wed, 31 Jul 2024 15:56:05 +0530 Subject: [PATCH] addded identifier key as resource id in service catalog model --- .openapi-generator/FILES | 9 ++ README.md | 3 + REGENERATE.md | 2 +- docs/GetPolicyTicketStatsGroupBy.md | 1 + docs/GetPolicyTicketStatsSubGroupBy.md | 1 + ...GetSinglePolicyTicketByEntityIdResponse.md | 1 + ...GetSinglePolicyTicketByPolicyIdResponse.md | 1 + docs/ResourceType.md | 1 + docs/TenantPolicyForPolicyWithSetting.md | 43 ++++++ ...PolicyForPolicyWithSettingServicesInner.md | 35 +++++ docs/TenantPolicyWithSetting.md | 2 +- docs/TenantVerifyCurBucketAPIRequest.md | 30 ++++ docs/TenantVerifyCurBucketRequest.md | 1 + docs/TenantVerifyServiceApi.md | 11 +- docs/TenantsTenantProviderVerifyApi.md | 10 +- onelens_backend_client/__init__.py | 3 + .../api/tenant_verify_service_api.py | 47 +++--- .../api/tenants_tenant_provider_verify_api.py | 40 ++--- onelens_backend_client/models/__init__.py | 3 + .../get_policy_ticket_stats_group_by.py | 11 +- .../get_policy_ticket_stats_sub_group_by.py | 11 +- ...gle_policy_ticket_by_entity_id_response.py | 11 +- ...gle_policy_ticket_by_policy_id_response.py | 11 +- .../models/resource_type.py | 11 +- .../tenant_policy_for_policy_with_setting.py | 135 +++++++++++++++++ ..._for_policy_with_setting_services_inner.py | 136 +++++++++++++++++ .../models/tenant_policy_with_setting.py | 6 +- .../tenant_verify_cur_bucket_api_request.py | 93 ++++++++++++ .../tenant_verify_cur_bucket_request.py | 6 +- ...t_tenant_policy_for_policy_with_setting.py | 138 ++++++++++++++++++ ..._for_policy_with_setting_services_inner.py | 82 +++++++++++ ...st_tenant_verify_cur_bucket_api_request.py | 64 ++++++++ 32 files changed, 895 insertions(+), 64 deletions(-) create mode 100644 docs/TenantPolicyForPolicyWithSetting.md create mode 100644 docs/TenantPolicyForPolicyWithSettingServicesInner.md create mode 100644 docs/TenantVerifyCurBucketAPIRequest.md create mode 100644 onelens_backend_client/models/tenant_policy_for_policy_with_setting.py create mode 100644 onelens_backend_client/models/tenant_policy_for_policy_with_setting_services_inner.py create mode 100644 onelens_backend_client/models/tenant_verify_cur_bucket_api_request.py create mode 100644 test/test_tenant_policy_for_policy_with_setting.py create mode 100644 test/test_tenant_policy_for_policy_with_setting_services_inner.py create mode 100644 test/test_tenant_verify_cur_bucket_api_request.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 09f6517f..f8942c03 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -423,6 +423,8 @@ docs/TenantPoliciesApi.md docs/TenantPolicy.md docs/TenantPolicyExclusions.md docs/TenantPolicyFilters.md +docs/TenantPolicyForPolicyWithSetting.md +docs/TenantPolicyForPolicyWithSettingServicesInner.md docs/TenantPolicyServiceApi.md docs/TenantPolicySettings.md docs/TenantPolicySettingsFilters.md @@ -447,6 +449,7 @@ docs/TenantUserDetailsUpdateFieldsMixin.md docs/TenantUserServiceApi.md docs/TenantUserUpdateFieldsMixin.md docs/TenantUsersApi.md +docs/TenantVerifyCurBucketAPIRequest.md docs/TenantVerifyCurBucketRequest.md docs/TenantVerifyCurBucketResponse.md docs/TenantVerifyRequestWithUser.md @@ -946,6 +949,8 @@ onelens_backend_client/models/tenant_filters.py onelens_backend_client/models/tenant_policy.py onelens_backend_client/models/tenant_policy_exclusions.py onelens_backend_client/models/tenant_policy_filters.py +onelens_backend_client/models/tenant_policy_for_policy_with_setting.py +onelens_backend_client/models/tenant_policy_for_policy_with_setting_services_inner.py onelens_backend_client/models/tenant_policy_settings.py onelens_backend_client/models/tenant_policy_settings_filters.py onelens_backend_client/models/tenant_policy_state.py @@ -964,6 +969,7 @@ onelens_backend_client/models/tenant_tickets_stats_metrics_group_by.py onelens_backend_client/models/tenant_tickets_stats_metrics_sub_group_by.py onelens_backend_client/models/tenant_user_details_update_fields_mixin.py onelens_backend_client/models/tenant_user_update_fields_mixin.py +onelens_backend_client/models/tenant_verify_cur_bucket_api_request.py onelens_backend_client/models/tenant_verify_cur_bucket_request.py onelens_backend_client/models/tenant_verify_cur_bucket_response.py onelens_backend_client/models/tenant_verify_request_with_user.py @@ -1021,4 +1027,7 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_tenant_policy_for_policy_with_setting.py +test/test_tenant_policy_for_policy_with_setting_services_inner.py +test/test_tenant_verify_cur_bucket_api_request.py tox.ini diff --git a/README.md b/README.md index 77ecee7f..6410f232 100644 --- a/README.md +++ b/README.md @@ -669,6 +669,8 @@ Class | Method | Description - [TenantPolicy](docs/TenantPolicy.md) - [TenantPolicyExclusions](docs/TenantPolicyExclusions.md) - [TenantPolicyFilters](docs/TenantPolicyFilters.md) + - [TenantPolicyForPolicyWithSetting](docs/TenantPolicyForPolicyWithSetting.md) + - [TenantPolicyForPolicyWithSettingServicesInner](docs/TenantPolicyForPolicyWithSettingServicesInner.md) - [TenantPolicySettings](docs/TenantPolicySettings.md) - [TenantPolicySettingsFilters](docs/TenantPolicySettingsFilters.md) - [TenantPolicyState](docs/TenantPolicyState.md) @@ -687,6 +689,7 @@ Class | Method | Description - [TenantTicketsStatsMetricsSubGroupBy](docs/TenantTicketsStatsMetricsSubGroupBy.md) - [TenantUserDetailsUpdateFieldsMixin](docs/TenantUserDetailsUpdateFieldsMixin.md) - [TenantUserUpdateFieldsMixin](docs/TenantUserUpdateFieldsMixin.md) + - [TenantVerifyCurBucketAPIRequest](docs/TenantVerifyCurBucketAPIRequest.md) - [TenantVerifyCurBucketRequest](docs/TenantVerifyCurBucketRequest.md) - [TenantVerifyCurBucketResponse](docs/TenantVerifyCurBucketResponse.md) - [TenantVerifyRequestWithUser](docs/TenantVerifyRequestWithUser.md) diff --git a/REGENERATE.md b/REGENERATE.md index 30b74917..2c61e39b 100644 --- a/REGENERATE.md +++ b/REGENERATE.md @@ -2,7 +2,7 @@ Run this to regenerate the client code locally. OneLens Backend must be running ``` docker run --rm -v "${PWD}:/onelens-backend-python-client" openapitools/openapi-generator-cli:v7.5.0 generate \ --i http://host.docker.internal:9000/openapi.json \ +-i http://host.docker.internal:8001/openapi.json \ -g python \ -o /onelens-backend-python-client/ \ -t /onelens-backend-python-client/templates/ \ diff --git a/docs/GetPolicyTicketStatsGroupBy.md b/docs/GetPolicyTicketStatsGroupBy.md index 95327f7e..75269fe0 100644 --- a/docs/GetPolicyTicketStatsGroupBy.md +++ b/docs/GetPolicyTicketStatsGroupBy.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **field_name** | **str** | Field name to be fetched | **field_value** | **float** | | [optional] **field_details** | [**List[GetPolicyTicketStatsSubGroupBy]**](GetPolicyTicketStatsSubGroupBy.md) | | [optional] +**field_display_name** | **str** | | [optional] ## Example diff --git a/docs/GetPolicyTicketStatsSubGroupBy.md b/docs/GetPolicyTicketStatsSubGroupBy.md index 9d35ed0b..5c16598d 100644 --- a/docs/GetPolicyTicketStatsSubGroupBy.md +++ b/docs/GetPolicyTicketStatsSubGroupBy.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **field_name** | **str** | Field name to be fetched | **field_value** | **float** | | [optional] +**field_display_name** | **str** | | [optional] ## Example diff --git a/docs/GetSinglePolicyTicketByEntityIdResponse.md b/docs/GetSinglePolicyTicketByEntityIdResponse.md index c5bbb31f..33281594 100644 --- a/docs/GetSinglePolicyTicketByEntityIdResponse.md +++ b/docs/GetSinglePolicyTicketByEntityIdResponse.md @@ -21,6 +21,7 @@ Name | Type | Description | Notes **policy_labels** | **List[str]** | List of policy labels | [optional] **policy_violated_on** | **datetime** | Datetime of the policy violation | **potential_savings** | **float** | Potential savings possible for the current policy violation | +**resource_id** | **str** | | [optional] ## Example diff --git a/docs/GetSinglePolicyTicketByPolicyIdResponse.md b/docs/GetSinglePolicyTicketByPolicyIdResponse.md index 921948c5..0a770bc2 100644 --- a/docs/GetSinglePolicyTicketByPolicyIdResponse.md +++ b/docs/GetSinglePolicyTicketByPolicyIdResponse.md @@ -17,6 +17,7 @@ Name | Type | Description | Notes **account_id** | **str** | Account Id managing the resource | **recommendation_unit_title** | **str** | | [optional] **potential_savings** | **float** | Potential savings of the ticket | +**resource_id** | **str** | | [optional] ## Example diff --git a/docs/ResourceType.md b/docs/ResourceType.md index 46b983c4..ff5552b8 100644 --- a/docs/ResourceType.md +++ b/docs/ResourceType.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **resource_type** | **str** | | **resource_table** | **str** | | +**identifier_key** | **str** | | [optional] **select_columns** | **List[str]** | | **resource_url_template** | **str** | | **is_tags_available** | **bool** | | diff --git a/docs/TenantPolicyForPolicyWithSetting.md b/docs/TenantPolicyForPolicyWithSetting.md new file mode 100644 index 00000000..06d73c00 --- /dev/null +++ b/docs/TenantPolicyForPolicyWithSetting.md @@ -0,0 +1,43 @@ +# TenantPolicyForPolicyWithSetting + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**parent_ptp_id** | **str** | The id of the parent policy template pack. | +**title** | **str** | The title of the policy template. | +**alias** | **str** | The alias of the policy template. | +**description** | **str** | The description of the policy template. | [optional] +**services** | [**List[TenantPolicyForPolicyWithSettingServicesInner]**](TenantPolicyForPolicyWithSettingServicesInner.md) | The list of services display names associated the policy template. | +**execution_type** | [**PolicyExecutionType**](PolicyExecutionType.md) | The execution type of the policy template. | +**details** | [**PolicyTemplateDetailsOutput**](PolicyTemplateDetailsOutput.md) | The details of the policy template. | +**description2** | **str** | The description2 of the policy template. | [optional] +**resource_type** | **str** | The resource type of the policy template. | +**recommendation_details** | [**PolicyTemplateRecommendationDetailsOutput**](PolicyTemplateRecommendationDetailsOutput.md) | The recommendation details for the policy template. | +**policy_template_id** | **str** | The id of the policy template. | +**category** | [**PolicyCategory**](PolicyCategory.md) | The category of the policy template. | +**provider** | [**Provider**](Provider.md) | The cloud provider of the policy template. | +**id** | **str** | The unique identifier of the tenant policy. | +**state** | [**TenantPolicySystemState**](TenantPolicySystemState.md) | The state of the tenant policy. | + +## Example + +```python +from onelens_backend_client.models.tenant_policy_for_policy_with_setting import TenantPolicyForPolicyWithSetting + +# TODO update the JSON string below +json = "{}" +# create an instance of TenantPolicyForPolicyWithSetting from a JSON string +tenant_policy_for_policy_with_setting_instance = TenantPolicyForPolicyWithSetting.from_json(json) +# print the JSON string representation of the object +print(TenantPolicyForPolicyWithSetting.to_json()) + +# convert the object into a dict +tenant_policy_for_policy_with_setting_dict = tenant_policy_for_policy_with_setting_instance.to_dict() +# create an instance of TenantPolicyForPolicyWithSetting from a dict +tenant_policy_for_policy_with_setting_form_dict = tenant_policy_for_policy_with_setting.from_dict(tenant_policy_for_policy_with_setting_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TenantPolicyForPolicyWithSettingServicesInner.md b/docs/TenantPolicyForPolicyWithSettingServicesInner.md new file mode 100644 index 00000000..a1103073 --- /dev/null +++ b/docs/TenantPolicyForPolicyWithSettingServicesInner.md @@ -0,0 +1,35 @@ +# TenantPolicyForPolicyWithSettingServicesInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**name** | **str** | | +**product_code** | **str** | | +**display_name** | **str** | | +**description** | **str** | | +**resource_types** | [**List[ResourceType]**](ResourceType.md) | | [optional] [default to []] +**features** | [**Features**](Features.md) | | [optional] + +## Example + +```python +from onelens_backend_client.models.tenant_policy_for_policy_with_setting_services_inner import TenantPolicyForPolicyWithSettingServicesInner + +# TODO update the JSON string below +json = "{}" +# create an instance of TenantPolicyForPolicyWithSettingServicesInner from a JSON string +tenant_policy_for_policy_with_setting_services_inner_instance = TenantPolicyForPolicyWithSettingServicesInner.from_json(json) +# print the JSON string representation of the object +print(TenantPolicyForPolicyWithSettingServicesInner.to_json()) + +# convert the object into a dict +tenant_policy_for_policy_with_setting_services_inner_dict = tenant_policy_for_policy_with_setting_services_inner_instance.to_dict() +# create an instance of TenantPolicyForPolicyWithSettingServicesInner from a dict +tenant_policy_for_policy_with_setting_services_inner_form_dict = tenant_policy_for_policy_with_setting_services_inner.from_dict(tenant_policy_for_policy_with_setting_services_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TenantPolicyWithSetting.md b/docs/TenantPolicyWithSetting.md index 41f70e60..6a618932 100644 --- a/docs/TenantPolicyWithSetting.md +++ b/docs/TenantPolicyWithSetting.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**policy** | [**TenantPolicy**](TenantPolicy.md) | The policy details. | +**policy** | [**TenantPolicyForPolicyWithSetting**](TenantPolicyForPolicyWithSetting.md) | The policy details. | **setting** | [**TenantPolicySettings**](TenantPolicySettings.md) | The policy setting details. | ## Example diff --git a/docs/TenantVerifyCurBucketAPIRequest.md b/docs/TenantVerifyCurBucketAPIRequest.md new file mode 100644 index 00000000..e5260b4f --- /dev/null +++ b/docs/TenantVerifyCurBucketAPIRequest.md @@ -0,0 +1,30 @@ +# TenantVerifyCurBucketAPIRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cur_bucket_config** | [**CurBucketConfig**](CurBucketConfig.md) | cur bucket config | +**cloud_id** | **str** | cloud id | + +## Example + +```python +from onelens_backend_client.models.tenant_verify_cur_bucket_api_request import TenantVerifyCurBucketAPIRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of TenantVerifyCurBucketAPIRequest from a JSON string +tenant_verify_cur_bucket_api_request_instance = TenantVerifyCurBucketAPIRequest.from_json(json) +# print the JSON string representation of the object +print(TenantVerifyCurBucketAPIRequest.to_json()) + +# convert the object into a dict +tenant_verify_cur_bucket_api_request_dict = tenant_verify_cur_bucket_api_request_instance.to_dict() +# create an instance of TenantVerifyCurBucketAPIRequest from a dict +tenant_verify_cur_bucket_api_request_form_dict = tenant_verify_cur_bucket_api_request.from_dict(tenant_verify_cur_bucket_api_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TenantVerifyCurBucketRequest.md b/docs/TenantVerifyCurBucketRequest.md index 9619e797..f6dbaf10 100644 --- a/docs/TenantVerifyCurBucketRequest.md +++ b/docs/TenantVerifyCurBucketRequest.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cur_bucket_config** | [**CurBucketConfig**](CurBucketConfig.md) | cur bucket config | **cloud_id** | **str** | cloud id | +**tenant_id** | **str** | Tenant ID | ## Example diff --git a/docs/TenantVerifyServiceApi.md b/docs/TenantVerifyServiceApi.md index 1b7d9c83..d7682d8a 100644 --- a/docs/TenantVerifyServiceApi.md +++ b/docs/TenantVerifyServiceApi.md @@ -77,7 +77,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **verify_tenant_cur_bucket** -> object verify_tenant_cur_bucket(request) +> object verify_tenant_cur_bucket(tenant_verify_cur_bucket_request) Verify Tenant Cur Bucket @@ -86,6 +86,7 @@ Verify Tenant Cur Bucket ```python import onelens_backend_client +from onelens_backend_client.models.tenant_verify_cur_bucket_request import TenantVerifyCurBucketRequest from onelens_backend_client.rest import ApiException from pprint import pprint @@ -100,11 +101,11 @@ configuration = onelens_backend_client.Configuration( with onelens_backend_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = onelens_backend_client.TenantVerifyServiceApi(api_client) - request = 'request_example' # str | + tenant_verify_cur_bucket_request = onelens_backend_client.TenantVerifyCurBucketRequest() # TenantVerifyCurBucketRequest | try: # Verify Tenant Cur Bucket - api_response = api_instance.verify_tenant_cur_bucket(request) + api_response = api_instance.verify_tenant_cur_bucket(tenant_verify_cur_bucket_request) print("The response of TenantVerifyServiceApi->verify_tenant_cur_bucket:\n") pprint(api_response) except Exception as e: @@ -118,7 +119,7 @@ with onelens_backend_client.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **request** | **str**| | + **tenant_verify_cur_bucket_request** | [**TenantVerifyCurBucketRequest**](TenantVerifyCurBucketRequest.md)| | ### Return type @@ -130,7 +131,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details diff --git a/docs/TenantsTenantProviderVerifyApi.md b/docs/TenantsTenantProviderVerifyApi.md index 62c9f678..99e81562 100644 --- a/docs/TenantsTenantProviderVerifyApi.md +++ b/docs/TenantsTenantProviderVerifyApi.md @@ -8,7 +8,7 @@ Method | Description # **verify_tenant_cur_bucket** -> ResponseTenantVerifyCurBucketResponse verify_tenant_cur_bucket(tenant_id, tenant_verify_cur_bucket_request) +> ResponseTenantVerifyCurBucketResponse verify_tenant_cur_bucket(tenant_id, tenant_verify_cur_bucket_api_request) Verify Tenant Cur Bucket @@ -20,7 +20,7 @@ An API endpoint that verifies the tenant cur bucket. ```python import onelens_backend_client from onelens_backend_client.models.response_tenant_verify_cur_bucket_response import ResponseTenantVerifyCurBucketResponse -from onelens_backend_client.models.tenant_verify_cur_bucket_request import TenantVerifyCurBucketRequest +from onelens_backend_client.models.tenant_verify_cur_bucket_api_request import TenantVerifyCurBucketAPIRequest from onelens_backend_client.rest import ApiException from pprint import pprint @@ -36,11 +36,11 @@ with onelens_backend_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = onelens_backend_client.TenantsTenantProviderVerifyApi(api_client) tenant_id = 'tenant_id_example' # str | - tenant_verify_cur_bucket_request = onelens_backend_client.TenantVerifyCurBucketRequest() # TenantVerifyCurBucketRequest | + tenant_verify_cur_bucket_api_request = onelens_backend_client.TenantVerifyCurBucketAPIRequest() # TenantVerifyCurBucketAPIRequest | try: # Verify Tenant Cur Bucket - api_response = api_instance.verify_tenant_cur_bucket(tenant_id, tenant_verify_cur_bucket_request) + api_response = api_instance.verify_tenant_cur_bucket(tenant_id, tenant_verify_cur_bucket_api_request) print("The response of TenantsTenantProviderVerifyApi->verify_tenant_cur_bucket:\n") pprint(api_response) except Exception as e: @@ -55,7 +55,7 @@ with onelens_backend_client.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tenant_id** | **str**| | - **tenant_verify_cur_bucket_request** | [**TenantVerifyCurBucketRequest**](TenantVerifyCurBucketRequest.md)| | + **tenant_verify_cur_bucket_api_request** | [**TenantVerifyCurBucketAPIRequest**](TenantVerifyCurBucketAPIRequest.md)| | ### Return type diff --git a/onelens_backend_client/__init__.py b/onelens_backend_client/__init__.py index 2c80b17f..c59ef5d0 100644 --- a/onelens_backend_client/__init__.py +++ b/onelens_backend_client/__init__.py @@ -464,6 +464,8 @@ from onelens_backend_client.models.tenant_policy import TenantPolicy from onelens_backend_client.models.tenant_policy_exclusions import TenantPolicyExclusions from onelens_backend_client.models.tenant_policy_filters import TenantPolicyFilters +from onelens_backend_client.models.tenant_policy_for_policy_with_setting import TenantPolicyForPolicyWithSetting +from onelens_backend_client.models.tenant_policy_for_policy_with_setting_services_inner import TenantPolicyForPolicyWithSettingServicesInner from onelens_backend_client.models.tenant_policy_settings import TenantPolicySettings from onelens_backend_client.models.tenant_policy_settings_filters import TenantPolicySettingsFilters from onelens_backend_client.models.tenant_policy_state import TenantPolicyState @@ -482,6 +484,7 @@ from onelens_backend_client.models.tenant_tickets_stats_metrics_sub_group_by import TenantTicketsStatsMetricsSubGroupBy from onelens_backend_client.models.tenant_user_details_update_fields_mixin import TenantUserDetailsUpdateFieldsMixin from onelens_backend_client.models.tenant_user_update_fields_mixin import TenantUserUpdateFieldsMixin +from onelens_backend_client.models.tenant_verify_cur_bucket_api_request import TenantVerifyCurBucketAPIRequest from onelens_backend_client.models.tenant_verify_cur_bucket_request import TenantVerifyCurBucketRequest from onelens_backend_client.models.tenant_verify_cur_bucket_response import TenantVerifyCurBucketResponse from onelens_backend_client.models.tenant_verify_request_with_user import TenantVerifyRequestWithUser diff --git a/onelens_backend_client/api/tenant_verify_service_api.py b/onelens_backend_client/api/tenant_verify_service_api.py index f9bea0dd..9043ac3a 100644 --- a/onelens_backend_client/api/tenant_verify_service_api.py +++ b/onelens_backend_client/api/tenant_verify_service_api.py @@ -16,8 +16,8 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictStr from typing import Any +from onelens_backend_client.models.tenant_verify_cur_bucket_request import TenantVerifyCurBucketRequest from onelens_backend_client.models.tenant_verify_request_with_user import TenantVerifyRequestWithUser from onelens_backend_client.models.tenant_verify_response import TenantVerifyResponse @@ -312,7 +312,7 @@ def _verify_tenant_serialize( @validate_call def verify_tenant_cur_bucket( self, - request: StrictStr, + tenant_verify_cur_bucket_request: TenantVerifyCurBucketRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -329,8 +329,8 @@ def verify_tenant_cur_bucket( """Verify Tenant Cur Bucket - :param request: (required) - :type request: str + :param tenant_verify_cur_bucket_request: (required) + :type tenant_verify_cur_bucket_request: TenantVerifyCurBucketRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -354,7 +354,7 @@ def verify_tenant_cur_bucket( """ # noqa: E501 _param = self._verify_tenant_cur_bucket_serialize( - request=request, + tenant_verify_cur_bucket_request=tenant_verify_cur_bucket_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -379,7 +379,7 @@ def verify_tenant_cur_bucket( @validate_call def verify_tenant_cur_bucket_with_http_info( self, - request: StrictStr, + tenant_verify_cur_bucket_request: TenantVerifyCurBucketRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -396,8 +396,8 @@ def verify_tenant_cur_bucket_with_http_info( """Verify Tenant Cur Bucket - :param request: (required) - :type request: str + :param tenant_verify_cur_bucket_request: (required) + :type tenant_verify_cur_bucket_request: TenantVerifyCurBucketRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -421,7 +421,7 @@ def verify_tenant_cur_bucket_with_http_info( """ # noqa: E501 _param = self._verify_tenant_cur_bucket_serialize( - request=request, + tenant_verify_cur_bucket_request=tenant_verify_cur_bucket_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -446,7 +446,7 @@ def verify_tenant_cur_bucket_with_http_info( @validate_call def verify_tenant_cur_bucket_without_preload_content( self, - request: StrictStr, + tenant_verify_cur_bucket_request: TenantVerifyCurBucketRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -463,8 +463,8 @@ def verify_tenant_cur_bucket_without_preload_content( """Verify Tenant Cur Bucket - :param request: (required) - :type request: str + :param tenant_verify_cur_bucket_request: (required) + :type tenant_verify_cur_bucket_request: TenantVerifyCurBucketRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -488,7 +488,7 @@ def verify_tenant_cur_bucket_without_preload_content( """ # noqa: E501 _param = self._verify_tenant_cur_bucket_serialize( - request=request, + tenant_verify_cur_bucket_request=tenant_verify_cur_bucket_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -508,7 +508,7 @@ def verify_tenant_cur_bucket_without_preload_content( def _verify_tenant_cur_bucket_serialize( self, - request, + tenant_verify_cur_bucket_request, _request_auth, _content_type, _headers, @@ -529,13 +529,11 @@ def _verify_tenant_cur_bucket_serialize( # process the path parameters # process the query parameters - if request is not None: - - _query_params.append(('request', request)) - # process the header parameters # process the form parameters # process the body parameter + if tenant_verify_cur_bucket_request is not None: + _body_params = tenant_verify_cur_bucket_request # set the HTTP header `Accept` @@ -545,6 +543,19 @@ def _verify_tenant_cur_bucket_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ diff --git a/onelens_backend_client/api/tenants_tenant_provider_verify_api.py b/onelens_backend_client/api/tenants_tenant_provider_verify_api.py index ba7f1c82..0cfe40e1 100644 --- a/onelens_backend_client/api/tenants_tenant_provider_verify_api.py +++ b/onelens_backend_client/api/tenants_tenant_provider_verify_api.py @@ -18,7 +18,7 @@ from pydantic import StrictStr from onelens_backend_client.models.response_tenant_verify_cur_bucket_response import ResponseTenantVerifyCurBucketResponse -from onelens_backend_client.models.tenant_verify_cur_bucket_request import TenantVerifyCurBucketRequest +from onelens_backend_client.models.tenant_verify_cur_bucket_api_request import TenantVerifyCurBucketAPIRequest from onelens_backend_client.api_client import ApiClient, RequestSerialized from onelens_backend_client.api_response import ApiResponse @@ -42,7 +42,7 @@ def __init__(self, api_client=None) -> None: def verify_tenant_cur_bucket( self, tenant_id: StrictStr, - tenant_verify_cur_bucket_request: TenantVerifyCurBucketRequest, + tenant_verify_cur_bucket_api_request: TenantVerifyCurBucketAPIRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -62,8 +62,8 @@ def verify_tenant_cur_bucket( :param tenant_id: (required) :type tenant_id: str - :param tenant_verify_cur_bucket_request: (required) - :type tenant_verify_cur_bucket_request: TenantVerifyCurBucketRequest + :param tenant_verify_cur_bucket_api_request: (required) + :type tenant_verify_cur_bucket_api_request: TenantVerifyCurBucketAPIRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -88,7 +88,7 @@ def verify_tenant_cur_bucket( _param = self._verify_tenant_cur_bucket_serialize( tenant_id=tenant_id, - tenant_verify_cur_bucket_request=tenant_verify_cur_bucket_request, + tenant_verify_cur_bucket_api_request=tenant_verify_cur_bucket_api_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -114,7 +114,7 @@ def verify_tenant_cur_bucket( def verify_tenant_cur_bucket_with_http_info( self, tenant_id: StrictStr, - tenant_verify_cur_bucket_request: TenantVerifyCurBucketRequest, + tenant_verify_cur_bucket_api_request: TenantVerifyCurBucketAPIRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -134,8 +134,8 @@ def verify_tenant_cur_bucket_with_http_info( :param tenant_id: (required) :type tenant_id: str - :param tenant_verify_cur_bucket_request: (required) - :type tenant_verify_cur_bucket_request: TenantVerifyCurBucketRequest + :param tenant_verify_cur_bucket_api_request: (required) + :type tenant_verify_cur_bucket_api_request: TenantVerifyCurBucketAPIRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -160,7 +160,7 @@ def verify_tenant_cur_bucket_with_http_info( _param = self._verify_tenant_cur_bucket_serialize( tenant_id=tenant_id, - tenant_verify_cur_bucket_request=tenant_verify_cur_bucket_request, + tenant_verify_cur_bucket_api_request=tenant_verify_cur_bucket_api_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -186,7 +186,7 @@ def verify_tenant_cur_bucket_with_http_info( def verify_tenant_cur_bucket_without_preload_content( self, tenant_id: StrictStr, - tenant_verify_cur_bucket_request: TenantVerifyCurBucketRequest, + tenant_verify_cur_bucket_api_request: TenantVerifyCurBucketAPIRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -206,8 +206,8 @@ def verify_tenant_cur_bucket_without_preload_content( :param tenant_id: (required) :type tenant_id: str - :param tenant_verify_cur_bucket_request: (required) - :type tenant_verify_cur_bucket_request: TenantVerifyCurBucketRequest + :param tenant_verify_cur_bucket_api_request: (required) + :type tenant_verify_cur_bucket_api_request: TenantVerifyCurBucketAPIRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -232,7 +232,7 @@ def verify_tenant_cur_bucket_without_preload_content( _param = self._verify_tenant_cur_bucket_serialize( tenant_id=tenant_id, - tenant_verify_cur_bucket_request=tenant_verify_cur_bucket_request, + tenant_verify_cur_bucket_api_request=tenant_verify_cur_bucket_api_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -253,7 +253,7 @@ def verify_tenant_cur_bucket_without_preload_content( def _verify_tenant_cur_bucket_serialize( self, tenant_id, - tenant_verify_cur_bucket_request, + tenant_verify_cur_bucket_api_request, _request_auth, _content_type, _headers, @@ -273,14 +273,16 @@ def _verify_tenant_cur_bucket_serialize( _body_params: Optional[bytes] = None # process the path parameters - if tenant_id is not None: - _path_params['tenant_id'] = tenant_id # process the query parameters + if tenant_id is not None: + + _query_params.append(('tenant_id', tenant_id)) + # process the header parameters # process the form parameters # process the body parameter - if tenant_verify_cur_bucket_request is not None: - _body_params = tenant_verify_cur_bucket_request + if tenant_verify_cur_bucket_api_request is not None: + _body_params = tenant_verify_cur_bucket_api_request # set the HTTP header `Accept` @@ -310,7 +312,7 @@ def _verify_tenant_cur_bucket_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v1/tenants/{tenant_id}/providers/verify_cur_bucket', + resource_path='/v1/providers/verify_cur_bucket', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/onelens_backend_client/models/__init__.py b/onelens_backend_client/models/__init__.py index ff502134..68a891d7 100644 --- a/onelens_backend_client/models/__init__.py +++ b/onelens_backend_client/models/__init__.py @@ -404,6 +404,8 @@ from onelens_backend_client.models.tenant_policy import TenantPolicy from onelens_backend_client.models.tenant_policy_exclusions import TenantPolicyExclusions from onelens_backend_client.models.tenant_policy_filters import TenantPolicyFilters +from onelens_backend_client.models.tenant_policy_for_policy_with_setting import TenantPolicyForPolicyWithSetting +from onelens_backend_client.models.tenant_policy_for_policy_with_setting_services_inner import TenantPolicyForPolicyWithSettingServicesInner from onelens_backend_client.models.tenant_policy_settings import TenantPolicySettings from onelens_backend_client.models.tenant_policy_settings_filters import TenantPolicySettingsFilters from onelens_backend_client.models.tenant_policy_state import TenantPolicyState @@ -422,6 +424,7 @@ from onelens_backend_client.models.tenant_tickets_stats_metrics_sub_group_by import TenantTicketsStatsMetricsSubGroupBy from onelens_backend_client.models.tenant_user_details_update_fields_mixin import TenantUserDetailsUpdateFieldsMixin from onelens_backend_client.models.tenant_user_update_fields_mixin import TenantUserUpdateFieldsMixin +from onelens_backend_client.models.tenant_verify_cur_bucket_api_request import TenantVerifyCurBucketAPIRequest from onelens_backend_client.models.tenant_verify_cur_bucket_request import TenantVerifyCurBucketRequest from onelens_backend_client.models.tenant_verify_cur_bucket_response import TenantVerifyCurBucketResponse from onelens_backend_client.models.tenant_verify_request_with_user import TenantVerifyRequestWithUser diff --git a/onelens_backend_client/models/get_policy_ticket_stats_group_by.py b/onelens_backend_client/models/get_policy_ticket_stats_group_by.py index b5ad54f5..91e45ea3 100644 --- a/onelens_backend_client/models/get_policy_ticket_stats_group_by.py +++ b/onelens_backend_client/models/get_policy_ticket_stats_group_by.py @@ -30,7 +30,8 @@ class GetPolicyTicketStatsGroupBy(BaseModel): field_name: StrictStr = Field(description="Field name to be fetched") field_value: Optional[Union[StrictFloat, StrictInt]] = None field_details: Optional[List[GetPolicyTicketStatsSubGroupBy]] = None - __properties: ClassVar[List[str]] = ["field_name", "field_value", "field_details"] + field_display_name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["field_name", "field_value", "field_details", "field_display_name"] model_config = ConfigDict( populate_by_name=True, @@ -88,6 +89,11 @@ def to_dict(self) -> Dict[str, Any]: if self.field_details is None and "field_details" in self.model_fields_set: _dict['field_details'] = None + # set to None if field_display_name (nullable) is None + # and model_fields_set contains the field + if self.field_display_name is None and "field_display_name" in self.model_fields_set: + _dict['field_display_name'] = None + return _dict @classmethod @@ -102,7 +108,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "field_name": obj.get("field_name"), "field_value": obj.get("field_value"), - "field_details": [GetPolicyTicketStatsSubGroupBy.from_dict(_item) for _item in obj["field_details"]] if obj.get("field_details") is not None else None + "field_details": [GetPolicyTicketStatsSubGroupBy.from_dict(_item) for _item in obj["field_details"]] if obj.get("field_details") is not None else None, + "field_display_name": obj.get("field_display_name") }) return _obj diff --git a/onelens_backend_client/models/get_policy_ticket_stats_sub_group_by.py b/onelens_backend_client/models/get_policy_ticket_stats_sub_group_by.py index 3183505b..270441d3 100644 --- a/onelens_backend_client/models/get_policy_ticket_stats_sub_group_by.py +++ b/onelens_backend_client/models/get_policy_ticket_stats_sub_group_by.py @@ -28,7 +28,8 @@ class GetPolicyTicketStatsSubGroupBy(BaseModel): """ # noqa: E501 field_name: StrictStr = Field(description="Field name to be fetched") field_value: Optional[Union[StrictFloat, StrictInt]] = None - __properties: ClassVar[List[str]] = ["field_name", "field_value"] + field_display_name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["field_name", "field_value", "field_display_name"] model_config = ConfigDict( populate_by_name=True, @@ -74,6 +75,11 @@ def to_dict(self) -> Dict[str, Any]: if self.field_value is None and "field_value" in self.model_fields_set: _dict['field_value'] = None + # set to None if field_display_name (nullable) is None + # and model_fields_set contains the field + if self.field_display_name is None and "field_display_name" in self.model_fields_set: + _dict['field_display_name'] = None + return _dict @classmethod @@ -87,7 +93,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "field_name": obj.get("field_name"), - "field_value": obj.get("field_value") + "field_value": obj.get("field_value"), + "field_display_name": obj.get("field_display_name") }) return _obj diff --git a/onelens_backend_client/models/get_single_policy_ticket_by_entity_id_response.py b/onelens_backend_client/models/get_single_policy_ticket_by_entity_id_response.py index b9c23df7..129e85e6 100644 --- a/onelens_backend_client/models/get_single_policy_ticket_by_entity_id_response.py +++ b/onelens_backend_client/models/get_single_policy_ticket_by_entity_id_response.py @@ -45,7 +45,8 @@ class GetSinglePolicyTicketByEntityIdResponse(BaseModel): policy_labels: Optional[List[StrictStr]] = Field(default=None, description="List of policy labels") policy_violated_on: datetime = Field(description="Datetime of the policy violation") potential_savings: Union[StrictFloat, StrictInt] = Field(description="Potential savings possible for the current policy violation") - __properties: ClassVar[List[str]] = ["ticket_id", "status", "state", "violation_attributes", "entity_id", "entity_name", "region", "service", "service_display_name", "account_id", "recommendation_unit_title", "policy_id", "policy_title", "policy_labels", "policy_violated_on", "potential_savings"] + resource_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["ticket_id", "status", "state", "violation_attributes", "entity_id", "entity_name", "region", "service", "service_display_name", "account_id", "recommendation_unit_title", "policy_id", "policy_title", "policy_labels", "policy_violated_on", "potential_savings", "resource_id"] model_config = ConfigDict( populate_by_name=True, @@ -91,6 +92,11 @@ def to_dict(self) -> Dict[str, Any]: if self.recommendation_unit_title is None and "recommendation_unit_title" in self.model_fields_set: _dict['recommendation_unit_title'] = None + # set to None if resource_id (nullable) is None + # and model_fields_set contains the field + if self.resource_id is None and "resource_id" in self.model_fields_set: + _dict['resource_id'] = None + return _dict @classmethod @@ -118,7 +124,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "policy_title": obj.get("policy_title"), "policy_labels": obj.get("policy_labels"), "policy_violated_on": obj.get("policy_violated_on"), - "potential_savings": obj.get("potential_savings") + "potential_savings": obj.get("potential_savings"), + "resource_id": obj.get("resource_id") }) return _obj diff --git a/onelens_backend_client/models/get_single_policy_ticket_by_policy_id_response.py b/onelens_backend_client/models/get_single_policy_ticket_by_policy_id_response.py index d29aa812..430cd11b 100644 --- a/onelens_backend_client/models/get_single_policy_ticket_by_policy_id_response.py +++ b/onelens_backend_client/models/get_single_policy_ticket_by_policy_id_response.py @@ -40,7 +40,8 @@ class GetSinglePolicyTicketByPolicyIdResponse(BaseModel): account_id: StrictStr = Field(description="Account Id managing the resource") recommendation_unit_title: Optional[StrictStr] = None potential_savings: Union[StrictFloat, StrictInt] = Field(description="Potential savings of the ticket") - __properties: ClassVar[List[str]] = ["ticket_id", "status", "state", "violation_attributes", "entity_id", "entity_name", "region", "service", "service_display_name", "account_id", "recommendation_unit_title", "potential_savings"] + resource_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["ticket_id", "status", "state", "violation_attributes", "entity_id", "entity_name", "region", "service", "service_display_name", "account_id", "recommendation_unit_title", "potential_savings", "resource_id"] model_config = ConfigDict( populate_by_name=True, @@ -86,6 +87,11 @@ def to_dict(self) -> Dict[str, Any]: if self.recommendation_unit_title is None and "recommendation_unit_title" in self.model_fields_set: _dict['recommendation_unit_title'] = None + # set to None if resource_id (nullable) is None + # and model_fields_set contains the field + if self.resource_id is None and "resource_id" in self.model_fields_set: + _dict['resource_id'] = None + return _dict @classmethod @@ -109,7 +115,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "service_display_name": obj.get("service_display_name"), "account_id": obj.get("account_id"), "recommendation_unit_title": obj.get("recommendation_unit_title"), - "potential_savings": obj.get("potential_savings") + "potential_savings": obj.get("potential_savings"), + "resource_id": obj.get("resource_id") }) return _obj diff --git a/onelens_backend_client/models/resource_type.py b/onelens_backend_client/models/resource_type.py index c1487e11..8e20d8ad 100644 --- a/onelens_backend_client/models/resource_type.py +++ b/onelens_backend_client/models/resource_type.py @@ -18,7 +18,7 @@ import json from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List +from typing import Any, ClassVar, Dict, List, Optional from onelens_backend_client.models.relationship_config_item import RelationshipConfigItem from typing import Optional, Set from typing_extensions import Self @@ -29,11 +29,12 @@ class ResourceType(BaseModel): """ # noqa: E501 resource_type: StrictStr resource_table: StrictStr + identifier_key: Optional[StrictStr] = None select_columns: List[StrictStr] resource_url_template: StrictStr is_tags_available: StrictBool relationship_config: List[RelationshipConfigItem] - __properties: ClassVar[List[str]] = ["resource_type", "resource_table", "select_columns", "resource_url_template", "is_tags_available", "relationship_config"] + __properties: ClassVar[List[str]] = ["resource_type", "resource_table", "identifier_key", "select_columns", "resource_url_template", "is_tags_available", "relationship_config"] model_config = ConfigDict( populate_by_name=True, @@ -81,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['relationship_config'] = _items + # set to None if identifier_key (nullable) is None + # and model_fields_set contains the field + if self.identifier_key is None and "identifier_key" in self.model_fields_set: + _dict['identifier_key'] = None + return _dict @classmethod @@ -95,6 +101,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "resource_type": obj.get("resource_type"), "resource_table": obj.get("resource_table"), + "identifier_key": obj.get("identifier_key"), "select_columns": obj.get("select_columns"), "resource_url_template": obj.get("resource_url_template"), "is_tags_available": obj.get("is_tags_available"), diff --git a/onelens_backend_client/models/tenant_policy_for_policy_with_setting.py b/onelens_backend_client/models/tenant_policy_for_policy_with_setting.py new file mode 100644 index 00000000..be2c76dd --- /dev/null +++ b/onelens_backend_client/models/tenant_policy_for_policy_with_setting.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + onelens-backend + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.1.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from onelens_backend_client.models.policy_category import PolicyCategory +from onelens_backend_client.models.policy_execution_type import PolicyExecutionType +from onelens_backend_client.models.policy_template_details_output import PolicyTemplateDetailsOutput +from onelens_backend_client.models.policy_template_recommendation_details_output import PolicyTemplateRecommendationDetailsOutput +from onelens_backend_client.models.provider import Provider +from onelens_backend_client.models.tenant_policy_for_policy_with_setting_services_inner import TenantPolicyForPolicyWithSettingServicesInner +from onelens_backend_client.models.tenant_policy_system_state import TenantPolicySystemState +from typing import Optional, Set +from typing_extensions import Self + +class TenantPolicyForPolicyWithSetting(BaseModel): + """ + TenantPolicyForPolicyWithSetting + """ # noqa: E501 + parent_ptp_id: StrictStr = Field(description="The id of the parent policy template pack.") + title: StrictStr = Field(description="The title of the policy template.") + alias: StrictStr = Field(description="The alias of the policy template.") + description: Optional[StrictStr] = Field(default=None, description="The description of the policy template.") + services: List[TenantPolicyForPolicyWithSettingServicesInner] = Field(description="The list of services display names associated the policy template.") + execution_type: PolicyExecutionType = Field(description="The execution type of the policy template.") + details: PolicyTemplateDetailsOutput = Field(description="The details of the policy template.") + description2: Optional[StrictStr] = Field(default=None, description="The description2 of the policy template.") + resource_type: StrictStr = Field(description="The resource type of the policy template.") + recommendation_details: PolicyTemplateRecommendationDetailsOutput = Field(description="The recommendation details for the policy template.") + policy_template_id: StrictStr = Field(description="The id of the policy template.") + category: PolicyCategory = Field(description="The category of the policy template.") + provider: Provider = Field(description="The cloud provider of the policy template.") + id: StrictStr = Field(description="The unique identifier of the tenant policy.") + state: TenantPolicySystemState = Field(description="The state of the tenant policy.") + __properties: ClassVar[List[str]] = ["parent_ptp_id", "title", "alias", "description", "services", "execution_type", "details", "description2", "resource_type", "recommendation_details", "policy_template_id", "category", "provider", "id", "state"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TenantPolicyForPolicyWithSetting from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in services (list) + _items = [] + if self.services: + for _item in self.services: + if _item: + _items.append(_item.to_dict()) + _dict['services'] = _items + # override the default output from pydantic by calling `to_dict()` of details + if self.details: + _dict['details'] = self.details.to_dict() + # override the default output from pydantic by calling `to_dict()` of recommendation_details + if self.recommendation_details: + _dict['recommendation_details'] = self.recommendation_details.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TenantPolicyForPolicyWithSetting from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "parent_ptp_id": obj.get("parent_ptp_id"), + "title": obj.get("title"), + "alias": obj.get("alias"), + "description": obj.get("description"), + "services": [TenantPolicyForPolicyWithSettingServicesInner.from_dict(_item) for _item in obj["services"]] if obj.get("services") is not None else None, + "execution_type": obj.get("execution_type"), + "details": PolicyTemplateDetailsOutput.from_dict(obj["details"]) if obj.get("details") is not None else None, + "description2": obj.get("description2"), + "resource_type": obj.get("resource_type"), + "recommendation_details": PolicyTemplateRecommendationDetailsOutput.from_dict(obj["recommendation_details"]) if obj.get("recommendation_details") is not None else None, + "policy_template_id": obj.get("policy_template_id"), + "category": obj.get("category"), + "provider": obj.get("provider"), + "id": obj.get("id"), + "state": obj.get("state") + }) + return _obj + + diff --git a/onelens_backend_client/models/tenant_policy_for_policy_with_setting_services_inner.py b/onelens_backend_client/models/tenant_policy_for_policy_with_setting_services_inner.py new file mode 100644 index 00000000..cead0fe8 --- /dev/null +++ b/onelens_backend_client/models/tenant_policy_for_policy_with_setting_services_inner.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + onelens-backend + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.1.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from onelens_backend_client.models.service_catalog import ServiceCatalog +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +TENANTPOLICYFORPOLICYWITHSETTINGSERVICESINNER_ANY_OF_SCHEMAS = ["ServiceCatalog", "str"] + +class TenantPolicyForPolicyWithSettingServicesInner(BaseModel): + """ + TenantPolicyForPolicyWithSettingServicesInner + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: ServiceCatalog + anyof_schema_2_validator: Optional[ServiceCatalog] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[ServiceCatalog, str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "ServiceCatalog", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = TenantPolicyForPolicyWithSettingServicesInner.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: ServiceCatalog + if not isinstance(v, ServiceCatalog): + error_messages.append(f"Error! Input type `{type(v)}` is not `ServiceCatalog`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in TenantPolicyForPolicyWithSettingServicesInner with anyOf schemas: ServiceCatalog, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[ServiceCatalog] = None + try: + instance.actual_instance = ServiceCatalog.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into TenantPolicyForPolicyWithSettingServicesInner with anyOf schemas: ServiceCatalog, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ServiceCatalog, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/onelens_backend_client/models/tenant_policy_with_setting.py b/onelens_backend_client/models/tenant_policy_with_setting.py index 1de11712..22d054c7 100644 --- a/onelens_backend_client/models/tenant_policy_with_setting.py +++ b/onelens_backend_client/models/tenant_policy_with_setting.py @@ -19,7 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List -from onelens_backend_client.models.tenant_policy import TenantPolicy +from onelens_backend_client.models.tenant_policy_for_policy_with_setting import TenantPolicyForPolicyWithSetting from onelens_backend_client.models.tenant_policy_settings import TenantPolicySettings from typing import Optional, Set from typing_extensions import Self @@ -28,7 +28,7 @@ class TenantPolicyWithSetting(BaseModel): """ TenantPolicyWithSetting """ # noqa: E501 - policy: TenantPolicy = Field(description="The policy details.") + policy: TenantPolicyForPolicyWithSetting = Field(description="The policy details.") setting: TenantPolicySettings = Field(description="The policy setting details.") __properties: ClassVar[List[str]] = ["policy", "setting"] @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "policy": TenantPolicy.from_dict(obj["policy"]) if obj.get("policy") is not None else None, + "policy": TenantPolicyForPolicyWithSetting.from_dict(obj["policy"]) if obj.get("policy") is not None else None, "setting": TenantPolicySettings.from_dict(obj["setting"]) if obj.get("setting") is not None else None }) return _obj diff --git a/onelens_backend_client/models/tenant_verify_cur_bucket_api_request.py b/onelens_backend_client/models/tenant_verify_cur_bucket_api_request.py new file mode 100644 index 00000000..e25074bb --- /dev/null +++ b/onelens_backend_client/models/tenant_verify_cur_bucket_api_request.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + onelens-backend + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.1.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from onelens_backend_client.models.cur_bucket_config import CurBucketConfig +from typing import Optional, Set +from typing_extensions import Self + +class TenantVerifyCurBucketAPIRequest(BaseModel): + """ + TenantVerifyCurBucketAPIRequest + """ # noqa: E501 + cur_bucket_config: CurBucketConfig = Field(description="cur bucket config") + cloud_id: StrictStr = Field(description="cloud id") + __properties: ClassVar[List[str]] = ["cur_bucket_config", "cloud_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TenantVerifyCurBucketAPIRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of cur_bucket_config + if self.cur_bucket_config: + _dict['cur_bucket_config'] = self.cur_bucket_config.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TenantVerifyCurBucketAPIRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cur_bucket_config": CurBucketConfig.from_dict(obj["cur_bucket_config"]) if obj.get("cur_bucket_config") is not None else None, + "cloud_id": obj.get("cloud_id") + }) + return _obj + + diff --git a/onelens_backend_client/models/tenant_verify_cur_bucket_request.py b/onelens_backend_client/models/tenant_verify_cur_bucket_request.py index 261ec10a..2640327f 100644 --- a/onelens_backend_client/models/tenant_verify_cur_bucket_request.py +++ b/onelens_backend_client/models/tenant_verify_cur_bucket_request.py @@ -29,7 +29,8 @@ class TenantVerifyCurBucketRequest(BaseModel): """ # noqa: E501 cur_bucket_config: CurBucketConfig = Field(description="cur bucket config") cloud_id: StrictStr = Field(description="cloud id") - __properties: ClassVar[List[str]] = ["cur_bucket_config", "cloud_id"] + tenant_id: StrictStr = Field(description="Tenant ID") + __properties: ClassVar[List[str]] = ["cur_bucket_config", "cloud_id", "tenant_id"] model_config = ConfigDict( populate_by_name=True, @@ -86,7 +87,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "cur_bucket_config": CurBucketConfig.from_dict(obj["cur_bucket_config"]) if obj.get("cur_bucket_config") is not None else None, - "cloud_id": obj.get("cloud_id") + "cloud_id": obj.get("cloud_id"), + "tenant_id": obj.get("tenant_id") }) return _obj diff --git a/test/test_tenant_policy_for_policy_with_setting.py b/test/test_tenant_policy_for_policy_with_setting.py new file mode 100644 index 00000000..1eb5c0d3 --- /dev/null +++ b/test/test_tenant_policy_for_policy_with_setting.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + onelens-backend + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.1.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from onelens_backend_client.models.tenant_policy_for_policy_with_setting import TenantPolicyForPolicyWithSetting + +class TestTenantPolicyForPolicyWithSetting(unittest.TestCase): + """TenantPolicyForPolicyWithSetting unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TenantPolicyForPolicyWithSetting: + """Test TenantPolicyForPolicyWithSetting + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TenantPolicyForPolicyWithSetting` + """ + model = TenantPolicyForPolicyWithSetting() + if include_optional: + return TenantPolicyForPolicyWithSetting( + parent_ptp_id = '', + title = '', + alias = '', + description = '', + services = [ + null + ], + execution_type = 'DETECTIVE', + details = onelens_backend_client.models.policy_template_details.PolicyTemplateDetails( + inputs = [ + '' + ], + config_schema = onelens_backend_client.models.config_schema.config_schema(), + primary_violation_attributes_schema = onelens_backend_client.models.primary_violation_attributes_schema.primary_violation_attributes_schema(), + secondary_violation_attributes_schema = onelens_backend_client.models.secondary_violation_attributes_schema.secondary_violation_attributes_schema(), + rule_type = 'SQL', + rule_definition = '', + rule_definition_hash = '', + default_policy_config = onelens_backend_client.models.default_policy_config.default_policy_config(), + default_policy_config_hash = '', + metrics_details = [ + onelens_backend_client.models.metrics_chart_config.MetricsChartConfig( + chart_title = '', + chart_type = '', + table_name = '', + metric_name = '', + aggregation_type = null, + look_back_period = null, + threshold = onelens_backend_client.models.metrics_threshold.MetricsThreshold( + value_from = '', + value = null, ), ) + ], ), + description2 = '', + resource_type = '', + recommendation_details = onelens_backend_client.models.policy_template_recommendation_details.PolicyTemplateRecommendationDetails( + applicable_recommendation_units = [ + onelens_backend_client.models.policy_template_recommendation_units.PolicyTemplateRecommendationUnits( + recommendation_unit_id = '', + params = null, ) + ], ), + policy_template_id = '', + category = 'COST_SAVING', + provider = 'AWS', + id = '', + state = 'ACTIVE' + ) + else: + return TenantPolicyForPolicyWithSetting( + parent_ptp_id = '', + title = '', + alias = '', + services = [ + null + ], + execution_type = 'DETECTIVE', + details = onelens_backend_client.models.policy_template_details.PolicyTemplateDetails( + inputs = [ + '' + ], + config_schema = onelens_backend_client.models.config_schema.config_schema(), + primary_violation_attributes_schema = onelens_backend_client.models.primary_violation_attributes_schema.primary_violation_attributes_schema(), + secondary_violation_attributes_schema = onelens_backend_client.models.secondary_violation_attributes_schema.secondary_violation_attributes_schema(), + rule_type = 'SQL', + rule_definition = '', + rule_definition_hash = '', + default_policy_config = onelens_backend_client.models.default_policy_config.default_policy_config(), + default_policy_config_hash = '', + metrics_details = [ + onelens_backend_client.models.metrics_chart_config.MetricsChartConfig( + chart_title = '', + chart_type = '', + table_name = '', + metric_name = '', + aggregation_type = null, + look_back_period = null, + threshold = onelens_backend_client.models.metrics_threshold.MetricsThreshold( + value_from = '', + value = null, ), ) + ], ), + resource_type = '', + recommendation_details = onelens_backend_client.models.policy_template_recommendation_details.PolicyTemplateRecommendationDetails( + applicable_recommendation_units = [ + onelens_backend_client.models.policy_template_recommendation_units.PolicyTemplateRecommendationUnits( + recommendation_unit_id = '', + params = null, ) + ], ), + policy_template_id = '', + category = 'COST_SAVING', + provider = 'AWS', + id = '', + state = 'ACTIVE', + ) + """ + + def testTenantPolicyForPolicyWithSetting(self): + """Test TenantPolicyForPolicyWithSetting""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tenant_policy_for_policy_with_setting_services_inner.py b/test/test_tenant_policy_for_policy_with_setting_services_inner.py new file mode 100644 index 00000000..98c0b4d0 --- /dev/null +++ b/test/test_tenant_policy_for_policy_with_setting_services_inner.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + onelens-backend + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.1.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from onelens_backend_client.models.tenant_policy_for_policy_with_setting_services_inner import TenantPolicyForPolicyWithSettingServicesInner + +class TestTenantPolicyForPolicyWithSettingServicesInner(unittest.TestCase): + """TenantPolicyForPolicyWithSettingServicesInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TenantPolicyForPolicyWithSettingServicesInner: + """Test TenantPolicyForPolicyWithSettingServicesInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TenantPolicyForPolicyWithSettingServicesInner` + """ + model = TenantPolicyForPolicyWithSettingServicesInner() + if include_optional: + return TenantPolicyForPolicyWithSettingServicesInner( + id = '', + name = '', + product_code = '', + display_name = '', + description = '', + resource_types = [ + onelens_backend_client.models.resource_type.ResourceType( + resource_type = '', + resource_table = '', + identifier_key = '', + select_columns = [ + '' + ], + resource_url_template = '', + is_tags_available = True, + relationship_config = [ + onelens_backend_client.models.relationship_config_item.RelationshipConfigItem( + relationship_type = '', + join = onelens_backend_client.models.join.Join( + current_table_column = '', + join_table = '', + join_table_column = '', ), ) + ], ) + ], + features = onelens_backend_client.models.features.Features( + enable_in_policy = True, + enable_in_anomalies = True, ) + ) + else: + return TenantPolicyForPolicyWithSettingServicesInner( + id = '', + name = '', + product_code = '', + display_name = '', + description = '', + ) + """ + + def testTenantPolicyForPolicyWithSettingServicesInner(self): + """Test TenantPolicyForPolicyWithSettingServicesInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tenant_verify_cur_bucket_api_request.py b/test/test_tenant_verify_cur_bucket_api_request.py new file mode 100644 index 00000000..ad392286 --- /dev/null +++ b/test/test_tenant_verify_cur_bucket_api_request.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + onelens-backend + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.1.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from onelens_backend_client.models.tenant_verify_cur_bucket_api_request import TenantVerifyCurBucketAPIRequest + +class TestTenantVerifyCurBucketAPIRequest(unittest.TestCase): + """TenantVerifyCurBucketAPIRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TenantVerifyCurBucketAPIRequest: + """Test TenantVerifyCurBucketAPIRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TenantVerifyCurBucketAPIRequest` + """ + model = TenantVerifyCurBucketAPIRequest() + if include_optional: + return TenantVerifyCurBucketAPIRequest( + cur_bucket_config = onelens_backend_client.models.cur_bucket_config.CurBucketConfig( + name = '', + role = '', + path = '', + version = 'v1', + status = 'INITIALISED', ), + cloud_id = '' + ) + else: + return TenantVerifyCurBucketAPIRequest( + cur_bucket_config = onelens_backend_client.models.cur_bucket_config.CurBucketConfig( + name = '', + role = '', + path = '', + version = 'v1', + status = 'INITIALISED', ), + cloud_id = '', + ) + """ + + def testTenantVerifyCurBucketAPIRequest(self): + """Test TenantVerifyCurBucketAPIRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()