forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMetadataTypes.cs
More file actions
152 lines (132 loc) · 5.06 KB
/
Copy pathMetadataTypes.cs
File metadata and controls
152 lines (132 loc) · 5.06 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
using System;
using System.Collections.Generic;
using ServiceStack.DataAnnotations;
namespace ServiceStack
{
public class MetadataTypesConfig
{
public MetadataTypesConfig(
string baseUrl = null,
bool makePartial = true,
bool makeVirtual = true,
bool addReturnMarker = true,
bool convertDescriptionToComments = true,
bool addDataContractAttributes = false,
bool addIndexesToDataMembers = false,
string addDefaultXmlNamespace = null,
bool addResponseStatus = false,
bool makeDataContractsExtensible = false,
bool initializeCollections = true,
int? addImplicitVersion = null)
{
BaseUrl = baseUrl;
MakePartial = makePartial;
MakeVirtual = makeVirtual;
AddReturnMarker = addReturnMarker;
AddDescriptionAsComments = convertDescriptionToComments;
AddDataContractAttributes = addDataContractAttributes;
AddDefaultXmlNamespace = addDefaultXmlNamespace;
MakeDataContractsExtensible = makeDataContractsExtensible;
AddIndexesToDataMembers = addIndexesToDataMembers;
InitializeCollections = initializeCollections;
AddResponseStatus = addResponseStatus;
AddImplicitVersion = addImplicitVersion;
}
public string BaseUrl { get; set; }
public bool MakePartial { get; set; }
public bool MakeVirtual { get; set; }
public bool AddReturnMarker { get; set; }
public bool AddDescriptionAsComments { get; set; }
public bool AddDataContractAttributes { get; set; }
public bool AddIndexesToDataMembers { get; set; }
public int? AddImplicitVersion { get; set; }
public bool AddResponseStatus { get; set; }
public string AddDefaultXmlNamespace { get; set; }
public bool MakeDataContractsExtensible { get; set; }
public bool InitializeCollections { get; set; }
public List<string> DefaultNamespaces { get; set; }
public Dictionary<string, string> TypeAlias { get; set; }
public HashSet<Type> IgnoreTypes { get; set; }
public HashSet<Type> ExportAttributes { get; set; }
public List<string> IgnoreTypesInNamespaces { get; set; }
}
[Exclude(Feature.Soap)]
public class MetadataTypes
{
public MetadataTypes()
{
Types = new List<MetadataType>();
Operations = new List<MetadataOperationType>();
Version = 1;
}
public int Version { get; set; }
public MetadataTypesConfig Config { get; set; }
public List<MetadataType> Types { get; set; }
public List<MetadataOperationType> Operations { get; set; }
}
public class MetadataOperationType
{
public List<string> Actions { get; set; }
public MetadataType Request { get; set; }
public MetadataType Response { get; set; }
}
public class MetadataType
{
public string Name { get; set; }
public string Namespace { get; set; }
public string[] GenericArgs { get; set; }
public MetadataTypeName Inherits { get; set; }
public string Description { get; set; }
public bool ReturnVoidMarker { get; set; }
public MetadataTypeName ReturnMarkerTypeName { get; set; }
public List<MetadataRoute> Routes { get; set; }
public MetadataDataContract DataContract { get; set; }
public List<MetadataPropertyType> Properties { get; set; }
public List<MetadataAttribute> Attributes { get; set; }
public string GetFullName()
{
return Namespace + "." + Name;
}
}
public class MetadataTypeName
{
public string Name { get; set; }
public string[] GenericArgs { get; set; }
}
public class MetadataRoute
{
public string Path { get; set; }
public string Verbs { get; set; }
public string Notes { get; set; }
public string Summary { get; set; }
}
public class MetadataDataContract
{
public string Name { get; set; }
public string Namespace { get; set; }
}
public class MetadataDataMember
{
public string Name { get; set; }
public int? Order { get; set; }
public bool? IsRequired { get; set; }
public bool? EmitDefaultValue { get; set; }
}
public class MetadataPropertyType
{
public string Name { get; set; }
public string Type { get; set; }
public string[] GenericArgs { get; set; }
public string Value { get; set; }
public string Description { get; set; }
public MetadataDataMember DataMember { get; set; }
public bool? ReadOnly { get; set; }
public List<MetadataAttribute> Attributes { get; set; }
}
public class MetadataAttribute
{
public string Name { get; set; }
public List<MetadataPropertyType> ConstructorArgs { get; set; }
public List<MetadataPropertyType> Args { get; set; }
}
}