Skip to content

Commit

Permalink
Fix the @bodyRoot nested with @body issue for workloads spec (#32700
Browse files Browse the repository at this point in the history
)

* fix generation issues for JS in Feb release cycle

* fix TypeSpec Validation

* update

* update

* update

* update

* update

* Update specification/databasewatcher/DatabaseWatcher.Management/tspconfig.yaml

* update

---------

Co-authored-by: Mary Gao <[email protected]>
Co-authored-by: Mike Harder <[email protected]>
Co-authored-by: Qiaoqiao Zhang <[email protected]>
  • Loading branch information
4 people authored Mar 7, 2025
1 parent 8a01684 commit af57dae
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,18 @@ interface SAPApplicationServerInstances {
/**
* Starts the SAP Application Server Instance.
*/
start is ArmResourceActionAsync<
start is CustomizedArmResourceActionAsync<
SAPApplicationServerInstance,
{
@doc("SAP Application server instance start request body.")
@body
body?: StartRequest;
},
StartRequest,
Foundations.OperationStatusResult
>;

/**
* Stops the SAP Application Server Instance.
*/
stop is ArmResourceActionAsync<
stop is CustomizedArmResourceActionAsync<
SAPApplicationServerInstance,
{
@doc("SAP Application server instance stop request body.")
@body
body?: StopRequest;
},
StopRequest,
Foundations.OperationStatusResult
>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,18 @@ interface SAPCentralServerInstances {
/**
* Starts the SAP Central Services Instance.
*/
start is ArmResourceActionAsync<
start is CustomizedArmResourceActionAsync<
SAPCentralServerInstance,
{
@doc("SAP Central Services instance start request body.")
@body
body?: StartRequest;
},
StartRequest,
Foundations.OperationStatusResult
>;

/**
* Stops the SAP Central Services Instance.
*/
stop is ArmResourceActionAsync<
stop is CustomizedArmResourceActionAsync<
SAPCentralServerInstance,
{
@doc("SAP Central Services instance stop request body.")
@body
body?: StopRequest;
},
StopRequest,
Foundations.OperationStatusResult
>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,18 @@ interface SAPDatabaseInstances {
/**
* Starts the database instance of the SAP system.
*/
start is ArmResourceActionAsync<
start is CustomizedArmResourceActionAsync<
SAPDatabaseInstance,
{
@doc("SAP Database server instance start request body.")
@body
body?: StartRequest;
},
StartRequest,
Foundations.OperationStatusResult
>;

/**
* Stops the database instance of the SAP system.
*/
stop is ArmResourceActionAsync<
stop is CustomizedArmResourceActionAsync<
SAPDatabaseInstance,
{
@doc("Stop request for the database instance of the SAP system.")
@body
body?: StopRequest;
},
StopRequest,
Foundations.OperationStatusResult
>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,18 @@ interface SAPVirtualInstances {
/**
* Starts the SAP application, that is the Central Services instance and Application server instances.
*/
start is ArmResourceActionAsync<
start is CustomizedArmResourceActionAsync<
SAPVirtualInstance,
{
@doc("The Virtual Instance for SAP solutions resource start request body.")
@body
body?: StartRequest;
},
StartRequest,
Foundations.OperationStatusResult
>;

/**
* Stops the SAP Application, that is the Application server instances and Central Services instance.
*/
stop is ArmResourceActionAsync<
stop is CustomizedArmResourceActionAsync<
SAPVirtualInstance,
{
@doc("The Virtual Instance for SAP solutions resource stop request body.")
@body
body?: StopRequest;
},
StopRequest,
Foundations.OperationStatusResult
>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,41 @@ op VirtualResourceActionSync<
@bodyRoot
body: Request,
): Response | Error;

/**
* @dev A long-running resource action.
* @template Resource The resource being acted upon
* @template Request The request model for the action
* @template Response The response model for the action
* @template BaseParameters Optional. Allows overriding the parameters for the operation
* @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
* @template Parameters Optional. Additional parameters after the path parameters
* @template Error Optional. The error response, if non-standard.
*/
#suppress "@azure-tools/typespec-azure-core/documentation-required" "template"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "template"
@returnsDoc("Azure operation completed successfully.")
@autoRoute
@armResourceAction(Resource)
@post
op CustomizedArmResourceActionAsync<
Resource extends Azure.ResourceManager.Foundations.Resource,
Request extends TypeSpec.Reflection.Model | void,
Response extends TypeSpec.Reflection.Model | void,
BaseParameters extends TypeSpec.Reflection.Model = Azure.ResourceManager.Foundations.DefaultBaseParameters<Resource>,
LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
Response,
string
> &
Azure.Core.Foundations.RetryAfterHeader,
Parameters extends {} = {},
Error extends {} = ErrorResponse
>(
...ResourceInstanceParameters<Resource, BaseParameters>,
...Parameters,
@bodyRoot body?: Request,
): ArmAcceptedLroResponse<
"Resource operation accepted.",
LroHeaders
> | Response | Error;

0 comments on commit af57dae

Please sign in to comment.