use unkey::models::{Refill, RefillInterval, UpdateKeyRequest};
use unkey::Client;
async fn update_key() {
let c = Client::new("unkey_ABC");
let req = UpdateKeyRequest::new("key_XYZ")
.set_name(Some("new_name")) // Update the keys name
.set_ratelimit(None) // Remove any ratelimit on the key
.set_expires(None) // Remove any expiration date
.set_refill(Some(Refill::new(100, RefillInterval::Daily)));
match c.update_key(req).await {
Ok(_) => println!("Success"), // Nothing on success
Err(err) => eprintln!("{err:?}"),
}
}