11
11
12
12
namespace KubernetesWatchGenerator
13
13
{
14
- class Program
14
+ internal class Program
15
15
{
16
16
private static HashSet < string > _classesWithValidation ;
17
- static readonly Dictionary < string , string > ClassNameMap = new Dictionary < string , string > ( ) ;
17
+ private static readonly Dictionary < string , string > ClassNameMap = new Dictionary < string , string > ( ) ;
18
18
private static Dictionary < JsonSchema4 , string > _schemaToNameMap ;
19
19
private static HashSet < string > _schemaDefinitionsInMultipleGroups ;
20
20
private static Dictionary < string , string > _classNameToPluralMap ;
21
21
22
- static async Task Main ( string [ ] args )
22
+ private static async Task Main ( string [ ] args )
23
23
{
24
24
if ( args . Length < 2 )
25
25
{
@@ -167,7 +167,7 @@ static async Task Main(string[] args)
167
167
168
168
}
169
169
170
- static void ToXmlDoc ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
170
+ private static void ToXmlDoc ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
171
171
RenderBlock fn , RenderBlock inverse )
172
172
{
173
173
if ( arguments != null && arguments . Count > 0 && arguments [ 0 ] != null && arguments [ 0 ] is string )
@@ -195,7 +195,7 @@ static void ToXmlDoc(RenderContext context, IList<object> arguments, IDictionary
195
195
}
196
196
}
197
197
198
- static void GetTuple ( RenderContext context , IList < object > arguments , IDictionary < string , object > options , RenderBlock fn , RenderBlock inverse )
198
+ private static void GetTuple ( RenderContext context , IList < object > arguments , IDictionary < string , object > options , RenderBlock fn , RenderBlock inverse )
199
199
{
200
200
if ( arguments != null && arguments . Count > 0 && arguments [ 0 ] is ITuple && options . TryGetValue ( "index" , out var indexObj ) && int . TryParse ( indexObj ? . ToString ( ) , out var index ) )
201
201
{
@@ -205,7 +205,7 @@ static void GetTuple(RenderContext context, IList<object> arguments, IDictionary
205
205
}
206
206
}
207
207
208
- static void GetClassName ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
208
+ private static void GetClassName ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
209
209
RenderBlock fn , RenderBlock inverse )
210
210
{
211
211
if ( arguments != null && arguments . Count > 0 && arguments [ 0 ] != null && arguments [ 0 ] is SwaggerOperation )
@@ -218,7 +218,7 @@ static void GetClassName(RenderContext context, IList<object> arguments, IDictio
218
218
}
219
219
}
220
220
221
- static string GetClassName ( SwaggerOperation watchOperation )
221
+ private static string GetClassName ( SwaggerOperation watchOperation )
222
222
{
223
223
var groupVersionKind =
224
224
( Dictionary < string , object > ) watchOperation . ExtensionData [ "x-kubernetes-group-version-kind" ] ;
@@ -251,7 +251,7 @@ private static void GetInterfaceName(RenderContext context, IList<object> argume
251
251
}
252
252
}
253
253
254
- static string GetClassNameForSchemaDefinition ( JsonSchema4 definition )
254
+ private static string GetClassNameForSchemaDefinition ( JsonSchema4 definition )
255
255
{
256
256
if ( definition . ExtensionData != null &&
257
257
definition . ExtensionData . ContainsKey ( "x-kubernetes-group-version-kind" ) )
@@ -274,7 +274,7 @@ static string GetClassNameForSchemaDefinition(JsonSchema4 definition)
274
274
return className ;
275
275
}
276
276
277
- static string GetInterfaceName ( JsonSchema4 definition )
277
+ private static string GetInterfaceName ( JsonSchema4 definition )
278
278
{
279
279
var groupVersionKindElements = ( object [ ] ) definition . ExtensionData [ "x-kubernetes-group-version-kind" ] ;
280
280
var groupVersionKind = ( Dictionary < string , object > ) groupVersionKindElements [ 0 ] ;
@@ -315,7 +315,7 @@ static string GetInterfaceName(JsonSchema4 definition)
315
315
return result ;
316
316
}
317
317
318
- static void GetKind ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
318
+ private static void GetKind ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
319
319
RenderBlock fn , RenderBlock inverse )
320
320
{
321
321
if ( arguments != null && arguments . Count > 0 && arguments [ 0 ] != null && arguments [ 0 ] is JsonSchema4 )
@@ -332,7 +332,7 @@ private static string GetKind(JsonSchema4 definition)
332
332
return groupVersionKind [ "kind" ] as string ;
333
333
}
334
334
335
- static void GetPlural ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
335
+ private static void GetPlural ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
336
336
RenderBlock fn , RenderBlock inverse )
337
337
{
338
338
if ( arguments != null && arguments . Count > 0 && arguments [ 0 ] != null && arguments [ 0 ] is JsonSchema4 )
@@ -355,7 +355,7 @@ private static string GetPlural(JsonSchema4 definition)
355
355
return _classNameToPluralMap . GetValueOrDefault ( className , null ) ;
356
356
}
357
357
358
- static void GetGroup ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
358
+ private static void GetGroup ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
359
359
RenderBlock fn , RenderBlock inverse )
360
360
{
361
361
if ( arguments != null && arguments . Count > 0 && arguments [ 0 ] != null && arguments [ 0 ] is JsonSchema4 )
@@ -372,7 +372,7 @@ private static string GetGroup(JsonSchema4 definition)
372
372
return groupVersionKind [ "group" ] as string ;
373
373
}
374
374
375
- static void GetMethodName ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
375
+ private static void GetMethodName ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
376
376
RenderBlock fn , RenderBlock inverse )
377
377
{
378
378
if ( arguments != null && arguments . Count > 0 && arguments [ 0 ] != null && arguments [ 0 ] is SwaggerOperation )
@@ -381,7 +381,7 @@ static void GetMethodName(RenderContext context, IList<object> arguments, IDicti
381
381
}
382
382
}
383
383
384
- static string GetMethodName ( SwaggerOperation watchOperation )
384
+ private static string GetMethodName ( SwaggerOperation watchOperation )
385
385
{
386
386
var tag = watchOperation . Tags [ 0 ] ;
387
387
tag = tag . Replace ( "_" , string . Empty ) ;
@@ -394,7 +394,7 @@ static string GetMethodName(SwaggerOperation watchOperation)
394
394
return methodName ;
395
395
}
396
396
397
- static void GetDotNetType ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
397
+ private static void GetDotNetType ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
398
398
RenderBlock fn , RenderBlock inverse )
399
399
{
400
400
if ( arguments != null && arguments . Count > 0 && arguments [ 0 ] != null && arguments [ 0 ] is SwaggerParameter )
@@ -455,7 +455,7 @@ private static string GetDotNetType(JsonObjectType jsonType, string name, bool r
455
455
}
456
456
}
457
457
458
- static void GetDotNetName ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
458
+ private static void GetDotNetName ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
459
459
RenderBlock fn , RenderBlock inverse )
460
460
{
461
461
if ( arguments != null && arguments . Count > 0 && arguments [ 0 ] != null && arguments [ 0 ] is SwaggerParameter )
@@ -484,7 +484,7 @@ private static string GetDotNetName(string jsonName)
484
484
return jsonName ;
485
485
}
486
486
487
- static void GetPathExpression ( RenderContext context , IList < object > arguments ,
487
+ private static void GetPathExpression ( RenderContext context , IList < object > arguments ,
488
488
IDictionary < string , object > options , RenderBlock fn , RenderBlock inverse )
489
489
{
490
490
if ( arguments != null && arguments . Count > 0 && arguments [ 0 ] != null &&
@@ -508,7 +508,7 @@ private static string GetPathExpression(SwaggerOperationDescription operation)
508
508
return pathExpression ;
509
509
}
510
510
511
- static void GetApiVersion ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
511
+ private static void GetApiVersion ( RenderContext context , IList < object > arguments , IDictionary < string , object > options ,
512
512
RenderBlock fn , RenderBlock inverse )
513
513
{
514
514
if ( arguments != null && arguments . Count > 0 && arguments [ 0 ] != null && arguments [ 0 ] is JsonSchema4 )
0 commit comments