* release agrifood package

* update files

* updae files
This commit is contained in:
kazrael2119 2022-09-02 10:30:57 +08:00 коммит произвёл GitHub
Родитель 909a485ee9
Коммит f8d30b0d1c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
112 изменённых файлов: 8845 добавлений и 4 удалений

Просмотреть файл

@ -13,6 +13,7 @@ specifiers:
'@rush-temp/api-management-custom-widgets-tools': file:./projects/api-management-custom-widgets-tools.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
@ -318,6 +319,7 @@ dependencies:
'@rush-temp/api-management-custom-widgets-tools': file:projects/api-management-custom-widgets-tools.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
@ -10196,6 +10198,33 @@ packages:
- supports-color
dev: false
file:projects/arm-agrifood.tgz:
resolution: {integrity: sha512-hE60+8FUOvs27D/VtrifObE8lvdK4bQlF08eOgF/ht2RHv1UKfL6WBiPVyn483gx5GNlHnaOyAhqQ8h6urO2PA==, tarball: file:projects/arm-agrifood.tgz}
name: '@rush-temp/arm-agrifood'
version: 0.0.0
dependencies:
'@azure/identity': 2.1.0
'@microsoft/api-extractor': 7.18.11
'@rollup/plugin-commonjs': 21.1.0_rollup@2.77.2
'@rollup/plugin-json': 4.1.0_rollup@2.77.2
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.77.2
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.2
'@types/chai': 4.3.1
chai: 4.3.6
cross-env: 7.0.3
mkdirp: 1.0.4
mocha: 7.2.0
rimraf: 3.0.2
rollup: 2.77.2
rollup-plugin-sourcemaps: 0.6.3_rollup@2.77.2
tslib: 2.4.0
typescript: 4.6.4
uglify-js: 3.16.3
transitivePeerDependencies:
- '@types/node'
- supports-color
dev: false
file:projects/arm-analysisservices.tgz:
resolution: {integrity: sha512-viRAvNGB1DXLH+s6KmOfwO1dFqiOD5alwo0OD4XmQWw8rBtxMY5ws7jWw2XwB0VVYrWyDAAmDVgDQ+PptMTGEw==, tarball: file:projects/arm-analysisservices.tgz}
name: '@rush-temp/arm-analysisservices'

Просмотреть файл

@ -21,3 +21,4 @@ https://docs.microsoft.com/javascript/api/@azure/arm-devcenter?view=azure-node-p
https://docs.microsoft.com/javascript/api/@azure/arm-connectedvmware?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-nginx
https://docs.microsoft.com/javascript/api/@azure/arm-nginx?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-agrifood?view=azure-node-preview

Просмотреть файл

@ -1835,6 +1835,11 @@
"packageName": "@azure/arm-nginx",
"projectFolder": "sdk/nginx/arm-nginx",
"versionPolicyName": "management"
},
{
"packageName": "@azure/arm-agrifood",
"projectFolder": "sdk/agrifood/arm-agrifood",
"versionPolicyName": "management"
}
]
}

Просмотреть файл

@ -0,0 +1,5 @@
# Release History
## 1.0.0-beta.1 (2022-08-31)
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).

Просмотреть файл

@ -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.

Просмотреть файл

@ -0,0 +1,109 @@
# Azure AgriFoodMgmt client library for JavaScript
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure AgriFoodMgmt client.
APIs documentation for Azure AgFoodPlatform 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.
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
### Prerequisites
- An [Azure subscription][azure_sub].
### Install the `@azure/arm-agrifood` package
Install the Azure AgriFoodMgmt client library for JavaScript with `npm`:
```bash
npm install @azure/arm-agrifood
```
### Create and authenticate a `AgriFoodMgmtClient`
To create a client object to access the Azure AgriFoodMgmt API, you will need the `endpoint` of your Azure AgriFoodMgmt resource and a `credential`. The Azure AgriFoodMgmt client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your Azure AgriFoodMgmt 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 AgriFoodMgmt** 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 { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new AgriFoodMgmtClient(new DefaultAzureCredential(), subscriptionId);
// For client-side applications running in the browser, use this code instead:
// const credential = new InteractiveBrowserCredential({
// tenantId: "<YOUR_TENANT_ID>",
// clientId: "<YOUR_CLIENT_ID>"
// });
// const client = new AgriFoodMgmtClient(credential, 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
### AgriFoodMgmtClient
`AgriFoodMgmtClient` is the primary interface for developers using the Azure AgriFoodMgmt client library. Explore the methods on this client object to understand the different features of the Azure AgriFoodMgmt 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

Просмотреть файл

@ -0,0 +1,8 @@
{
"commit": "450b1618259d8b170b5cfcb37866d3fc5747b564",
"readme": "specification/agrifood/resource-manager/readme.md",
"autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\agrifood\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220727.1 --generate-sample=true",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.2",
"use": "@autorest/typescript@6.0.0-rc.1.20220727.1"
}

Просмотреть файл

@ -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"
}
}
}
}

Просмотреть файл

@ -0,0 +1,121 @@
{
"name": "@azure/arm-agrifood",
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for AgriFoodMgmtClient.",
"version": "1.0.0-beta.1",
"engines": {
"node": ">=12.0.0"
},
"dependencies": {
"@azure/core-lro": "^2.2.0",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.5.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.8.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": "^21.0.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-multi-entry": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"mkdirp": "^1.0.4",
"rollup": "^2.66.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"typescript": "~4.6.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^2.0.0",
"@azure-tools/test-credential": "^1.0.0",
"mocha": "^7.1.1",
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@azure/dev-tool": "^1.0.0"
},
"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": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"integration-test:browser": "echo skipped"
},
"sideEffects": false,
"//metadata": {
"constantPaths": [
{
"path": "src/agriFoodMgmtClient.ts",
"prefix": "packageDetails"
}
]
},
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-agrifood?view=azure-node-preview"
}
}

Просмотреть файл

@ -0,0 +1,4 @@
{
"Entries": [],
"Variables": {}
}

Просмотреть файл

@ -0,0 +1,625 @@
## 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';
import { PollerLike } from '@azure/core-lro';
import { PollOperationState } from '@azure/core-lro';
// @public
export type ActionType = string;
// @public (undocumented)
export class AgriFoodMgmtClient extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AgriFoodMgmtClientOptionalParams);
// (undocumented)
apiVersion: string;
// (undocumented)
extensions: Extensions;
// (undocumented)
farmBeatsExtensions: FarmBeatsExtensions;
// (undocumented)
farmBeatsModels: FarmBeatsModels;
// (undocumented)
locations: Locations;
// (undocumented)
operations: Operations;
// (undocumented)
privateEndpointConnections: PrivateEndpointConnections;
// (undocumented)
privateLinkResources: PrivateLinkResources;
// (undocumented)
subscriptionId: string;
}
// @public
export interface AgriFoodMgmtClientOptionalParams extends coreClient.ServiceClientOptions {
$host?: string;
apiVersion?: string;
endpoint?: string;
}
// @public
export interface ArmAsyncOperation {
status?: 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<string, unknown>;
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 interface Extension extends ProxyResource {
readonly eTag?: string;
readonly extensionApiDocsLink?: string;
readonly extensionAuthLink?: string;
readonly extensionCategory?: string;
readonly extensionId?: string;
readonly installedExtensionVersion?: string;
}
// @public
export interface ExtensionListResponse {
readonly nextLink?: string;
value?: Extension[];
}
// @public
export interface Extensions {
create(resourceGroupName: string, farmBeatsResourceName: string, extensionId: string, options?: ExtensionsCreateOptionalParams): Promise<ExtensionsCreateResponse>;
delete(resourceGroupName: string, farmBeatsResourceName: string, extensionId: string, options?: ExtensionsDeleteOptionalParams): Promise<void>;
get(resourceGroupName: string, farmBeatsResourceName: string, extensionId: string, options?: ExtensionsGetOptionalParams): Promise<ExtensionsGetResponse>;
listByFarmBeats(resourceGroupName: string, farmBeatsResourceName: string, options?: ExtensionsListByFarmBeatsOptionalParams): PagedAsyncIterableIterator<Extension>;
update(resourceGroupName: string, farmBeatsResourceName: string, extensionId: string, options?: ExtensionsUpdateOptionalParams): Promise<ExtensionsUpdateResponse>;
}
// @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 interface FarmBeats extends TrackedResource {
identity?: Identity;
readonly instanceUri?: string;
readonly privateEndpointConnections?: PrivateEndpointConnection;
readonly provisioningState?: ProvisioningState;
publicNetworkAccess?: PublicNetworkAccess;
sensorIntegration?: SensorIntegration;
}
// @public
export interface FarmBeatsExtension extends ProxyResource {
readonly description?: string;
readonly detailedInformation?: DetailedInformation[];
readonly extensionApiDocsLink?: string;
readonly extensionAuthLink?: string;
readonly extensionCategory?: string;
readonly farmBeatsExtensionId?: string;
readonly farmBeatsExtensionName?: string;
readonly farmBeatsExtensionVersion?: string;
readonly publisherId?: string;
readonly targetResourceType?: string;
}
// @public
export interface FarmBeatsExtensionListResponse {
readonly nextLink?: string;
value?: FarmBeatsExtension[];
}
// @public
export interface FarmBeatsExtensions {
get(farmBeatsExtensionId: string, options?: FarmBeatsExtensionsGetOptionalParams): Promise<FarmBeatsExtensionsGetResponse>;
list(options?: FarmBeatsExtensionsListOptionalParams): PagedAsyncIterableIterator<FarmBeatsExtension>;
}
// @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 {
beginUpdate(resourceGroupName: string, farmBeatsResourceName: string, body: FarmBeatsUpdateRequestModel, options?: FarmBeatsModelsUpdateOptionalParams): Promise<PollerLike<PollOperationState<FarmBeatsModelsUpdateResponse>, FarmBeatsModelsUpdateResponse>>;
beginUpdateAndWait(resourceGroupName: string, farmBeatsResourceName: string, body: FarmBeatsUpdateRequestModel, options?: FarmBeatsModelsUpdateOptionalParams): Promise<FarmBeatsModelsUpdateResponse>;
createOrUpdate(resourceGroupName: string, farmBeatsResourceName: string, body: FarmBeats, options?: FarmBeatsModelsCreateOrUpdateOptionalParams): Promise<FarmBeatsModelsCreateOrUpdateResponse>;
delete(resourceGroupName: string, farmBeatsResourceName: string, options?: FarmBeatsModelsDeleteOptionalParams): Promise<void>;
get(resourceGroupName: string, farmBeatsResourceName: string, options?: FarmBeatsModelsGetOptionalParams): Promise<FarmBeatsModelsGetResponse>;
getOperationResult(resourceGroupName: string, farmBeatsResourceName: string, operationResultsId: string, options?: FarmBeatsModelsGetOperationResultOptionalParams): Promise<FarmBeatsModelsGetOperationResultResponse>;
listByResourceGroup(resourceGroupName: string, options?: FarmBeatsModelsListByResourceGroupOptionalParams): PagedAsyncIterableIterator<FarmBeats>;
listBySubscription(options?: FarmBeatsModelsListBySubscriptionOptionalParams): PagedAsyncIterableIterator<FarmBeats>;
}
// @public
export interface FarmBeatsModelsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {
}
// @public
export type FarmBeatsModelsCreateOrUpdateResponse = FarmBeats;
// @public
export interface FarmBeatsModelsDeleteOptionalParams extends coreClient.OperationOptions {
}
// @public
export interface FarmBeatsModelsGetOperationResultOptionalParams extends coreClient.OperationOptions {
}
// @public
export type FarmBeatsModelsGetOperationResultResponse = ArmAsyncOperation;
// @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 FarmBeatsModelsUpdateHeaders {
// (undocumented)
location?: string;
}
// @public
export interface FarmBeatsModelsUpdateOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
updateIntervalInMs?: number;
}
// @public
export type FarmBeatsModelsUpdateResponse = FarmBeats;
// @public
export interface FarmBeatsUpdateProperties {
publicNetworkAccess?: PublicNetworkAccess;
sensorIntegration?: SensorIntegration;
}
// @public
export interface FarmBeatsUpdateRequestModel {
identity?: Identity;
location?: string;
properties?: FarmBeatsUpdateProperties;
tags?: {
[propertyName: string]: string;
};
}
// @public
export interface Identity {
readonly principalId?: string;
readonly tenantId?: string;
type?: "SystemAssigned";
}
// @public
export enum KnownActionType {
Internal = "Internal"
}
// @public
export enum KnownCheckNameAvailabilityReason {
AlreadyExists = "AlreadyExists",
Invalid = "Invalid"
}
// @public
export enum KnownCreatedByType {
Application = "Application",
Key = "Key",
ManagedIdentity = "ManagedIdentity",
User = "User"
}
// @public
export enum KnownOrigin {
System = "system",
User = "user",
UserSystem = "user,system"
}
// @public
export enum KnownPrivateEndpointConnectionProvisioningState {
Creating = "Creating",
Deleting = "Deleting",
Failed = "Failed",
Succeeded = "Succeeded"
}
// @public
export enum KnownPrivateEndpointServiceConnectionStatus {
Approved = "Approved",
Pending = "Pending",
Rejected = "Rejected"
}
// @public
export enum KnownProvisioningState {
Creating = "Creating",
Deleting = "Deleting",
Failed = "Failed",
Succeeded = "Succeeded",
Updating = "Updating"
}
// @public
export enum KnownPublicNetworkAccess {
Enabled = "Enabled",
Hybrid = "Hybrid"
}
// @public
export interface Locations {
checkNameAvailability(body: CheckNameAvailabilityRequest, options?: LocationsCheckNameAvailabilityOptionalParams): Promise<LocationsCheckNameAvailabilityResponse>;
}
// @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<Operation>;
}
// @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 interface PrivateEndpoint {
readonly id?: string;
}
// @public
export interface PrivateEndpointConnection extends Resource {
privateEndpoint?: PrivateEndpoint;
privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState;
readonly provisioningState?: PrivateEndpointConnectionProvisioningState;
}
// @public
export interface PrivateEndpointConnectionListResult {
value?: PrivateEndpointConnection[];
}
// @public
export type PrivateEndpointConnectionProvisioningState = string;
// @public
export interface PrivateEndpointConnections {
beginDelete(resourceGroupName: string, farmBeatsResourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
beginDeleteAndWait(resourceGroupName: string, farmBeatsResourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise<void>;
createOrUpdate(resourceGroupName: string, farmBeatsResourceName: string, privateEndpointConnectionName: string, body: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise<PrivateEndpointConnectionsCreateOrUpdateResponse>;
get(resourceGroupName: string, farmBeatsResourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise<PrivateEndpointConnectionsGetResponse>;
listByResource(resourceGroupName: string, farmBeatsResourceName: string, options?: PrivateEndpointConnectionsListByResourceOptionalParams): PagedAsyncIterableIterator<PrivateEndpointConnection>;
}
// @public
export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {
}
// @public
export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection;
// @public
export interface PrivateEndpointConnectionsDeleteHeaders {
// (undocumented)
location?: string;
}
// @public
export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
updateIntervalInMs?: number;
}
// @public
export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions {
}
// @public
export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection;
// @public
export interface PrivateEndpointConnectionsListByResourceOptionalParams extends coreClient.OperationOptions {
}
// @public
export type PrivateEndpointConnectionsListByResourceResponse = PrivateEndpointConnectionListResult;
// @public
export type PrivateEndpointServiceConnectionStatus = string;
// @public
export interface PrivateLinkResource extends Resource {
readonly groupId?: string;
readonly requiredMembers?: string[];
requiredZoneNames?: string[];
}
// @public
export interface PrivateLinkResourceListResult {
value?: PrivateLinkResource[];
}
// @public
export interface PrivateLinkResources {
get(resourceGroupName: string, farmBeatsResourceName: string, subResourceName: string, options?: PrivateLinkResourcesGetOptionalParams): Promise<PrivateLinkResourcesGetResponse>;
listByResource(resourceGroupName: string, farmBeatsResourceName: string, options?: PrivateLinkResourcesListByResourceOptionalParams): PagedAsyncIterableIterator<PrivateLinkResource>;
}
// @public
export interface PrivateLinkResourcesGetOptionalParams extends coreClient.OperationOptions {
}
// @public
export type PrivateLinkResourcesGetResponse = PrivateLinkResource;
// @public
export interface PrivateLinkResourcesListByResourceOptionalParams extends coreClient.OperationOptions {
}
// @public
export type PrivateLinkResourcesListByResourceResponse = PrivateLinkResourceListResult;
// @public
export interface PrivateLinkServiceConnectionState {
actionsRequired?: string;
description?: string;
status?: PrivateEndpointServiceConnectionStatus;
}
// @public
export type ProvisioningState = string;
// @public
export interface ProxyResource extends Resource {
}
// @public
export type PublicNetworkAccess = string;
// @public
export interface Resource {
readonly id?: string;
readonly name?: string;
readonly systemData?: SystemData;
readonly type?: string;
}
// @public
export interface SensorIntegration {
enabled?: string;
provisioningInfo?: ErrorResponse;
readonly provisioningState?: ProvisioningState;
}
// @public
export interface SystemData {
createdAt?: Date;
createdBy?: string;
createdByType?: CreatedByType;
lastModifiedAt?: Date;
lastModifiedBy?: string;
lastModifiedByType?: CreatedByType;
}
// @public
export interface TrackedResource extends Resource {
location: string;
tags?: {
[propertyName: string]: string;
};
}
// @public
export interface UnitSystemsInfo {
key: string;
values: string[];
}
// (No @packageDocumentation comment for this package)
```

Просмотреть файл

@ -0,0 +1,122 @@
/*
* 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";
// #region Warning Handler
/**
* A function that can determine whether a rollup warning should be ignored. If
* the function returns `true`, then the warning will not be displayed.
*/
function ignoreNiseSinonEval(warning) {
return (
warning.code === "EVAL" &&
warning.id &&
(warning.id.includes("node_modules/nise") ||
warning.id.includes("node_modules/sinon")) === true
);
}
function ignoreChaiCircularDependency(warning) {
return (
warning.code === "CIRCULAR_DEPENDENCY" &&
warning.importer && warning.importer.includes("node_modules/chai") === true
);
}
const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
/**
* 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(),
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()]
};
const config = [baseConfig];
if (!options.disableBrowserBundle) {
config.push(makeBrowserTestConfig());
}
return config;
}
export default makeConfig(require("./package.json"));

Просмотреть файл

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Install extension.
*
* @summary Install extension.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Create.json
*/
async function extensionsCreate() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const extensionId = "provider.extension";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.extensions.create(
resourceGroupName,
farmBeatsResourceName,
extensionId
);
console.log(result);
}
extensionsCreate().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Uninstall extension.
*
* @summary Uninstall extension.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Delete.json
*/
async function extensionsDelete() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const extensionId = "provider.extension";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.extensions.delete(
resourceGroupName,
farmBeatsResourceName,
extensionId
);
console.log(result);
}
extensionsDelete().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get installed extension details by extension id.
*
* @summary Get installed extension details by extension id.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Get.json
*/
async function extensionsGet() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const extensionId = "provider.extension";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.extensions.get(
resourceGroupName,
farmBeatsResourceName,
extensionId
);
console.log(result);
}
extensionsGet().catch(console.error);

Просмотреть файл

@ -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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get installed extensions details.
*
* @summary Get installed extensions details.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_ListByFarmBeats.json
*/
async function extensionsListByFarmBeats() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.extensions.listByFarmBeats(
resourceGroupName,
farmBeatsResourceName
)) {
resArray.push(item);
}
console.log(resArray);
}
extensionsListByFarmBeats().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Upgrade to latest extension.
*
* @summary Upgrade to latest extension.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Update.json
*/
async function extensionsUpdate() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const extensionId = "provider.extension";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.extensions.update(
resourceGroupName,
farmBeatsResourceName,
extensionId
);
console.log(result);
}
extensionsUpdate().catch(console.error);

Просмотреть файл

@ -0,0 +1,29 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get farmBeats extension.
*
* @summary Get farmBeats extension.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsExtensions_Get.json
*/
async function farmBeatsExtensionsGet() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const farmBeatsExtensionId = "DTN.ContentServices";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsExtensions.get(farmBeatsExtensionId);
console.log(result);
}
farmBeatsExtensionsGet().catch(console.error);

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get list of farmBeats extension.
*
* @summary Get list of farmBeats extension.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsExtensions_List.json
*/
async function farmBeatsExtensionsList() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.farmBeatsExtensions.list()) {
resArray.push(item);
}
console.log(resArray);
}
farmBeatsExtensionsList().catch(console.error);

Просмотреть файл

@ -0,0 +1,38 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { FarmBeats, AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create or update FarmBeats resource.
*
* @summary Create or update FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_CreateOrUpdate.json
*/
async function farmBeatsModelsCreateOrUpdate() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const body: FarmBeats = {
location: "eastus2",
tags: { key1: "value1", key2: "value2" }
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.createOrUpdate(
resourceGroupName,
farmBeatsResourceName,
body
);
console.log(result);
}
farmBeatsModelsCreateOrUpdate().catch(console.error);

Просмотреть файл

@ -0,0 +1,33 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Delete a FarmBeats resource.
*
* @summary Delete a FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Delete.json
*/
async function farmBeatsModelsDelete() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmBeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.delete(
resourceGroupName,
farmBeatsResourceName
);
console.log(result);
}
farmBeatsModelsDelete().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get operationResults for a FarmBeats resource.
*
* @summary Get operationResults for a FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_GetOperationResult.json
*/
async function farmBeatsModelsGetOperationResult() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmBeatsResourceName";
const operationResultsId = "resource-provisioning-id-farmBeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.getOperationResult(
resourceGroupName,
farmBeatsResourceName,
operationResultsId
);
console.log(result);
}
farmBeatsModelsGetOperationResult().catch(console.error);

Просмотреть файл

@ -0,0 +1,33 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get FarmBeats resource.
*
* @summary Get FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Get.json
*/
async function farmBeatsModelsGet() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmBeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.get(
resourceGroupName,
farmBeatsResourceName
);
console.log(result);
}
farmBeatsModelsGet().catch(console.error);

Просмотреть файл

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Lists the FarmBeats instances for a resource group.
*
* @summary Lists the FarmBeats instances for a resource group.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_ListByResourceGroup.json
*/
async function farmBeatsModelsListByResourceGroup() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.farmBeatsModels.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
farmBeatsModelsListByResourceGroup().catch(console.error);

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Lists the FarmBeats instances for a subscription.
*
* @summary Lists the FarmBeats instances for a subscription.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_ListBySubscription.json
*/
async function farmBeatsModelsListBySubscription() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.farmBeatsModels.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
farmBeatsModelsListBySubscription().catch(console.error);

Просмотреть файл

@ -0,0 +1,67 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
FarmBeatsUpdateRequestModel,
AgriFoodMgmtClient
} from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Update a FarmBeats resource.
*
* @summary Update a FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Update.json
*/
async function farmBeatsModelsUpdate() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmBeatsResourceName";
const body: FarmBeatsUpdateRequestModel = {
tags: { key1: "value1", key2: "value2" }
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.beginUpdateAndWait(
resourceGroupName,
farmBeatsResourceName,
body
);
console.log(result);
}
farmBeatsModelsUpdate().catch(console.error);
/**
* This sample demonstrates how to Update a FarmBeats resource.
*
* @summary Update a FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_UpdateWithSensor.json
*/
async function farmBeatsModelsUpdateWithSensor() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmBeatsResourceName";
const body: FarmBeatsUpdateRequestModel = {
identity: { type: "SystemAssigned" },
properties: { sensorIntegration: { enabled: "True" } },
tags: { key1: "value1", key2: "value2" }
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.beginUpdateAndWait(
resourceGroupName,
farmBeatsResourceName,
body
);
console.log(result);
}
farmBeatsModelsUpdateWithSensor().catch(console.error);

Просмотреть файл

@ -0,0 +1,55 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
CheckNameAvailabilityRequest,
AgriFoodMgmtClient
} from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Checks the name availability of the resource with requested resource name.
*
* @summary Checks the name availability of the resource with requested resource name.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Locations_CheckNameAvailability_AlreadyExists.json
*/
async function locationsCheckNameAvailabilityAlreadyExists() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const body: CheckNameAvailabilityRequest = {
name: "existingaccountname",
type: "Microsoft.AgFoodPlatform/farmBeats"
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.locations.checkNameAvailability(body);
console.log(result);
}
locationsCheckNameAvailabilityAlreadyExists().catch(console.error);
/**
* This sample demonstrates how to Checks the name availability of the resource with requested resource name.
*
* @summary Checks the name availability of the resource with requested resource name.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Locations_CheckNameAvailability_Available.json
*/
async function locationsCheckNameAvailabilityAvailable() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const body: CheckNameAvailabilityRequest = {
name: "newaccountname",
type: "Microsoft.AgFoodPlatform/farmBeats"
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.locations.checkNameAvailability(body);
console.log(result);
}
locationsCheckNameAvailabilityAvailable().catch(console.error);

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Lists the available operations of Microsoft.AgFoodPlatform resource provider.
*
* @summary Lists the available operations of Microsoft.AgFoodPlatform resource provider.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Operations_List.json
*/
async function operationsList() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.operations.list()) {
resArray.push(item);
}
console.log(resArray);
}
operationsList().catch(console.error);

Просмотреть файл

@ -0,0 +1,45 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
PrivateEndpointConnection,
AgriFoodMgmtClient
} from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Approves or Rejects a Private endpoint connection request.
*
* @summary Approves or Rejects a Private endpoint connection request.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_CreateOrUpdate.json
*/
async function privateEndpointConnectionsCreateOrUpdate() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const privateEndpointConnectionName = "privateEndpointConnectionName";
const body: PrivateEndpointConnection = {
privateLinkServiceConnectionState: {
description: "Approved by johndoe@contoso.com",
status: "Approved"
}
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.privateEndpointConnections.createOrUpdate(
resourceGroupName,
farmBeatsResourceName,
privateEndpointConnectionName,
body
);
console.log(result);
}
privateEndpointConnectionsCreateOrUpdate().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Delete Private endpoint connection request.
*
* @summary Delete Private endpoint connection request.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_Delete.json
*/
async function privateEndpointConnectionsDelete() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const privateEndpointConnectionName = "privateEndpointConnectionName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.privateEndpointConnections.beginDeleteAndWait(
resourceGroupName,
farmBeatsResourceName,
privateEndpointConnectionName
);
console.log(result);
}
privateEndpointConnectionsDelete().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get Private endpoint connection object.
*
* @summary Get Private endpoint connection object.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_Get.json
*/
async function privateEndpointConnectionsGet() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const privateEndpointConnectionName = "privateEndpointConnectionName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.privateEndpointConnections.get(
resourceGroupName,
farmBeatsResourceName,
privateEndpointConnectionName
);
console.log(result);
}
privateEndpointConnectionsGet().catch(console.error);

Просмотреть файл

@ -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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get list of Private endpoint connections.
*
* @summary Get list of Private endpoint connections.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_ListByResource.json
*/
async function privateEndpointConnectionsListByResource() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.privateEndpointConnections.listByResource(
resourceGroupName,
farmBeatsResourceName
)) {
resArray.push(item);
}
console.log(resArray);
}
privateEndpointConnectionsListByResource().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get Private link resource object.
*
* @summary Get Private link resource object.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateLinkResources_Get.json
*/
async function privateLinkResourcesGet() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const subResourceName = "farmbeats";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.privateLinkResources.get(
resourceGroupName,
farmBeatsResourceName,
subResourceName
);
console.log(result);
}
privateLinkResourcesGet().catch(console.error);

Просмотреть файл

@ -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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get list of Private link resources.
*
* @summary Get list of Private link resources.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateLinkResources_ListByResource.json
*/
async function privateLinkResourcesListByResource() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.privateLinkResources.listByResource(
resourceGroupName,
farmBeatsResourceName
)) {
resArray.push(item);
}
console.log(resArray);
}
privateLinkResourcesListByResource().catch(console.error);

Просмотреть файл

@ -0,0 +1,92 @@
# client library samples for JavaScript (Beta)
These sample programs show how to use the JavaScript client libraries for in some common scenarios.
| **File Name** | **Description** |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [extensionsCreateSample.js][extensionscreatesample] | Install extension. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Create.json |
| [extensionsDeleteSample.js][extensionsdeletesample] | Uninstall extension. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Delete.json |
| [extensionsGetSample.js][extensionsgetsample] | Get installed extension details by extension id. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Get.json |
| [extensionsListByFarmBeatsSample.js][extensionslistbyfarmbeatssample] | Get installed extensions details. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_ListByFarmBeats.json |
| [extensionsUpdateSample.js][extensionsupdatesample] | Upgrade to latest extension. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Update.json |
| [farmBeatsExtensionsGetSample.js][farmbeatsextensionsgetsample] | Get farmBeats extension. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsExtensions_Get.json |
| [farmBeatsExtensionsListSample.js][farmbeatsextensionslistsample] | Get list of farmBeats extension. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsExtensions_List.json |
| [farmBeatsModelsCreateOrUpdateSample.js][farmbeatsmodelscreateorupdatesample] | Create or update FarmBeats resource. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_CreateOrUpdate.json |
| [farmBeatsModelsDeleteSample.js][farmbeatsmodelsdeletesample] | Delete a FarmBeats resource. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Delete.json |
| [farmBeatsModelsGetOperationResultSample.js][farmbeatsmodelsgetoperationresultsample] | Get operationResults for a FarmBeats resource. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_GetOperationResult.json |
| [farmBeatsModelsGetSample.js][farmbeatsmodelsgetsample] | Get FarmBeats resource. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Get.json |
| [farmBeatsModelsListByResourceGroupSample.js][farmbeatsmodelslistbyresourcegroupsample] | Lists the FarmBeats instances for a resource group. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_ListByResourceGroup.json |
| [farmBeatsModelsListBySubscriptionSample.js][farmbeatsmodelslistbysubscriptionsample] | Lists the FarmBeats instances for a subscription. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_ListBySubscription.json |
| [farmBeatsModelsUpdateSample.js][farmbeatsmodelsupdatesample] | Update a FarmBeats resource. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Update.json |
| [locationsCheckNameAvailabilitySample.js][locationschecknameavailabilitysample] | Checks the name availability of the resource with requested resource name. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Locations_CheckNameAvailability_AlreadyExists.json |
| [operationsListSample.js][operationslistsample] | Lists the available operations of Microsoft.AgFoodPlatform resource provider. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Operations_List.json |
| [privateEndpointConnectionsCreateOrUpdateSample.js][privateendpointconnectionscreateorupdatesample] | Approves or Rejects a Private endpoint connection request. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_CreateOrUpdate.json |
| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Delete Private endpoint connection request. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_Delete.json |
| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Get Private endpoint connection object. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_Get.json |
| [privateEndpointConnectionsListByResourceSample.js][privateendpointconnectionslistbyresourcesample] | Get list of Private endpoint connections. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_ListByResource.json |
| [privateLinkResourcesGetSample.js][privatelinkresourcesgetsample] | Get Private link resource object. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateLinkResources_Get.json |
| [privateLinkResourcesListByResourceSample.js][privatelinkresourceslistbyresourcesample] | Get list of Private link resources. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateLinkResources_ListByResource.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/).
You need [an Azure subscription][freesub] to run these sample programs.
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node extensionsCreateSample.js
```
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
```bash
npx cross-env node extensionsCreateSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[extensionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/extensionsCreateSample.js
[extensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/extensionsDeleteSample.js
[extensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/extensionsGetSample.js
[extensionslistbyfarmbeatssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/extensionsListByFarmBeatsSample.js
[extensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/extensionsUpdateSample.js
[farmbeatsextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/farmBeatsExtensionsGetSample.js
[farmbeatsextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/farmBeatsExtensionsListSample.js
[farmbeatsmodelscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/farmBeatsModelsCreateOrUpdateSample.js
[farmbeatsmodelsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/farmBeatsModelsDeleteSample.js
[farmbeatsmodelsgetoperationresultsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/farmBeatsModelsGetOperationResultSample.js
[farmbeatsmodelsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/farmBeatsModelsGetSample.js
[farmbeatsmodelslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/farmBeatsModelsListByResourceGroupSample.js
[farmbeatsmodelslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/farmBeatsModelsListBySubscriptionSample.js
[farmbeatsmodelsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/farmBeatsModelsUpdateSample.js
[locationschecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/locationsCheckNameAvailabilitySample.js
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/operationsListSample.js
[privateendpointconnectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js
[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/privateEndpointConnectionsDeleteSample.js
[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/privateEndpointConnectionsGetSample.js
[privateendpointconnectionslistbyresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/privateEndpointConnectionsListByResourceSample.js
[privatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/privateLinkResourcesGetSample.js
[privatelinkresourceslistbyresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/javascript/privateLinkResourcesListByResourceSample.js
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-agrifood?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/agrifood/arm-agrifood/README.md

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Install extension.
*
* @summary Install extension.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Create.json
*/
async function extensionsCreate() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const extensionId = "provider.extension";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.extensions.create(
resourceGroupName,
farmBeatsResourceName,
extensionId
);
console.log(result);
}
extensionsCreate().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Uninstall extension.
*
* @summary Uninstall extension.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Delete.json
*/
async function extensionsDelete() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const extensionId = "provider.extension";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.extensions.delete(
resourceGroupName,
farmBeatsResourceName,
extensionId
);
console.log(result);
}
extensionsDelete().catch(console.error);

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get installed extension details by extension id.
*
* @summary Get installed extension details by extension id.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Get.json
*/
async function extensionsGet() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const extensionId = "provider.extension";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.extensions.get(resourceGroupName, farmBeatsResourceName, extensionId);
console.log(result);
}
extensionsGet().catch(console.error);

Просмотреть файл

@ -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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get installed extensions details.
*
* @summary Get installed extensions details.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_ListByFarmBeats.json
*/
async function extensionsListByFarmBeats() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.extensions.listByFarmBeats(
resourceGroupName,
farmBeatsResourceName
)) {
resArray.push(item);
}
console.log(resArray);
}
extensionsListByFarmBeats().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Upgrade to latest extension.
*
* @summary Upgrade to latest extension.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Update.json
*/
async function extensionsUpdate() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const extensionId = "provider.extension";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.extensions.update(
resourceGroupName,
farmBeatsResourceName,
extensionId
);
console.log(result);
}
extensionsUpdate().catch(console.error);

Просмотреть файл

@ -0,0 +1,29 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get farmBeats extension.
*
* @summary Get farmBeats extension.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsExtensions_Get.json
*/
async function farmBeatsExtensionsGet() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const farmBeatsExtensionId = "DTN.ContentServices";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsExtensions.get(farmBeatsExtensionId);
console.log(result);
}
farmBeatsExtensionsGet().catch(console.error);

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get list of farmBeats extension.
*
* @summary Get list of farmBeats extension.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsExtensions_List.json
*/
async function farmBeatsExtensionsList() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.farmBeatsExtensions.list()) {
resArray.push(item);
}
console.log(resArray);
}
farmBeatsExtensionsList().catch(console.error);

Просмотреть файл

@ -0,0 +1,38 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update FarmBeats resource.
*
* @summary Create or update FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_CreateOrUpdate.json
*/
async function farmBeatsModelsCreateOrUpdate() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const body = {
location: "eastus2",
tags: { key1: "value1", key2: "value2" },
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.createOrUpdate(
resourceGroupName,
farmBeatsResourceName,
body
);
console.log(result);
}
farmBeatsModelsCreateOrUpdate().catch(console.error);

Просмотреть файл

@ -0,0 +1,30 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Delete a FarmBeats resource.
*
* @summary Delete a FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Delete.json
*/
async function farmBeatsModelsDelete() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmBeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.delete(resourceGroupName, farmBeatsResourceName);
console.log(result);
}
farmBeatsModelsDelete().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get operationResults for a FarmBeats resource.
*
* @summary Get operationResults for a FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_GetOperationResult.json
*/
async function farmBeatsModelsGetOperationResult() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmBeatsResourceName";
const operationResultsId = "resource-provisioning-id-farmBeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.getOperationResult(
resourceGroupName,
farmBeatsResourceName,
operationResultsId
);
console.log(result);
}
farmBeatsModelsGetOperationResult().catch(console.error);

Просмотреть файл

@ -0,0 +1,30 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get FarmBeats resource.
*
* @summary Get FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Get.json
*/
async function farmBeatsModelsGet() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmBeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.get(resourceGroupName, farmBeatsResourceName);
console.log(result);
}
farmBeatsModelsGet().catch(console.error);

Просмотреть файл

@ -0,0 +1,32 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists the FarmBeats instances for a resource group.
*
* @summary Lists the FarmBeats instances for a resource group.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_ListByResourceGroup.json
*/
async function farmBeatsModelsListByResourceGroup() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.farmBeatsModels.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
}
console.log(resArray);
}
farmBeatsModelsListByResourceGroup().catch(console.error);

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists the FarmBeats instances for a subscription.
*
* @summary Lists the FarmBeats instances for a subscription.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_ListBySubscription.json
*/
async function farmBeatsModelsListBySubscription() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.farmBeatsModels.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
farmBeatsModelsListBySubscription().catch(console.error);

Просмотреть файл

@ -0,0 +1,64 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Update a FarmBeats resource.
*
* @summary Update a FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Update.json
*/
async function farmBeatsModelsUpdate() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmBeatsResourceName";
const body = {
tags: { key1: "value1", key2: "value2" },
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.beginUpdateAndWait(
resourceGroupName,
farmBeatsResourceName,
body
);
console.log(result);
}
farmBeatsModelsUpdate().catch(console.error);
/**
* This sample demonstrates how to Update a FarmBeats resource.
*
* @summary Update a FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_UpdateWithSensor.json
*/
async function farmBeatsModelsUpdateWithSensor() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmBeatsResourceName";
const body = {
identity: { type: "SystemAssigned" },
properties: { sensorIntegration: { enabled: "True" } },
tags: { key1: "value1", key2: "value2" },
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.beginUpdateAndWait(
resourceGroupName,
farmBeatsResourceName,
body
);
console.log(result);
}
farmBeatsModelsUpdateWithSensor().catch(console.error);

Просмотреть файл

@ -0,0 +1,52 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Checks the name availability of the resource with requested resource name.
*
* @summary Checks the name availability of the resource with requested resource name.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Locations_CheckNameAvailability_AlreadyExists.json
*/
async function locationsCheckNameAvailabilityAlreadyExists() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const body = {
name: "existingaccountname",
type: "Microsoft.AgFoodPlatform/farmBeats",
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.locations.checkNameAvailability(body);
console.log(result);
}
locationsCheckNameAvailabilityAlreadyExists().catch(console.error);
/**
* This sample demonstrates how to Checks the name availability of the resource with requested resource name.
*
* @summary Checks the name availability of the resource with requested resource name.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Locations_CheckNameAvailability_Available.json
*/
async function locationsCheckNameAvailabilityAvailable() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const body = {
name: "newaccountname",
type: "Microsoft.AgFoodPlatform/farmBeats",
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.locations.checkNameAvailability(body);
console.log(result);
}
locationsCheckNameAvailabilityAvailable().catch(console.error);

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists the available operations of Microsoft.AgFoodPlatform resource provider.
*
* @summary Lists the available operations of Microsoft.AgFoodPlatform resource provider.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Operations_List.json
*/
async function operationsList() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.operations.list()) {
resArray.push(item);
}
console.log(resArray);
}
operationsList().catch(console.error);

Просмотреть файл

@ -0,0 +1,32 @@
{
"name": "@azure-samples/arm-agrifood-js-beta",
"private": true,
"version": "1.0.0",
"description": " client library samples for JavaScript (Beta)",
"engines": {
"node": ">=12.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/agrifood/arm-agrifood"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/agrifood/arm-agrifood",
"dependencies": {
"@azure/arm-agrifood": "next",
"dotenv": "latest",
"@azure/identity": "^2.0.1"
}
}

Просмотреть файл

@ -0,0 +1,42 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Approves or Rejects a Private endpoint connection request.
*
* @summary Approves or Rejects a Private endpoint connection request.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_CreateOrUpdate.json
*/
async function privateEndpointConnectionsCreateOrUpdate() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const privateEndpointConnectionName = "privateEndpointConnectionName";
const body = {
privateLinkServiceConnectionState: {
description: "Approved by johndoe@contoso.com",
status: "Approved",
},
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.privateEndpointConnections.createOrUpdate(
resourceGroupName,
farmBeatsResourceName,
privateEndpointConnectionName,
body
);
console.log(result);
}
privateEndpointConnectionsCreateOrUpdate().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Delete Private endpoint connection request.
*
* @summary Delete Private endpoint connection request.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_Delete.json
*/
async function privateEndpointConnectionsDelete() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const privateEndpointConnectionName = "privateEndpointConnectionName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.privateEndpointConnections.beginDeleteAndWait(
resourceGroupName,
farmBeatsResourceName,
privateEndpointConnectionName
);
console.log(result);
}
privateEndpointConnectionsDelete().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get Private endpoint connection object.
*
* @summary Get Private endpoint connection object.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_Get.json
*/
async function privateEndpointConnectionsGet() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const privateEndpointConnectionName = "privateEndpointConnectionName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.privateEndpointConnections.get(
resourceGroupName,
farmBeatsResourceName,
privateEndpointConnectionName
);
console.log(result);
}
privateEndpointConnectionsGet().catch(console.error);

Просмотреть файл

@ -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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get list of Private endpoint connections.
*
* @summary Get list of Private endpoint connections.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_ListByResource.json
*/
async function privateEndpointConnectionsListByResource() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.privateEndpointConnections.listByResource(
resourceGroupName,
farmBeatsResourceName
)) {
resArray.push(item);
}
console.log(resArray);
}
privateEndpointConnectionsListByResource().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get Private link resource object.
*
* @summary Get Private link resource object.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateLinkResources_Get.json
*/
async function privateLinkResourcesGet() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const subResourceName = "farmbeats";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.privateLinkResources.get(
resourceGroupName,
farmBeatsResourceName,
subResourceName
);
console.log(result);
}
privateLinkResourcesGet().catch(console.error);

Просмотреть файл

@ -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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AgriFoodMgmtClient } = require("@azure/arm-agrifood");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get list of Private link resources.
*
* @summary Get list of Private link resources.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateLinkResources_ListByResource.json
*/
async function privateLinkResourcesListByResource() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.privateLinkResources.listByResource(
resourceGroupName,
farmBeatsResourceName
)) {
resArray.push(item);
}
console.log(resArray);
}
privateLinkResourcesListByResource().catch(console.error);

Просмотреть файл

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -0,0 +1,105 @@
# client library samples for TypeScript (Beta)
These sample programs show how to use the TypeScript client libraries for in some common scenarios.
| **File Name** | **Description** |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [extensionsCreateSample.ts][extensionscreatesample] | Install extension. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Create.json |
| [extensionsDeleteSample.ts][extensionsdeletesample] | Uninstall extension. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Delete.json |
| [extensionsGetSample.ts][extensionsgetsample] | Get installed extension details by extension id. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Get.json |
| [extensionsListByFarmBeatsSample.ts][extensionslistbyfarmbeatssample] | Get installed extensions details. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_ListByFarmBeats.json |
| [extensionsUpdateSample.ts][extensionsupdatesample] | Upgrade to latest extension. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Update.json |
| [farmBeatsExtensionsGetSample.ts][farmbeatsextensionsgetsample] | Get farmBeats extension. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsExtensions_Get.json |
| [farmBeatsExtensionsListSample.ts][farmbeatsextensionslistsample] | Get list of farmBeats extension. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsExtensions_List.json |
| [farmBeatsModelsCreateOrUpdateSample.ts][farmbeatsmodelscreateorupdatesample] | Create or update FarmBeats resource. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_CreateOrUpdate.json |
| [farmBeatsModelsDeleteSample.ts][farmbeatsmodelsdeletesample] | Delete a FarmBeats resource. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Delete.json |
| [farmBeatsModelsGetOperationResultSample.ts][farmbeatsmodelsgetoperationresultsample] | Get operationResults for a FarmBeats resource. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_GetOperationResult.json |
| [farmBeatsModelsGetSample.ts][farmbeatsmodelsgetsample] | Get FarmBeats resource. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Get.json |
| [farmBeatsModelsListByResourceGroupSample.ts][farmbeatsmodelslistbyresourcegroupsample] | Lists the FarmBeats instances for a resource group. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_ListByResourceGroup.json |
| [farmBeatsModelsListBySubscriptionSample.ts][farmbeatsmodelslistbysubscriptionsample] | Lists the FarmBeats instances for a subscription. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_ListBySubscription.json |
| [farmBeatsModelsUpdateSample.ts][farmbeatsmodelsupdatesample] | Update a FarmBeats resource. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Update.json |
| [locationsCheckNameAvailabilitySample.ts][locationschecknameavailabilitysample] | Checks the name availability of the resource with requested resource name. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Locations_CheckNameAvailability_AlreadyExists.json |
| [operationsListSample.ts][operationslistsample] | Lists the available operations of Microsoft.AgFoodPlatform resource provider. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Operations_List.json |
| [privateEndpointConnectionsCreateOrUpdateSample.ts][privateendpointconnectionscreateorupdatesample] | Approves or Rejects a Private endpoint connection request. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_CreateOrUpdate.json |
| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Delete Private endpoint connection request. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_Delete.json |
| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Get Private endpoint connection object. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_Get.json |
| [privateEndpointConnectionsListByResourceSample.ts][privateendpointconnectionslistbyresourcesample] | Get list of Private endpoint connections. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_ListByResource.json |
| [privateLinkResourcesGetSample.ts][privatelinkresourcesgetsample] | Get Private link resource object. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateLinkResources_Get.json |
| [privateLinkResourcesListByResourceSample.ts][privatelinkresourceslistbyresourcesample] | Get list of Private link resources. x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateLinkResources_ListByResource.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/).
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using:
```bash
npm install -g typescript
```
You need [an Azure subscription][freesub] to run these sample programs.
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Compile the samples:
```bash
npm run build
```
3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
4. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node dist/extensionsCreateSample.js
```
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
```bash
npx cross-env node dist/extensionsCreateSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[extensionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/extensionsCreateSample.ts
[extensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/extensionsDeleteSample.ts
[extensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/extensionsGetSample.ts
[extensionslistbyfarmbeatssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/extensionsListByFarmBeatsSample.ts
[extensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/extensionsUpdateSample.ts
[farmbeatsextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/farmBeatsExtensionsGetSample.ts
[farmbeatsextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/farmBeatsExtensionsListSample.ts
[farmbeatsmodelscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/farmBeatsModelsCreateOrUpdateSample.ts
[farmbeatsmodelsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/farmBeatsModelsDeleteSample.ts
[farmbeatsmodelsgetoperationresultsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/farmBeatsModelsGetOperationResultSample.ts
[farmbeatsmodelsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/farmBeatsModelsGetSample.ts
[farmbeatsmodelslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/farmBeatsModelsListByResourceGroupSample.ts
[farmbeatsmodelslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/farmBeatsModelsListBySubscriptionSample.ts
[farmbeatsmodelsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/farmBeatsModelsUpdateSample.ts
[locationschecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/locationsCheckNameAvailabilitySample.ts
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/operationsListSample.ts
[privateendpointconnectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts
[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts
[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/privateEndpointConnectionsGetSample.ts
[privateendpointconnectionslistbyresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/privateEndpointConnectionsListByResourceSample.ts
[privatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/privateLinkResourcesGetSample.ts
[privatelinkresourceslistbyresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/agrifood/arm-agrifood/samples/v1-beta/typescript/src/privateLinkResourcesListByResourceSample.ts
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-agrifood?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/agrifood/arm-agrifood/README.md
[typescript]: https://www.typescriptlang.org/docs/home.html

Просмотреть файл

@ -0,0 +1,41 @@
{
"name": "@azure-samples/arm-agrifood-ts-beta",
"private": true,
"version": "1.0.0",
"description": " client library samples for TypeScript (Beta)",
"engines": {
"node": ">=12.0.0"
},
"scripts": {
"build": "tsc",
"prebuild": "rimraf dist/"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/agrifood/arm-agrifood"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/agrifood/arm-agrifood",
"dependencies": {
"@azure/arm-agrifood": "next",
"dotenv": "latest",
"@azure/identity": "^2.0.1"
},
"devDependencies": {
"@types/node": "^12.0.0",
"typescript": "~4.6.0",
"rimraf": "latest"
}
}

Просмотреть файл

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Install extension.
*
* @summary Install extension.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Create.json
*/
async function extensionsCreate() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const extensionId = "provider.extension";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.extensions.create(
resourceGroupName,
farmBeatsResourceName,
extensionId
);
console.log(result);
}
extensionsCreate().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Uninstall extension.
*
* @summary Uninstall extension.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Delete.json
*/
async function extensionsDelete() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const extensionId = "provider.extension";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.extensions.delete(
resourceGroupName,
farmBeatsResourceName,
extensionId
);
console.log(result);
}
extensionsDelete().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get installed extension details by extension id.
*
* @summary Get installed extension details by extension id.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Get.json
*/
async function extensionsGet() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const extensionId = "provider.extension";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.extensions.get(
resourceGroupName,
farmBeatsResourceName,
extensionId
);
console.log(result);
}
extensionsGet().catch(console.error);

Просмотреть файл

@ -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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get installed extensions details.
*
* @summary Get installed extensions details.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_ListByFarmBeats.json
*/
async function extensionsListByFarmBeats() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.extensions.listByFarmBeats(
resourceGroupName,
farmBeatsResourceName
)) {
resArray.push(item);
}
console.log(resArray);
}
extensionsListByFarmBeats().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Upgrade to latest extension.
*
* @summary Upgrade to latest extension.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Update.json
*/
async function extensionsUpdate() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const extensionId = "provider.extension";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.extensions.update(
resourceGroupName,
farmBeatsResourceName,
extensionId
);
console.log(result);
}
extensionsUpdate().catch(console.error);

Просмотреть файл

@ -0,0 +1,29 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get farmBeats extension.
*
* @summary Get farmBeats extension.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsExtensions_Get.json
*/
async function farmBeatsExtensionsGet() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const farmBeatsExtensionId = "DTN.ContentServices";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsExtensions.get(farmBeatsExtensionId);
console.log(result);
}
farmBeatsExtensionsGet().catch(console.error);

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get list of farmBeats extension.
*
* @summary Get list of farmBeats extension.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsExtensions_List.json
*/
async function farmBeatsExtensionsList() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.farmBeatsExtensions.list()) {
resArray.push(item);
}
console.log(resArray);
}
farmBeatsExtensionsList().catch(console.error);

Просмотреть файл

@ -0,0 +1,38 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { FarmBeats, AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create or update FarmBeats resource.
*
* @summary Create or update FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_CreateOrUpdate.json
*/
async function farmBeatsModelsCreateOrUpdate() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const body: FarmBeats = {
location: "eastus2",
tags: { key1: "value1", key2: "value2" }
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.createOrUpdate(
resourceGroupName,
farmBeatsResourceName,
body
);
console.log(result);
}
farmBeatsModelsCreateOrUpdate().catch(console.error);

Просмотреть файл

@ -0,0 +1,33 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Delete a FarmBeats resource.
*
* @summary Delete a FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Delete.json
*/
async function farmBeatsModelsDelete() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmBeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.delete(
resourceGroupName,
farmBeatsResourceName
);
console.log(result);
}
farmBeatsModelsDelete().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get operationResults for a FarmBeats resource.
*
* @summary Get operationResults for a FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_GetOperationResult.json
*/
async function farmBeatsModelsGetOperationResult() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmBeatsResourceName";
const operationResultsId = "resource-provisioning-id-farmBeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.getOperationResult(
resourceGroupName,
farmBeatsResourceName,
operationResultsId
);
console.log(result);
}
farmBeatsModelsGetOperationResult().catch(console.error);

Просмотреть файл

@ -0,0 +1,33 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get FarmBeats resource.
*
* @summary Get FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Get.json
*/
async function farmBeatsModelsGet() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmBeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.get(
resourceGroupName,
farmBeatsResourceName
);
console.log(result);
}
farmBeatsModelsGet().catch(console.error);

Просмотреть файл

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Lists the FarmBeats instances for a resource group.
*
* @summary Lists the FarmBeats instances for a resource group.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_ListByResourceGroup.json
*/
async function farmBeatsModelsListByResourceGroup() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.farmBeatsModels.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
farmBeatsModelsListByResourceGroup().catch(console.error);

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Lists the FarmBeats instances for a subscription.
*
* @summary Lists the FarmBeats instances for a subscription.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_ListBySubscription.json
*/
async function farmBeatsModelsListBySubscription() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.farmBeatsModels.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
farmBeatsModelsListBySubscription().catch(console.error);

Просмотреть файл

@ -0,0 +1,67 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
FarmBeatsUpdateRequestModel,
AgriFoodMgmtClient
} from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Update a FarmBeats resource.
*
* @summary Update a FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Update.json
*/
async function farmBeatsModelsUpdate() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmBeatsResourceName";
const body: FarmBeatsUpdateRequestModel = {
tags: { key1: "value1", key2: "value2" }
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.beginUpdateAndWait(
resourceGroupName,
farmBeatsResourceName,
body
);
console.log(result);
}
farmBeatsModelsUpdate().catch(console.error);
/**
* This sample demonstrates how to Update a FarmBeats resource.
*
* @summary Update a FarmBeats resource.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_UpdateWithSensor.json
*/
async function farmBeatsModelsUpdateWithSensor() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmBeatsResourceName";
const body: FarmBeatsUpdateRequestModel = {
identity: { type: "SystemAssigned" },
properties: { sensorIntegration: { enabled: "True" } },
tags: { key1: "value1", key2: "value2" }
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.farmBeatsModels.beginUpdateAndWait(
resourceGroupName,
farmBeatsResourceName,
body
);
console.log(result);
}
farmBeatsModelsUpdateWithSensor().catch(console.error);

Просмотреть файл

@ -0,0 +1,55 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
CheckNameAvailabilityRequest,
AgriFoodMgmtClient
} from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Checks the name availability of the resource with requested resource name.
*
* @summary Checks the name availability of the resource with requested resource name.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Locations_CheckNameAvailability_AlreadyExists.json
*/
async function locationsCheckNameAvailabilityAlreadyExists() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const body: CheckNameAvailabilityRequest = {
name: "existingaccountname",
type: "Microsoft.AgFoodPlatform/farmBeats"
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.locations.checkNameAvailability(body);
console.log(result);
}
locationsCheckNameAvailabilityAlreadyExists().catch(console.error);
/**
* This sample demonstrates how to Checks the name availability of the resource with requested resource name.
*
* @summary Checks the name availability of the resource with requested resource name.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Locations_CheckNameAvailability_Available.json
*/
async function locationsCheckNameAvailabilityAvailable() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const body: CheckNameAvailabilityRequest = {
name: "newaccountname",
type: "Microsoft.AgFoodPlatform/farmBeats"
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.locations.checkNameAvailability(body);
console.log(result);
}
locationsCheckNameAvailabilityAvailable().catch(console.error);

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Lists the available operations of Microsoft.AgFoodPlatform resource provider.
*
* @summary Lists the available operations of Microsoft.AgFoodPlatform resource provider.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Operations_List.json
*/
async function operationsList() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.operations.list()) {
resArray.push(item);
}
console.log(resArray);
}
operationsList().catch(console.error);

Просмотреть файл

@ -0,0 +1,45 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
PrivateEndpointConnection,
AgriFoodMgmtClient
} from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Approves or Rejects a Private endpoint connection request.
*
* @summary Approves or Rejects a Private endpoint connection request.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_CreateOrUpdate.json
*/
async function privateEndpointConnectionsCreateOrUpdate() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const privateEndpointConnectionName = "privateEndpointConnectionName";
const body: PrivateEndpointConnection = {
privateLinkServiceConnectionState: {
description: "Approved by johndoe@contoso.com",
status: "Approved"
}
};
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.privateEndpointConnections.createOrUpdate(
resourceGroupName,
farmBeatsResourceName,
privateEndpointConnectionName,
body
);
console.log(result);
}
privateEndpointConnectionsCreateOrUpdate().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Delete Private endpoint connection request.
*
* @summary Delete Private endpoint connection request.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_Delete.json
*/
async function privateEndpointConnectionsDelete() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const privateEndpointConnectionName = "privateEndpointConnectionName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.privateEndpointConnections.beginDeleteAndWait(
resourceGroupName,
farmBeatsResourceName,
privateEndpointConnectionName
);
console.log(result);
}
privateEndpointConnectionsDelete().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get Private endpoint connection object.
*
* @summary Get Private endpoint connection object.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_Get.json
*/
async function privateEndpointConnectionsGet() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const privateEndpointConnectionName = "privateEndpointConnectionName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.privateEndpointConnections.get(
resourceGroupName,
farmBeatsResourceName,
privateEndpointConnectionName
);
console.log(result);
}
privateEndpointConnectionsGet().catch(console.error);

Просмотреть файл

@ -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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get list of Private endpoint connections.
*
* @summary Get list of Private endpoint connections.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_ListByResource.json
*/
async function privateEndpointConnectionsListByResource() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.privateEndpointConnections.listByResource(
resourceGroupName,
farmBeatsResourceName
)) {
resArray.push(item);
}
console.log(resArray);
}
privateEndpointConnectionsListByResource().catch(console.error);

Просмотреть файл

@ -0,0 +1,35 @@
/*
* 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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get Private link resource object.
*
* @summary Get Private link resource object.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateLinkResources_Get.json
*/
async function privateLinkResourcesGet() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const subResourceName = "farmbeats";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const result = await client.privateLinkResources.get(
resourceGroupName,
farmBeatsResourceName,
subResourceName
);
console.log(result);
}
privateLinkResourcesGet().catch(console.error);

Просмотреть файл

@ -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.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AgriFoodMgmtClient } from "@azure/arm-agrifood";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get list of Private link resources.
*
* @summary Get list of Private link resources.
* x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateLinkResources_ListByResource.json
*/
async function privateLinkResourcesListByResource() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "examples-rg";
const farmBeatsResourceName = "examples-farmbeatsResourceName";
const credential = new DefaultAzureCredential();
const client = new AgriFoodMgmtClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.privateLinkResources.listByResource(
resourceGroupName,
farmBeatsResourceName
)) {
resArray.push(item);
}
console.log(resArray);
}
privateLinkResourcesListByResource().catch(console.error);

Просмотреть файл

@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "ES2018",
"module": "commonjs",
"moduleResolution": "node",
"resolveJsonModule": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"alwaysStrict": true,
"outDir": "dist",
"rootDir": "src"
},
"include": [
"src/**.ts"
]
}

Просмотреть файл

@ -0,0 +1,169 @@
/*
* 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 coreRestPipeline from "@azure/core-rest-pipeline";
import {
PipelineRequest,
PipelineResponse,
SendRequest
} from "@azure/core-rest-pipeline";
import * as coreAuth from "@azure/core-auth";
import {
ExtensionsImpl,
FarmBeatsExtensionsImpl,
FarmBeatsModelsImpl,
LocationsImpl,
OperationsImpl,
PrivateEndpointConnectionsImpl,
PrivateLinkResourcesImpl
} from "./operations";
import {
Extensions,
FarmBeatsExtensions,
FarmBeatsModels,
Locations,
Operations,
PrivateEndpointConnections,
PrivateLinkResources
} from "./operationsInterfaces";
import { AgriFoodMgmtClientOptionalParams } from "./models";
export class AgriFoodMgmtClient extends coreClient.ServiceClient {
$host: string;
subscriptionId: string;
apiVersion: string;
/**
* Initializes a new instance of the AgriFoodMgmtClient 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?: AgriFoodMgmtClientOptionalParams
) {
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: AgriFoodMgmtClientOptionalParams = {
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 ?? options.baseUri ?? "https://management.azure.com"
};
super(optionsWithDefaults);
let bearerTokenAuthenticationPolicyFound: boolean = false;
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
(pipelinePolicy) =>
pipelinePolicy.name ===
coreRestPipeline.bearerTokenAuthenticationPolicyName
);
}
if (
!options ||
!options.pipeline ||
options.pipeline.getOrderedPolicies().length == 0 ||
!bearerTokenAuthenticationPolicyFound
) {
this.pipeline.removePolicy({
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
});
this.pipeline.addPolicy(
coreRestPipeline.bearerTokenAuthenticationPolicy({
credential: credentials,
scopes: `${optionsWithDefaults.credentialScopes}`,
challengeCallbacks: {
authorizeRequestOnChallenge:
coreClient.authorizeRequestOnClaimChallenge
}
})
);
}
// Parameter assignments
this.subscriptionId = subscriptionId;
// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2021-09-01-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);
this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this);
this.privateLinkResources = new PrivateLinkResourcesImpl(this);
this.addCustomApiVersionPolicy(options.apiVersion);
}
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
private addCustomApiVersionPolicy(apiVersion?: string) {
if (!apiVersion) {
return;
}
const apiVersionPolicy = {
name: "CustomApiVersionPolicy",
async sendRequest(
request: PipelineRequest,
next: SendRequest
): Promise<PipelineResponse> {
const param = request.url.split("?");
if (param.length > 1) {
const newParams = param[1].split("&").map((item) => {
if (item.indexOf("api-version") > -1) {
return "api-version=" + apiVersion;
} else {
return item;
}
});
request.url = param[0] + "?" + newParams.join("&");
}
return next(request);
}
};
this.pipeline.addPolicy(apiVersionPolicy);
}
extensions: Extensions;
farmBeatsExtensions: FarmBeatsExtensions;
farmBeatsModels: FarmBeatsModels;
locations: Locations;
operations: Operations;
privateEndpointConnections: PrivateEndpointConnections;
privateLinkResources: PrivateLinkResources;
}

Просмотреть файл

@ -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.
*/
/// <reference lib="esnext.asynciterable" />
export * from "./models";
export { AgriFoodMgmtClient } from "./agriFoodMgmtClient";
export * from "./operationsInterfaces";

Просмотреть файл

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { LongRunningOperation, LroResponse } from "@azure/core-lro";
export class LroImpl<T> implements LongRunningOperation<T> {
constructor(
private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
private args: Record<string, unknown>,
private spec: {
readonly requestBody?: unknown;
readonly path?: string;
readonly httpMethod: string;
} & Record<string, any>,
public requestPath: string = spec.path!,
public requestMethod: string = spec.httpMethod
) {}
public async sendInitialRequest(): Promise<LroResponse<T>> {
return this.sendOperationFn(this.args, this.spec);
}
public async sendPollRequest(path: string): Promise<LroResponse<T>> {
const { requestBody, ...restSpec } = this.spec;
return this.sendOperationFn(this.args, {
...restSpec,
path,
httpMethod: "GET"
});
}
}

Просмотреть файл

@ -0,0 +1,943 @@
/*
* 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";
/** 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;
/**
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly systemData?: SystemData;
}
/** 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 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<string, unknown>;
}
/** 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[];
}
/** Identity for the resource. */
export interface Identity {
/**
* The principal ID of resource identity.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly principalId?: string;
/**
* The tenant ID of resource.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly tenantId?: string;
/** The identity type. */
type?: "SystemAssigned";
}
/** Sensor integration request model. */
export interface SensorIntegration {
/** Sensor integration enable state. Allowed values are True, None */
enabled?: string;
/**
* Sensor integration instance provisioning state.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly provisioningState?: ProvisioningState;
/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */
provisioningInfo?: ErrorResponse;
}
/** The Private Endpoint resource. */
export interface PrivateEndpoint {
/**
* The ARM identifier for Private Endpoint
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
}
/** A collection of information about the state of the connection between service consumer and provider. */
export interface PrivateLinkServiceConnectionState {
/** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */
status?: PrivateEndpointServiceConnectionStatus;
/** The reason for approval/rejection of the connection. */
description?: string;
/** A message indicating if changes on the service provider require any updates on the consumer. */
actionsRequired?: string;
}
/** FarmBeats update request. */
export interface FarmBeatsUpdateRequestModel {
/** Geo-location where the resource lives. */
location?: string;
/** Identity for the resource. */
identity?: Identity;
/** FarmBeats ARM Resource properties. */
properties?: FarmBeatsUpdateProperties;
/** Resource tags. */
tags?: { [propertyName: string]: string };
}
/** FarmBeats ARM Resource properties. */
export interface FarmBeatsUpdateProperties {
/** Sensor integration request model. */
sensorIntegration?: SensorIntegration;
/** Property to allow or block public traffic for an Azure FarmBeats resource. */
publicNetworkAccess?: PublicNetworkAccess;
}
/** 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;
}
/**
* Arm async operation class.
* Ref: https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/async-operations.
*/
export interface ArmAsyncOperation {
/** Status of the async operation. */
status?: 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;
}
/** List of private endpoint connection associated with the specified storage account */
export interface PrivateEndpointConnectionListResult {
/** Array of private endpoint connections */
value?: PrivateEndpointConnection[];
}
/** A list of private link resources */
export interface PrivateLinkResourceListResult {
/** Array of private link resources */
value?: PrivateLinkResource[];
}
/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */
export interface ProxyResource extends Resource {}
/** The Private Endpoint Connection resource. */
export interface PrivateEndpointConnection extends Resource {
/** The resource of private end point. */
privateEndpoint?: PrivateEndpoint;
/** A collection of information about the state of the connection between service consumer and provider. */
privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState;
/**
* The provisioning state of the private endpoint connection resource.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly provisioningState?: PrivateEndpointConnectionProvisioningState;
}
/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */
export interface TrackedResource extends Resource {
/** Resource tags. */
tags?: { [propertyName: string]: string };
/** The geo-location where the resource lives */
location: string;
}
/** A private link resource */
export interface PrivateLinkResource extends Resource {
/**
* The private link resource group id.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly groupId?: string;
/**
* The private link resource required member names.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly requiredMembers?: string[];
/** The private link resource Private link DNS zone name. */
requiredZoneNames?: string[];
}
/** Extension resource. */
export interface Extension extends ProxyResource {
/**
* 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 interface FarmBeatsExtension extends ProxyResource {
/**
* 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 interface FarmBeats extends TrackedResource {
/** Identity for the resource. */
identity?: Identity;
/**
* 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;
/** Sensor integration request model. */
sensorIntegration?: SensorIntegration;
/** Property to allow or block public traffic for an Azure FarmBeats resource. */
publicNetworkAccess?: PublicNetworkAccess;
/**
* The Private Endpoint Connection resource.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly privateEndpointConnections?: PrivateEndpointConnection;
}
/** Defines headers for FarmBeatsModels_update operation. */
export interface FarmBeatsModelsUpdateHeaders {
location?: string;
}
/** Defines headers for PrivateEndpointConnections_delete operation. */
export interface PrivateEndpointConnectionsDeleteHeaders {
location?: string;
}
/** Known values of {@link CreatedByType} that the service accepts. */
export enum KnownCreatedByType {
/** User */
User = "User",
/** Application */
Application = "Application",
/** ManagedIdentity */
ManagedIdentity = "ManagedIdentity",
/** Key */
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 {
/** Creating */
Creating = "Creating",
/** Updating */
Updating = "Updating",
/** Deleting */
Deleting = "Deleting",
/** Succeeded */
Succeeded = "Succeeded",
/** Failed */
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
* **Creating** \
* **Updating** \
* **Deleting** \
* **Succeeded** \
* **Failed**
*/
export type ProvisioningState = string;
/** Known values of {@link PublicNetworkAccess} that the service accepts. */
export enum KnownPublicNetworkAccess {
/** Enabled */
Enabled = "Enabled",
/** Hybrid */
Hybrid = "Hybrid"
}
/**
* Defines values for PublicNetworkAccess. \
* {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Enabled** \
* **Hybrid**
*/
export type PublicNetworkAccess = string;
/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */
export enum KnownPrivateEndpointServiceConnectionStatus {
/** Pending */
Pending = "Pending",
/** Approved */
Approved = "Approved",
/** Rejected */
Rejected = "Rejected"
}
/**
* Defines values for PrivateEndpointServiceConnectionStatus. \
* {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Pending** \
* **Approved** \
* **Rejected**
*/
export type PrivateEndpointServiceConnectionStatus = string;
/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */
export enum KnownPrivateEndpointConnectionProvisioningState {
/** Succeeded */
Succeeded = "Succeeded",
/** Creating */
Creating = "Creating",
/** Deleting */
Deleting = "Deleting",
/** Failed */
Failed = "Failed"
}
/**
* Defines values for PrivateEndpointConnectionProvisioningState. \
* {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Succeeded** \
* **Creating** \
* **Deleting** \
* **Failed**
*/
export type PrivateEndpointConnectionProvisioningState = string;
/** Known values of {@link CheckNameAvailabilityReason} that the service accepts. */
export enum KnownCheckNameAvailabilityReason {
/** Invalid */
Invalid = "Invalid",
/** AlreadyExists */
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 = "user",
/** System */
System = "system",
/** UserSystem */
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 = "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 {
/** Delay to wait until next poll, in milliseconds. */
updateIntervalInMs?: number;
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
resumeFrom?: string;
}
/** Contains response data for the update operation. */
export type 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 FarmBeatsModelsGetOperationResultOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the getOperationResult operation. */
export type FarmBeatsModelsGetOperationResultResponse = ArmAsyncOperation;
/** 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 PrivateEndpointConnectionsCreateOrUpdateOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the createOrUpdate operation. */
export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection;
/** Optional parameters. */
export interface PrivateEndpointConnectionsGetOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the get operation. */
export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection;
/** Optional parameters. */
export interface PrivateEndpointConnectionsDeleteOptionalParams
extends coreClient.OperationOptions {
/** Delay to wait until next poll, in milliseconds. */
updateIntervalInMs?: number;
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
resumeFrom?: string;
}
/** Optional parameters. */
export interface PrivateEndpointConnectionsListByResourceOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listByResource operation. */
export type PrivateEndpointConnectionsListByResourceResponse = PrivateEndpointConnectionListResult;
/** Optional parameters. */
export interface PrivateLinkResourcesListByResourceOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listByResource operation. */
export type PrivateLinkResourcesListByResourceResponse = PrivateLinkResourceListResult;
/** Optional parameters. */
export interface PrivateLinkResourcesGetOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the get operation. */
export type PrivateLinkResourcesGetResponse = PrivateLinkResource;
/** Optional parameters. */
export interface AgriFoodMgmtClientOptionalParams
extends coreClient.ServiceClientOptions {
/** server parameter */
$host?: string;
/** Api Version */
apiVersion?: string;
/** Overrides client endpoint. */
endpoint?: string;
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,305 @@
/*
* 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,
PrivateEndpointConnection as PrivateEndpointConnectionMapper
} 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 subscriptionId: OperationURLParameter = {
parameterPath: "subscriptionId",
mapper: {
constraints: {
MinLength: 1
},
serializedName: "subscriptionId",
required: true,
type: {
name: "String"
}
}
};
export const resourceGroupName: OperationURLParameter = {
parameterPath: "resourceGroupName",
mapper: {
constraints: {
MaxLength: 90,
MinLength: 1
},
serializedName: "resourceGroupName",
required: true,
type: {
name: "String"
}
}
};
export const farmBeatsResourceName: OperationURLParameter = {
parameterPath: "farmBeatsResourceName",
mapper: {
serializedName: "farmBeatsResourceName",
required: true,
type: {
name: "String"
}
}
};
export const extensionId: OperationURLParameter = {
parameterPath: "extensionId",
mapper: {
serializedName: "extensionId",
required: true,
type: {
name: "String"
}
}
};
export const apiVersion: OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
defaultValue: "2021-09-01-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 operationResultsId: OperationURLParameter = {
parameterPath: "operationResultsId",
mapper: {
constraints: {
Pattern: new RegExp("^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$")
},
serializedName: "operationResultsId",
required: true,
type: {
name: "String"
}
}
};
export const body2: OperationParameter = {
parameterPath: "body",
mapper: CheckNameAvailabilityRequestMapper
};
export const body3: OperationParameter = {
parameterPath: "body",
mapper: PrivateEndpointConnectionMapper
};
export const privateEndpointConnectionName: OperationURLParameter = {
parameterPath: "privateEndpointConnectionName",
mapper: {
serializedName: "privateEndpointConnectionName",
required: true,
type: {
name: "String"
}
}
};
export const subResourceName: OperationURLParameter = {
parameterPath: "subResourceName",
mapper: {
serializedName: "subResourceName",
required: true,
type: {
name: "String"
}
}
};

Просмотреть файл

@ -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 { AgriFoodMgmtClient } from "../agriFoodMgmtClient";
import {
Extension,
ExtensionsListByFarmBeatsNextOptionalParams,
ExtensionsListByFarmBeatsOptionalParams,
ExtensionsCreateOptionalParams,
ExtensionsCreateResponse,
ExtensionsGetOptionalParams,
ExtensionsGetResponse,
ExtensionsUpdateOptionalParams,
ExtensionsUpdateResponse,
ExtensionsDeleteOptionalParams,
ExtensionsListByFarmBeatsResponse,
ExtensionsListByFarmBeatsNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing Extensions operations. */
export class ExtensionsImpl implements Extensions {
private readonly client: AgriFoodMgmtClient;
/**
* Initialize a new instance of the class Extensions class.
* @param client Reference to the service client
*/
constructor(client: AgriFoodMgmtClient) {
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<Extension> {
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<Extension[]> {
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<Extension> {
for await (const page of this.listByFarmBeatsPagingPage(
resourceGroupName,
farmBeatsResourceName,
options
)) {
yield* page;
}
}
/**
* Install extension.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param extensionId Id of extension resource.
* @param options The options parameters.
*/
create(
resourceGroupName: string,
farmBeatsResourceName: string,
extensionId: string,
options?: ExtensionsCreateOptionalParams
): Promise<ExtensionsCreateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, farmBeatsResourceName, extensionId, options },
createOperationSpec
);
}
/**
* Get installed extension details by extension id.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param extensionId Id of extension resource.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
farmBeatsResourceName: string,
extensionId: string,
options?: ExtensionsGetOptionalParams
): Promise<ExtensionsGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, farmBeatsResourceName, extensionId, options },
getOperationSpec
);
}
/**
* Upgrade to latest extension.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param extensionId Id of extension resource.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
farmBeatsResourceName: string,
extensionId: string,
options?: ExtensionsUpdateOptionalParams
): Promise<ExtensionsUpdateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, farmBeatsResourceName, extensionId, options },
updateOperationSpec
);
}
/**
* Uninstall extension.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param extensionId Id of extension resource.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
farmBeatsResourceName: string,
extensionId: string,
options?: ExtensionsDeleteOptionalParams
): Promise<void> {
return this.client.sendOperationRequest(
{ resourceGroupName, farmBeatsResourceName, extensionId, 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<ExtensionsListByFarmBeatsResponse> {
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<ExtensionsListByFarmBeatsNextResponse> {
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.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName,
Parameters.extensionId
],
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.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName,
Parameters.extensionId
],
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.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName,
Parameters.extensionId
],
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.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName,
Parameters.extensionId
],
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.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName
],
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.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};

Просмотреть файл

@ -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 { AgriFoodMgmtClient } from "../agriFoodMgmtClient";
import {
FarmBeatsExtension,
FarmBeatsExtensionsListNextOptionalParams,
FarmBeatsExtensionsListOptionalParams,
FarmBeatsExtensionsListResponse,
FarmBeatsExtensionsGetOptionalParams,
FarmBeatsExtensionsGetResponse,
FarmBeatsExtensionsListNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing FarmBeatsExtensions operations. */
export class FarmBeatsExtensionsImpl implements FarmBeatsExtensions {
private readonly client: AgriFoodMgmtClient;
/**
* Initialize a new instance of the class FarmBeatsExtensions class.
* @param client Reference to the service client
*/
constructor(client: AgriFoodMgmtClient) {
this.client = client;
}
/**
* Get list of farmBeats extension.
* @param options The options parameters.
*/
public list(
options?: FarmBeatsExtensionsListOptionalParams
): PagedAsyncIterableIterator<FarmBeatsExtension> {
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<FarmBeatsExtension[]> {
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<FarmBeatsExtension> {
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<FarmBeatsExtensionsListResponse> {
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<FarmBeatsExtensionsGetResponse> {
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<FarmBeatsExtensionsListNextResponse> {
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
};

Просмотреть файл

@ -0,0 +1,595 @@
/*
* 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 { AgriFoodMgmtClient } from "../agriFoodMgmtClient";
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
import { LroImpl } from "../lroImpl";
import {
FarmBeats,
FarmBeatsModelsListBySubscriptionNextOptionalParams,
FarmBeatsModelsListBySubscriptionOptionalParams,
FarmBeatsModelsListByResourceGroupNextOptionalParams,
FarmBeatsModelsListByResourceGroupOptionalParams,
FarmBeatsModelsGetOptionalParams,
FarmBeatsModelsGetResponse,
FarmBeatsModelsCreateOrUpdateOptionalParams,
FarmBeatsModelsCreateOrUpdateResponse,
FarmBeatsUpdateRequestModel,
FarmBeatsModelsUpdateOptionalParams,
FarmBeatsModelsUpdateResponse,
FarmBeatsModelsDeleteOptionalParams,
FarmBeatsModelsListBySubscriptionResponse,
FarmBeatsModelsListByResourceGroupResponse,
FarmBeatsModelsGetOperationResultOptionalParams,
FarmBeatsModelsGetOperationResultResponse,
FarmBeatsModelsListBySubscriptionNextResponse,
FarmBeatsModelsListByResourceGroupNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing FarmBeatsModels operations. */
export class FarmBeatsModelsImpl implements FarmBeatsModels {
private readonly client: AgriFoodMgmtClient;
/**
* Initialize a new instance of the class FarmBeatsModels class.
* @param client Reference to the service client
*/
constructor(client: AgriFoodMgmtClient) {
this.client = client;
}
/**
* Lists the FarmBeats instances for a subscription.
* @param options The options parameters.
*/
public listBySubscription(
options?: FarmBeatsModelsListBySubscriptionOptionalParams
): PagedAsyncIterableIterator<FarmBeats> {
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<FarmBeats[]> {
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<FarmBeats> {
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<FarmBeats> {
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<FarmBeats[]> {
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<FarmBeats> {
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<FarmBeatsModelsGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, farmBeatsResourceName, options },
getOperationSpec
);
}
/**
* Create or update FarmBeats resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param body FarmBeats resource create or update request object.
* @param options The options parameters.
*/
createOrUpdate(
resourceGroupName: string,
farmBeatsResourceName: string,
body: FarmBeats,
options?: FarmBeatsModelsCreateOrUpdateOptionalParams
): Promise<FarmBeatsModelsCreateOrUpdateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, farmBeatsResourceName, body, options },
createOrUpdateOperationSpec
);
}
/**
* Update a FarmBeats resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param body Request object.
* @param options The options parameters.
*/
async beginUpdate(
resourceGroupName: string,
farmBeatsResourceName: string,
body: FarmBeatsUpdateRequestModel,
options?: FarmBeatsModelsUpdateOptionalParams
): Promise<
PollerLike<
PollOperationState<FarmBeatsModelsUpdateResponse>,
FarmBeatsModelsUpdateResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
): Promise<FarmBeatsModelsUpdateResponse> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
) => {
let currentRawResponse:
| coreClient.FullOperationResponse
| undefined = undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback
}
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON()
}
};
};
const lro = new LroImpl(
sendOperation,
{ resourceGroupName, farmBeatsResourceName, body, options },
updateOperationSpec
);
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "location"
});
await poller.poll();
return poller;
}
/**
* Update a FarmBeats resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param body Request object.
* @param options The options parameters.
*/
async beginUpdateAndWait(
resourceGroupName: string,
farmBeatsResourceName: string,
body: FarmBeatsUpdateRequestModel,
options?: FarmBeatsModelsUpdateOptionalParams
): Promise<FarmBeatsModelsUpdateResponse> {
const poller = await this.beginUpdate(
resourceGroupName,
farmBeatsResourceName,
body,
options
);
return poller.pollUntilDone();
}
/**
* 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<void> {
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<FarmBeatsModelsListBySubscriptionResponse> {
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<FarmBeatsModelsListByResourceGroupResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, options },
listByResourceGroupOperationSpec
);
}
/**
* Get operationResults for a FarmBeats resource.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param operationResultsId The operation results id.
* @param options The options parameters.
*/
getOperationResult(
resourceGroupName: string,
farmBeatsResourceName: string,
operationResultsId: string,
options?: FarmBeatsModelsGetOperationResultOptionalParams
): Promise<FarmBeatsModelsGetOperationResultResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, farmBeatsResourceName, operationResultsId, options },
getOperationResultOperationSpec
);
}
/**
* 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<FarmBeatsModelsListBySubscriptionNextResponse> {
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<FarmBeatsModelsListByResourceGroupNextResponse> {
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.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName
],
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.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName
],
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
},
201: {
bodyMapper: Mappers.FarmBeats
},
202: {
bodyMapper: Mappers.FarmBeats
},
204: {
bodyMapper: Mappers.FarmBeats
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.body1,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName
],
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.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName
],
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.subscriptionId,
Parameters.resourceGroupName
],
headerParameters: [Parameters.accept],
serializer
};
const getOperationResultOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/operationResults/{operationResultsId}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ArmAsyncOperation
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName,
Parameters.operationResultsId
],
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.subscriptionId,
Parameters.resourceGroupName,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};

Просмотреть файл

@ -0,0 +1,15 @@
/*
* 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";
export * from "./privateEndpointConnections";
export * from "./privateLinkResources";

Просмотреть файл

@ -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 { AgriFoodMgmtClient } from "../agriFoodMgmtClient";
import {
CheckNameAvailabilityRequest,
LocationsCheckNameAvailabilityOptionalParams,
LocationsCheckNameAvailabilityResponse
} from "../models";
/** Class containing Locations operations. */
export class LocationsImpl implements Locations {
private readonly client: AgriFoodMgmtClient;
/**
* Initialize a new instance of the class Locations class.
* @param client Reference to the service client
*/
constructor(client: AgriFoodMgmtClient) {
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<LocationsCheckNameAvailabilityResponse> {
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
};

Просмотреть файл

@ -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 { AgriFoodMgmtClient } from "../agriFoodMgmtClient";
import {
Operation,
OperationsListNextOptionalParams,
OperationsListOptionalParams,
OperationsListResponse,
OperationsListNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing Operations operations. */
export class OperationsImpl implements Operations {
private readonly client: AgriFoodMgmtClient;
/**
* Initialize a new instance of the class Operations class.
* @param client Reference to the service client
*/
constructor(client: AgriFoodMgmtClient) {
this.client = client;
}
/**
* Lists the available operations of Microsoft.AgFoodPlatform resource provider.
* @param options The options parameters.
*/
public list(
options?: OperationsListOptionalParams
): PagedAsyncIterableIterator<Operation> {
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<Operation[]> {
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<Operation> {
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<OperationsListResponse> {
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<OperationsListNextResponse> {
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
};

Просмотреть файл

@ -0,0 +1,363 @@
/*
* 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 { PrivateEndpointConnections } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { AgriFoodMgmtClient } from "../agriFoodMgmtClient";
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
import { LroImpl } from "../lroImpl";
import {
PrivateEndpointConnection,
PrivateEndpointConnectionsListByResourceOptionalParams,
PrivateEndpointConnectionsCreateOrUpdateOptionalParams,
PrivateEndpointConnectionsCreateOrUpdateResponse,
PrivateEndpointConnectionsGetOptionalParams,
PrivateEndpointConnectionsGetResponse,
PrivateEndpointConnectionsDeleteOptionalParams,
PrivateEndpointConnectionsListByResourceResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing PrivateEndpointConnections operations. */
export class PrivateEndpointConnectionsImpl
implements PrivateEndpointConnections {
private readonly client: AgriFoodMgmtClient;
/**
* Initialize a new instance of the class PrivateEndpointConnections class.
* @param client Reference to the service client
*/
constructor(client: AgriFoodMgmtClient) {
this.client = client;
}
/**
* Get list of Private endpoint connections.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param options The options parameters.
*/
public listByResource(
resourceGroupName: string,
farmBeatsResourceName: string,
options?: PrivateEndpointConnectionsListByResourceOptionalParams
): PagedAsyncIterableIterator<PrivateEndpointConnection> {
const iter = this.listByResourcePagingAll(
resourceGroupName,
farmBeatsResourceName,
options
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listByResourcePagingPage(
resourceGroupName,
farmBeatsResourceName,
options
);
}
};
}
private async *listByResourcePagingPage(
resourceGroupName: string,
farmBeatsResourceName: string,
options?: PrivateEndpointConnectionsListByResourceOptionalParams
): AsyncIterableIterator<PrivateEndpointConnection[]> {
let result = await this._listByResource(
resourceGroupName,
farmBeatsResourceName,
options
);
yield result.value || [];
}
private async *listByResourcePagingAll(
resourceGroupName: string,
farmBeatsResourceName: string,
options?: PrivateEndpointConnectionsListByResourceOptionalParams
): AsyncIterableIterator<PrivateEndpointConnection> {
for await (const page of this.listByResourcePagingPage(
resourceGroupName,
farmBeatsResourceName,
options
)) {
yield* page;
}
}
/**
* Approves or Rejects a Private endpoint connection request.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param privateEndpointConnectionName Private endpoint connection name.
* @param body Request object.
* @param options The options parameters.
*/
createOrUpdate(
resourceGroupName: string,
farmBeatsResourceName: string,
privateEndpointConnectionName: string,
body: PrivateEndpointConnection,
options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams
): Promise<PrivateEndpointConnectionsCreateOrUpdateResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
farmBeatsResourceName,
privateEndpointConnectionName,
body,
options
},
createOrUpdateOperationSpec
);
}
/**
* Get Private endpoint connection object.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param privateEndpointConnectionName Private endpoint connection name.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
farmBeatsResourceName: string,
privateEndpointConnectionName: string,
options?: PrivateEndpointConnectionsGetOptionalParams
): Promise<PrivateEndpointConnectionsGetResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
farmBeatsResourceName,
privateEndpointConnectionName,
options
},
getOperationSpec
);
}
/**
* Delete Private endpoint connection request.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param privateEndpointConnectionName Private endpoint connection name.
* @param options The options parameters.
*/
async beginDelete(
resourceGroupName: string,
farmBeatsResourceName: string,
privateEndpointConnectionName: string,
options?: PrivateEndpointConnectionsDeleteOptionalParams
): Promise<PollerLike<PollOperationState<void>, void>> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
): Promise<void> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
) => {
let currentRawResponse:
| coreClient.FullOperationResponse
| undefined = undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback
}
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON()
}
};
};
const lro = new LroImpl(
sendOperation,
{
resourceGroupName,
farmBeatsResourceName,
privateEndpointConnectionName,
options
},
deleteOperationSpec
);
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "location"
});
await poller.poll();
return poller;
}
/**
* Delete Private endpoint connection request.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param privateEndpointConnectionName Private endpoint connection name.
* @param options The options parameters.
*/
async beginDeleteAndWait(
resourceGroupName: string,
farmBeatsResourceName: string,
privateEndpointConnectionName: string,
options?: PrivateEndpointConnectionsDeleteOptionalParams
): Promise<void> {
const poller = await this.beginDelete(
resourceGroupName,
farmBeatsResourceName,
privateEndpointConnectionName,
options
);
return poller.pollUntilDone();
}
/**
* Get list of Private endpoint connections.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param options The options parameters.
*/
private _listByResource(
resourceGroupName: string,
farmBeatsResourceName: string,
options?: PrivateEndpointConnectionsListByResourceOptionalParams
): Promise<PrivateEndpointConnectionsListByResourceResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, farmBeatsResourceName, options },
listByResourceOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/privateEndpointConnections/{privateEndpointConnectionName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.PrivateEndpointConnection
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.body3,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName,
Parameters.privateEndpointConnectionName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/privateEndpointConnections/{privateEndpointConnectionName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.PrivateEndpointConnection
},
404: {
bodyMapper: Mappers.ErrorResponse,
isError: true
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName,
Parameters.privateEndpointConnectionName
],
headerParameters: [Parameters.accept],
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/privateEndpointConnections/{privateEndpointConnectionName}",
httpMethod: "DELETE",
responses: {
200: {},
201: {},
202: {},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName,
Parameters.privateEndpointConnectionName
],
headerParameters: [Parameters.accept],
serializer
};
const listByResourceOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/privateEndpointConnections",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.PrivateEndpointConnectionListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName
],
headerParameters: [Parameters.accept],
serializer
};

Просмотреть файл

@ -0,0 +1,183 @@
/*
* 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 { PrivateLinkResources } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { AgriFoodMgmtClient } from "../agriFoodMgmtClient";
import {
PrivateLinkResource,
PrivateLinkResourcesListByResourceOptionalParams,
PrivateLinkResourcesListByResourceResponse,
PrivateLinkResourcesGetOptionalParams,
PrivateLinkResourcesGetResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing PrivateLinkResources operations. */
export class PrivateLinkResourcesImpl implements PrivateLinkResources {
private readonly client: AgriFoodMgmtClient;
/**
* Initialize a new instance of the class PrivateLinkResources class.
* @param client Reference to the service client
*/
constructor(client: AgriFoodMgmtClient) {
this.client = client;
}
/**
* Get list of Private link resources.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param options The options parameters.
*/
public listByResource(
resourceGroupName: string,
farmBeatsResourceName: string,
options?: PrivateLinkResourcesListByResourceOptionalParams
): PagedAsyncIterableIterator<PrivateLinkResource> {
const iter = this.listByResourcePagingAll(
resourceGroupName,
farmBeatsResourceName,
options
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listByResourcePagingPage(
resourceGroupName,
farmBeatsResourceName,
options
);
}
};
}
private async *listByResourcePagingPage(
resourceGroupName: string,
farmBeatsResourceName: string,
options?: PrivateLinkResourcesListByResourceOptionalParams
): AsyncIterableIterator<PrivateLinkResource[]> {
let result = await this._listByResource(
resourceGroupName,
farmBeatsResourceName,
options
);
yield result.value || [];
}
private async *listByResourcePagingAll(
resourceGroupName: string,
farmBeatsResourceName: string,
options?: PrivateLinkResourcesListByResourceOptionalParams
): AsyncIterableIterator<PrivateLinkResource> {
for await (const page of this.listByResourcePagingPage(
resourceGroupName,
farmBeatsResourceName,
options
)) {
yield* page;
}
}
/**
* Get list of Private link resources.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param options The options parameters.
*/
private _listByResource(
resourceGroupName: string,
farmBeatsResourceName: string,
options?: PrivateLinkResourcesListByResourceOptionalParams
): Promise<PrivateLinkResourcesListByResourceResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, farmBeatsResourceName, options },
listByResourceOperationSpec
);
}
/**
* Get Private link resource object.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param farmBeatsResourceName FarmBeats resource name.
* @param subResourceName Sub resource name.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
farmBeatsResourceName: string,
subResourceName: string,
options?: PrivateLinkResourcesGetOptionalParams
): Promise<PrivateLinkResourcesGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, farmBeatsResourceName, subResourceName, options },
getOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listByResourceOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/privateLinkResources",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.PrivateLinkResourceListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName
],
headerParameters: [Parameters.accept],
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/privateLinkResources/{subResourceName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.PrivateLinkResource
},
404: {
bodyMapper: Mappers.ErrorResponse,
isError: true
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.farmBeatsResourceName,
Parameters.subResourceName
],
headerParameters: [Parameters.accept],
serializer
};

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше