diff --git a/specification/managedoperations/ManagedOps.Management/client.tsp b/specification/managedoperations/ManagedOps.Management/client.tsp index 42cc93139d10..d06283a35c15 100644 --- a/specification/managedoperations/ManagedOps.Management/client.tsp +++ b/specification/managedoperations/ManagedOps.Management/client.tsp @@ -2,5 +2,27 @@ import "./main.tsp"; import "@azure-tools/typespec-client-generator-core"; using Azure.ClientGenerator.Core; +using Microsoft.ManagedOps; @@clientName(Microsoft.ManagedOps, "ManagedOpsMgmtClient", "python"); +@@clientName(ManagedOps, "ManagedOperations", "csharp"); +@@clientName(AzureMonitorInformation, + "ManagedOpsAzureMonitorInformation", + "csharp" +); +@@clientName(ChangeTrackingInformation, + "ManagedOpsChangeTrackingInformation", + "csharp" +); +@@clientName(EnablementState, "ManagedOpsEnablementStatus", "csharp"); +@@clientName(ProvisioningState, "ManagedOpsProvisioningState", "csharp"); +@@clientName(ServiceInformation, "ManagedOpsServiceInformation", "csharp"); +@@clientName(DesiredConfiguration, "ManagedOpsDesiredConfiguration", "csharp"); +@@clientName(DesiredConfigurationUpdate, + "ManagedOpsDesiredConfigurationUpdate", + "csharp" +); +@@clientName(DesiredEnablementState, + "ManagedOpsDesiredEnablementState", + "csharp" +); diff --git a/specification/managedoperations/ManagedOps.Management/managedOps.tsp b/specification/managedoperations/ManagedOps.Management/managedOps.tsp index 2364b60e2883..bccd26c39217 100644 --- a/specification/managedoperations/ManagedOps.Management/managedOps.tsp +++ b/specification/managedoperations/ManagedOps.Management/managedOps.tsp @@ -88,13 +88,22 @@ model PolicyAssignmentProperties { ]>; } -#suppress "@azure-tools/typespec-azure-core/no-unnamed-union" "Maintaining compatibility with current SDKs." -alias enablementState = - | "Enabled" - | "InProgress" - | "Failed" - | "Disabled" - | string; +@doc("The enablement state of a service.") +union EnablementState { + string, + + @doc("Service is enabled.") + Enabled: "Enabled", + + @doc("Service enablement is in progress.") + InProgress: "InProgress", + + @doc("Service enablement has failed.") + Failed: "Failed", + + @doc("Service is disabled.") + Disabled: "Disabled", +} @doc("Change Tracking and Inventory service information.") model ChangeTrackingInformation { @@ -106,7 +115,7 @@ model ChangeTrackingInformation { ]>; @doc("Indicates whether the service is enabled.") - enablementStatus: enablementState; + enablementStatus: EnablementState; } @doc("Azure Monitor Insights service information.") @@ -119,31 +128,31 @@ model AzureMonitorInformation { ]>; @doc("Indicates whether the service is enabled.") - enablementStatus: enablementState; + enablementStatus: EnablementState; } @doc("Azure Update Manager service information.") model UpdateManagerInformation { @doc("Indicates whether the service is enabled.") - enablementStatus: enablementState; + enablementStatus: EnablementState; } @doc("Azure Policy and Machine Configuration service information.") model GuestConfigurationInformation { @doc("Indicates whether the service is enabled.") - enablementStatus: enablementState; + enablementStatus: EnablementState; } @doc("Defender for Servers service information.") model DefenderForServersInformation { @doc("Indicates whether the service is enabled.") - enablementStatus: enablementState; + enablementStatus: EnablementState; } @doc("Defender Cloud Security Posture Management (CSPM) service information.") model DefenderCspmInformation { @doc("Indicates whether the service is enabled.") - enablementStatus: enablementState; + enablementStatus: EnablementState; } @doc("Specifies the service plan for this resource.") @@ -175,15 +184,23 @@ model DesiredConfiguration { @doc("Desired enablement state of the Defender For Servers service.") @visibility(Lifecycle.Read, Lifecycle.Update, Lifecycle.Create) - defenderForServers?: desiredEnablementState; + defenderForServers?: DesiredEnablementState; @doc("Desired enablement state of the Defender Cloud Security Posture Management (CSPM) service.") @visibility(Lifecycle.Read, Lifecycle.Update, Lifecycle.Create) - defenderCspm?: desiredEnablementState; + defenderCspm?: DesiredEnablementState; } -#suppress "@azure-tools/typespec-azure-core/no-unnamed-union" "Maintaining compatibility with current SDKs." -alias desiredEnablementState = "Enable" | "Disable" | string; +@doc("The desired enablement state of a service.") +union DesiredEnablementState { + string, + + @doc("Enable the service.") + Enable: "Enable", + + @doc("Disable the service.") + Disable: "Disable", +} @doc("Configuration for the Change Tracking and Inventory service.") model ChangeTrackingConfiguration { @@ -235,11 +252,11 @@ model ManagedOpUpdateProperties { model DesiredConfigurationUpdate { @doc("Desired enablement state of the Defender For Servers service.") @visibility(Lifecycle.Read, Lifecycle.Update, Lifecycle.Create) - defenderForServers?: desiredEnablementState; + defenderForServers?: DesiredEnablementState; @doc("Desired enablement state of the Defender Cloud Security Posture Management (CSPM) service.") @visibility(Lifecycle.Read, Lifecycle.Update, Lifecycle.Create) - defenderCspm?: desiredEnablementState; + defenderCspm?: DesiredEnablementState; } /** The operations that can be performed on our resource */ diff --git a/specification/managedoperations/resource-manager/Microsoft.ManagedOps/preview/2025-07-28-preview/managedops.json b/specification/managedoperations/resource-manager/Microsoft.ManagedOps/preview/2025-07-28-preview/managedops.json index e4cc4fc50cee..c52b811cf45f 100644 --- a/specification/managedoperations/resource-manager/Microsoft.ManagedOps/preview/2025-07-28-preview/managedops.json +++ b/specification/managedoperations/resource-manager/Microsoft.ManagedOps/preview/2025-07-28-preview/managedops.json @@ -404,17 +404,8 @@ } }, "enablementStatus": { - "type": "string", - "description": "Indicates whether the service is enabled.", - "enum": [ - "Enabled", - "InProgress", - "Failed", - "Disabled" - ], - "x-ms-enum": { - "modelAsString": true - } + "$ref": "#/definitions/EnablementState", + "description": "Indicates whether the service is enabled." } }, "required": [ @@ -460,17 +451,8 @@ } }, "enablementStatus": { - "type": "string", - "description": "Indicates whether the service is enabled.", - "enum": [ - "Enabled", - "InProgress", - "Failed", - "Disabled" - ], - "x-ms-enum": { - "modelAsString": true - } + "$ref": "#/definitions/EnablementState", + "description": "Indicates whether the service is enabled." } }, "required": [ @@ -483,17 +465,8 @@ "description": "Defender Cloud Security Posture Management (CSPM) service information.", "properties": { "enablementStatus": { - "type": "string", - "description": "Indicates whether the service is enabled.", - "enum": [ - "Enabled", - "InProgress", - "Failed", - "Disabled" - ], - "x-ms-enum": { - "modelAsString": true - } + "$ref": "#/definitions/EnablementState", + "description": "Indicates whether the service is enabled." } }, "required": [ @@ -505,17 +478,8 @@ "description": "Defender for Servers service information.", "properties": { "enablementStatus": { - "type": "string", - "description": "Indicates whether the service is enabled.", - "enum": [ - "Enabled", - "InProgress", - "Failed", - "Disabled" - ], - "x-ms-enum": { - "modelAsString": true - } + "$ref": "#/definitions/EnablementState", + "description": "Indicates whether the service is enabled." } }, "required": [ @@ -559,15 +523,8 @@ } }, "defenderForServers": { - "type": "string", + "$ref": "#/definitions/DesiredEnablementState", "description": "Desired enablement state of the Defender For Servers service.", - "enum": [ - "Enable", - "Disable" - ], - "x-ms-enum": { - "modelAsString": true - }, "x-ms-mutability": [ "read", "update", @@ -575,15 +532,8 @@ ] }, "defenderCspm": { - "type": "string", + "$ref": "#/definitions/DesiredEnablementState", "description": "Desired enablement state of the Defender Cloud Security Posture Management (CSPM) service.", - "enum": [ - "Enable", - "Disable" - ], - "x-ms-enum": { - "modelAsString": true - }, "x-ms-mutability": [ "read", "update", @@ -602,15 +552,8 @@ "description": "Updatable parameters in the Desired configuration input.", "properties": { "defenderForServers": { - "type": "string", + "$ref": "#/definitions/DesiredEnablementState", "description": "Desired enablement state of the Defender For Servers service.", - "enum": [ - "Enable", - "Disable" - ], - "x-ms-enum": { - "modelAsString": true - }, "x-ms-mutability": [ "read", "update", @@ -618,15 +561,8 @@ ] }, "defenderCspm": { - "type": "string", + "$ref": "#/definitions/DesiredEnablementState", "description": "Desired enablement state of the Defender Cloud Security Posture Management (CSPM) service.", - "enum": [ - "Enable", - "Disable" - ], - "x-ms-enum": { - "modelAsString": true - }, "x-ms-mutability": [ "read", "update", @@ -635,22 +571,73 @@ } } }, + "DesiredEnablementState": { + "type": "string", + "description": "The desired enablement state of a service.", + "enum": [ + "Enable", + "Disable" + ], + "x-ms-enum": { + "name": "DesiredEnablementState", + "modelAsString": true, + "values": [ + { + "name": "Enable", + "value": "Enable", + "description": "Enable the service." + }, + { + "name": "Disable", + "value": "Disable", + "description": "Disable the service." + } + ] + } + }, + "EnablementState": { + "type": "string", + "description": "The enablement state of a service.", + "enum": [ + "Enabled", + "InProgress", + "Failed", + "Disabled" + ], + "x-ms-enum": { + "name": "EnablementState", + "modelAsString": true, + "values": [ + { + "name": "Enabled", + "value": "Enabled", + "description": "Service is enabled." + }, + { + "name": "InProgress", + "value": "InProgress", + "description": "Service enablement is in progress." + }, + { + "name": "Failed", + "value": "Failed", + "description": "Service enablement has failed." + }, + { + "name": "Disabled", + "value": "Disabled", + "description": "Service is disabled." + } + ] + } + }, "GuestConfigurationInformation": { "type": "object", "description": "Azure Policy and Machine Configuration service information.", "properties": { "enablementStatus": { - "type": "string", - "description": "Indicates whether the service is enabled.", - "enum": [ - "Enabled", - "InProgress", - "Failed", - "Disabled" - ], - "x-ms-enum": { - "modelAsString": true - } + "$ref": "#/definitions/EnablementState", + "description": "Indicates whether the service is enabled." } }, "required": [ @@ -879,17 +866,8 @@ "description": "Azure Update Manager service information.", "properties": { "enablementStatus": { - "type": "string", - "description": "Indicates whether the service is enabled.", - "enum": [ - "Enabled", - "InProgress", - "Failed", - "Disabled" - ], - "x-ms-enum": { - "modelAsString": true - } + "$ref": "#/definitions/EnablementState", + "description": "Indicates whether the service is enabled." } }, "required": [