270 references to AtsConstants
Aspire.Hosting.CodeGeneration.Go (34)
AtsGoCodeGenerator.cs (34)
137
if (dto.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
151
if (handleType.AtsTypeId ==
AtsConstants
.ReferenceExpressionTypeId
315
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId
536
if (dto.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
912
if (string.Equals(typeId,
AtsConstants
.BuilderTypeId, StringComparison.Ordinal))
914
var appInterface = _interfaceNames.TryGetValue(
AtsConstants
.ApplicationTypeId, out var appName)
1136
&& p.CallbackReturnType.TypeId !=
AtsConstants
.Void;
1153
var hasReturn = capability.ReturnType is not null && capability.ReturnType.TypeId !=
AtsConstants
.Void;
1541
&& p.CallbackReturnType.TypeId !=
AtsConstants
.Void;
1892
var hasReturn = capability.ReturnType is not null && capability.ReturnType.TypeId !=
AtsConstants
.Void;
1916
WriteLine("\tc.registerHandleWrapper(\"" +
AtsConstants
.ReferenceExpressionTypeId + "\", func(h *handle, c *client) any {");
1934
var builderTypeId =
AtsConstants
.BuilderTypeId;
1941
var appTypeId =
AtsConstants
.ApplicationTypeId;
1991
WriteLine($"\tresult, err := b.client.invokeCapability(context.Background(), \"{
AtsConstants
.BuildCapability}\", map[string]any{{");
2049
WriteLine($"\tresult, err := c.invokeCapability(context.Background(), \"{
AtsConstants
.CreateBuilderCapability}\", map[string]any{{\"argsOrOptions\": resolved}})");
2082
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
2120
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
2168
AtsConstants
.String or
AtsConstants
.Char => "string",
2169
AtsConstants
.Number => "float64",
2170
AtsConstants
.Boolean => "bool",
2171
AtsConstants
.Void => "",
2172
AtsConstants
.Any => "any",
2173
AtsConstants
.DateTime or
AtsConstants
.DateTimeOffset or
2174
AtsConstants
.DateOnly or
AtsConstants
.TimeOnly => "string",
2175
AtsConstants
.TimeSpan => "float64",
2176
AtsConstants
.Guid or
AtsConstants
.Uri => "string",
2177
AtsConstants
.CancellationToken => "*CancellationToken",
2187
string.Equals(capabilityId,
AtsConstants
.BuildCapability, StringComparison.Ordinal)
2188
|| string.Equals(capabilityId,
AtsConstants
.CreateBuilderCapability, StringComparison.Ordinal);
2194
string.Equals(typeId,
AtsConstants
.CancellationToken, StringComparison.Ordinal)
Aspire.Hosting.CodeGeneration.Java (41)
AtsJavaCodeGenerator.cs (41)
717
if (dto.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
1317
var builderClassName = _classNames.TryGetValue(
AtsConstants
.BuilderTypeId, out var name)
1875
var hasReturn = capability.ReturnType?.TypeId !=
AtsConstants
.Void;
1887
var hasReturnType = callbackReturnType != null && callbackReturnType.TypeId !=
AtsConstants
.Void;
1921
var hasReturnType = callbackParam.CallbackReturnType != null && callbackParam.CallbackReturnType.TypeId !=
AtsConstants
.Void;
1967
var hasReturnType = property.CallbackReturnType != null && property.CallbackReturnType.TypeId !=
AtsConstants
.Void;
1997
if (callbackParameter.Type?.TypeId ==
AtsConstants
.CancellationToken)
2017
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
2090
AtsConstants
.String or
AtsConstants
.Char or
2091
AtsConstants
.DateTime or
AtsConstants
.DateTimeOffset or
2092
AtsConstants
.DateOnly or
AtsConstants
.TimeOnly or
2093
AtsConstants
.Guid or
AtsConstants
.Uri => $"(String) {valueExpression}",
2094
AtsConstants
.Number or
AtsConstants
.TimeSpan => $"((Number) {valueExpression}).doubleValue()",
2095
AtsConstants
.Boolean => $"(Boolean) {valueExpression}",
2096
AtsConstants
.Void => "null",
2147
if (typeRef.TypeId ==
AtsConstants
.CancellationToken)
2257
var builderClassName = _classNames.TryGetValue(
AtsConstants
.BuilderTypeId, out var name)
2336
if (handleType.AtsTypeId ==
AtsConstants
.ReferenceExpressionTypeId
2487
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
2519
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
2575
AtsConstants
.String or
AtsConstants
.Char => "String",
2584
AtsConstants
.Number => useBoxedTypes ? "Number" : "double",
2585
AtsConstants
.Boolean => useBoxedTypes ? "Boolean" : "boolean",
2586
AtsConstants
.Void => "void",
2587
AtsConstants
.Any => "Object",
2588
AtsConstants
.DateTime or
AtsConstants
.DateTimeOffset or
2589
AtsConstants
.DateOnly or
AtsConstants
.TimeOnly => "String",
2590
AtsConstants
.TimeSpan => useBoxedTypes ? "Number" : "double",
2591
AtsConstants
.Guid or
AtsConstants
.Uri => "String",
2592
AtsConstants
.CancellationToken => "CancellationToken",
2602
string.Equals(typeId,
AtsConstants
.CancellationToken, StringComparison.Ordinal)
2613
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId
Aspire.Hosting.CodeGeneration.Python (23)
AtsPythonCodeGenerator.cs (23)
144
AtsConstants
.ReferenceExpressionTypeId,
242
return typeRef.TypeId is
AtsConstants
.Void or
AtsConstants
.Any or
AtsConstants
.CancellationToken
252
AtsConstants
.String or
AtsConstants
.Char => "str",
253
AtsConstants
.Number => "int",
254
AtsConstants
.Boolean => "bool",
255
AtsConstants
.Void => "None",
256
AtsConstants
.Any => "typing.Any",
257
AtsConstants
.DateTime => "datetime.datetime",
258
AtsConstants
.DateTimeOffset => "datetime.datetime",
259
AtsConstants
.DateOnly => "datetime.date",
260
AtsConstants
.TimeOnly => "datetime.time",
261
AtsConstants
.TimeSpan => "float",
262
AtsConstants
.Guid or
AtsConstants
.Uri => "str",
263
AtsConstants
.CancellationToken => "CancellationToken",
273
if (param.Type?.TypeId ==
AtsConstants
.CancellationToken)
286
if (param.Type?.TypeId ==
AtsConstants
.CancellationToken)
435
filtered = filtered.Where(p => p.Type?.TypeId !=
AtsConstants
.CancellationToken);
447
if (param.Type?.TypeId ==
AtsConstants
.CancellationToken)
605
if (param.Type?.TypeId ==
AtsConstants
.CancellationToken)
Aspire.Hosting.CodeGeneration.Python.Tests (3)
AtsPythonCodeGeneratorTests.cs (3)
415
TypeId =
AtsConstants
.String,
471
TypeId =
AtsConstants
.String,
545
TypeId =
AtsConstants
.Void,
Aspire.Hosting.CodeGeneration.Rust (40)
AtsRustCodeGenerator.cs (40)
207
if (dto.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
375
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId
472
var hasReturn = capability.ReturnType.TypeId !=
AtsConstants
.Void;
609
else if (returnTypeRef?.TypeId ==
AtsConstants
.CancellationToken)
713
var builderStructName = _structNames.TryGetValue(
AtsConstants
.BuilderTypeId, out var name)
781
if (handleType.AtsTypeId ==
AtsConstants
.ReferenceExpressionTypeId
905
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
943
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
983
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
1011
AtsConstants
.String or
AtsConstants
.Char => "String",
1012
AtsConstants
.Number => "f64",
1013
AtsConstants
.Boolean => "bool",
1014
AtsConstants
.Void => "()",
1015
AtsConstants
.Any => "Value",
1016
AtsConstants
.DateTime or
AtsConstants
.DateTimeOffset or
1017
AtsConstants
.DateOnly or
AtsConstants
.TimeOnly => "String",
1018
AtsConstants
.TimeSpan => "f64",
1019
AtsConstants
.Guid or
AtsConstants
.Uri => "String",
1020
AtsConstants
.CancellationToken => "CancellationToken",
1037
AtsConstants
.String or
AtsConstants
.Char => "&str",
1038
AtsConstants
.Number => "f64",
1039
AtsConstants
.Boolean => "bool",
1040
AtsConstants
.Void => "()",
1041
AtsConstants
.Any => "&Value",
1042
AtsConstants
.DateTime or
AtsConstants
.DateTimeOffset or
1043
AtsConstants
.DateOnly or
AtsConstants
.TimeOnly => "&str",
1044
AtsConstants
.TimeSpan => "f64",
1045
AtsConstants
.Guid or
AtsConstants
.Uri => "&str",
1046
AtsConstants
.CancellationToken => "&CancellationToken",
1059
&& typeRef.TypeId !=
AtsConstants
.ReferenceExpressionTypeId
1077
string.Equals(typeId,
AtsConstants
.CancellationToken, StringComparison.Ordinal)
1088
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId
Aspire.Hosting.CodeGeneration.TypeScript (36)
AtsTypeScriptCodeGenerator.cs (14)
133
capability.ReturnType.TypeId ==
AtsConstants
.Void ? null : capability.Documentation?.Returns,
134
suppressReturns: capability.ReturnType.TypeId ==
AtsConstants
.Void,
911
var isVoid = capability.ReturnType == null || capability.ReturnType.TypeId ==
AtsConstants
.Void;
1188
if (capability.ReturnType?.TypeId ==
AtsConstants
.CancellationToken)
1817
else if (capability.ReturnType?.TypeId ==
AtsConstants
.CancellationToken)
1895
&& callbackParam.CallbackReturnType.TypeId !=
AtsConstants
.Void;
1932
if (cbTypeId ==
AtsConstants
.CancellationToken)
1959
var builderHandle = TypeScriptApiProjector.GetHandleTypeName(
AtsConstants
.BuilderTypeId);
2283
if (getter.ReturnType?.TypeId ==
AtsConstants
.CancellationToken)
2363
if (getter.ReturnType?.TypeId ==
AtsConstants
.CancellationToken)
2712
else if (method.ReturnType?.TypeId ==
AtsConstants
.CancellationToken)
2900
var isVoid = capability.ReturnType == null || capability.ReturnType.TypeId ==
AtsConstants
.Void;
3042
if (capability.ReturnType?.TypeId ==
AtsConstants
.CancellationToken)
3152
var isVoid = capability.ReturnType == null || capability.ReturnType.TypeId ==
AtsConstants
.Void;
TypeScriptApiProjector.cs (22)
424
if (capability.ReturnType is null || capability.ReturnType.TypeId ==
AtsConstants
.Void)
1659
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
1711
return typeRef.TypeId is
AtsConstants
.Void or
AtsConstants
.Any or
AtsConstants
.CancellationToken
1752
AtsConstants
.String or
AtsConstants
.Char => "string",
1753
AtsConstants
.Number => "number",
1754
AtsConstants
.Boolean => "boolean",
1755
AtsConstants
.Void => "void",
1756
AtsConstants
.Any => "any",
1757
AtsConstants
.DateTime or
AtsConstants
.DateTimeOffset or
1758
AtsConstants
.DateOnly or
AtsConstants
.TimeOnly => "string",
1759
AtsConstants
.TimeSpan => "number",
1760
AtsConstants
.Guid or
AtsConstants
.Uri => "string",
1761
AtsConstants
.CancellationToken => GetCancellationTokenInterfaceName(),
1999
internal static bool IsCancellationTokenType(AtsTypeRef? typeRef) => typeRef?.TypeId ==
AtsConstants
.CancellationToken;
2597
if (targetTypeId is
AtsConstants
.ReferenceExpressionTypeId or InteractionInputCollectionTypeId)
3034
var returnType = callbackReturnType == null || callbackReturnType.TypeId ==
AtsConstants
.Void
Aspire.Hosting.CodeGeneration.TypeScript.Tests (15)
AtsTypeScriptCodeGeneratorTests.cs (15)
1523
TypeId =
AtsConstants
.Void,
1546
TypeId =
AtsConstants
.Void,
1831
c.TargetTypeId ==
AtsConstants
.ReferenceExpressionTypeId);
1922
Assert.Equal(
AtsConstants
.CancellationToken, ctParam.Type.TypeId);
1957
Assert.Equal(
AtsConstants
.CancellationToken, operationParam.CallbackParameters[0].Type?.TypeId);
1976
Assert.Equal(
AtsConstants
.TimeSpan, timeoutParam.Type?.TypeId);
1980
Assert.Equal(
AtsConstants
.CancellationToken, ctParam.Type?.TypeId);
2421
TypeId =
AtsConstants
.String,
2426
TypeId =
AtsConstants
.Void,
2730
TypeId =
AtsConstants
.Void,
2863
TypeId =
AtsConstants
.Void,
2870
TypeId =
AtsConstants
.Void,
2897
TypeId =
AtsConstants
.String,
2906
TypeId =
AtsConstants
.Number,
2914
TypeId =
AtsConstants
.Void,
Aspire.Hosting.RemoteHost (53)
Ats\AtsMarshaller.cs (2)
140
if (typeRef.TypeId ==
AtsConstants
.CancellationToken && value is CancellationToken cancellationToken)
146
if (typeRef.TypeId == TypeSystem.
AtsConstants
.Any)
AtsCapabilityScanner.cs (50)
98
var typeId =
AtsConstants
.EnumTypeId(fullName);
1312
AtsTypeCategory.Primitive => typeRef.TypeId !=
AtsConstants
.CancellationToken && typeRef.TypeId !=
AtsConstants
.Void,
1617
: new AtsTypeRef { TypeId =
AtsConstants
.Any, Category = AtsTypeCategory.Primitive };
1621
TypeId =
AtsConstants
.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
1644
propertyTypeRef = new AtsTypeRef { TypeId =
AtsConstants
.Any, Category = AtsTypeCategory.Primitive };
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 };
2371
if (
AtsConstants
.IsPrimitiveType(type))
2379
return
AtsConstants
.Any;
2384
return
AtsConstants
.DictTypeId(
AtsConstants
.String,
AtsConstants
.Any);
2389
return
AtsConstants
.ListTypeId(
AtsConstants
.Any);
2395
return
AtsConstants
.EnumTypeId(type.FullName ?? type.Name);
2417
return
AtsConstants
.DictTypeId(keyTypeName, valueTypeName);
2433
return
AtsConstants
.ListTypeId(elementTypeName);
2504
return
AtsConstants
.String;
2508
return
AtsConstants
.Char;
2512
return
AtsConstants
.Boolean;
2521
return
AtsConstants
.Number;
2527
return
AtsConstants
.DateTime;
2531
return
AtsConstants
.DateTimeOffset;
2535
return
AtsConstants
.DateOnly;
2539
return
AtsConstants
.TimeOnly;
2543
return
AtsConstants
.TimeSpan;
2549
return
AtsConstants
.Guid;
2553
return
AtsConstants
.Uri;
2557
return
AtsConstants
.CancellationToken;
2588
TypeId =
AtsConstants
.Void,
2688
return new AtsTypeRef { TypeId =
AtsConstants
.Any, ClrType = type, Category = AtsTypeCategory.Primitive };
2695
TypeId =
AtsConstants
.DictTypeId(
AtsConstants
.String,
AtsConstants
.Any),
2698
KeyType = new AtsTypeRef { TypeId =
AtsConstants
.String, ClrType = typeof(string), Category = AtsTypeCategory.Primitive },
2699
ValueType = new AtsTypeRef { TypeId =
AtsConstants
.Any, ClrType = typeof(object), Category = AtsTypeCategory.Primitive },
2708
TypeId =
AtsConstants
.ListTypeId(
AtsConstants
.Any),
2711
ElementType = new AtsTypeRef { TypeId =
AtsConstants
.Any, ClrType = typeof(object), Category = AtsTypeCategory.Primitive }
2723
TypeId =
AtsConstants
.EnumTypeId(type.FullName ?? type.Name),
2746
TypeId =
AtsConstants
.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
2769
TypeId =
AtsConstants
.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
2791
TypeId =
AtsConstants
.ListTypeId(elementTypeRef.TypeId),
2811
TypeId =
AtsConstants
.ArrayTypeId(elementTypeRef.TypeId),
2856
TypeId =
AtsConstants
.ArrayTypeId(elementTypeRef.TypeId),
AtsContextFilter.cs (1)
343
TypeId =
AtsConstants
.Void,
Aspire.Hosting.RemoteHost.Tests (23)
AtsCapabilityScannerTests.cs (7)
179
Assert.Contains(parameter.Type.UnionTypes!, type => type.TypeId ==
AtsConstants
.String);
443
Assert.Equal(
AtsConstants
.String, nameGetter.ReturnType.TypeId);
448
Assert.Equal(
AtsConstants
.String, descriptionGetter.ReturnType.TypeId);
469
Assert.Equal(
AtsConstants
.String, nullableString.Type.TypeId);
474
Assert.Equal(
AtsConstants
.String, requiredString.Type.TypeId);
479
Assert.Equal(
AtsConstants
.Number, nullableNumber.Type.TypeId);
484
Assert.Equal(
AtsConstants
.Number, requiredNumber.Type.TypeId);
AtsContextFilterTests.cs (11)
136
type => Assert.Equal(
AtsConstants
.EnumTypeId(typeof(TestMode).FullName!), type.TypeId));
163
Assert.Contains(filteredContext.EnumTypes, type => type.TypeId ==
AtsConstants
.EnumTypeId(typeof(DistributedApplicationOperation).FullName!));
164
Assert.Contains(filteredContext.EnumTypes, type => type.TypeId ==
AtsConstants
.EnumTypeId("Aspire.TypeSystem.ExportedValueMode"));
231
Assert.Equal(
AtsConstants
.Void, filteredSupport.ReturnType.TypeId);
248
TypeId =
AtsConstants
.EnumTypeId("Some.Foreign.Dependency.ForeignMode"),
256
TypeId =
AtsConstants
.EnumTypeId("Some.Foreign.Dependency.ForeignCallbackMode"),
285
Type = new AtsTypeRef { TypeId =
AtsConstants
.Void, Category = AtsTypeCategory.Primitive },
434
TypeId =
AtsConstants
.EnumTypeId(typeof(TestMode).FullName!),
453
TypeId =
AtsConstants
.EnumTypeId(typeof(TestMode).FullName!),
461
TypeId =
AtsConstants
.EnumTypeId("Aspire.TypeSystem.ExportedValueMode"),
469
TypeId =
AtsConstants
.EnumTypeId(typeof(DistributedApplicationOperation).FullName!),
AtsMarshallerTests.cs (4)
224
TypeId =
AtsConstants
.CancellationToken,
1234
var conditionHandleId = registry.Register(condition,
AtsConstants
.ReferenceExpressionTypeId);
1276
var conditionHandleId = registry.Register(condition,
AtsConstants
.ReferenceExpressionTypeId);
1318
var conditionHandleId = registry.Register(condition,
AtsConstants
.ReferenceExpressionTypeId);
HandleRegistryTests.cs (1)
355
var typeId =
AtsConstants
.ReferenceExpressionTypeId;
Aspire.TypeSystem (2)
AtsCapabilityInfo.cs (1)
309
/// Use <see cref="
AtsConstants
.Void"/> TypeId for void return types.
AtsContext.cs (1)
110
if (
AtsConstants
.IsPrimitiveType(type))