Skip to main content

CommonLibrary/SourceControlManagement/DTO/
SourceControlManagementProviderDTO.rs

1//! # SourceControlManagementProviderDTO
2//!
3//! Defines the DTO for an SourceControlManagement provider itself.
4
5use serde::{Deserialize, Serialize};
6use serde_json::Value;
7
8use crate::SourceControlManagement::DTO::SourceControlInputBoxDTO::SourceControlInputBoxDTO;
9
10/// A serializable struct representing the metadata for a source control
11/// provider.
12#[derive(Serialize, Deserialize, Debug, Clone)]
13#[serde(rename_all = "camelCase")]
14pub struct SourceControlManagementProviderDTO {
15	pub Handle:u32,
16
17	/// The provider id ("git", "github", "hg", …). Used as the
18	/// `scmId` field on the `sky://scm/register` event payload so
19	/// replay-on-late-listener (Sky boot race) can re-emit with
20	/// the original id Cocoon's `ScmShimRegistry` keys against.
21	/// Defaults to empty for backwards-compat with old DTOs.
22	#[serde(default)]
23	pub Identifier:String,
24
25	pub Label:String,
26
27	/// The root URI of the repository this provider is managing. Serialized
28	/// `UriComponents`.
29	#[serde(rename = "rootUri")]
30	pub RootURI:Option<Value>,
31
32	/// An optional count of changed resources, often displayed as a badge.
33	#[serde(skip_serializing_if = "Option::is_none")]
34	pub Count:Option<u32>,
35
36	/// The template for the commit message input box.
37	#[serde(skip_serializing_if = "Option::is_none")]
38	pub CommitTemplate:Option<String>,
39
40	/// The state of the SourceControlManagement input box (commit message
41	/// area).
42	#[serde(skip_serializing_if = "Option::is_none")]
43	pub InputBox:Option<SourceControlInputBoxDTO>,
44}