From 733641f70f55abd605f5028b6e9d27e22686b7e0 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 8 Apr 2022 06:07:32 +0000 Subject: [PATCH] CodeGen from PR 18616 in Azure/azure-rest-api-specs Merge 38308a26073f38c456ac74fa03d634babecd0572 into daac0981f39af9fbeffb1e71149f6f3d9b7db831 --- common/config/rush/pnpm-lock.yaml | 33 +- rush.json | 9 +- sdk/agrifood/arm-agrifood/CHANGELOG.md | 5 + sdk/agrifood/arm-agrifood/LICENSE | 21 + sdk/agrifood/arm-agrifood/README.md | 98 +++ sdk/agrifood/arm-agrifood/_meta.json | 8 + sdk/agrifood/arm-agrifood/api-extractor.json | 31 + sdk/agrifood/arm-agrifood/package.json | 100 +++ .../arm-agrifood/review/arm-agrifood.api.md | 453 ++++++++++ sdk/agrifood/arm-agrifood/rollup.config.js | 188 +++++ .../src/azureAgriFoodRPService.ts | 95 +++ sdk/agrifood/arm-agrifood/src/index.ts | 12 + sdk/agrifood/arm-agrifood/src/models/index.ts | 682 +++++++++++++++ .../arm-agrifood/src/models/mappers.ts | 780 ++++++++++++++++++ .../arm-agrifood/src/models/parameters.ts | 263 ++++++ .../arm-agrifood/src/operations/extensions.ts | 375 +++++++++ .../src/operations/farmBeatsExtensions.ts | 185 +++++ .../src/operations/farmBeatsModels.ts | 466 +++++++++++ .../arm-agrifood/src/operations/index.ts | 13 + .../arm-agrifood/src/operations/locations.ts | 68 ++ .../arm-agrifood/src/operations/operations.ts | 137 +++ .../src/operationsInterfaces/extensions.ts | 88 ++ .../farmBeatsExtensions.ts | 36 + .../operationsInterfaces/farmBeatsModels.ts | 91 ++ .../src/operationsInterfaces/index.ts | 13 + .../src/operationsInterfaces/locations.ts | 26 + .../src/operationsInterfaces/operations.ts | 22 + sdk/agrifood/arm-agrifood/test/sampleTest.ts | 48 ++ sdk/agrifood/arm-agrifood/tsconfig.json | 27 + sdk/agrifood/ci.mgmt.yml | 38 + sdk/agrifood/ci.yml | 12 +- 31 files changed, 4415 insertions(+), 8 deletions(-) create mode 100644 sdk/agrifood/arm-agrifood/CHANGELOG.md create mode 100644 sdk/agrifood/arm-agrifood/LICENSE create mode 100644 sdk/agrifood/arm-agrifood/README.md create mode 100644 sdk/agrifood/arm-agrifood/_meta.json create mode 100644 sdk/agrifood/arm-agrifood/api-extractor.json create mode 100644 sdk/agrifood/arm-agrifood/package.json create mode 100644 sdk/agrifood/arm-agrifood/review/arm-agrifood.api.md create mode 100644 sdk/agrifood/arm-agrifood/rollup.config.js create mode 100644 sdk/agrifood/arm-agrifood/src/azureAgriFoodRPService.ts create mode 100644 sdk/agrifood/arm-agrifood/src/index.ts create mode 100644 sdk/agrifood/arm-agrifood/src/models/index.ts create mode 100644 sdk/agrifood/arm-agrifood/src/models/mappers.ts create mode 100644 sdk/agrifood/arm-agrifood/src/models/parameters.ts create mode 100644 sdk/agrifood/arm-agrifood/src/operations/extensions.ts create mode 100644 sdk/agrifood/arm-agrifood/src/operations/farmBeatsExtensions.ts create mode 100644 sdk/agrifood/arm-agrifood/src/operations/farmBeatsModels.ts create mode 100644 sdk/agrifood/arm-agrifood/src/operations/index.ts create mode 100644 sdk/agrifood/arm-agrifood/src/operations/locations.ts create mode 100644 sdk/agrifood/arm-agrifood/src/operations/operations.ts create mode 100644 sdk/agrifood/arm-agrifood/src/operationsInterfaces/extensions.ts create mode 100644 sdk/agrifood/arm-agrifood/src/operationsInterfaces/farmBeatsExtensions.ts create mode 100644 sdk/agrifood/arm-agrifood/src/operationsInterfaces/farmBeatsModels.ts create mode 100644 sdk/agrifood/arm-agrifood/src/operationsInterfaces/index.ts create mode 100644 sdk/agrifood/arm-agrifood/src/operationsInterfaces/locations.ts create mode 100644 sdk/agrifood/arm-agrifood/src/operationsInterfaces/operations.ts create mode 100644 sdk/agrifood/arm-agrifood/test/sampleTest.ts create mode 100644 sdk/agrifood/arm-agrifood/tsconfig.json create mode 100644 sdk/agrifood/ci.mgmt.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index f10690b25978..226ab661ed7f 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -10,6 +10,7 @@ specifiers: '@rush-temp/ai-text-analytics': file:./projects/ai-text-analytics.tgz '@rush-temp/app-configuration': file:./projects/app-configuration.tgz '@rush-temp/arm-advisor': file:./projects/arm-advisor.tgz + '@rush-temp/arm-agrifood': file:./projects/arm-agrifood.tgz '@rush-temp/arm-analysisservices': file:./projects/arm-analysisservices.tgz '@rush-temp/arm-apimanagement': file:./projects/arm-apimanagement.tgz '@rush-temp/arm-app': file:./projects/arm-app.tgz @@ -284,6 +285,7 @@ dependencies: '@rush-temp/ai-text-analytics': file:projects/ai-text-analytics.tgz '@rush-temp/app-configuration': file:projects/app-configuration.tgz '@rush-temp/arm-advisor': file:projects/arm-advisor.tgz + '@rush-temp/arm-agrifood': file:projects/arm-agrifood.tgz '@rush-temp/arm-analysisservices': file:projects/arm-analysisservices.tgz '@rush-temp/arm-apimanagement': file:projects/arm-apimanagement.tgz '@rush-temp/arm-app': file:projects/arm-app.tgz @@ -9182,6 +9184,33 @@ packages: - supports-color dev: false + file:projects/arm-agrifood.tgz: + resolution: {integrity: sha512-3oKfk6bgYaVb12COtKd1LBQYJ277T8cEhwpv2Zf+Lh1RVHkQJOnHhnRuQOEY9SaJnnYruB62+LhLIEWGlFtElA==, tarball: file:projects/arm-agrifood.tgz} + name: '@rush-temp/arm-agrifood' + 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.2 + transitivePeerDependencies: + - debug + - encoding + - supports-color + dev: false + file:projects/arm-analysisservices.tgz: resolution: {integrity: sha512-CjQGw9AAtSBWwzXgHkNjwxDnI75lrSxsfIisJrDoL3ZDizhTSLKKoAgLwa5dj+WJue0jLZM2USV5ajUSeXYHiA==, tarball: file:projects/arm-analysisservices.tgz} name: '@rush-temp/arm-analysisservices' @@ -16529,7 +16558,7 @@ packages: dev: false file:projects/schema-registry-avro.tgz: - resolution: {integrity: sha512-ADG9wO8rIljoktGdVnP+v8jdrxc43TL0hQgHi7cSXkrJxFGGB6M8XqcDhuT8hYCLfLkRzCwpwH7VSnsjBDVdpg==, tarball: file:projects/schema-registry-avro.tgz} + resolution: {integrity: sha512-9TumFphoGCJiaHQVfz2Z9AsSbhal4ZtZWx7L9fG19JdfEZKJT5uUykYq81plFNWAReFMs83oFPUO//K+BhRuLQ==, tarball: file:projects/schema-registry-avro.tgz} name: '@rush-temp/schema-registry-avro' version: 0.0.0 dependencies: @@ -17674,7 +17703,7 @@ packages: dev: false file:projects/web-pubsub.tgz: - resolution: {integrity: sha512-7qvVc3+mTZX3L5BoserPH04Nwu7kDUUNR5KCtK+ugSa+uTQ5jM0uPXJ3sxgajKuLX+a63eftQtMg2Zcf9K3HZw==, tarball: file:projects/web-pubsub.tgz} + resolution: {integrity: sha512-vAYE6Sk0Olihti+uB+3ac0P3Y+d/XtBXwF2rq0PblaciuLhY/J/3+Y9dpOYDpgTiTyZuAmm+7DDRAq8AYkSETQ==, tarball: file:projects/web-pubsub.tgz} name: '@rush-temp/web-pubsub' version: 0.0.0 dependencies: diff --git a/rush.json b/rush.json index 757c504cb898..6240c20fc6dd 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. @@ -1680,6 +1680,11 @@ "packageName": "@azure/arm-hardwaresecuritymodules", "projectFolder": "sdk/hardwaresecuritymodules/arm-hardwaresecuritymodules", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-agrifood", + "projectFolder": "sdk/agrifood/arm-agrifood", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/agrifood/arm-agrifood/CHANGELOG.md b/sdk/agrifood/arm-agrifood/CHANGELOG.md new file mode 100644 index 000000000000..23d392c6fa6a --- /dev/null +++ b/sdk/agrifood/arm-agrifood/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-04-08) + +The package of @azure/arm-agrifood 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/agrifood/arm-agrifood/LICENSE b/sdk/agrifood/arm-agrifood/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/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/agrifood/arm-agrifood/README.md b/sdk/agrifood/arm-agrifood/README.md new file mode 100644 index 000000000000..da77666c3636 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/README.md @@ -0,0 +1,98 @@ +# Azure AgriFood RP client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure AgriFood RP client. + +APIs documentation for Azure AgriFood Resource Provider Service. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/agrifood/arm-agrifood) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-agrifood) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-agrifood?view=azure-node-preview) | +[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-agrifood` package + +Install the Azure AgriFood RP client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-agrifood +``` + +### Create and authenticate a `AzureAgriFoodRPService` + +To create a client object to access the Azure AgriFood RP API, you will need the `endpoint` of your Azure AgriFood RP resource and a `credential`. The Azure AgriFood RP client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure AgriFood RP 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 AgriFood RP** 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 { AzureAgriFoodRPService } = require("@azure/arm-agrifood"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new AzureAgriFoodRPService(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 + +### AzureAgriFoodRPService + +`AzureAgriFoodRPService` is the primary interface for developers using the Azure AgriFood RP client library. Explore the methods on this client object to understand the different features of the Azure AgriFood RP 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%2Fagrifood%2Farm-agrifood%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/agrifood/arm-agrifood/_meta.json b/sdk/agrifood/arm-agrifood/_meta.json new file mode 100644 index 000000000000..d75d3aacdd5e --- /dev/null +++ b/sdk/agrifood/arm-agrifood/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "3d6c003292c5d279871cc285aeaed67e7d7da24a", + "readme": "specification/agrifood/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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/agrifood/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.6", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" +} \ No newline at end of file diff --git a/sdk/agrifood/arm-agrifood/api-extractor.json b/sdk/agrifood/arm-agrifood/api-extractor.json new file mode 100644 index 000000000000..42728bb72003 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/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-agrifood.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/agrifood/arm-agrifood/package.json b/sdk/agrifood/arm-agrifood/package.json new file mode 100644 index 000000000000..0f43a4cb04c9 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/package.json @@ -0,0 +1,100 @@ +{ + "name": "@azure/arm-agrifood", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for AzureAgriFoodRPService.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=12.0.0" + }, + "dependencies": { + "@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-agrifood.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/agrifood/arm-agrifood", + "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/agrifood/arm-agrifood/review/arm-agrifood.api.md b/sdk/agrifood/arm-agrifood/review/arm-agrifood.api.md new file mode 100644 index 000000000000..e4caf45e0167 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/review/arm-agrifood.api.md @@ -0,0 +1,453 @@ +## API Report File for "@azure/arm-agrifood" + +> 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'; + +// @public +export type ActionType = string; + +// @public (undocumented) +export class AzureAgriFoodRPService extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureAgriFoodRPServiceOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + extensions: Extensions; + // (undocumented) + farmBeatsExtensions: FarmBeatsExtensions; + // (undocumented) + farmBeatsModels: FarmBeatsModels; + // (undocumented) + locations: Locations; + // (undocumented) + operations: Operations; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface AzureAgriFoodRPServiceOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: 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 type CreatedByType = string; + +// @public +export interface DetailedInformation { + apiInputParameters?: string[]; + apiName?: string; + customParameters?: string[]; + platformParameters?: string[]; + unitsSupported?: UnitSystemsInfo; +} + +// @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 type Extension = ProxyResource & { + readonly systemData?: SystemData; + readonly eTag?: string; + readonly extensionId?: string; + readonly extensionCategory?: string; + readonly installedExtensionVersion?: string; + readonly extensionAuthLink?: string; + readonly extensionApiDocsLink?: string; +}; + +// @public +export interface ExtensionListResponse { + readonly nextLink?: string; + value?: Extension[]; +} + +// @public +export interface Extensions { + create(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options?: ExtensionsCreateOptionalParams): Promise; + delete(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options?: ExtensionsDeleteOptionalParams): Promise; + get(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options?: ExtensionsGetOptionalParams): Promise; + listByFarmBeats(resourceGroupName: string, farmBeatsResourceName: string, options?: ExtensionsListByFarmBeatsOptionalParams): PagedAsyncIterableIterator; + update(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options?: ExtensionsUpdateOptionalParams): Promise; +} + +// @public +export interface ExtensionsCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExtensionsCreateResponse = Extension; + +// @public +export interface ExtensionsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ExtensionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExtensionsGetResponse = Extension; + +// @public +export interface ExtensionsListByFarmBeatsNextOptionalParams extends coreClient.OperationOptions { + extensionCategories?: string[]; + extensionIds?: string[]; + maxPageSize?: number; + skipToken?: string; +} + +// @public +export type ExtensionsListByFarmBeatsNextResponse = ExtensionListResponse; + +// @public +export interface ExtensionsListByFarmBeatsOptionalParams extends coreClient.OperationOptions { + extensionCategories?: string[]; + extensionIds?: string[]; + maxPageSize?: number; + skipToken?: string; +} + +// @public +export type ExtensionsListByFarmBeatsResponse = ExtensionListResponse; + +// @public +export interface ExtensionsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExtensionsUpdateResponse = Extension; + +// @public +export type FarmBeats = TrackedResource & { + readonly systemData?: SystemData; + readonly instanceUri?: string; + readonly provisioningState?: ProvisioningState; +}; + +// @public +export type FarmBeatsExtension = ProxyResource & { + readonly systemData?: SystemData; + readonly targetResourceType?: string; + readonly farmBeatsExtensionId?: string; + readonly farmBeatsExtensionName?: string; + readonly farmBeatsExtensionVersion?: string; + readonly publisherId?: string; + readonly description?: string; + readonly extensionCategory?: string; + readonly extensionAuthLink?: string; + readonly extensionApiDocsLink?: string; + readonly detailedInformation?: DetailedInformation[]; +}; + +// @public +export interface FarmBeatsExtensionListResponse { + readonly nextLink?: string; + value?: FarmBeatsExtension[]; +} + +// @public +export interface FarmBeatsExtensions { + get(farmBeatsExtensionId: string, options?: FarmBeatsExtensionsGetOptionalParams): Promise; + list(options?: FarmBeatsExtensionsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface FarmBeatsExtensionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FarmBeatsExtensionsGetResponse = FarmBeatsExtension; + +// @public +export interface FarmBeatsExtensionsListNextOptionalParams extends coreClient.OperationOptions { + extensionCategories?: string[]; + farmBeatsExtensionIds?: string[]; + farmBeatsExtensionNames?: string[]; + maxPageSize?: number; + publisherIds?: string[]; +} + +// @public +export type FarmBeatsExtensionsListNextResponse = FarmBeatsExtensionListResponse; + +// @public +export interface FarmBeatsExtensionsListOptionalParams extends coreClient.OperationOptions { + extensionCategories?: string[]; + farmBeatsExtensionIds?: string[]; + farmBeatsExtensionNames?: string[]; + maxPageSize?: number; + publisherIds?: string[]; +} + +// @public +export type FarmBeatsExtensionsListResponse = FarmBeatsExtensionListResponse; + +// @public +export interface FarmBeatsListResponse { + readonly nextLink?: string; + value?: FarmBeats[]; +} + +// @public +export interface FarmBeatsModels { + createOrUpdate(farmBeatsResourceName: string, resourceGroupName: string, body: FarmBeats, options?: FarmBeatsModelsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, farmBeatsResourceName: string, options?: FarmBeatsModelsDeleteOptionalParams): Promise; + get(resourceGroupName: string, farmBeatsResourceName: string, options?: FarmBeatsModelsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: FarmBeatsModelsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: FarmBeatsModelsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(farmBeatsResourceName: string, resourceGroupName: string, body: FarmBeatsUpdateRequestModel, options?: FarmBeatsModelsUpdateOptionalParams): Promise; +} + +// @public +export interface FarmBeatsModelsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FarmBeatsModelsCreateOrUpdateResponse = FarmBeats; + +// @public +export interface FarmBeatsModelsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface FarmBeatsModelsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FarmBeatsModelsGetResponse = FarmBeats; + +// @public +export interface FarmBeatsModelsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + maxPageSize?: number; + skipToken?: string; +} + +// @public +export type FarmBeatsModelsListByResourceGroupNextResponse = FarmBeatsListResponse; + +// @public +export interface FarmBeatsModelsListByResourceGroupOptionalParams extends coreClient.OperationOptions { + maxPageSize?: number; + skipToken?: string; +} + +// @public +export type FarmBeatsModelsListByResourceGroupResponse = FarmBeatsListResponse; + +// @public +export interface FarmBeatsModelsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { + maxPageSize?: number; + skipToken?: string; +} + +// @public +export type FarmBeatsModelsListBySubscriptionNextResponse = FarmBeatsListResponse; + +// @public +export interface FarmBeatsModelsListBySubscriptionOptionalParams extends coreClient.OperationOptions { + maxPageSize?: number; + skipToken?: string; +} + +// @public +export type FarmBeatsModelsListBySubscriptionResponse = FarmBeatsListResponse; + +// @public +export interface FarmBeatsModelsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FarmBeatsModelsUpdateResponse = FarmBeats; + +// @public +export interface FarmBeatsUpdateRequestModel { + location?: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @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 KnownOrigin { + // (undocumented) + System = "system", + // (undocumented) + User = "user", + // (undocumented) + UserSystem = "user,system" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded" +} + +// @public +export interface Locations { + checkNameAvailability(body: CheckNameAvailabilityRequest, options?: LocationsCheckNameAvailabilityOptionalParams): Promise; +} + +// @public +export interface LocationsCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LocationsCheckNameAvailabilityResponse = CheckNameAvailabilityResponse; + +// @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 type Origin = string; + +// @public +export type ProvisioningState = string; + +// @public +export type ProxyResource = Resource & {}; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @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; +}; + +// @public +export interface UnitSystemsInfo { + key: string; + values: string[]; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/agrifood/arm-agrifood/rollup.config.js b/sdk/agrifood/arm-agrifood/rollup.config.js new file mode 100644 index 000000000000..9be1955eb7f1 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/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/agrifood/arm-agrifood/src/azureAgriFoodRPService.ts b/sdk/agrifood/arm-agrifood/src/azureAgriFoodRPService.ts new file mode 100644 index 000000000000..21fe3b6386a7 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/azureAgriFoodRPService.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 { + ExtensionsImpl, + FarmBeatsExtensionsImpl, + FarmBeatsModelsImpl, + LocationsImpl, + OperationsImpl +} from "./operations"; +import { + Extensions, + FarmBeatsExtensions, + FarmBeatsModels, + Locations, + Operations +} from "./operationsInterfaces"; +import { AzureAgriFoodRPServiceOptionalParams } from "./models"; + +export class AzureAgriFoodRPService extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + + /** + * Initializes a new instance of the AzureAgriFoodRPService 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?: AzureAgriFoodRPServiceOptionalParams + ) { + 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: AzureAgriFoodRPServiceOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-agrifood/1.0.0-beta.1`; + 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 || "2020-05-12-preview"; + this.extensions = new ExtensionsImpl(this); + this.farmBeatsExtensions = new FarmBeatsExtensionsImpl(this); + this.farmBeatsModels = new FarmBeatsModelsImpl(this); + this.locations = new LocationsImpl(this); + this.operations = new OperationsImpl(this); + } + + extensions: Extensions; + farmBeatsExtensions: FarmBeatsExtensions; + farmBeatsModels: FarmBeatsModels; + locations: Locations; + operations: Operations; +} diff --git a/sdk/agrifood/arm-agrifood/src/index.ts b/sdk/agrifood/arm-agrifood/src/index.ts new file mode 100644 index 000000000000..1f3cbd936e47 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/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 { AzureAgriFoodRPService } from "./azureAgriFoodRPService"; +export * from "./operationsInterfaces"; diff --git a/sdk/agrifood/arm-agrifood/src/models/index.ts b/sdk/agrifood/arm-agrifood/src/models/index.ts new file mode 100644 index 000000000000..27d7b1fe910e --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/models/index.ts @@ -0,0 +1,682 @@ +/* + * 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"; + +/** 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; +} + +/** 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; +} + +/** Paged response contains list of requested objects and a URL link to get the next set of results. */ +export interface ExtensionListResponse { + /** List of requested objects. */ + value?: Extension[]; + /** + * Continuation link (absolute URI) to the next page of results in the list. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Paged response contains list of requested objects and a URL link to get the next set of results. */ +export interface FarmBeatsExtensionListResponse { + /** List of requested objects. */ + value?: FarmBeatsExtension[]; + /** + * Continuation link (absolute URI) to the next page of results in the list. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Model to capture detailed information for farmBeatsExtensions. */ +export interface DetailedInformation { + /** ApiName available for the farmBeatsExtension. */ + apiName?: string; + /** List of customParameters. */ + customParameters?: string[]; + /** List of platformParameters. */ + platformParameters?: string[]; + /** Unit systems info for the data provider. */ + unitsSupported?: UnitSystemsInfo; + /** List of apiInputParameters. */ + apiInputParameters?: string[]; +} + +/** Unit systems info for the data provider. */ +export interface UnitSystemsInfo { + /** UnitSystem key sent as part of ProviderInput. */ + key: string; + /** List of unit systems supported by this data provider. */ + values: string[]; +} + +/** FarmBeats update request. */ +export interface FarmBeatsUpdateRequestModel { + /** Geo-location where the resource lives. */ + location?: string; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** Paged response contains list of requested objects and a URL link to get the next set of results. */ +export interface FarmBeatsListResponse { + /** List of requested objects. */ + value?: FarmBeats[]; + /** + * Continuation link (absolute URI) to the next page of results in the list. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** 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; +} + +/** 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 a Azure Resource Manager proxy resource. It will not have tags and a location */ +export type ProxyResource = Resource & {}; + +/** 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; +}; + +/** Extension resource. */ +export type Extension = ProxyResource & { + /** + * 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; + /** + * The ETag value to implement optimistic concurrency. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly eTag?: string; + /** + * Extension Id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly extensionId?: string; + /** + * Extension category. e.g. weather/sensor/satellite. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly extensionCategory?: string; + /** + * Installed extension version. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly installedExtensionVersion?: string; + /** + * Extension auth link. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly extensionAuthLink?: string; + /** + * Extension api docs link. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly extensionApiDocsLink?: string; +}; + +/** FarmBeats extension resource. */ +export type FarmBeatsExtension = ProxyResource & { + /** + * 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; + /** + * Target ResourceType of the farmBeatsExtension. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly targetResourceType?: string; + /** + * FarmBeatsExtension ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly farmBeatsExtensionId?: string; + /** + * FarmBeatsExtension name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly farmBeatsExtensionName?: string; + /** + * FarmBeatsExtension version. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly farmBeatsExtensionVersion?: string; + /** + * Publisher ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publisherId?: string; + /** + * Textual description. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; + /** + * Category of the extension. e.g. weather/sensor/satellite. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly extensionCategory?: string; + /** + * FarmBeatsExtension auth link. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly extensionAuthLink?: string; + /** + * FarmBeatsExtension api docs link. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly extensionApiDocsLink?: string; + /** + * Detailed information which shows summary of requested data. + * Used in descriptive get extension metadata call. + * Information for weather category per api included are apisSupported, + * customParameters, PlatformParameters and Units supported. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedInformation?: DetailedInformation[]; +}; + +/** FarmBeats ARM Resource. */ +export type FarmBeats = TrackedResource & { + /** + * 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; + /** + * Uri of the FarmBeats instance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly instanceUri?: string; + /** + * FarmBeats instance provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +}; + +/** 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 ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Succeeded = "Succeeded", + Failed = "Failed" +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** + */ +export type ProvisioningState = string; + +/** 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 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 ExtensionsCreateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the create operation. */ +export type ExtensionsCreateResponse = Extension; + +/** Optional parameters. */ +export interface ExtensionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ExtensionsGetResponse = Extension; + +/** Optional parameters. */ +export interface ExtensionsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type ExtensionsUpdateResponse = Extension; + +/** Optional parameters. */ +export interface ExtensionsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ExtensionsListByFarmBeatsOptionalParams + extends coreClient.OperationOptions { + /** Installed extension ids. */ + extensionIds?: string[]; + /** Installed extension categories. */ + extensionCategories?: string[]; + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + */ + maxPageSize?: number; + /** Skip token for getting next set of results. */ + skipToken?: string; +} + +/** Contains response data for the listByFarmBeats operation. */ +export type ExtensionsListByFarmBeatsResponse = ExtensionListResponse; + +/** Optional parameters. */ +export interface ExtensionsListByFarmBeatsNextOptionalParams + extends coreClient.OperationOptions { + /** Installed extension ids. */ + extensionIds?: string[]; + /** Installed extension categories. */ + extensionCategories?: string[]; + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + */ + maxPageSize?: number; + /** Skip token for getting next set of results. */ + skipToken?: string; +} + +/** Contains response data for the listByFarmBeatsNext operation. */ +export type ExtensionsListByFarmBeatsNextResponse = ExtensionListResponse; + +/** Optional parameters. */ +export interface FarmBeatsExtensionsListOptionalParams + extends coreClient.OperationOptions { + /** Extension categories. */ + extensionCategories?: string[]; + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + */ + maxPageSize?: number; + /** FarmBeatsExtension ids. */ + farmBeatsExtensionIds?: string[]; + /** FarmBeats extension names. */ + farmBeatsExtensionNames?: string[]; + /** Publisher ids. */ + publisherIds?: string[]; +} + +/** Contains response data for the list operation. */ +export type FarmBeatsExtensionsListResponse = FarmBeatsExtensionListResponse; + +/** Optional parameters. */ +export interface FarmBeatsExtensionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type FarmBeatsExtensionsGetResponse = FarmBeatsExtension; + +/** Optional parameters. */ +export interface FarmBeatsExtensionsListNextOptionalParams + extends coreClient.OperationOptions { + /** Extension categories. */ + extensionCategories?: string[]; + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + */ + maxPageSize?: number; + /** FarmBeatsExtension ids. */ + farmBeatsExtensionIds?: string[]; + /** FarmBeats extension names. */ + farmBeatsExtensionNames?: string[]; + /** Publisher ids. */ + publisherIds?: string[]; +} + +/** Contains response data for the listNext operation. */ +export type FarmBeatsExtensionsListNextResponse = FarmBeatsExtensionListResponse; + +/** Optional parameters. */ +export interface FarmBeatsModelsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type FarmBeatsModelsGetResponse = FarmBeats; + +/** Optional parameters. */ +export interface FarmBeatsModelsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type FarmBeatsModelsCreateOrUpdateResponse = FarmBeats; + +/** Optional parameters. */ +export interface FarmBeatsModelsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type FarmBeatsModelsUpdateResponse = FarmBeats; + +/** Optional parameters. */ +export interface FarmBeatsModelsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface FarmBeatsModelsListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + */ + maxPageSize?: number; + /** Skip token for getting next set of results. */ + skipToken?: string; +} + +/** Contains response data for the listBySubscription operation. */ +export type FarmBeatsModelsListBySubscriptionResponse = FarmBeatsListResponse; + +/** Optional parameters. */ +export interface FarmBeatsModelsListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + */ + maxPageSize?: number; + /** Continuation token for getting next set of results. */ + skipToken?: string; +} + +/** Contains response data for the listByResourceGroup operation. */ +export type FarmBeatsModelsListByResourceGroupResponse = FarmBeatsListResponse; + +/** Optional parameters. */ +export interface FarmBeatsModelsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions { + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + */ + maxPageSize?: number; + /** Skip token for getting next set of results. */ + skipToken?: string; +} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type FarmBeatsModelsListBySubscriptionNextResponse = FarmBeatsListResponse; + +/** Optional parameters. */ +export interface FarmBeatsModelsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + */ + maxPageSize?: number; + /** Continuation token for getting next set of results. */ + skipToken?: string; +} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type FarmBeatsModelsListByResourceGroupNextResponse = FarmBeatsListResponse; + +/** Optional parameters. */ +export interface LocationsCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkNameAvailability operation. */ +export type LocationsCheckNameAvailabilityResponse = CheckNameAvailabilityResponse; + +/** 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 AzureAgriFoodRPServiceOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/agrifood/arm-agrifood/src/models/mappers.ts b/sdk/agrifood/arm-agrifood/src/models/mappers.ts new file mode 100644 index 000000000000..ace36e8e9c8f --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/models/mappers.ts @@ -0,0 +1,780 @@ +/* + * 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 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 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 ExtensionListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExtensionListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Extension" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const FarmBeatsExtensionListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FarmBeatsExtensionListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FarmBeatsExtension" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const DetailedInformation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DetailedInformation", + modelProperties: { + apiName: { + serializedName: "apiName", + type: { + name: "String" + } + }, + customParameters: { + serializedName: "customParameters", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + platformParameters: { + serializedName: "platformParameters", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + unitsSupported: { + serializedName: "unitsSupported", + type: { + name: "Composite", + className: "UnitSystemsInfo" + } + }, + apiInputParameters: { + serializedName: "apiInputParameters", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const UnitSystemsInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UnitSystemsInfo", + modelProperties: { + key: { + constraints: { + MaxLength: 100, + MinLength: 2 + }, + serializedName: "key", + required: true, + type: { + name: "String" + } + }, + values: { + serializedName: "values", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const FarmBeatsUpdateRequestModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FarmBeatsUpdateRequestModel", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const FarmBeatsListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FarmBeatsListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FarmBeats" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +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 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 ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +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 Extension: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Extension", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + eTag: { + serializedName: "eTag", + readOnly: true, + type: { + name: "String" + } + }, + extensionId: { + constraints: { + Pattern: new RegExp("^[a-zA-Z]{3,50}[.][a-zA-Z]{3,100}$") + }, + serializedName: "properties.extensionId", + readOnly: true, + type: { + name: "String" + } + }, + extensionCategory: { + serializedName: "properties.extensionCategory", + readOnly: true, + type: { + name: "String" + } + }, + installedExtensionVersion: { + constraints: { + Pattern: new RegExp("^([1-9]|10).\\d$") + }, + serializedName: "properties.installedExtensionVersion", + readOnly: true, + type: { + name: "String" + } + }, + extensionAuthLink: { + serializedName: "properties.extensionAuthLink", + readOnly: true, + type: { + name: "String" + } + }, + extensionApiDocsLink: { + serializedName: "properties.extensionApiDocsLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const FarmBeatsExtension: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FarmBeatsExtension", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + targetResourceType: { + serializedName: "properties.targetResourceType", + readOnly: true, + type: { + name: "String" + } + }, + farmBeatsExtensionId: { + constraints: { + Pattern: new RegExp("^[a-zA-Z]{3,50}[.][a-zA-Z]{3,100}$"), + MaxLength: 100, + MinLength: 2 + }, + serializedName: "properties.farmBeatsExtensionId", + readOnly: true, + type: { + name: "String" + } + }, + farmBeatsExtensionName: { + constraints: { + MaxLength: 100, + MinLength: 2 + }, + serializedName: "properties.farmBeatsExtensionName", + readOnly: true, + type: { + name: "String" + } + }, + farmBeatsExtensionVersion: { + constraints: { + Pattern: new RegExp("^([1-9]|10).\\d$"), + MaxLength: 100, + MinLength: 2 + }, + serializedName: "properties.farmBeatsExtensionVersion", + readOnly: true, + type: { + name: "String" + } + }, + publisherId: { + constraints: { + MaxLength: 100, + MinLength: 2 + }, + serializedName: "properties.publisherId", + readOnly: true, + type: { + name: "String" + } + }, + description: { + constraints: { + MaxLength: 500, + MinLength: 2 + }, + serializedName: "properties.description", + readOnly: true, + type: { + name: "String" + } + }, + extensionCategory: { + constraints: { + MaxLength: 100, + MinLength: 2 + }, + serializedName: "properties.extensionCategory", + readOnly: true, + type: { + name: "String" + } + }, + extensionAuthLink: { + serializedName: "properties.extensionAuthLink", + readOnly: true, + type: { + name: "String" + } + }, + extensionApiDocsLink: { + serializedName: "properties.extensionApiDocsLink", + readOnly: true, + type: { + name: "String" + } + }, + detailedInformation: { + serializedName: "properties.detailedInformation", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DetailedInformation" + } + } + } + } + } + } +}; + +export const FarmBeats: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FarmBeats", + modelProperties: { + ...TrackedResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + instanceUri: { + serializedName: "properties.instanceUri", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/agrifood/arm-agrifood/src/models/parameters.ts b/sdk/agrifood/arm-agrifood/src/models/parameters.ts new file mode 100644 index 000000000000..5a04da40cfde --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/models/parameters.ts @@ -0,0 +1,263 @@ +/* + * 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 { + FarmBeats as FarmBeatsMapper, + FarmBeatsUpdateRequestModel as FarmBeatsUpdateRequestModelMapper, + CheckNameAvailabilityRequest as CheckNameAvailabilityRequestMapper +} from "../models/mappers"; + +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 extensionId: OperationURLParameter = { + parameterPath: "extensionId", + mapper: { + serializedName: "extensionId", + required: true, + type: { + name: "String" + } + } +}; + +export const farmBeatsResourceName: OperationURLParameter = { + parameterPath: "farmBeatsResourceName", + mapper: { + serializedName: "farmBeatsResourceName", + 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 subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2020-05-12-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const extensionIds: OperationQueryParameter = { + parameterPath: ["options", "extensionIds"], + mapper: { + serializedName: "extensionIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + collectionFormat: "Multi" +}; + +export const extensionCategories: OperationQueryParameter = { + parameterPath: ["options", "extensionCategories"], + mapper: { + serializedName: "extensionCategories", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + collectionFormat: "Multi" +}; + +export const maxPageSize: OperationQueryParameter = { + parameterPath: ["options", "maxPageSize"], + mapper: { + defaultValue: 50, + constraints: { + InclusiveMaximum: 1000, + InclusiveMinimum: 10 + }, + serializedName: "$maxPageSize", + type: { + name: "Number" + } + } +}; + +export const skipToken: OperationQueryParameter = { + parameterPath: ["options", "skipToken"], + mapper: { + serializedName: "$skipToken", + type: { + name: "String" + } + } +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const farmBeatsExtensionIds: OperationQueryParameter = { + parameterPath: ["options", "farmBeatsExtensionIds"], + mapper: { + serializedName: "farmBeatsExtensionIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + collectionFormat: "Multi" +}; + +export const farmBeatsExtensionNames: OperationQueryParameter = { + parameterPath: ["options", "farmBeatsExtensionNames"], + mapper: { + serializedName: "farmBeatsExtensionNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + collectionFormat: "Multi" +}; + +export const publisherIds: OperationQueryParameter = { + parameterPath: ["options", "publisherIds"], + mapper: { + serializedName: "publisherIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + collectionFormat: "Multi" +}; + +export const farmBeatsExtensionId: OperationURLParameter = { + parameterPath: "farmBeatsExtensionId", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z]{3,50}[.][a-zA-Z]{3,100}$") + }, + serializedName: "farmBeatsExtensionId", + required: true, + type: { + name: "String" + } + } +}; + +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: FarmBeatsMapper +}; + +export const body1: OperationParameter = { + parameterPath: "body", + mapper: FarmBeatsUpdateRequestModelMapper +}; + +export const body2: OperationParameter = { + parameterPath: "body", + mapper: CheckNameAvailabilityRequestMapper +}; diff --git a/sdk/agrifood/arm-agrifood/src/operations/extensions.ts b/sdk/agrifood/arm-agrifood/src/operations/extensions.ts new file mode 100644 index 000000000000..a7a1e5cda035 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/operations/extensions.ts @@ -0,0 +1,375 @@ +/* + * 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 { Extensions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureAgriFoodRPService } from "../azureAgriFoodRPService"; +import { + Extension, + ExtensionsListByFarmBeatsNextOptionalParams, + ExtensionsListByFarmBeatsOptionalParams, + ExtensionsCreateOptionalParams, + ExtensionsCreateResponse, + ExtensionsGetOptionalParams, + ExtensionsGetResponse, + ExtensionsUpdateOptionalParams, + ExtensionsUpdateResponse, + ExtensionsDeleteOptionalParams, + ExtensionsListByFarmBeatsResponse, + ExtensionsListByFarmBeatsNextResponse +} from "../models"; + +/// +/** Class containing Extensions operations. */ +export class ExtensionsImpl implements Extensions { + private readonly client: AzureAgriFoodRPService; + + /** + * Initialize a new instance of the class Extensions class. + * @param client Reference to the service client + */ + constructor(client: AzureAgriFoodRPService) { + this.client = client; + } + + /** + * Get installed extensions details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param options The options parameters. + */ + public listByFarmBeats( + resourceGroupName: string, + farmBeatsResourceName: string, + options?: ExtensionsListByFarmBeatsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByFarmBeatsPagingAll( + resourceGroupName, + farmBeatsResourceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByFarmBeatsPagingPage( + resourceGroupName, + farmBeatsResourceName, + options + ); + } + }; + } + + private async *listByFarmBeatsPagingPage( + resourceGroupName: string, + farmBeatsResourceName: string, + options?: ExtensionsListByFarmBeatsOptionalParams + ): AsyncIterableIterator { + let result = await this._listByFarmBeats( + resourceGroupName, + farmBeatsResourceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByFarmBeatsNext( + resourceGroupName, + farmBeatsResourceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByFarmBeatsPagingAll( + resourceGroupName: string, + farmBeatsResourceName: string, + options?: ExtensionsListByFarmBeatsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByFarmBeatsPagingPage( + resourceGroupName, + farmBeatsResourceName, + options + )) { + yield* page; + } + } + + /** + * Install extension. + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + create( + extensionId: string, + farmBeatsResourceName: string, + resourceGroupName: string, + options?: ExtensionsCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { extensionId, farmBeatsResourceName, resourceGroupName, options }, + createOperationSpec + ); + } + + /** + * Get installed extension details by extension id. + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + get( + extensionId: string, + farmBeatsResourceName: string, + resourceGroupName: string, + options?: ExtensionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { extensionId, farmBeatsResourceName, resourceGroupName, options }, + getOperationSpec + ); + } + + /** + * Upgrade to latest extension. + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + update( + extensionId: string, + farmBeatsResourceName: string, + resourceGroupName: string, + options?: ExtensionsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { extensionId, farmBeatsResourceName, resourceGroupName, options }, + updateOperationSpec + ); + } + + /** + * Uninstall extension. + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + delete( + extensionId: string, + farmBeatsResourceName: string, + resourceGroupName: string, + options?: ExtensionsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { extensionId, farmBeatsResourceName, resourceGroupName, options }, + deleteOperationSpec + ); + } + + /** + * Get installed extensions details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param options The options parameters. + */ + private _listByFarmBeats( + resourceGroupName: string, + farmBeatsResourceName: string, + options?: ExtensionsListByFarmBeatsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, farmBeatsResourceName, options }, + listByFarmBeatsOperationSpec + ); + } + + /** + * ListByFarmBeatsNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param nextLink The nextLink from the previous successful call to the ListByFarmBeats method. + * @param options The options parameters. + */ + private _listByFarmBeatsNext( + resourceGroupName: string, + farmBeatsResourceName: string, + nextLink: string, + options?: ExtensionsListByFarmBeatsNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, farmBeatsResourceName, nextLink, options }, + listByFarmBeatsNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/extensions/{extensionId}", + httpMethod: "PUT", + responses: { + 201: { + bodyMapper: Mappers.Extension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.extensionId, + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/extensions/{extensionId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Extension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.extensionId, + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/extensions/{extensionId}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Extension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.extensionId, + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/extensions/{extensionId}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.extensionId, + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByFarmBeatsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/extensions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExtensionListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.extensionIds, + Parameters.extensionCategories, + Parameters.maxPageSize, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByFarmBeatsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExtensionListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.extensionIds, + Parameters.extensionCategories, + Parameters.maxPageSize, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/agrifood/arm-agrifood/src/operations/farmBeatsExtensions.ts b/sdk/agrifood/arm-agrifood/src/operations/farmBeatsExtensions.ts new file mode 100644 index 000000000000..4f6677470508 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/operations/farmBeatsExtensions.ts @@ -0,0 +1,185 @@ +/* + * 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 { FarmBeatsExtensions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureAgriFoodRPService } from "../azureAgriFoodRPService"; +import { + FarmBeatsExtension, + FarmBeatsExtensionsListNextOptionalParams, + FarmBeatsExtensionsListOptionalParams, + FarmBeatsExtensionsListResponse, + FarmBeatsExtensionsGetOptionalParams, + FarmBeatsExtensionsGetResponse, + FarmBeatsExtensionsListNextResponse +} from "../models"; + +/// +/** Class containing FarmBeatsExtensions operations. */ +export class FarmBeatsExtensionsImpl implements FarmBeatsExtensions { + private readonly client: AzureAgriFoodRPService; + + /** + * Initialize a new instance of the class FarmBeatsExtensions class. + * @param client Reference to the service client + */ + constructor(client: AzureAgriFoodRPService) { + this.client = client; + } + + /** + * Get list of farmBeats extension. + * @param options The options parameters. + */ + public list( + options?: FarmBeatsExtensionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: FarmBeatsExtensionsListOptionalParams + ): 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?: FarmBeatsExtensionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Get list of farmBeats extension. + * @param options The options parameters. + */ + private _list( + options?: FarmBeatsExtensionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Get farmBeats extension. + * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * @param options The options parameters. + */ + get( + farmBeatsExtensionId: string, + options?: FarmBeatsExtensionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { farmBeatsExtensionId, options }, + getOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: FarmBeatsExtensionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.AgFoodPlatform/farmBeatsExtensionDefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FarmBeatsExtensionListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.extensionCategories, + Parameters.maxPageSize, + Parameters.farmBeatsExtensionIds, + Parameters.farmBeatsExtensionNames, + Parameters.publisherIds + ], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.AgFoodPlatform/farmBeatsExtensionDefinitions/{farmBeatsExtensionId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FarmBeatsExtension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.farmBeatsExtensionId], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FarmBeatsExtensionListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.extensionCategories, + Parameters.maxPageSize, + Parameters.farmBeatsExtensionIds, + Parameters.farmBeatsExtensionNames, + Parameters.publisherIds + ], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/agrifood/arm-agrifood/src/operations/farmBeatsModels.ts b/sdk/agrifood/arm-agrifood/src/operations/farmBeatsModels.ts new file mode 100644 index 000000000000..14a4e3b15d8e --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/operations/farmBeatsModels.ts @@ -0,0 +1,466 @@ +/* + * 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 { FarmBeatsModels } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureAgriFoodRPService } from "../azureAgriFoodRPService"; +import { + FarmBeats, + FarmBeatsModelsListBySubscriptionNextOptionalParams, + FarmBeatsModelsListBySubscriptionOptionalParams, + FarmBeatsModelsListByResourceGroupNextOptionalParams, + FarmBeatsModelsListByResourceGroupOptionalParams, + FarmBeatsModelsGetOptionalParams, + FarmBeatsModelsGetResponse, + FarmBeatsModelsCreateOrUpdateOptionalParams, + FarmBeatsModelsCreateOrUpdateResponse, + FarmBeatsUpdateRequestModel, + FarmBeatsModelsUpdateOptionalParams, + FarmBeatsModelsUpdateResponse, + FarmBeatsModelsDeleteOptionalParams, + FarmBeatsModelsListBySubscriptionResponse, + FarmBeatsModelsListByResourceGroupResponse, + FarmBeatsModelsListBySubscriptionNextResponse, + FarmBeatsModelsListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing FarmBeatsModels operations. */ +export class FarmBeatsModelsImpl implements FarmBeatsModels { + private readonly client: AzureAgriFoodRPService; + + /** + * Initialize a new instance of the class FarmBeatsModels class. + * @param client Reference to the service client + */ + constructor(client: AzureAgriFoodRPService) { + this.client = client; + } + + /** + * Lists the FarmBeats instances for a subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: FarmBeatsModelsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: FarmBeatsModelsListBySubscriptionOptionalParams + ): 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?: FarmBeatsModelsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Lists the FarmBeats instances for a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: FarmBeatsModelsListByResourceGroupOptionalParams + ): 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?: FarmBeatsModelsListByResourceGroupOptionalParams + ): 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?: FarmBeatsModelsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Get FarmBeats resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + farmBeatsResourceName: string, + options?: FarmBeatsModelsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, farmBeatsResourceName, options }, + getOperationSpec + ); + } + + /** + * Create or update FarmBeats resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param body FarmBeats resource create or update request object. + * @param options The options parameters. + */ + createOrUpdate( + farmBeatsResourceName: string, + resourceGroupName: string, + body: FarmBeats, + options?: FarmBeatsModelsCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { farmBeatsResourceName, resourceGroupName, body, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Update a FarmBeats resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param body Request object. + * @param options The options parameters. + */ + update( + farmBeatsResourceName: string, + resourceGroupName: string, + body: FarmBeatsUpdateRequestModel, + options?: FarmBeatsModelsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { farmBeatsResourceName, resourceGroupName, body, options }, + updateOperationSpec + ); + } + + /** + * Delete a FarmBeats resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + farmBeatsResourceName: string, + options?: FarmBeatsModelsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, farmBeatsResourceName, options }, + deleteOperationSpec + ); + } + + /** + * Lists the FarmBeats instances for a subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: FarmBeatsModelsListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Lists the FarmBeats instances for a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: FarmBeatsModelsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: FarmBeatsModelsListBySubscriptionNextOptionalParams + ): 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?: FarmBeatsModelsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FarmBeats + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.FarmBeats + }, + 201: { + bodyMapper: Mappers.FarmBeats + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.FarmBeats + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AgFoodPlatform/farmBeats", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FarmBeatsListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.maxPageSize, + Parameters.skipToken + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FarmBeatsListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.maxPageSize, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FarmBeatsListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.maxPageSize, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FarmBeatsListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.maxPageSize, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/agrifood/arm-agrifood/src/operations/index.ts b/sdk/agrifood/arm-agrifood/src/operations/index.ts new file mode 100644 index 000000000000..3c7b56fc6bf9 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/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 "./extensions"; +export * from "./farmBeatsExtensions"; +export * from "./farmBeatsModels"; +export * from "./locations"; +export * from "./operations"; diff --git a/sdk/agrifood/arm-agrifood/src/operations/locations.ts b/sdk/agrifood/arm-agrifood/src/operations/locations.ts new file mode 100644 index 000000000000..5b0d769704d7 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/operations/locations.ts @@ -0,0 +1,68 @@ +/* + * 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 { Locations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureAgriFoodRPService } from "../azureAgriFoodRPService"; +import { + CheckNameAvailabilityRequest, + LocationsCheckNameAvailabilityOptionalParams, + LocationsCheckNameAvailabilityResponse +} from "../models"; + +/** Class containing Locations operations. */ +export class LocationsImpl implements Locations { + private readonly client: AzureAgriFoodRPService; + + /** + * Initialize a new instance of the class Locations class. + * @param client Reference to the service client + */ + constructor(client: AzureAgriFoodRPService) { + this.client = client; + } + + /** + * Checks the name availability of the resource with requested resource name. + * @param body NameAvailabilityRequest object. + * @param options The options parameters. + */ + checkNameAvailability( + body: CheckNameAvailabilityRequest, + options?: LocationsCheckNameAvailabilityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { body, options }, + checkNameAvailabilityOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AgFoodPlatform/checkNameAvailability", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CheckNameAvailabilityResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/agrifood/arm-agrifood/src/operations/operations.ts b/sdk/agrifood/arm-agrifood/src/operations/operations.ts new file mode 100644 index 000000000000..497d8c360b1c --- /dev/null +++ b/sdk/agrifood/arm-agrifood/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 { AzureAgriFoodRPService } from "../azureAgriFoodRPService"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: AzureAgriFoodRPService; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: AzureAgriFoodRPService) { + this.client = client; + } + + /** + * Lists the available operations of Microsoft.AgFoodPlatform resource provider. + * @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; + } + } + + /** + * Lists the available operations of Microsoft.AgFoodPlatform resource provider. + * @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.AgFoodPlatform/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/agrifood/arm-agrifood/src/operationsInterfaces/extensions.ts b/sdk/agrifood/arm-agrifood/src/operationsInterfaces/extensions.ts new file mode 100644 index 000000000000..a00e3a753c38 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/operationsInterfaces/extensions.ts @@ -0,0 +1,88 @@ +/* + * 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 { + Extension, + ExtensionsListByFarmBeatsOptionalParams, + ExtensionsCreateOptionalParams, + ExtensionsCreateResponse, + ExtensionsGetOptionalParams, + ExtensionsGetResponse, + ExtensionsUpdateOptionalParams, + ExtensionsUpdateResponse, + ExtensionsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Extensions. */ +export interface Extensions { + /** + * Get installed extensions details. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param options The options parameters. + */ + listByFarmBeats( + resourceGroupName: string, + farmBeatsResourceName: string, + options?: ExtensionsListByFarmBeatsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Install extension. + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + create( + extensionId: string, + farmBeatsResourceName: string, + resourceGroupName: string, + options?: ExtensionsCreateOptionalParams + ): Promise; + /** + * Get installed extension details by extension id. + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + get( + extensionId: string, + farmBeatsResourceName: string, + resourceGroupName: string, + options?: ExtensionsGetOptionalParams + ): Promise; + /** + * Upgrade to latest extension. + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + update( + extensionId: string, + farmBeatsResourceName: string, + resourceGroupName: string, + options?: ExtensionsUpdateOptionalParams + ): Promise; + /** + * Uninstall extension. + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + delete( + extensionId: string, + farmBeatsResourceName: string, + resourceGroupName: string, + options?: ExtensionsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/agrifood/arm-agrifood/src/operationsInterfaces/farmBeatsExtensions.ts b/sdk/agrifood/arm-agrifood/src/operationsInterfaces/farmBeatsExtensions.ts new file mode 100644 index 000000000000..297061be8aa3 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/operationsInterfaces/farmBeatsExtensions.ts @@ -0,0 +1,36 @@ +/* + * 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 { + FarmBeatsExtension, + FarmBeatsExtensionsListOptionalParams, + FarmBeatsExtensionsGetOptionalParams, + FarmBeatsExtensionsGetResponse +} from "../models"; + +/// +/** Interface representing a FarmBeatsExtensions. */ +export interface FarmBeatsExtensions { + /** + * Get list of farmBeats extension. + * @param options The options parameters. + */ + list( + options?: FarmBeatsExtensionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get farmBeats extension. + * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * @param options The options parameters. + */ + get( + farmBeatsExtensionId: string, + options?: FarmBeatsExtensionsGetOptionalParams + ): Promise; +} diff --git a/sdk/agrifood/arm-agrifood/src/operationsInterfaces/farmBeatsModels.ts b/sdk/agrifood/arm-agrifood/src/operationsInterfaces/farmBeatsModels.ts new file mode 100644 index 000000000000..19bd04d5848b --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/operationsInterfaces/farmBeatsModels.ts @@ -0,0 +1,91 @@ +/* + * 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 { + FarmBeats, + FarmBeatsModelsListBySubscriptionOptionalParams, + FarmBeatsModelsListByResourceGroupOptionalParams, + FarmBeatsModelsGetOptionalParams, + FarmBeatsModelsGetResponse, + FarmBeatsModelsCreateOrUpdateOptionalParams, + FarmBeatsModelsCreateOrUpdateResponse, + FarmBeatsUpdateRequestModel, + FarmBeatsModelsUpdateOptionalParams, + FarmBeatsModelsUpdateResponse, + FarmBeatsModelsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a FarmBeatsModels. */ +export interface FarmBeatsModels { + /** + * Lists the FarmBeats instances for a subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: FarmBeatsModelsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the FarmBeats instances for a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: FarmBeatsModelsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get FarmBeats resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + farmBeatsResourceName: string, + options?: FarmBeatsModelsGetOptionalParams + ): Promise; + /** + * Create or update FarmBeats resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param body FarmBeats resource create or update request object. + * @param options The options parameters. + */ + createOrUpdate( + farmBeatsResourceName: string, + resourceGroupName: string, + body: FarmBeats, + options?: FarmBeatsModelsCreateOrUpdateOptionalParams + ): Promise; + /** + * Update a FarmBeats resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param body Request object. + * @param options The options parameters. + */ + update( + farmBeatsResourceName: string, + resourceGroupName: string, + body: FarmBeatsUpdateRequestModel, + options?: FarmBeatsModelsUpdateOptionalParams + ): Promise; + /** + * Delete a FarmBeats resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + farmBeatsResourceName: string, + options?: FarmBeatsModelsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/agrifood/arm-agrifood/src/operationsInterfaces/index.ts b/sdk/agrifood/arm-agrifood/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..3c7b56fc6bf9 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/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 "./extensions"; +export * from "./farmBeatsExtensions"; +export * from "./farmBeatsModels"; +export * from "./locations"; +export * from "./operations"; diff --git a/sdk/agrifood/arm-agrifood/src/operationsInterfaces/locations.ts b/sdk/agrifood/arm-agrifood/src/operationsInterfaces/locations.ts new file mode 100644 index 000000000000..37298457c7c5 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/operationsInterfaces/locations.ts @@ -0,0 +1,26 @@ +/* + * 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 { + CheckNameAvailabilityRequest, + LocationsCheckNameAvailabilityOptionalParams, + LocationsCheckNameAvailabilityResponse +} from "../models"; + +/** Interface representing a Locations. */ +export interface Locations { + /** + * Checks the name availability of the resource with requested resource name. + * @param body NameAvailabilityRequest object. + * @param options The options parameters. + */ + checkNameAvailability( + body: CheckNameAvailabilityRequest, + options?: LocationsCheckNameAvailabilityOptionalParams + ): Promise; +} diff --git a/sdk/agrifood/arm-agrifood/src/operationsInterfaces/operations.ts b/sdk/agrifood/arm-agrifood/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..59cc6551a887 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/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 { + /** + * Lists the available operations of Microsoft.AgFoodPlatform resource provider. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/agrifood/arm-agrifood/test/sampleTest.ts b/sdk/agrifood/arm-agrifood/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/agrifood/arm-agrifood/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/agrifood/arm-agrifood/tsconfig.json b/sdk/agrifood/arm-agrifood/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/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/agrifood/ci.mgmt.yml b/sdk/agrifood/ci.mgmt.yml new file mode 100644 index 000000000000..2c68a192dc5a --- /dev/null +++ b/sdk/agrifood/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/agrifood/arm-agrifood + - sdk/agrifood/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/agrifood/arm-agrifood + - sdk/agrifood/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: agrifood + Artifacts: + - name: azure-arm-agrifood + safeName: azurearmagrifood + \ No newline at end of file diff --git a/sdk/agrifood/ci.yml b/sdk/agrifood/ci.yml index 26bf7480dc51..1eb64aa303a9 100644 --- a/sdk/agrifood/ci.yml +++ b/sdk/agrifood/ci.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -9,7 +9,9 @@ trigger: paths: include: - sdk/agrifood/ - + exclude: + - sdk/agrifood/arm-agrifood + - sdk/agrifood/ci.mgmt.yml pr: branches: include: @@ -20,11 +22,13 @@ pr: paths: include: - sdk/agrifood/ - + exclude: + - sdk/agrifood/arm-agrifood + - sdk/agrifood/ci.mgmt.yml extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: agrifood Artifacts: - name: azure-rest-agrifood-farming - safeName: azurerestagrifoodfarming \ No newline at end of file + safeName: azurerestagrifoodfarming