Skip to content
22 changes: 22 additions & 0 deletions specification/managedoperations/ManagedOps.Management/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -106,7 +115,7 @@ model ChangeTrackingInformation {
]>;

@doc("Indicates whether the service is enabled.")
enablementStatus: enablementState;
enablementStatus: EnablementState;
}

@doc("Azure Monitor Insights service information.")
Expand All @@ -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.")
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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": [
Expand All @@ -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": [
Expand All @@ -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": [
Expand Down Expand Up @@ -559,31 +523,17 @@
}
},
"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",
"create"
]
},
"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",
Expand All @@ -602,31 +552,17 @@
"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",
"create"
]
},
"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",
Expand All @@ -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": [
Expand Down Expand Up @@ -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": [
Expand Down
Loading