diff --git a/sdk/redisenterprise/arm-redisenterprisecache/LICENSE.txt b/sdk/redisenterprise/arm-redisenterprisecache/LICENSE.txt new file mode 100644 index 000000000000..2d3163745319 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/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/redisenterprise/arm-redisenterprisecache/README.md b/sdk/redisenterprise/arm-redisenterprisecache/README.md new file mode 100644 index 000000000000..5281f220eba8 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/README.md @@ -0,0 +1,98 @@ +## Azure RedisEnterpriseManagementClient SDK for JavaScript + +This package contains an isomorphic SDK for RedisEnterpriseManagementClient. + +### Currently supported environments + +- Node.js version 6.x.x or higher +- Browser JavaScript + +### How to Install + +```bash +npm install @azure/arm-redisenterprisecache +``` + +### How to use + +#### nodejs - client creation and list operations as an example written in TypeScript. + +##### Install @azure/ms-rest-nodeauth + +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. +```bash +npm install @azure/ms-rest-nodeauth@"^3.0.0" +``` + +##### Sample code + +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package +```typescript +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { RedisEnterpriseManagementClient } = require("@azure/arm-redisenterprisecache"); +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new RedisEnterpriseManagementClient(creds, subscriptionId); + client.operations.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +#### browser - Authentication, client creation and list operations as an example written in JavaScript. + +##### Install @azure/ms-rest-browserauth + +```bash +npm install @azure/ms-rest-browserauth +``` + +##### Sample code + +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-redisenterprisecache 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/redisenterprise/arm-redisenterprisecache/README.png) diff --git a/sdk/redisenterprise/arm-redisenterprisecache/package.json b/sdk/redisenterprise/arm-redisenterprisecache/package.json new file mode 100644 index 000000000000..1afee7ef532c --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/package.json @@ -0,0 +1,58 @@ +{ + "name": "@azure/arm-redisenterprisecache", + "author": "Microsoft Corporation", + "description": "RedisEnterpriseManagementClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "@azure/ms-rest-azure-js": "^2.0.1", + "@azure/ms-rest-js": "^2.0.4", + "tslib": "^1.10.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-redisenterprisecache.js", + "module": "./esm/redisEnterpriseManagementClient.js", + "types": "./esm/redisEnterpriseManagementClient.d.ts", + "devDependencies": { + "typescript": "^3.5.3", + "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/redisenterprise/arm-redisenterprisecache", + "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-redisenterprisecache.js.map'\" -o ./dist/arm-redisenterprisecache.min.js ./dist/arm-redisenterprisecache.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/redisenterprise/arm-redisenterprisecache/rollup.config.js b/sdk/redisenterprise/arm-redisenterprisecache/rollup.config.js new file mode 100644 index 000000000000..28ecf3b872aa --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/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/redisEnterpriseManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-redisenterprisecache.js", + format: "umd", + name: "Azure.ArmRedisenterprisecache", + 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/redisenterprise/arm-redisenterprisecache/src/models/databasesMappers.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/databasesMappers.ts new file mode 100644 index 000000000000..8b92032e0b14 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/models/databasesMappers.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AccessKeys, + AzureEntityResource, + BaseResource, + Cluster, + Database, + DatabaseList, + DatabaseUpdate, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + ExportClusterParameters, + ImportClusterParameters, + Module, + Persistence, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateLinkResource, + PrivateLinkServiceConnectionState, + ProxyResource, + RegenerateKeyParameters, + Resource, + Sku, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/index.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/index.ts new file mode 100644 index 000000000000..1f701a1789fc --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/models/index.ts @@ -0,0 +1,1318 @@ +/* + * 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 }; + +/** + * SKU parameters supplied to the create RedisEnterprise operation. + */ +export interface Sku { + /** + * The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, + * EnterpriseFlash_F300 etc.). Possible values include: 'Enterprise_E10', 'Enterprise_E20', + * 'Enterprise_E50', 'Enterprise_E100', 'EnterpriseFlash_F300', 'EnterpriseFlash_F700', + * 'EnterpriseFlash_F1500' + */ + name: SkuName; + /** + * The size of the RedisEnterprise cluster. Defaults to 2 or 3 depending on SKU. Valid values are + * (2, 4, 6, ...) for Enterprise SKUs and (3, 9, 15, ...) for Flash SKUs. + */ + capacity?: number; +} + +/** + * The Private Endpoint resource. + */ +export interface PrivateEndpoint { + /** + * The ARM identifier for Private Endpoint + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; +} + +/** + * A collection of information about the state of the connection between service consumer and + * provider. + */ +export interface PrivateLinkServiceConnectionState { + /** + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. Possible values include: 'Pending', 'Approved', 'Rejected' + */ + status?: PrivateEndpointServiceConnectionStatus; + /** + * The reason for approval/rejection of the connection. + */ + description?: string; + /** + * A message indicating if changes on the service provider require any updates on the consumer. + */ + actionsRequired?: string; +} + +/** + * 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 Private Endpoint Connection resource. + */ +export interface PrivateEndpointConnection extends Resource { + /** + * The resource of private end point. + */ + privateEndpoint?: PrivateEndpoint; + /** + * A collection of information about the state of the connection between service consumer and + * provider. + */ + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + /** + * The provisioning state of the private endpoint connection resource. Possible values include: + * 'Succeeded', 'Creating', 'Deleting', 'Failed' + */ + provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +/** + * 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; +} + +/** + * Describes the RedisEnterprise cluster + */ +export interface Cluster extends TrackedResource { + /** + * The SKU to create, which affects price, performance, and features. + */ + sku: Sku; + /** + * The Availability Zones where this cluster will be deployed. + */ + zones?: string[]; + /** + * The minimum TLS version for the cluster to support, e.g. '1.2'. Possible values include: + * '1.0', '1.1', '1.2' + */ + minimumTlsVersion?: TlsVersion; + /** + * DNS name of the cluster endpoint + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly hostName?: string; + /** + * Current provisioning status of the cluster. Possible values include: 'Succeeded', 'Failed', + * 'Canceled', 'Creating', 'Updating', 'Deleting' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * Current resource status of the cluster. Possible values include: 'Running', 'Creating', + * 'CreateFailed', 'Updating', 'UpdateFailed', 'Deleting', 'DeleteFailed', 'Enabling', + * 'EnableFailed', 'Disabling', 'DisableFailed', 'Disabled' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceState?: ResourceState; + /** + * Version of redis the cluster supports, e.g. '6' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly redisVersion?: string; + /** + * List of private endpoint connections associated with the specified RedisEnterprise cluster + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; +} + +/** + * A partial update to the RedisEnterprise cluster + */ +export interface ClusterUpdate { + /** + * The SKU to create, which affects price, performance, and features. + */ + sku?: Sku; + /** + * The minimum TLS version for the cluster to support, e.g. '1.2'. Possible values include: + * '1.0', '1.1', '1.2' + */ + minimumTlsVersion?: TlsVersion; + /** + * DNS name of the cluster endpoint + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly hostName?: string; + /** + * Current provisioning status of the cluster. Possible values include: 'Succeeded', 'Failed', + * 'Canceled', 'Creating', 'Updating', 'Deleting' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * Current resource status of the cluster. Possible values include: 'Running', 'Creating', + * 'CreateFailed', 'Updating', 'UpdateFailed', 'Deleting', 'DeleteFailed', 'Enabling', + * 'EnableFailed', 'Disabling', 'DisableFailed', 'Disabled' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceState?: ResourceState; + /** + * Version of redis the cluster supports, e.g. '6' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly redisVersion?: string; + /** + * List of private endpoint connections associated with the specified RedisEnterprise cluster + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * Persistence-related configuration for the RedisEnterprise database + * @summary Persistence settings + */ +export interface Persistence { + /** + * Sets whether AOF is enabled. + */ + aofEnabled?: boolean; + /** + * Sets whether RDB is enabled. + */ + rdbEnabled?: boolean; + /** + * Sets the frequency at which data is written to disk. Possible values include: '1s', 'always' + */ + aofFrequency?: AofFrequency; + /** + * Sets the frequency at which a snapshot of the database is created. Possible values include: + * '1h', '6h', '12h' + */ + rdbFrequency?: RdbFrequency; +} + +/** + * Specifies configuration of a redis module + * @summary Module settings + */ +export interface Module { + /** + * The name of the module, e.g. 'RedisBloom', 'RediSearch', 'RedisTimeSeries' + */ + name: string; + /** + * Configuration options for the module, e.g. 'ERROR_RATE 0.00 INITIAL_SIZE 400'. + */ + args?: string; + /** + * The version of the module, e.g. '1.0'. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly version?: 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 { +} + +/** + * Describes a database on the RedisEnterprise cluster + */ +export interface Database extends ProxyResource { + /** + * Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. + * Default is TLS-encrypted. Possible values include: 'Encrypted', 'Plaintext' + */ + clientProtocol?: Protocol; + /** + * TCP port of the database endpoint. Specified at create time. Defaults to an available port. + */ + port?: number; + /** + * Current provisioning status of the database. Possible values include: 'Succeeded', 'Failed', + * 'Canceled', 'Creating', 'Updating', 'Deleting' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * Current resource status of the database. Possible values include: 'Running', 'Creating', + * 'CreateFailed', 'Updating', 'UpdateFailed', 'Deleting', 'DeleteFailed', 'Enabling', + * 'EnableFailed', 'Disabling', 'DisableFailed', 'Disabled' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceState?: ResourceState; + /** + * Clustering policy - default is OSSCluster. Specified at create time. Possible values include: + * 'EnterpriseCluster', 'OSSCluster' + */ + clusteringPolicy?: ClusteringPolicy; + /** + * Redis eviction policy - default is VolatileLRU. Possible values include: 'AllKeysLFU', + * 'AllKeysLRU', 'AllKeysRandom', 'VolatileLRU', 'VolatileLFU', 'VolatileTTL', 'VolatileRandom', + * 'NoEviction' + */ + evictionPolicy?: EvictionPolicy; + /** + * Persistence settings + */ + persistence?: Persistence; + /** + * Optional set of redis modules to enable in this database - modules can only be added at + * creation time. + */ + modules?: Module[]; +} + +/** + * A partial update to the RedisEnterprise database + */ +export interface DatabaseUpdate { + /** + * Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. + * Default is TLS-encrypted. Possible values include: 'Encrypted', 'Plaintext' + */ + clientProtocol?: Protocol; + /** + * TCP port of the database endpoint. Specified at create time. Defaults to an available port. + */ + port?: number; + /** + * Current provisioning status of the database. Possible values include: 'Succeeded', 'Failed', + * 'Canceled', 'Creating', 'Updating', 'Deleting' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * Current resource status of the database. Possible values include: 'Running', 'Creating', + * 'CreateFailed', 'Updating', 'UpdateFailed', 'Deleting', 'DeleteFailed', 'Enabling', + * 'EnableFailed', 'Disabling', 'DisableFailed', 'Disabled' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceState?: ResourceState; + /** + * Clustering policy - default is OSSCluster. Specified at create time. Possible values include: + * 'EnterpriseCluster', 'OSSCluster' + */ + clusteringPolicy?: ClusteringPolicy; + /** + * Redis eviction policy - default is VolatileLRU. Possible values include: 'AllKeysLFU', + * 'AllKeysLRU', 'AllKeysRandom', 'VolatileLRU', 'VolatileLFU', 'VolatileTTL', 'VolatileRandom', + * 'NoEviction' + */ + evictionPolicy?: EvictionPolicy; + /** + * Persistence settings + */ + persistence?: Persistence; + /** + * Optional set of redis modules to enable in this database - modules can only be added at + * creation time. + */ + modules?: Module[]; +} + +/** + * The secret access keys used for authenticating connections to redis + * @summary Access keys + */ +export interface AccessKeys { + /** + * The current primary key that clients can use to authenticate + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly primaryKey?: string; + /** + * The current secondary key that clients can use to authenticate + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly secondaryKey?: string; +} + +/** + * Specifies which access keys to reset to a new random value. + * @summary Regenerate access keys request + */ +export interface RegenerateKeyParameters { + /** + * Which access key to regenerate. Possible values include: 'Primary', 'Secondary' + */ + keyType: AccessKeyType; +} + +/** + * Parameters for a Redis Enterprise import operation. + * @summary Import an RDB file into a target database + */ +export interface ImportClusterParameters { + /** + * SAS URI for the target blob to import from + */ + sasUri: string; +} + +/** + * Parameters for a Redis Enterprise export operation. + * @summary Export an RDB file into a target database + */ +export interface ExportClusterParameters { + /** + * SAS URI for the target directory to export to + */ + sasUri: 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; +} + +/** + * The status of a long-running operation. + */ +export interface OperationStatus { + /** + * The operation's unique id. + */ + id?: string; + /** + * The operation's name. + */ + name?: string; + /** + * The start time of the operation. + */ + startTime?: string; + /** + * The end time of the operation. + */ + endTime?: string; + /** + * The current status of the operation. + */ + status?: string; + /** + * Error response describing why the operation failed. + */ + error?: ErrorResponse; +} + +/** + * 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; +} + +/** + * A private link resource + */ +export interface PrivateLinkResource extends Resource { + /** + * The private link resource group id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly groupId?: string; + /** + * The private link resource required member names. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly requiredMembers?: string[]; + /** + * The private link resource Private link DNS zone name. + */ + requiredZoneNames?: string[]; +} + +/** + * 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; +} + +/** + * An interface representing RedisEnterpriseManagementClientOptions. + */ +export interface RedisEnterpriseManagementClientOptions extends AzureServiceClientOptions { + baseUri?: 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; +} + +/** + * @interface + * The response of a list-all operation. + * @extends Array + */ +export interface ClusterList extends Array { + /** + * The URI to fetch the next page of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * The response of a list-all operation. + * @extends Array + */ +export interface DatabaseList extends Array { + /** + * The URI to fetch the next page of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * List of private endpoint connection associated with the specified storage account + * @extends Array + */ +export interface PrivateEndpointConnectionListResult extends Array { +} + +/** + * @interface + * A list of private link resources + * @extends Array + */ +export interface PrivateLinkResourceListResult extends Array { +} + +/** + * Defines values for SkuName. + * Possible values include: 'Enterprise_E10', 'Enterprise_E20', 'Enterprise_E50', + * 'Enterprise_E100', 'EnterpriseFlash_F300', 'EnterpriseFlash_F700', 'EnterpriseFlash_F1500' + * @readonly + * @enum {string} + */ +export type SkuName = 'Enterprise_E10' | 'Enterprise_E20' | 'Enterprise_E50' | 'Enterprise_E100' | 'EnterpriseFlash_F300' | 'EnterpriseFlash_F700' | 'EnterpriseFlash_F1500'; + +/** + * Defines values for ProvisioningState. + * Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Creating', 'Updating', 'Deleting' + * @readonly + * @enum {string} + */ +export type ProvisioningState = 'Succeeded' | 'Failed' | 'Canceled' | 'Creating' | 'Updating' | 'Deleting'; + +/** + * Defines values for ResourceState. + * Possible values include: 'Running', 'Creating', 'CreateFailed', 'Updating', 'UpdateFailed', + * 'Deleting', 'DeleteFailed', 'Enabling', 'EnableFailed', 'Disabling', 'DisableFailed', 'Disabled' + * @readonly + * @enum {string} + */ +export type ResourceState = 'Running' | 'Creating' | 'CreateFailed' | 'Updating' | 'UpdateFailed' | 'Deleting' | 'DeleteFailed' | 'Enabling' | 'EnableFailed' | 'Disabling' | 'DisableFailed' | 'Disabled'; + +/** + * Defines values for TlsVersion. + * Possible values include: '1.0', '1.1', '1.2' + * @readonly + * @enum {string} + */ +export type TlsVersion = '1.0' | '1.1' | '1.2'; + +/** + * Defines values for PrivateEndpointServiceConnectionStatus. + * Possible values include: 'Pending', 'Approved', 'Rejected' + * @readonly + * @enum {string} + */ +export type PrivateEndpointServiceConnectionStatus = 'Pending' | 'Approved' | 'Rejected'; + +/** + * Defines values for PrivateEndpointConnectionProvisioningState. + * Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed' + * @readonly + * @enum {string} + */ +export type PrivateEndpointConnectionProvisioningState = 'Succeeded' | 'Creating' | 'Deleting' | 'Failed'; + +/** + * Defines values for Protocol. + * Possible values include: 'Encrypted', 'Plaintext' + * @readonly + * @enum {string} + */ +export type Protocol = 'Encrypted' | 'Plaintext'; + +/** + * Defines values for ClusteringPolicy. + * Possible values include: 'EnterpriseCluster', 'OSSCluster' + * @readonly + * @enum {string} + */ +export type ClusteringPolicy = 'EnterpriseCluster' | 'OSSCluster'; + +/** + * Defines values for EvictionPolicy. + * Possible values include: 'AllKeysLFU', 'AllKeysLRU', 'AllKeysRandom', 'VolatileLRU', + * 'VolatileLFU', 'VolatileTTL', 'VolatileRandom', 'NoEviction' + * @readonly + * @enum {string} + */ +export type EvictionPolicy = 'AllKeysLFU' | 'AllKeysLRU' | 'AllKeysRandom' | 'VolatileLRU' | 'VolatileLFU' | 'VolatileTTL' | 'VolatileRandom' | 'NoEviction'; + +/** + * Defines values for AofFrequency. + * Possible values include: '1s', 'always' + * @readonly + * @enum {string} + */ +export type AofFrequency = '1s' | 'always'; + +/** + * Defines values for RdbFrequency. + * Possible values include: '1h', '6h', '12h' + * @readonly + * @enum {string} + */ +export type RdbFrequency = '1h' | '6h' | '12h'; + +/** + * Defines values for AccessKeyType. + * Possible values include: 'Primary', 'Secondary' + * @readonly + * @enum {string} + */ +export type AccessKeyType = 'Primary' | 'Secondary'; + +/** + * 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'; + +/** + * 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; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type OperationsStatusGetResponse = OperationStatus & { + /** + * 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: OperationStatus; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type RedisEnterpriseCreateResponse = Cluster & { + /** + * 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: Cluster; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type RedisEnterpriseUpdateResponse = Cluster & { + /** + * 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: Cluster; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type RedisEnterpriseGetResponse = Cluster & { + /** + * 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: Cluster; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type RedisEnterpriseListByResourceGroupResponse = ClusterList & { + /** + * 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: ClusterList; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type RedisEnterpriseListResponse = ClusterList & { + /** + * 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: ClusterList; + }; +}; + +/** + * Contains response data for the beginCreate operation. + */ +export type RedisEnterpriseBeginCreateResponse = Cluster & { + /** + * 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: Cluster; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type RedisEnterpriseBeginUpdateResponse = Cluster & { + /** + * 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: Cluster; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type RedisEnterpriseListByResourceGroupNextResponse = ClusterList & { + /** + * 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: ClusterList; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type RedisEnterpriseListNextResponse = ClusterList & { + /** + * 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: ClusterList; + }; +}; + +/** + * Contains response data for the listByCluster operation. + */ +export type DatabasesListByClusterResponse = DatabaseList & { + /** + * 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: DatabaseList; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type DatabasesCreateResponse = Database & { + /** + * 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: Database; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type DatabasesUpdateResponse = Database & { + /** + * 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: Database; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type DatabasesGetResponse = Database & { + /** + * 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: Database; + }; +}; + +/** + * Contains response data for the listKeys operation. + */ +export type DatabasesListKeysResponse = AccessKeys & { + /** + * 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: AccessKeys; + }; +}; + +/** + * Contains response data for the regenerateKey operation. + */ +export type DatabasesRegenerateKeyResponse = AccessKeys & { + /** + * 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: AccessKeys; + }; +}; + +/** + * Contains response data for the beginCreate operation. + */ +export type DatabasesBeginCreateResponse = Database & { + /** + * 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: Database; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type DatabasesBeginUpdateResponse = Database & { + /** + * 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: Database; + }; +}; + +/** + * Contains response data for the beginRegenerateKey operation. + */ +export type DatabasesBeginRegenerateKeyResponse = AccessKeys & { + /** + * 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: AccessKeys; + }; +}; + +/** + * Contains response data for the listByClusterNext operation. + */ +export type DatabasesListByClusterNextResponse = DatabaseList & { + /** + * 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: DatabaseList; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult & { + /** + * 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: PrivateEndpointConnectionListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection & { + /** + * 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: PrivateEndpointConnection; + }; +}; + +/** + * Contains response data for the put operation. + */ +export type PrivateEndpointConnectionsPutResponse = PrivateEndpointConnection & { + /** + * 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: PrivateEndpointConnection; + }; +}; + +/** + * Contains response data for the beginPut operation. + */ +export type PrivateEndpointConnectionsBeginPutResponse = PrivateEndpointConnection & { + /** + * 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: PrivateEndpointConnection; + }; +}; + +/** + * Contains response data for the listByCluster operation. + */ +export type PrivateLinkResourcesListByClusterResponse = PrivateLinkResourceListResult & { + /** + * 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: PrivateLinkResourceListResult; + }; +}; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/mappers.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/mappers.ts new file mode 100644 index 000000000000..da7943f2f74b --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/models/mappers.ts @@ -0,0 +1,1033 @@ +/* + * 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 Sku: msRest.CompositeMapper = { + serializedName: "Sku", + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number" + } + } + } + } +}; + +export const PrivateEndpoint: msRest.CompositeMapper = { + serializedName: "PrivateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkServiceConnectionState: msRest.CompositeMapper = { + serializedName: "PrivateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + actionsRequired: { + serializedName: "actionsRequired", + 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 PrivateEndpointConnection: msRest.CompositeMapper = { + serializedName: "PrivateEndpointConnection", + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...Resource.type.modelProperties, + privateEndpoint: { + serializedName: "properties.privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint" + } + }, + privateLinkServiceConnectionState: { + required: true, + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + 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 Cluster: msRest.CompositeMapper = { + serializedName: "Cluster", + type: { + name: "Composite", + className: "Cluster", + modelProperties: { + ...TrackedResource.type.modelProperties, + sku: { + required: true, + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + zones: { + serializedName: "zones", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + minimumTlsVersion: { + serializedName: "properties.minimumTlsVersion", + type: { + name: "String" + } + }, + hostName: { + readOnly: true, + serializedName: "properties.hostName", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + resourceState: { + readOnly: true, + serializedName: "properties.resourceState", + type: { + name: "String" + } + }, + redisVersion: { + readOnly: true, + serializedName: "properties.redisVersion", + type: { + name: "String" + } + }, + privateEndpointConnections: { + readOnly: true, + serializedName: "properties.privateEndpointConnections", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + } + } + } +}; + +export const ClusterUpdate: msRest.CompositeMapper = { + serializedName: "ClusterUpdate", + type: { + name: "Composite", + className: "ClusterUpdate", + modelProperties: { + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + minimumTlsVersion: { + serializedName: "properties.minimumTlsVersion", + type: { + name: "String" + } + }, + hostName: { + readOnly: true, + serializedName: "properties.hostName", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + resourceState: { + readOnly: true, + serializedName: "properties.resourceState", + type: { + name: "String" + } + }, + redisVersion: { + readOnly: true, + serializedName: "properties.redisVersion", + type: { + name: "String" + } + }, + privateEndpointConnections: { + readOnly: true, + serializedName: "properties.privateEndpointConnections", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const Persistence: msRest.CompositeMapper = { + serializedName: "Persistence", + type: { + name: "Composite", + className: "Persistence", + modelProperties: { + aofEnabled: { + serializedName: "aofEnabled", + type: { + name: "Boolean" + } + }, + rdbEnabled: { + serializedName: "rdbEnabled", + type: { + name: "Boolean" + } + }, + aofFrequency: { + serializedName: "aofFrequency", + type: { + name: "String" + } + }, + rdbFrequency: { + serializedName: "rdbFrequency", + type: { + name: "String" + } + } + } + } +}; + +export const Module: msRest.CompositeMapper = { + serializedName: "Module", + type: { + name: "Composite", + className: "Module", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + args: { + serializedName: "args", + type: { + name: "String" + } + }, + version: { + readOnly: true, + serializedName: "version", + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const Database: msRest.CompositeMapper = { + serializedName: "Database", + type: { + name: "Composite", + className: "Database", + modelProperties: { + ...ProxyResource.type.modelProperties, + clientProtocol: { + serializedName: "properties.clientProtocol", + type: { + name: "String" + } + }, + port: { + serializedName: "properties.port", + type: { + name: "Number" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + resourceState: { + readOnly: true, + serializedName: "properties.resourceState", + type: { + name: "String" + } + }, + clusteringPolicy: { + serializedName: "properties.clusteringPolicy", + type: { + name: "String" + } + }, + evictionPolicy: { + serializedName: "properties.evictionPolicy", + type: { + name: "String" + } + }, + persistence: { + serializedName: "properties.persistence", + type: { + name: "Composite", + className: "Persistence" + } + }, + modules: { + serializedName: "properties.modules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Module" + } + } + } + } + } + } +}; + +export const DatabaseUpdate: msRest.CompositeMapper = { + serializedName: "DatabaseUpdate", + type: { + name: "Composite", + className: "DatabaseUpdate", + modelProperties: { + clientProtocol: { + serializedName: "properties.clientProtocol", + type: { + name: "String" + } + }, + port: { + serializedName: "properties.port", + type: { + name: "Number" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + resourceState: { + readOnly: true, + serializedName: "properties.resourceState", + type: { + name: "String" + } + }, + clusteringPolicy: { + serializedName: "properties.clusteringPolicy", + type: { + name: "String" + } + }, + evictionPolicy: { + serializedName: "properties.evictionPolicy", + type: { + name: "String" + } + }, + persistence: { + serializedName: "properties.persistence", + type: { + name: "Composite", + className: "Persistence" + } + }, + modules: { + serializedName: "properties.modules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Module" + } + } + } + } + } + } +}; + +export const AccessKeys: msRest.CompositeMapper = { + serializedName: "AccessKeys", + type: { + name: "Composite", + className: "AccessKeys", + modelProperties: { + primaryKey: { + readOnly: true, + serializedName: "primaryKey", + type: { + name: "String" + } + }, + secondaryKey: { + readOnly: true, + serializedName: "secondaryKey", + type: { + name: "String" + } + } + } + } +}; + +export const RegenerateKeyParameters: msRest.CompositeMapper = { + serializedName: "RegenerateKeyParameters", + type: { + name: "Composite", + className: "RegenerateKeyParameters", + modelProperties: { + keyType: { + required: true, + serializedName: "keyType", + type: { + name: "Enum", + allowedValues: [ + "Primary", + "Secondary" + ] + } + } + } + } +}; + +export const ImportClusterParameters: msRest.CompositeMapper = { + serializedName: "ImportClusterParameters", + type: { + name: "Composite", + className: "ImportClusterParameters", + modelProperties: { + sasUri: { + required: true, + serializedName: "sasUri", + type: { + name: "String" + } + } + } + } +}; + +export const ExportClusterParameters: msRest.CompositeMapper = { + serializedName: "ExportClusterParameters", + type: { + name: "Composite", + className: "ExportClusterParameters", + modelProperties: { + sasUri: { + required: true, + serializedName: "sasUri", + 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 OperationStatus: msRest.CompositeMapper = { + serializedName: "OperationStatus", + type: { + name: "Composite", + className: "OperationStatus", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + type: { + name: "String" + } + }, + endTime: { + serializedName: "endTime", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponse" + } + } + } + } +}; + +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 PrivateLinkResource: msRest.CompositeMapper = { + serializedName: "PrivateLinkResource", + type: { + name: "Composite", + className: "PrivateLinkResource", + modelProperties: { + ...Resource.type.modelProperties, + groupId: { + readOnly: true, + serializedName: "properties.groupId", + type: { + name: "String" + } + }, + requiredMembers: { + readOnly: true, + serializedName: "properties.requiredMembers", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + requiredZoneNames: { + serializedName: "properties.requiredZoneNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +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 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" + } + } + } + } +}; + +export const ClusterList: msRest.CompositeMapper = { + serializedName: "ClusterList", + type: { + name: "Composite", + className: "ClusterList", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Cluster" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const DatabaseList: msRest.CompositeMapper = { + serializedName: "DatabaseList", + type: { + name: "Composite", + className: "DatabaseList", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Database" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnectionListResult: msRest.CompositeMapper = { + serializedName: "PrivateEndpointConnectionListResult", + type: { + name: "Composite", + className: "PrivateEndpointConnectionListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + } + } + } +}; + +export const PrivateLinkResourceListResult: msRest.CompositeMapper = { + serializedName: "PrivateLinkResourceListResult", + type: { + name: "Composite", + className: "PrivateLinkResourceListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } + } + } + } + } +}; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/operationsMappers.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/operationsMappers.ts new file mode 100644 index 000000000000..fddc3077d64b --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/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/redisenterprise/arm-redisenterprisecache/src/models/operationsStatusMappers.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/operationsStatusMappers.ts new file mode 100644 index 000000000000..f0219f9c237e --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/models/operationsStatusMappers.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 { + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + OperationStatus +} from "../models/mappers"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/parameters.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/parameters.ts new file mode 100644 index 000000000000..98f4bd82664b --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/models/parameters.ts @@ -0,0 +1,123 @@ +/* + * 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 clusterName: msRest.OperationURLParameter = { + parameterPath: "clusterName", + mapper: { + required: true, + serializedName: "clusterName", + type: { + name: "String" + } + } +}; +export const databaseName: msRest.OperationURLParameter = { + parameterPath: "databaseName", + mapper: { + required: true, + serializedName: "databaseName", + type: { + name: "String" + } + } +}; +export const location: msRest.OperationURLParameter = { + parameterPath: "location", + mapper: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const operationId: msRest.OperationURLParameter = { + parameterPath: "operationId", + mapper: { + required: true, + serializedName: "operationId", + type: { + name: "String" + } + } +}; +export const privateEndpointConnectionName: msRest.OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", + mapper: { + required: true, + serializedName: "privateEndpointConnectionName", + type: { + name: "String" + } + } +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + 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/redisenterprise/arm-redisenterprisecache/src/models/privateEndpointConnectionsMappers.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/privateEndpointConnectionsMappers.ts new file mode 100644 index 000000000000..965cde2b1b26 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/models/privateEndpointConnectionsMappers.ts @@ -0,0 +1,28 @@ +/* + * 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, + Cluster, + Database, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Module, + Persistence, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionListResult, + PrivateLinkResource, + PrivateLinkServiceConnectionState, + ProxyResource, + Resource, + Sku, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/privateLinkResourcesMappers.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/privateLinkResourcesMappers.ts new file mode 100644 index 000000000000..8a66020d28c2 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/models/privateLinkResourcesMappers.ts @@ -0,0 +1,28 @@ +/* + * 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, + Cluster, + Database, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Module, + Persistence, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateLinkResource, + PrivateLinkResourceListResult, + PrivateLinkServiceConnectionState, + ProxyResource, + Resource, + Sku, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/redisEnterpriseMappers.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/redisEnterpriseMappers.ts new file mode 100644 index 000000000000..9beb18ebd427 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/models/redisEnterpriseMappers.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AzureEntityResource, + BaseResource, + Cluster, + ClusterList, + ClusterUpdate, + Database, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Module, + Persistence, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateLinkResource, + PrivateLinkServiceConnectionState, + ProxyResource, + Resource, + Sku, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/databases.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/databases.ts new file mode 100644 index 000000000000..5317e2a3bf78 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/databases.ts @@ -0,0 +1,676 @@ +/* + * 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 msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/databasesMappers"; +import * as Parameters from "../models/parameters"; +import { RedisEnterpriseManagementClientContext } from "../redisEnterpriseManagementClientContext"; + +/** Class representing a Databases. */ +export class Databases { + private readonly client: RedisEnterpriseManagementClientContext; + + /** + * Create a Databases. + * @param {RedisEnterpriseManagementClientContext} client Reference to the service client. + */ + constructor(client: RedisEnterpriseManagementClientContext) { + this.client = client; + } + + /** + * Gets all databases in the specified RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param [options] The optional parameters + * @returns Promise + */ + listByCluster(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param callback The callback + */ + listByCluster(resourceGroupName: string, clusterName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param options The optional parameters + * @param callback The callback + */ + listByCluster(resourceGroupName: string, clusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByCluster(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + options + }, + listByClusterOperationSpec, + callback) as Promise; + } + + /** + * Creates a database + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Parameters supplied to the create or update database operation. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, clusterName: string, databaseName: string, parameters: Models.Database, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,clusterName,databaseName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates a database + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Parameters supplied to the create or update database operation. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, clusterName: string, databaseName: string, parameters: Models.DatabaseUpdate, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,clusterName,databaseName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Gets information about a database in a RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, clusterName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param callback The callback + */ + get(resourceGroupName: string, clusterName: string, databaseName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, clusterName: string, databaseName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, clusterName: string, databaseName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + databaseName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Deletes a single database + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,clusterName,databaseName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Retrieves the access keys for the RedisEnterprise database. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param [options] The optional parameters + * @returns Promise + */ + listKeys(resourceGroupName: string, clusterName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param callback The callback + */ + listKeys(resourceGroupName: string, clusterName: string, databaseName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param options The optional parameters + * @param callback The callback + */ + listKeys(resourceGroupName: string, clusterName: string, databaseName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listKeys(resourceGroupName: string, clusterName: string, databaseName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + databaseName, + options + }, + listKeysOperationSpec, + callback) as Promise; + } + + /** + * Regenerates the RedisEnterprise database's access keys. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param keyType Which access key to regenerate. Possible values include: 'Primary', 'Secondary' + * @param [options] The optional parameters + * @returns Promise + */ + regenerateKey(resourceGroupName: string, clusterName: string, databaseName: string, keyType: Models.AccessKeyType, options?: msRest.RequestOptionsBase): Promise { + return this.beginRegenerateKey(resourceGroupName,clusterName,databaseName,keyType,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Imports a database file to target database. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param sasUri SAS URI for the target blob to import from + * @param [options] The optional parameters + * @returns Promise + */ + importMethod(resourceGroupName: string, clusterName: string, databaseName: string, sasUri: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginImportMethod(resourceGroupName,clusterName,databaseName,sasUri,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Exports a database file from target database. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param sasUri SAS URI for the target directory to export to + * @param [options] The optional parameters + * @returns Promise + */ + exportMethod(resourceGroupName: string, clusterName: string, databaseName: string, sasUri: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginExportMethod(resourceGroupName,clusterName,databaseName,sasUri,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Creates a database + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Parameters supplied to the create or update database operation. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, clusterName: string, databaseName: string, parameters: Models.Database, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + clusterName, + databaseName, + parameters, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Updates a database + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Parameters supplied to the create or update database operation. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, clusterName: string, databaseName: string, parameters: Models.DatabaseUpdate, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + clusterName, + databaseName, + parameters, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Deletes a single database + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + clusterName, + databaseName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Regenerates the RedisEnterprise database's access keys. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param keyType Which access key to regenerate. Possible values include: 'Primary', 'Secondary' + * @param [options] The optional parameters + * @returns Promise + */ + beginRegenerateKey(resourceGroupName: string, clusterName: string, databaseName: string, keyType: Models.AccessKeyType, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + clusterName, + databaseName, + keyType, + options + }, + beginRegenerateKeyOperationSpec, + options); + } + + /** + * Imports a database file to target database. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param sasUri SAS URI for the target blob to import from + * @param [options] The optional parameters + * @returns Promise + */ + beginImportMethod(resourceGroupName: string, clusterName: string, databaseName: string, sasUri: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + clusterName, + databaseName, + sasUri, + options + }, + beginImportMethodOperationSpec, + options); + } + + /** + * Exports a database file from target database. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param sasUri SAS URI for the target directory to export to + * @param [options] The optional parameters + * @returns Promise + */ + beginExportMethod(resourceGroupName: string, clusterName: string, databaseName: string, sasUri: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + clusterName, + databaseName, + sasUri, + options + }, + beginExportMethodOperationSpec, + options); + } + + /** + * Gets all databases in the specified RedisEnterprise cluster. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByClusterNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByClusterNext(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 + */ + listByClusterNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByClusterNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByClusterNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByClusterOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DatabaseList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.databaseName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Database + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listKeysOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/listKeys", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.databaseName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AccessKeys + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.databaseName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Database, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Database + }, + 201: { + bodyMapper: Mappers.Database + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.databaseName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.DatabaseUpdate, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Database + }, + 202: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.databaseName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginRegenerateKeyOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/regenerateKey", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.databaseName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + keyType: "keyType" + }, + mapper: { + ...Mappers.RegenerateKeyParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.AccessKeys + }, + 202: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginImportMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/import", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.databaseName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + sasUri: "sasUri" + }, + mapper: { + ...Mappers.ImportClusterParameters, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginExportMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/export", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.databaseName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + sasUri: "sasUri" + }, + mapper: { + ...Mappers.ExportClusterParameters, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByClusterNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DatabaseList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/index.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/index.ts new file mode 100644 index 000000000000..15d088f84042 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/index.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 * from "./operations"; +export * from "./operationsStatus"; +export * from "./redisEnterprise"; +export * from "./databases"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkResources"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/operations.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/operations.ts new file mode 100644 index 000000000000..b08303351ab9 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/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 { RedisEnterpriseManagementClientContext } from "../redisEnterpriseManagementClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: RedisEnterpriseManagementClientContext; + + /** + * Create a Operations. + * @param {RedisEnterpriseManagementClientContext} client Reference to the service client. + */ + constructor(client: RedisEnterpriseManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache 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 all of the available REST API operations of the Microsoft.Cache 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.Cache/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/redisenterprise/arm-redisenterprisecache/src/operations/operationsStatus.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/operationsStatus.ts new file mode 100644 index 000000000000..c6e650f64c2c --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/operationsStatus.ts @@ -0,0 +1,86 @@ +/* + * 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/operationsStatusMappers"; +import * as Parameters from "../models/parameters"; +import { RedisEnterpriseManagementClientContext } from "../redisEnterpriseManagementClientContext"; + +/** Class representing a OperationsStatus. */ +export class OperationsStatus { + private readonly client: RedisEnterpriseManagementClientContext; + + /** + * Create a OperationsStatus. + * @param {RedisEnterpriseManagementClientContext} client Reference to the service client. + */ + constructor(client: RedisEnterpriseManagementClientContext) { + this.client = client; + } + + /** + * Gets the status of operation. + * @param location The region the operation is in. + * @param operationId The operation's unique identifier. + * @param [options] The optional parameters + * @returns Promise + */ + get(location: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param location The region the operation is in. + * @param operationId The operation's unique identifier. + * @param callback The callback + */ + get(location: string, operationId: string, callback: msRest.ServiceCallback): void; + /** + * @param location The region the operation is in. + * @param operationId The operation's unique identifier. + * @param options The optional parameters + * @param callback The callback + */ + get(location: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(location: string, operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + location, + operationId, + options + }, + getOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Cache/locations/{location}/operationsStatus/{operationId}", + urlParameters: [ + Parameters.location, + Parameters.operationId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationStatus + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateEndpointConnections.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..01d839cfc0f2 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateEndpointConnections.ts @@ -0,0 +1,289 @@ +/* + * 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 msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/privateEndpointConnectionsMappers"; +import * as Parameters from "../models/parameters"; +import { RedisEnterpriseManagementClientContext } from "../redisEnterpriseManagementClientContext"; + +/** Class representing a PrivateEndpointConnections. */ +export class PrivateEndpointConnections { + private readonly client: RedisEnterpriseManagementClientContext; + + /** + * Create a PrivateEndpointConnections. + * @param {RedisEnterpriseManagementClientContext} client Reference to the service client. + */ + constructor(client: RedisEnterpriseManagementClientContext) { + this.client = client; + } + + /** + * Lists all the private endpoint connections associated with the RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param callback The callback + */ + list(resourceGroupName: string, clusterName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, clusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets the specified private endpoint connection associated with the RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Azure resource + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Azure resource + * @param callback The callback + */ + get(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Azure resource + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + privateEndpointConnectionName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Updates the state of the specified private endpoint connection associated with the + * RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Azure resource + * @param properties The private endpoint connection properties. + * @param [options] The optional parameters + * @returns Promise + */ + put(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase): Promise { + return this.beginPut(resourceGroupName,clusterName,privateEndpointConnectionName,properties,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Azure resource + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Azure resource + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Azure resource + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + privateEndpointConnectionName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Updates the state of the specified private endpoint connection associated with the + * RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Azure resource + * @param properties The private endpoint connection properties. + * @param [options] The optional parameters + * @returns Promise + */ + beginPut(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + clusterName, + privateEndpointConnectionName, + properties, + options + }, + beginPutOperationSpec, + options); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.privateEndpointConnectionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.subscriptionId, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginPutOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.subscriptionId, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "properties", + mapper: { + ...Mappers.PrivateEndpointConnection, + required: true + } + }, + responses: { + 201: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateLinkResources.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateLinkResources.ts new file mode 100644 index 000000000000..c70a164fff31 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateLinkResources.ts @@ -0,0 +1,86 @@ +/* + * 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/privateLinkResourcesMappers"; +import * as Parameters from "../models/parameters"; +import { RedisEnterpriseManagementClientContext } from "../redisEnterpriseManagementClientContext"; + +/** Class representing a PrivateLinkResources. */ +export class PrivateLinkResources { + private readonly client: RedisEnterpriseManagementClientContext; + + /** + * Create a PrivateLinkResources. + * @param {RedisEnterpriseManagementClientContext} client Reference to the service client. + */ + constructor(client: RedisEnterpriseManagementClientContext) { + this.client = client; + } + + /** + * Gets the private link resources that need to be created for a RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param [options] The optional parameters + * @returns Promise + */ + listByCluster(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param callback The callback + */ + listByCluster(resourceGroupName: string, clusterName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param options The optional parameters + * @param callback The callback + */ + listByCluster(resourceGroupName: string, clusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByCluster(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + options + }, + listByClusterOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByClusterOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateLinkResources", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/redisEnterprise.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/redisEnterprise.ts new file mode 100644 index 000000000000..dccaae6b2b1d --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/redisEnterprise.ts @@ -0,0 +1,479 @@ +/* + * 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 msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/redisEnterpriseMappers"; +import * as Parameters from "../models/parameters"; +import { RedisEnterpriseManagementClientContext } from "../redisEnterpriseManagementClientContext"; + +/** Class representing a RedisEnterprise. */ +export class RedisEnterprise { + private readonly client: RedisEnterpriseManagementClientContext; + + /** + * Create a RedisEnterprise. + * @param {RedisEnterpriseManagementClientContext} client Reference to the service client. + */ + constructor(client: RedisEnterpriseManagementClientContext) { + this.client = client; + } + + /** + * Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param parameters Parameters supplied to the Create RedisEnterprise operation. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, clusterName: string, parameters: Models.Cluster, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,clusterName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates an existing RedisEnterprise cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param parameters Parameters supplied to the Update RedisEnterprise operation. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, clusterName: string, parameters: Models.ClusterUpdate, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,clusterName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes a RedisEnterprise cache cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,clusterName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Gets information about a RedisEnterprise cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param callback The callback + */ + get(resourceGroupName: string, clusterName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, clusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Lists all RedisEnterprise clusters in 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?: msRest.RequestOptionsBase): 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: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Gets all RedisEnterprise clusters in the specified subscription. + * @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; + } + + /** + * Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param parameters Parameters supplied to the Create RedisEnterprise operation. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, clusterName: string, parameters: Models.Cluster, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + clusterName, + parameters, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Updates an existing RedisEnterprise cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param parameters Parameters supplied to the Update RedisEnterprise operation. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, clusterName: string, parameters: Models.ClusterUpdate, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + clusterName, + parameters, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Deletes a RedisEnterprise cache cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + clusterName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Lists all RedisEnterprise clusters in 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?: msRest.RequestOptionsBase): 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: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all RedisEnterprise clusters in the specified subscription. + * @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 getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Cluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ClusterList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Cache/redisEnterprise", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ClusterList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Cluster, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Cluster + }, + 201: { + bodyMapper: Mappers.Cluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ClusterUpdate, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Cluster + }, + 202: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ClusterList + }, + 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.ClusterList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClient.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClient.ts new file mode 100644 index 000000000000..39c21aeb4b84 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClient.ts @@ -0,0 +1,51 @@ +/* + * 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/mappers"; +import * as operations from "./operations"; +import { RedisEnterpriseManagementClientContext } from "./redisEnterpriseManagementClientContext"; + + +class RedisEnterpriseManagementClient extends RedisEnterpriseManagementClientContext { + // Operation groups + operations: operations.Operations; + operationsStatus: operations.OperationsStatus; + redisEnterprise: operations.RedisEnterprise; + databases: operations.Databases; + privateEndpointConnections: operations.PrivateEndpointConnections; + privateLinkResources: operations.PrivateLinkResources; + + /** + * Initializes a new instance of the RedisEnterpriseManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.RedisEnterpriseManagementClientOptions) { + super(credentials, subscriptionId, options); + this.operations = new operations.Operations(this); + this.operationsStatus = new operations.OperationsStatus(this); + this.redisEnterprise = new operations.RedisEnterprise(this); + this.databases = new operations.Databases(this); + this.privateEndpointConnections = new operations.PrivateEndpointConnections(this); + this.privateLinkResources = new operations.PrivateLinkResources(this); + } +} + +// Operation Specifications + +export { + RedisEnterpriseManagementClient, + RedisEnterpriseManagementClientContext, + Models as RedisEnterpriseManagementModels, + Mappers as RedisEnterpriseManagementMappers +}; +export * from "./operations"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClientContext.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClientContext.ts new file mode 100644 index 000000000000..3682ef12303b --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClientContext.ts @@ -0,0 +1,61 @@ +/* + * 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"; + +const packageName = "@azure/arm-redisenterprisecache"; +const packageVersion = "1.0.0"; + +export class RedisEnterpriseManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the RedisEnterpriseManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.RedisEnterpriseManagementClientOptions) { + 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 = '2021-03-01'; + 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/redisenterprise/arm-redisenterprisecache/tsconfig.json b/sdk/redisenterprise/arm-redisenterprisecache/tsconfig.json new file mode 100644 index 000000000000..422b584abd5e --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/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"] +}