From 7bd148dc528c795e7c7161634273ce169108be56 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 19 Jun 2018 11:42:14 -0700 Subject: [PATCH] Generated from 40858f2b62c42577e6d834ceac599d41fdcc08d3 (#3022) Fix the validation Check for apiId parameter in the productapis --- .../apimanagement/lib/models/errorResponse.js | 8 +-- .../apimanagement/lib/models/index.d.ts | 2 +- .../apimanagement/lib/operations/index.d.ts | 30 ++++---- .../lib/operations/productApi.js | 69 +++++++++++-------- lib/services/apimanagement/package.json | 7 +- 5 files changed, 67 insertions(+), 49 deletions(-) diff --git a/lib/services/apimanagement/lib/models/errorResponse.js b/lib/services/apimanagement/lib/models/errorResponse.js index d3cf803b2c..2e1010e017 100644 --- a/lib/services/apimanagement/lib/models/errorResponse.js +++ b/lib/services/apimanagement/lib/models/errorResponse.js @@ -13,7 +13,7 @@ const models = require('./index'); /** - * Error Body contract. + * Error Response. * */ class ErrorResponse { @@ -44,21 +44,21 @@ class ErrorResponse { modelProperties: { code: { required: false, - serializedName: 'code', + serializedName: 'error.code', type: { name: 'String' } }, message: { required: false, - serializedName: 'message', + serializedName: 'error.message', type: { name: 'String' } }, details: { required: false, - serializedName: 'details', + serializedName: 'error.details', type: { name: 'Sequence', element: { diff --git a/lib/services/apimanagement/lib/models/index.d.ts b/lib/services/apimanagement/lib/models/index.d.ts index 373f0ed690..6e87acd473 100644 --- a/lib/services/apimanagement/lib/models/index.d.ts +++ b/lib/services/apimanagement/lib/models/index.d.ts @@ -37,7 +37,7 @@ export interface ErrorFieldContract { * @class * Initializes a new instance of the ErrorResponse class. * @constructor - * Error Body contract. + * Error Response. * * @member {string} [code] Service-defined error code. This code serves as a * sub-status for the HTTP error code specified in the response. diff --git a/lib/services/apimanagement/lib/operations/index.d.ts b/lib/services/apimanagement/lib/operations/index.d.ts index 91cfb380a4..ce7958e0f4 100644 --- a/lib/services/apimanagement/lib/operations/index.d.ts +++ b/lib/services/apimanagement/lib/operations/index.d.ts @@ -17813,8 +17813,9 @@ export interface ProductApi { * @param {string} productId Product identifier. Must be unique in the current * API Management service instance. * - * @param {string} apiId API identifier. Must be unique in the current API - * Management service instance. + * @param {string} apiId API revision identifier. Must be unique in the current + * API Management service instance. Non-current revision has ;rev=n as a suffix + * where n is the revision number. * * @param {object} [options] Optional Parameters. * @@ -17840,8 +17841,9 @@ export interface ProductApi { * @param {string} productId Product identifier. Must be unique in the current * API Management service instance. * - * @param {string} apiId API identifier. Must be unique in the current API - * Management service instance. + * @param {string} apiId API revision identifier. Must be unique in the current + * API Management service instance. Non-current revision has ;rev=n as a suffix + * where n is the revision number. * * @param {object} [options] Optional Parameters. * @@ -17884,8 +17886,9 @@ export interface ProductApi { * @param {string} productId Product identifier. Must be unique in the current * API Management service instance. * - * @param {string} apiId API identifier. Must be unique in the current API - * Management service instance. + * @param {string} apiId API revision identifier. Must be unique in the current + * API Management service instance. Non-current revision has ;rev=n as a suffix + * where n is the revision number. * * @param {object} [options] Optional Parameters. * @@ -17910,8 +17913,9 @@ export interface ProductApi { * @param {string} productId Product identifier. Must be unique in the current * API Management service instance. * - * @param {string} apiId API identifier. Must be unique in the current API - * Management service instance. + * @param {string} apiId API revision identifier. Must be unique in the current + * API Management service instance. Non-current revision has ;rev=n as a suffix + * where n is the revision number. * * @param {object} [options] Optional Parameters. * @@ -17955,8 +17959,9 @@ export interface ProductApi { * @param {string} productId Product identifier. Must be unique in the current * API Management service instance. * - * @param {string} apiId API identifier. Must be unique in the current API - * Management service instance. + * @param {string} apiId API revision identifier. Must be unique in the current + * API Management service instance. Non-current revision has ;rev=n as a suffix + * where n is the revision number. * * @param {object} [options] Optional Parameters. * @@ -17981,8 +17986,9 @@ export interface ProductApi { * @param {string} productId Product identifier. Must be unique in the current * API Management service instance. * - * @param {string} apiId API identifier. Must be unique in the current API - * Management service instance. + * @param {string} apiId API revision identifier. Must be unique in the current + * API Management service instance. Non-current revision has ;rev=n as a suffix + * where n is the revision number. * * @param {object} [options] Optional Parameters. * diff --git a/lib/services/apimanagement/lib/operations/productApi.js b/lib/services/apimanagement/lib/operations/productApi.js index 703eaee0bf..4499b5e506 100644 --- a/lib/services/apimanagement/lib/operations/productApi.js +++ b/lib/services/apimanagement/lib/operations/productApi.js @@ -258,8 +258,9 @@ function _listByProduct(resourceGroupName, serviceName, productId, options, call * @param {string} productId Product identifier. Must be unique in the current * API Management service instance. * - * @param {string} apiId API identifier. Must be unique in the current API - * Management service instance. + * @param {string} apiId API revision identifier. Must be unique in the current + * API Management service instance. Non-current revision has ;rev=n as a suffix + * where n is the revision number. * * @param {object} [options] Optional Parameters. * @@ -331,17 +332,17 @@ function _checkEntityExists(resourceGroupName, serviceName, productId, apiId, op throw new Error('apiId cannot be null or undefined and it must be of type string.'); } if (apiId !== null && apiId !== undefined) { - if (apiId.length > 80) + if (apiId.length > 256) { - throw new Error('"apiId" should satisfy the constraint - "MaxLength": 80'); + throw new Error('"apiId" should satisfy the constraint - "MaxLength": 256'); } if (apiId.length < 1) { throw new Error('"apiId" should satisfy the constraint - "MinLength": 1'); } - if (apiId.match(/(^[\w]+$)|(^[\w][\w\-]+[\w]$)/) === null) + if (apiId.match(/^[^*#&+:<>?]+$/) === null) { - throw new Error('"apiId" should satisfy the constraint - "Pattern": /(^[\w]+$)|(^[\w][\w\-]+[\w]$)/'); + throw new Error('"apiId" should satisfy the constraint - "Pattern": /^[^*#&+:<>?]+$/'); } } if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { @@ -443,8 +444,9 @@ function _checkEntityExists(resourceGroupName, serviceName, productId, apiId, op * @param {string} productId Product identifier. Must be unique in the current * API Management service instance. * - * @param {string} apiId API identifier. Must be unique in the current API - * Management service instance. + * @param {string} apiId API revision identifier. Must be unique in the current + * API Management service instance. Non-current revision has ;rev=n as a suffix + * where n is the revision number. * * @param {object} [options] Optional Parameters. * @@ -517,17 +519,17 @@ function _createOrUpdate(resourceGroupName, serviceName, productId, apiId, optio throw new Error('apiId cannot be null or undefined and it must be of type string.'); } if (apiId !== null && apiId !== undefined) { - if (apiId.length > 80) + if (apiId.length > 256) { - throw new Error('"apiId" should satisfy the constraint - "MaxLength": 80'); + throw new Error('"apiId" should satisfy the constraint - "MaxLength": 256'); } if (apiId.length < 1) { throw new Error('"apiId" should satisfy the constraint - "MinLength": 1'); } - if (apiId.match(/(^[\w]+$)|(^[\w][\w\-]+[\w]$)/) === null) + if (apiId.match(/^[^*#&+:<>?]+$/) === null) { - throw new Error('"apiId" should satisfy the constraint - "Pattern": /(^[\w]+$)|(^[\w][\w\-]+[\w]$)/'); + throw new Error('"apiId" should satisfy the constraint - "Pattern": /^[^*#&+:<>?]+$/'); } } if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { @@ -662,8 +664,9 @@ function _createOrUpdate(resourceGroupName, serviceName, productId, apiId, optio * @param {string} productId Product identifier. Must be unique in the current * API Management service instance. * - * @param {string} apiId API identifier. Must be unique in the current API - * Management service instance. + * @param {string} apiId API revision identifier. Must be unique in the current + * API Management service instance. Non-current revision has ;rev=n as a suffix + * where n is the revision number. * * @param {object} [options] Optional Parameters. * @@ -735,17 +738,17 @@ function _deleteMethod(resourceGroupName, serviceName, productId, apiId, options throw new Error('apiId cannot be null or undefined and it must be of type string.'); } if (apiId !== null && apiId !== undefined) { - if (apiId.length > 80) + if (apiId.length > 256) { - throw new Error('"apiId" should satisfy the constraint - "MaxLength": 80'); + throw new Error('"apiId" should satisfy the constraint - "MaxLength": 256'); } if (apiId.length < 1) { throw new Error('"apiId" should satisfy the constraint - "MinLength": 1'); } - if (apiId.match(/(^[\w]+$)|(^[\w][\w\-]+[\w]$)/) === null) + if (apiId.match(/^[^*#&+:<>?]+$/) === null) { - throw new Error('"apiId" should satisfy the constraint - "Pattern": /(^[\w]+$)|(^[\w][\w\-]+[\w]$)/'); + throw new Error('"apiId" should satisfy the constraint - "Pattern": /^[^*#&+:<>?]+$/'); } } if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { @@ -1120,8 +1123,9 @@ class ProductApi { * @param {string} productId Product identifier. Must be unique in the current * API Management service instance. * - * @param {string} apiId API identifier. Must be unique in the current API - * Management service instance. + * @param {string} apiId API revision identifier. Must be unique in the current + * API Management service instance. Non-current revision has ;rev=n as a suffix + * where n is the revision number. * * @param {object} [options] Optional Parameters. * @@ -1159,8 +1163,9 @@ class ProductApi { * @param {string} productId Product identifier. Must be unique in the current * API Management service instance. * - * @param {string} apiId API identifier. Must be unique in the current API - * Management service instance. + * @param {string} apiId API revision identifier. Must be unique in the current + * API Management service instance. Non-current revision has ;rev=n as a suffix + * where n is the revision number. * * @param {object} [options] Optional Parameters. * @@ -1218,8 +1223,9 @@ class ProductApi { * @param {string} productId Product identifier. Must be unique in the current * API Management service instance. * - * @param {string} apiId API identifier. Must be unique in the current API - * Management service instance. + * @param {string} apiId API revision identifier. Must be unique in the current + * API Management service instance. Non-current revision has ;rev=n as a suffix + * where n is the revision number. * * @param {object} [options] Optional Parameters. * @@ -1256,8 +1262,9 @@ class ProductApi { * @param {string} productId Product identifier. Must be unique in the current * API Management service instance. * - * @param {string} apiId API identifier. Must be unique in the current API - * Management service instance. + * @param {string} apiId API revision identifier. Must be unique in the current + * API Management service instance. Non-current revision has ;rev=n as a suffix + * where n is the revision number. * * @param {object} [options] Optional Parameters. * @@ -1316,8 +1323,9 @@ class ProductApi { * @param {string} productId Product identifier. Must be unique in the current * API Management service instance. * - * @param {string} apiId API identifier. Must be unique in the current API - * Management service instance. + * @param {string} apiId API revision identifier. Must be unique in the current + * API Management service instance. Non-current revision has ;rev=n as a suffix + * where n is the revision number. * * @param {object} [options] Optional Parameters. * @@ -1354,8 +1362,9 @@ class ProductApi { * @param {string} productId Product identifier. Must be unique in the current * API Management service instance. * - * @param {string} apiId API identifier. Must be unique in the current API - * Management service instance. + * @param {string} apiId API revision identifier. Must be unique in the current + * API Management service instance. Non-current revision has ;rev=n as a suffix + * where n is the revision number. * * @param {object} [options] Optional Parameters. * diff --git a/lib/services/apimanagement/package.json b/lib/services/apimanagement/package.json index 73d1daed63..ffc18487c6 100644 --- a/lib/services/apimanagement/package.json +++ b/lib/services/apimanagement/package.json @@ -4,10 +4,13 @@ "description": "ApiManagementClient Library with typescript type definitions for node", "version": "2.1.0-preview", "dependencies": { - "ms-rest": "^2.3.2", + "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" }, - "keywords": [ "node", "azure" ], + "keywords": [ + "node", + "azure" + ], "license": "MIT", "main": "./lib/apiManagementClient.js", "types": "./lib/apiManagementClient.d.ts",