-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSystemModelBuilder.cs
More file actions
93 lines (81 loc) · 2.79 KB
/
Copy pathSystemModelBuilder.cs
File metadata and controls
93 lines (81 loc) · 2.79 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
using System.Collections.Generic;
namespace OctopusProjectBuilder.Model
{
public class SystemModelBuilder
{
private readonly List<MachinePolicy> _machinePolicies = new List<MachinePolicy>();
private readonly List<Environment> _environments = new List<Environment>();
private readonly List<ProjectGroup> _projectGroups = new List<ProjectGroup>();
private readonly List<Project> _projects = new List<Project>();
private readonly List<Lifecycle> _lifecycles = new List<Lifecycle>();
private readonly List<LibraryVariableSet> _libraryVariableSets = new List<LibraryVariableSet>();
private readonly List<UserRole> _userRoles = new List<UserRole>();
private readonly List<Team> _teams = new List<Team>();
private readonly List<Tenant> _tenants = new List<Tenant>();
private readonly List<TagSet> _tagSets = new List<TagSet>();
public SystemModelBuilder AddProjectGroup(ProjectGroup group)
{
_projectGroups.Add(group);
return this;
}
public SystemModelBuilder AddEnvironment(Environment environment)
{
_environments.Add(environment);
return this;
}
public SystemModelBuilder AddProject(Project project)
{
_projects.Add(project);
return this;
}
public SystemModelBuilder AddLifecycle(Lifecycle lifecycle)
{
_lifecycles.Add(lifecycle);
return this;
}
public SystemModelBuilder AddLibraryVariableSet(LibraryVariableSet libraryVariableSet)
{
_libraryVariableSets.Add(libraryVariableSet);
return this;
}
public SystemModelBuilder AddUserRole(UserRole userRole)
{
_userRoles.Add(userRole);
return this;
}
public SystemModelBuilder AddTeam(Team team)
{
_teams.Add(team);
return this;
}
public SystemModelBuilder AddMachinePolicy(MachinePolicy machinePolicy)
{
_machinePolicies.Add(machinePolicy);
return this;
}
public SystemModelBuilder AddTenant(Tenant tenant)
{
_tenants.Add(tenant);
return this;
}
public SystemModelBuilder AddTagSet(TagSet tagSet)
{
_tagSets.Add(tagSet);
return this;
}
public SystemModel Build()
{
return new SystemModel(
_machinePolicies,
_lifecycles,
_projectGroups,
_libraryVariableSets,
_projects,
_environments,
_userRoles,
_teams,
_tenants,
_tagSets);
}
}
}