pub struct ImportApiKeyRequest {
pub actor_id: Option<String>,
pub ip_restriction: Option<Box<IpRestriction>>,
pub metadata: Option<Value>,
pub name: Option<String>,
pub rate_limit_policy: Option<Box<RateLimitPolicy>>,
pub raw_key: Option<String>,
pub request_id: Option<String>,
pub scopes: Option<Vec<String>>,
pub ttl: Option<String>,
pub visibility: Option<KeyVisibility>,
}Expand description
ImportApiKeyRequest : Example: { "raw_key": "sk_live_abc123xyz789", "name": "Stripe Production Key", "actor_id": "payment-processor", "scopes": ["read", "write"], "ttl": "8760h", // 1 year (also accepts: 31536000s) "metadata": {"source": "stripe", "environment": "production"} }
Fields§
§actor_id: Option<String>actor_id is the identifier of the entity that owns this imported key. Required so every imported key is traceable to an actor for revocation and audit queries.
ip_restriction: Option<Box<IpRestriction>>§metadata: Option<Value>metadata is a free-form JSON object for caller-defined attributes (e.g., source, environment, tags). Values may be strings, numbers, booleans, arrays, objects, or null. Total serialized size is capped at 4KB. AIP-148 metadata field.
name: Option<String>§rate_limit_policy: Option<Box<RateLimitPolicy>>§raw_key: Option<String>§request_id: Option<String>§scopes: Option<Vec<String>>§ttl: Option<String>ttl sets the expiry as a duration from now. Encoded as a google.protobuf.Duration (string ending in "s", e.g. "3600s"). Accepted bounds: 1s to 315360000s (~10 years). If unset or zero, the project default TTL applies. For convenience, the server also accepts Go-style duration strings ("24h", "30m", "1h30m") and an extended unit set ("1d", "1w", "1mo", "1y"; approximations: 1mo = 30d, 1y = 365d). Clients should prefer the standard Duration encoding for portability.
visibility: Option<KeyVisibility>Implementations§
Source§impl ImportApiKeyRequest
impl ImportApiKeyRequest
Sourcepub fn new() -> ImportApiKeyRequest
pub fn new() -> ImportApiKeyRequest
Example: { "raw_key": "sk_live_abc123xyz789", "name": "Stripe Production Key", "actor_id": "payment-processor", "scopes": ["read", "write"], "ttl": "8760h", // 1 year (also accepts: 31536000s) "metadata": {"source": "stripe", "environment": "production"} }
Trait Implementations§
Source§impl Clone for ImportApiKeyRequest
impl Clone for ImportApiKeyRequest
Source§fn clone(&self) -> ImportApiKeyRequest
fn clone(&self) -> ImportApiKeyRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ImportApiKeyRequest
impl Debug for ImportApiKeyRequest
Source§impl Default for ImportApiKeyRequest
impl Default for ImportApiKeyRequest
Source§fn default() -> ImportApiKeyRequest
fn default() -> ImportApiKeyRequest
Source§impl<'de> Deserialize<'de> for ImportApiKeyRequest
impl<'de> Deserialize<'de> for ImportApiKeyRequest
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>,
Source§impl PartialEq for ImportApiKeyRequest
impl PartialEq for ImportApiKeyRequest
Source§fn eq(&self, other: &ImportApiKeyRequest) -> bool
fn eq(&self, other: &ImportApiKeyRequest) -> bool
self and other values to be equal, and is used by ==.