Skip to main content

nautobot_openapi/models/
git_repository_request.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/// GitRepositoryRequest : Git repositories defined as a data source.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct GitRepositoryRequest {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "provided_contents", skip_serializing_if = "Option::is_none")]
18    pub provided_contents:
19        Option<Vec<crate::models::BulkWritableGitRepositoryRequestProvidedContentsInner>>,
20    #[serde(rename = "name")]
21    pub name: String,
22    /// Internal field name. Please use underscores rather than dashes in this key.
23    #[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
24    pub slug: Option<String>,
25    /// Only HTTP and HTTPS URLs are presently supported
26    #[serde(rename = "remote_url")]
27    pub remote_url: String,
28    /// Branch, tag, or commit
29    #[serde(rename = "branch", skip_serializing_if = "Option::is_none")]
30    pub branch: Option<String>,
31    /// Commit hash of the most recent fetch from the selected branch. Used for syncing between workers.
32    #[serde(rename = "current_head", skip_serializing_if = "Option::is_none")]
33    pub current_head: Option<String>,
34    #[serde(
35        rename = "secrets_group",
36        default,
37        with = "::serde_with::rust::double_option",
38        skip_serializing_if = "Option::is_none"
39    )]
40    pub secrets_group: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
41    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
42    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
43    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
44    pub relationships: Option<
45        ::std::collections::HashMap<
46            String,
47            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
48        >,
49    >,
50    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
51    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
52}
53
54impl GitRepositoryRequest {
55    /// Git repositories defined as a data source.
56    pub fn new(name: String, remote_url: String) -> GitRepositoryRequest {
57        GitRepositoryRequest {
58            id: None,
59            provided_contents: None,
60            name,
61            slug: None,
62            remote_url,
63            branch: None,
64            current_head: None,
65            secrets_group: None,
66            custom_fields: None,
67            relationships: None,
68            tags: None,
69        }
70    }
71}