pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
Sourcepub fn new(api_token: &ApiToken) -> Result<Self, Error>
pub fn new(api_token: &ApiToken) -> Result<Self, Error>
§Errors
Returns an error if the api token is not a valid header or there’s an issue constructing the client.
Examples found in repository?
examples/list-projects.rs (line 9)
8async fn main() -> Result<()> {
9 let client = Client::new(&ApiToken::from_env()?)?;
10 //eprintln!("{:?}", &client);
11
12 let res = client
13 .list_pipelines(PipelineListRequest {
14 org_slug: "gh/remind101".into(),
15 ..Default::default()
16 })
17 .await
18 .context("error listing pipelines")?;
19 //eprintln!("{:?}", &res);
20
21 for pipeline in res.items {
22 println!("{}", pipeline.project_slug);
23 let res = client
24 .list_workflows_by_pipeline_id(WorkflowListRequest {
25 pipeline_id: pipeline.id,
26 ..Default::default()
27 })
28 .await
29 .context("error getting workflows for pipeline")?;
30 //eprintln!("{:?}", &res);
31
32 for workflow in res.items {
33 println!("{}", workflow.name);
34
35 let res =
36 client.get_workflow_timeseries(WorkflowTimeseriesRequest {
37 project_slug: workflow.project_slug,
38 branch: Some("master".into()),
39 ..Default::default()
40 });
41 //eprintln!("{:?}", &res);
42 }
43 }
44
45 Ok(())
46}Trait Implementations§
Source§impl Insights for Client
impl Insights for Client
Source§fn get_workflow_timeseries<'life0, 'async_trait, T>(
&'life0 self,
params: T,
) -> Pin<Box<dyn Future<Output = Result<WorkflowTimeseriesResponse, Error>> + Send + 'async_trait>>where
T: 'async_trait + Borrow<WorkflowTimeseriesRequest> + Send + Sync,
Self: 'async_trait,
'life0: 'async_trait,
fn get_workflow_timeseries<'life0, 'async_trait, T>(
&'life0 self,
params: T,
) -> Pin<Box<dyn Future<Output = Result<WorkflowTimeseriesResponse, Error>> + Send + 'async_trait>>where
T: 'async_trait + Borrow<WorkflowTimeseriesRequest> + Send + Sync,
Self: 'async_trait,
'life0: 'async_trait,
Workflow timeseries data Read more
Source§impl Pipeline for Client
impl Pipeline for Client
Source§fn list_pipelines<'life0, 'async_trait>(
&'life0 self,
params: PipelineListRequest,
) -> Pin<Box<dyn Future<Output = Result<PipelineListResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_pipelines<'life0, 'async_trait>(
&'life0 self,
params: PipelineListRequest,
) -> Pin<Box<dyn Future<Output = Result<PipelineListResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a list of pipelines.
Returns all pipelines for the most recently built projects (max 250) you follow in an organization.
Source§fn list_workflows_by_pipeline_id<'life0, 'async_trait>(
&'life0 self,
params: WorkflowListRequest,
) -> Pin<Box<dyn Future<Output = Result<WorkflowListResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_workflows_by_pipeline_id<'life0, 'async_trait>(
&'life0 self,
params: WorkflowListRequest,
) -> Pin<Box<dyn Future<Output = Result<WorkflowListResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a pipeline’s workflows.
Returns a paginated list of workflows by pipeline ID.
Source§impl Project for Client
impl Project for Client
Source§fn get_project<'life0, 'async_trait>(
&'life0 self,
params: ProjectGetRequest,
) -> Pin<Box<dyn Future<Output = Result<ProjectGetResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_project<'life0, 'async_trait>(
&'life0 self,
params: ProjectGetRequest,
) -> Pin<Box<dyn Future<Output = Result<ProjectGetResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get information about a project. Read more
Source§fn list_envvars<'life0, 'async_trait>(
&'life0 self,
params: ProjectListEnvvarsRequest,
) -> Pin<Box<dyn Future<Output = Result<ProjectListEnvvarsResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_envvars<'life0, 'async_trait>(
&'life0 self,
params: ProjectListEnvvarsRequest,
) -> Pin<Box<dyn Future<Output = Result<ProjectListEnvvarsResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List env vars for for a project. Read more
Source§fn delete_envvar<'life0, 'async_trait>(
&'life0 self,
params: ProjectDeleteEnvvarRequest,
) -> Pin<Box<dyn Future<Output = Result<ProjectDeleteEnvvarResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_envvar<'life0, 'async_trait>(
&'life0 self,
params: ProjectDeleteEnvvarRequest,
) -> Pin<Box<dyn Future<Output = Result<ProjectDeleteEnvvarResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete an env var from a repo. Read more
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more