-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKiotaEngine.cs
More file actions
169 lines (147 loc) · 7.14 KB
/
KiotaEngine.cs
File metadata and controls
169 lines (147 loc) · 7.14 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
using System.Diagnostics.CodeAnalysis;
namespace Riverside.CompilerPlatform.Features.Kiota;
/// <summary>
/// Represents the configuration and options for generating code using the Kiota engine.
/// </summary>
public partial class KiotaEngine
{
/// <summary>
/// The path or URI to the OpenAPI description file used to generate the code files.
/// </summary>
public string? Path { get; }
/// <summary>
/// The path or URI to the API manifest file used to generate the code files.
/// Append #apikey if the target manifest contains multiple API dependencies entries.
/// </summary>
public string? Manifest { get; }
/// <summary>
/// The output directory path for the generated code files.
/// </summary>
public string? Output { get; }
/// <summary>
/// The target language for the generated code files.
/// </summary>
public required GenerationLanguage Language { get; set; }
/// <summary>
/// The class name to use for the core client class.
/// </summary>
public string? ClassName { get; }
/// <summary>
/// The type access modifier to use for the client types.
/// </summary>
public Accessibility? TypeAccessModifier { get; }
/// <summary>
/// The namespace to use for the core client class specified with the <see cref="ClassName"/> option.
/// </summary>
public string? NamespaceName { get; }
/// <summary>
/// The log level to use when logging messages to the main output.
/// </summary>
public ConsoleLogLevel? LogLevel { get; }
/// <summary>
/// Enables backing store for models.
/// </summary>
public bool? BackingStore { get; }
/// <summary>
/// Excludes backward compatible and obsolete assets from the generated result.
/// Should be used for new clients.
/// </summary>
public bool? ExcludeBackwardCompatible { get; }
/// <summary>
/// Will include the 'AdditionalData' property for models.
/// </summary>
public bool? AdditionalData { get; }
/// <summary>
/// The fully qualified class names for serialisers.
/// Use <c>none</c> to generate a client without any serialiser.
/// </summary>
public string[]? Serializer { get; }
/// <summary>
/// The fully qualified class names for deserialisers.
/// Use <c>none</c> to generate a client without any deserialiser.
/// </summary>
public string[]? Deserializer { get; }
/// <summary>
/// Removes all files from the output directory before generating the code files.
/// </summary>
public bool? CleanOutput { get; }
/// <summary>
/// The MIME types with optional priorities as defined in RFC9110 Accept header to use for structured data model generation.
/// </summary>
public string[]? StructuredMimeTypes { get; }
/// <summary>
/// The paths to include in the generation.
/// Glob patterns accepted.
/// Append <c>#OPERATION</c> to the pattern to specify the operation to include, e.g. <c>users/*/messages#GET</c>.
/// </summary>
public string[]? IncludePath { get; }
/// <summary>
/// The paths to exclude from the generation.
/// Glob patterns accepted.
/// Append <c>#OPERATION</c> to the pattern to specify the operation to exclude, e.g. <c>users/*/messages#GET</c>.
/// </summary>
public string[]? ExcludePath { get; }
/// <summary>
/// The OpenAPI description validation rules to disable.
/// </summary>
public ValidationRules[]? DisableValidationRules { get; }
/// <summary>
/// Clears any cached data for the current command.
/// </summary>
public bool? ClearCache { get; }
/// <summary>
/// Disables SSL certificate validation.
/// </summary>
public bool? DisableSSLValidation { get; }
/// <summary>
/// Initialises a new instance of the KiotaEngine class with the specified configuration settings for code generation, serialisation, and validation.
/// </summary>
/// <remarks>
/// All parameters are optional and can be set to null to use default values.
/// This constructor allows fine-grained control over the code generation process, including language selection, serialisation options, and validation settings.
/// </remarks>
/// <param name="d">The path to the input directory or file used for code generation. Can be null to use the default location.</param>
/// <param name="a">The manifest file path that provides metadata for the generation process. Can be null if not required.</param>
/// <param name="o">The output directory where generated files will be written. Can be null to use the current directory.</param>
/// <param name="l">The target programming language for code generation.</param>
/// <param name="c">The name of the root class to be generated. Can be null to use a default class name.</param>
/// <param name="tam">The access modifier to apply to generated types. Can be null to use the default accessibility.</param>
/// <param name="n">The namespace for the generated client class. Can be null to use the default namespace.</param>
/// <param name="ll">The log level to use for diagnostic output during generation. Can be null to use the default log level.</param>
/// <param name="b">Indicates whether to use a backing store for generated models. If null, the default behavior is used.</param>
/// <param name="ebc">Indicates whether to exclude backward compatible code from the output. If null, the default behavior is used.</param>
/// <param name="ad">Indicates whether to include additional data support in generated models. If null, the default behavior is used.</param>
/// <param name="s">An array of serializer names to use for serialization. Can be null to use default serializers.</param>
/// <param name="ds">An array of deserializer names to use for deserialization. Can be null to use default deserializers.</param>
/// <param name="co">Indicates whether to clean the output directory before generation. If null, the default behavior is used.</param>
/// <param name="m">An array of structured MIME types to support in generated code. Can be null to use default MIME types.</param>
/// <param name="i">An array of paths to include in the generation process. Can be null to include all paths.</param>
/// <param name="e">An array of paths to exclude from the generation process. Can be null to exclude none.</param>
/// <param name="dvr">An array of validation rules to disable during generation. Can be null to enable all rules.</param>
/// <param name="cc">Indicates whether to clear the internal cache before generation. If null, the default behavior is used.</param>
/// <param name="dsv">Indicates whether to disable SSL validation for network operations. If null, the default behavior is used.</param>
[SetsRequiredMembers]
public KiotaEngine(string? d, string? a, string? o, GenerationLanguage l, string? c, Accessibility? tam, string? n, ConsoleLogLevel? ll, bool? b, bool? ebc, bool? ad, string[]? s, string[]? ds, bool? co, string[]? m, string[]? i, string[]? e, ValidationRules[]? dvr, bool? cc, bool? dsv)
{
Path = d;
Manifest = a;
Output = o;
Language = l;
ClassName = c;
TypeAccessModifier = tam;
NamespaceName = n;
LogLevel = ll;
BackingStore = b;
ExcludeBackwardCompatible = ebc;
AdditionalData = ad;
Serializer = s;
Deserializer = ds;
CleanOutput = co;
StructuredMimeTypes = m;
IncludePath = i;
ExcludePath = e;
DisableValidationRules = dvr;
ClearCache = cc;
DisableSSLValidation = dsv;
}
}