// this provides the production configuration for talking to central through the openapi libraries.
this provides the production configuration for talking to central through the openapi libraries.
this provides the production configuration for talking to central through the openapi libraries .
pub fn central_client(token: String) -> Result<zerotier_central_api::Client, anyhow::Error> {
    let mut headers = HeaderMap::new();
    headers.insert(
        "Authorization",
        HeaderValue::from_str(&format!("bearer {}", token))?,
    );
    Ok(zerotier_central_api::Client::new_with_client(
        &std::env::var("ZEROTIER_CENTRAL_INSTANCE").unwrap_or(CENTRAL_BASEURL.to_string()),
        reqwest::Client::builder()
            .user_agent(version())
            .https_only(true)
            .default_headers(headers)
            .build()?,
    ))
}
pub fn central_client ( token : String ) -> Result < zerotier_central_api :: Client , anyhow :: Error > { let mut headers = HeaderMap :: new ( ) ; headers . insert ( " " , HeaderValue :: from_str ( & format ! ( " " token ) ) ? , ) ; Ok ( zerotier_central_api :: Client :: new_with_client ( & std :: env :: var ( " " ) . unwrap_or ( CENTRAL_BASEURL . to_string ( ) ) , reqwest :: Client :: builder ( ) . user_agent ( version ( ) ) . https_only ( true ) . default_headers ( headers ) . build ( ) ? , ) ) }
this provides the production configuration for talking to central through the openapi libraries.
this provides the production configuration for talking to central through the openapi libraries .
token
String