Skip to content

Commit

Permalink
CodeGen from PR 3168 in test-repo-billy/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge bd17a55da84491db851285461c49917f63d53fc2 into 67f4b5ff52fd6a0f6a4bfae872b3f16b31c25362
  • Loading branch information
SDKAuto committed Jan 8, 2024
1 parent ba8ca02 commit c4bcd0c
Show file tree
Hide file tree
Showing 20 changed files with 2,485 additions and 2,673 deletions.
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 @@ -134,4 +134,4 @@
"browser": {
"./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
}
}
}
1,822 changes: 880 additions & 942 deletions sdk/loadtesting/load-testing-rest/review/load-testing.api.md

Large diffs are not rendered by default.

27 changes: 19 additions & 8 deletions sdk/loadtesting/load-testing-rest/src/azureLoadTesting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,29 @@
// Licensed under the MIT license.

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

/**
* 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 endpoint - 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,
endpoint: string,
credentials: TokenCredential,
options: ClientOptions = {}
): AzureLoadTestingClient {
const baseUrl = options.baseUrl ?? `https://${Endpoint}`;
options.apiVersion = options.apiVersion ?? "2022-11-01";
const baseUrl = options.baseUrl ?? `https://${endpoint}`;
options.apiVersion = options.apiVersion ?? "2023-04-01-preview";
options = {
...options,
credentials: {
scopes: ["https://cnt-prod.loadtesting.azure.com/.default"],
scopes: options.credentials?.scopes ?? [
"https://cnt-prod.loadtesting.azure.com/.default",
],
},
};

Expand All @@ -34,9 +38,16 @@ export default function createClient(
userAgentOptions: {
userAgentPrefix,
},
loggingOptions: {
logger: options.loggingOptions?.logger ?? logger.info,
},
};

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

return client;
}
Loading

0 comments on commit c4bcd0c

Please sign in to comment.