141 writes to Category
Aspire.Hosting.CodeGeneration.Java.Tests (44)
AtsJavaCodeGeneratorTests.cs (44)
2646
new AtsTypeRef { TypeId = "array",
Category
= AtsTypeCategory.Array, ElementType = MutableStringDict() });
2662
Category
= AtsTypeCategory.List,
2676
var stringType = new AtsTypeRef { TypeId = "string",
Category
= AtsTypeCategory.Primitive };
2677
var innerArray = new AtsTypeRef { TypeId = "array",
Category
= AtsTypeCategory.Array, ElementType = stringType };
2680
new AtsTypeRef { TypeId = "array",
Category
= AtsTypeCategory.Array, ElementType = innerArray });
2723
var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource",
Category
= AtsTypeCategory.Handle };
2724
var stringType = new AtsTypeRef { TypeId = AtsConstants.String,
Category
= AtsTypeCategory.Primitive };
2725
var innerArray = new AtsTypeRef { TypeId = "array",
Category
= AtsTypeCategory.Array, ElementType = stringType };
2726
var matrixType = new AtsTypeRef { TypeId = "array",
Category
= AtsTypeCategory.Array, ElementType = innerArray };
2731
Type = new AtsTypeRef { TypeId = "callback",
Category
= AtsTypeCategory.Callback },
2733
CallbackReturnType = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive }
2740
ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive },
2761
var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource",
Category
= AtsTypeCategory.Handle };
2765
Type = new AtsTypeRef { TypeId = AtsConstants.CancellationToken,
Category
= AtsTypeCategory.Dto }
2772
ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive },
2789
var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource",
Category
= AtsTypeCategory.Handle };
2808
Category
= AtsTypeCategory.Primitive,
2834
Category
= AtsTypeCategory.Handle
2841
new AtsTypeRef { TypeId = AtsConstants.Boolean,
Category
= AtsTypeCategory.Primitive, IsNullable = true }),
2845
new AtsTypeRef { TypeId = AtsConstants.Number,
Category
= AtsTypeCategory.Primitive, IsNullable = true }));
2963
var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource",
Category
= AtsTypeCategory.Handle };
2967
Category
= AtsTypeCategory.Primitive,
2973
Category
= AtsTypeCategory.Primitive,
2979
Category
= AtsTypeCategory.Array,
2985
Category
= AtsTypeCategory.Array,
2991
Category
= AtsTypeCategory.Array,
2998
Type = new AtsTypeRef { TypeId = "callback",
Category
= AtsTypeCategory.Callback },
3004
CallbackReturnType = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive }
3011
ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive },
3219
var contextType = new AtsTypeRef { TypeId = "Tests/MutableContext",
Category
= AtsTypeCategory.Dto };
3235
Type = new AtsTypeRef { TypeId = AtsConstants.String,
Category
= AtsTypeCategory.Primitive }
3248
Type = new AtsTypeRef { TypeId = "callback",
Category
= AtsTypeCategory.Callback },
3257
Category
= AtsTypeCategory.Primitive
3310
var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource",
Category
= AtsTypeCategory.Handle };
3311
var contextType = new AtsTypeRef { TypeId = "Tests/MutableContext",
Category
= AtsTypeCategory.Dto };
3316
Type = new AtsTypeRef { TypeId = "callback",
Category
= AtsTypeCategory.Callback },
3321
CallbackReturnType = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive }
3328
ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive },
3350
Type = new AtsTypeRef { TypeId = AtsConstants.String,
Category
= AtsTypeCategory.Primitive }
3537
Type = new AtsTypeRef { TypeId = "KeywordProbe",
Category
= AtsTypeCategory.Dto }
3596
new AtsTypeRef { TypeId = "string",
Category
= AtsTypeCategory.Primitive });
3628
Category
= AtsTypeCategory.Dict,
3630
KeyType = new AtsTypeRef { TypeId = "string",
Category
= AtsTypeCategory.Primitive },
3631
ValueType = new AtsTypeRef { TypeId = "string",
Category
= AtsTypeCategory.Primitive }
Aspire.Hosting.CodeGeneration.Python.Tests (19)
AtsPythonCodeGeneratorTests.cs (19)
500
Category
= AtsTypeCategory.Handle
524
Category
= AtsTypeCategory.Primitive
556
Category
= AtsTypeCategory.Handle
580
Category
= AtsTypeCategory.Primitive
615
Category
= AtsTypeCategory.Handle
622
Category
= AtsTypeCategory.Handle,
630
Category
= AtsTypeCategory.Handle,
654
Category
= AtsTypeCategory.Primitive
694
Category
= AtsTypeCategory.Union,
700
Category
= AtsTypeCategory.Union,
706
Category
= AtsTypeCategory.Primitive,
714
Category
= AtsTypeCategory.Primitive
749
Category
= AtsTypeCategory.Array,
753
Category
= AtsTypeCategory.Primitive,
763
Category
= AtsTypeCategory.Primitive
799
Category
= AtsTypeCategory.Primitive
805
Category
= AtsTypeCategory.Primitive
812
Category
= AtsTypeCategory.Handle
819
Category
= AtsTypeCategory.Handle
Aspire.Hosting.CodeGeneration.TypeScript.Tests (21)
AtsTypeScriptCodeGeneratorTests.cs (21)
785
Category
= AtsTypeCategory.Primitive,
791
Category
= AtsTypeCategory.Array,
842
Category
= AtsTypeCategory.Union,
1382
Category
= AtsTypeCategory.Handle
1628
Category
= AtsTypeCategory.Handle
1640
Category
= AtsTypeCategory.Primitive
1663
Category
= AtsTypeCategory.Primitive
2566
Category
= AtsTypeCategory.Handle
2571
Category
= AtsTypeCategory.Primitive
2576
Category
= AtsTypeCategory.Primitive
2771
Category
= AtsTypeCategory.Handle
2779
Category
= AtsTypeCategory.Handle
2865
Category
= AtsTypeCategory.Handle
2880
Category
= AtsTypeCategory.Primitive
2983
Category
= AtsTypeCategory.Handle
2998
Category
= AtsTypeCategory.Callback
3013
Category
= AtsTypeCategory.Primitive
3020
Category
= AtsTypeCategory.Primitive
3047
Category
= AtsTypeCategory.Primitive
3056
Category
= AtsTypeCategory.Primitive
3064
Category
= AtsTypeCategory.Primitive
Aspire.Hosting.RemoteHost (38)
Ats\AtsMarshaller.cs (1)
445
Category
= _context.GetCategory(type)
AtsCapabilityScanner.cs (35)
696
typeRef.
Category
= AtsTypeCategory.Handle;
856
Category
= AtsTypeCategory.Handle,
887
Category
= AtsTypeCategory.Handle,
1097
? new AtsTypeRef { TypeId = "callback", ClrType = prop.PropertyType,
Category
= AtsTypeCategory.Callback }
1617
: new AtsTypeRef { TypeId = AtsConstants.Any,
Category
= AtsTypeCategory.Primitive };
1622
Category
= AtsTypeCategory.Dict,
1644
propertyTypeRef = new AtsTypeRef { TypeId = AtsConstants.Any,
Category
= AtsTypeCategory.Primitive };
2150
? new AtsTypeRef { TypeId = "callback",
Category
= AtsTypeCategory.Callback }
2207
returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive };
2211
returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive };
2219
?? new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive }
2220
: new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive };
2225
?? new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive }
2253
var voidTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive };
2589
Category
= AtsTypeCategory.Primitive
2605
Category
= typeRef.Category,
2683
return new AtsTypeRef { TypeId = primitiveTypeId, ClrType = type,
Category
= AtsTypeCategory.Primitive };
2689
return new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = type,
Category
= AtsTypeCategory.Primitive };
2698
Category
= AtsTypeCategory.Dict,
2699
KeyType = new AtsTypeRef { TypeId = AtsConstants.String, ClrType = typeof(string),
Category
= AtsTypeCategory.Primitive },
2700
ValueType = new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = typeof(object),
Category
= AtsTypeCategory.Primitive },
2711
Category
= AtsTypeCategory.List,
2712
ElementType = new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = typeof(object),
Category
= AtsTypeCategory.Primitive }
2726
Category
= AtsTypeCategory.Enum
2749
Category
= AtsTypeCategory.Dict,
2772
Category
= AtsTypeCategory.Dict,
2794
Category
= AtsTypeCategory.List,
2814
Category
= AtsTypeCategory.Array,
2859
Category
= AtsTypeCategory.Array,
2875
Category
= AtsTypeCategory.Dto,
2887
Category
= AtsTypeCategory.Handle,
2897
Category
= AtsTypeCategory.Unknown,
2992
Category
= AtsTypeCategory.Handle,
3059
Category
= AtsTypeCategory.Handle,
3317
Category
= AtsTypeCategory.Union,
AtsContextFilter.cs (2)
326
Category
= AtsTypeCategory.Handle,
344
Category
= AtsTypeCategory.Primitive
Aspire.Hosting.RemoteHost.Tests (19)
AtsContextFilterTests.cs (17)
192
Category
= AtsTypeCategory.Dto
199
Category
= AtsTypeCategory.Handle
206
Category
= AtsTypeCategory.Handle,
278
Category
= AtsTypeCategory.Enum
285
Type = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive },
296
Category
= AtsTypeCategory.Enum
436
Category
= AtsTypeCategory.Enum
489
Category
= AtsTypeCategory.Enum
509
Category
= AtsTypeCategory.Handle
519
Category
= AtsTypeCategory.Dto
529
Category
= AtsTypeCategory.Enum
537
Category
= AtsTypeCategory.Handle,
545
Category
= AtsTypeCategory.Handle
562
Category
= AtsTypeCategory.Handle
580
Category
= AtsTypeCategory.Primitive
593
Category
= AtsTypeCategory.Dto
606
Category
= AtsTypeCategory.Primitive
AtsMarshallerTests.cs (2)
226
Category
= AtsTypeCategory.Primitive
953
var typeRef = new AtsTypeRef { TypeId = "test/SelfReferencingDto",
Category
= AtsTypeCategory.Dto };
106 references to Category
Aspire.Hosting.CodeGeneration.Go (16)
AtsGoCodeGenerator.cs (15)
320
if (typeRef.
Category
== AtsTypeCategory.Handle)
691
var renderedValue = typeRef.
Category
switch
709
var valueType = typeRef.
Category
== AtsTypeCategory.Primitive
875
if (capability.ReturnType.
Category
!= AtsTypeCategory.List
876
&& capability.ReturnType.
Category
!= AtsTypeCategory.Dict)
1177
if (returnType.
Category
!= AtsTypeCategory.Handle)
1398
if (p.Type?.
Category
!= AtsTypeCategory.Handle) { continue; }
1584
else if (p.CallbackParameters is { Count: > 0 } callbackParameters && callbackParameters.Any(cp => cp.Type.
Category
== AtsTypeCategory.Dto))
1599
if (callbackParameters[i].Type.
Category
== AtsTypeCategory.Dto)
1637
if (returnType.
Category
== AtsTypeCategory.Dict)
1837
if (p.Type?.
Category
== AtsTypeCategory.Union)
1909
if (hasReturn && capability.ReturnType!.
Category
== AtsTypeCategory.Handle)
2103
var baseType = typeRef.
Category
switch
2141
var baseType = typeRef.
Category
switch
2165
&& typeRef.
Category
is AtsTypeCategory.Primitive or AtsTypeCategory.Enum
src\Shared\CodeGeneration\AtsOptionsFlattening.cs (1)
54
if (candidate.Type?.
Category
!= AtsTypeCategory.Dto)
Aspire.Hosting.CodeGeneration.Java (15)
AtsJavaCodeGenerator.cs (15)
861
return typeRef.
Category
switch
1123
if (parameter.IsCallback || parameter.Type?.
Category
!= AtsTypeCategory.Handle)
2041
var converted = typeRef.
Category
switch
2082
if (typeRef?.
Category
is not (AtsTypeCategory.Dict or AtsTypeCategory.Array or AtsTypeCategory.List))
2089
if (typeRef.
Category
== AtsTypeCategory.List)
2105
if (typeRef.
Category
== AtsTypeCategory.Array)
2231
return returnType.
Category
== AtsTypeCategory.List || returnType.
Category
== AtsTypeCategory.Dict;
2237
var isDict = returnType.
Category
== AtsTypeCategory.Dict;
2554
return typeRef.
Category
switch
2586
return typeRef.
Category
switch
2660
private static bool IsUnionType(AtsTypeRef? typeRef) => typeRef?.
Category
== AtsTypeCategory.Union;
2683
if (typeRef.
Category
== AtsTypeCategory.Handle)
2696
if (typeRef.
Category
== AtsTypeCategory.List)
2703
else if (typeRef.
Category
== AtsTypeCategory.Dict)
Aspire.Hosting.CodeGeneration.Python (15)
AtsPythonCodeGenerator.cs (15)
158
typeRef != null && typeRef.
Category
== AtsTypeCategory.Handle;
220
var mappedType = typeRef.
Category
switch
246
&& typeRef.
Category
is AtsTypeCategory.Primitive or AtsTypeCategory.Enum
521
if (typeRef.
Category
== AtsTypeCategory.Union)
528
if (typeRef.
Category
== AtsTypeCategory.Primitive && typeRef.TypeId == AtsConstants.Void)
598
return typeRef.
Category
switch
999
expression = typeRef.
Category
switch
1011
if (!topLevel || typeRef.
Category
is AtsTypeCategory.Primitive)
1367
var isResourceBuilder = capability.ReturnType != null && capability.ReturnType.
Category
== AtsTypeCategory.Handle &&
1440
if (capability.ReturnType != null && (capability.ReturnType.
Category
== AtsTypeCategory.Handle || capability.ReturnType.
Category
== AtsTypeCategory.Dto))
1925
if (targetTypeRef.
Category
!= AtsTypeCategory.Handle)
2174
if (!string.IsNullOrEmpty(typeRef.TypeId) && typeRef.
Category
== AtsTypeCategory.Handle)
2178
if (!string.IsNullOrEmpty(typeRef.TypeId) && typeRef.
Category
== AtsTypeCategory.Dict)
2182
if (!string.IsNullOrEmpty(typeRef.TypeId) && typeRef.
Category
== AtsTypeCategory.List)
Aspire.Hosting.CodeGeneration.Rust (19)
AtsRustCodeGenerator.cs (19)
381
return typeRef.
Category
switch
615
else if (returnTypeRef?.
Category
== AtsTypeCategory.Dict && returnTypeRef.IsReadOnly == false)
621
else if (returnTypeRef?.
Category
== AtsTypeCategory.List && returnTypeRef.IsReadOnly == false)
654
return returnType.
Category
== AtsTypeCategory.List || returnType.
Category
== AtsTypeCategory.Dict;
662
var isDict = returnType.
Category
== AtsTypeCategory.Dict;
910
var baseType = typeRef.
Category
switch
948
var baseType = typeRef.
Category
switch
988
var baseType = typeRef.
Category
switch
1035
if (typeRef.
Category
== AtsTypeCategory.Primitive)
1061
&& typeRef.
Category
is AtsTypeCategory.Primitive or AtsTypeCategory.Enum
1065
typeRef?.
Category
== AtsTypeCategory.Handle
1071
&& (typeRef.
Category
== AtsTypeCategory.Array || (typeRef.
Category
== AtsTypeCategory.List && typeRef.IsReadOnly))
1077
&& ((typeRef.
Category
== AtsTypeCategory.List && !typeRef.IsReadOnly)
1078
|| (typeRef.
Category
== AtsTypeCategory.Dict && !typeRef.IsReadOnly));
1101
if (typeRef.
Category
== AtsTypeCategory.Handle)
1114
if (typeRef.
Category
== AtsTypeCategory.List || typeRef.
Category
== AtsTypeCategory.Dict)
Aspire.Hosting.CodeGeneration.TypeScript (18)
AtsTypeScriptCodeGenerator.cs (2)
374
if (typeRef?.
Category
!= AtsTypeCategory.Dto ||
389
if (typeRef?.
Category
!= AtsTypeCategory.Dto ||
src\Shared\CodeGeneration\AtsOptionsFlattening.cs (1)
54
if (candidate.Type?.
Category
!= AtsTypeCategory.Dto)
TypeScriptApiProjector.cs (15)
759
return exportedValue.Type.
Category
is AtsTypeCategory.Primitive
771
return typeRef.
Category
switch
1644
typeRef is {
Category
: AtsTypeCategory.Handle };
1685
var mappedType = typeRef.
Category
switch
1706
if (typeRef.IsNullable != true || typeRef.
Category
is not (AtsTypeCategory.Primitive or AtsTypeCategory.Enum))
1723
return typeRef.
Category
switch
1734
var requiresGrouping = elementType?.
Category
== AtsTypeCategory.Union ||
1735
elementType is { IsNullable: true,
Category
: AtsTypeCategory.Primitive or AtsTypeCategory.Enum };
1855
if (typeRef?.
Category
== AtsTypeCategory.Union)
2004
return typeRef.
Category
== AtsTypeCategory.Handle && typeRef.IsInterface;
2547
if (typeRef.
Category
== AtsTypeCategory.Union && typeRef.UnionTypes is { Count: > 0 })
2621
return typeRef?.
Category
== AtsTypeCategory.Dict;
2630
return typeRef?.
Category
== AtsTypeCategory.List;
2663
if (targetTypeRef.
Category
!= AtsTypeCategory.Handle)
2938
if (!string.IsNullOrEmpty(typeRef.TypeId) && typeRef.
Category
== AtsTypeCategory.Handle)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (3)
AtsTypeScriptCodeGeneratorTests.cs (3)
749
Assert.Equal(AtsTypeCategory.Handle, dependencyParam.Type.
Category
);
2040
Assert.Equal(AtsTypeCategory.Primitive, ctParam.Type.
Category
);
2213
Assert.NotEqual(AtsTypeCategory.Unknown, param.Type.
Category
);
Aspire.Hosting.RemoteHost (9)
Ats\AtsMarshaller.cs (2)
155
return typeRef.
Category
switch
164
_ => throw new InvalidOperationException($"Unknown type category: {typeRef.
Category
}")
AtsCapabilityScanner.cs (5)
610
if (typeRef.
Category
== AtsTypeCategory.Enum && typeRef.ClrType != null)
694
if (typeRef.
Category
== AtsTypeCategory.Unknown && validTypes.Contains(typeRef.TypeId))
789
if (typeRef.
Category
== AtsTypeCategory.Unknown)
1310
return typeRef.
Category
switch
2605
Category = typeRef.
Category
,
AtsContextFilter.cs (1)
393
if (typeRef.
Category
== AtsTypeCategory.Handle && !string.IsNullOrEmpty(typeRef.TypeId))
CodeGeneration\CodeGenerationService.cs (1)
142
Category = t.
Category
.ToString(),
Aspire.Hosting.RemoteHost.Tests (11)
AtsCapabilityScannerTests.cs (11)
160
Assert.Equal(AtsTypeCategory.Array, itemsType.
Category
);
165
Assert.Equal(AtsTypeCategory.Array, enumerableReturnCapability.ReturnType.
Category
);
176
Assert.Equal(AtsTypeCategory.Array, typeRef.
Category
);
191
Assert.Equal(AtsTypeCategory.Union, parameter.Type?.
Category
);
323
Assert.Equal(AtsTypeCategory.Union, resourceParameter.Type?.
Category
);
329
Assert.Equal(AtsTypeCategory.Dict, argumentsParameter.Type?.
Category
);
391
Assert.Equal(AtsTypeCategory.Dto, optionsParameter.Type.
Category
);
408
Assert.Equal(AtsTypeCategory.Handle, callbackParameter.Type.
Category
);
410
Assert.Equal(AtsTypeCategory.Dto, prepareRequestProperty.CallbackReturnType?.
Category
);
554
Assert.NotEqual(AtsTypeCategory.Unknown, cbParam.Type.
Category
);
573
Assert.Equal(AtsTypeCategory.Handle, parameter.Type.
Category
);