diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index c3c5bc227ce9..37dacde2d9d8 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -126,6 +126,7 @@ specifiers: '@rush-temp/arm-privatedns': file:./projects/arm-privatedns.tgz '@rush-temp/arm-purview': file:./projects/arm-purview.tgz '@rush-temp/arm-quota': file:./projects/arm-quota.tgz + '@rush-temp/arm-recommendationsservice': file:./projects/arm-recommendationsservice.tgz '@rush-temp/arm-recoveryservices': file:./projects/arm-recoveryservices.tgz '@rush-temp/arm-recoveryservices-siterecovery': file:./projects/arm-recoveryservices-siterecovery.tgz '@rush-temp/arm-recoveryservicesbackup': file:./projects/arm-recoveryservicesbackup.tgz @@ -398,6 +399,7 @@ dependencies: '@rush-temp/arm-privatedns': file:projects/arm-privatedns.tgz '@rush-temp/arm-purview': file:projects/arm-purview.tgz '@rush-temp/arm-quota': file:projects/arm-quota.tgz + '@rush-temp/arm-recommendationsservice': file:projects/arm-recommendationsservice.tgz '@rush-temp/arm-recoveryservices': file:projects/arm-recoveryservices.tgz '@rush-temp/arm-recoveryservices-siterecovery': file:projects/arm-recoveryservices-siterecovery.tgz '@rush-temp/arm-recoveryservicesbackup': file:projects/arm-recoveryservicesbackup.tgz @@ -9114,19 +9116,19 @@ packages: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.4 - '@rollup/plugin-commonjs': 21.0.1_rollup@2.67.1 - '@rollup/plugin-json': 4.1.0_rollup@2.67.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.67.1 - '@rollup/plugin-node-resolve': 13.1.3_rollup@2.67.1 + '@rollup/plugin-commonjs': 21.0.2_rollup@2.70.1 + '@rollup/plugin-json': 4.1.0_rollup@2.70.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 + '@rollup/plugin-node-resolve': 13.1.3_rollup@2.70.1 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 2.67.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.67.1 + rollup: 2.70.1 + rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1 tslib: 2.3.1 typescript: 4.2.4 - uglify-js: 3.15.1 + uglify-js: 3.15.3 transitivePeerDependencies: - '@types/node' - debug @@ -12208,6 +12210,33 @@ packages: - supports-color dev: false + file:projects/arm-recommendationsservice.tgz: + resolution: {integrity: sha512-zMOVU00VKJX8WkQ+zMC+f3emQjlnqvM5QhJMdkSzD9690adUIBb/UIpWrqlVze+7CUi6o7MCg24YTT9KmBemTg==, tarball: file:projects/arm-recommendationsservice.tgz} + name: '@rush-temp/arm-recommendationsservice' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@azure/identity': 2.0.4 + '@microsoft/api-extractor': 7.19.4 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.15.3 + transitivePeerDependencies: + - debug + - encoding + - supports-color + dev: false + file:projects/arm-recoveryservices-siterecovery.tgz: resolution: {integrity: sha512-SzNg57gvadtpR9EkL91zKjA/VLpFCWJLG9onbdR1vP56rpITe8A2x6VAeRsOKoYOrY5ipqVRPxxaXAMWHvlZZA==, tarball: file:projects/arm-recoveryservices-siterecovery.tgz} name: '@rush-temp/arm-recoveryservices-siterecovery' diff --git a/rush.json b/rush.json index e98c45a12572..4a86bc954b59 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ { + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -1670,6 +1670,11 @@ "packageName": "@azure/arm-app", "projectFolder": "sdk/app/arm-app", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-recommendationsservice", + "projectFolder": "sdk/recommendationsservice/arm-recommendationsservice", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/recommendationsservice/arm-recommendationsservice/CHANGELOG.md b/sdk/recommendationsservice/arm-recommendationsservice/CHANGELOG.md new file mode 100644 index 000000000000..2f3c7ea3a3ec --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0 (2022-03-24) + +The package of @azure/arm-recommendationsservice is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/recommendationsservice/arm-recommendationsservice/LICENSE b/sdk/recommendationsservice/arm-recommendationsservice/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/recommendationsservice/arm-recommendationsservice/README.md b/sdk/recommendationsservice/arm-recommendationsservice/README.md new file mode 100644 index 000000000000..2083bb0f8412 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/README.md @@ -0,0 +1,98 @@ +# Azure Service client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. + +Dynamics 365 Recommendations Service resource provider + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/recommendationsservice/arm-recommendationsservice) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-recommendationsservice) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-recommendationsservice) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-recommendationsservice` package + +Install the Azure Service client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-recommendationsservice +``` + +### Create and authenticate a `RecommendationsService` + +To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { RecommendationsService } = require("@azure/arm-recommendationsservice"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new RecommendationsService(new DefaultAzureCredential(), subscriptionId); +``` + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### RecommendationsService + +`RecommendationsService` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Frecommendationsservice%2Farm-recommendationsservice%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/recommendationsservice/arm-recommendationsservice/_meta.json b/sdk/recommendationsservice/arm-recommendationsservice/_meta.json new file mode 100644 index 000000000000..4d701e13f9a4 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "e0249c9945c29948111754f800eaa88f46a79254", + "readme": "specification/recommendationsservice/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/recommendationsservice/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.2.1", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" +} \ No newline at end of file diff --git a/sdk/recommendationsservice/arm-recommendationsservice/api-extractor.json b/sdk/recommendationsservice/arm-recommendationsservice/api-extractor.json new file mode 100644 index 000000000000..e8a6593d9ced --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-recommendationsservice.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/recommendationsservice/arm-recommendationsservice/package.json b/sdk/recommendationsservice/arm-recommendationsservice/package.json new file mode 100644 index 000000000000..b96bc325cea5 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/package.json @@ -0,0 +1,102 @@ +{ + "name": "@azure/arm-recommendationsservice", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for RecommendationsService.", + "version": "1.0.0", + "engines": { + "node": ">=12.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-recommendationsservice.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/recommendationsservice/arm-recommendationsservice", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "LICENSE", + "rollup.config.js", + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" + }, + "sideEffects": false, + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/recommendationsservice/arm-recommendationsservice/review/arm-recommendationsservice.api.md b/sdk/recommendationsservice/arm-recommendationsservice/review/arm-recommendationsservice.api.md new file mode 100644 index 000000000000..37f83db458d4 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/review/arm-recommendationsservice.api.md @@ -0,0 +1,614 @@ +## API Report File for "@azure/arm-recommendationsservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type AccountConfiguration = string; + +// @public +export interface AccountPatchResource { + properties?: AccountPatchResourceProperties; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface AccountPatchResourceProperties { + cors?: CorsRule[]; + endpointAuthentications?: EndpointAuthentication[]; + reportsConnectionString?: string; +} + +// @public +export type AccountResource = TrackedResource & { + properties?: AccountResourceProperties; + readonly systemData?: SystemData; +}; + +// @public +export interface AccountResourceList { + nextLink?: string; + value?: AccountResource[]; +} + +// @public +export interface AccountResourceProperties { + configuration?: AccountConfiguration; + cors?: CorsRule[]; + endpointAuthentications?: EndpointAuthentication[]; + readonly provisioningState?: string; + reportsConnectionString?: string; +} + +// @public +export interface Accounts { + beginCreateOrUpdate(resourceGroupName: string, accountName: string, body: AccountResource, options?: AccountsCreateOrUpdateOptionalParams): Promise, AccountsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, body: AccountResource, options?: AccountsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, accountName: string, body: AccountPatchResource, options?: AccountsUpdateOptionalParams): Promise, AccountsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, accountName: string, body: AccountPatchResource, options?: AccountsUpdateOptionalParams): Promise; + checkNameAvailability(body: CheckNameAvailabilityRequest, options?: AccountsCheckNameAvailabilityOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, options?: AccountsGetOptionalParams): Promise; + getStatus(resourceGroupName: string, accountName: string, options?: AccountsGetStatusOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: AccountsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: AccountsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AccountsCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsCheckNameAvailabilityResponse = CheckNameAvailabilityResponse; + +// @public +export interface AccountsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AccountsCreateOrUpdateResponse = AccountResource; + +// @public +export interface AccountsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface AccountsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsGetResponse = AccountResource; + +// @public +export interface AccountsGetStatusOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsGetStatusResponse = AccountStatus; + +// @public +export interface AccountsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsListByResourceGroupNextResponse = AccountResourceList; + +// @public +export interface AccountsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsListByResourceGroupResponse = AccountResourceList; + +// @public +export interface AccountsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsListBySubscriptionNextResponse = AccountResourceList; + +// @public +export interface AccountsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsListBySubscriptionResponse = AccountResourceList; + +// @public +export interface AccountStatus { + scopesStatuses?: ScopeStatuses[]; +} + +// @public +export interface AccountsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AccountsUpdateResponse = AccountResource; + +// @public +export type ActionType = string; + +// @public +export type CheckNameAvailabilityReason = string; + +// @public +export interface CheckNameAvailabilityRequest { + name?: string; + type?: string; +} + +// @public +export interface CheckNameAvailabilityResponse { + message?: string; + nameAvailable?: boolean; + reason?: CheckNameAvailabilityReason; +} + +// @public +export interface CorsRule { + allowedHeaders?: string[]; + allowedMethods?: string[]; + allowedOrigins: string[]; + exposedHeaders?: string[]; + maxAgeInSeconds?: number; +} + +// @public +export type CreatedByType = string; + +// @public +export interface EndpointAuthentication { + aadTenantID?: string; + principalID?: string; + principalType?: PrincipalType; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export enum KnownAccountConfiguration { + // (undocumented) + Capacity = "Capacity", + // (undocumented) + Free = "Free" +} + +// @public +export enum KnownActionType { + // (undocumented) + Internal = "Internal" +} + +// @public +export enum KnownCheckNameAvailabilityReason { + // (undocumented) + AlreadyExists = "AlreadyExists", + // (undocumented) + Invalid = "Invalid" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownModelingFeatures { + // (undocumented) + Basic = "Basic", + // (undocumented) + Premium = "Premium", + // (undocumented) + Standard = "Standard" +} + +// @public +export enum KnownModelingFrequency { + // (undocumented) + High = "High", + // (undocumented) + Low = "Low", + // (undocumented) + Medium = "Medium" +} + +// @public +export enum KnownModelingSize { + // (undocumented) + Large = "Large", + // (undocumented) + Medium = "Medium", + // (undocumented) + Small = "Small" +} + +// @public +export enum KnownOrigin { + // (undocumented) + System = "system", + // (undocumented) + User = "user", + // (undocumented) + UserSystem = "user,system" +} + +// @public +export enum KnownPrincipalType { + // (undocumented) + Application = "Application", + // (undocumented) + User = "User" +} + +// @public +export interface Modeling { + beginCreateOrUpdate(resourceGroupName: string, accountName: string, modelingName: string, body: ModelingResource, options?: ModelingCreateOrUpdateOptionalParams): Promise, ModelingCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, modelingName: string, body: ModelingResource, options?: ModelingCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, accountName: string, modelingName: string, options?: ModelingDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, modelingName: string, options?: ModelingDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, accountName: string, modelingName: string, body: ModelingPatchResource, options?: ModelingUpdateOptionalParams): Promise, ModelingUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, accountName: string, modelingName: string, body: ModelingPatchResource, options?: ModelingUpdateOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, modelingName: string, options?: ModelingGetOptionalParams): Promise; + listByAccountResource(resourceGroupName: string, accountName: string, options?: ModelingListByAccountResourceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ModelingCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ModelingCreateOrUpdateResponse = ModelingResource; + +// @public +export interface ModelingDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ModelingFeatures = string; + +// @public +export type ModelingFrequency = string; + +// @public +export interface ModelingGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ModelingGetResponse = ModelingResource; + +// @public +export interface ModelingInputData { + connectionString?: string; +} + +// @public +export interface ModelingListByAccountResourceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ModelingListByAccountResourceNextResponse = ModelingResourceList; + +// @public +export interface ModelingListByAccountResourceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ModelingListByAccountResourceResponse = ModelingResourceList; + +// @public +export interface ModelingPatchResource { + properties?: ModelingPatchResourceProperties; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface ModelingPatchResourceProperties { + inputData?: ModelingInputData; +} + +// @public +export type ModelingResource = TrackedResource & { + properties?: ModelingResourceProperties; + readonly systemData?: SystemData; +}; + +// @public +export interface ModelingResourceList { + nextLink?: string; + value?: ModelingResource[]; +} + +// @public +export interface ModelingResourceProperties { + features?: ModelingFeatures; + frequency?: ModelingFrequency; + inputData?: ModelingInputData; + readonly provisioningState?: string; + size?: ModelingSize; +} + +// @public +export type ModelingSize = string; + +// @public +export interface ModelingUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ModelingUpdateResponse = ModelingResource; + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export interface OperationStatuses { + get(location: string, operationId: string, options?: OperationStatusesGetOptionalParams): Promise; +} + +// @public +export interface OperationStatusesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationStatusesGetResponse = OperationStatusResult; + +// @public +export interface OperationStatusResult { + endTime?: Date; + error?: ErrorDetail; + id?: string; + name?: string; + operations?: OperationStatusResult[]; + percentComplete?: number; + startTime?: Date; + status: string; +} + +// @public +export type Origin = string; + +// @public +export type PrincipalType = string; + +// @public (undocumented) +export class RecommendationsService extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: RecommendationsServiceOptionalParams); + // (undocumented) + accounts: Accounts; + // (undocumented) + apiVersion: string; + // (undocumented) + modeling: Modeling; + // (undocumented) + operations: Operations; + // (undocumented) + operationStatuses: OperationStatuses; + // (undocumented) + serviceEndpoints: ServiceEndpoints; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface RecommendationsServiceOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ScopeStatuses { + scope?: string; + statuses?: StageStatus[]; +} + +// @public +export interface ServiceEndpointPatchResource { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type ServiceEndpointResource = TrackedResource & { + properties?: ServiceEndpointResourceProperties; + readonly systemData?: SystemData; +}; + +// @public +export interface ServiceEndpointResourceList { + nextLink?: string; + value?: ServiceEndpointResource[]; +} + +// @public +export interface ServiceEndpointResourceProperties { + readonly pairedLocation?: string; + preAllocatedCapacity?: number; + readonly provisioningState?: string; + readonly url?: string; +} + +// @public +export interface ServiceEndpoints { + beginCreateOrUpdate(resourceGroupName: string, accountName: string, serviceEndpointName: string, body: ServiceEndpointResource, options?: ServiceEndpointsCreateOrUpdateOptionalParams): Promise, ServiceEndpointsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, serviceEndpointName: string, body: ServiceEndpointResource, options?: ServiceEndpointsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, accountName: string, serviceEndpointName: string, options?: ServiceEndpointsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, serviceEndpointName: string, options?: ServiceEndpointsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, accountName: string, serviceEndpointName: string, body: ServiceEndpointPatchResource, options?: ServiceEndpointsUpdateOptionalParams): Promise, ServiceEndpointsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, accountName: string, serviceEndpointName: string, body: ServiceEndpointPatchResource, options?: ServiceEndpointsUpdateOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, serviceEndpointName: string, options?: ServiceEndpointsGetOptionalParams): Promise; + listByAccountResource(resourceGroupName: string, accountName: string, options?: ServiceEndpointsListByAccountResourceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ServiceEndpointsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ServiceEndpointsCreateOrUpdateResponse = ServiceEndpointResource; + +// @public +export interface ServiceEndpointsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ServiceEndpointsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServiceEndpointsGetResponse = ServiceEndpointResource; + +// @public +export interface ServiceEndpointsListByAccountResourceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServiceEndpointsListByAccountResourceNextResponse = ServiceEndpointResourceList; + +// @public +export interface ServiceEndpointsListByAccountResourceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServiceEndpointsListByAccountResourceResponse = ServiceEndpointResourceList; + +// @public +export interface ServiceEndpointsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ServiceEndpointsUpdateResponse = ServiceEndpointResource; + +// @public +export interface StageStatus { + stage?: string; + status?: string; + time?: Date; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/recommendationsservice/arm-recommendationsservice/rollup.config.js b/sdk/recommendationsservice/arm-recommendationsservice/rollup.config.js new file mode 100644 index 000000000000..9be1955eb7f1 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/rollup.config.js @@ -0,0 +1,188 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false +}; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/index.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/index.ts new file mode 100644 index 000000000000..4040997d1932 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { RecommendationsService } from "./recommendationsService"; +export * from "./operationsInterfaces"; diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/lroImpl.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/models/index.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/models/index.ts new file mode 100644 index 000000000000..cd835386bcd6 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/models/index.ts @@ -0,0 +1,783 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +/** The check availability request body. */ +export interface CheckNameAvailabilityRequest { + /** The name of the resource for which availability needs to be checked. */ + name?: string; + /** The resource type. */ + type?: string; +} + +/** The check availability result. */ +export interface CheckNameAvailabilityResponse { + /** Indicates if the resource name is available. */ + nameAvailable?: boolean; + /** The reason why the given name is not available. */ + reason?: CheckNameAvailabilityReason; + /** Detailed reason why the given name is available. */ + message?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** The list of RecommendationsService Account resources. */ +export interface AccountResourceList { + /** The link used to get the next page of RecommendationsService Account resources list. */ + nextLink?: string; + /** The list of RecommendationsService Account resources. */ + value?: AccountResource[]; +} + +/** Account resource properties. */ +export interface AccountResourceProperties { + /** Account configuration. This can only be set at RecommendationsService Account creation. */ + configuration?: AccountConfiguration; + /** The list of service endpoints authentication details. */ + endpointAuthentications?: EndpointAuthentication[]; + /** The list of CORS details. */ + cors?: CorsRule[]; + /** Connection string to write Accounts reports to. */ + reportsConnectionString?: string; + /** + * The resource provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** Service endpoints authentication details. */ +export interface EndpointAuthentication { + /** AAD tenant ID. */ + aadTenantID?: string; + /** AAD principal ID. */ + principalID?: string; + /** AAD principal type. */ + principalType?: PrincipalType; +} + +/** CORS details. */ +export interface CorsRule { + /** The origin domains that are permitted to make a request against the service via CORS. */ + allowedOrigins: string[]; + /** The methods (HTTP request verbs) that the origin domain may use for a CORS request. */ + allowedMethods?: string[]; + /** The request headers that the origin domain may specify on the CORS request. */ + allowedHeaders?: string[]; + /** The response headers to expose to CORS clients. */ + exposedHeaders?: string[]; + /** The number of seconds that the client/browser should cache a preflight response. */ + maxAgeInSeconds?: number; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** Account resource patch details. */ +export interface AccountPatchResource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Account resource patch properties. */ + properties?: AccountPatchResourceProperties; +} + +/** Account resource patch properties. */ +export interface AccountPatchResourceProperties { + /** The list of service endpoints authentication details. */ + endpointAuthentications?: EndpointAuthentication[]; + /** The list of CORS details. */ + cors?: CorsRule[]; + /** Connection string to write Accounts reports to. */ + reportsConnectionString?: string; +} + +/** Account status. */ +export interface AccountStatus { + /** The list of scopes statuses. */ + scopesStatuses?: ScopeStatuses[]; +} + +/** Scope statuses. */ +export interface ScopeStatuses { + /** The scope that the statuses refers to. */ + scope?: string; + /** Scope stage statuses. */ + statuses?: StageStatus[]; +} + +/** Stage status. */ +export interface StageStatus { + /** The stage name. */ + stage?: string; + /** The status of the stage. */ + status?: string; + /** The time of the status. */ + time?: Date; +} + +/** The list of Modeling resources. */ +export interface ModelingResourceList { + /** The link used to get the next page of Modeling resources list. */ + nextLink?: string; + /** The list of Modeling resources. */ + value?: ModelingResource[]; +} + +/** Modeling resource properties. */ +export interface ModelingResourceProperties { + /** Modeling features controls the set of supported scenarios\models being computed. This can only be set at Modeling creation. */ + features?: ModelingFeatures; + /** Modeling frequency controls the modeling compute frequency. */ + frequency?: ModelingFrequency; + /** Modeling size controls the maximum supported input data size. */ + size?: ModelingSize; + /** The configuration to raw CDM data to be used as Modeling resource input. */ + inputData?: ModelingInputData; + /** + * The resource provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** The configuration to raw CDM data to be used as Modeling resource input. */ +export interface ModelingInputData { + /** Connection string to raw input data. */ + connectionString?: string; +} + +/** Modeling resource patch details. */ +export interface ModelingPatchResource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Modeling resource properties to update. */ + properties?: ModelingPatchResourceProperties; +} + +/** Modeling resource properties to update. */ +export interface ModelingPatchResourceProperties { + /** The configuration to raw CDM data to be used as Modeling resource input. */ + inputData?: ModelingInputData; +} + +/** The list of ServiceEndpoint resources. */ +export interface ServiceEndpointResourceList { + /** The link used to get the next page of ServiceEndpoint resources list. */ + nextLink?: string; + /** The list of ServiceEndpoint resources. */ + value?: ServiceEndpointResource[]; +} + +/** ServiceEndpoint resource properties. */ +export interface ServiceEndpointResourceProperties { + /** ServiceEndpoint pre-allocated capacity controls the maximum requests-per-second allowed for that endpoint. Only applicable when Account configuration is Capacity. */ + preAllocatedCapacity?: number; + /** + * The paired location that will be used by this ServiceEndpoint. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly pairedLocation?: string; + /** + * The URL where the ServiceEndpoint API is accessible at. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly url?: string; + /** + * The resource provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** ServiceEndpoint resource patch details. */ +export interface ServiceEndpointPatchResource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** The current status of an async operation. */ +export interface OperationStatusResult { + /** Fully qualified ID for the async operation. */ + id?: string; + /** Name of the async operation. */ + name?: string; + /** Operation status. */ + status: string; + /** Percent of the operation that is complete. */ + percentComplete?: number; + /** The start time of the operation. */ + startTime?: Date; + /** The end time of the operation. */ + endTime?: Date; + /** The operations list. */ + operations?: OperationStatusResult[]; + /** If present, details of the operation error. */ + error?: ErrorDetail; +} + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +}; + +/** Account resource details. */ +export type AccountResource = TrackedResource & { + /** Account resource properties. */ + properties?: AccountResourceProperties; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +}; + +/** Modeling resource details. */ +export type ModelingResource = TrackedResource & { + /** Modeling resource properties. */ + properties?: ModelingResourceProperties; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +}; + +/** ServiceEndpoint resource details. */ +export type ServiceEndpointResource = TrackedResource & { + /** ServiceEndpoint resource properties. */ + properties?: ServiceEndpointResourceProperties; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +}; + +/** Known values of {@link CheckNameAvailabilityReason} that the service accepts. */ +export enum KnownCheckNameAvailabilityReason { + Invalid = "Invalid", + AlreadyExists = "AlreadyExists" +} + +/** + * Defines values for CheckNameAvailabilityReason. \ + * {@link KnownCheckNameAvailabilityReason} can be used interchangeably with CheckNameAvailabilityReason, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **AlreadyExists** + */ +export type CheckNameAvailabilityReason = string; + +/** Known values of {@link AccountConfiguration} that the service accepts. */ +export enum KnownAccountConfiguration { + Free = "Free", + Capacity = "Capacity" +} + +/** + * Defines values for AccountConfiguration. \ + * {@link KnownAccountConfiguration} can be used interchangeably with AccountConfiguration, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Free** \ + * **Capacity** + */ +export type AccountConfiguration = string; + +/** Known values of {@link PrincipalType} that the service accepts. */ +export enum KnownPrincipalType { + Application = "Application", + User = "User" +} + +/** + * Defines values for PrincipalType. \ + * {@link KnownPrincipalType} can be used interchangeably with PrincipalType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Application** \ + * **User** + */ +export type PrincipalType = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link ModelingFeatures} that the service accepts. */ +export enum KnownModelingFeatures { + Basic = "Basic", + Standard = "Standard", + Premium = "Premium" +} + +/** + * Defines values for ModelingFeatures. \ + * {@link KnownModelingFeatures} can be used interchangeably with ModelingFeatures, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Basic** \ + * **Standard** \ + * **Premium** + */ +export type ModelingFeatures = string; + +/** Known values of {@link ModelingFrequency} that the service accepts. */ +export enum KnownModelingFrequency { + Low = "Low", + Medium = "Medium", + High = "High" +} + +/** + * Defines values for ModelingFrequency. \ + * {@link KnownModelingFrequency} can be used interchangeably with ModelingFrequency, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Low** \ + * **Medium** \ + * **High** + */ +export type ModelingFrequency = string; + +/** Known values of {@link ModelingSize} that the service accepts. */ +export enum KnownModelingSize { + Small = "Small", + Medium = "Medium", + Large = "Large" +} + +/** + * Defines values for ModelingSize. \ + * {@link KnownModelingSize} can be used interchangeably with ModelingSize, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Small** \ + * **Medium** \ + * **Large** + */ +export type ModelingSize = string; + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + User = "user", + System = "system", + UserSystem = "user,system" +} + +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + Internal = "Internal" +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; + +/** Optional parameters. */ +export interface AccountsCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkNameAvailability operation. */ +export type AccountsCheckNameAvailabilityResponse = CheckNameAvailabilityResponse; + +/** Optional parameters. */ +export interface AccountsListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type AccountsListBySubscriptionResponse = AccountResourceList; + +/** Optional parameters. */ +export interface AccountsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type AccountsListByResourceGroupResponse = AccountResourceList; + +/** Optional parameters. */ +export interface AccountsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AccountsGetResponse = AccountResource; + +/** Optional parameters. */ +export interface AccountsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type AccountsCreateOrUpdateResponse = AccountResource; + +/** Optional parameters. */ +export interface AccountsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type AccountsUpdateResponse = AccountResource; + +/** Optional parameters. */ +export interface AccountsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface AccountsGetStatusOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getStatus operation. */ +export type AccountsGetStatusResponse = AccountStatus; + +/** Optional parameters. */ +export interface AccountsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type AccountsListBySubscriptionNextResponse = AccountResourceList; + +/** Optional parameters. */ +export interface AccountsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type AccountsListByResourceGroupNextResponse = AccountResourceList; + +/** Optional parameters. */ +export interface ModelingListByAccountResourceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByAccountResource operation. */ +export type ModelingListByAccountResourceResponse = ModelingResourceList; + +/** Optional parameters. */ +export interface ModelingGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ModelingGetResponse = ModelingResource; + +/** Optional parameters. */ +export interface ModelingCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type ModelingCreateOrUpdateResponse = ModelingResource; + +/** Optional parameters. */ +export interface ModelingUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type ModelingUpdateResponse = ModelingResource; + +/** Optional parameters. */ +export interface ModelingDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface ModelingListByAccountResourceNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByAccountResourceNext operation. */ +export type ModelingListByAccountResourceNextResponse = ModelingResourceList; + +/** Optional parameters. */ +export interface ServiceEndpointsListByAccountResourceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByAccountResource operation. */ +export type ServiceEndpointsListByAccountResourceResponse = ServiceEndpointResourceList; + +/** Optional parameters. */ +export interface ServiceEndpointsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ServiceEndpointsGetResponse = ServiceEndpointResource; + +/** Optional parameters. */ +export interface ServiceEndpointsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type ServiceEndpointsCreateOrUpdateResponse = ServiceEndpointResource; + +/** Optional parameters. */ +export interface ServiceEndpointsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type ServiceEndpointsUpdateResponse = ServiceEndpointResource; + +/** Optional parameters. */ +export interface ServiceEndpointsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface ServiceEndpointsListByAccountResourceNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByAccountResourceNext operation. */ +export type ServiceEndpointsListByAccountResourceNextResponse = ServiceEndpointResourceList; + +/** Optional parameters. */ +export interface OperationStatusesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type OperationStatusesGetResponse = OperationStatusResult; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface RecommendationsServiceOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/models/mappers.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/models/mappers.ts new file mode 100644 index 000000000000..b158ff173aa0 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/models/mappers.ts @@ -0,0 +1,1016 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +export const CheckNameAvailabilityRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckNameAvailabilityRequest", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const CheckNameAvailabilityResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckNameAvailabilityResponse", + modelProperties: { + nameAvailable: { + serializedName: "nameAvailable", + type: { + name: "Boolean" + } + }, + reason: { + serializedName: "reason", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const AccountResourceList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountResourceList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccountResource" + } + } + } + } + } + } +}; + +export const AccountResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountResourceProperties", + modelProperties: { + configuration: { + serializedName: "configuration", + type: { + name: "String" + } + }, + endpointAuthentications: { + serializedName: "endpointAuthentications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EndpointAuthentication" + } + } + } + }, + cors: { + serializedName: "cors", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CorsRule" + } + } + } + }, + reportsConnectionString: { + serializedName: "reportsConnectionString", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const EndpointAuthentication: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EndpointAuthentication", + modelProperties: { + aadTenantID: { + serializedName: "aadTenantID", + type: { + name: "String" + } + }, + principalID: { + serializedName: "principalID", + type: { + name: "String" + } + }, + principalType: { + serializedName: "principalType", + type: { + name: "String" + } + } + } + } +}; + +export const CorsRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CorsRule", + modelProperties: { + allowedOrigins: { + constraints: { + MinItems: 1 + }, + serializedName: "allowedOrigins", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + allowedMethods: { + serializedName: "allowedMethods", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + allowedHeaders: { + serializedName: "allowedHeaders", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + exposedHeaders: { + serializedName: "exposedHeaders", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + maxAgeInSeconds: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "maxAgeInSeconds", + type: { + name: "Number" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AccountPatchResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountPatchResource", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "AccountPatchResourceProperties" + } + } + } + } +}; + +export const AccountPatchResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountPatchResourceProperties", + modelProperties: { + endpointAuthentications: { + serializedName: "endpointAuthentications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EndpointAuthentication" + } + } + } + }, + cors: { + serializedName: "cors", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CorsRule" + } + } + } + }, + reportsConnectionString: { + serializedName: "reportsConnectionString", + type: { + name: "String" + } + } + } + } +}; + +export const AccountStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountStatus", + modelProperties: { + scopesStatuses: { + serializedName: "scopesStatuses", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ScopeStatuses" + } + } + } + } + } + } +}; + +export const ScopeStatuses: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScopeStatuses", + modelProperties: { + scope: { + serializedName: "scope", + type: { + name: "String" + } + }, + statuses: { + serializedName: "statuses", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StageStatus" + } + } + } + } + } + } +}; + +export const StageStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StageStatus", + modelProperties: { + stage: { + serializedName: "stage", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + time: { + serializedName: "time", + type: { + name: "DateTime" + } + } + } + } +}; + +export const ModelingResourceList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModelingResourceList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ModelingResource" + } + } + } + } + } + } +}; + +export const ModelingResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModelingResourceProperties", + modelProperties: { + features: { + serializedName: "features", + type: { + name: "String" + } + }, + frequency: { + serializedName: "frequency", + type: { + name: "String" + } + }, + size: { + serializedName: "size", + type: { + name: "String" + } + }, + inputData: { + serializedName: "inputData", + type: { + name: "Composite", + className: "ModelingInputData" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ModelingInputData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModelingInputData", + modelProperties: { + connectionString: { + serializedName: "connectionString", + type: { + name: "String" + } + } + } + } +}; + +export const ModelingPatchResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModelingPatchResource", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ModelingPatchResourceProperties" + } + } + } + } +}; + +export const ModelingPatchResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModelingPatchResourceProperties", + modelProperties: { + inputData: { + serializedName: "inputData", + type: { + name: "Composite", + className: "ModelingInputData" + } + } + } + } +}; + +export const ServiceEndpointResourceList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceEndpointResourceList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ServiceEndpointResource" + } + } + } + } + } + } +}; + +export const ServiceEndpointResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceEndpointResourceProperties", + modelProperties: { + preAllocatedCapacity: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "preAllocatedCapacity", + type: { + name: "Number" + } + }, + pairedLocation: { + serializedName: "pairedLocation", + readOnly: true, + type: { + name: "String" + } + }, + url: { + serializedName: "url", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ServiceEndpointPatchResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceEndpointPatchResource", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const OperationStatusResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationStatusResult", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + required: true, + type: { + name: "String" + } + }, + percentComplete: { + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 0 + }, + serializedName: "percentComplete", + type: { + name: "Number" + } + }, + startTime: { + serializedName: "startTime", + type: { + name: "DateTime" + } + }, + endTime: { + serializedName: "endTime", + type: { + name: "DateTime" + } + }, + operations: { + serializedName: "operations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationStatusResult" + } + } + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const AccountResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "AccountResourceProperties" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const ModelingResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModelingResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ModelingResourceProperties" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const ServiceEndpointResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceEndpointResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ServiceEndpointResourceProperties" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/models/parameters.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/models/parameters.ts new file mode 100644 index 000000000000..3f7bbf5db4e7 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/models/parameters.ts @@ -0,0 +1,207 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + CheckNameAvailabilityRequest as CheckNameAvailabilityRequestMapper, + AccountResource as AccountResourceMapper, + AccountPatchResource as AccountPatchResourceMapper, + ModelingResource as ModelingResourceMapper, + ModelingPatchResource as ModelingPatchResourceMapper, + ServiceEndpointResource as ServiceEndpointResourceMapper, + ServiceEndpointPatchResource as ServiceEndpointPatchResourceMapper +} from "../models/mappers"; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const body: OperationParameter = { + parameterPath: "body", + mapper: CheckNameAvailabilityRequestMapper +}; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2022-02-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const accountName: OperationURLParameter = { + parameterPath: "accountName", + mapper: { + serializedName: "accountName", + required: true, + type: { + name: "String" + } + } +}; + +export const body1: OperationParameter = { + parameterPath: "body", + mapper: AccountResourceMapper +}; + +export const body2: OperationParameter = { + parameterPath: "body", + mapper: AccountPatchResourceMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const modelingName: OperationURLParameter = { + parameterPath: "modelingName", + mapper: { + serializedName: "modelingName", + required: true, + type: { + name: "String" + } + } +}; + +export const body3: OperationParameter = { + parameterPath: "body", + mapper: ModelingResourceMapper +}; + +export const body4: OperationParameter = { + parameterPath: "body", + mapper: ModelingPatchResourceMapper +}; + +export const serviceEndpointName: OperationURLParameter = { + parameterPath: "serviceEndpointName", + mapper: { + serializedName: "serviceEndpointName", + required: true, + type: { + name: "String" + } + } +}; + +export const body5: OperationParameter = { + parameterPath: "body", + mapper: ServiceEndpointResourceMapper +}; + +export const body6: OperationParameter = { + parameterPath: "body", + mapper: ServiceEndpointPatchResourceMapper +}; + +export const location: OperationURLParameter = { + parameterPath: "location", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "location", + required: true, + type: { + name: "String" + } + } +}; + +export const operationId: OperationURLParameter = { + parameterPath: "operationId", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "operationId", + required: true, + type: { + name: "String" + } + } +}; diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/operations/accounts.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/operations/accounts.ts new file mode 100644 index 000000000000..da5a92d0c13b --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/operations/accounts.ts @@ -0,0 +1,755 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Accounts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { RecommendationsService } from "../recommendationsService"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + AccountResource, + AccountsListBySubscriptionNextOptionalParams, + AccountsListBySubscriptionOptionalParams, + AccountsListByResourceGroupNextOptionalParams, + AccountsListByResourceGroupOptionalParams, + CheckNameAvailabilityRequest, + AccountsCheckNameAvailabilityOptionalParams, + AccountsCheckNameAvailabilityResponse, + AccountsListBySubscriptionResponse, + AccountsListByResourceGroupResponse, + AccountsGetOptionalParams, + AccountsGetResponse, + AccountsCreateOrUpdateOptionalParams, + AccountsCreateOrUpdateResponse, + AccountPatchResource, + AccountsUpdateOptionalParams, + AccountsUpdateResponse, + AccountsDeleteOptionalParams, + AccountsGetStatusOptionalParams, + AccountsGetStatusResponse, + AccountsListBySubscriptionNextResponse, + AccountsListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing Accounts operations. */ +export class AccountsImpl implements Accounts { + private readonly client: RecommendationsService; + + /** + * Initialize a new instance of the class Accounts class. + * @param client Reference to the service client + */ + constructor(client: RecommendationsService) { + this.client = client; + } + + /** + * Returns list of RecommendationsService Account resources. + * @param options The options parameters. + */ + public listBySubscription( + options?: AccountsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: AccountsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: AccountsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Returns list of RecommendationsService Account resources. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Checks that the RecommendationsService Account name is valid and is not already in use. + * @param body Check name availability request details. + * @param options The options parameters. + */ + checkNameAvailability( + body: CheckNameAvailabilityRequest, + options?: AccountsCheckNameAvailabilityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { body, options }, + checkNameAvailabilityOperationSpec + ); + } + + /** + * Returns list of RecommendationsService Account resources. + * @param options The options parameters. + */ + private _listBySubscription( + options?: AccountsListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Returns list of RecommendationsService Account resources. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Returns RecommendationsService Account resource for a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + options?: AccountsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates RecommendationsService Account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param body Account details. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + body: AccountResource, + options?: AccountsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccountsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, accountName, body, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates or updates RecommendationsService Account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param body Account details. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + body: AccountResource, + options?: AccountsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + accountName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates RecommendationsService Account details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param body Account resource patch details. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + accountName: string, + body: AccountPatchResource, + options?: AccountsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccountsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, accountName, body, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Updates RecommendationsService Account details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param body Account resource patch details. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + body: AccountPatchResource, + options?: AccountsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + accountName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes RecommendationsService Account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + options?: AccountsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, accountName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Deletes RecommendationsService Account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + options?: AccountsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Returns RecommendationsService Account status. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param options The options parameters. + */ + getStatus( + resourceGroupName: string, + accountName: string, + options?: AccountsGetStatusOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + getStatusOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: AccountsListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: AccountsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.RecommendationsService/checkNameAvailability", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CheckNameAvailabilityResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.RecommendationsService/accounts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountResourceList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountResourceList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts/{accountName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts/{accountName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.AccountResource + }, + 201: { + bodyMapper: Mappers.AccountResource + }, + 202: { + bodyMapper: Mappers.AccountResource + }, + 204: { + bodyMapper: Mappers.AccountResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts/{accountName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.AccountResource + }, + 201: { + bodyMapper: Mappers.AccountResource + }, + 202: { + bodyMapper: Mappers.AccountResource + }, + 204: { + bodyMapper: Mappers.AccountResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts/{accountName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getStatusOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts/{accountName}/status", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.AccountStatus + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountResourceList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountResourceList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/operations/index.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/operations/index.ts new file mode 100644 index 000000000000..b6e59d42b97f --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/operations/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./accounts"; +export * from "./modeling"; +export * from "./serviceEndpoints"; +export * from "./operationStatuses"; +export * from "./operations"; diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/operations/modeling.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/operations/modeling.ts new file mode 100644 index 000000000000..ec1afbeb0321 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/operations/modeling.ts @@ -0,0 +1,611 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Modeling } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { RecommendationsService } from "../recommendationsService"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ModelingResource, + ModelingListByAccountResourceNextOptionalParams, + ModelingListByAccountResourceOptionalParams, + ModelingListByAccountResourceResponse, + ModelingGetOptionalParams, + ModelingGetResponse, + ModelingCreateOrUpdateOptionalParams, + ModelingCreateOrUpdateResponse, + ModelingPatchResource, + ModelingUpdateOptionalParams, + ModelingUpdateResponse, + ModelingDeleteOptionalParams, + ModelingListByAccountResourceNextResponse +} from "../models"; + +/// +/** Class containing Modeling operations. */ +export class ModelingImpl implements Modeling { + private readonly client: RecommendationsService; + + /** + * Initialize a new instance of the class Modeling class. + * @param client Reference to the service client + */ + constructor(client: RecommendationsService) { + this.client = client; + } + + /** + * Returns list of Modeling resources for a given Account name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param options The options parameters. + */ + public listByAccountResource( + resourceGroupName: string, + accountName: string, + options?: ModelingListByAccountResourceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByAccountResourcePagingAll( + resourceGroupName, + accountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByAccountResourcePagingPage( + resourceGroupName, + accountName, + options + ); + } + }; + } + + private async *listByAccountResourcePagingPage( + resourceGroupName: string, + accountName: string, + options?: ModelingListByAccountResourceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByAccountResource( + resourceGroupName, + accountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByAccountResourceNext( + resourceGroupName, + accountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByAccountResourcePagingAll( + resourceGroupName: string, + accountName: string, + options?: ModelingListByAccountResourceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByAccountResourcePagingPage( + resourceGroupName, + accountName, + options + )) { + yield* page; + } + } + + /** + * Returns list of Modeling resources for a given Account name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param options The options parameters. + */ + private _listByAccountResource( + resourceGroupName: string, + accountName: string, + options?: ModelingListByAccountResourceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listByAccountResourceOperationSpec + ); + } + + /** + * Returns Modeling resources for a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param modelingName The name of the Modeling resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + modelingName: string, + options?: ModelingGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, modelingName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates Modeling resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param modelingName The name of the Modeling resource. + * @param body Modeling resource details. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + modelingName: string, + body: ModelingResource, + options?: ModelingCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ModelingCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, accountName, modelingName, body, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates or updates Modeling resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param modelingName The name of the Modeling resource. + * @param body Modeling resource details. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + modelingName: string, + body: ModelingResource, + options?: ModelingCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + accountName, + modelingName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates Modeling resource details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param modelingName The name of the Modeling resource. + * @param body Modeling resource patch details. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + accountName: string, + modelingName: string, + body: ModelingPatchResource, + options?: ModelingUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ModelingUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, accountName, modelingName, body, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Updates Modeling resource details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param modelingName The name of the Modeling resource. + * @param body Modeling resource patch details. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + modelingName: string, + body: ModelingPatchResource, + options?: ModelingUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + accountName, + modelingName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes Modeling resources of a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param modelingName The name of the Modeling resource. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + modelingName: string, + options?: ModelingDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, accountName, modelingName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Deletes Modeling resources of a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param modelingName The name of the Modeling resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + modelingName: string, + options?: ModelingDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + modelingName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByAccountResourceNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param nextLink The nextLink from the previous successful call to the ListByAccountResource method. + * @param options The options parameters. + */ + private _listByAccountResourceNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: ModelingListByAccountResourceNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listByAccountResourceNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByAccountResourceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts/{accountName}/modeling", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ModelingResourceList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts/{accountName}/modeling/{modelingName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ModelingResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.modelingName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts/{accountName}/modeling/{modelingName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ModelingResource + }, + 201: { + bodyMapper: Mappers.ModelingResource + }, + 202: { + bodyMapper: Mappers.ModelingResource + }, + 204: { + bodyMapper: Mappers.ModelingResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.modelingName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts/{accountName}/modeling/{modelingName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.ModelingResource + }, + 201: { + bodyMapper: Mappers.ModelingResource + }, + 202: { + bodyMapper: Mappers.ModelingResource + }, + 204: { + bodyMapper: Mappers.ModelingResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.modelingName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts/{accountName}/modeling/{modelingName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.modelingName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByAccountResourceNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ModelingResourceList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/operations/operationStatuses.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/operations/operationStatuses.ts new file mode 100644 index 000000000000..eed5d0ae092e --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/operations/operationStatuses.ts @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { OperationStatuses } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { RecommendationsService } from "../recommendationsService"; +import { + OperationStatusesGetOptionalParams, + OperationStatusesGetResponse +} from "../models"; + +/** Class containing OperationStatuses operations. */ +export class OperationStatusesImpl implements OperationStatuses { + private readonly client: RecommendationsService; + + /** + * Initialize a new instance of the class OperationStatuses class. + * @param client Reference to the service client + */ + constructor(client: RecommendationsService) { + this.client = client; + } + + /** + * Returns the current status of an async operation. + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async operation. + * @param options The options parameters. + */ + get( + location: string, + operationId: string, + options?: OperationStatusesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, operationId, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.RecommendationsService/locations/{location}/operationStatuses/{operationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationStatusResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.location, + Parameters.operationId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/operations/operations.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/operations/operations.ts new file mode 100644 index 000000000000..66736bae15df --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/operations/operations.ts @@ -0,0 +1,137 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { RecommendationsService } from "../recommendationsService"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: RecommendationsService; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: RecommendationsService) { + this.client = client; + } + + /** + * Returns list of operations. + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Returns list of operations. + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.RecommendationsService/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/operations/serviceEndpoints.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/operations/serviceEndpoints.ts new file mode 100644 index 000000000000..078bad8728c6 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/operations/serviceEndpoints.ts @@ -0,0 +1,611 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ServiceEndpoints } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { RecommendationsService } from "../recommendationsService"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ServiceEndpointResource, + ServiceEndpointsListByAccountResourceNextOptionalParams, + ServiceEndpointsListByAccountResourceOptionalParams, + ServiceEndpointsListByAccountResourceResponse, + ServiceEndpointsGetOptionalParams, + ServiceEndpointsGetResponse, + ServiceEndpointsCreateOrUpdateOptionalParams, + ServiceEndpointsCreateOrUpdateResponse, + ServiceEndpointPatchResource, + ServiceEndpointsUpdateOptionalParams, + ServiceEndpointsUpdateResponse, + ServiceEndpointsDeleteOptionalParams, + ServiceEndpointsListByAccountResourceNextResponse +} from "../models"; + +/// +/** Class containing ServiceEndpoints operations. */ +export class ServiceEndpointsImpl implements ServiceEndpoints { + private readonly client: RecommendationsService; + + /** + * Initialize a new instance of the class ServiceEndpoints class. + * @param client Reference to the service client + */ + constructor(client: RecommendationsService) { + this.client = client; + } + + /** + * Returns list of ServiceEndpoint resources for a given Account name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param options The options parameters. + */ + public listByAccountResource( + resourceGroupName: string, + accountName: string, + options?: ServiceEndpointsListByAccountResourceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByAccountResourcePagingAll( + resourceGroupName, + accountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByAccountResourcePagingPage( + resourceGroupName, + accountName, + options + ); + } + }; + } + + private async *listByAccountResourcePagingPage( + resourceGroupName: string, + accountName: string, + options?: ServiceEndpointsListByAccountResourceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByAccountResource( + resourceGroupName, + accountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByAccountResourceNext( + resourceGroupName, + accountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByAccountResourcePagingAll( + resourceGroupName: string, + accountName: string, + options?: ServiceEndpointsListByAccountResourceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByAccountResourcePagingPage( + resourceGroupName, + accountName, + options + )) { + yield* page; + } + } + + /** + * Returns list of ServiceEndpoint resources for a given Account name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param options The options parameters. + */ + private _listByAccountResource( + resourceGroupName: string, + accountName: string, + options?: ServiceEndpointsListByAccountResourceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listByAccountResourceOperationSpec + ); + } + + /** + * Returns ServiceEndpoint resources for a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param serviceEndpointName The name of the ServiceEndpoint resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + serviceEndpointName: string, + options?: ServiceEndpointsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, serviceEndpointName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates ServiceEndpoint resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param serviceEndpointName The name of the ServiceEndpoint resource. + * @param body ServiceEndpoint resource details. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + serviceEndpointName: string, + body: ServiceEndpointResource, + options?: ServiceEndpointsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServiceEndpointsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, accountName, serviceEndpointName, body, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates or updates ServiceEndpoint resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param serviceEndpointName The name of the ServiceEndpoint resource. + * @param body ServiceEndpoint resource details. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + serviceEndpointName: string, + body: ServiceEndpointResource, + options?: ServiceEndpointsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + accountName, + serviceEndpointName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates ServiceEndpoint resource details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param serviceEndpointName The name of the ServiceEndpoint resource. + * @param body ServiceEndpoint resource patch details. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + accountName: string, + serviceEndpointName: string, + body: ServiceEndpointPatchResource, + options?: ServiceEndpointsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServiceEndpointsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, accountName, serviceEndpointName, body, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Updates ServiceEndpoint resource details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param serviceEndpointName The name of the ServiceEndpoint resource. + * @param body ServiceEndpoint resource patch details. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + serviceEndpointName: string, + body: ServiceEndpointPatchResource, + options?: ServiceEndpointsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + accountName, + serviceEndpointName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes ServiceEndpoint resources of a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param serviceEndpointName The name of the ServiceEndpoint resource. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + serviceEndpointName: string, + options?: ServiceEndpointsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, accountName, serviceEndpointName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Deletes ServiceEndpoint resources of a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param serviceEndpointName The name of the ServiceEndpoint resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + serviceEndpointName: string, + options?: ServiceEndpointsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + serviceEndpointName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByAccountResourceNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param nextLink The nextLink from the previous successful call to the ListByAccountResource method. + * @param options The options parameters. + */ + private _listByAccountResourceNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: ServiceEndpointsListByAccountResourceNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listByAccountResourceNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByAccountResourceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts/{accountName}/serviceEndpoints", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ServiceEndpointResourceList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts/{accountName}/serviceEndpoints/{serviceEndpointName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ServiceEndpointResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.serviceEndpointName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts/{accountName}/serviceEndpoints/{serviceEndpointName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ServiceEndpointResource + }, + 201: { + bodyMapper: Mappers.ServiceEndpointResource + }, + 202: { + bodyMapper: Mappers.ServiceEndpointResource + }, + 204: { + bodyMapper: Mappers.ServiceEndpointResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.serviceEndpointName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts/{accountName}/serviceEndpoints/{serviceEndpointName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.ServiceEndpointResource + }, + 201: { + bodyMapper: Mappers.ServiceEndpointResource + }, + 202: { + bodyMapper: Mappers.ServiceEndpointResource + }, + 204: { + bodyMapper: Mappers.ServiceEndpointResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body6, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.serviceEndpointName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecommendationsService/accounts/{accountName}/serviceEndpoints/{serviceEndpointName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.serviceEndpointName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByAccountResourceNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ServiceEndpointResourceList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/accounts.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/accounts.ts new file mode 100644 index 000000000000..8b6b27975279 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/accounts.ts @@ -0,0 +1,164 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + AccountResource, + AccountsListBySubscriptionOptionalParams, + AccountsListByResourceGroupOptionalParams, + CheckNameAvailabilityRequest, + AccountsCheckNameAvailabilityOptionalParams, + AccountsCheckNameAvailabilityResponse, + AccountsGetOptionalParams, + AccountsGetResponse, + AccountsCreateOrUpdateOptionalParams, + AccountsCreateOrUpdateResponse, + AccountPatchResource, + AccountsUpdateOptionalParams, + AccountsUpdateResponse, + AccountsDeleteOptionalParams, + AccountsGetStatusOptionalParams, + AccountsGetStatusResponse +} from "../models"; + +/// +/** Interface representing a Accounts. */ +export interface Accounts { + /** + * Returns list of RecommendationsService Account resources. + * @param options The options parameters. + */ + listBySubscription( + options?: AccountsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns list of RecommendationsService Account resources. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Checks that the RecommendationsService Account name is valid and is not already in use. + * @param body Check name availability request details. + * @param options The options parameters. + */ + checkNameAvailability( + body: CheckNameAvailabilityRequest, + options?: AccountsCheckNameAvailabilityOptionalParams + ): Promise; + /** + * Returns RecommendationsService Account resource for a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + options?: AccountsGetOptionalParams + ): Promise; + /** + * Creates or updates RecommendationsService Account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param body Account details. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + body: AccountResource, + options?: AccountsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccountsCreateOrUpdateResponse + > + >; + /** + * Creates or updates RecommendationsService Account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param body Account details. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + body: AccountResource, + options?: AccountsCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates RecommendationsService Account details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param body Account resource patch details. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + accountName: string, + body: AccountPatchResource, + options?: AccountsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccountsUpdateResponse + > + >; + /** + * Updates RecommendationsService Account details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param body Account resource patch details. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + body: AccountPatchResource, + options?: AccountsUpdateOptionalParams + ): Promise; + /** + * Deletes RecommendationsService Account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + options?: AccountsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes RecommendationsService Account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + options?: AccountsDeleteOptionalParams + ): Promise; + /** + * Returns RecommendationsService Account status. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param options The options parameters. + */ + getStatus( + resourceGroupName: string, + accountName: string, + options?: AccountsGetStatusOptionalParams + ): Promise; +} diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/index.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..b6e59d42b97f --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./accounts"; +export * from "./modeling"; +export * from "./serviceEndpoints"; +export * from "./operationStatuses"; +export * from "./operations"; diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/modeling.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/modeling.ts new file mode 100644 index 000000000000..2f7ace793731 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/modeling.ts @@ -0,0 +1,147 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + ModelingResource, + ModelingListByAccountResourceOptionalParams, + ModelingGetOptionalParams, + ModelingGetResponse, + ModelingCreateOrUpdateOptionalParams, + ModelingCreateOrUpdateResponse, + ModelingPatchResource, + ModelingUpdateOptionalParams, + ModelingUpdateResponse, + ModelingDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Modeling. */ +export interface Modeling { + /** + * Returns list of Modeling resources for a given Account name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param options The options parameters. + */ + listByAccountResource( + resourceGroupName: string, + accountName: string, + options?: ModelingListByAccountResourceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns Modeling resources for a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param modelingName The name of the Modeling resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + modelingName: string, + options?: ModelingGetOptionalParams + ): Promise; + /** + * Creates or updates Modeling resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param modelingName The name of the Modeling resource. + * @param body Modeling resource details. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + modelingName: string, + body: ModelingResource, + options?: ModelingCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ModelingCreateOrUpdateResponse + > + >; + /** + * Creates or updates Modeling resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param modelingName The name of the Modeling resource. + * @param body Modeling resource details. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + modelingName: string, + body: ModelingResource, + options?: ModelingCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates Modeling resource details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param modelingName The name of the Modeling resource. + * @param body Modeling resource patch details. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + accountName: string, + modelingName: string, + body: ModelingPatchResource, + options?: ModelingUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ModelingUpdateResponse + > + >; + /** + * Updates Modeling resource details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param modelingName The name of the Modeling resource. + * @param body Modeling resource patch details. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + modelingName: string, + body: ModelingPatchResource, + options?: ModelingUpdateOptionalParams + ): Promise; + /** + * Deletes Modeling resources of a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param modelingName The name of the Modeling resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + modelingName: string, + options?: ModelingDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes Modeling resources of a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param modelingName The name of the Modeling resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + modelingName: string, + options?: ModelingDeleteOptionalParams + ): Promise; +} diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/operationStatuses.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/operationStatuses.ts new file mode 100644 index 000000000000..45c05f9b27fa --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/operationStatuses.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + OperationStatusesGetOptionalParams, + OperationStatusesGetResponse +} from "../models"; + +/** Interface representing a OperationStatuses. */ +export interface OperationStatuses { + /** + * Returns the current status of an async operation. + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async operation. + * @param options The options parameters. + */ + get( + location: string, + operationId: string, + options?: OperationStatusesGetOptionalParams + ): Promise; +} diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/operations.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..0c50b09b459e --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Returns list of operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/serviceEndpoints.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/serviceEndpoints.ts new file mode 100644 index 000000000000..8b1afa334084 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/operationsInterfaces/serviceEndpoints.ts @@ -0,0 +1,147 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + ServiceEndpointResource, + ServiceEndpointsListByAccountResourceOptionalParams, + ServiceEndpointsGetOptionalParams, + ServiceEndpointsGetResponse, + ServiceEndpointsCreateOrUpdateOptionalParams, + ServiceEndpointsCreateOrUpdateResponse, + ServiceEndpointPatchResource, + ServiceEndpointsUpdateOptionalParams, + ServiceEndpointsUpdateResponse, + ServiceEndpointsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a ServiceEndpoints. */ +export interface ServiceEndpoints { + /** + * Returns list of ServiceEndpoint resources for a given Account name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param options The options parameters. + */ + listByAccountResource( + resourceGroupName: string, + accountName: string, + options?: ServiceEndpointsListByAccountResourceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns ServiceEndpoint resources for a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param serviceEndpointName The name of the ServiceEndpoint resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + serviceEndpointName: string, + options?: ServiceEndpointsGetOptionalParams + ): Promise; + /** + * Creates or updates ServiceEndpoint resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param serviceEndpointName The name of the ServiceEndpoint resource. + * @param body ServiceEndpoint resource details. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + serviceEndpointName: string, + body: ServiceEndpointResource, + options?: ServiceEndpointsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServiceEndpointsCreateOrUpdateResponse + > + >; + /** + * Creates or updates ServiceEndpoint resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param serviceEndpointName The name of the ServiceEndpoint resource. + * @param body ServiceEndpoint resource details. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + serviceEndpointName: string, + body: ServiceEndpointResource, + options?: ServiceEndpointsCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates ServiceEndpoint resource details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param serviceEndpointName The name of the ServiceEndpoint resource. + * @param body ServiceEndpoint resource patch details. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + accountName: string, + serviceEndpointName: string, + body: ServiceEndpointPatchResource, + options?: ServiceEndpointsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServiceEndpointsUpdateResponse + > + >; + /** + * Updates ServiceEndpoint resource details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param serviceEndpointName The name of the ServiceEndpoint resource. + * @param body ServiceEndpoint resource patch details. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + serviceEndpointName: string, + body: ServiceEndpointPatchResource, + options?: ServiceEndpointsUpdateOptionalParams + ): Promise; + /** + * Deletes ServiceEndpoint resources of a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param serviceEndpointName The name of the ServiceEndpoint resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + serviceEndpointName: string, + options?: ServiceEndpointsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes ServiceEndpoint resources of a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the RecommendationsService Account resource. + * @param serviceEndpointName The name of the ServiceEndpoint resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + serviceEndpointName: string, + options?: ServiceEndpointsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/recommendationsservice/arm-recommendationsservice/src/recommendationsService.ts b/sdk/recommendationsservice/arm-recommendationsservice/src/recommendationsService.ts new file mode 100644 index 000000000000..609ab0e8a209 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/src/recommendationsService.ts @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + AccountsImpl, + ModelingImpl, + ServiceEndpointsImpl, + OperationStatusesImpl, + OperationsImpl +} from "./operations"; +import { + Accounts, + Modeling, + ServiceEndpoints, + OperationStatuses, + Operations +} from "./operationsInterfaces"; +import { RecommendationsServiceOptionalParams } from "./models"; + +export class RecommendationsService extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the RecommendationsService class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: RecommendationsServiceOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: RecommendationsServiceOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-recommendationsservice/1.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2022-02-01"; + this.accounts = new AccountsImpl(this); + this.modeling = new ModelingImpl(this); + this.serviceEndpoints = new ServiceEndpointsImpl(this); + this.operationStatuses = new OperationStatusesImpl(this); + this.operations = new OperationsImpl(this); + } + + accounts: Accounts; + modeling: Modeling; + serviceEndpoints: ServiceEndpoints; + operationStatuses: OperationStatuses; + operations: Operations; +} diff --git a/sdk/recommendationsservice/arm-recommendationsservice/test/sampleTest.ts b/sdk/recommendationsservice/arm-recommendationsservice/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/recommendationsservice/arm-recommendationsservice/tsconfig.json b/sdk/recommendationsservice/arm-recommendationsservice/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/recommendationsservice/arm-recommendationsservice/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/recommendationsservice/ci.mgmt.yml b/sdk/recommendationsservice/ci.mgmt.yml new file mode 100644 index 000000000000..2b0984881d3d --- /dev/null +++ b/sdk/recommendationsservice/ci.mgmt.yml @@ -0,0 +1,38 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/recommendationsservice/arm-recommendationsservice + - sdk/recommendationsservice/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/recommendationsservice/arm-recommendationsservice + - sdk/recommendationsservice/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: recommendationsservice + Artifacts: + - name: azure-arm-recommendationsservice + safeName: azurearmrecommendationsservice + \ No newline at end of file