Skip to main content

ProjectsClient

Struct ProjectsClient 

Source
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

Source

pub async fn list(&self) -> Result<Vec<Project>>

Source

pub async fn get(&self, project_id: i64) -> Result<Option<Project>>

Source

pub async fn create(&self, name: &str) -> Result<Project>

Source

pub async fn update(&self, project_id: i64, name: &str) -> Result<Project>

Source

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.

Source

pub async fn delete(&self, project_id: i64) -> Result<()>

Source

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.

Source

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.

Source

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().

Source

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).

Source

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).

Source

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).

Source

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).

Source

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.

Source

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

Source§

fn clone(&self) -> ProjectsClient

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProjectsClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more