diff --git a/specification/computeschedule/ComputeSchedule.Management/client.tsp b/specification/computeschedule/ComputeSchedule.Management/client.tsp index f92367c17dba..d8a451726e84 100644 --- a/specification/computeschedule/ComputeSchedule.Management/client.tsp +++ b/specification/computeschedule/ComputeSchedule.Management/client.tsp @@ -2,5 +2,80 @@ import "./main.tsp"; import "@azure-tools/typespec-client-generator-core"; using Azure.ClientGenerator.Core; +using Microsoft.ComputeSchedule; @@clientName(Microsoft.ComputeSchedule, "ComputeScheduleMgmt", "python"); + +@@clientName(ScheduledActions.virtualMachinesSubmitDeallocate, + "SubmitVirtualMachineDeallocate", + "csharp" +); +@@clientName(ScheduledActions.virtualMachinesSubmitHibernate, + "SubmitVirtualMachineHibernate", + "csharp" +); + +@@clientName(ScheduledActions.virtualMachinesSubmitStart, + "SubmitVirtualMachineStart", + "csharp" +); +@@clientName(ScheduledActions.virtualMachinesExecuteDeallocate, + "ExecuteVirtualMachineDeallocate", + "csharp" +); +@@clientName(ScheduledActions.virtualMachinesExecuteHibernate, + "ExecuteVirtualMachineHibernate", + "csharp" +); +@@clientName(ScheduledActions.virtualMachinesExecuteStart, + "ExecuteVirtualMachineStart", + "csharp" +); +@@clientName(ScheduledActions.virtualMachinesGetOperationStatus, + "GetVirtualMachineOperationStatus", + "csharp" +); +@@clientName(ScheduledActions.virtualMachinesCancelOperations, + "CancelVirtualMachineOperations", + "csharp" +); +@@clientName(ScheduledActions.virtualMachinesGetOperationErrors, + "GetVirtualMachineOperationErrors", + "csharp" +); + +@@clientName(CancelOperationsResponse, "CancelOperationsResult", "csharp"); +@@clientName(DeadlineType, "ScheduledActionDeadlineType", "csharp"); +@@clientName(DeallocateResourceOperationResponse, + "DeallocateResourceOperationResult", + "csharp" +); +@@clientName(DeallocateResourceOperationResponse.type, + "ResourceType", + "csharp" +); +@@clientName(ExecutionParameters, + "ScheduledActionExecutionParameterDetail", + "csharp" +); +@@clientName(GetOperationErrorsResponse, "GetOperationErrorsResult", "csharp"); +@@clientName(GetOperationStatusResponse, "GetOperationStatusResult", "csharp"); +@@clientName(HibernateResourceOperationResponse, + "HibernateResourceOperationResult", + "csharp" +); +@@clientName(HibernateResourceOperationResponse.type, "ResourceType", "csharp"); +@@clientName(OperationState, "ScheduledActionOperationState", "csharp"); +@@clientName(OptimizationPreference, + "ScheduledActionOptimizationPreference", + "csharp" +); +@@clientName(ResourceOperation, "ResourceOperationResult", "csharp"); +@@clientName(Resources, "UserRequestResources", "csharp"); +@@clientName(RetryPolicy, "UserRequestRetryPolicy", "csharp"); +@@clientName(Schedule, "UserRequestSchedule", "csharp"); +@@clientName(StartResourceOperationResponse, + "StartResourceOperationResult", + "csharp" +); +@@clientName(StartResourceOperationResponse.type, "ResourceType", "csharp"); diff --git a/specification/computeschedule/ComputeSchedule.Management/models.tsp b/specification/computeschedule/ComputeSchedule.Management/models.tsp index 164dd9a03641..a2b0ab895408 100644 --- a/specification/computeschedule/ComputeSchedule.Management/models.tsp +++ b/specification/computeschedule/ComputeSchedule.Management/models.tsp @@ -120,7 +120,7 @@ model Schedule { @doc("The resources needed for the user request") model Resources { @doc("The resource ids used for the request") - ids: Array; + ids: Array; } @doc("The retry policy for the user request") @@ -156,7 +156,7 @@ model ResourceOperationDetails { operationId: string; @doc("Unique identifier for the resource involved in the operation, eg ArmId") - resourceId: Azure.Core.armResourceIdentifier; + resourceId: armResourceIdentifier; @doc("Type of operation performed on the resources") opType: ResourceOperationType = ResourceOperationType.Unknown; @@ -191,7 +191,7 @@ model ResourceOperationDetails { @doc("High level response from an operation on a resource") model ResourceOperation { @doc("Unique identifier for the resource involved in the operation, eg ArmId") - resourceId?: Azure.Core.armResourceIdentifier; + resourceId?: armResourceIdentifier; @doc("Resource level error code if it exists") errorCode?: string; @@ -271,7 +271,7 @@ model DeallocateResourceOperationResponse { @doc("The location of the deallocate request eg westus") @visibility("read", "create") - location: string; + location: azureLocation; @extension("x-ms-identifiers", ["resourceId"]) @doc("The results from the deallocate request if no errors exist") @@ -304,7 +304,7 @@ model StartResourceOperationResponse { @doc("The location of the start request eg westus") @visibility("read", "create") - location: string; + location: azureLocation; @extension("x-ms-identifiers", ["resourceId"]) @doc("The results from the start request if no errors exist") @@ -337,7 +337,7 @@ model HibernateResourceOperationResponse { @doc("The location of the Hibernate request eg westus") @visibility("read", "create") - location: string; + location: azureLocation; @extension("x-ms-identifiers", ["resourceId"]) @doc("The results from the Hibernate request if no errors exist") diff --git a/specification/computeschedule/ComputeSchedule.Management/tspconfig.yaml b/specification/computeschedule/ComputeSchedule.Management/tspconfig.yaml index 713a5826ab6e..74029a03414b 100644 --- a/specification/computeschedule/ComputeSchedule.Management/tspconfig.yaml +++ b/specification/computeschedule/ComputeSchedule.Management/tspconfig.yaml @@ -15,6 +15,11 @@ options: generate-test: true generate-sample: true examples-dir: "{project-root}/examples" + "@azure-tools/typespec-csharp": + package-dir: "Azure.ResourceManager.ComputeSchedule" + flavor: azure + clear-output-folder: true + namespace: "{package-dir}" linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/computeschedule.json b/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/computeschedule.json index e23760f86190..b55ad7f312ce 100644 --- a/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/computeschedule.json +++ b/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/computeschedule.json @@ -562,6 +562,10 @@ } }, "definitions": { + "Azure.Core.azureLocation": { + "type": "string", + "description": "Represents an Azure geography region where supported resource providers live." + }, "CancelOperationsRequest": { "type": "object", "description": "This is the request to cancel running operations in scheduled actions using the operation ids", @@ -645,7 +649,7 @@ "description": "The type of resources used in the deallocate request eg virtual machines" }, "location": { - "type": "string", + "$ref": "#/definitions/Azure.Core.azureLocation", "description": "The location of the deallocate request eg westus", "x-ms-mutability": [ "read", @@ -840,7 +844,7 @@ "description": "The type of resources used in the Hibernate request eg virtual machines" }, "location": { - "type": "string", + "$ref": "#/definitions/Azure.Core.azureLocation", "description": "The location of the Hibernate request eg westus", "x-ms-mutability": [ "read", @@ -1391,7 +1395,7 @@ "description": "The type of resources used in the start request eg virtual machines" }, "location": { - "type": "string", + "$ref": "#/definitions/Azure.Core.azureLocation", "description": "The location of the start request eg westus", "x-ms-mutability": [ "read",