Skip to main content

Crate tenant_resolver_sdk

Crate tenant_resolver_sdk 

Source
Expand description

Tenant Resolver SDK

This crate provides the public API for the tenant-resolver module:

§Usage

Consumers obtain the client from ClientHub:

use tenant_resolver_sdk::{
    TenantResolverClient, GetAncestorsOptions, GetDescendantsOptions,
    GetTenantsOptions, IsAncestorOptions,
};

// Get the client from ClientHub
let resolver = hub.get::<dyn TenantResolverClient>()?;

// Get tenant info
let tenant = resolver.get_tenant(&ctx, tenant_id).await?;

// Get multiple tenants
let tenants = resolver.get_tenants(&ctx, &[id1, id2], &GetTenantsOptions::default()).await?;

// Get ancestors
let response = resolver.get_ancestors(&ctx, tenant_id, &GetAncestorsOptions::default()).await?;

// Get descendants
let descendants = resolver.get_descendants(&ctx, tenant_id, &GetDescendantsOptions::default()).await?;

// Check ancestry
let is_anc = resolver.is_ancestor(&ctx, parent_id, child_id, &IsAncestorOptions::default()).await?;

Re-exports§

pub use api::TenantResolverClient;
pub use error::TenantResolverError;
pub use gts::TenantResolverPluginSpecV1;
pub use models::BarrierMode;
pub use models::GetAncestorsOptions;
pub use models::GetAncestorsResponse;
pub use models::GetDescendantsOptions;
pub use models::GetDescendantsResponse;
pub use models::GetTenantsOptions;
pub use models::HasStatus;
pub use models::IsAncestorOptions;
pub use models::TenantId;
pub use models::TenantInfo;
pub use models::TenantRef;
pub use models::TenantStatus;
pub use models::matches_status;
pub use plugin_api::TenantResolverPluginClient;

Modules§

api
Public API trait for the tenant resolver.
error
Error types for the tenant resolver module.
gts
GTS schema definitions for tenant resolver plugins.
models
Domain models for the tenant resolver module.
plugin_api
Plugin API trait for tenant resolver implementations.