-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathRepository.cs
40 lines (31 loc) · 1.11 KB
/
Repository.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
using YamlDotNet.Serialization;
namespace Documentation.Assembler.Configuration;
public record NarrativeRepository : Repository
{
public static string RepositoryName { get; } = "docs-content";
public override string Name { get; set; } = RepositoryName;
public override string? PathPrefix { get; set; }
}
public record Repository
{
[YamlIgnore]
public virtual string Name { get; set; } = string.Empty;
[YamlMember(Alias = "repo")]
public string Origin { get; set; } = string.Empty;
[YamlMember(Alias = "current")]
public string CurrentBranch { get; set; } = "main";
[YamlMember(Alias = "checkout_strategy")]
public string CheckoutStrategy { get; set; } = "partial";
private string? _pathPrefix;
[YamlMember(Alias = "path_prefix")]
public virtual string? PathPrefix
{
get => _pathPrefix ?? $"reference/{Name}";
set => _pathPrefix = value;
}
[YamlMember(Alias = "skip")]
public bool Skip { get; set; }
}