nominal-api 0.1239.0

API bindings for the Nominal platform
Documentation
use conjure_http::endpoint;
/// This service provides information about workspaces. Workspaces provide access control boundaries. All resources in
/// Nominal live within a workspace.
#[conjure_http::conjure_endpoints(
    name = "WorkspaceService",
    use_legacy_error_serialization
)]
pub trait WorkspaceService {
    /// Gets all workspaces that the requesting user belongs to.
    #[endpoint(
        method = GET,
        path = "/workspaces/v1/workspaces",
        name = "getWorkspaces",
        produces = conjure_http::server::conjure::CollectionResponseSerializer
    )]
    fn get_workspaces(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
    ) -> Result<
        std::collections::BTreeSet<
            super::super::super::super::super::objects::security::api::workspace::Workspace,
        >,
        conjure_http::private::Error,
    >;
    /// Gets the workspace with the specified WorkspaceRid.
    #[endpoint(
        method = GET,
        path = "/workspaces/v1/workspaces/{workspaceRid}",
        name = "getWorkspace",
        produces = conjure_http::server::StdResponseSerializer
    )]
    fn get_workspace(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
        #[path(
            name = "workspaceRid",
            decoder = conjure_http::server::conjure::FromPlainDecoder,
            log_as = "workspaceRid",
            safe
        )]
        workspace_rid: super::super::super::super::super::objects::api::rids::WorkspaceRid,
    ) -> Result<
        super::super::super::super::super::objects::security::api::workspace::Workspace,
        conjure_http::private::Error,
    >;
    /// Updates the settings of the workspace with the specified WorkspaceRid.
    #[endpoint(
        method = PUT,
        path = "/workspaces/v1/workspaces/{rid}",
        name = "updateWorkspace",
        produces = conjure_http::server::StdResponseSerializer
    )]
    fn update_workspace(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
        #[path(
            name = "rid",
            decoder = conjure_http::server::conjure::FromPlainDecoder,
            safe
        )]
        rid: super::super::super::super::super::objects::api::rids::WorkspaceRid,
        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
        request: super::super::super::super::super::objects::security::api::workspace::UpdateWorkspaceRequest,
    ) -> Result<
        super::super::super::super::super::objects::security::api::workspace::Workspace,
        conjure_http::private::Error,
    >;
    /// Gets the default workspace for the requesting user. If the user belongs to a single workspace,
    /// that workspace is returned. Otherwise, if the user's organization has a default workspace and
    /// the user belongs to it, that will be returned.
    #[endpoint(
        method = GET,
        path = "/workspaces/v1/default-workspace",
        name = "getDefaultWorkspace",
        produces = conjure_http::server::conjure::CollectionResponseSerializer
    )]
    fn get_default_workspace(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
    ) -> Result<
        Option<
            super::super::super::super::super::objects::security::api::workspace::Workspace,
        >,
        conjure_http::private::Error,
    >;
}
/// This service provides information about workspaces. Workspaces provide access control boundaries. All resources in
/// Nominal live within a workspace.
#[conjure_http::conjure_endpoints(
    name = "WorkspaceService",
    use_legacy_error_serialization
)]
pub trait AsyncWorkspaceService {
    /// Gets all workspaces that the requesting user belongs to.
    #[endpoint(
        method = GET,
        path = "/workspaces/v1/workspaces",
        name = "getWorkspaces",
        produces = conjure_http::server::conjure::CollectionResponseSerializer
    )]
    async fn get_workspaces(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
    ) -> Result<
        std::collections::BTreeSet<
            super::super::super::super::super::objects::security::api::workspace::Workspace,
        >,
        conjure_http::private::Error,
    >;
    /// Gets the workspace with the specified WorkspaceRid.
    #[endpoint(
        method = GET,
        path = "/workspaces/v1/workspaces/{workspaceRid}",
        name = "getWorkspace",
        produces = conjure_http::server::StdResponseSerializer
    )]
    async fn get_workspace(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
        #[path(
            name = "workspaceRid",
            decoder = conjure_http::server::conjure::FromPlainDecoder,
            log_as = "workspaceRid",
            safe
        )]
        workspace_rid: super::super::super::super::super::objects::api::rids::WorkspaceRid,
    ) -> Result<
        super::super::super::super::super::objects::security::api::workspace::Workspace,
        conjure_http::private::Error,
    >;
    /// Updates the settings of the workspace with the specified WorkspaceRid.
    #[endpoint(
        method = PUT,
        path = "/workspaces/v1/workspaces/{rid}",
        name = "updateWorkspace",
        produces = conjure_http::server::StdResponseSerializer
    )]
    async fn update_workspace(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
        #[path(
            name = "rid",
            decoder = conjure_http::server::conjure::FromPlainDecoder,
            safe
        )]
        rid: super::super::super::super::super::objects::api::rids::WorkspaceRid,
        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
        request: super::super::super::super::super::objects::security::api::workspace::UpdateWorkspaceRequest,
    ) -> Result<
        super::super::super::super::super::objects::security::api::workspace::Workspace,
        conjure_http::private::Error,
    >;
    /// Gets the default workspace for the requesting user. If the user belongs to a single workspace,
    /// that workspace is returned. Otherwise, if the user's organization has a default workspace and
    /// the user belongs to it, that will be returned.
    #[endpoint(
        method = GET,
        path = "/workspaces/v1/default-workspace",
        name = "getDefaultWorkspace",
        produces = conjure_http::server::conjure::CollectionResponseSerializer
    )]
    async fn get_default_workspace(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
    ) -> Result<
        Option<
            super::super::super::super::super::objects::security::api::workspace::Workspace,
        >,
        conjure_http::private::Error,
    >;
}
/// This service provides information about workspaces. Workspaces provide access control boundaries. All resources in
/// Nominal live within a workspace.
#[conjure_http::conjure_endpoints(
    name = "WorkspaceService",
    use_legacy_error_serialization,
    local
)]
pub trait LocalAsyncWorkspaceService {
    /// Gets all workspaces that the requesting user belongs to.
    #[endpoint(
        method = GET,
        path = "/workspaces/v1/workspaces",
        name = "getWorkspaces",
        produces = conjure_http::server::conjure::CollectionResponseSerializer
    )]
    async fn get_workspaces(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
    ) -> Result<
        std::collections::BTreeSet<
            super::super::super::super::super::objects::security::api::workspace::Workspace,
        >,
        conjure_http::private::Error,
    >;
    /// Gets the workspace with the specified WorkspaceRid.
    #[endpoint(
        method = GET,
        path = "/workspaces/v1/workspaces/{workspaceRid}",
        name = "getWorkspace",
        produces = conjure_http::server::StdResponseSerializer
    )]
    async fn get_workspace(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
        #[path(
            name = "workspaceRid",
            decoder = conjure_http::server::conjure::FromPlainDecoder,
            log_as = "workspaceRid",
            safe
        )]
        workspace_rid: super::super::super::super::super::objects::api::rids::WorkspaceRid,
    ) -> Result<
        super::super::super::super::super::objects::security::api::workspace::Workspace,
        conjure_http::private::Error,
    >;
    /// Updates the settings of the workspace with the specified WorkspaceRid.
    #[endpoint(
        method = PUT,
        path = "/workspaces/v1/workspaces/{rid}",
        name = "updateWorkspace",
        produces = conjure_http::server::StdResponseSerializer
    )]
    async fn update_workspace(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
        #[path(
            name = "rid",
            decoder = conjure_http::server::conjure::FromPlainDecoder,
            safe
        )]
        rid: super::super::super::super::super::objects::api::rids::WorkspaceRid,
        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
        request: super::super::super::super::super::objects::security::api::workspace::UpdateWorkspaceRequest,
    ) -> Result<
        super::super::super::super::super::objects::security::api::workspace::Workspace,
        conjure_http::private::Error,
    >;
    /// Gets the default workspace for the requesting user. If the user belongs to a single workspace,
    /// that workspace is returned. Otherwise, if the user's organization has a default workspace and
    /// the user belongs to it, that will be returned.
    #[endpoint(
        method = GET,
        path = "/workspaces/v1/default-workspace",
        name = "getDefaultWorkspace",
        produces = conjure_http::server::conjure::CollectionResponseSerializer
    )]
    async fn get_default_workspace(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
    ) -> Result<
        Option<
            super::super::super::super::super::objects::security::api::workspace::Workspace,
        >,
        conjure_http::private::Error,
    >;
}