Skip to main content

nautobot_openapi/models/
git_repository.rs

1/*
2 * API Documentation
3 *
4 * Source of truth and network automation platform
5 *
6 * The version of the OpenAPI document: 3.1.0 (3.1)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// GitRepository : Git repositories defined as a data source.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct GitRepository {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
18    pub object_type: Option<String>,
19    /// Human friendly display value
20    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
21    pub display: Option<String>,
22    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
23    pub url: Option<String>,
24    #[serde(rename = "natural_slug", skip_serializing_if = "Option::is_none")]
25    pub natural_slug: Option<String>,
26    #[serde(rename = "provided_contents", skip_serializing_if = "Option::is_none")]
27    pub provided_contents:
28        Option<Vec<crate::models::BulkWritableGitRepositoryRequestProvidedContentsInner>>,
29    #[serde(rename = "name")]
30    pub name: String,
31    /// Internal field name. Please use underscores rather than dashes in this key.
32    #[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
33    pub slug: Option<String>,
34    /// Only HTTP and HTTPS URLs are presently supported
35    #[serde(rename = "remote_url")]
36    pub remote_url: String,
37    /// Branch, tag, or commit
38    #[serde(rename = "branch", skip_serializing_if = "Option::is_none")]
39    pub branch: Option<String>,
40    /// Commit hash of the most recent fetch from the selected branch. Used for syncing between workers.
41    #[serde(rename = "current_head", skip_serializing_if = "Option::is_none")]
42    pub current_head: Option<String>,
43    #[serde(
44        rename = "secrets_group",
45        default,
46        with = "::serde_with::rust::double_option",
47        skip_serializing_if = "Option::is_none"
48    )]
49    pub secrets_group: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
50    #[serde(
51        rename = "created",
52        default,
53        with = "::serde_with::rust::double_option",
54        skip_serializing_if = "Option::is_none"
55    )]
56    pub created: Option<Option<String>>,
57    #[serde(
58        rename = "last_updated",
59        default,
60        with = "::serde_with::rust::double_option",
61        skip_serializing_if = "Option::is_none"
62    )]
63    pub last_updated: Option<Option<String>>,
64    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
65    pub notes_url: Option<String>,
66    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
67    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
68    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
69    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
70}
71
72impl GitRepository {
73    /// Git repositories defined as a data source.
74    pub fn new(name: String, remote_url: String) -> GitRepository {
75        GitRepository {
76            id: None,
77            object_type: None,
78            display: None,
79            url: None,
80            natural_slug: None,
81            provided_contents: None,
82            name,
83            slug: None,
84            remote_url,
85            branch: None,
86            current_head: None,
87            secrets_group: None,
88            created: None,
89            last_updated: None,
90            notes_url: None,
91            custom_fields: None,
92            tags: None,
93        }
94    }
95}