Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR @azure-rest/load-testing] Update TypeSpec to latest 2024-06 release - 0.57 & 0.43 #10319

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sdk/loadtesting/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.

trigger:
branches:
include:
Expand All @@ -19,6 +19,8 @@ pr:
- feature/*
- release/*
- hotfix/*
exclude:
- feature/v4
paths:
include:
- sdk/loadtesting/
Expand Down
25 changes: 19 additions & 6 deletions sdk/loadtesting/load-testing-rest/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./types/src/index.d.ts",
"docModel": { "enabled": true },
"apiReport": { "enabled": true, "reportFolder": "./review" },
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/load-testing.d.ts"
},
"messages": {
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": { "logLevel": "none" },
"ae-unresolved-link": { "logLevel": "none" }
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}
}
2 changes: 1 addition & 1 deletion sdk/loadtesting/load-testing-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@
"browser": {
"./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
}
}
}
1,935 changes: 992 additions & 943 deletions sdk/loadtesting/load-testing-rest/review/load-testing.api.md

Large diffs are not rendered by default.

38 changes: 23 additions & 15 deletions sdk/loadtesting/load-testing-rest/src/azureLoadTesting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,24 @@
// Licensed under the MIT license.

import { getClient, ClientOptions } from "@azure-rest/core-client";
import { logger } from "./logger.js";
import { TokenCredential } from "@azure/core-auth";
import { AzureLoadTestingClient } from "./clientDefinitions";
import { AzureLoadTestingClient } from "./clientDefinitions.js";

/**
* Initialize a new instance of the class AzureLoadTestingClient class.
* @param Endpoint type: string URL to perform data plane API operations on the resource.
* @param credentials type: TokenCredential
* Initialize a new instance of `AzureLoadTestingClient`
* @param endpointParam - A sequence of textual characters.
* @param credentials - uniquely identify client credential
* @param options - the parameter for all optional parameters
*/
export default function createClient(
Endpoint: string,
endpointParam: string,
credentials: TokenCredential,
options: ClientOptions = {},
): AzureLoadTestingClient {
const baseUrl = options.baseUrl ?? `https://${Endpoint}`;
options.apiVersion = options.apiVersion ?? "2022-11-01";
options = {
...options,
credentials: {
scopes: ["https://cnt-prod.loadtesting.azure.com/.default"],
},
};

const endpointUrl =
options.endpoint ?? options.baseUrl ?? `https://${endpointParam}`;
options.apiVersion = options.apiVersion ?? "2024-03-01-preview";
const userAgentInfo = `azsdk-js-load-testing-rest/1.0.1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -34,9 +30,21 @@ export default function createClient(
userAgentOptions: {
userAgentPrefix,
},
loggingOptions: {
logger: options.loggingOptions?.logger ?? logger.info,
},
credentials: {
scopes: options.credentials?.scopes ?? [
"https://cnt-prod.loadtesting.azure.com/.default",
],
},
};

const client = getClient(baseUrl, credentials, options) as AzureLoadTestingClient;
const client = getClient(
endpointUrl,
credentials,
options,
) as AzureLoadTestingClient;

return client;
}
Loading