diff --git a/.chronus/changes/fix-put-templ-2024-2-5-19-5-5.md b/.chronus/changes/fix-put-templ-2024-2-5-19-5-5.md new file mode 100644 index 0000000000..d806a88d8b --- /dev/null +++ b/.chronus/changes/fix-put-templ-2024-2-5-19-5-5.md @@ -0,0 +1,8 @@ +--- +# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking +changeKind: fix +packages: + - "@azure-tools/typespec-azure-resource-manager" +--- + +Fix for issue #254 cannot customize response in ARM PUT templates diff --git a/docs/libraries/azure-resource-manager/reference/interfaces.md b/docs/libraries/azure-resource-manager/reference/interfaces.md index 1f6b4e01f7..2347dd7fca 100644 --- a/docs/libraries/azure-resource-manager/reference/interfaces.md +++ b/docs/libraries/azure-resource-manager/reference/interfaces.md @@ -703,7 +703,7 @@ op Azure.ResourceManager.ArmResourceActionAsyncBase(provider: "Microsoft.ThisWil ### `ArmResourceActionNoContentAsync` {#Azure.ResourceManager.ArmResourceActionNoContentAsync} ```typespec -op Azure.ResourceManager.ArmResourceActionNoContentAsync(provider: "Microsoft.ThisWillBeReplaced", body: Request): Azure.ResourceManager.ArmAcceptedLroResponse<"Resource operation accepted.", Azure.ResourceManager.ArmLroLocationHeader, never, never>, void, string>> | Azure.ResourceManager.ArmNoContentResponse<"Action completed successfully."> | Error +op Azure.ResourceManager.ArmResourceActionNoContentAsync(provider: "Microsoft.ThisWillBeReplaced", body: Request): Azure.ResourceManager.ArmAcceptedLroResponse | Azure.ResourceManager.ArmNoContentResponse<"Action completed successfully."> | Error ``` #### Template Parameters @@ -792,7 +792,7 @@ op Azure.ResourceManager.ArmResourceCheckExistence(provider: "Microsoft.ThisWill ### `ArmResourceCreateOrReplaceAsync` {#Azure.ResourceManager.ArmResourceCreateOrReplaceAsync} ```typespec -op Azure.ResourceManager.ArmResourceCreateOrReplaceAsync(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Error +op Azure.ResourceManager.ArmResourceCreateOrReplaceAsync(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Response | Error ``` #### Template Parameters @@ -829,7 +829,7 @@ op Azure.ResourceManager.ArmResourceCreateOrReplaceSync(provider: "Microsoft.Thi A long-running resource CreateOrUpdate (PUT) ```typespec -op Azure.ResourceManager.ArmResourceCreateOrUpdateAsync(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Error +op Azure.ResourceManager.ArmResourceCreateOrUpdateAsync(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Response | Error ``` #### Template Parameters diff --git a/packages/typespec-azure-resource-manager/lib/operations.tsp b/packages/typespec-azure-resource-manager/lib/operations.tsp index 5d4f0e0106..7515e47ef8 100644 --- a/packages/typespec-azure-resource-manager/lib/operations.tsp +++ b/packages/typespec-azure-resource-manager/lib/operations.tsp @@ -164,7 +164,7 @@ op ArmResourceCreateOrUpdateAsync< > is ArmCreateOperation< ResourceInstanceParameters & Parameters, Resource, - ArmResourceUpdatedResponse | ArmResourceCreatedResponse, + Response, Error >; @@ -592,17 +592,16 @@ op ArmResourceActionNoContentAsync< Resource extends ArmResource, Request extends TypeSpec.Reflection.Model | void, BaseParameters extends TypeSpec.Reflection.Model = DefaultBaseParameters, - LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader< - Azure.Core.StatusMonitorPollingOptions, - void, - string - >, + LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader, Parameters extends {} = {}, Error extends {} = ErrorResponse > is ArmResourceActionAsyncBase< Resource, Request, - ArmAcceptedLroResponse | ArmNoContentResponse<"Action completed successfully.">, + ArmAcceptedLroResponse< + "Resource operation accepted.", + LroHeaders + > | ArmNoContentResponse<"Action completed successfully.">, BaseParameters, Parameters, Error