pub struct TeamsService<'a> { /* private fields */ }Expand description
Operations on teams. Obtain via LinearClient::teams.
Implementations§
Source§impl<'a> TeamsService<'a>
impl<'a> TeamsService<'a>
Sourcepub async fn list(&self, req: ListTeamsRequest) -> Result<Page<Team>>
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);Sourcepub fn list_stream(
self,
req: ListTeamsRequest,
) -> impl Stream<Item = Result<Team>> + 'a
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?;Sourcepub async fn get(&self, id: &TeamId) -> Result<Team>
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);Sourcepub async fn states(&self, team: &TeamId) -> Result<Vec<WorkflowState>>
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>
impl<'a> Clone for TeamsService<'a>
Source§fn clone(&self) -> TeamsService<'a>
fn clone(&self) -> TeamsService<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more