Skip to content

Commit

Permalink
[Azure Load Testing] Fix Client Generation for Consolidated Admin/Run…
Browse files Browse the repository at this point in the history
… Clients (#31920)

* Fixes to cllient.tsp for SDK Generation

* Another try

* Another try 2

* Re-merge interfaces and use recommended decorator
  • Loading branch information
mitsha-microsoft authored Dec 18, 2024
1 parent a3b0112 commit 416353c
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions specification/loadtestservice/LoadTestService/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "./main.tsp";
import "@azure-tools/typespec-client-generator-core";

using TypeSpec.Versioning;
using TypeSpec.Rest;
using Azure.ClientGenerator.Core;
using Microsoft.LoadTestService;

Expand Down Expand Up @@ -34,6 +35,11 @@ interface AdministrationOperations {
uploadTestFile is LoadTestAdministration.uploadTestFile;
deleteTestFile is LoadTestAdministration.deleteTestFile;
deleteTest is LoadTestAdministration.deleteTest;

createOrUpdateTestProfile is TestProfileAdministration.createOrUpdateTestProfile;
deleteTestProfile is TestProfileAdministration.deleteTestProfile;
getTestProfile is TestProfileAdministration.getTestProfile;
listTestProfiles is TestProfileAdministration.listTestProfiles;
}

#suppress "@azure-tools/typespec-azure-core/use-standard-operations"
Expand Down Expand Up @@ -63,32 +69,13 @@ interface TestRunOperations {
listTestRuns is LoadTestRun.listTestRuns;
@clientName("stopTestRun", "javascript,python,java,csharp,go")
stop is LoadTestRun.stop;
}

// NOTE: `LoadTestAdministrationClient` will contain all administration operations and `LoadTestRunClient` will contain all run based operations
// A separate interface is made to just segregate the operations by resource type
#suppress "@azure-tools/typespec-azure-core/use-standard-names" "Existing name"
@client({
name: "LoadTestAdministrationClient",
service: Microsoft.LoadTestService,
})
interface TestProfileAdministrationOperations {
createOrUpdateTestProfile is TestProfileAdministration.createOrUpdateTestProfile;
deleteTestProfile is TestProfileAdministration.deleteTestProfile;
getTestProfile is TestProfileAdministration.getTestProfile;
listTestProfiles is TestProfileAdministration.listTestProfiles;
}

#suppress "@azure-tools/typespec-azure-core/use-standard-names" "Existing name"
@client({
name: "LoadTestRunClient",
service: Microsoft.LoadTestService,
})
interface TestProfileRunOperations {
@clientName("BeginTestProfileRun", "python")
createOrUpdateTestProfileRun is TestProfileRunAdministration.createOrUpdateTestProfileRun;
deleteTestProfileRun is TestProfileRunAdministration.deleteTestProfileRun;
getTestProfileRun is TestProfileRunAdministration.getTestProfileRun;
listTestProfileRuns is TestProfileRunAdministration.listTestProfileRuns;
@clientName("stopTestProfileRun", "javascript,python,java,csharp,go")
stop is TestProfileRunAdministration.stop;
@action("stop")
stopTestProfileRun is TestProfileRunAdministration.stop;
}

0 comments on commit 416353c

Please sign in to comment.