async fn obtain_token(ad: AuthData) -> anyhow::Result<String> {
    let mut conf = openapi::client::ClientConfiguration::new();
    conf.set_base_url(&ad.endpoint);
    match ad.auth {
        auth_data::AuthKind::ByToken(tok) => Ok(tok.token),
        auth_data::AuthKind::ByLoginAndPassword(lp) => {
            let client = RawClient::new(conf);
            let auth = models::SimpleAuthParams::login()
                .login(lp.login)
                .password(lp.password)
                .send(&client)
                .await?
                .object;
            Ok(auth.data)
        }
    }
}
/// auth-data does not necessarily contain token. For example, user can specify
/// login and password instead. This function is responsible for converting
/// any possible AuthKind to token.
auth-data does not necessarily contain token. For example, user can specify
login and password instead. This function is responsible for converting
any possible AuthKind to token.
auth - data does not necessarily contain token . For example user can specify login and password instead . This function is responsible for converting any possible AuthKind to token .
async fn obtain_token(ad: AuthData) -> anyhow::Result<String> {
    let mut conf = openapi::client::ClientConfiguration::new();
    conf.set_base_url(&ad.endpoint);
    match ad.auth {
        auth_data::AuthKind::ByToken(tok) => Ok(tok.token),
        auth_data::AuthKind::ByLoginAndPassword(lp) => {
            let client = RawClient::new(conf);
            let auth = models::SimpleAuthParams::login()
                .login(lp.login)
                .password(lp.password)
                .send(&client)
                .await?
                .object;
            Ok(auth.data)
        }
    }
}
async fn obtain_token ( ad : AuthData ) -> anyhow :: Result < String > { let mut conf = openapi :: client :: ClientConfiguration :: new ( ) ; conf . set_base_url ( & ad . endpoint ) ; match ad . auth { auth_data :: AuthKind :: ByToken ( tok ) => Ok ( tok . token ) , auth_data :: AuthKind :: ByLoginAndPassword ( lp ) => { let client = RawClient :: new ( conf ) ; let auth = models :: SimpleAuthParams :: login ( ) . login ( lp . login ) . password ( lp . password ) . send ( & client ) . await ? . object ; Ok ( auth . data ) } } }
auth-data does not necessarily contain token.
auth - data does not necessarily contain token .
ad
AuthData