Skip to content

Commit

Permalink
[Azure Load Testing] Fixing Typespec for SDK Generation via DPG (Azur…
Browse files Browse the repository at this point in the history
…e#31083)

* Move client customizations to clients file

* Merge Administration and Run Client

---------

Co-authored-by: Harshan B <Harshan01@gmail.com>
  • Loading branch information
mitsha-microsoft and Harshan01 authored Oct 21, 2024
1 parent 3a16848 commit e65a1bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 9 additions & 2 deletions specification/loadtestservice/LoadTestService/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ using Microsoft.LoadTestService;
@useDependency(APIVersions.v2024_05_01_preview)
namespace Customizations;

// Client customizations should be kept in this file only and not in other files
// Model related customizations here (Ref: https://azure.github.io/typespec-azure/docs/howtos/DataPlane%20Generation%20-%20DPG/04renaming):
@@clientName(MetricDimensionsRequest.metricname, "metric_name", "python");
@@clientName(MetricDimensionsRequest.timespan, "time_interval", "python");

#suppress "@azure-tools/typespec-azure-core/use-standard-operations"
@client({
name: "LoadTestAdministrationClient",
Expand Down Expand Up @@ -58,8 +63,10 @@ interface TestRunOperations {
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
@client({
name: "TestProfileAdministrationClient",
name: "LoadTestAdministrationClient",
service: Microsoft.LoadTestService,
})
interface TestProfileAdministrationOperations {
Expand All @@ -70,7 +77,7 @@ interface TestProfileAdministrationOperations {
}

@client({
name: "TestProfileRunClient",
name: "LoadTestRunClient",
service: Microsoft.LoadTestService,
})
interface TestProfileRunOperations {
Expand Down
3 changes: 0 additions & 3 deletions specification/loadtestservice/LoadTestService/models.tsp
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import "@typespec/rest";
import "@typespec/http";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-client-generator-core";

using TypeSpec.Rest;
using TypeSpec.Http;
using TypeSpec.Versioning;
using Azure.ClientGenerator.Core;

namespace Microsoft.LoadTestService;

Expand Down Expand Up @@ -1127,7 +1125,6 @@ model MetricDimensionsRequest {
The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'.
""")
@query
@clientName("time_interval", "python")
timespan: string;
}

Expand Down

0 comments on commit e65a1bb

Please sign in to comment.