Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

[AutoPR iotcentral/resource-manager] Remove subscriptionId uuid format for IotCentral #2950

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/services/iotcentral/lib/iotCentralClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class IotCentralClient extends AzureServiceClient {
* @class
* @param {credentials} credentials - Credentials needed for the client to connect to Azure.
*
* @param {uuid} subscriptionId - The subscription identifier.
* @param {string} subscriptionId - The subscription identifier.
*
* @param {string} [baseUri] - The base URI of the service.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/services/iotcentral/lib/iotCentralClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class IotCentralClient extends ServiceClient {
/**
* Create a IotCentralClient.
* @param {credentials} credentials - Credentials needed for the client to connect to Azure.
* @param {uuid} subscriptionId - The subscription identifier.
* @param {string} subscriptionId - The subscription identifier.
* @param {string} [baseUri] - The base URI of the service.
* @param {object} [options] - The parameter options
* @param {Array} [options.filters] - Filters to be added to the request pipeline
Expand Down
153 changes: 42 additions & 111 deletions lib/services/iotcentral/lib/operations/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,18 @@ function _get(resourceGroupName, resourceName, options, callback) {
}
// Validate
try {
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string' || !msRest.isValidUuid(this.client.subscriptionId)) {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string and must be a valid uuid.');
if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
}
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
}
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
}
if (resourceGroupName !== null && resourceGroupName !== undefined) {
if (resourceGroupName.length > 64)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 64');
}
if (resourceGroupName.length < 1)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1');
}
}
if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') {
throw new Error('resourceName cannot be null or undefined and it must be of type string.');
}
if (resourceName !== null && resourceName !== undefined) {
if (resourceName.length > 100)
{
throw new Error('"resourceName" should satisfy the constraint - "MaxLength": 100');
}
if (resourceName.length < 1)
{
throw new Error('"resourceName" should satisfy the constraint - "MinLength": 1');
}
}
if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
throw new Error('this.client.acceptLanguage must be of type string.');
}
Expand All @@ -92,7 +75,7 @@ function _get(resourceGroupName, resourceName, options, callback) {
// Construct URL
let baseUrl = this.client.baseUri;
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}';
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId.toString()));
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName));
let queryParameters = [];
Expand Down Expand Up @@ -475,8 +458,11 @@ function _listBySubscription(options, callback) {
}
// Validate
try {
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string' || !msRest.isValidUuid(this.client.subscriptionId)) {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string and must be a valid uuid.');
if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
}
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
}
if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
throw new Error('this.client.acceptLanguage must be of type string.');
Expand All @@ -488,7 +474,7 @@ function _listBySubscription(options, callback) {
// Construct URL
let baseUrl = this.client.baseUri;
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.IoTCentral/IoTApps';
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId.toString()));
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
let queryParameters = [];
queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
if (queryParameters.length > 0) {
Expand Down Expand Up @@ -609,22 +595,15 @@ function _listByResourceGroup(resourceGroupName, options, callback) {
}
// Validate
try {
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string' || !msRest.isValidUuid(this.client.subscriptionId)) {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string and must be a valid uuid.');
if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
}
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
}
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
}
if (resourceGroupName !== null && resourceGroupName !== undefined) {
if (resourceGroupName.length > 64)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 64');
}
if (resourceGroupName.length < 1)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1');
}
}
if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
throw new Error('this.client.acceptLanguage must be of type string.');
}
Expand All @@ -635,7 +614,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) {
// Construct URL
let baseUrl = this.client.baseUri;
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps';
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId.toString()));
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
let queryParameters = [];
queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
Expand Down Expand Up @@ -758,8 +737,11 @@ function _checkNameAvailability(name, options, callback) {
}
// Validate
try {
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string' || !msRest.isValidUuid(this.client.subscriptionId)) {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string and must be a valid uuid.');
if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
}
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
}
if (name === null || name === undefined || typeof name.valueOf() !== 'string') {
throw new Error('name cannot be null or undefined and it must be of type string.');
Expand All @@ -779,7 +761,7 @@ function _checkNameAvailability(name, options, callback) {
// Construct URL
let baseUrl = this.client.baseUri;
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.IoTCentral/checkNameAvailability';
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId.toString()));
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
let queryParameters = [];
queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
if (queryParameters.length > 0) {
Expand Down Expand Up @@ -941,35 +923,18 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, app, options, cal
}
// Validate
try {
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string' || !msRest.isValidUuid(this.client.subscriptionId)) {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string and must be a valid uuid.');
if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
}
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
}
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
}
if (resourceGroupName !== null && resourceGroupName !== undefined) {
if (resourceGroupName.length > 64)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 64');
}
if (resourceGroupName.length < 1)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1');
}
}
if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') {
throw new Error('resourceName cannot be null or undefined and it must be of type string.');
}
if (resourceName !== null && resourceName !== undefined) {
if (resourceName.length > 100)
{
throw new Error('"resourceName" should satisfy the constraint - "MaxLength": 100');
}
if (resourceName.length < 1)
{
throw new Error('"resourceName" should satisfy the constraint - "MinLength": 1');
}
}
if (app === null || app === undefined) {
throw new Error('app cannot be null or undefined.');
}
Expand All @@ -983,7 +948,7 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, app, options, cal
// Construct URL
let baseUrl = this.client.baseUri;
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}';
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId.toString()));
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName));
let queryParameters = [];
Expand Down Expand Up @@ -1154,35 +1119,18 @@ function _beginUpdate(resourceGroupName, resourceName, appPatch, options, callba
}
// Validate
try {
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string' || !msRest.isValidUuid(this.client.subscriptionId)) {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string and must be a valid uuid.');
if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
}
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
}
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
}
if (resourceGroupName !== null && resourceGroupName !== undefined) {
if (resourceGroupName.length > 64)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 64');
}
if (resourceGroupName.length < 1)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1');
}
}
if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') {
throw new Error('resourceName cannot be null or undefined and it must be of type string.');
}
if (resourceName !== null && resourceName !== undefined) {
if (resourceName.length > 100)
{
throw new Error('"resourceName" should satisfy the constraint - "MaxLength": 100');
}
if (resourceName.length < 1)
{
throw new Error('"resourceName" should satisfy the constraint - "MinLength": 1');
}
}
if (appPatch === null || appPatch === undefined) {
throw new Error('appPatch cannot be null or undefined.');
}
Expand All @@ -1196,7 +1144,7 @@ function _beginUpdate(resourceGroupName, resourceName, appPatch, options, callba
// Construct URL
let baseUrl = this.client.baseUri;
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}';
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId.toString()));
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName));
let queryParameters = [];
Expand Down Expand Up @@ -1335,35 +1283,18 @@ function _beginDeleteMethod(resourceGroupName, resourceName, options, callback)
}
// Validate
try {
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string' || !msRest.isValidUuid(this.client.subscriptionId)) {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string and must be a valid uuid.');
if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
}
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
}
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
}
if (resourceGroupName !== null && resourceGroupName !== undefined) {
if (resourceGroupName.length > 64)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 64');
}
if (resourceGroupName.length < 1)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1');
}
}
if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') {
throw new Error('resourceName cannot be null or undefined and it must be of type string.');
}
if (resourceName !== null && resourceName !== undefined) {
if (resourceName.length > 100)
{
throw new Error('"resourceName" should satisfy the constraint - "MaxLength": 100');
}
if (resourceName.length < 1)
{
throw new Error('"resourceName" should satisfy the constraint - "MinLength": 1');
}
}
if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
throw new Error('this.client.acceptLanguage must be of type string.');
}
Expand All @@ -1374,7 +1305,7 @@ function _beginDeleteMethod(resourceGroupName, resourceName, options, callback)
// Construct URL
let baseUrl = this.client.baseUri;
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}';
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId.toString()));
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName));
let queryParameters = [];
Expand Down
3 changes: 3 additions & 0 deletions lib/services/iotcentral/lib/operations/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ function _list(options, callback) {
}
// Validate
try {
if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
}
if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
throw new Error('this.client.acceptLanguage must be of type string.');
}
Expand Down