nominal-api 0.1241.0

API bindings for the Nominal platform
Documentation
use conjure_http::endpoint;
/// These endpoints are not intended to be used directly by clients, since
/// they require saving resource-specific state associated with new commits.
#[conjure_http::conjure_client(name = "InternalVersioningService")]
pub trait InternalVersioningService<
    #[response_body]
    I: Iterator<
            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
        >,
> {
    /// Creates a root commit (no parents) and a "main" branch
    /// pointing to that commit, for the given resource.
    /// Throws if the resource already has a commit graph.
    #[endpoint(
        method = POST,
        path = "/internal/scout/v1/versioning/{resourceRid}",
        name = "initResourceVersioning",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    fn init_resource_versioning(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(
            name = "resourceRid",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        resource_rid: &conjure_object::ResourceIdentifier,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::objects::scout::versioning::api::InitResourceVersioningRequest,
    ) -> Result<
        super::super::super::objects::scout::versioning::api::BranchAndCommit,
        conjure_http::private::Error,
    >;
    /// Creates a non-permanent commit on the given branch,
    /// Throws if the branch doesn't exist.
    /// Throws if latestCommit is passed and is not the latest commit.
    #[endpoint(
        method = POST,
        path = "/internal/scout/v1/versioning/{resourceRid}/branch/{branchName}/working-state",
        name = "saveWorkingState",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    fn save_working_state(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(
            name = "resourceRid",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        resource_rid: &conjure_object::ResourceIdentifier,
        #[path(
            name = "branchName",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        branch_name: &super::super::super::objects::scout::versioning::api::BranchName,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::objects::scout::versioning::api::SaveWorkingStateRequest,
    ) -> Result<
        super::super::super::objects::scout::versioning::api::BranchAndCommit,
        conjure_http::private::Error,
    >;
    /// Creates a new permanent commit on the given branch.
    /// Throws if the branch doesn't exist.
    /// Throws if latestCommit is passed and is not the latest commit.
    #[endpoint(
        method = POST,
        path = "/internal/scout/v1/versioning/{resourceRid}/branch/{branchName}/commit",
        name = "commit",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    fn commit(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(
            name = "resourceRid",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        resource_rid: &conjure_object::ResourceIdentifier,
        #[path(
            name = "branchName",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        branch_name: &super::super::super::objects::scout::versioning::api::BranchName,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::objects::scout::versioning::api::CommitRequest,
    ) -> Result<
        super::super::super::objects::scout::versioning::api::BranchAndCommit,
        conjure_http::private::Error,
    >;
    /// Compacts the commit graph for the resource by deleting
    /// working state commits that match the provided strategy.
    /// Persists commits that are pointed to by branches.
    /// Returns the set of commits that were compacted.
    /// Throws if the resource doesn't exist.
    #[endpoint(
        method = POST,
        path = "/internal/scout/v1/versioning/{resourceRid}/compact-commits",
        name = "compactCommits",
        accept = conjure_http::client::conjure::CollectionResponseDeserializer
    )]
    fn compact_commits(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(
            name = "resourceRid",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        resource_rid: &conjure_object::ResourceIdentifier,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::objects::scout::versioning::api::CompactCommitsRequest,
    ) -> Result<
        std::collections::BTreeSet<
            super::super::super::objects::scout::versioning::api::CommitId,
        >,
        conjure_http::private::Error,
    >;
}
/// These endpoints are not intended to be used directly by clients, since
/// they require saving resource-specific state associated with new commits.
#[conjure_http::conjure_client(name = "InternalVersioningService")]
pub trait AsyncInternalVersioningService<
    #[response_body]
    I: conjure_http::private::Stream<
            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
        >,
> {
    /// Creates a root commit (no parents) and a "main" branch
    /// pointing to that commit, for the given resource.
    /// Throws if the resource already has a commit graph.
    #[endpoint(
        method = POST,
        path = "/internal/scout/v1/versioning/{resourceRid}",
        name = "initResourceVersioning",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    async fn init_resource_versioning(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(
            name = "resourceRid",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        resource_rid: &conjure_object::ResourceIdentifier,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::objects::scout::versioning::api::InitResourceVersioningRequest,
    ) -> Result<
        super::super::super::objects::scout::versioning::api::BranchAndCommit,
        conjure_http::private::Error,
    >;
    /// Creates a non-permanent commit on the given branch,
    /// Throws if the branch doesn't exist.
    /// Throws if latestCommit is passed and is not the latest commit.
    #[endpoint(
        method = POST,
        path = "/internal/scout/v1/versioning/{resourceRid}/branch/{branchName}/working-state",
        name = "saveWorkingState",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    async fn save_working_state(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(
            name = "resourceRid",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        resource_rid: &conjure_object::ResourceIdentifier,
        #[path(
            name = "branchName",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        branch_name: &super::super::super::objects::scout::versioning::api::BranchName,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::objects::scout::versioning::api::SaveWorkingStateRequest,
    ) -> Result<
        super::super::super::objects::scout::versioning::api::BranchAndCommit,
        conjure_http::private::Error,
    >;
    /// Creates a new permanent commit on the given branch.
    /// Throws if the branch doesn't exist.
    /// Throws if latestCommit is passed and is not the latest commit.
    #[endpoint(
        method = POST,
        path = "/internal/scout/v1/versioning/{resourceRid}/branch/{branchName}/commit",
        name = "commit",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    async fn commit(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(
            name = "resourceRid",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        resource_rid: &conjure_object::ResourceIdentifier,
        #[path(
            name = "branchName",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        branch_name: &super::super::super::objects::scout::versioning::api::BranchName,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::objects::scout::versioning::api::CommitRequest,
    ) -> Result<
        super::super::super::objects::scout::versioning::api::BranchAndCommit,
        conjure_http::private::Error,
    >;
    /// Compacts the commit graph for the resource by deleting
    /// working state commits that match the provided strategy.
    /// Persists commits that are pointed to by branches.
    /// Returns the set of commits that were compacted.
    /// Throws if the resource doesn't exist.
    #[endpoint(
        method = POST,
        path = "/internal/scout/v1/versioning/{resourceRid}/compact-commits",
        name = "compactCommits",
        accept = conjure_http::client::conjure::CollectionResponseDeserializer
    )]
    async fn compact_commits(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(
            name = "resourceRid",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        resource_rid: &conjure_object::ResourceIdentifier,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::objects::scout::versioning::api::CompactCommitsRequest,
    ) -> Result<
        std::collections::BTreeSet<
            super::super::super::objects::scout::versioning::api::CommitId,
        >,
        conjure_http::private::Error,
    >;
}
/// These endpoints are not intended to be used directly by clients, since
/// they require saving resource-specific state associated with new commits.
#[conjure_http::conjure_client(name = "InternalVersioningService", local)]
pub trait LocalAsyncInternalVersioningService<
    #[response_body]
    I: conjure_http::private::Stream<
            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
        >,
> {
    /// Creates a root commit (no parents) and a "main" branch
    /// pointing to that commit, for the given resource.
    /// Throws if the resource already has a commit graph.
    #[endpoint(
        method = POST,
        path = "/internal/scout/v1/versioning/{resourceRid}",
        name = "initResourceVersioning",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    async fn init_resource_versioning(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(
            name = "resourceRid",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        resource_rid: &conjure_object::ResourceIdentifier,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::objects::scout::versioning::api::InitResourceVersioningRequest,
    ) -> Result<
        super::super::super::objects::scout::versioning::api::BranchAndCommit,
        conjure_http::private::Error,
    >;
    /// Creates a non-permanent commit on the given branch,
    /// Throws if the branch doesn't exist.
    /// Throws if latestCommit is passed and is not the latest commit.
    #[endpoint(
        method = POST,
        path = "/internal/scout/v1/versioning/{resourceRid}/branch/{branchName}/working-state",
        name = "saveWorkingState",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    async fn save_working_state(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(
            name = "resourceRid",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        resource_rid: &conjure_object::ResourceIdentifier,
        #[path(
            name = "branchName",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        branch_name: &super::super::super::objects::scout::versioning::api::BranchName,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::objects::scout::versioning::api::SaveWorkingStateRequest,
    ) -> Result<
        super::super::super::objects::scout::versioning::api::BranchAndCommit,
        conjure_http::private::Error,
    >;
    /// Creates a new permanent commit on the given branch.
    /// Throws if the branch doesn't exist.
    /// Throws if latestCommit is passed and is not the latest commit.
    #[endpoint(
        method = POST,
        path = "/internal/scout/v1/versioning/{resourceRid}/branch/{branchName}/commit",
        name = "commit",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    async fn commit(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(
            name = "resourceRid",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        resource_rid: &conjure_object::ResourceIdentifier,
        #[path(
            name = "branchName",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        branch_name: &super::super::super::objects::scout::versioning::api::BranchName,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::objects::scout::versioning::api::CommitRequest,
    ) -> Result<
        super::super::super::objects::scout::versioning::api::BranchAndCommit,
        conjure_http::private::Error,
    >;
    /// Compacts the commit graph for the resource by deleting
    /// working state commits that match the provided strategy.
    /// Persists commits that are pointed to by branches.
    /// Returns the set of commits that were compacted.
    /// Throws if the resource doesn't exist.
    #[endpoint(
        method = POST,
        path = "/internal/scout/v1/versioning/{resourceRid}/compact-commits",
        name = "compactCommits",
        accept = conjure_http::client::conjure::CollectionResponseDeserializer
    )]
    async fn compact_commits(
        &self,
        #[auth]
        auth_: &conjure_object::BearerToken,
        #[path(
            name = "resourceRid",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        resource_rid: &conjure_object::ResourceIdentifier,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::objects::scout::versioning::api::CompactCommitsRequest,
    ) -> Result<
        std::collections::BTreeSet<
            super::super::super::objects::scout::versioning::api::CommitId,
        >,
        conjure_http::private::Error,
    >;
}