pub struct JiraAPIClient {
    pub url: Url,
    pub version: String,
    /* private fields */
}
Expand description

Reusable client for interfacing with Jira

Fields§

§url: Url§version: String

Implementations§

source§

impl JiraAPIClient

source

pub fn new(cfg: &JiraClientConfig) -> Result<JiraAPIClient, JiraClientError>

Instantiate a reusable API client.

use jira_issue_api::types::*;
use jira_issue_api::{Credential, JiraClientConfig, JiraAPIClient};

let anon = Credential::Anonymous;

// let credential = Credential::PersonalAccessToken("xxxxxxx".to_string())

// let api_token = Credential::ApiToken {
//     login: "user@example.com".to_string(),
//     token: "xxxxxxx".to_string(),
// };

let jira_cfg = JiraClientConfig {
    credential: anon,
    max_query_results: 50u32,
    url: "https://domain.atlassian.net".to_string(),
    timeout: 10u64,
    tls_accept_invalid_certs: false,
};

let client = JiraAPIClient::new(&jira_cfg).unwrap();
source

pub async fn query_issues( &self, query: &String ) -> Result<PostIssueQueryResponseBody, JiraClientError>

source

pub async fn post_worklog( &self, issue_key: &IssueKey, body: PostWorklogBody ) -> Result<Response, JiraClientError>

source

pub async fn post_comment( &self, issue_key: &IssueKey, body: PostCommentBody ) -> Result<Response, JiraClientError>

source

pub async fn get_transitions( &self, issue_key: &IssueKey, expand: bool ) -> Result<GetTransitionsBody, JiraClientError>

source

pub async fn post_transition( &self, issue_key: &IssueKey, transition: &PostTransitionBody ) -> Result<Response, JiraClientError>

source

pub async fn get_assignable_users( &self, params: &GetAssignableUserParams ) -> Result<Vec<User>, JiraClientError>

source

pub async fn post_assign_user( &self, issue_key: &IssueKey, user: &User ) -> Result<Response, JiraClientError>

source

pub async fn get_user(&self, user: String) -> Result<User, JiraClientError>

cloud: user.account_id server: user.name

Trait Implementations§

source§

impl Clone for JiraAPIClient

source§

fn clone(&self) -> JiraAPIClient

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for JiraAPIClient

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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> ToOwned for T
where T: Clone,

§

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

§

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

§

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

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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