You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reproduce (the LRO op defined as response of 202 without body; and the metadata of LRO contains the body for final result)
For standard template, it would have a 200 with body of final result.
import "@typespec/http";
import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@azure-tools/typespec-client-generator-core";
using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.Core;
using Azure.ResourceManager;
using Azure.ClientGenerator.Core;
using Azure.ClientGenerator.Core.Legacy;
@armProviderNamespace
@service(#{ title: "ArmResource" })
@versioned(Versions)
@doc("Arm Resource Provider management API.")
namespace TspTest.ArmResourceProvider;
@doc("Azure API versions.")
enum Versions {
@doc("Preview API version 2022-06-01-preview.")
v2022_06_01_preview: "2022-06-01-preview",
@doc("Preview API version 2022-09-01-preview.")
v2022_09_01_preview: "2022-09-01-preview",
@doc("Public API version.")
v2023_11_01: "2023-11-01",
@doc("Preview API version 2023-12-01-preview.")
v2023_12_01_preview: "2023-12-01-preview",
}
//----------------------- Top Level Arm Resource -----------------------
@resource("topLevelArmResources")
model TopLevelArmResource is TrackedResource<TopLevelArmResourceProperties> {
@key("topLevelArmResourceName")
@path
@segment("topLevelArmResources")
@doc("arm resource name for path")
@pattern("^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$")
name: string;
}
@doc("Top Level Arm Resource Properties.")
model TopLevelArmResourceProperties {
@doc("Configuration Endpoints.")
@visibility(Lifecycle.Read)
configurationEndpoints?: string[];
userName: string; // this should be renamed to username
userNames: string; // this isn't a whole word match, shouldn't be renamed to usernames
accuserName: string; // this isn't a whole word match, shouldn't be renamed to accusername
}
@armResourceOperations
interface AdministratorMicrosoftEntras {
/**
* Creates a new server administrator associated to a Microsoft Entra principal.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@Azure.Core.useFinalStateVia("azure-async-operation")
@put
createOrUpdate is Azure.ResourceManager.Legacy.CreateOrReplaceAsync<
TopLevelArmResource,
Request = TopLevelArmResource,
Response = ArmAcceptedLroResponse<LroHeaders = ArmCombinedLroHeaders<FinalResult = TopLevelArmResource> &
Azure.Core.Foundations.RetryAfterHeader>
>;
}
service Azure/azure-rest-api-specs#36556
Reproduce (the LRO op defined as response of 202 without body; and the metadata of LRO contains the body for final result)
For standard template, it would have a 200 with body of final result.