diff --git a/lib/services/authorizationManagement/lib/authorizationManagementClient.d.ts b/lib/services/authorizationManagement/lib/authorizationManagementClient.d.ts index 33ff65cbe6..f9ed67fe31 100644 --- a/lib/services/authorizationManagement/lib/authorizationManagementClient.d.ts +++ b/lib/services/authorizationManagement/lib/authorizationManagementClient.d.ts @@ -59,6 +59,7 @@ export default class AuthorizationManagementClient extends AzureServiceClient { permissions: operations.Permissions; roleAssignments: operations.RoleAssignments; roleDefinitions: operations.RoleDefinitions; + denyAssignments: operations.DenyAssignments; } export { AuthorizationManagementClient, models as AuthorizationManagementModels }; diff --git a/lib/services/authorizationManagement/lib/authorizationManagementClient.js b/lib/services/authorizationManagement/lib/authorizationManagementClient.js index ce38e31681..fccd8f0ca8 100644 --- a/lib/services/authorizationManagement/lib/authorizationManagementClient.js +++ b/lib/services/authorizationManagement/lib/authorizationManagementClient.js @@ -76,6 +76,7 @@ class AuthorizationManagementClient extends ServiceClient { this.permissions = new operations.Permissions(this); this.roleAssignments = new operations.RoleAssignments(this); this.roleDefinitions = new operations.RoleDefinitions(this); + this.denyAssignments = new operations.DenyAssignments(this); this.models = models; msRest.addSerializationMixin(this); } diff --git a/lib/services/authorizationManagement/lib/models/denyAssignment.js b/lib/services/authorizationManagement/lib/models/denyAssignment.js new file mode 100644 index 0000000000..1c72e427e1 --- /dev/null +++ b/lib/services/authorizationManagement/lib/models/denyAssignment.js @@ -0,0 +1,165 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Deny Assignment + * + */ +class DenyAssignment { + /** + * Create a DenyAssignment. + * @member {string} [id] The deny assignment ID. + * @member {string} [name] The deny assignment name. + * @member {string} [type] The deny assignment type. + * @member {string} [denyAssignmentName] The display name of the deny + * assignment. + * @member {string} [description] The description of the deny assignment. + * @member {array} [permissions] An array of permissions that are denied by + * the deny assignment. + * @member {string} [scope] The deny assignment scope. + * @member {boolean} [doNotApplyToChildScopes] Determines if the deny + * assignment applies to child scopes. Default value is false. + * @member {array} [principals] Array of principals to which the deny + * assignment applies. + * @member {array} [excludePrincipals] Array of principals to which the deny + * assignment does not apply. + * @member {boolean} [isSystemProtected] Specifies whether this deny + * assignment was created by Azure and cannot be edited or deleted. + */ + constructor() { + } + + /** + * Defines the metadata of DenyAssignment + * + * @returns {object} metadata of DenyAssignment + * + */ + mapper() { + return { + required: false, + serializedName: 'DenyAssignment', + type: { + name: 'Composite', + className: 'DenyAssignment', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + denyAssignmentName: { + required: false, + serializedName: 'properties.denyAssignmentName', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + permissions: { + required: false, + serializedName: 'properties.permissions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DenyAssignmentPermissionElementType', + type: { + name: 'Composite', + className: 'DenyAssignmentPermission' + } + } + } + }, + scope: { + required: false, + serializedName: 'properties.scope', + type: { + name: 'String' + } + }, + doNotApplyToChildScopes: { + required: false, + serializedName: 'properties.doNotApplyToChildScopes', + type: { + name: 'Boolean' + } + }, + principals: { + required: false, + serializedName: 'properties.principals', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PrincipalElementType', + type: { + name: 'Composite', + className: 'Principal' + } + } + } + }, + excludePrincipals: { + required: false, + serializedName: 'properties.excludePrincipals', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PrincipalElementType', + type: { + name: 'Composite', + className: 'Principal' + } + } + } + }, + isSystemProtected: { + required: false, + serializedName: 'properties.isSystemProtected', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = DenyAssignment; diff --git a/lib/services/authorizationManagement/lib/models/denyAssignmentFilter.js b/lib/services/authorizationManagement/lib/models/denyAssignmentFilter.js new file mode 100644 index 0000000000..eb20e0ab9e --- /dev/null +++ b/lib/services/authorizationManagement/lib/models/denyAssignmentFilter.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Deny Assignments filter + * + */ +class DenyAssignmentFilter { + /** + * Create a DenyAssignmentFilter. + * @member {string} [denyAssignmentName] Return deny assignment with + * specified name. + * @member {string} [principalId] Return all deny assignments where the + * specified principal is listed in the principals list of deny assignments. + * @member {string} [gdprExportPrincipalId] Return all deny assignments where + * the specified principal is listed either in the principals list or exclude + * principals list of deny assignments. + */ + constructor() { + } + + /** + * Defines the metadata of DenyAssignmentFilter + * + * @returns {object} metadata of DenyAssignmentFilter + * + */ + mapper() { + return { + required: false, + serializedName: 'DenyAssignmentFilter', + type: { + name: 'Composite', + className: 'DenyAssignmentFilter', + modelProperties: { + denyAssignmentName: { + required: false, + serializedName: 'denyAssignmentName', + type: { + name: 'String' + } + }, + principalId: { + required: false, + serializedName: 'principalId', + type: { + name: 'String' + } + }, + gdprExportPrincipalId: { + required: false, + serializedName: 'gdprExportPrincipalId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DenyAssignmentFilter; diff --git a/lib/services/authorizationManagement/lib/models/denyAssignmentListResult.js b/lib/services/authorizationManagement/lib/models/denyAssignmentListResult.js new file mode 100644 index 0000000000..50127cab67 --- /dev/null +++ b/lib/services/authorizationManagement/lib/models/denyAssignmentListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Deny assignment list operation result. + */ +class DenyAssignmentListResult extends Array { + /** + * Create a DenyAssignmentListResult. + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DenyAssignmentListResult + * + * @returns {object} metadata of DenyAssignmentListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DenyAssignmentListResult', + type: { + name: 'Composite', + className: 'DenyAssignmentListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DenyAssignmentElementType', + type: { + name: 'Composite', + className: 'DenyAssignment' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DenyAssignmentListResult; diff --git a/lib/services/authorizationManagement/lib/models/denyAssignmentPermission.js b/lib/services/authorizationManagement/lib/models/denyAssignmentPermission.js new file mode 100644 index 0000000000..0becb5dc4a --- /dev/null +++ b/lib/services/authorizationManagement/lib/models/denyAssignmentPermission.js @@ -0,0 +1,108 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Deny assignment permissions. + * + */ +class DenyAssignmentPermission { + /** + * Create a DenyAssignmentPermission. + * @member {array} [actions] Actions to which the deny assignment does not + * grant access. + * @member {array} [notActions] Actions to exclude from that the deny + * assignment does not grant access. + * @member {array} [dataActions] Data actions to which the deny assignment + * does not grant access. + * @member {array} [notDataActions] Data actions to exclude from that the + * deny assignment does not grant access. + */ + constructor() { + } + + /** + * Defines the metadata of DenyAssignmentPermission + * + * @returns {object} metadata of DenyAssignmentPermission + * + */ + mapper() { + return { + required: false, + serializedName: 'DenyAssignmentPermission', + type: { + name: 'Composite', + className: 'DenyAssignmentPermission', + modelProperties: { + actions: { + required: false, + serializedName: 'actions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + notActions: { + required: false, + serializedName: 'notActions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + dataActions: { + required: false, + serializedName: 'dataActions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + notDataActions: { + required: false, + serializedName: 'notDataActions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = DenyAssignmentPermission; diff --git a/lib/services/authorizationManagement/lib/models/index.d.ts b/lib/services/authorizationManagement/lib/models/index.d.ts index 0575694748..1d81952731 100644 --- a/lib/services/authorizationManagement/lib/models/index.d.ts +++ b/lib/services/authorizationManagement/lib/models/index.d.ts @@ -205,20 +205,115 @@ export interface RoleAssignment { * @member {string} principalId The principal ID assigned to the role. This * maps to the ID inside the Active Directory. It can point to a user, service * principal, or security group. - * @member {string} [principalType] The principal type of the assigned - * principal ID. Possible values include: 'User', 'Group', 'ServicePrincipal', - * 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', - * 'DirectoryObjectOrGroup', 'Everyone' * @member {boolean} [canDelegate] The delgation flag used for creating a role * assignment */ export interface RoleAssignmentCreateParameters { roleDefinitionId: string; principalId: string; - principalType?: string; canDelegate?: boolean; } +/** + * @class + * Initializes a new instance of the DenyAssignmentFilter class. + * @constructor + * Deny Assignments filter + * + * @member {string} [denyAssignmentName] Return deny assignment with specified + * name. + * @member {string} [principalId] Return all deny assignments where the + * specified principal is listed in the principals list of deny assignments. + * @member {string} [gdprExportPrincipalId] Return all deny assignments where + * the specified principal is listed either in the principals list or exclude + * principals list of deny assignments. + */ +export interface DenyAssignmentFilter { + denyAssignmentName?: string; + principalId?: string; + gdprExportPrincipalId?: string; +} + +/** + * @class + * Initializes a new instance of the DenyAssignmentPermission class. + * @constructor + * Deny assignment permissions. + * + * @member {array} [actions] Actions to which the deny assignment does not + * grant access. + * @member {array} [notActions] Actions to exclude from that the deny + * assignment does not grant access. + * @member {array} [dataActions] Data actions to which the deny assignment does + * not grant access. + * @member {array} [notDataActions] Data actions to exclude from that the deny + * assignment does not grant access. + */ +export interface DenyAssignmentPermission { + actions?: string[]; + notActions?: string[]; + dataActions?: string[]; + notDataActions?: string[]; +} + +/** + * @class + * Initializes a new instance of the Principal class. + * @constructor + * Deny assignment principal. + * + * @member {string} [id] Object ID of the Azure AD principal (user, group, or + * service principal) to which the deny assignment applies. An empty guid + * '00000000-0000-0000-0000-000000000000' as principal id and principal type as + * 'Everyone' represents all users, groups and service principals. + * @member {string} [type] Type of object represented by principal id (user, + * group, or service principal). An empty guid + * '00000000-0000-0000-0000-000000000000' as principal id and principal type as + * 'Everyone' represents all users, groups and service principals. + */ +export interface Principal { + readonly id?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the DenyAssignment class. + * @constructor + * Deny Assignment + * + * @member {string} [id] The deny assignment ID. + * @member {string} [name] The deny assignment name. + * @member {string} [type] The deny assignment type. + * @member {string} [denyAssignmentName] The display name of the deny + * assignment. + * @member {string} [description] The description of the deny assignment. + * @member {array} [permissions] An array of permissions that are denied by the + * deny assignment. + * @member {string} [scope] The deny assignment scope. + * @member {boolean} [doNotApplyToChildScopes] Determines if the deny + * assignment applies to child scopes. Default value is false. + * @member {array} [principals] Array of principals to which the deny + * assignment applies. + * @member {array} [excludePrincipals] Array of principals to which the deny + * assignment does not apply. + * @member {boolean} [isSystemProtected] Specifies whether this deny assignment + * was created by Azure and cannot be edited or deleted. + */ +export interface DenyAssignment { + readonly id?: string; + readonly name?: string; + readonly type?: string; + denyAssignmentName?: string; + description?: string; + permissions?: DenyAssignmentPermission[]; + scope?: string; + doNotApplyToChildScopes?: boolean; + principals?: Principal[]; + excludePrincipals?: Principal[]; + isSystemProtected?: boolean; +} + /** * @class @@ -284,3 +379,16 @@ export interface RoleAssignmentListResult extends Array { export interface RoleDefinitionListResult extends Array { nextLink?: string; } + +/** + * @class + * Initializes a new instance of the DenyAssignmentListResult class. + * @constructor + * Deny assignment list operation result. + * + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + */ +export interface DenyAssignmentListResult extends Array { + nextLink?: string; +} diff --git a/lib/services/authorizationManagement/lib/models/index.js b/lib/services/authorizationManagement/lib/models/index.js index aedb81d269..bba8055f71 100644 --- a/lib/services/authorizationManagement/lib/models/index.js +++ b/lib/services/authorizationManagement/lib/models/index.js @@ -28,8 +28,13 @@ exports.RoleDefinition = require('./roleDefinition'); exports.RoleAssignmentFilter = require('./roleAssignmentFilter'); exports.RoleAssignment = require('./roleAssignment'); exports.RoleAssignmentCreateParameters = require('./roleAssignmentCreateParameters'); +exports.DenyAssignmentFilter = require('./denyAssignmentFilter'); +exports.DenyAssignmentPermission = require('./denyAssignmentPermission'); +exports.Principal = require('./principal'); +exports.DenyAssignment = require('./denyAssignment'); exports.ClassicAdministratorListResult = require('./classicAdministratorListResult'); exports.ProviderOperationsMetadataListResult = require('./providerOperationsMetadataListResult'); exports.PermissionGetResult = require('./permissionGetResult'); exports.RoleAssignmentListResult = require('./roleAssignmentListResult'); exports.RoleDefinitionListResult = require('./roleDefinitionListResult'); +exports.DenyAssignmentListResult = require('./denyAssignmentListResult'); diff --git a/lib/services/authorizationManagement/lib/models/principal.js b/lib/services/authorizationManagement/lib/models/principal.js new file mode 100644 index 0000000000..35b4e07596 --- /dev/null +++ b/lib/services/authorizationManagement/lib/models/principal.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Deny assignment principal. + * + */ +class Principal { + /** + * Create a Principal. + * @member {string} [id] Object ID of the Azure AD principal (user, group, or + * service principal) to which the deny assignment applies. An empty guid + * '00000000-0000-0000-0000-000000000000' as principal id and principal type + * as 'Everyone' represents all users, groups and service principals. + * @member {string} [type] Type of object represented by principal id (user, + * group, or service principal). An empty guid + * '00000000-0000-0000-0000-000000000000' as principal id and principal type + * as 'Everyone' represents all users, groups and service principals. + */ + constructor() { + } + + /** + * Defines the metadata of Principal + * + * @returns {object} metadata of Principal + * + */ + mapper() { + return { + required: false, + serializedName: 'Principal', + type: { + name: 'Composite', + className: 'Principal', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Principal; diff --git a/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js b/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js index 645dc8e154..d8bdf2e41e 100644 --- a/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js +++ b/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js @@ -22,10 +22,6 @@ class RoleAssignmentCreateParameters { * @member {string} principalId The principal ID assigned to the role. This * maps to the ID inside the Active Directory. It can point to a user, * service principal, or security group. - * @member {string} [principalType] The principal type of the assigned - * principal ID. Possible values include: 'User', 'Group', - * 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', - * 'Application', 'MSI', 'DirectoryObjectOrGroup', 'Everyone' * @member {boolean} [canDelegate] The delgation flag used for creating a * role assignment */ @@ -60,13 +56,6 @@ class RoleAssignmentCreateParameters { name: 'String' } }, - principalType: { - required: false, - serializedName: 'properties.principalType', - type: { - name: 'String' - } - }, canDelegate: { required: false, serializedName: 'properties.canDelegate', diff --git a/lib/services/authorizationManagement/lib/operations/denyAssignments.js b/lib/services/authorizationManagement/lib/operations/denyAssignments.js new file mode 100644 index 0000000000..e079285ca7 --- /dev/null +++ b/lib/services/authorizationManagement/lib/operations/denyAssignments.js @@ -0,0 +1,2446 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets deny assignments for a resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceProviderNamespace The namespace of the resource + * provider. + * + * @param {string} parentResourcePath The parent resource identity. + * + * @param {string} resourceType The resource type of the resource. + * + * @param {string} resourceName The name of the resource to get deny + * assignments for. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2018-07-01-preview'; + // Validate + try { + 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 (resourceProviderNamespace === null || resourceProviderNamespace === undefined || typeof resourceProviderNamespace.valueOf() !== 'string') { + throw new Error('resourceProviderNamespace cannot be null or undefined and it must be of type string.'); + } + if (parentResourcePath === null || parentResourcePath === undefined || typeof parentResourcePath.valueOf() !== 'string') { + throw new Error('parentResourcePath cannot be null or undefined and it must be of type string.'); + } + if (resourceType === null || resourceType === undefined || typeof resourceType.valueOf() !== 'string') { + throw new Error('resourceType cannot be null or undefined and it must be of type string.'); + } + 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter 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.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/denyAssignments'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceProviderNamespace}', encodeURIComponent(resourceProviderNamespace)); + requestUrl = requestUrl.replace('{parentResourcePath}', parentResourcePath); + requestUrl = requestUrl.replace('{resourceType}', resourceType); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets deny assignments for a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listForResourceGroup(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2018-07-01-preview'; + // Validate + try { + 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter 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.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/denyAssignments'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all deny assignments for the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2018-07-01-preview'; + // Validate + try { + 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter 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.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Authorization/denyAssignments'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Get the specified deny assignment. + * + * @param {string} scope The scope of the deny assignment. + * + * @param {string} denyAssignmentId The ID of the deny assignment to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignment} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(scope, denyAssignmentId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-01-preview'; + // Validate + try { + if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { + throw new Error('scope cannot be null or undefined and it must be of type string.'); + } + if (denyAssignmentId === null || denyAssignmentId === undefined || typeof denyAssignmentId.valueOf() !== 'string') { + throw new Error('denyAssignmentId 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.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{scope}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId}'; + requestUrl = requestUrl.replace('{scope}', scope); + requestUrl = requestUrl.replace('{denyAssignmentId}', encodeURIComponent(denyAssignmentId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignment']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a deny assignment by ID. + * + * @param {string} denyAssignmentId The fully qualified deny assignment ID. For + * example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + * for subscription level deny assignments, or + * /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for + * tenant level deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignment} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getById(denyAssignmentId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-01-preview'; + // Validate + try { + if (denyAssignmentId === null || denyAssignmentId === undefined || typeof denyAssignmentId.valueOf() !== 'string') { + throw new Error('denyAssignmentId 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.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{denyAssignmentId}'; + requestUrl = requestUrl.replace('{denyAssignmentId}', denyAssignmentId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignment']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets deny assignments for a scope. + * + * @param {string} scope The scope of the deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listForScope(scope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2018-07-01-preview'; + // Validate + try { + if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { + throw new Error('scope cannot be null or undefined and it must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter 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.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{scope}/providers/Microsoft.Authorization/denyAssignments'; + requestUrl = requestUrl.replace('{scope}', scope); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets deny assignments for a resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listForResourceNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink 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.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets deny assignments for a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listForResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink 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.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all deny assignments for the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink 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.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets deny assignments for a scope. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listForScopeNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink 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.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a DenyAssignments. */ +class DenyAssignments { + /** + * Create a DenyAssignments. + * @param {AuthorizationManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listForResource = _listForResource; + this._listForResourceGroup = _listForResourceGroup; + this._list = _list; + this._get = _get; + this._getById = _getById; + this._listForScope = _listForScope; + this._listForResourceNext = _listForResourceNext; + this._listForResourceGroupNext = _listForResourceGroupNext; + this._listNext = _listNext; + this._listForScopeNext = _listForScopeNext; + } + + /** + * Gets deny assignments for a resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceProviderNamespace The namespace of the resource + * provider. + * + * @param {string} parentResourcePath The parent resource identity. + * + * @param {string} resourceType The resource type of the resource. + * + * @param {string} resourceName The name of the resource to get deny + * assignments for. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listForResourceWithHttpOperationResponse(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets deny assignments for a resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceProviderNamespace The namespace of the resource + * provider. + * + * @param {string} parentResourcePath The parent resource identity. + * + * @param {string} resourceType The resource type of the resource. + * + * @param {string} resourceName The name of the resource to get deny + * assignments for. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, options, optionalCallback); + } + } + + /** + * Gets deny assignments for a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listForResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listForResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets deny assignments for a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listForResourceGroup(resourceGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listForResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listForResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets all deny assignments for the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all deny assignments for the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * Get the specified deny assignment. + * + * @param {string} scope The scope of the deny assignment. + * + * @param {string} denyAssignmentId The ID of the deny assignment to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(scope, denyAssignmentId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(scope, denyAssignmentId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the specified deny assignment. + * + * @param {string} scope The scope of the deny assignment. + * + * @param {string} denyAssignmentId The ID of the deny assignment to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignment} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignment} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(scope, denyAssignmentId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(scope, denyAssignmentId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(scope, denyAssignmentId, options, optionalCallback); + } + } + + /** + * Gets a deny assignment by ID. + * + * @param {string} denyAssignmentId The fully qualified deny assignment ID. For + * example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + * for subscription level deny assignments, or + * /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for + * tenant level deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getByIdWithHttpOperationResponse(denyAssignmentId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getById(denyAssignmentId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a deny assignment by ID. + * + * @param {string} denyAssignmentId The fully qualified deny assignment ID. For + * example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + * for subscription level deny assignments, or + * /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for + * tenant level deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignment} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignment} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getById(denyAssignmentId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getById(denyAssignmentId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getById(denyAssignmentId, options, optionalCallback); + } + } + + /** + * Gets deny assignments for a scope. + * + * @param {string} scope The scope of the deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listForScopeWithHttpOperationResponse(scope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listForScope(scope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets deny assignments for a scope. + * + * @param {string} scope The scope of the deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listForScope(scope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listForScope(scope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listForScope(scope, options, optionalCallback); + } + } + + /** + * Gets deny assignments for a resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listForResourceNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listForResourceNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets deny assignments for a resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listForResourceNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listForResourceNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listForResourceNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets deny assignments for a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listForResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listForResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets deny assignments for a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listForResourceGroupNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listForResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listForResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all deny assignments for the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all deny assignments for the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets deny assignments for a scope. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listForScopeNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listForScopeNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets deny assignments for a scope. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listForScopeNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listForScopeNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listForScopeNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = DenyAssignments; diff --git a/lib/services/authorizationManagement/lib/operations/index.d.ts b/lib/services/authorizationManagement/lib/operations/index.d.ts index 23d6748379..943144b336 100644 --- a/lib/services/authorizationManagement/lib/operations/index.d.ts +++ b/lib/services/authorizationManagement/lib/operations/index.d.ts @@ -818,11 +818,6 @@ export interface RoleAssignments { * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * - * @param {string} [parameters.principalType] The principal type of the - * assigned principal ID. Possible values include: 'User', 'Group', - * 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', - * 'Application', 'MSI', 'DirectoryObjectOrGroup', 'Everyone' - * * @param {boolean} [parameters.canDelegate] The delgation flag used for * creating a role assignment * @@ -862,11 +857,6 @@ export interface RoleAssignments { * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * - * @param {string} [parameters.principalType] The principal type of the - * assigned principal ID. Possible values include: 'User', 'Group', - * 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', - * 'Application', 'MSI', 'DirectoryObjectOrGroup', 'Everyone' - * * @param {boolean} [parameters.canDelegate] The delgation flag used for * creating a role assignment * @@ -1030,11 +1020,6 @@ export interface RoleAssignments { * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * - * @param {string} [parameters.principalType] The principal type of the - * assigned principal ID. Possible values include: 'User', 'Group', - * 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', - * 'Application', 'MSI', 'DirectoryObjectOrGroup', 'Everyone' - * * @param {boolean} [parameters.canDelegate] The delgation flag used for * creating a role assignment * @@ -1065,11 +1050,6 @@ export interface RoleAssignments { * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * - * @param {string} [parameters.principalType] The principal type of the - * assigned principal ID. Possible values include: 'User', 'Group', - * 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', - * 'Application', 'MSI', 'DirectoryObjectOrGroup', 'Everyone' - * * @param {boolean} [parameters.canDelegate] The delgation flag used for * creating a role assignment * @@ -1918,3 +1898,712 @@ export interface RoleDefinitions { listNext(nextPageLink: string, callback: ServiceCallback): void; listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } + +/** + * @class + * DenyAssignments + * __NOTE__: An instance of this class is automatically created for an + * instance of the AuthorizationManagementClient. + */ +export interface DenyAssignments { + + + /** + * Gets deny assignments for a resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceProviderNamespace The namespace of the resource + * provider. + * + * @param {string} parentResourcePath The parent resource identity. + * + * @param {string} resourceType The resource type of the resource. + * + * @param {string} resourceName The name of the resource to get deny + * assignments for. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listForResourceWithHttpOperationResponse(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets deny assignments for a resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceProviderNamespace The namespace of the resource + * provider. + * + * @param {string} parentResourcePath The parent resource identity. + * + * @param {string} resourceType The resource type of the resource. + * + * @param {string} resourceName The name of the resource to get deny + * assignments for. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, callback: ServiceCallback): void; + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets deny assignments for a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listForResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets deny assignments for a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listForResourceGroup(resourceGroupName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listForResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listForResourceGroup(resourceGroupName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all deny assignments for the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all deny assignments for the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get the specified deny assignment. + * + * @param {string} scope The scope of the deny assignment. + * + * @param {string} denyAssignmentId The ID of the deny assignment to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(scope: string, denyAssignmentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get the specified deny assignment. + * + * @param {string} scope The scope of the deny assignment. + * + * @param {string} denyAssignmentId The ID of the deny assignment to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignment} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignment} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignment} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(scope: string, denyAssignmentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(scope: string, denyAssignmentId: string, callback: ServiceCallback): void; + get(scope: string, denyAssignmentId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a deny assignment by ID. + * + * @param {string} denyAssignmentId The fully qualified deny assignment ID. For + * example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + * for subscription level deny assignments, or + * /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for + * tenant level deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getByIdWithHttpOperationResponse(denyAssignmentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a deny assignment by ID. + * + * @param {string} denyAssignmentId The fully qualified deny assignment ID. For + * example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + * for subscription level deny assignments, or + * /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for + * tenant level deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignment} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignment} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignment} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getById(denyAssignmentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getById(denyAssignmentId: string, callback: ServiceCallback): void; + getById(denyAssignmentId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets deny assignments for a scope. + * + * @param {string} scope The scope of the deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listForScopeWithHttpOperationResponse(scope: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets deny assignments for a scope. + * + * @param {string} scope The scope of the deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listForScope(scope: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listForScope(scope: string, callback: ServiceCallback): void; + listForScope(scope: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets deny assignments for a resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listForResourceNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets deny assignments for a resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listForResourceNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listForResourceNext(nextPageLink: string, callback: ServiceCallback): void; + listForResourceNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets deny assignments for a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listForResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets deny assignments for a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listForResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listForResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listForResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all deny assignments for the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all deny assignments for the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets deny assignments for a scope. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listForScopeNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets deny assignments for a scope. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listForScopeNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listForScopeNext(nextPageLink: string, callback: ServiceCallback): void; + listForScopeNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/authorizationManagement/lib/operations/index.js b/lib/services/authorizationManagement/lib/operations/index.js index 3a264a946c..357740d773 100644 --- a/lib/services/authorizationManagement/lib/operations/index.js +++ b/lib/services/authorizationManagement/lib/operations/index.js @@ -19,3 +19,4 @@ exports.ProviderOperationsMetadataOperations = require('./providerOperationsMeta exports.Permissions = require('./permissions'); exports.RoleAssignments = require('./roleAssignments'); exports.RoleDefinitions = require('./roleDefinitions'); +exports.DenyAssignments = require('./denyAssignments'); diff --git a/lib/services/authorizationManagement/lib/operations/permissions.js b/lib/services/authorizationManagement/lib/operations/permissions.js index 76c2f9684a..96ac5a3e74 100644 --- a/lib/services/authorizationManagement/lib/operations/permissions.js +++ b/lib/services/authorizationManagement/lib/operations/permissions.js @@ -47,7 +47,7 @@ function _listForResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -194,7 +194,7 @@ function _listForResource(resourceGroupName, resourceProviderNamespace, parentRe if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/authorizationManagement/lib/operations/providerOperationsMetadataOperations.js b/lib/services/authorizationManagement/lib/operations/providerOperationsMetadataOperations.js index b6246668ba..2d3a0eb0c0 100644 --- a/lib/services/authorizationManagement/lib/operations/providerOperationsMetadataOperations.js +++ b/lib/services/authorizationManagement/lib/operations/providerOperationsMetadataOperations.js @@ -52,7 +52,7 @@ function _get(resourceProviderNamespace, options, callback) { throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : 'resourceTypes'; - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (resourceProviderNamespace === null || resourceProviderNamespace === undefined || typeof resourceProviderNamespace.valueOf() !== 'string') { @@ -193,7 +193,7 @@ function _list(options, callback) { throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : 'resourceTypes'; - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { diff --git a/lib/services/authorizationManagement/lib/operations/roleAssignments.js b/lib/services/authorizationManagement/lib/operations/roleAssignments.js index 733313d390..2688a75fab 100644 --- a/lib/services/authorizationManagement/lib/operations/roleAssignments.js +++ b/lib/services/authorizationManagement/lib/operations/roleAssignments.js @@ -64,7 +64,7 @@ function _listForResource(resourceGroupName, resourceProviderNamespace, parentRe throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -230,7 +230,7 @@ function _listForResourceGroup(resourceGroupName, options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -376,7 +376,7 @@ function _deleteMethod(scope, roleAssignmentName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { @@ -503,11 +503,6 @@ function _deleteMethod(scope, roleAssignmentName, options, callback) { * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * - * @param {string} [parameters.principalType] The principal type of the - * assigned principal ID. Possible values include: 'User', 'Group', - * 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', - * 'Application', 'MSI', 'DirectoryObjectOrGroup', 'Everyone' - * * @param {boolean} [parameters.canDelegate] The delgation flag used for * creating a role assignment * @@ -539,7 +534,7 @@ function _create(scope, roleAssignmentName, parameters, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { @@ -695,7 +690,7 @@ function _get(scope, roleAssignmentName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { @@ -832,7 +827,7 @@ function _deleteById(roleId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (roleId === null || roleId === undefined || typeof roleId.valueOf() !== 'string') { @@ -946,11 +941,6 @@ function _deleteById(roleId, options, callback) { * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * - * @param {string} [parameters.principalType] The principal type of the - * assigned principal ID. Possible values include: 'User', 'Group', - * 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', - * 'Application', 'MSI', 'DirectoryObjectOrGroup', 'Everyone' - * * @param {boolean} [parameters.canDelegate] The delgation flag used for * creating a role assignment * @@ -982,7 +972,7 @@ function _createById(roleId, parameters, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (roleId === null || roleId === undefined || typeof roleId.valueOf() !== 'string') { @@ -1132,7 +1122,7 @@ function _getById(roleId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (roleId === null || roleId === undefined || typeof roleId.valueOf() !== 'string') { @@ -1270,7 +1260,7 @@ function _list(options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { @@ -1416,7 +1406,7 @@ function _listForScope(scope, options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { @@ -2375,11 +2365,6 @@ class RoleAssignments { * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * - * @param {string} [parameters.principalType] The principal type of the - * assigned principal ID. Possible values include: 'User', 'Group', - * 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', - * 'Application', 'MSI', 'DirectoryObjectOrGroup', 'Everyone' - * * @param {boolean} [parameters.canDelegate] The delgation flag used for * creating a role assignment * @@ -2431,11 +2416,6 @@ class RoleAssignments { * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * - * @param {string} [parameters.principalType] The principal type of the - * assigned principal ID. Possible values include: 'User', 'Group', - * 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', - * 'Application', 'MSI', 'DirectoryObjectOrGroup', 'Everyone' - * * @param {boolean} [parameters.canDelegate] The delgation flag used for * creating a role assignment * @@ -2668,11 +2648,6 @@ class RoleAssignments { * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * - * @param {string} [parameters.principalType] The principal type of the - * assigned principal ID. Possible values include: 'User', 'Group', - * 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', - * 'Application', 'MSI', 'DirectoryObjectOrGroup', 'Everyone' - * * @param {boolean} [parameters.canDelegate] The delgation flag used for * creating a role assignment * @@ -2715,11 +2690,6 @@ class RoleAssignments { * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * - * @param {string} [parameters.principalType] The principal type of the - * assigned principal ID. Possible values include: 'User', 'Group', - * 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', - * 'Application', 'MSI', 'DirectoryObjectOrGroup', 'Everyone' - * * @param {boolean} [parameters.canDelegate] The delgation flag used for * creating a role assignment * diff --git a/lib/services/authorizationManagement/lib/operations/roleDefinitions.js b/lib/services/authorizationManagement/lib/operations/roleDefinitions.js index 07175afefc..48fbc51257 100644 --- a/lib/services/authorizationManagement/lib/operations/roleDefinitions.js +++ b/lib/services/authorizationManagement/lib/operations/roleDefinitions.js @@ -49,7 +49,7 @@ function _deleteMethod(scope, roleDefinitionId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { @@ -188,7 +188,7 @@ function _get(scope, roleDefinitionId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { @@ -341,7 +341,7 @@ function _createOrUpdate(scope, roleDefinitionId, roleDefinition, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { @@ -500,7 +500,7 @@ function _list(scope, options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { @@ -644,7 +644,7 @@ function _getById(roleId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-09-01-preview'; + let apiVersion = '2018-01-01-preview'; // Validate try { if (roleId === null || roleId === undefined || typeof roleId.valueOf() !== 'string') { diff --git a/lib/services/authorizationManagement/package.json b/lib/services/authorizationManagement/package.json index c50780cda2..ebbb29db9c 100644 --- a/lib/services/authorizationManagement/package.json +++ b/lib/services/authorizationManagement/package.json @@ -2,7 +2,7 @@ "name": "azure-arm-authorization", "author": "Microsoft Corporation", "description": "AuthorizationManagementClient Library with typescript type definitions for node", - "version": "7.0.0", + "version": "8.0.0", "dependencies": { "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" diff --git a/test/recordings/keyvaultstorage-tests/Key_Vault_Storage_should_successfully_assign_Key_Vault_the_operator_role_on_a_storage_account.nock.js b/test/recordings/keyvaultstorage-tests/Key_Vault_Storage_should_successfully_assign_Key_Vault_the_operator_role_on_a_storage_account.nock.js index 0d22c8d4d3..ab1d30f647 100644 --- a/test/recordings/keyvaultstorage-tests/Key_Vault_Storage_should_successfully_assign_Key_Vault_the_operator_role_on_a_storage_account.nock.js +++ b/test/recordings/keyvaultstorage-tests/Key_Vault_Storage_should_successfully_assign_Key_Vault_the_operator_role_on_a_storage_account.nock.js @@ -113,7 +113,7 @@ nock('https://management.azure.com:443') function (nock) { var result = nock('https://management.azure.com:443') - .get('///providers/Microsoft.Authorization/roleDefinitions?$filter=roleName%20eq%20%27Storage%20Account%20Key%20Operator%20Service%20Role%27&api-version=2018-09-01-preview') + .get('///providers/Microsoft.Authorization/roleDefinitions?$filter=roleName%20eq%20%27Storage%20Account%20Key%20Operator%20Service%20Role%27&api-version=2018-01-01-preview') .reply(200, "{\"value\":[{\"properties\":{\"roleName\":\"Storage Account Key Operator Service Role\",\"type\":\"BuiltInRole\",\"description\":\"Storage Account Key Operators are allowed to list and regenerate keys on Storage Accounts\",\"assignableScopes\":[\"/\"],\"permissions\":[{\"actions\":[\"Microsoft.Storage/storageAccounts/listkeys/action\",\"Microsoft.Storage/storageAccounts/regeneratekey/action\"],\"notActions\":[],\"dataActions\":[],\"notDataActions\":[]}],\"createdOn\":\"2017-04-13T18:26:11.5770570Z\",\"updatedOn\":\"2017-04-13T20:57:14.5990198Z\",\"createdBy\":null,\"updatedBy\":null},\"id\":\"/providers/Microsoft.Authorization/roleDefinitions/81a9662b-bebf-436f-a333-f67b29880f12\",\"type\":\"Microsoft.Authorization/roleDefinitions\",\"name\":\"81a9662b-bebf-436f-a333-f67b29880f12\"}]}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-length': '737', @@ -136,7 +136,7 @@ function (nock) { var result = nock('https://management.azure.com:443') .filteringRequestBody(function (path) { return '*';}) -.put('//subscriptions/6d8e19c2-3a60-481f-8ebb-118dc3007c5d/resourceGroups/nodeTestGroup8988/providers/Microsoft.Storage/storageAccounts/testakvsa725/providers/Microsoft.Authorization/roleAssignments/afb48884-7051-4b73-b83f-afcca5decd79?api-version=2018-09-01-preview', '*') +.put('//subscriptions/6d8e19c2-3a60-481f-8ebb-118dc3007c5d/resourceGroups/nodeTestGroup8988/providers/Microsoft.Storage/storageAccounts/testakvsa725/providers/Microsoft.Authorization/roleAssignments/afb48884-7051-4b73-b83f-afcca5decd79?api-version=2018-01-01-preview', '*') .reply(201, "{\"properties\":{\"roleDefinitionId\":\"/subscriptions/6d8e19c2-3a60-481f-8ebb-118dc3007c5d/providers/Microsoft.Authorization/roleDefinitions/81a9662b-bebf-436f-a333-f67b29880f12\",\"principalId\":\"93c27d83-f79b-4cb2-8dd4-4aa716542e74\",\"principalType\":\"ServicePrincipal\",\"scope\":\"/subscriptions/6d8e19c2-3a60-481f-8ebb-118dc3007c5d/resourceGroups/nodeTestGroup8988/providers/Microsoft.Storage/storageAccounts/testakvsa725\",\"createdOn\":\"2018-06-27T23:53:49.6661846Z\",\"updatedOn\":\"2018-06-27T23:53:49.6661846Z\",\"createdBy\":null,\"updatedBy\":\"7541419d-883d-452f-a823-56aa8bf0749f\"},\"id\":\"/subscriptions/6d8e19c2-3a60-481f-8ebb-118dc3007c5d/resourceGroups/nodeTestGroup8988/providers/Microsoft.Storage/storageAccounts/testakvsa725/providers/Microsoft.Authorization/roleAssignments/afb48884-7051-4b73-b83f-afcca5decd79\",\"type\":\"Microsoft.Authorization/roleAssignments\",\"name\":\"afb48884-7051-4b73-b83f-afcca5decd79\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-length': '901',