pub async fn from_auth_data(ad: AuthData) -> anyhow::Result<ApiClient> {
    let mut configuration = openapi::client::ClientConfiguration::new();

    configuration.set_base_url(&ad.endpoint);

    let token = obtain_token(ad).await.context("failed to obtain token")?;

    let api_key = openapi::client::ApiKey {
        header_name: "Authorization".to_string(),
        key: format!("Bearer {}", &token),
    };
    configuration.set_api_key(api_key);

    let inner = Arc::new(RawClient::new(configuration));
    Ok(ApiClient { inner })
}
/// Establishes connection to JJS API using given AuthData
Establishes connection to JJS API using given AuthData
Establishes connection to JJS API using given AuthData
pub async fn from_auth_data(ad: AuthData) -> anyhow::Result<ApiClient> {
    let mut configuration = openapi::client::ClientConfiguration::new();
    configuration.set_base_url(&ad.endpoint);
    let token = obtain_token(ad).await.context("failed to obtain token")?;
    let api_key = openapi::client::ApiKey {
        header_name: "Authorization".to_string(),
        key: format!("Bearer {}", &token),
    };
    configuration.set_api_key(api_key);
    let inner = Arc::new(RawClient::new(configuration));
    Ok(ApiClient { inner })
}
pub async fn from_auth_data ( ad : AuthData ) -> anyhow :: Result < ApiClient > { let mut configuration = openapi :: client :: ClientConfiguration :: new ( ) ; configuration . set_base_url ( & ad . endpoint ) ; let token = obtain_token ( ad ) . await . context ( " " ) ? ; let api_key = openapi :: client :: ApiKey { header_name : " " . to_string ( ) , key : format ! ( " " token ) , } ; configuration . set_api_key ( api_key ) ; let inner = Arc :: new ( RawClient :: new ( configuration ) ) ; Ok ( ApiClient { inner } ) }
Establishes connection to JJS API using given AuthData
Establishes connection to JJS API using given AuthData
ad
AuthData