-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Expand file tree
/
Copy pathclient.tsp
More file actions
90 lines (80 loc) · 3.51 KB
/
Copy pathclient.tsp
File metadata and controls
90 lines (80 loc) · 3.51 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
import "@azure-tools/typespec-client-generator-core";
import "./main.tsp";
using Azure.ClientGenerator.Core;
using Microsoft.AAD;
// common-types v3 models `Resource.id` as a plain string, so the generated
// ResourceData constructors take `string id` and fail to call the
// `base(ResourceIdentifier id)` constructor. Map it to ResourceIdentifier for C#.
@@alternateType(
Azure.ResourceManager.CommonTypes.Resource.id,
Azure.Core.armResourceIdentifier,
"csharp"
);
// AZC0030: model names must not end in 'Response' for the .NET SDK.
@@clientName(
UnsuspendDomainServiceResponse,
"DomainServiceUnsuspendResult",
"csharp"
);
// The `DomainServices` operations interface generates an internal REST-operations
// class named `DomainServices`, which collides with the last segment of the
// `Azure.ResourceManager.DomainServices` namespace and forces the emitter to escape
// the whole namespace to `_DomainServices`. Rename the operation group for C# to
// avoid the collision (the class is internal, so this has no public API impact).
@@clientName(DomainServices, "DomainServiceOperationGroup", "csharp");
// Use the ARM ETag type instead of a plain string for resource etags.
@@alternateType(DomainService.etag, Azure.Core.eTag, "csharp");
@@alternateType(OuContainer.etag, Azure.Core.eTag, "csharp");
// These `location` properties are Azure regions; use AzureLocation instead of string.
@@alternateType(DomainService.location, Azure.Core.azureLocation, "csharp");
@@alternateType(OuContainer.location, Azure.Core.azureLocation, "csharp");
@@alternateType(ReplicaSet.location, Azure.Core.azureLocation, "csharp");
// These properties are ARM subnet resource IDs; type them as ResourceIdentifier.
@@alternateType(
ReplicaSet.subnetId,
Azure.Core.armResourceIdentifier,
"csharp"
);
@@alternateType(
MigrationProperties.oldSubnetId,
Azure.Core.armResourceIdentifier,
"csharp"
);
// .NET guideline: DateTimeOffset properties should end with `On`/`At`.
@@clientName(ConfigDiagnostics.lastExecuted, "lastExecutedOn", "csharp");
@@clientName(HealthAlert.lastDetected, "lastDetectedOn", "csharp");
@@clientName(HealthAlert.raised, "raisedOn", "csharp");
@@clientName(
LdapsSettings.certificateNotAfter,
"certificateNotAfterOn",
"csharp"
);
@@clientName(ReplicaSet.healthLastEvaluated, "healthLastEvaluatedOn", "csharp");
// `Status` is a generic name in IntelliSense; it is the diagnostics validator status.
@@clientName(Status, "DomainServiceValidatorStatus", "csharp");
// These model/enum names are generic and lack service context in IntelliSense
// (some, like `ReplicaSet`, collide with well-known concepts). Add the
// `DomainService` prefix for the .NET SDK.
@@clientName(ReplicaSet, "DomainServiceReplicaSet", "csharp");
@@clientName(MigrationProperties, "DomainServiceMigrationProperties", "csharp");
@@clientName(MigrationProgress, "DomainServiceMigrationProgress", "csharp");
@@clientName(ConfigDiagnostics, "DomainServiceConfigDiagnostics", "csharp");
@@clientName(
ConfigDiagnosticsValidatorResult,
"DomainServiceConfigDiagnosticsValidatorResult",
"csharp"
);
@@clientName(
ConfigDiagnosticsValidatorResultIssue,
"DomainServiceConfigDiagnosticsValidatorResultIssue",
"csharp"
);
@@clientName(HealthAlert, "DomainServiceHealthAlert", "csharp");
@@clientName(HealthMonitor, "DomainServiceHealthMonitor", "csharp");
@@clientName(
NotificationSettings,
"DomainServiceNotificationSettings",
"csharp"
);
@@clientName(ExternalAccess, "DomainServiceExternalAccess", "csharp");
@@clientName(SyncScope, "DomainServiceSyncScope", "csharp");