Skip to main content

windmill_api/models/
git_credential_status.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.812.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// GitCredentialStatus : server-owned, what the repo's own credential reports about itself
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct GitCredentialStatus {
17    #[serde(rename = "provider")]
18    pub provider: Provider,
19    #[serde(rename = "token_id", skip_serializing_if = "Option::is_none")]
20    pub token_id: Option<i64>,
21    /// absent for a non-expiring token
22    #[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")]
23    pub expires_at: Option<String>,
24    #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")]
25    pub scopes: Option<Vec<String>>,
26    /// whether this workspace renews the credential itself
27    #[serde(rename = "rotatable")]
28    pub rotatable: bool,
29    #[serde(rename = "checked_at")]
30    pub checked_at: i64,
31    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
32    pub error: Option<String>,
33}
34
35impl GitCredentialStatus {
36    /// server-owned, what the repo's own credential reports about itself
37    pub fn new(provider: Provider, rotatable: bool, checked_at: i64) -> GitCredentialStatus {
38        GitCredentialStatus {
39            provider,
40            token_id: None,
41            expires_at: None,
42            scopes: None,
43            rotatable,
44            checked_at,
45            error: None,
46        }
47    }
48}
49/// 
50#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
51pub enum Provider {
52    #[serde(rename = "gitlab")]
53    Gitlab,
54}
55
56impl Default for Provider {
57    fn default() -> Provider {
58        Self::Gitlab
59    }
60}
61