-
Notifications
You must be signed in to change notification settings - Fork 413
Expand file tree
/
Copy pathServiceFilter.cs
More file actions
51 lines (47 loc) · 1.32 KB
/
Copy pathServiceFilter.cs
File metadata and controls
51 lines (47 loc) · 1.32 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
using System;
using System.Collections.Generic;
using System.Linq;
namespace Docker.DotNet.Models
{
public class ServicesListParameters
{
[QueryStringParameter("filters", false, typeof(MapQueryStringConverter))]
public ServiceFilter Filters { get; set; }
}
public class ServiceFilter : Dictionary<string, string[]>
{
public string[] Id
{
get => this["id"];
set => this["id"] = value;
}
public string[] Label
{
get => this["label"];
set => this["label"] = value;
}
public ServiceCreationMode[] Mode
{
get
{
var lst = new ServiceCreationMode[this["mode"].Length];
for(int i = 0; i< this["mode"].Length; i++)
{
lst[i] = (ServiceCreationMode)Enum.Parse(typeof(ServiceCreationMode), this["mode"][i]);
}
return lst;
}
set => this["mode"] = value.Select(m => m.ToString()).ToArray();
}
public string[] Name
{
get => this["name"];
set => this["name"] = value;
}
}
public enum ServiceCreationMode
{
Replicated,
Global
}
}