Skip to main content

windmill_api/models/
github_installations_inner.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.713.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct GithubInstallationsInner {
16    #[serde(rename = "workspace_id", skip_serializing_if = "Option::is_none")]
17    pub workspace_id: Option<String>,
18    #[serde(rename = "installation_id")]
19    pub installation_id: f64,
20    #[serde(rename = "account_id")]
21    pub account_id: String,
22    #[serde(rename = "repositories")]
23    pub repositories: Vec<models::GithubInstallationsInnerRepositoriesInner>,
24    /// Total number of repositories available for this installation
25    #[serde(rename = "total_count")]
26    pub total_count: f64,
27    /// Number of repositories loaded per page
28    #[serde(rename = "per_page")]
29    pub per_page: f64,
30    /// Error message if token retrieval failed
31    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
32    pub error: Option<String>,
33    /// Set for self-managed (GHES) installs. Cloud installs omit this field.
34    #[serde(rename = "github_base_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35    pub github_base_url: Option<Option<String>>,
36    /// True when the installation was assigned by the instance super-admin from instance settings. Workspace admins cannot remove these.
37    #[serde(rename = "provisioned_by_admin", skip_serializing_if = "Option::is_none")]
38    pub provisioned_by_admin: Option<bool>,
39}
40
41impl GithubInstallationsInner {
42    pub fn new(installation_id: f64, account_id: String, repositories: Vec<models::GithubInstallationsInnerRepositoriesInner>, total_count: f64, per_page: f64) -> GithubInstallationsInner {
43        GithubInstallationsInner {
44            workspace_id: None,
45            installation_id,
46            account_id,
47            repositories,
48            total_count,
49            per_page,
50            error: None,
51            github_base_url: None,
52            provisioned_by_admin: None,
53        }
54    }
55}
56