pub struct CredentialData {
pub version: String,
pub id: String,
pub name: String,
pub api_key: String,
pub template_type: TemplateType,
pub created_at: String,
pub updated_at: String,
pub metadata: Option<HashMap<String, String>>,
}Expand description
Core credential data structure
Fields§
§version: StringData format version for compatibility
id: StringUnique identifier for the credential
name: StringUser-friendly name for the credential
api_key: StringAPI key in plain text
template_type: TemplateTypeTemplate type this credential is associated with
created_at: StringCreation timestamp in UTC
updated_at: StringLast update timestamp in UTC
metadata: Option<HashMap<String, String>>Optional metadata for future extensibility
Implementations§
Source§impl CredentialData
impl CredentialData
Sourcepub fn new(name: String, api_key: String, template_type: TemplateType) -> Self
pub fn new(name: String, api_key: String, template_type: TemplateType) -> Self
Create a new credential
Sourcepub fn update_timestamp(&mut self)
pub fn update_timestamp(&mut self)
Update the timestamp to current time
Sourcepub fn template_type(&self) -> &TemplateType
pub fn template_type(&self) -> &TemplateType
Get template type
Sourcepub fn created_at(&self) -> &str
pub fn created_at(&self) -> &str
Get creation timestamp
Sourcepub fn updated_at(&self) -> &str
pub fn updated_at(&self) -> &str
Get update timestamp
Sourcepub fn set_metadata(&mut self, metadata: HashMap<String, String>)
pub fn set_metadata(&mut self, metadata: HashMap<String, String>)
Update metadata
Trait Implementations§
Source§impl Clone for CredentialData
impl Clone for CredentialData
Source§fn clone(&self) -> CredentialData
fn clone(&self) -> CredentialData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CredentialData
impl Debug for CredentialData
Source§impl Default for CredentialData
impl Default for CredentialData
Source§impl<'de> Deserialize<'de> for CredentialData
impl<'de> Deserialize<'de> for CredentialData
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 PartialEq for CredentialData
impl PartialEq for CredentialData
Source§impl Serialize for CredentialData
impl Serialize for CredentialData
impl StructuralPartialEq for CredentialData
Auto Trait Implementations§
impl Freeze for CredentialData
impl RefUnwindSafe for CredentialData
impl Send for CredentialData
impl Sync for CredentialData
impl Unpin for CredentialData
impl UnwindSafe for CredentialData
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