diff --git a/onelens_backend_client_v2/models.py b/onelens_backend_client_v2/models.py index ac46c8c5..824f91a6 100644 --- a/onelens_backend_client_v2/models.py +++ b/onelens_backend_client_v2/models.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: -# timestamp: 2024-10-25T05:55:44+00:00 +# timestamp: 2024-11-11T13:54:11+00:00 from __future__ import annotations @@ -21,6 +21,10 @@ ) +class APIUpdateFeatureStatusEnabledRequest(BaseModel): + id: UUID4 = Field(..., title="Id") + + class ActivatePolicyTemplateRequest(BaseModel): id: UUID4 = Field( ..., description="The unique identifier of the policy template.", title="Id" @@ -877,6 +881,18 @@ class ExportFileType(str, Enum): pdf = "pdf" +class FeatureConfig(BaseModel): + enable_metrics_for_days: Optional[int] = Field( + None, title="Enable Metrics For Days" + ) + threshold_percentage: Optional[int] = Field(None, title="Threshold Percentage") + + +class FeatureStore(BaseModel): + enabled_for: Optional[List[str]] = Field(None, title="Enabled For") + config: Optional[FeatureConfig] = None + + class Features(BaseModel): enable_in_policy: Optional[bool] = Field(False, title="Enable In Policy") enable_in_anomalies: Optional[bool] = Field(False, title="Enable In Anomalies") @@ -904,6 +920,10 @@ class GenerationStatus(str, Enum): AMBIGUOUS_QUERY = "AMBIGUOUS_QUERY" +class GetAllFeaturesRequest(BaseModel): + pass + + class GetAllParentNodesRequest(BaseModel): tenant_id: UUID4 = Field( ..., description="The id of the tenant.", title="Tenant Id" @@ -1270,11 +1290,6 @@ class MarkViewAsDefaultResponse(BaseModel): pass -class Metric(BaseModel): - measures: Dict[str, Any] = Field(..., title="Measures") - timestamp: str = Field(..., title="Timestamp") - - class MetricsAggregationType(str, Enum): p99_maximum = "p99_maximum" p95_maximum = "p95_maximum" @@ -1845,6 +1860,10 @@ class RecommendationUnitWithActionType(BaseModel): ) +class RegisterAllFeaturesRequest(BaseModel): + tenant_id: UUID4 = Field(..., title="Tenant Id") + + class RelationshipConfigItem(BaseModel): relationship_type: str = Field(..., title="Relationship Type") join: Join @@ -2014,6 +2033,16 @@ class ResourceHierarchyMappingResponse(BaseModel): pass +class ResourceMetricConfig(BaseModel): + resource_type: Optional[str] = Field(None, title="Resource Type") + metric_table_additional_columns: Optional[List[str]] = Field( + None, title="Metric Table Additional Columns" + ) + resource_select_statement: Optional[str] = Field( + None, title="Resource Select Statement" + ) + + class ResourceRelationshipResponse(BaseModel): relationship_type: str = Field( ..., description="The relationship type", title="Relationship Type" @@ -2024,20 +2053,6 @@ class ResourceRelationshipResponse(BaseModel): resource: ResourceCatalog = Field(..., description="The resource details.") -class ResourceType(BaseModel): - resource_type: str = Field(..., title="Resource Type") - resource_table: str = Field(..., title="Resource Table") - identifier_key: Optional[str] = Field(None, title="Identifier Key") - select_columns: List[str] = Field(..., title="Select Columns") - resource_url_template: str = Field(..., title="Resource Url Template") - is_tags_available: bool = Field(..., title="Is Tags Available") - relationship_config: List[RelationshipConfigItem] = Field( - ..., title="Relationship Config" - ) - created_at_column: Optional[str] = Field(None, title="Created At Column") - updated_at_column: Optional[str] = Field(None, title="Updated At Column") - - class ResponseActivatePolicyTemplateResponse(BaseModel): data: ActivatePolicyTemplateResponse message: Optional[str] = Field(None, title="Message") @@ -2178,20 +2193,6 @@ class RuleType(str, Enum): PYTHON = "PYTHON" -class ServiceCatalog(BaseModel): - id: str = Field(..., title="Id") - name: str = Field(..., title="Name") - product_code: str = Field(..., title="Product Code") - display_name: str = Field(..., title="Display Name") - description: str = Field(..., title="Description") - resource_types: Optional[List[ResourceType]] = Field([], title="Resource Types") - features: Optional[Features] = Field( - default_factory=lambda: Features.model_validate( - {"enable_in_policy": False, "enable_in_anomalies": False} - ) - ) - - class ServiceCatalogRequest(BaseModel): tenant_id: UUID = Field(..., description="The id of the tenant.", title="Tenant Id") @@ -2201,10 +2202,6 @@ class ServiceCatalogRequestFind(BaseModel): id: str = Field(..., description="The id of the service catalog.", title="Id") -class ServiceCatalogResponse(BaseModel): - services: List[ServiceCatalog] = Field(..., title="Services") - - class SetOrganizationStatusResponse(BaseModel): pass @@ -2357,6 +2354,11 @@ class TenantEmbedAppsLinksWithUser(BaseModel): ) +class TenantFeatureScope(str, Enum): + POLICY = "POLICY" + GLOBAL = "GLOBAL" + + class TenantFilters(BaseModel): ids: Optional[List[UUID4]] = Field(None, title="Ids") names: Optional[List[str]] = Field(None, title="Names") @@ -2567,6 +2569,12 @@ class UpdateActionTypeResponse(BaseModel): id: int = Field(..., description="Action Type ID", title="Id") +class UpdateFeatureStatusRequest(BaseModel): + tenant_id: UUID4 = Field(..., title="Tenant Id") + id: UUID4 = Field(..., title="Id") + is_enabled: bool = Field(..., title="Is Enabled") + + class UpdateOrganizationRequest(BaseModel): name: Optional[str] = Field( None, description="Name of the organization", title="Name" @@ -3006,6 +3014,11 @@ class OnelensModelsServiceInterfacesTenantDataMetricsServiceGranularityUnit(str, months = "months" +class OnelensModelsServiceInterfacesTenantDataMetricsServiceMetric(BaseModel): + measures: Dict[str, Any] = Field(..., title="Measures") + timestamp: str = Field(..., title="Timestamp") + + class OnelensModelsServiceInterfacesTenantDataMetricsServiceOperator(str, Enum): equals = "equals" in_ = "in" @@ -3061,6 +3074,11 @@ class OnelensModelsServiceInterfacesTenantMetadataCommonsHierarchyNodeCategory2( OTHER = "OTHER" +class OnelensModelsServiceInterfacesTenantMetadataServiceCatalogDtoMetric(BaseModel): + metric_name: str = Field(..., title="Metric Name") + unit: str = Field(..., title="Unit") + + class OnelensModelsServiceInterfacesUtilitiesCommonsGranularityUnit(str, Enum): minutes = "minutes" days = "days" @@ -3086,6 +3104,21 @@ class OnelensModelsServiceInterfacesUtilitiesDataRetrieverServiceTimeDimension( ) +class APIGetFeaturesByFiltersRequest(BaseModel): + scope: Optional[TenantFeatureScope] = Field( + None, description="Scope of the feature" + ) + entity_id: Optional[List[str]] = Field( + None, description="List of entity IDs for the feature", title="Entity Id" + ) + feature_name: Optional[str] = Field( + None, description="Name of the feature", title="Feature Name" + ) + is_enabled: Optional[bool] = Field( + None, description="Whether the feature is enabled", title="Is Enabled" + ) + + class ActionType(BaseModel): service: Union[AwsService, GcpService] = Field( ..., description="Service AWS etc.", title="Service" @@ -4156,6 +4189,14 @@ class EnableTenantUserResponse(BaseModel): id: UUID4 = Field(..., description="PK in the tenant users table", title="Id") +class Feature(BaseModel): + id: UUID4 = Field(..., title="Id") + name: str = Field(..., title="Name") + description: str = Field(..., title="Description") + scope: TenantFeatureScope + feature_store: Optional[FeatureStore] = None + + class GetActionTypeRequest(BaseModel): pagination: Optional[PaginationParams] = Field( default_factory=lambda: PaginationParams.model_validate( @@ -4178,6 +4219,10 @@ class GetActionTypeResponse(BaseModel): pagination: PaginationFields = Field(..., description="Pagination fields") +class GetAllFeaturesResponse(BaseModel): + features: List[Feature] = Field(..., title="Features") + + class GetAllNaviraFullLogResponse(BaseModel): pagination: PaginationFields = Field(..., description="Pagination fields.") navira_logs: List[NaviraFullLogResponse] = Field( @@ -4347,7 +4392,9 @@ class GetLeafNodesRequest(BaseModel): class GetMetricsResponse(BaseModel): - metrics: List[Metric] = Field(..., title="Metrics") + metrics: List[OnelensModelsServiceInterfacesTenantDataMetricsServiceMetric] = Field( + ..., title="Metrics" + ) unit: str = Field(..., title="Unit") @@ -5377,6 +5424,25 @@ class ResourceHierarchyMappingRequest(BaseModel): leaf_nodes: LeafNodes = Field(..., description="The leaf nodes") +class ResourceType(BaseModel): + resource_type: str = Field(..., title="Resource Type") + resource_table: str = Field(..., title="Resource Table") + identifier_key: Optional[str] = Field(None, title="Identifier Key") + select_columns: List[str] = Field(..., title="Select Columns") + resource_url_template: str = Field(..., title="Resource Url Template") + is_tags_available: bool = Field(..., title="Is Tags Available") + relationship_config: List[RelationshipConfigItem] = Field( + ..., title="Relationship Config" + ) + created_at_column: Optional[str] = Field(None, title="Created At Column") + updated_at_column: Optional[str] = Field(None, title="Updated At Column") + metrics: Optional[ + List[OnelensModelsServiceInterfacesTenantMetadataServiceCatalogDtoMetric] + ] = Field(None, title="Metrics") + metric_table: Optional[str] = Field(None, title="Metric Table") + resource_metric_config: Optional[ResourceMetricConfig] = None + + class ResponseAddTenantPolicyExclusionsResponse(BaseModel): data: AddTenantPolicyExclusionsResponse message: Optional[str] = Field(None, title="Message") @@ -5537,6 +5603,24 @@ class ResponseValidateHierarchyNodeFieldsResponse(BaseModel): message: Optional[str] = Field(None, title="Message") +class ServiceCatalog(BaseModel): + id: str = Field(..., title="Id") + name: str = Field(..., title="Name") + product_code: str = Field(..., title="Product Code") + display_name: str = Field(..., title="Display Name") + description: str = Field(..., title="Description") + resource_types: Optional[List[ResourceType]] = Field([], title="Resource Types") + features: Optional[Features] = Field( + default_factory=lambda: Features.model_validate( + {"enable_in_policy": False, "enable_in_anomalies": False} + ) + ) + + +class ServiceCatalogResponse(BaseModel): + services: List[ServiceCatalog] = Field(..., title="Services") + + class SubGroupByOption(BaseModel): type: GroupByType = Field( ..., description="Type of the group (e.g., NODE, GENERAL)" @@ -5626,6 +5710,36 @@ class TenantAnomalySettings(BaseModel): ) +class TenantFeature(BaseModel): + id: UUID4 = Field( + ..., description="Unique identifier for the tenant feature", title="Id" + ) + feature_id: UUID4 = Field( + ..., + description="Unique identifier for the feature from catalog", + title="Feature Id", + ) + feature_name: str = Field( + ..., description="Name of the feature", title="Feature Name" + ) + is_enabled: bool = Field( + ..., description="Whether the feature is enabled", title="Is Enabled" + ) + scope: TenantFeatureScope = Field(..., description="Scope of the feature") + entity_id: Optional[str] = Field( + None, description="Entity ID for the feature", title="Entity Id" + ) + config: Optional[FeatureConfig] = Field( + None, description="Configuration for the feature" + ) + created_at: datetime = Field( + ..., description="Creation datetime of the feature", title="Created At" + ) + updated_at: datetime = Field( + ..., description="Update datetime of the feature", title="Updated At" + ) + + class TenantPolicySettings(BaseModel): id: UUID4 = Field( ..., @@ -5785,6 +5899,11 @@ class TenantTicket(BaseModel): ticket_alias: Optional[int] = Field( None, description="the numeric ticket alias of the ticket", title="Ticket Alias" ) + trigger_id: UUID = Field( + ..., + description="The unique identifier of the trigger that created the ticket", + title="Trigger Id", + ) class TenantTicketFilters(BaseModel): @@ -5886,6 +6005,11 @@ class TenantTicketWithTicketAlias(BaseModel): description="the # included ticket alias of the ticket", title="Ticket Alias", ) + trigger_id: UUID = Field( + ..., + description="The unique identifier of the trigger that created the ticket", + title="Trigger Id", + ) class TenantUserDetailsUpdateFieldsMixin(BaseModel): @@ -5982,6 +6106,10 @@ class TicketsSelectedField(BaseModel): ) +class UpdateFeatureStatusResponse(BaseModel): + feature: TenantFeature + + class UpdateHierarchyNodeAPIRequest(BaseModel): name: Optional[constr(max_length=30)] = Field(None, title="Name") parent_id: Optional[UUID4] = Field( @@ -6542,6 +6670,10 @@ class OnelensModelsServiceInterfacesTenantDataMetricsServiceTimeDimensionOutput( granularity: GranularityOutput +class APIUpdateFeatureStatusUpdateResponse(BaseModel): + feature: TenantFeature + + class BulkUpdateTenantTicketsAPIResponse(BaseModel): data: BulkUpdateTenantTicketsRequestMixin = Field( ..., description="Updated tickets data" @@ -6834,6 +6966,10 @@ class GetCURDataMetricsAPIRequest(BaseModel): query: CURDataMetricsQuery +class GetFeaturesByFiltersResponse(BaseModel): + features: List[TenantFeature] = Field(..., title="Features") + + class GetHierarchyFlatAPIRequest(BaseModel): filters: Optional[GetHierarchyFlatFilters] = Field( default_factory=lambda: GetHierarchyFlatFilters.model_validate( @@ -7195,6 +7331,9 @@ class GetPolicyTicketsExportAPIRequest(BaseModel): selected_fields: Optional[List[TicketsSelectedField]] = Field( None, description="Selected fields to be fetched", title="Selected Fields" ) + file_extension: Optional[ExportFileType] = Field( + "xlsx", description="export file type" + ) class GetPolicyTicketsExportRequest(BaseModel): @@ -7211,12 +7350,12 @@ class GetPolicyTicketsExportRequest(BaseModel): selected_fields: Optional[List[TicketsSelectedField]] = Field( None, description="Selected fields to be fetched", title="Selected Fields" ) + file_extension: Optional[ExportFileType] = Field( + "xlsx", description="export file type" + ) tenant_id: UUID4 = Field( ..., description="The unique identifier of the tenant", title="Tenant Id" ) - file_extension: Optional[ExportFileType] = Field( - "csv", description="export file type" - ) class GetResourceCatalogCostDataStatsAPIRequest(BaseModel): @@ -7819,6 +7958,10 @@ class PolicyTemplateUpdateFieldsMixin(BaseModel): ) +class RegisterAllFeaturesResponse(BaseModel): + features: List[TenantFeature] = Field(..., title="Features") + + class ResponseBulkUpdateTenantTicketsAPIResponse(BaseModel): data: BulkUpdateTenantTicketsAPIResponse message: Optional[str] = Field(None, title="Message") @@ -7969,6 +8112,9 @@ class TenantPolicy(BaseModel): recommendation_details: PolicyTemplateRecommendationDetailsOutput = Field( ..., description="The recommendation details for the policy template." ) + activated_at: Optional[datetime] = Field( + None, description="activated at timestamp", title="Activated At" + ) policy_template_id: UUID4 = Field( ..., description="The id of the policy template.", title="Policy Template Id" ) @@ -8025,6 +8171,11 @@ class TenantPolicyForPolicyWithSetting(BaseModel): recommendation_details: PolicyTemplateRecommendationDetailsOutput = Field( ..., description="The recommendation details for the policy template." ) + activated_at: datetime = Field( + ..., + description="The timestamp when the policy was activated.", + title="Activated At", + ) policy_template_id: UUID4 = Field( ..., description="The id of the policy template.", title="Policy Template Id" ) @@ -8040,11 +8191,6 @@ class TenantPolicyForPolicyWithSetting(BaseModel): state: TenantPolicySystemState = Field( ..., description="The state of the tenant policy." ) - created_at: datetime = Field( - ..., - description="The timestamp when the policy was created.", - title="Created At", - ) is_new: Optional[bool] = Field( False, description="Flag to indicate if the policy is new.", title="Is New" ) @@ -8089,6 +8235,9 @@ class TenantPolicyWithPolicyDisplayAlias(BaseModel): recommendation_details: PolicyTemplateRecommendationDetailsOutput = Field( ..., description="The recommendation details for the policy template." ) + activated_at: Optional[datetime] = Field( + None, description="activated at timestamp", title="Activated At" + ) policy_template_id: UUID4 = Field( ..., description="The id of the policy template.", title="Policy Template Id" ) @@ -8203,6 +8352,9 @@ class UpdatePolicyTemplateResponse(BaseModel): recommendation_details: PolicyTemplateRecommendationDetailsOutput = Field( ..., description="The recommendation details for the policy template." ) + activated_at: Optional[datetime] = Field( + None, description="activated at timestamp", title="Activated At" + ) category: PolicyCategory = Field( ..., description="The category of the policy template." ) @@ -8363,6 +8515,9 @@ class CreatePolicyTemplateRequest(BaseModel): recommendation_details: PolicyTemplateRecommendationDetailsInput = Field( ..., description="The recommendation details for the policy template." ) + activated_at: Optional[datetime] = Field( + None, description="activated at timestamp", title="Activated At" + ) requirements: Optional[str] = Field( None, description="The requirements of the policy template.", @@ -8409,6 +8564,9 @@ class CreatePolicyTemplateResponse(BaseModel): recommendation_details: PolicyTemplateRecommendationDetailsOutput = Field( ..., description="The recommendation details for the policy template." ) + activated_at: Optional[datetime] = Field( + None, description="activated at timestamp", title="Activated At" + ) category: PolicyCategory = Field( ..., description="The category of the policy template." ) @@ -8429,7 +8587,7 @@ class CreatePolicyTemplateResponse(BaseModel): class CreateSavedViewAPIRequest(BaseModel): - name: constr(min_length=3, max_length=30) = Field( + name: constr(max_length=30) = Field( ..., description="Name of the saved view", title="Name" ) page: constr(min_length=3, max_length=30) = Field( @@ -8441,7 +8599,7 @@ class CreateSavedViewAPIRequest(BaseModel): class CreateSavedViewRequest(BaseModel): - name: constr(min_length=3, max_length=30) = Field( + name: constr(max_length=30) = Field( ..., description="Name of the saved view", title="Name" ) page: constr(min_length=3, max_length=30) = Field( @@ -8664,7 +8822,9 @@ class GetMutipleMetricsRequest(BaseModel): class GetMutipleMetricsResponseMixin(BaseModel): query: MetricsQueryOutput = Field(..., description="Query for the metric") - metrics: List[Metric] = Field(..., title="Metrics") + metrics: List[OnelensModelsServiceInterfacesTenantDataMetricsServiceMetric] = Field( + ..., title="Metrics" + ) unit: str = Field(..., title="Unit") @@ -8707,6 +8867,9 @@ class GetPolicyTemplateByAliasResponse(BaseModel): recommendation_details: PolicyTemplateRecommendationDetailsOutput = Field( ..., description="The recommendation details for the policy template." ) + activated_at: Optional[datetime] = Field( + None, description="activated at timestamp", title="Activated At" + ) category: PolicyCategory = Field( ..., description="The category of the policy template." ) @@ -8765,6 +8928,9 @@ class GetPolicyTemplateByIDResponse(BaseModel): recommendation_details: PolicyTemplateRecommendationDetailsOutput = Field( ..., description="The recommendation details for the policy template." ) + activated_at: Optional[datetime] = Field( + None, description="activated at timestamp", title="Activated At" + ) category: PolicyCategory = Field( ..., description="The category of the policy template." ) @@ -8837,6 +9003,9 @@ class GetTenantPolicyByIdResponse(BaseModel): recommendation_details: PolicyTemplateRecommendationDetailsOutput = Field( ..., description="The recommendation details for the policy template." ) + activated_at: Optional[datetime] = Field( + None, description="activated at timestamp", title="Activated At" + ) policy_template_id: UUID4 = Field( ..., description="The id of the policy template.", title="Policy Template Id" ) @@ -9022,6 +9191,9 @@ class PolicyTemplate(BaseModel): recommendation_details: PolicyTemplateRecommendationDetailsOutput = Field( ..., description="The recommendation details for the policy template." ) + activated_at: Optional[datetime] = Field( + None, description="activated at timestamp", title="Activated At" + ) category: PolicyCategory = Field( ..., description="The category of the policy template." ) diff --git a/onelens_backend_client_v2/rpc/__init__.py b/onelens_backend_client_v2/rpc/__init__.py index 68f0f3d7..596cd981 100644 --- a/onelens_backend_client_v2/rpc/__init__.py +++ b/onelens_backend_client_v2/rpc/__init__.py @@ -106,6 +106,10 @@ TenantConnectionServiceRpcHandler, ) +from onelens_backend_client_v2.rpc.feature_service_rpc_handler import ( + FeatureServiceRpcHandler, +) + __all__ = [ "TenantVerifyServiceRpcHandler", @@ -135,4 +139,5 @@ "NaviraServiceRpcHandler", "ActionTypeMigrationServiceRpcHandler", "TenantConnectionServiceRpcHandler", + "FeatureServiceRpcHandler", ] diff --git a/onelens_backend_client_v2/rpc/feature_service_rpc_handler.py b/onelens_backend_client_v2/rpc/feature_service_rpc_handler.py new file mode 100644 index 00000000..73313f3d --- /dev/null +++ b/onelens_backend_client_v2/rpc/feature_service_rpc_handler.py @@ -0,0 +1,525 @@ +# FeatureServiceRpcHandler API + +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + + +from onelens_backend_client_v2.models import GetAllFeaturesRequest + + +from onelens_backend_client_v2.models import GetAllFeaturesResponse + + +from onelens_backend_client_v2.models import APIGetFeaturesByFiltersRequest + + +from onelens_backend_client_v2.models import GetFeaturesByFiltersResponse + + +from onelens_backend_client_v2.models import RegisterAllFeaturesRequest + + +from onelens_backend_client_v2.models import RegisterAllFeaturesResponse + + +from onelens_backend_client_v2.models import UpdateFeatureStatusRequest + + +from onelens_backend_client_v2.models import UpdateFeatureStatusResponse + + +from onelens_backend_client_v2.api_client import ApiClient, RequestSerialized + + +class FeatureServiceRpcHandler: + """NOTE: This class is auto generated. Do not edit the class manually.""" + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def get_all( + self, + request: GetAllFeaturesRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetAllFeaturesResponse: + """Get all features of the tenant + + + + :param request: (required) + :type request: GetAllFeaturesRequest + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_all_serialize( + request=request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetAllFeaturesResponse", + "422": "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + def _get_all_serialize( + self, + request: GetAllFeaturesRequest, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the body parameter + if request is not None: + _body_params = request + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # 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] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/rpc/feature_service/get_all", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_features_by_filters( + self, + request: APIGetFeaturesByFiltersRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetFeaturesByFiltersResponse: + """Get features by filters + + + + :param request: (required) + :type request: APIGetFeaturesByFiltersRequest + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_features_by_filters_serialize( + request=request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetFeaturesByFiltersResponse", + "422": "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + def _get_features_by_filters_serialize( + self, + request: APIGetFeaturesByFiltersRequest, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the body parameter + if request is not None: + _body_params = request + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # 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] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/rpc/feature_service/get_features_by_filters", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def register_all_features( + self, + request: RegisterAllFeaturesRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RegisterAllFeaturesResponse: + """Register all service features in the tenant + + + + :param request: (required) + :type request: RegisterAllFeaturesRequest + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._register_all_features_serialize( + request=request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RegisterAllFeaturesResponse", + "422": "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + def _register_all_features_serialize( + self, + request: RegisterAllFeaturesRequest, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the body parameter + if request is not None: + _body_params = request + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # 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] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/rpc/feature_service/register_all_features", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_feature_status( + self, + request: UpdateFeatureStatusRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UpdateFeatureStatusResponse: + """Enable feature by change manager + + + + :param request: (required) + :type request: UpdateFeatureStatusRequest + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._update_feature_status_serialize( + request=request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "UpdateFeatureStatusResponse", + "422": "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + def _update_feature_status_serialize( + self, + request: UpdateFeatureStatusRequest, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the body parameter + if request is not None: + _body_params = request + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # 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] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/rpc/feature_service/update_feature_status", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/onelens_backend_client_v2/rpc/saved_view_service_rpc_handler.py b/onelens_backend_client_v2/rpc/saved_view_service_rpc_handler.py index f0d3c078..6cae49fb 100644 --- a/onelens_backend_client_v2/rpc/saved_view_service_rpc_handler.py +++ b/onelens_backend_client_v2/rpc/saved_view_service_rpc_handler.py @@ -410,7 +410,7 @@ def _get_saved_views_serialize( ) @validate_call - def mark_saved_view_as_default( + def toggle_default_to_saved_view( self, request: MarkViewAsDefaultRequest, _request_timeout: Union[ @@ -453,7 +453,7 @@ def mark_saved_view_as_default( :return: Returns the result object. """ - _param = self._mark_saved_view_as_default_serialize( + _param = self._toggle_default_to_saved_view_serialize( request=request, _request_auth=_request_auth, _content_type=_content_type, @@ -474,7 +474,7 @@ def mark_saved_view_as_default( response_types_map=_response_types_map, ).data - def _mark_saved_view_as_default_serialize( + def _toggle_default_to_saved_view_serialize( self, request: MarkViewAsDefaultRequest, _request_auth, @@ -517,7 +517,7 @@ def _mark_saved_view_as_default_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/rpc/saved_view_service/mark_saved_view_as_default", + resource_path="/rpc/saved_view_service/toggle_default_to_saved_view", path_params=_path_params, query_params=_query_params, header_params=_header_params,