diff --git a/sdk/agrifood/arm-agrifood/LICENSE.txt b/sdk/agrifood/arm-agrifood/LICENSE.txt new file mode 100644 index 000000000000..2d3163745319 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 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. diff --git a/sdk/agrifood/arm-agrifood/README.md b/sdk/agrifood/arm-agrifood/README.md new file mode 100644 index 000000000000..0a23a247f792 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/README.md @@ -0,0 +1,112 @@ +## Azure AzureAgriFoodRPService SDK for JavaScript + +This package contains an isomorphic SDK (runs both in node.js and in browsers) for AzureAgriFoodRPService. + +### Currently supported environments + +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +You must have an [Azure subscription](https://azure.microsoft.com/free/). + +### How to install + +To use this SDK in your project, you will need to install two packages. +- `@azure/arm-agrifood` that contains the client. +- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. + +Install both packages using the below command: +```bash +npm install --save @azure/arm-agrifood @azure/identity +``` +> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. +If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. + +### How to use + +- If you are writing a client side browser application, + - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. + - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. +- If you are writing a server side application, + - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) + - Complete the set up steps required by the credential if any. + - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. + +In the below samples, we pass the credential and the Azure subscription id to instantiate the client. +Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +#### nodejs - Authentication, client creation, and get extensions as an example written in JavaScript. + +##### Sample code + +```javascript +const { DefaultAzureCredential } = require("@azure/identity"); +const { AzureAgriFoodRPService } = require("@azure/arm-agrifood"); +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples +// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. +const creds = new DefaultAzureCredential(); +const client = new AzureAgriFoodRPService(creds, subscriptionId); +const extensionId = "testextensionId"; +const farmBeatsResourceName = "testfarmBeatsResourceName"; +const resourceGroupName = "testresourceGroupName"; +client.extensions.get(extensionId, farmBeatsResourceName, resourceGroupName).then((result) => { + console.log("The result is:"); + console.log(result); +}).catch((err) => { + console.log("An error occurred:"); + console.error(err); +}); +``` + +#### browser - Authentication, client creation, and get extensions as an example written in JavaScript. + +In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. + - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. + - Note down the client Id from the previous step and use it in the browser sample below. + +##### Sample code + +- index.html + +```html + + + + @azure/arm-agrifood sample + + + + + + + +``` + +## 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/sdk/agrifood/arm-agrifood/README.png) diff --git a/sdk/agrifood/arm-agrifood/package.json b/sdk/agrifood/arm-agrifood/package.json new file mode 100644 index 000000000000..d44bc4deb178 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/package.json @@ -0,0 +1,59 @@ +{ + "name": "@azure/arm-agrifood", + "author": "Microsoft Corporation", + "description": "AzureAgriFoodRPService Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "@azure/ms-rest-azure-js": "^2.1.0", + "@azure/ms-rest-js": "^2.2.0", + "@azure/core-auth": "^1.1.4", + "tslib": "^1.10.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-agrifood.js", + "module": "./esm/azureAgriFoodRPService.js", + "types": "./esm/azureAgriFoodRPService.d.ts", + "devDependencies": { + "typescript": "^3.6.0", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.6.0" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/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", + "esm/**/*.js", + "esm/**/*.js.map", + "esm/**/*.d.ts", + "esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "rollup.config.js", + "tsconfig.json" + ], + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-agrifood.js.map'\" -o ./dist/arm-agrifood.min.js ./dist/arm-agrifood.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/agrifood/arm-agrifood/rollup.config.js b/sdk/agrifood/arm-agrifood/rollup.config.js new file mode 100644 index 000000000000..2d3f37dd5f46 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/rollup.config.js @@ -0,0 +1,37 @@ +import rollup from "rollup"; +import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + +/** + * @type {rollup.RollupFileOptions} + */ +const config = { + input: "./esm/azureAgriFoodRPService.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-agrifood.js", + format: "umd", + name: "Azure.ArmAgrifood", + sourcemap: true, + globals: { + "@azure/ms-rest-js": "msRest", + "@azure/ms-rest-azure-js": "msRestAzure" + }, + banner: `/* + * 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. + */` + }, + plugins: [ + nodeResolve({ mainFields: ['module', 'main'] }), + sourcemaps() + ] +}; + +export default config; diff --git a/sdk/agrifood/arm-agrifood/src/azureAgriFoodRPService.ts b/sdk/agrifood/arm-agrifood/src/azureAgriFoodRPService.ts new file mode 100644 index 000000000000..b54c943835cc --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/azureAgriFoodRPService.ts @@ -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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import { TokenCredential } from "@azure/core-auth"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { AzureAgriFoodRPServiceContext } from "./azureAgriFoodRPServiceContext"; + + +class AzureAgriFoodRPService extends AzureAgriFoodRPServiceContext { + // Operation groups + extensions: operations.Extensions; + farmBeatsExtensions: operations.FarmBeatsExtensions; + farmBeatsModels: operations.FarmBeatsModels; + locations: operations.Locations; + operations: operations.Operations; + + /** + * Initializes a new instance of the AzureAgriFoodRPService class. + * @param credentials Credentials needed for the client to connect to Azure. Credentials + * implementing the TokenCredential interface from the @azure/identity package are recommended. For + * more information about these credentials, see + * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the + * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and + * @azure/ms-rest-browserauth are also supported. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.AzureAgriFoodRPServiceOptions) { + super(credentials, subscriptionId, options); + this.extensions = new operations.Extensions(this); + this.farmBeatsExtensions = new operations.FarmBeatsExtensions(this); + this.farmBeatsModels = new operations.FarmBeatsModels(this); + this.locations = new operations.Locations(this); + this.operations = new operations.Operations(this); + } +} + +// Operation Specifications + +export { + AzureAgriFoodRPService, + AzureAgriFoodRPServiceContext, + Models as AzureAgriFoodRPServiceModels, + Mappers as AzureAgriFoodRPServiceMappers +}; +export * from "./operations"; diff --git a/sdk/agrifood/arm-agrifood/src/azureAgriFoodRPServiceContext.ts b/sdk/agrifood/arm-agrifood/src/azureAgriFoodRPServiceContext.ts new file mode 100644 index 000000000000..cab992ec07ee --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/azureAgriFoodRPServiceContext.ts @@ -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. + */ + +import * as Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; + +const packageName = "@azure/arm-agrifood"; +const packageVersion = "1.0.0"; + +export class AzureAgriFoodRPServiceContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials | TokenCredential; + apiVersion?: string; + subscriptionId: string; + + /** + * Initializes a new instance of the AzureAgriFoodRPService class. + * @param credentials Credentials needed for the client to connect to Azure. Credentials + * implementing the TokenCredential interface from the @azure/identity package are recommended. For + * more information about these credentials, see + * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the + * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and + * @azure/ms-rest-browserauth are also supported. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.AzureAgriFoodRPServiceOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if (!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2020-05-12-preview'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/sdk/agrifood/arm-agrifood/src/models/extensionsMappers.ts b/sdk/agrifood/arm-agrifood/src/models/extensionsMappers.ts new file mode 100644 index 000000000000..fe93058898a6 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/models/extensionsMappers.ts @@ -0,0 +1,25 @@ +/* + * 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 { + AzureEntityResource, + BaseResource, + DetailedInformation, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Extension, + ExtensionListResponse, + FarmBeats, + FarmBeatsExtension, + ProxyResource, + Resource, + SystemData, + TrackedResource, + UnitSystemsInfo +} from "../models/mappers"; diff --git a/sdk/agrifood/arm-agrifood/src/models/farmBeatsExtensionsMappers.ts b/sdk/agrifood/arm-agrifood/src/models/farmBeatsExtensionsMappers.ts new file mode 100644 index 000000000000..5614e6484f79 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/models/farmBeatsExtensionsMappers.ts @@ -0,0 +1,25 @@ +/* + * 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 { + AzureEntityResource, + BaseResource, + DetailedInformation, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Extension, + FarmBeats, + FarmBeatsExtension, + FarmBeatsExtensionListResponse, + ProxyResource, + Resource, + SystemData, + TrackedResource, + UnitSystemsInfo +} from "../models/mappers"; diff --git a/sdk/agrifood/arm-agrifood/src/models/farmBeatsModelsMappers.ts b/sdk/agrifood/arm-agrifood/src/models/farmBeatsModelsMappers.ts new file mode 100644 index 000000000000..a4cdf4bad51a --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/models/farmBeatsModelsMappers.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AzureEntityResource, + BaseResource, + DetailedInformation, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Extension, + FarmBeats, + FarmBeatsExtension, + FarmBeatsListResponse, + FarmBeatsUpdateRequestModel, + ProxyResource, + Resource, + SystemData, + TrackedResource, + UnitSystemsInfo +} from "../models/mappers"; diff --git a/sdk/agrifood/arm-agrifood/src/models/index.ts b/sdk/agrifood/arm-agrifood/src/models/index.ts new file mode 100644 index 000000000000..dee600a96e47 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/models/index.ts @@ -0,0 +1,1047 @@ +/* + * 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 { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + +/** + * 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. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + 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. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + lastModifiedByType?: CreatedByType; + /** + * The timestamp of resource last modification (UTC) + */ + lastModifiedAt?: Date; +} + +/** + * Extension resource. + */ +export interface Extension extends BaseResource { + systemData?: SystemData; + /** + * 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; + /** + * 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; +} + +/** + * 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[]; +} + +/** + * 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[]; + unitsSupported?: UnitSystemsInfo; + /** + * List of apiInputParameters. + */ + apiInputParameters?: string[]; +} + +/** + * FarmBeats extension resource. + */ +export interface FarmBeatsExtension extends BaseResource { + systemData?: SystemData; + /** + * Target ResourceType of the farmBeatsExtension. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly targetResourceType?: string; + /** + * FarmBeatsExtension ID. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly farmBeatsExtensionId?: string; + /** + * FarmBeatsExtension name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly farmBeatsExtensionName?: string; + /** + * FarmBeatsExtension version. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly farmBeatsExtensionVersion?: string; + /** + * Publisher ID. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly publisherId?: string; + /** + * Textual description. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; + /** + * Category of the extension. e.g. weather/sensor/satellite. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly extensionCategory?: string; + /** + * FarmBeatsExtension auth link. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly extensionAuthLink?: string; + /** + * FarmBeatsExtension api docs link. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly extensionApiDocsLink?: string; + /** + * Detailed information which shows summary of requested data. + * Used in descriptive get extension metadata call. + * Information for weather category per api included are apisSupported, + * customParameters, PlatformParameters and Units supported. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly detailedInformation?: DetailedInformation[]; +} + +/** + * FarmBeats ARM Resource. + */ +export interface FarmBeats extends BaseResource { + systemData?: SystemData; + /** + * Uri of the FarmBeats instance. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly instanceUri?: string; + /** + * FarmBeats instance provisioning state. Possible values include: 'Succeeded', 'Failed' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; +} + +/** + * FarmBeats update request. + */ +export interface FarmBeatsUpdateRequestModel { + /** + * Geo-location where the resource lives. + */ + location?: string; + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * Common fields that are returned in the response for all Azure Resource Manager resources + * @summary Resource + */ +export interface Resource extends BaseResource { + /** + * 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; +} + +/** + * The resource model definition for a Azure Resource Manager proxy resource. It will not have tags + * and a location + * @summary Proxy Resource + */ +export interface ProxyResource extends Resource { +} + +/** + * The resource model definition for an Azure Resource Manager resource with an etag. + * @summary Entity Resource + */ +export interface AzureEntityResource extends Resource { + /** + * Resource Etag. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly etag?: string; +} + +/** + * The resource model definition for an Azure Resource Manager tracked top level resource which has + * 'tags' and a 'location' + * @summary Tracked Resource + */ +export interface TrackedResource extends Resource { + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; + /** + * The geo-location where the resource lives + */ + location: string; +} + +/** + * 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?: any; +} + +/** + * 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[]; +} + +/** + * Common error response for all Azure Resource Manager APIs to return error details for failed + * operations. (This also follows the OData error response format.). + * @summary Error response + */ +export interface ErrorResponse { + /** + * The error object. + */ + error?: ErrorDetail; +} + +/** + * 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; +} + +/** + * Details of a REST API operation, returned from the Resource Provider Operations API + * @summary REST API Operation + */ +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". Possible values include: 'user', 'system', + * '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. + * Possible values include: 'Internal' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly actionType?: ActionType; +} + +/** + * 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. Possible values include: 'Invalid', + * 'AlreadyExists' + */ + reason?: CheckNameAvailabilityReason; + /** + * Detailed reason why the given name is available. + */ + message?: 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; +} + +/** + * Optional Parameters. + */ +export interface ExtensionsListByFarmBeatsOptionalParams extends msRest.RequestOptionsBase { + /** + * Installed extension ids. + */ + extensionIds?: string[]; + /** + * Installed extension categories. + */ + extensionCategories?: string[]; + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. Default value: 50. + */ + maxPageSize?: number; + /** + * Skip token for getting next set of results. + */ + skipToken?: string; +} + +/** + * Optional Parameters. + */ +export interface ExtensionsListByFarmBeatsNextOptionalParams extends msRest.RequestOptionsBase { + /** + * Installed extension ids. + */ + extensionIds?: string[]; + /** + * Installed extension categories. + */ + extensionCategories?: string[]; + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. Default value: 50. + */ + maxPageSize?: number; + /** + * Skip token for getting next set of results. + */ + skipToken?: string; +} + +/** + * Optional Parameters. + */ +export interface FarmBeatsExtensionsListOptionalParams extends msRest.RequestOptionsBase { + /** + * FarmBeatsExtension ids. + */ + farmBeatsExtensionIds?: string[]; + /** + * FarmBeats extension names. + */ + farmBeatsExtensionNames?: string[]; + /** + * Extension categories. + */ + extensionCategories?: string[]; + /** + * Publisher ids. + */ + publisherIds?: string[]; + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. Default value: 50. + */ + maxPageSize?: number; +} + +/** + * Optional Parameters. + */ +export interface FarmBeatsExtensionsListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * FarmBeatsExtension ids. + */ + farmBeatsExtensionIds?: string[]; + /** + * FarmBeats extension names. + */ + farmBeatsExtensionNames?: string[]; + /** + * Extension categories. + */ + extensionCategories?: string[]; + /** + * Publisher ids. + */ + publisherIds?: string[]; + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. Default value: 50. + */ + maxPageSize?: number; +} + +/** + * Optional Parameters. + */ +export interface FarmBeatsModelsListBySubscriptionOptionalParams extends msRest.RequestOptionsBase { + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. Default value: 50. + */ + maxPageSize?: number; + /** + * Skip token for getting next set of results. + */ + skipToken?: string; +} + +/** + * Optional Parameters. + */ +export interface FarmBeatsModelsListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. Default value: 50. + */ + maxPageSize?: number; + /** + * Continuation token for getting next set of results. + */ + skipToken?: string; +} + +/** + * Optional Parameters. + */ +export interface FarmBeatsModelsListBySubscriptionNextOptionalParams extends msRest.RequestOptionsBase { + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. Default value: 50. + */ + maxPageSize?: number; + /** + * Skip token for getting next set of results. + */ + skipToken?: string; +} + +/** + * Optional Parameters. + */ +export interface FarmBeatsModelsListByResourceGroupNextOptionalParams extends msRest.RequestOptionsBase { + /** + * Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. Default value: 50. + */ + maxPageSize?: number; + /** + * Continuation token for getting next set of results. + */ + skipToken?: string; +} + +/** + * An interface representing AzureAgriFoodRPServiceOptions. + */ +export interface AzureAgriFoodRPServiceOptions extends AzureServiceClientOptions { + baseUri?: string; +} + +/** + * @interface + * Paged response contains list of requested objects and a URL link to get the next set of results. + * @extends Array + */ +export interface ExtensionListResponse extends Array { + /** + * 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; +} + +/** + * @interface + * Paged response contains list of requested objects and a URL link to get the next set of results. + * @extends Array + */ +export interface FarmBeatsExtensionListResponse extends Array { + /** + * 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; +} + +/** + * @interface + * Paged response contains list of requested objects and a URL link to get the next set of results. + * @extends Array + */ +export interface FarmBeatsListResponse extends Array { + /** + * 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; +} + +/** + * @interface + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link + * to get the next set of results. + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * 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; +} + +/** + * Defines values for CreatedByType. + * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + * @readonly + * @enum {string} + */ +export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; + +/** + * Defines values for ProvisioningState. + * Possible values include: 'Succeeded', 'Failed' + * @readonly + * @enum {string} + */ +export type ProvisioningState = 'Succeeded' | 'Failed'; + +/** + * Defines values for Origin. + * Possible values include: 'user', 'system', 'user,system' + * @readonly + * @enum {string} + */ +export type Origin = 'user' | 'system' | 'user,system'; + +/** + * Defines values for ActionType. + * Possible values include: 'Internal' + * @readonly + * @enum {string} + */ +export type ActionType = 'Internal'; + +/** + * Defines values for CheckNameAvailabilityReason. + * Possible values include: 'Invalid', 'AlreadyExists' + * @readonly + * @enum {string} + */ +export type CheckNameAvailabilityReason = 'Invalid' | 'AlreadyExists'; + +/** + * Contains response data for the create operation. + */ +export type ExtensionsCreateResponse = Extension & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Extension; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ExtensionsGetResponse = Extension & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Extension; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type ExtensionsUpdateResponse = Extension & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Extension; + }; +}; + +/** + * Contains response data for the listByFarmBeats operation. + */ +export type ExtensionsListByFarmBeatsResponse = ExtensionListResponse & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ExtensionListResponse; + }; +}; + +/** + * Contains response data for the listByFarmBeatsNext operation. + */ +export type ExtensionsListByFarmBeatsNextResponse = ExtensionListResponse & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ExtensionListResponse; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type FarmBeatsExtensionsListResponse = FarmBeatsExtensionListResponse & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FarmBeatsExtensionListResponse; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type FarmBeatsExtensionsGetResponse = FarmBeatsExtension & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FarmBeatsExtension; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type FarmBeatsExtensionsListNextResponse = FarmBeatsExtensionListResponse & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FarmBeatsExtensionListResponse; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type FarmBeatsModelsGetResponse = FarmBeats & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FarmBeats; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type FarmBeatsModelsCreateOrUpdateResponse = FarmBeats & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FarmBeats; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type FarmBeatsModelsUpdateResponse = FarmBeats & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FarmBeats; + }; +}; + +/** + * Contains response data for the listBySubscription operation. + */ +export type FarmBeatsModelsListBySubscriptionResponse = FarmBeatsListResponse & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FarmBeatsListResponse; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type FarmBeatsModelsListByResourceGroupResponse = FarmBeatsListResponse & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FarmBeatsListResponse; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type FarmBeatsModelsListBySubscriptionNextResponse = FarmBeatsListResponse & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FarmBeatsListResponse; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type FarmBeatsModelsListByResourceGroupNextResponse = FarmBeatsListResponse & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FarmBeatsListResponse; + }; +}; + +/** + * Contains response data for the checkNameAvailability operation. + */ +export type LocationsCheckNameAvailabilityResponse = CheckNameAvailabilityResponse & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CheckNameAvailabilityResponse; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationsListNextResponse = OperationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationListResult; + }; +}; diff --git a/sdk/agrifood/arm-agrifood/src/models/locationsMappers.ts b/sdk/agrifood/arm-agrifood/src/models/locationsMappers.ts new file mode 100644 index 000000000000..61b3d37064ce --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/models/locationsMappers.ts @@ -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 { + CheckNameAvailabilityRequest, + CheckNameAvailabilityResponse, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse +} from "../models/mappers"; diff --git a/sdk/agrifood/arm-agrifood/src/models/mappers.ts b/sdk/agrifood/arm-agrifood/src/models/mappers.ts new file mode 100644 index 000000000000..122e11f8e025 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/models/mappers.ts @@ -0,0 +1,827 @@ +/* + * 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 { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const SystemData: msRest.CompositeMapper = { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const Extension: msRest.CompositeMapper = { + serializedName: "Extension", + type: { + name: "Composite", + className: "Extension", + modelProperties: { + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + extensionId: { + readOnly: true, + serializedName: "properties.extensionId", + constraints: { + Pattern: /^[a-zA-Z]{3,50}[.][a-zA-Z]{3,100}$/ + }, + type: { + name: "String" + } + }, + extensionCategory: { + readOnly: true, + serializedName: "properties.extensionCategory", + type: { + name: "String" + } + }, + installedExtensionVersion: { + readOnly: true, + serializedName: "properties.installedExtensionVersion", + constraints: { + Pattern: /^([1-9]|10).\d$/ + }, + type: { + name: "String" + } + }, + extensionAuthLink: { + readOnly: true, + serializedName: "properties.extensionAuthLink", + type: { + name: "String" + } + }, + extensionApiDocsLink: { + readOnly: true, + serializedName: "properties.extensionApiDocsLink", + type: { + name: "String" + } + }, + eTag: { + readOnly: true, + serializedName: "eTag", + type: { + name: "String" + } + } + } + } +}; + +export const UnitSystemsInfo: msRest.CompositeMapper = { + serializedName: "UnitSystemsInfo", + type: { + name: "Composite", + className: "UnitSystemsInfo", + modelProperties: { + key: { + required: true, + serializedName: "key", + constraints: { + MaxLength: 100, + MinLength: 2 + }, + type: { + name: "String" + } + }, + values: { + required: true, + serializedName: "values", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DetailedInformation: msRest.CompositeMapper = { + serializedName: "DetailedInformation", + type: { + name: "Composite", + className: "DetailedInformation", + modelProperties: { + apiName: { + serializedName: "apiName", + type: { + name: "String" + } + }, + customParameters: { + serializedName: "customParameters", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + platformParameters: { + serializedName: "platformParameters", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + unitsSupported: { + serializedName: "unitsSupported", + type: { + name: "Composite", + className: "UnitSystemsInfo" + } + }, + apiInputParameters: { + serializedName: "apiInputParameters", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const FarmBeatsExtension: msRest.CompositeMapper = { + serializedName: "FarmBeatsExtension", + type: { + name: "Composite", + className: "FarmBeatsExtension", + modelProperties: { + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + targetResourceType: { + readOnly: true, + serializedName: "properties.targetResourceType", + type: { + name: "String" + } + }, + farmBeatsExtensionId: { + readOnly: true, + serializedName: "properties.farmBeatsExtensionId", + constraints: { + MaxLength: 100, + MinLength: 2, + Pattern: /^[a-zA-Z]{3,50}[.][a-zA-Z]{3,100}$/ + }, + type: { + name: "String" + } + }, + farmBeatsExtensionName: { + readOnly: true, + serializedName: "properties.farmBeatsExtensionName", + constraints: { + MaxLength: 100, + MinLength: 2 + }, + type: { + name: "String" + } + }, + farmBeatsExtensionVersion: { + readOnly: true, + serializedName: "properties.farmBeatsExtensionVersion", + constraints: { + MaxLength: 100, + MinLength: 2, + Pattern: /^([1-9]|10).\d$/ + }, + type: { + name: "String" + } + }, + publisherId: { + readOnly: true, + serializedName: "properties.publisherId", + constraints: { + MaxLength: 100, + MinLength: 2 + }, + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "properties.description", + constraints: { + MaxLength: 500, + MinLength: 2 + }, + type: { + name: "String" + } + }, + extensionCategory: { + readOnly: true, + serializedName: "properties.extensionCategory", + constraints: { + MaxLength: 100, + MinLength: 2 + }, + type: { + name: "String" + } + }, + extensionAuthLink: { + readOnly: true, + serializedName: "properties.extensionAuthLink", + type: { + name: "String" + } + }, + extensionApiDocsLink: { + readOnly: true, + serializedName: "properties.extensionApiDocsLink", + type: { + name: "String" + } + }, + detailedInformation: { + readOnly: true, + serializedName: "properties.detailedInformation", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DetailedInformation" + } + } + } + } + } + } +}; + +export const FarmBeats: msRest.CompositeMapper = { + serializedName: "FarmBeats", + type: { + name: "Composite", + className: "FarmBeats", + modelProperties: { + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + instanceUri: { + readOnly: true, + serializedName: "properties.instanceUri", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + } + } + } +}; + +export const FarmBeatsUpdateRequestModel: msRest.CompositeMapper = { + serializedName: "FarmBeatsUpdateRequestModel", + type: { + name: "Composite", + className: "FarmBeatsUpdateRequestModel", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const AzureEntityResource: msRest.CompositeMapper = { + serializedName: "AzureEntityResource", + type: { + name: "Composite", + className: "AzureEntityResource", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResource: msRest.CompositeMapper = { + serializedName: "TrackedResource", + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorAdditionalInfo: msRest.CompositeMapper = { + serializedName: "ErrorAdditionalInfo", + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + info: { + readOnly: true, + serializedName: "info", + type: { + name: "Object" + } + } + } + } +}; + +export const ErrorDetail: msRest.CompositeMapper = { + serializedName: "ErrorDetail", + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + target: { + readOnly: true, + serializedName: "target", + type: { + name: "String" + } + }, + details: { + readOnly: true, + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + readOnly: true, + serializedName: "additionalInfo", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + readOnly: true, + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + readOnly: true, + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + readOnly: true, + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + isDataAction: { + readOnly: true, + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + readOnly: true, + serializedName: "origin", + type: { + name: "String" + } + }, + actionType: { + readOnly: true, + serializedName: "actionType", + type: { + name: "String" + } + } + } + } +}; + +export const CheckNameAvailabilityResponse: msRest.CompositeMapper = { + serializedName: "CheckNameAvailabilityResponse", + type: { + name: "Composite", + className: "CheckNameAvailabilityResponse", + modelProperties: { + nameAvailable: { + serializedName: "nameAvailable", + type: { + name: "Boolean" + } + }, + reason: { + serializedName: "reason", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const CheckNameAvailabilityRequest: msRest.CompositeMapper = { + serializedName: "CheckNameAvailabilityRequest", + type: { + name: "Composite", + className: "CheckNameAvailabilityRequest", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const ExtensionListResponse: msRest.CompositeMapper = { + serializedName: "ExtensionListResponse", + type: { + name: "Composite", + className: "ExtensionListResponse", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Extension" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const FarmBeatsExtensionListResponse: msRest.CompositeMapper = { + serializedName: "FarmBeatsExtensionListResponse", + type: { + name: "Composite", + className: "FarmBeatsExtensionListResponse", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FarmBeatsExtension" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const FarmBeatsListResponse: msRest.CompositeMapper = { + serializedName: "FarmBeatsListResponse", + type: { + name: "Composite", + className: "FarmBeatsListResponse", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FarmBeats" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/agrifood/arm-agrifood/src/models/operationsMappers.ts b/sdk/agrifood/arm-agrifood/src/models/operationsMappers.ts new file mode 100644 index 000000000000..fddc3077d64b --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/models/operationsMappers.ts @@ -0,0 +1,16 @@ +/* + * 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 { + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Operation, + OperationDisplay, + OperationListResult +} from "../models/mappers"; diff --git a/sdk/agrifood/arm-agrifood/src/models/parameters.ts b/sdk/agrifood/arm-agrifood/src/models/parameters.ts new file mode 100644 index 000000000000..9bfc43048db2 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/models/parameters.ts @@ -0,0 +1,224 @@ +/* + * 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 msRest from "@azure/ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + } +}; +export const extensionCategories: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "extensionCategories" + ], + mapper: { + serializedName: "extensionCategories", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + collectionFormat: msRest.QueryCollectionFormat.Multi +}; +export const extensionId: msRest.OperationURLParameter = { + parameterPath: "extensionId", + mapper: { + required: true, + serializedName: "extensionId", + type: { + name: "String" + } + } +}; +export const extensionIds: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "extensionIds" + ], + mapper: { + serializedName: "extensionIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + collectionFormat: msRest.QueryCollectionFormat.Multi +}; +export const farmBeatsExtensionId: msRest.OperationURLParameter = { + parameterPath: "farmBeatsExtensionId", + mapper: { + required: true, + serializedName: "farmBeatsExtensionId", + constraints: { + Pattern: /^[a-zA-Z]{3,50}[.][a-zA-Z]{3,100}$/ + }, + type: { + name: "String" + } + } +}; +export const farmBeatsExtensionIds: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "farmBeatsExtensionIds" + ], + mapper: { + serializedName: "farmBeatsExtensionIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + collectionFormat: msRest.QueryCollectionFormat.Multi +}; +export const farmBeatsExtensionNames: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "farmBeatsExtensionNames" + ], + mapper: { + serializedName: "farmBeatsExtensionNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + collectionFormat: msRest.QueryCollectionFormat.Multi +}; +export const farmBeatsResourceName: msRest.OperationURLParameter = { + parameterPath: "farmBeatsResourceName", + mapper: { + required: true, + serializedName: "farmBeatsResourceName", + type: { + name: "String" + } + } +}; +export const maxPageSize: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "maxPageSize" + ], + mapper: { + serializedName: "$maxPageSize", + defaultValue: 50, + constraints: { + InclusiveMaximum: 1000, + InclusiveMinimum: 10 + }, + type: { + name: "Number" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const publisherIds: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "publisherIds" + ], + mapper: { + serializedName: "publisherIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + collectionFormat: msRest.QueryCollectionFormat.Multi +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1 + }, + type: { + name: "String" + } + } +}; +export const skipToken: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "skipToken" + ], + mapper: { + serializedName: "$skipToken", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + } +}; diff --git a/sdk/agrifood/arm-agrifood/src/operations/extensions.ts b/sdk/agrifood/arm-agrifood/src/operations/extensions.ts new file mode 100644 index 000000000000..459a2a22c4d9 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/operations/extensions.ts @@ -0,0 +1,393 @@ +/* + * 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 msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/extensionsMappers"; +import * as Parameters from "../models/parameters"; +import { AzureAgriFoodRPServiceContext } from "../azureAgriFoodRPServiceContext"; + +/** Class representing a Extensions. */ +export class Extensions { + private readonly client: AzureAgriFoodRPServiceContext; + + /** + * Create a Extensions. + * @param {AzureAgriFoodRPServiceContext} client Reference to the service client. + */ + constructor(client: AzureAgriFoodRPServiceContext) { + this.client = client; + } + + /** + * Install extension. + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + create(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param callback The callback + */ + create(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + create(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + create(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + extensionId, + farmBeatsResourceName, + resourceGroupName, + options + }, + createOperationSpec, + callback) as Promise; + } + + /** + * Get installed extension details by extension id. + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + get(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param callback The callback + */ + get(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + get(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + extensionId, + farmBeatsResourceName, + resourceGroupName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Upgrade to latest extension. + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + update(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param callback The callback + */ + update(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + update(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + extensionId, + farmBeatsResourceName, + resourceGroupName, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Uninstall extension. + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param callback The callback + */ + deleteMethod(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param extensionId Id of extension resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(extensionId: string, farmBeatsResourceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + extensionId, + farmBeatsResourceName, + resourceGroupName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * 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 optional parameters + * @returns Promise + */ + listByFarmBeats(resourceGroupName: string, farmBeatsResourceName: string, options?: Models.ExtensionsListByFarmBeatsOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param callback The callback + */ + listByFarmBeats(resourceGroupName: string, farmBeatsResourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param options The optional parameters + * @param callback The callback + */ + listByFarmBeats(resourceGroupName: string, farmBeatsResourceName: string, options: Models.ExtensionsListByFarmBeatsOptionalParams, callback: msRest.ServiceCallback): void; + listByFarmBeats(resourceGroupName: string, farmBeatsResourceName: string, options?: Models.ExtensionsListByFarmBeatsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + farmBeatsResourceName, + options + }, + listByFarmBeatsOperationSpec, + callback) as Promise; + } + + /** + * Get installed extensions details. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByFarmBeatsNext(nextPageLink: string, options?: Models.ExtensionsListByFarmBeatsNextOptionalParams): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByFarmBeatsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByFarmBeatsNext(nextPageLink: string, options: Models.ExtensionsListByFarmBeatsNextOptionalParams, callback: msRest.ServiceCallback): void; + listByFarmBeatsNext(nextPageLink: string, options?: Models.ExtensionsListByFarmBeatsNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByFarmBeatsNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/extensions/{extensionId}", + urlParameters: [ + Parameters.extensionId, + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 201: { + bodyMapper: Mappers.Extension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/extensions/{extensionId}", + urlParameters: [ + Parameters.extensionId, + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Extension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/extensions/{extensionId}", + urlParameters: [ + Parameters.extensionId, + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Extension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/extensions/{extensionId}", + urlParameters: [ + Parameters.extensionId, + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByFarmBeatsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/extensions", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.farmBeatsResourceName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.extensionIds, + Parameters.extensionCategories, + Parameters.maxPageSize, + Parameters.skipToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExtensionListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByFarmBeatsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.extensionIds, + Parameters.extensionCategories, + Parameters.maxPageSize, + Parameters.skipToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExtensionListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/agrifood/arm-agrifood/src/operations/farmBeatsExtensions.ts b/sdk/agrifood/arm-agrifood/src/operations/farmBeatsExtensions.ts new file mode 100644 index 000000000000..3919afcc2d95 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/operations/farmBeatsExtensions.ts @@ -0,0 +1,186 @@ +/* + * 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 msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/farmBeatsExtensionsMappers"; +import * as Parameters from "../models/parameters"; +import { AzureAgriFoodRPServiceContext } from "../azureAgriFoodRPServiceContext"; + +/** Class representing a FarmBeatsExtensions. */ +export class FarmBeatsExtensions { + private readonly client: AzureAgriFoodRPServiceContext; + + /** + * Create a FarmBeatsExtensions. + * @param {AzureAgriFoodRPServiceContext} client Reference to the service client. + */ + constructor(client: AzureAgriFoodRPServiceContext) { + this.client = client; + } + + /** + * Get list of farmBeats extension. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: Models.FarmBeatsExtensionsListOptionalParams): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: Models.FarmBeatsExtensionsListOptionalParams, callback: msRest.ServiceCallback): void; + list(options?: Models.FarmBeatsExtensionsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Get farmBeats extension. + * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * @param [options] The optional parameters + * @returns Promise + */ + get(farmBeatsExtensionId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * @param callback The callback + */ + get(farmBeatsExtensionId: string, callback: msRest.ServiceCallback): void; + /** + * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * @param options The optional parameters + * @param callback The callback + */ + get(farmBeatsExtensionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(farmBeatsExtensionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + farmBeatsExtensionId, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Get list of farmBeats extension. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: Models.FarmBeatsExtensionsListNextOptionalParams): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: Models.FarmBeatsExtensionsListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.FarmBeatsExtensionsListNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.AgFoodPlatform/farmBeatsExtensionDefinitions", + queryParameters: [ + Parameters.farmBeatsExtensionIds, + Parameters.farmBeatsExtensionNames, + Parameters.extensionCategories, + Parameters.publisherIds, + Parameters.maxPageSize, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FarmBeatsExtensionListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.AgFoodPlatform/farmBeatsExtensionDefinitions/{farmBeatsExtensionId}", + urlParameters: [ + Parameters.farmBeatsExtensionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FarmBeatsExtension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.farmBeatsExtensionIds, + Parameters.farmBeatsExtensionNames, + Parameters.extensionCategories, + Parameters.publisherIds, + Parameters.maxPageSize, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FarmBeatsExtensionListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/agrifood/arm-agrifood/src/operations/farmBeatsModels.ts b/sdk/agrifood/arm-agrifood/src/operations/farmBeatsModels.ts new file mode 100644 index 000000000000..5ffa8e819710 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/operations/farmBeatsModels.ts @@ -0,0 +1,492 @@ +/* + * 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 msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/farmBeatsModelsMappers"; +import * as Parameters from "../models/parameters"; +import { AzureAgriFoodRPServiceContext } from "../azureAgriFoodRPServiceContext"; + +/** Class representing a FarmBeatsModels. */ +export class FarmBeatsModels { + private readonly client: AzureAgriFoodRPServiceContext; + + /** + * Create a FarmBeatsModels. + * @param {AzureAgriFoodRPServiceContext} client Reference to the service client. + */ + constructor(client: AzureAgriFoodRPServiceContext) { + this.client = client; + } + + /** + * Get FarmBeats resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, farmBeatsResourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param callback The callback + */ + get(resourceGroupName: string, farmBeatsResourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, farmBeatsResourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, farmBeatsResourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + farmBeatsResourceName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Create or update FarmBeats resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param body FarmBeats resource create or update request object. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(farmBeatsResourceName: string, resourceGroupName: string, body: Models.FarmBeats, options?: msRest.RequestOptionsBase): Promise; + /** + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param body FarmBeats resource create or update request object. + * @param callback The callback + */ + createOrUpdate(farmBeatsResourceName: string, resourceGroupName: string, body: Models.FarmBeats, callback: msRest.ServiceCallback): void; + /** + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param body FarmBeats resource create or update request object. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(farmBeatsResourceName: string, resourceGroupName: string, body: Models.FarmBeats, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(farmBeatsResourceName: string, resourceGroupName: string, body: Models.FarmBeats, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + farmBeatsResourceName, + resourceGroupName, + body, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Update a FarmBeats resource. + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param body Request object. + * @param [options] The optional parameters + * @returns Promise + */ + update(farmBeatsResourceName: string, resourceGroupName: string, body: Models.FarmBeatsUpdateRequestModel, options?: msRest.RequestOptionsBase): Promise; + /** + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param body Request object. + * @param callback The callback + */ + update(farmBeatsResourceName: string, resourceGroupName: string, body: Models.FarmBeatsUpdateRequestModel, callback: msRest.ServiceCallback): void; + /** + * @param farmBeatsResourceName FarmBeats resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param body Request object. + * @param options The optional parameters + * @param callback The callback + */ + update(farmBeatsResourceName: string, resourceGroupName: string, body: Models.FarmBeatsUpdateRequestModel, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(farmBeatsResourceName: string, resourceGroupName: string, body: Models.FarmBeatsUpdateRequestModel, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + farmBeatsResourceName, + resourceGroupName, + body, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Delete a FarmBeats resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, farmBeatsResourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, farmBeatsResourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param farmBeatsResourceName FarmBeats resource name. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, farmBeatsResourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, farmBeatsResourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + farmBeatsResourceName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Lists the FarmBeats instances for a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscription(options?: Models.FarmBeatsModelsListBySubscriptionOptionalParams): Promise; + /** + * @param callback The callback + */ + listBySubscription(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBySubscription(options: Models.FarmBeatsModelsListBySubscriptionOptionalParams, callback: msRest.ServiceCallback): void; + listBySubscription(options?: Models.FarmBeatsModelsListBySubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Lists the FarmBeats instances for a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: Models.FarmBeatsModelsListByResourceGroupOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: Models.FarmBeatsModelsListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: Models.FarmBeatsModelsListByResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Lists the FarmBeats instances for a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscriptionNext(nextPageLink: string, options?: Models.FarmBeatsModelsListBySubscriptionNextOptionalParams): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, options: Models.FarmBeatsModelsListBySubscriptionNextOptionalParams, callback: msRest.ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: Models.FarmBeatsModelsListBySubscriptionNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; + } + + /** + * Lists the FarmBeats instances for a resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: Models.FarmBeatsModelsListByResourceGroupNextOptionalParams): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, options: Models.FarmBeatsModelsListByResourceGroupNextOptionalParams, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: Models.FarmBeatsModelsListByResourceGroupNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.farmBeatsResourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FarmBeats + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}", + urlParameters: [ + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "body", + mapper: { + ...Mappers.FarmBeats, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.FarmBeats + }, + 201: { + bodyMapper: Mappers.FarmBeats + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}", + urlParameters: [ + Parameters.farmBeatsResourceName, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "body", + mapper: { + ...Mappers.FarmBeatsUpdateRequestModel, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.FarmBeats + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.farmBeatsResourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.AgFoodPlatform/farmBeats", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.maxPageSize, + Parameters.skipToken, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FarmBeatsListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.maxPageSize, + Parameters.skipToken, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FarmBeatsListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.maxPageSize, + Parameters.skipToken, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FarmBeatsListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.maxPageSize, + Parameters.skipToken, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FarmBeatsListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/agrifood/arm-agrifood/src/operations/index.ts b/sdk/agrifood/arm-agrifood/src/operations/index.ts new file mode 100644 index 000000000000..b5242f3a9c1d --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/operations/index.ts @@ -0,0 +1,14 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./extensions"; +export * from "./farmBeatsExtensions"; +export * from "./farmBeatsModels"; +export * from "./locations"; +export * from "./operations"; diff --git a/sdk/agrifood/arm-agrifood/src/operations/locations.ts b/sdk/agrifood/arm-agrifood/src/operations/locations.ts new file mode 100644 index 000000000000..1a57c571a774 --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/operations/locations.ts @@ -0,0 +1,87 @@ +/* + * 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 msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/locationsMappers"; +import * as Parameters from "../models/parameters"; +import { AzureAgriFoodRPServiceContext } from "../azureAgriFoodRPServiceContext"; + +/** Class representing a Locations. */ +export class Locations { + private readonly client: AzureAgriFoodRPServiceContext; + + /** + * Create a Locations. + * @param {AzureAgriFoodRPServiceContext} client Reference to the service client. + */ + constructor(client: AzureAgriFoodRPServiceContext) { + this.client = client; + } + + /** + * Checks the name availability of the resource with requested resource name. + * @param body NameAvailabilityRequest object. + * @param [options] The optional parameters + * @returns Promise + */ + checkNameAvailability(body: Models.CheckNameAvailabilityRequest, options?: msRest.RequestOptionsBase): Promise; + /** + * @param body NameAvailabilityRequest object. + * @param callback The callback + */ + checkNameAvailability(body: Models.CheckNameAvailabilityRequest, callback: msRest.ServiceCallback): void; + /** + * @param body NameAvailabilityRequest object. + * @param options The optional parameters + * @param callback The callback + */ + checkNameAvailability(body: Models.CheckNameAvailabilityRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkNameAvailability(body: Models.CheckNameAvailabilityRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + body, + options + }, + checkNameAvailabilityOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.AgFoodPlatform/checkNameAvailability", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "body", + mapper: { + ...Mappers.CheckNameAvailabilityRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.CheckNameAvailabilityResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/agrifood/arm-agrifood/src/operations/operations.ts b/sdk/agrifood/arm-agrifood/src/operations/operations.ts new file mode 100644 index 000000000000..c51bc81a1efc --- /dev/null +++ b/sdk/agrifood/arm-agrifood/src/operations/operations.ts @@ -0,0 +1,125 @@ +/* + * 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 msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { AzureAgriFoodRPServiceContext } from "../azureAgriFoodRPServiceContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: AzureAgriFoodRPServiceContext; + + /** + * Create a Operations. + * @param {AzureAgriFoodRPServiceContext} client Reference to the service client. + */ + constructor(client: AzureAgriFoodRPServiceContext) { + this.client = client; + } + + /** + * Lists the available operations of Microsoft.AgFoodPlatform resource provider. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists the available operations of Microsoft.AgFoodPlatform resource provider. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.AgFoodPlatform/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/agrifood/arm-agrifood/tsconfig.json b/sdk/agrifood/arm-agrifood/tsconfig.json new file mode 100644 index 000000000000..422b584abd5e --- /dev/null +++ b/sdk/agrifood/arm-agrifood/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6", "dom"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./src/**/*.ts"], + "exclude": ["node_modules"] +}