pub trait AsyncTemplateService {
// Required methods
fn create(
&self,
auth_: BearerToken,
request: CreateTemplateRequest,
) -> impl Future<Output = Result<Template, Error>> + Send;
fn get(
&self,
auth_: BearerToken,
template_rid: TemplateRid,
branch: Option<BranchName>,
commit: Option<CommitId>,
) -> impl Future<Output = Result<Template, Error>> + Send;
fn batch_get_metadata(
&self,
auth_: BearerToken,
rids: BTreeSet<TemplateRid>,
) -> impl Future<Output = Result<BTreeSet<TemplateSummary>, Error>> + Send;
fn save_working_state(
&self,
auth_: BearerToken,
template_rid: TemplateRid,
branch: Option<BranchName>,
request: SaveTemplateRequest,
) -> impl Future<Output = Result<Template, Error>> + Send;
fn get_used_ref_names(
&self,
auth_: BearerToken,
template_rid: TemplateRid,
branch: Option<BranchName>,
commit: Option<CommitId>,
) -> impl Future<Output = Result<BTreeSet<DataSourceRefName>, Error>> + Send;
fn update_ref_names(
&self,
auth_: BearerToken,
template_rid: TemplateRid,
branch: Option<BranchName>,
request: UpdateRefNameRequest,
) -> impl Future<Output = Result<Template, Error>> + Send;
fn commit(
&self,
auth_: BearerToken,
template_rid: TemplateRid,
branch: Option<BranchName>,
request: CommitTemplateRequest,
) -> impl Future<Output = Result<Template, Error>> + Send;
fn update_metadata(
&self,
auth_: BearerToken,
template_rid: TemplateRid,
request: UpdateMetadataRequest,
) -> impl Future<Output = Result<TemplateMetadata, Error>> + Send;
fn search_templates(
&self,
auth_: BearerToken,
request: SearchTemplatesRequest,
) -> impl Future<Output = Result<SearchTemplatesResponse, Error>> + Send;
fn get_all_labels_and_properties(
&self,
auth_: BearerToken,
workspaces: BTreeSet<WorkspaceRid>,
) -> impl Future<Output = Result<GetAllLabelsAndPropertiesResponse, Error>> + Send;
fn merge_to_main(
&self,
auth_: BearerToken,
template_rid: TemplateRid,
request: MergeToMainRequest,
) -> impl Future<Output = Result<Template, Error>> + Send;
}
Expand description
TemplateService manages templates, which are workbooks that can be re-used across runs. Templates are versioned.
Required Methods§
Sourcefn create(
&self,
auth_: BearerToken,
request: CreateTemplateRequest,
) -> impl Future<Output = Result<Template, Error>> + Send
fn create( &self, auth_: BearerToken, request: CreateTemplateRequest, ) -> impl Future<Output = Result<Template, Error>> + Send
Creates a new template.
Sourcefn get(
&self,
auth_: BearerToken,
template_rid: TemplateRid,
branch: Option<BranchName>,
commit: Option<CommitId>,
) -> impl Future<Output = Result<Template, Error>> + Send
fn get( &self, auth_: BearerToken, template_rid: TemplateRid, branch: Option<BranchName>, commit: Option<CommitId>, ) -> impl Future<Output = Result<Template, Error>> + Send
Must only pass one of (branch, commit). If neither are passed, the latest commit on the “main” branch is returned. Throws if the template, branch, or commit doesn’t exist.
fn batch_get_metadata( &self, auth_: BearerToken, rids: BTreeSet<TemplateRid>, ) -> impl Future<Output = Result<BTreeSet<TemplateSummary>, Error>> + Send
Sourcefn save_working_state(
&self,
auth_: BearerToken,
template_rid: TemplateRid,
branch: Option<BranchName>,
request: SaveTemplateRequest,
) -> impl Future<Output = Result<Template, Error>> + Send
fn save_working_state( &self, auth_: BearerToken, template_rid: TemplateRid, branch: Option<BranchName>, request: SaveTemplateRequest, ) -> impl Future<Output = Result<Template, Error>> + Send
Creates a commit that may be compacted, e.g cleaned up and not exist anymore. Throws if the template or branch doesn’t exist. Throws if the latest commit doesn’t match the provided id. Throws if you save to an archived template.
Sourcefn get_used_ref_names(
&self,
auth_: BearerToken,
template_rid: TemplateRid,
branch: Option<BranchName>,
commit: Option<CommitId>,
) -> impl Future<Output = Result<BTreeSet<DataSourceRefName>, Error>> + Send
fn get_used_ref_names( &self, auth_: BearerToken, template_rid: TemplateRid, branch: Option<BranchName>, commit: Option<CommitId>, ) -> impl Future<Output = Result<BTreeSet<DataSourceRefName>, Error>> + Send
Returns the set of all ref names used by the template.
Sourcefn update_ref_names(
&self,
auth_: BearerToken,
template_rid: TemplateRid,
branch: Option<BranchName>,
request: UpdateRefNameRequest,
) -> impl Future<Output = Result<Template, Error>> + Send
fn update_ref_names( &self, auth_: BearerToken, template_rid: TemplateRid, branch: Option<BranchName>, request: UpdateRefNameRequest, ) -> impl Future<Output = Result<Template, Error>> + Send
Updates the data source ref names for all variables used in the template.
Sourcefn commit(
&self,
auth_: BearerToken,
template_rid: TemplateRid,
branch: Option<BranchName>,
request: CommitTemplateRequest,
) -> impl Future<Output = Result<Template, Error>> + Send
fn commit( &self, auth_: BearerToken, template_rid: TemplateRid, branch: Option<BranchName>, request: CommitTemplateRequest, ) -> impl Future<Output = Result<Template, Error>> + Send
Creates a commit with a commit message. Throws if the template or branch doesn’t exist. Throws if the latest commit doesn’t match the provided id. Throws if you commit to an archived template.
Sourcefn update_metadata(
&self,
auth_: BearerToken,
template_rid: TemplateRid,
request: UpdateMetadataRequest,
) -> impl Future<Output = Result<TemplateMetadata, Error>> + Send
fn update_metadata( &self, auth_: BearerToken, template_rid: TemplateRid, request: UpdateMetadataRequest, ) -> impl Future<Output = Result<TemplateMetadata, Error>> + Send
Throws if the template doesn’t exist.
fn search_templates( &self, auth_: BearerToken, request: SearchTemplatesRequest, ) -> impl Future<Output = Result<SearchTemplatesResponse, Error>> + Send
fn get_all_labels_and_properties( &self, auth_: BearerToken, workspaces: BTreeSet<WorkspaceRid>, ) -> impl Future<Output = Result<GetAllLabelsAndPropertiesResponse, Error>> + Send
Sourcefn merge_to_main(
&self,
auth_: BearerToken,
template_rid: TemplateRid,
request: MergeToMainRequest,
) -> impl Future<Output = Result<Template, Error>> + Send
fn merge_to_main( &self, auth_: BearerToken, template_rid: TemplateRid, request: MergeToMainRequest, ) -> impl Future<Output = Result<Template, Error>> + Send
Merges the given branch to the “main” branch. Throws if the template or branch doesn’t exist. Throws if the latest commit doesn’t match the provided id. Throws if you merge on an archived template.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.