Skip to content

Commit

Permalink
tsp, avs, rename List API response schema back to ##List (Azure#29408)
Browse files Browse the repository at this point in the history
  • Loading branch information
weidongxu-microsoft authored Jun 14, 2024
1 parent 30c95a2 commit 2209f9b
Show file tree
Hide file tree
Showing 3 changed files with 379 additions and 291 deletions.
7 changes: 7 additions & 0 deletions specification/vmware/Microsoft.AVS/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -2224,3 +2224,10 @@ model ResourceSkuRequired {
@doc("The SKU (Stock Keeping Unit) assigned to this resource.")
sku: Foundations.Sku;
}

@doc("The response of a {name} list operation.", Resource)
@friendlyName(FriendlyNameFormat, Resource)
model ResourceList<
Resource extends Foundations.Resource,
FriendlyNameFormat extends valueof string = "{name}List"
> is Azure.Core.Page<Resource>;
129 changes: 105 additions & 24 deletions specification/vmware/Microsoft.AVS/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ interface Locations {
interface PrivateClouds {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("PrivateClouds_List")
list is ArmResourceListByParent<PrivateCloud>;
list is ArmResourceListByParent<
PrivateCloud,
Response = ArmResponse<ResourceList<PrivateCloud>>
>;

listInSubscription is ArmListBySubscription<PrivateCloud>;
listInSubscription is ArmListBySubscription<
PrivateCloud,
Response = ArmResponse<ResourceList<PrivateCloud>>
>;

get is ArmResourceRead<PrivateCloud>;

Expand Down Expand Up @@ -109,7 +115,10 @@ interface PrivateClouds {
interface Clusters {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("Clusters_List")
list is ArmResourceListByParent<Cluster>;
list is ArmResourceListByParent<
Cluster,
Response = ArmResponse<ResourceList<Cluster>>
>;

get is ArmResourceRead<Cluster>;

Expand Down Expand Up @@ -167,7 +176,10 @@ interface Clusters {
interface Datastores {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("Datastores_List")
list is ArmResourceListByParent<Datastore>;
list is ArmResourceListByParent<
Datastore,
Response = ArmResponse<ResourceList<Datastore>>
>;

get is ArmResourceRead<Datastore>;

Expand All @@ -192,7 +204,10 @@ interface Datastores {
interface HcxEnterpriseSites {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("HcxEnterpriseSites_List")
list is ArmResourceListByParent<HcxEnterpriseSite>;
list is ArmResourceListByParent<
HcxEnterpriseSite,
Response = ArmResponse<ResourceList<HcxEnterpriseSite>>
>;

get is ArmResourceRead<HcxEnterpriseSite>;

Expand All @@ -217,7 +232,10 @@ interface HcxEnterpriseSites {
interface Authorizations {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("Authorizations_List")
list is ArmResourceListByParent<ExpressRouteAuthorization>;
list is ArmResourceListByParent<
ExpressRouteAuthorization,
Response = ArmResponse<ResourceList<ExpressRouteAuthorization>>
>;

get is ArmResourceRead<ExpressRouteAuthorization>;

Expand Down Expand Up @@ -247,7 +265,10 @@ interface Authorizations {
interface GlobalReachConnections {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("GlobalReachConnections_List")
list is ArmResourceListByParent<GlobalReachConnection>;
list is ArmResourceListByParent<
GlobalReachConnection,
Response = ArmResponse<ResourceList<GlobalReachConnection>>
>;

get is ArmResourceRead<GlobalReachConnection>;

Expand Down Expand Up @@ -278,14 +299,20 @@ interface WorkloadNetworks {

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_List")
list is ArmResourceListByParent<WorkloadNetwork>;
list is ArmResourceListByParent<
WorkloadNetwork,
Response = ArmResponse<ResourceList<WorkloadNetwork>>
>;
}

@armResourceOperations
interface WorkloadNetworkSegments {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListSegments")
list is ArmResourceListByParent<WorkloadNetworkSegment>;
list is ArmResourceListByParent<
WorkloadNetworkSegment,
Response = ArmResponse<ResourceList<WorkloadNetworkSegment, "{name}sList">>
>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetSegment")
Expand Down Expand Up @@ -340,7 +367,10 @@ interface WorkloadNetworkSegments {
interface WorkloadNetworkDhcpConfigurations {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListDhcp")
list is ArmResourceListByParent<WorkloadNetworkDhcp>;
list is ArmResourceListByParent<
WorkloadNetworkDhcp,
Response = ArmResponse<ResourceList<WorkloadNetworkDhcp>>
>;

#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "DhcpIdParameter should be last, but it is breaking to correct it."
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
Expand Down Expand Up @@ -410,7 +440,10 @@ interface WorkloadNetworkDhcpConfigurations {
interface WorkloadNetworkGateways {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListGateways")
list is ArmResourceListByParent<WorkloadNetworkGateway>;
list is ArmResourceListByParent<
WorkloadNetworkGateway,
Response = ArmResponse<ResourceList<WorkloadNetworkGateway>>
>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetGateway")
Expand All @@ -424,7 +457,10 @@ interface WorkloadNetworkGateways {
interface WorkloadNetworkPortMirroringProfiles {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListPortMirroring")
list is ArmResourceListByParent<WorkloadNetworkPortMirroring>;
list is ArmResourceListByParent<
WorkloadNetworkPortMirroring,
Response = ArmResponse<ResourceList<WorkloadNetworkPortMirroring>>
>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetPortMirroring")
Expand Down Expand Up @@ -498,7 +534,10 @@ interface WorkloadNetworkPortMirroringProfiles {
interface WorkloadNetworkVmGroups {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListVMGroups")
list is ArmResourceListByParent<WorkloadNetworkVMGroup>;
list is ArmResourceListByParent<
WorkloadNetworkVMGroup,
Response = ArmResponse<ResourceList<WorkloadNetworkVMGroup, "{name}sList">>
>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetVMGroup")
Expand Down Expand Up @@ -570,7 +609,13 @@ interface WorkloadNetworkVmGroups {
interface WorkloadNetworkVirtualMachines {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListVirtualMachines")
list is ArmResourceListByParent<WorkloadNetworkVirtualMachine>;
list is ArmResourceListByParent<
WorkloadNetworkVirtualMachine,
Response = ArmResponse<ResourceList<
WorkloadNetworkVirtualMachine,
"{name}sList"
>>
>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetVirtualMachine")
Expand All @@ -584,7 +629,13 @@ interface WorkloadNetworkVirtualMachines {
interface WorkloadNetworkDnsServices {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListDnsServices")
list is ArmResourceListByParent<WorkloadNetworkDnsService>;
list is ArmResourceListByParent<
WorkloadNetworkDnsService,
Response = ArmResponse<ResourceList<
WorkloadNetworkDnsService,
"{name}sList"
>>
>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetDnsService")
Expand Down Expand Up @@ -658,7 +709,10 @@ interface WorkloadNetworkDnsServices {
interface WorkloadNetworkDnsZones {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListDnsZones")
list is ArmResourceListByParent<WorkloadNetworkDnsZone>;
list is ArmResourceListByParent<
WorkloadNetworkDnsZone,
Response = ArmResponse<ResourceList<WorkloadNetworkDnsZone, "{name}sList">>
>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetDnsZone")
Expand Down Expand Up @@ -731,7 +785,10 @@ interface WorkloadNetworkDnsZones {
interface WorkloadNetworkPublicIps {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListPublicIPs")
list is ArmResourceListByParent<WorkloadNetworkPublicIP>;
list is ArmResourceListByParent<
WorkloadNetworkPublicIP,
Response = ArmResponse<ResourceList<WorkloadNetworkPublicIP, "{name}sList">>
>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetPublicIP")
Expand Down Expand Up @@ -782,7 +839,10 @@ interface WorkloadNetworkPublicIps {
interface CloudLinks {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("CloudLinks_List")
list is ArmResourceListByParent<CloudLink>;
list is ArmResourceListByParent<
CloudLink,
Response = ArmResponse<ResourceList<CloudLink>>
>;

get is ArmResourceRead<CloudLink>;

Expand All @@ -807,7 +867,10 @@ interface CloudLinks {
interface Addons {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("Addons_List")
list is ArmResourceListByParent<Addon>;
list is ArmResourceListByParent<
Addon,
Response = ArmResponse<ResourceList<Addon>>
>;

get is ArmResourceRead<Addon>;

Expand All @@ -832,7 +895,10 @@ interface Addons {
interface VirtualMachines {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("VirtualMachines_List")
list is ArmResourceListByParent<VirtualMachine>;
list is ArmResourceListByParent<
VirtualMachine,
Response = ArmResponse<ResourceList<VirtualMachine, "{name}sList">>
>;

get is ArmResourceRead<VirtualMachine>;

Expand All @@ -854,7 +920,13 @@ interface VirtualMachines {
interface PlacementPolicies {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("PlacementPolicies_List")
list is ArmResourceListByParent<PlacementPolicy>;
list is ArmResourceListByParent<
PlacementPolicy,
Response = ArmResponse<ResourceList<
PlacementPolicy,
"PlacementPoliciesList"
>>
>;

get is ArmResourceRead<PlacementPolicy>;

Expand Down Expand Up @@ -910,7 +982,10 @@ interface PlacementPolicies {
interface ScriptPackages {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("ScriptPackages_List")
list is ArmResourceListByParent<ScriptPackage>;
list is ArmResourceListByParent<
ScriptPackage,
Response = ArmResponse<ResourceList<ScriptPackage, "{name}sList">>
>;

get is ArmResourceRead<ScriptPackage>;
}
Expand All @@ -919,7 +994,10 @@ interface ScriptPackages {
interface ScriptCmdlets {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("ScriptCmdlets_List")
list is ArmResourceListByParent<ScriptCmdlet>;
list is ArmResourceListByParent<
ScriptCmdlet,
Response = ArmResponse<ResourceList<ScriptCmdlet, "{name}sList">>
>;

get is ArmResourceRead<ScriptCmdlet>;
}
Expand All @@ -928,7 +1006,10 @@ interface ScriptCmdlets {
interface ScriptExecutions {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("ScriptExecutions_List")
list is ArmResourceListByParent<ScriptExecution>;
list is ArmResourceListByParent<
ScriptExecution,
Response = ArmResponse<ResourceList<ScriptExecution, "{name}sList">>
>;

get is ArmResourceRead<ScriptExecution>;

Expand Down
Loading

0 comments on commit 2209f9b

Please sign in to comment.