doppler-rs 0.0.1

Unofficial client library for the Doppler API - secure secrets management platform
Documentation
/*
 * Core
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0-oas3.1
 * 
 * Generated by: https://openapi-generator.tech
 */

/*
 * Core
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0-oas3.1
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};
use chrono::{DateTime, NaiveDate, Utc};
/// CreateServiceTokenRequest
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateServiceTokenRequest {
    /// Unique identifier for the project object.
    #[serde(rename = "project")]
    pub project: String ,
    /// Name of the config object.
    #[serde(rename = "config")]
    pub config: String ,
    /// Name of the service token.
    #[serde(rename = "name")]
    pub name: String ,
    /// Unix timestamp of when token should expire.
    #[serde(rename = "expire_at", skip_serializing_if = "Option::is_none")]
    pub expire_at: Option<chrono::DateTime<chrono::Utc> >,
    /// Token's capabilities.
    /// Token's capabilities.
    /// Token's capabilities.
    #[serde(rename = "access", skip_serializing_if = "Option::is_none")]
    pub access: Option<String >,
}

impl CreateServiceTokenRequest {
    pub fn new(project: String , config: String , name: String ) -> CreateServiceTokenRequest {
        CreateServiceTokenRequest {
            project: project,
            config: config,
            name: name,
            expire_at: None,
            access: Some("Read".to_string()),
        }
    }
}
/// Token's capabilities.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Access {
    #[serde(rename = "read")]
    /// Token's capabilities.
    Read,
    #[serde(rename = "read/write")]
    /// Token's capabilities.
    ReadSlashWrite,
}

impl Default for Access {
    fn default() -> Access {
        Self::Read
    }
}