artifact-keeper-client 1.1.6

Rust client for the Artifact Keeper REST API
Documentation
/*
 * Artifact Keeper API
 *
 * Enterprise artifact registry supporting 45+ package formats.
 *
 * The version of the OpenAPI document: 1.0.0-rc.3
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ApiTokenResponse {
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "expires_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub expires_at: Option<Option<String>>,
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "last_used_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_used_at: Option<Option<String>>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "scopes")]
    pub scopes: Vec<String>,
    #[serde(rename = "token_prefix")]
    pub token_prefix: String,
}

impl ApiTokenResponse {
    pub fn new(created_at: String, id: uuid::Uuid, name: String, scopes: Vec<String>, token_prefix: String) -> ApiTokenResponse {
        ApiTokenResponse {
            created_at,
            expires_at: None,
            id,
            last_used_at: None,
            name,
            scopes,
            token_prefix,
        }
    }
}