pub struct CreateApiKeyRequest {
pub expires_at: Option<DateTime<Utc>>,
pub name: String,
pub rate_limit_override: Option<i32>,
pub scopes: Vec<ApiKeyScope>,
}Expand description
Request body for creating an API key.
JSON schema
{
"description": "Request body for creating an API key.",
"type": "object",
"required": [
"name",
"scopes"
],
"properties": {
"expires_at": {
"description": "Optional expiration date (ISO 8601).",
"type": [
"string",
"null"
],
"format": "date-time"
},
"name": {
"description": "Human-readable name for this key.",
"type": "string"
},
"rate_limit_override": {
"description": "Optional per-key rate limit override (requests per minute).\nWhen set, the server uses this value instead of the global rate\nlimit for requests authenticated with this key.",
"type": [
"integer",
"null"
],
"format": "int32",
"minimum": 0.0
},
"scopes": {
"description": "Scopes to grant.",
"type": "array",
"items": {
"$ref": "#/components/schemas/ApiKeyScope"
}
}
}
}
```ignore
</details>Fields§
§expires_at: Option<DateTime<Utc>>Optional expiration date (ISO 8601).
name: StringHuman-readable name for this key.
rate_limit_override: Option<i32>Optional per-key rate limit override (requests per minute). When set, the server uses this value instead of the global rate limit for requests authenticated with this key.
scopes: Vec<ApiKeyScope>Scopes to grant.
Implementations§
Source§impl CreateApiKeyRequest
impl CreateApiKeyRequest
pub fn builder() -> CreateApiKeyRequest
Trait Implementations§
Source§impl Clone for CreateApiKeyRequest
impl Clone for CreateApiKeyRequest
Source§impl Debug for CreateApiKeyRequest
impl Debug for CreateApiKeyRequest
Source§impl<'de> Deserialize<'de> for CreateApiKeyRequest
impl<'de> Deserialize<'de> for CreateApiKeyRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<CreateApiKeyRequest> for CreateApiKeyRequest
impl From<CreateApiKeyRequest> for CreateApiKeyRequest
Source§fn from(value: CreateApiKeyRequest) -> Self
fn from(value: CreateApiKeyRequest) -> Self
Converts to this type from the input type.
Source§impl Serialize for CreateApiKeyRequest
impl Serialize for CreateApiKeyRequest
Source§impl TryFrom<CreateApiKeyRequest> for CreateApiKeyRequest
impl TryFrom<CreateApiKeyRequest> for CreateApiKeyRequest
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: CreateApiKeyRequest) -> Result<Self, ConversionError>
fn try_from(value: CreateApiKeyRequest) -> Result<Self, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for CreateApiKeyRequest
impl RefUnwindSafe for CreateApiKeyRequest
impl Send for CreateApiKeyRequest
impl Sync for CreateApiKeyRequest
impl Unpin for CreateApiKeyRequest
impl UnsafeUnpin for CreateApiKeyRequest
impl UnwindSafe for CreateApiKeyRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more