#[derive(
Debug,
Clone,
conjure_object::serde::Serialize,
conjure_object::serde::Deserialize,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct ApiKey {
#[serde(rename = "rid")]
rid: super::ApiKeyRid,
#[builder(into)]
#[serde(rename = "apiKeyName")]
api_key_name: String,
#[serde(rename = "createdBy")]
created_by: conjure_object::ResourceIdentifier,
#[serde(rename = "createdAt")]
created_at: conjure_object::DateTime<conjure_object::Utc>,
#[builder(default, into)]
#[serde(rename = "expiresAt", skip_serializing_if = "Option::is_none", default)]
expires_at: Option<conjure_object::DateTime<conjure_object::Utc>>,
#[serde(rename = "isDeleted")]
is_deleted: bool,
}
impl ApiKey {
#[inline]
pub fn rid(&self) -> &super::ApiKeyRid {
&self.rid
}
#[inline]
pub fn api_key_name(&self) -> &str {
&*self.api_key_name
}
#[inline]
pub fn created_by(&self) -> &conjure_object::ResourceIdentifier {
&self.created_by
}
#[inline]
pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
self.created_at
}
#[inline]
pub fn expires_at(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
self.expires_at.as_ref().map(|o| *o)
}
#[inline]
pub fn is_deleted(&self) -> bool {
self.is_deleted
}
}