use std::collections::HashMap;
use async_trait::async_trait;
use uuid::Uuid;
use crate::error::TypesRegistryError;
use crate::models::{GtsInstance, GtsTypeSchema, InstanceQuery, RegisterResult, TypeSchemaQuery};
#[async_trait]
pub trait TypesRegistryClient: Send + Sync {
async fn register(
&self,
entities: Vec<serde_json::Value>,
) -> Result<Vec<RegisterResult>, TypesRegistryError>;
async fn register_type_schemas(
&self,
type_schemas: Vec<serde_json::Value>,
) -> Result<Vec<RegisterResult>, TypesRegistryError>;
async fn get_type_schema(&self, type_id: &str) -> Result<GtsTypeSchema, TypesRegistryError>;
async fn get_type_schema_by_uuid(
&self,
type_uuid: Uuid,
) -> Result<GtsTypeSchema, TypesRegistryError>;
async fn get_type_schemas(
&self,
type_ids: Vec<String>,
) -> HashMap<String, Result<GtsTypeSchema, TypesRegistryError>>;
async fn get_type_schemas_by_uuid(
&self,
type_uuids: Vec<Uuid>,
) -> HashMap<Uuid, Result<GtsTypeSchema, TypesRegistryError>>;
async fn list_type_schemas(
&self,
query: TypeSchemaQuery,
) -> Result<Vec<GtsTypeSchema>, TypesRegistryError>;
async fn register_instances(
&self,
instances: Vec<serde_json::Value>,
) -> Result<Vec<RegisterResult>, TypesRegistryError>;
async fn get_instance(&self, id: &str) -> Result<GtsInstance, TypesRegistryError>;
async fn get_instance_by_uuid(&self, uuid: Uuid) -> Result<GtsInstance, TypesRegistryError>;
async fn get_instances(
&self,
ids: Vec<String>,
) -> HashMap<String, Result<GtsInstance, TypesRegistryError>>;
async fn get_instances_by_uuid(
&self,
uuids: Vec<Uuid>,
) -> HashMap<Uuid, Result<GtsInstance, TypesRegistryError>>;
async fn list_instances(
&self,
query: InstanceQuery,
) -> Result<Vec<GtsInstance>, TypesRegistryError>;
}