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_client(name = "WorkspaceService")]
pub trait WorkspaceService<
    #[response_body]
    I: Iterator<
            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
        >,
> {
    /// Gets all workspaces that the requesting user belongs to.
    #[endpoint(
        method = GET,
        path = "/workspaces/v1/workspaces",
        name = "getWorkspaces",
        accept = conjure_http::client::conjure::CollectionResponseDeserializer
    )]
    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",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    fn get_workspace(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(
            name = "workspaceRid",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        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",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    fn update_workspace(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(name = "rid", encoder = conjure_http::client::conjure::PlainEncoder)]
        rid: &super::super::super::super::super::objects::api::rids::WorkspaceRid,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        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",
        accept = conjure_http::client::conjure::CollectionResponseDeserializer
    )]
    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_client(name = "WorkspaceService")]
pub trait AsyncWorkspaceService<
    #[response_body]
    I: conjure_http::private::Stream<
            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
        >,
> {
    /// Gets all workspaces that the requesting user belongs to.
    #[endpoint(
        method = GET,
        path = "/workspaces/v1/workspaces",
        name = "getWorkspaces",
        accept = conjure_http::client::conjure::CollectionResponseDeserializer
    )]
    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",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    async fn get_workspace(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(
            name = "workspaceRid",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        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",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    async fn update_workspace(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(name = "rid", encoder = conjure_http::client::conjure::PlainEncoder)]
        rid: &super::super::super::super::super::objects::api::rids::WorkspaceRid,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        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",
        accept = conjure_http::client::conjure::CollectionResponseDeserializer
    )]
    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_client(name = "WorkspaceService", local)]
pub trait LocalAsyncWorkspaceService<
    #[response_body]
    I: conjure_http::private::Stream<
            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
        >,
> {
    /// Gets all workspaces that the requesting user belongs to.
    #[endpoint(
        method = GET,
        path = "/workspaces/v1/workspaces",
        name = "getWorkspaces",
        accept = conjure_http::client::conjure::CollectionResponseDeserializer
    )]
    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",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    async fn get_workspace(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(
            name = "workspaceRid",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        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",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    async fn update_workspace(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(name = "rid", encoder = conjure_http::client::conjure::PlainEncoder)]
        rid: &super::super::super::super::super::objects::api::rids::WorkspaceRid,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        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",
        accept = conjure_http::client::conjure::CollectionResponseDeserializer
    )]
    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,
    >;
}