Skip to content

Commit 24e4a7a

Browse files
Remove redundant Front Door custom resource decorators (#44157)
1 parent 280622e commit 24e4a7a

2 files changed

Lines changed: 1 addition & 127 deletions

File tree

specification/frontdoor/resource-manager/Microsoft.Network/FrontDoor/client.tsp

Lines changed: 0 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -379,137 +379,10 @@ interface ProfilesOverrides {
379379
"csharp"
380380
);
381381

382-
// FrontDoorResourceData and other models in the following section should be use BasicResourceWithSettableIDName as base class instead of FrontDoorSubResource (SubResource).
383-
// hierarchyBuilding cannot be used here: the validator requires the base's properties (id) to be
384-
// directly on the target, but our models inherit `id` from SubResource.
385-
// Keeps models.tsp untouched (no swagger change) — replacements are C#-only constructs.
386-
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "C#-only replacement model to swap base class; no impact on spec/swagger."
387-
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage" "Brownfield migration: inherits @customAzureResource from BasicResourceWithSettableIDName; replacement is C#-only."
388-
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key" "C#-only replacement model; not emitted to swagger and not a top-level ARM resource."
389-
@doc("A routing rule represents a specification for traffic to treat and where to send it, along with health probe information.")
390-
model RoutingRuleReplacement extends BasicResourceWithSettableIDName {
391-
@doc("Properties of the Front Door Routing Rule")
392-
properties?: RoutingRuleProperties;
393-
}
394-
@@alternateType(RoutingRule, RoutingRuleReplacement, "csharp");
395-
@@clientName(RoutingRuleReplacement, "RoutingRuleData", "csharp");
396-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Back compatibility — flatten properties into parent in C# SDK."
397-
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(
398-
RoutingRuleReplacement.properties,
399-
"csharp"
400-
);
401-
402-
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "C#-only replacement model to swap base class; no impact on spec/swagger."
403-
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage" "Brownfield migration: inherits @customAzureResource from BasicResourceWithSettableIDName; replacement is C#-only."
404-
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key" "C#-only replacement model; not emitted to swagger and not a top-level ARM resource."
405-
@doc("Load balancing settings for a backend pool")
406-
model LoadBalancingSettingsModelReplacement
407-
extends BasicResourceWithSettableIDName {
408-
@doc("Properties of the load balancing settings")
409-
properties?: LoadBalancingSettingsProperties;
410-
}
411-
@@alternateType(
412-
LoadBalancingSettingsModel,
413-
LoadBalancingSettingsModelReplacement,
414-
"csharp"
415-
);
416-
@@clientName(
417-
LoadBalancingSettingsModelReplacement,
418-
"FrontDoorLoadBalancingSettingsData",
419-
"csharp"
420-
);
421-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Back compatibility — flatten properties into parent in C# SDK."
422-
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(
423-
LoadBalancingSettingsModelReplacement.properties,
424-
"csharp"
425-
);
426-
427-
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "C#-only replacement model to swap base class; no impact on spec/swagger."
428-
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage" "Brownfield migration: inherits @customAzureResource from BasicResourceWithSettableIDName; replacement is C#-only."
429-
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key" "C#-only replacement model; not emitted to swagger and not a top-level ARM resource."
430-
@doc("Load balancing settings for a backend pool")
431-
model HealthProbeSettingsModelReplacement
432-
extends BasicResourceWithSettableIDName {
433-
@doc("Properties of the health probe settings")
434-
properties?: HealthProbeSettingsProperties;
435-
}
436-
@@alternateType(
437-
HealthProbeSettingsModel,
438-
HealthProbeSettingsModelReplacement,
439-
"csharp"
440-
);
441-
@@clientName(
442-
HealthProbeSettingsModelReplacement,
443-
"FrontDoorHealthProbeSettingsData",
444-
"csharp"
445-
);
446-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Back compatibility — flatten properties into parent in C# SDK."
447-
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(
448-
HealthProbeSettingsModelReplacement.properties,
449-
"csharp"
450-
);
451-
452-
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "C#-only replacement model to swap base class; no impact on spec/swagger."
453-
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage" "Brownfield migration: inherits @customAzureResource from BasicResourceWithSettableIDName; replacement is C#-only."
454-
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key" "C#-only replacement model; not emitted to swagger and not a top-level ARM resource."
455-
@doc("A backend pool is a collection of backends that can be routed to.")
456-
model BackendPoolReplacement extends BasicResourceWithSettableIDName {
457-
@doc("Properties of the Front Door Backend Pool")
458-
properties?: BackendPoolProperties;
459-
}
460-
@@alternateType(BackendPool, BackendPoolReplacement, "csharp");
461-
@@clientName(BackendPoolReplacement, "FrontDoorBackendPool", "csharp");
462-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Back compatibility — flatten properties into parent in C# SDK."
463-
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(
464-
BackendPoolReplacement.properties,
465-
"csharp"
466-
);
467-
468382
@@alternateType(Profile.etag, Azure.Core.eTag, "csharp");
469383
@@alternateType(WebApplicationFirewallPolicy.etag, Azure.Core.eTag, "csharp");
470384
@@alternateType(PolicySettings.redirectUrl, url, "csharp");
471385

472-
@@alternateType(
473-
Microsoft.Network.Resource,
474-
Azure.ResourceManager.Foundations.TrackedResource,
475-
"csharp"
476-
);
477-
@@alternateType(
478-
ResourcewithSettableName,
479-
Azure.ResourceManager.Foundations.TrackedResource,
480-
"csharp"
481-
);
482-
@@alternateType(
483-
BasicResource,
484-
Azure.ResourceManager.Foundations.ProxyResource,
485-
"csharp"
486-
);
487-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Back compatibility: preserve autorest-generated resource treatment."
488-
@@Azure.ResourceManager.Legacy.customAzureResource(
489-
FrontDoor,
490-
#{ isAzureResource: true }
491-
);
492-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Back compatibility: preserve autorest-generated resource treatment."
493-
@@Azure.ResourceManager.Legacy.customAzureResource(
494-
Experiment,
495-
#{ isAzureResource: true }
496-
);
497-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Back compatibility: preserve autorest-generated resource treatment."
498-
@@Azure.ResourceManager.Legacy.customAzureResource(
499-
Profile,
500-
#{ isAzureResource: true }
501-
);
502-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Back compatibility: preserve autorest-generated resource treatment."
503-
@@Azure.ResourceManager.Legacy.customAzureResource(
504-
RulesEngine,
505-
#{ isAzureResource: true }
506-
);
507-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Back compatibility: preserve autorest-generated resource treatment."
508-
@@Azure.ResourceManager.Legacy.customAzureResource(
509-
WebApplicationFirewallPolicy,
510-
#{ isAzureResource: true }
511-
);
512-
513386
@@alternateType(
514387
GetLatencyScorecardsParameters.endDateTimeUTC,
515388
utcDateTime,

specification/frontdoor/resource-manager/Microsoft.Network/FrontDoor/main.tsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import "@azure-tools/typespec-azure-core";
1313
import "@azure-tools/typespec-azure-resource-manager";
1414
import "./models.tsp";
1515
import "./back-compatible.tsp";
16+
import "./client.tsp";
1617
import "./WebApplicationFirewallPolicy.tsp";
1718
import "./FrontDoor.tsp";
1819
import "./FrontendEndpoint.tsp";

0 commit comments

Comments
 (0)