Client

Struct Client 

Source
pub struct Client { /* private fields */ }

Implementations§

Source§

impl Client

Source

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}
Source

pub async fn get<T: Requestable>(&self, params: &T) -> Result<Response, Error>

§Errors

Returns an error if anything goes wrong with the request.

Source

pub async fn delete<T: Requestable>( &self, params: &T, ) -> Result<Response, Error>

Send an HTTP DELETE request.

§Errors

Returns an error if anything goes wrong with the request.

Trait Implementations§

Source§

impl Debug for Client

Source§

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

Formats the value using the given formatter. Read more
Source§

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,

Workflow timeseries data Read more
Source§

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,

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,

Get a pipeline’s workflows.

Returns a paginated list of workflows by pipeline ID.

Source§

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,

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,

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,

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> 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> 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, 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
Source§

impl<T> ErasedDestructor for T
where T: 'static,