pub struct ProjectsClient { /* private fields */ }Expand description
Sub-client for project management. Obtained via AkribesClient::projects().
Does not require a project_id on the parent client.
Implementations§
Source§impl ProjectsClient
impl ProjectsClient
pub async fn list(&self) -> Result<Vec<Project>>
pub async fn get(&self, project_id: i64) -> Result<Option<Project>>
pub async fn create(&self, name: &str) -> Result<Project>
pub async fn update(&self, project_id: i64, name: &str) -> Result<Project>
Sourcepub async fn resolve(&self, id_or_name: &str) -> Result<Option<Project>>
pub async fn resolve(&self, id_or_name: &str) -> Result<Option<Project>>
Look up a project by numeric id (if id_or_name parses as i64) or
by exact name. Returns None when no project matches.
Numeric-looking inputs are treated as ids first; a caller that really
wants to look up a project named e.g. "42" must currently fetch
the full list and filter themselves.
pub async fn delete(&self, project_id: i64) -> Result<()>
Sourcepub async fn duplicate(&self, project_id: i64) -> Result<Project>
pub async fn duplicate(&self, project_id: i64) -> Result<Project>
Duplicate a project (including all scripts). Server picks the copy name. Requires a wildcard-scoped identity.
Sourcepub async fn reorder(&self, order: Vec<i64>) -> Result<()>
pub async fn reorder(&self, order: Vec<i64>) -> Result<()>
Set the global project ordering. order is the list of project IDs
in the desired order. Requires a wildcard-scoped identity.
Sourcepub async fn list_scripts(&self, project_id: i64) -> Result<Vec<Script>>
pub async fn list_scripts(&self, project_id: i64) -> Result<Vec<Script>>
List scripts in a specific project. Flat alternative to
client.project(id).scripts().list().
Sourcepub async fn move_script(
&self,
src_project_id: i64,
src_script_name: &str,
dest_project_id: i64,
) -> Result<Script>
pub async fn move_script( &self, src_project_id: i64, src_script_name: &str, dest_project_id: i64, ) -> Result<Script>
Move a script from src_project_id to dest_project_id. Flat
alternative to client.project(src).scripts().move_to(name, dest).
Sourcepub async fn rename_script(
&self,
project_id: i64,
current_name: &str,
new_name: &str,
) -> Result<()>
pub async fn rename_script( &self, project_id: i64, current_name: &str, new_name: &str, ) -> Result<()>
Rename a script in project_id. Flat alternative to
client.project(id).scripts().rename(current, new).
Sourcepub async fn delete_script(
&self,
project_id: i64,
script_name: &str,
) -> Result<()>
pub async fn delete_script( &self, project_id: i64, script_name: &str, ) -> Result<()>
Delete a script in project_id. Flat alternative to
client.project(id).scripts().delete(name).
Sourcepub async fn duplicate_script(
&self,
project_id: i64,
script_name: &str,
_new_name: Option<&str>,
) -> Result<Script>
pub async fn duplicate_script( &self, project_id: i64, script_name: &str, _new_name: Option<&str>, ) -> Result<Script>
Duplicate a script within project_id. The server picks the copy
name; new_name is accepted for parity with the TypeScript SDK and
will be honored once the server supports it. Flat alternative to
client.project(id).scripts().duplicate(name).
Sourcepub async fn list_channels(
&self,
project_id: i64,
script_name: &str,
) -> Result<Vec<ScriptChannel>>
pub async fn list_channels( &self, project_id: i64, script_name: &str, ) -> Result<Vec<ScriptChannel>>
List channels for script_name in project_id (#1141). Flat
cross-project alternative to
client.project(id).channels().list(name). Mirrors TS
projects.listChannels.
Sourcepub async fn reorder_scripts(
&self,
project_id: i64,
order: Vec<i64>,
) -> Result<()>
pub async fn reorder_scripts( &self, project_id: i64, order: Vec<i64>, ) -> Result<()>
Reorder scripts within project_id (#1141). order is the list of
script IDs in the desired order. Flat cross-project alternative to
client.project(id).scripts().reorder(order). Mirrors TS
projects.reorderScripts.
Trait Implementations§
Source§impl Clone for ProjectsClient
impl Clone for ProjectsClient
Source§fn clone(&self) -> ProjectsClient
fn clone(&self) -> ProjectsClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more