Skip to main content

TeamsService

Struct TeamsService 

Source
pub struct TeamsService<'a> { /* private fields */ }
Expand description

Operations on teams. Obtain via LinearClient::teams.

Implementations§

Source§

impl<'a> TeamsService<'a>

Source

pub async fn list(&self, req: ListTeamsRequest) -> Result<Page<Team>>

Fetches one page of teams.

§Example
use linear_api::workspace::ListTeamsRequest;

let client = linear_api::LinearClient::from_env()?;
let page = client
    .teams()
    .list(ListTeamsRequest::builder().first(50).build())
    .await?;
println!("has more: {}", page.page_info.has_next_page);
Source

pub fn list_stream( self, req: ListTeamsRequest, ) -> impl Stream<Item = Result<Team>> + 'a

Lazily streams every team matching the request across pages, starting from req.after when set (the cursor then advances page by page).

§Example
use futures::TryStreamExt;

let client = linear_api::LinearClient::from_env()?;
let teams: Vec<_> = client
    .teams()
    .list_stream(Default::default())
    .try_collect()
    .await?;
Source

pub async fn get(&self, id: &TeamId) -> Result<Team>

Fetches a single team by ID.

Linear also resolves a team key (e.g. "ENG") passed as the ID string.

§Example
let client = linear_api::LinearClient::from_env()?;
let team = client.teams().get(&linear_api::TeamId::new("ENG")).await?;
println!("{}", team.name);
Source

pub async fn states(&self, team: &TeamId) -> Result<Vec<WorkflowState>>

Fetches all workflow states of one team, sorted by board position ascending (leftmost column first).

This is how you resolve state names to stateIds before issue updates. The semantic key is WorkflowState::state_type (triage | backlog | unstarted | started | completed | canceled) rather than the display name — for example, an automation might refuse writes that would move issues into completed/canceled states.

Drains the WorkflowStateList query (capped at 100 states; teams have far fewer in practice).

§Example
let client = linear_api::LinearClient::from_env()?;
let team_id = linear_api::TeamId::new("88888888-8888-4888-8888-888888888888");
for state in client.teams().states(&team_id).await? {
    println!("{:>12} {:?}", state.name, state.state_type);
}

Trait Implementations§

Source§

impl<'a> Clone for TeamsService<'a>

Source§

fn clone(&self) -> TeamsService<'a>

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<'a> Copy for TeamsService<'a>

Source§

impl<'a> Debug for TeamsService<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for TeamsService<'a>

§

impl<'a> !UnwindSafe for TeamsService<'a>

§

impl<'a> Freeze for TeamsService<'a>

§

impl<'a> Send for TeamsService<'a>

§

impl<'a> Sync for TeamsService<'a>

§

impl<'a> Unpin for TeamsService<'a>

§

impl<'a> UnsafeUnpin for TeamsService<'a>

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: Sized + 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: Sized + 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> 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