diff --git a/scaleway-async/scaleway_async/inference/v1/api.py b/scaleway-async/scaleway_async/inference/v1/api.py index 8e9b3db2c..e8e1970c7 100644 --- a/scaleway-async/scaleway_async/inference/v1/api.py +++ b/scaleway-async/scaleway_async/inference/v1/api.py @@ -56,7 +56,7 @@ class InferenceV1API(API): """ - This API allows you to handle your Managed Inference services. + This API allows you to handle your Generative APIs - Dedicated Deployment services. """ async def list_deployments( diff --git a/scaleway-async/scaleway_async/search/__init__.py b/scaleway-async/scaleway_async/search/__init__.py new file mode 100644 index 000000000..8b74a5ed7 --- /dev/null +++ b/scaleway-async/scaleway_async/search/__init__.py @@ -0,0 +1,2 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. diff --git a/scaleway-async/scaleway_async/search/v1alpha1/__init__.py b/scaleway-async/scaleway_async/search/v1alpha1/__init__.py new file mode 100644 index 000000000..173e317da --- /dev/null +++ b/scaleway-async/scaleway_async/search/v1alpha1/__init__.py @@ -0,0 +1,25 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. +from .types import ResourceType +from .types import BrmServerInfo +from .types import ServerlessContainersContainerInfo +from .types import ServerlessFunctionsFunctionInfo +from .types import ServerlessSqldbBackupInfo +from .types import VpcPrivateNetworkInfo +from .types import Resource +from .types import SearchResourcesRequest +from .types import SearchResourcesResponse +from .api import SearchV1Alpha1API + +__all__ = [ + "ResourceType", + "BrmServerInfo", + "ServerlessContainersContainerInfo", + "ServerlessFunctionsFunctionInfo", + "ServerlessSqldbBackupInfo", + "VpcPrivateNetworkInfo", + "Resource", + "SearchResourcesRequest", + "SearchResourcesResponse", + "SearchV1Alpha1API", +] diff --git a/scaleway-async/scaleway_async/search/v1alpha1/api.py b/scaleway-async/scaleway_async/search/v1alpha1/api.py new file mode 100644 index 000000000..738eaa629 --- /dev/null +++ b/scaleway-async/scaleway_async/search/v1alpha1/api.py @@ -0,0 +1,49 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. + +from typing import Optional + +from scaleway_core.api import API +from .types import ( + SearchResourcesResponse, +) +from .marshalling import ( + unmarshal_SearchResourcesResponse, +) + + +class SearchV1Alpha1API(API): + """ """ + + async def search_resources( + self, + *, + query: str, + organization_id: Optional[str] = None, + ) -> SearchResourcesResponse: + """ + Search API. + :param query: Search query. + :param organization_id: ID of the Organization to search in. + :return: :class:`SearchResourcesResponse ` + + Usage: + :: + + result = await api.search_resources( + query="example", + ) + """ + + res = self._request( + "GET", + "/search/v1alpha1/resources", + params={ + "organization_id": organization_id + or self.client.default_organization_id, + "query": query, + }, + ) + + self._throw_on_error(res) + return unmarshal_SearchResourcesResponse(res.json()) diff --git a/scaleway-async/scaleway_async/search/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/search/v1alpha1/marshalling.py new file mode 100644 index 000000000..5e65ac8e2 --- /dev/null +++ b/scaleway-async/scaleway_async/search/v1alpha1/marshalling.py @@ -0,0 +1,218 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. + +from typing import Any + +from .types import ( + ResourceType, + BrmServerInfo, + ServerlessContainersContainerInfo, + ServerlessFunctionsFunctionInfo, + ServerlessSqldbBackupInfo, + VpcPrivateNetworkInfo, + Resource, + SearchResourcesResponse, +) + + +def unmarshal_BrmServerInfo(data: Any) -> BrmServerInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'BrmServerInfo' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("ip", None) + if field is not None: + args["ip"] = field + else: + args["ip"] = None + + return BrmServerInfo(**args) + + +def unmarshal_ServerlessContainersContainerInfo( + data: Any, +) -> ServerlessContainersContainerInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ServerlessContainersContainerInfo' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("namespace_id", None) + if field is not None: + args["namespace_id"] = field + else: + args["namespace_id"] = None + + return ServerlessContainersContainerInfo(**args) + + +def unmarshal_ServerlessFunctionsFunctionInfo( + data: Any, +) -> ServerlessFunctionsFunctionInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ServerlessFunctionsFunctionInfo' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("namespace_id", None) + if field is not None: + args["namespace_id"] = field + else: + args["namespace_id"] = None + + return ServerlessFunctionsFunctionInfo(**args) + + +def unmarshal_ServerlessSqldbBackupInfo(data: Any) -> ServerlessSqldbBackupInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ServerlessSqldbBackupInfo' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("database_id", None) + if field is not None: + args["database_id"] = field + else: + args["database_id"] = None + + return ServerlessSqldbBackupInfo(**args) + + +def unmarshal_VpcPrivateNetworkInfo(data: Any) -> VpcPrivateNetworkInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'VpcPrivateNetworkInfo' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("vpc_id", None) + if field is not None: + args["vpc_id"] = field + else: + args["vpc_id"] = None + + return VpcPrivateNetworkInfo(**args) + + +def unmarshal_Resource(data: Any) -> Resource: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'Resource' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + else: + args["id"] = None + + field = data.get("organization_id", None) + if field is not None: + args["organization_id"] = field + else: + args["organization_id"] = None + + field = data.get("type", None) + if field is not None: + args["type_"] = field + else: + args["type_"] = ResourceType.UNKNOWN_TYPE + + field = data.get("name", None) + if field is not None: + args["name"] = field + else: + args["name"] = None + + field = data.get("project_id", None) + if field is not None: + args["project_id"] = field + else: + args["project_id"] = None + + field = data.get("global", None) + if field is not None: + args["global_"] = field + else: + args["global_"] = False + + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("region", None) + if field is not None: + args["region"] = field + else: + args["region"] = None + + field = data.get("vpc_private_network_info", None) + if field is not None: + args["vpc_private_network_info"] = unmarshal_VpcPrivateNetworkInfo(field) + else: + args["vpc_private_network_info"] = None + + field = data.get("serverless_functions_function_info", None) + if field is not None: + args["serverless_functions_function_info"] = ( + unmarshal_ServerlessFunctionsFunctionInfo(field) + ) + else: + args["serverless_functions_function_info"] = None + + field = data.get("serverless_containers_container_info", None) + if field is not None: + args["serverless_containers_container_info"] = ( + unmarshal_ServerlessContainersContainerInfo(field) + ) + else: + args["serverless_containers_container_info"] = None + + field = data.get("baremetal_server_info", None) + if field is not None: + args["baremetal_server_info"] = unmarshal_BrmServerInfo(field) + else: + args["baremetal_server_info"] = None + + field = data.get("serverless_sqldb_backup_info", None) + if field is not None: + args["serverless_sqldb_backup_info"] = unmarshal_ServerlessSqldbBackupInfo( + field + ) + else: + args["serverless_sqldb_backup_info"] = None + + return Resource(**args) + + +def unmarshal_SearchResourcesResponse(data: Any) -> SearchResourcesResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'SearchResourcesResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("resources", None) + if field is not None: + args["resources"] = ( + [unmarshal_Resource(v) for v in field] if field is not None else None + ) + else: + args["resources"] = [] + + return SearchResourcesResponse(**args) diff --git a/scaleway-async/scaleway_async/search/v1alpha1/types.py b/scaleway-async/scaleway_async/search/v1alpha1/types.py new file mode 100644 index 000000000..298455f7a --- /dev/null +++ b/scaleway-async/scaleway_async/search/v1alpha1/types.py @@ -0,0 +1,164 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. +from __future__ import annotations + +from dataclasses import dataclass +from enum import Enum +from typing import Optional + +from scaleway_core.bridge import ( + Region as ScwRegion, + Zone as ScwZone, +) +from scaleway_core.utils import ( + StrEnumMeta, +) + + +class ResourceType(str, Enum, metaclass=StrEnumMeta): + UNKNOWN_TYPE = "unknown_type" + INSTANCE_SERVER = "instance_server" + INSTANCE_VOLUME = "instance_volume" + INSTANCE_IMAGE = "instance_image" + K8S_CLUSTER = "k8s_cluster" + K8S_POOL = "k8s_pool" + K8S_NODE = "k8s_node" + DOMAIN_DOMAIN = "domain_domain" + DNS_ZONE = "dns_zone" + VPC_PRIVATE_NETWORK = "vpc_private_network" + VPC_VPC = "vpc_vpc" + VPG_GATEWAY = "vpg_gateway" + APPLE_SILICON_SERVER = "apple_silicon_server" + RDB_INSTANCE = "rdb_instance" + RDB_SNAPSHOT = "rdb_snapshot" + RDB_BACKUP = "rdb_backup" + BAREMETAL_SERVER = "baremetal_server" + TEM_DOMAIN = "tem_domain" + LB_SERVER = "lb_server" + SERVERLESS_FUNCTIONS_FUNCTION = "serverless_functions_function" + SERVERLESS_CONTAINERS_CONTAINER = "serverless_containers_container" + WBH_HOSTING = "wbh_hosting" + REDIS_CLUSTER = "redis_cluster" + SM_SECRET = "sm_secret" + KMS_KEY = "kms_key" + EDG_PIPELINE = "edg_pipeline" + MNQ_NATS_ACCOUNT = "mnq_nats_account" + SBS_VOLUME = "sbs_volume" + SBS_SNAPSHOT = "sbs_snapshot" + SERVERLESS_JOB_DEFINITION = "serverless_job_definition" + SERVERLESS_SQLDB_DATABASE = "serverless_sqldb_database" + SERVERLESS_SQLDB_BACKUP = "serverless_sqldb_backup" + DDL_DATALAB = "ddl_datalab" + MGDB_INSTANCE = "mgdb_instance" + MGDB_SNAPSHOT = "mgdb_snapshot" + IFR_DEPLOYMENT = "ifr_deployment" + IFR_MODEL = "ifr_model" + GAPI_BATCH = "gapi_batch" + DTWH_DEPLOYMENT = "dtwh_deployment" + OBS_DATASOURCE = "obs_datasource" + OBS_TOKEN = "obs_token" + OBS_ALERT = "obs_alert" + + def __str__(self) -> str: + return str(self.value) + + +@dataclass +class BrmServerInfo: + ip: str + + +@dataclass +class ServerlessContainersContainerInfo: + namespace_id: str + """ + ID of the Namespace the Serverless Container belongs to. + """ + + +@dataclass +class ServerlessFunctionsFunctionInfo: + namespace_id: str + """ + ID of the Namespace the Serverless Function belongs to. + """ + + +@dataclass +class ServerlessSqldbBackupInfo: + database_id: str + + +@dataclass +class VpcPrivateNetworkInfo: + vpc_id: str + """ + ID of the VPC the Private Network belongs to. + """ + + +@dataclass +class Resource: + id: str + """ + ID of the resource. + """ + + organization_id: str + """ + ID of the Organization the resource belongs to. + """ + + type_: ResourceType + """ + Type of the resource. + """ + + name: Optional[str] = None + """ + Name of the resource. + """ + + project_id: Optional[str] = None + """ + ID of the Project the resource belongs to. + """ + + global_: Optional[bool] = False + + zone: Optional[ScwZone] = None + + region: Optional[ScwRegion] = None + + vpc_private_network_info: Optional[VpcPrivateNetworkInfo] = None + + serverless_functions_function_info: Optional[ServerlessFunctionsFunctionInfo] = None + + serverless_containers_container_info: Optional[ + ServerlessContainersContainerInfo + ] = None + + baremetal_server_info: Optional[BrmServerInfo] = None + + serverless_sqldb_backup_info: Optional[ServerlessSqldbBackupInfo] = None + + +@dataclass +class SearchResourcesRequest: + query: str + """ + Search query. + """ + + organization_id: Optional[str] = None + """ + ID of the Organization to search in. + """ + + +@dataclass +class SearchResourcesResponse: + resources: list[Resource] + """ + Top resources found. + """ diff --git a/scaleway/scaleway/inference/v1/api.py b/scaleway/scaleway/inference/v1/api.py index 75626fc27..827c1f850 100644 --- a/scaleway/scaleway/inference/v1/api.py +++ b/scaleway/scaleway/inference/v1/api.py @@ -56,7 +56,7 @@ class InferenceV1API(API): """ - This API allows you to handle your Managed Inference services. + This API allows you to handle your Generative APIs - Dedicated Deployment services. """ def list_deployments( diff --git a/scaleway/scaleway/search/__init__.py b/scaleway/scaleway/search/__init__.py new file mode 100644 index 000000000..8b74a5ed7 --- /dev/null +++ b/scaleway/scaleway/search/__init__.py @@ -0,0 +1,2 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. diff --git a/scaleway/scaleway/search/v1alpha1/__init__.py b/scaleway/scaleway/search/v1alpha1/__init__.py new file mode 100644 index 000000000..173e317da --- /dev/null +++ b/scaleway/scaleway/search/v1alpha1/__init__.py @@ -0,0 +1,25 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. +from .types import ResourceType +from .types import BrmServerInfo +from .types import ServerlessContainersContainerInfo +from .types import ServerlessFunctionsFunctionInfo +from .types import ServerlessSqldbBackupInfo +from .types import VpcPrivateNetworkInfo +from .types import Resource +from .types import SearchResourcesRequest +from .types import SearchResourcesResponse +from .api import SearchV1Alpha1API + +__all__ = [ + "ResourceType", + "BrmServerInfo", + "ServerlessContainersContainerInfo", + "ServerlessFunctionsFunctionInfo", + "ServerlessSqldbBackupInfo", + "VpcPrivateNetworkInfo", + "Resource", + "SearchResourcesRequest", + "SearchResourcesResponse", + "SearchV1Alpha1API", +] diff --git a/scaleway/scaleway/search/v1alpha1/api.py b/scaleway/scaleway/search/v1alpha1/api.py new file mode 100644 index 000000000..ccb6f22cd --- /dev/null +++ b/scaleway/scaleway/search/v1alpha1/api.py @@ -0,0 +1,49 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. + +from typing import Optional + +from scaleway_core.api import API +from .types import ( + SearchResourcesResponse, +) +from .marshalling import ( + unmarshal_SearchResourcesResponse, +) + + +class SearchV1Alpha1API(API): + """ """ + + def search_resources( + self, + *, + query: str, + organization_id: Optional[str] = None, + ) -> SearchResourcesResponse: + """ + Search API. + :param query: Search query. + :param organization_id: ID of the Organization to search in. + :return: :class:`SearchResourcesResponse ` + + Usage: + :: + + result = api.search_resources( + query="example", + ) + """ + + res = self._request( + "GET", + "/search/v1alpha1/resources", + params={ + "organization_id": organization_id + or self.client.default_organization_id, + "query": query, + }, + ) + + self._throw_on_error(res) + return unmarshal_SearchResourcesResponse(res.json()) diff --git a/scaleway/scaleway/search/v1alpha1/marshalling.py b/scaleway/scaleway/search/v1alpha1/marshalling.py new file mode 100644 index 000000000..5e65ac8e2 --- /dev/null +++ b/scaleway/scaleway/search/v1alpha1/marshalling.py @@ -0,0 +1,218 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. + +from typing import Any + +from .types import ( + ResourceType, + BrmServerInfo, + ServerlessContainersContainerInfo, + ServerlessFunctionsFunctionInfo, + ServerlessSqldbBackupInfo, + VpcPrivateNetworkInfo, + Resource, + SearchResourcesResponse, +) + + +def unmarshal_BrmServerInfo(data: Any) -> BrmServerInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'BrmServerInfo' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("ip", None) + if field is not None: + args["ip"] = field + else: + args["ip"] = None + + return BrmServerInfo(**args) + + +def unmarshal_ServerlessContainersContainerInfo( + data: Any, +) -> ServerlessContainersContainerInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ServerlessContainersContainerInfo' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("namespace_id", None) + if field is not None: + args["namespace_id"] = field + else: + args["namespace_id"] = None + + return ServerlessContainersContainerInfo(**args) + + +def unmarshal_ServerlessFunctionsFunctionInfo( + data: Any, +) -> ServerlessFunctionsFunctionInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ServerlessFunctionsFunctionInfo' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("namespace_id", None) + if field is not None: + args["namespace_id"] = field + else: + args["namespace_id"] = None + + return ServerlessFunctionsFunctionInfo(**args) + + +def unmarshal_ServerlessSqldbBackupInfo(data: Any) -> ServerlessSqldbBackupInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ServerlessSqldbBackupInfo' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("database_id", None) + if field is not None: + args["database_id"] = field + else: + args["database_id"] = None + + return ServerlessSqldbBackupInfo(**args) + + +def unmarshal_VpcPrivateNetworkInfo(data: Any) -> VpcPrivateNetworkInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'VpcPrivateNetworkInfo' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("vpc_id", None) + if field is not None: + args["vpc_id"] = field + else: + args["vpc_id"] = None + + return VpcPrivateNetworkInfo(**args) + + +def unmarshal_Resource(data: Any) -> Resource: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'Resource' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + else: + args["id"] = None + + field = data.get("organization_id", None) + if field is not None: + args["organization_id"] = field + else: + args["organization_id"] = None + + field = data.get("type", None) + if field is not None: + args["type_"] = field + else: + args["type_"] = ResourceType.UNKNOWN_TYPE + + field = data.get("name", None) + if field is not None: + args["name"] = field + else: + args["name"] = None + + field = data.get("project_id", None) + if field is not None: + args["project_id"] = field + else: + args["project_id"] = None + + field = data.get("global", None) + if field is not None: + args["global_"] = field + else: + args["global_"] = False + + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("region", None) + if field is not None: + args["region"] = field + else: + args["region"] = None + + field = data.get("vpc_private_network_info", None) + if field is not None: + args["vpc_private_network_info"] = unmarshal_VpcPrivateNetworkInfo(field) + else: + args["vpc_private_network_info"] = None + + field = data.get("serverless_functions_function_info", None) + if field is not None: + args["serverless_functions_function_info"] = ( + unmarshal_ServerlessFunctionsFunctionInfo(field) + ) + else: + args["serverless_functions_function_info"] = None + + field = data.get("serverless_containers_container_info", None) + if field is not None: + args["serverless_containers_container_info"] = ( + unmarshal_ServerlessContainersContainerInfo(field) + ) + else: + args["serverless_containers_container_info"] = None + + field = data.get("baremetal_server_info", None) + if field is not None: + args["baremetal_server_info"] = unmarshal_BrmServerInfo(field) + else: + args["baremetal_server_info"] = None + + field = data.get("serverless_sqldb_backup_info", None) + if field is not None: + args["serverless_sqldb_backup_info"] = unmarshal_ServerlessSqldbBackupInfo( + field + ) + else: + args["serverless_sqldb_backup_info"] = None + + return Resource(**args) + + +def unmarshal_SearchResourcesResponse(data: Any) -> SearchResourcesResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'SearchResourcesResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("resources", None) + if field is not None: + args["resources"] = ( + [unmarshal_Resource(v) for v in field] if field is not None else None + ) + else: + args["resources"] = [] + + return SearchResourcesResponse(**args) diff --git a/scaleway/scaleway/search/v1alpha1/types.py b/scaleway/scaleway/search/v1alpha1/types.py new file mode 100644 index 000000000..298455f7a --- /dev/null +++ b/scaleway/scaleway/search/v1alpha1/types.py @@ -0,0 +1,164 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. +from __future__ import annotations + +from dataclasses import dataclass +from enum import Enum +from typing import Optional + +from scaleway_core.bridge import ( + Region as ScwRegion, + Zone as ScwZone, +) +from scaleway_core.utils import ( + StrEnumMeta, +) + + +class ResourceType(str, Enum, metaclass=StrEnumMeta): + UNKNOWN_TYPE = "unknown_type" + INSTANCE_SERVER = "instance_server" + INSTANCE_VOLUME = "instance_volume" + INSTANCE_IMAGE = "instance_image" + K8S_CLUSTER = "k8s_cluster" + K8S_POOL = "k8s_pool" + K8S_NODE = "k8s_node" + DOMAIN_DOMAIN = "domain_domain" + DNS_ZONE = "dns_zone" + VPC_PRIVATE_NETWORK = "vpc_private_network" + VPC_VPC = "vpc_vpc" + VPG_GATEWAY = "vpg_gateway" + APPLE_SILICON_SERVER = "apple_silicon_server" + RDB_INSTANCE = "rdb_instance" + RDB_SNAPSHOT = "rdb_snapshot" + RDB_BACKUP = "rdb_backup" + BAREMETAL_SERVER = "baremetal_server" + TEM_DOMAIN = "tem_domain" + LB_SERVER = "lb_server" + SERVERLESS_FUNCTIONS_FUNCTION = "serverless_functions_function" + SERVERLESS_CONTAINERS_CONTAINER = "serverless_containers_container" + WBH_HOSTING = "wbh_hosting" + REDIS_CLUSTER = "redis_cluster" + SM_SECRET = "sm_secret" + KMS_KEY = "kms_key" + EDG_PIPELINE = "edg_pipeline" + MNQ_NATS_ACCOUNT = "mnq_nats_account" + SBS_VOLUME = "sbs_volume" + SBS_SNAPSHOT = "sbs_snapshot" + SERVERLESS_JOB_DEFINITION = "serverless_job_definition" + SERVERLESS_SQLDB_DATABASE = "serverless_sqldb_database" + SERVERLESS_SQLDB_BACKUP = "serverless_sqldb_backup" + DDL_DATALAB = "ddl_datalab" + MGDB_INSTANCE = "mgdb_instance" + MGDB_SNAPSHOT = "mgdb_snapshot" + IFR_DEPLOYMENT = "ifr_deployment" + IFR_MODEL = "ifr_model" + GAPI_BATCH = "gapi_batch" + DTWH_DEPLOYMENT = "dtwh_deployment" + OBS_DATASOURCE = "obs_datasource" + OBS_TOKEN = "obs_token" + OBS_ALERT = "obs_alert" + + def __str__(self) -> str: + return str(self.value) + + +@dataclass +class BrmServerInfo: + ip: str + + +@dataclass +class ServerlessContainersContainerInfo: + namespace_id: str + """ + ID of the Namespace the Serverless Container belongs to. + """ + + +@dataclass +class ServerlessFunctionsFunctionInfo: + namespace_id: str + """ + ID of the Namespace the Serverless Function belongs to. + """ + + +@dataclass +class ServerlessSqldbBackupInfo: + database_id: str + + +@dataclass +class VpcPrivateNetworkInfo: + vpc_id: str + """ + ID of the VPC the Private Network belongs to. + """ + + +@dataclass +class Resource: + id: str + """ + ID of the resource. + """ + + organization_id: str + """ + ID of the Organization the resource belongs to. + """ + + type_: ResourceType + """ + Type of the resource. + """ + + name: Optional[str] = None + """ + Name of the resource. + """ + + project_id: Optional[str] = None + """ + ID of the Project the resource belongs to. + """ + + global_: Optional[bool] = False + + zone: Optional[ScwZone] = None + + region: Optional[ScwRegion] = None + + vpc_private_network_info: Optional[VpcPrivateNetworkInfo] = None + + serverless_functions_function_info: Optional[ServerlessFunctionsFunctionInfo] = None + + serverless_containers_container_info: Optional[ + ServerlessContainersContainerInfo + ] = None + + baremetal_server_info: Optional[BrmServerInfo] = None + + serverless_sqldb_backup_info: Optional[ServerlessSqldbBackupInfo] = None + + +@dataclass +class SearchResourcesRequest: + query: str + """ + Search query. + """ + + organization_id: Optional[str] = None + """ + ID of the Organization to search in. + """ + + +@dataclass +class SearchResourcesResponse: + resources: list[Resource] + """ + Top resources found. + """