diff --git a/lib/services/authorizationManagement/lib/authorizationManagementClient.d.ts b/lib/services/authorizationManagement/lib/authorizationManagementClient.d.ts index f9ed67fe31..2f2fc8646e 100644 --- a/lib/services/authorizationManagement/lib/authorizationManagementClient.d.ts +++ b/lib/services/authorizationManagement/lib/authorizationManagementClient.d.ts @@ -56,8 +56,8 @@ export default class AuthorizationManagementClient extends AzureServiceClient { // Operation groups classicAdministrators: operations.ClassicAdministrators; providerOperationsMetadataOperations: operations.ProviderOperationsMetadataOperations; - permissions: operations.Permissions; roleAssignments: operations.RoleAssignments; + permissions: operations.Permissions; roleDefinitions: operations.RoleDefinitions; denyAssignments: operations.DenyAssignments; } diff --git a/lib/services/authorizationManagement/lib/authorizationManagementClient.js b/lib/services/authorizationManagement/lib/authorizationManagementClient.js index fccd8f0ca8..6be7a43ee9 100644 --- a/lib/services/authorizationManagement/lib/authorizationManagementClient.js +++ b/lib/services/authorizationManagement/lib/authorizationManagementClient.js @@ -73,8 +73,8 @@ class AuthorizationManagementClient extends ServiceClient { } this.classicAdministrators = new operations.ClassicAdministrators(this); this.providerOperationsMetadataOperations = new operations.ProviderOperationsMetadataOperations(this); - this.permissions = new operations.Permissions(this); this.roleAssignments = new operations.RoleAssignments(this); + this.permissions = new operations.Permissions(this); this.roleDefinitions = new operations.RoleDefinitions(this); this.denyAssignments = new operations.DenyAssignments(this); this.models = models; diff --git a/lib/services/authorizationManagement/lib/models/index.d.ts b/lib/services/authorizationManagement/lib/models/index.d.ts index 1d81952731..4e40212258 100644 --- a/lib/services/authorizationManagement/lib/models/index.d.ts +++ b/lib/services/authorizationManagement/lib/models/index.d.ts @@ -97,64 +97,6 @@ export interface ProviderOperationsMetadata { operations?: ProviderOperation[]; } -/** - * @class - * Initializes a new instance of the Permission class. - * @constructor - * Role definition permissions. - * - * @member {array} [actions] Allowed actions. - * @member {array} [notActions] Denied actions. - * @member {array} [dataActions] Allowed Data actions. - * @member {array} [notDataActions] Denied Data actions. - */ -export interface Permission { - actions?: string[]; - notActions?: string[]; - dataActions?: string[]; - notDataActions?: string[]; -} - -/** - * @class - * Initializes a new instance of the RoleDefinitionFilter class. - * @constructor - * Role Definitions filter - * - * @member {string} [roleName] Returns role definition with the specific name. - * @member {string} [type] Returns role definition with the specific type. - */ -export interface RoleDefinitionFilter { - roleName?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the RoleDefinition class. - * @constructor - * Role definition. - * - * @member {string} [id] The role definition ID. - * @member {string} [name] The role definition name. - * @member {string} [type] The role definition type. - * @member {string} [roleName] The role name. - * @member {string} [description] The role definition description. - * @member {string} [roleType] The role type. - * @member {array} [permissions] Role definition permissions. - * @member {array} [assignableScopes] Role definition assignable scopes. - */ -export interface RoleDefinition { - readonly id?: string; - readonly name?: string; - readonly type?: string; - roleName?: string; - description?: string; - roleType?: string; - permissions?: Permission[]; - assignableScopes?: string[]; -} - /** * @class * Initializes a new instance of the RoleAssignmentFilter class. @@ -205,15 +147,78 @@ 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 RoleDefinitionFilter class. + * @constructor + * Role Definitions filter + * + * @member {string} [roleName] Returns role definition with the specific name. + * @member {string} [type] Returns role definition with the specific type. + */ +export interface RoleDefinitionFilter { + roleName?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the Permission class. + * @constructor + * Role definition permissions. + * + * @member {array} [actions] Allowed actions. + * @member {array} [notActions] Denied actions. + * @member {array} [dataActions] Allowed Data actions. + * @member {array} [notDataActions] Denied Data actions. + */ +export interface Permission { + actions?: string[]; + notActions?: string[]; + dataActions?: string[]; + notDataActions?: string[]; +} + +/** + * @class + * Initializes a new instance of the RoleDefinition class. + * @constructor + * Role definition. + * + * @member {string} [id] The role definition ID. + * @member {string} [name] The role definition name. + * @member {string} [type] The role definition type. + * @member {string} [roleName] The role name. + * @member {string} [description] The role definition description. + * @member {string} [roleType] The role type. + * @member {array} [permissions] Role definition permissions. + * @member {array} [assignableScopes] Role definition assignable scopes. + */ +export interface RoleDefinition { + readonly id?: string; + readonly name?: string; + readonly type?: string; + roleName?: string; + description?: string; + roleType?: string; + permissions?: Permission[]; + assignableScopes?: string[]; +} + /** * @class * Initializes a new instance of the DenyAssignmentFilter class. @@ -343,27 +348,27 @@ export interface ProviderOperationsMetadataListResult extends Array { +export interface RoleAssignmentListResult extends Array { nextLink?: string; } /** * @class - * Initializes a new instance of the RoleAssignmentListResult class. + * Initializes a new instance of the PermissionGetResult class. * @constructor - * Role assignment list operation result. + * Permissions information. * * @member {string} [nextLink] The URL to use for getting the next set of * results. */ -export interface RoleAssignmentListResult extends Array { +export interface PermissionGetResult extends Array { nextLink?: string; } diff --git a/lib/services/authorizationManagement/lib/models/index.js b/lib/services/authorizationManagement/lib/models/index.js index bba8055f71..707a0a363d 100644 --- a/lib/services/authorizationManagement/lib/models/index.js +++ b/lib/services/authorizationManagement/lib/models/index.js @@ -22,19 +22,19 @@ exports.ClassicAdministrator = require('./classicAdministrator'); exports.ProviderOperation = require('./providerOperation'); exports.ResourceType = require('./resourceType'); exports.ProviderOperationsMetadata = require('./providerOperationsMetadata'); -exports.Permission = require('./permission'); -exports.RoleDefinitionFilter = require('./roleDefinitionFilter'); -exports.RoleDefinition = require('./roleDefinition'); exports.RoleAssignmentFilter = require('./roleAssignmentFilter'); exports.RoleAssignment = require('./roleAssignment'); exports.RoleAssignmentCreateParameters = require('./roleAssignmentCreateParameters'); +exports.RoleDefinitionFilter = require('./roleDefinitionFilter'); +exports.Permission = require('./permission'); +exports.RoleDefinition = require('./roleDefinition'); 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.PermissionGetResult = require('./permissionGetResult'); exports.RoleDefinitionListResult = require('./roleDefinitionListResult'); exports.DenyAssignmentListResult = require('./denyAssignmentListResult'); diff --git a/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js b/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js index d8bdf2e41e..645dc8e154 100644 --- a/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js +++ b/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js @@ -22,6 +22,10 @@ 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 */ @@ -56,6 +60,13 @@ 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/index.d.ts b/lib/services/authorizationManagement/lib/operations/index.d.ts index 943144b336..0fb02617dd 100644 --- a/lib/services/authorizationManagement/lib/operations/index.d.ts +++ b/lib/services/authorizationManagement/lib/operations/index.d.ts @@ -320,259 +320,6 @@ export interface ProviderOperationsMetadataOperations { listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } -/** - * @class - * Permissions - * __NOTE__: An instance of this class is automatically created for an - * instance of the AuthorizationManagementClient. - */ -export interface Permissions { - - - /** - * Gets all permissions the caller has for a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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. - */ - listForResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all permissions the caller has for a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {PermissionGetResult} - 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. - * - * {PermissionGetResult} [result] - The deserialized result object if an error did not occur. - * See {@link PermissionGetResult} 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?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listForResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listForResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all permissions the caller has 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 the permissions - * for. - * - * @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. - */ - listForResourceWithHttpOperationResponse(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all permissions the caller has 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 the permissions - * for. - * - * @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 {PermissionGetResult} - 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. - * - * {PermissionGetResult} [result] - The deserialized result object if an error did not occur. - * See {@link PermissionGetResult} 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?: { 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: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all permissions the caller has 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 all permissions the caller has 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 {PermissionGetResult} - 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. - * - * {PermissionGetResult} [result] - The deserialized result object if an error did not occur. - * See {@link PermissionGetResult} 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 permissions the caller has 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 all permissions the caller has 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 {PermissionGetResult} - 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. - * - * {PermissionGetResult} [result] - The deserialized result object if an error did not occur. - * See {@link PermissionGetResult} 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; -} - /** * @class * RoleAssignments @@ -818,6 +565,11 @@ 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 * @@ -857,6 +609,11 @@ 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 * @@ -1020,6 +777,11 @@ 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 * @@ -1050,6 +812,11 @@ 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 * @@ -1500,6 +1267,259 @@ export interface RoleAssignments { listForScopeNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * Permissions + * __NOTE__: An instance of this class is automatically created for an + * instance of the AuthorizationManagementClient. + */ +export interface Permissions { + + + /** + * Gets all permissions the caller has for a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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. + */ + listForResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all permissions the caller has for a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {PermissionGetResult} - 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. + * + * {PermissionGetResult} [result] - The deserialized result object if an error did not occur. + * See {@link PermissionGetResult} 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?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listForResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listForResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all permissions the caller has 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 the permissions + * for. + * + * @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. + */ + listForResourceWithHttpOperationResponse(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all permissions the caller has 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 the permissions + * for. + * + * @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 {PermissionGetResult} - 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. + * + * {PermissionGetResult} [result] - The deserialized result object if an error did not occur. + * See {@link PermissionGetResult} 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?: { 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: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all permissions the caller has 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 all permissions the caller has 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 {PermissionGetResult} - 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. + * + * {PermissionGetResult} [result] - The deserialized result object if an error did not occur. + * See {@link PermissionGetResult} 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 permissions the caller has 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 all permissions the caller has 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 {PermissionGetResult} - 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. + * + * {PermissionGetResult} [result] - The deserialized result object if an error did not occur. + * See {@link PermissionGetResult} 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; +} + /** * @class * RoleDefinitions diff --git a/lib/services/authorizationManagement/lib/operations/index.js b/lib/services/authorizationManagement/lib/operations/index.js index 357740d773..29e4404bd8 100644 --- a/lib/services/authorizationManagement/lib/operations/index.js +++ b/lib/services/authorizationManagement/lib/operations/index.js @@ -16,7 +16,7 @@ exports.ClassicAdministrators = require('./classicAdministrators'); exports.ProviderOperationsMetadataOperations = require('./providerOperationsMetadataOperations'); -exports.Permissions = require('./permissions'); exports.RoleAssignments = require('./roleAssignments'); +exports.Permissions = require('./permissions'); exports.RoleDefinitions = require('./roleDefinitions'); exports.DenyAssignments = require('./denyAssignments'); diff --git a/lib/services/authorizationManagement/lib/operations/roleAssignments.js b/lib/services/authorizationManagement/lib/operations/roleAssignments.js index 2688a75fab..733313d390 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-01-01-preview'; + let apiVersion = '2018-09-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-01-01-preview'; + let apiVersion = '2018-09-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-01-01-preview'; + let apiVersion = '2018-09-01-preview'; // Validate try { if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { @@ -503,6 +503,11 @@ 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 * @@ -534,7 +539,7 @@ function _create(scope, roleAssignmentName, parameters, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-01-01-preview'; + let apiVersion = '2018-09-01-preview'; // Validate try { if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { @@ -690,7 +695,7 @@ function _get(scope, roleAssignmentName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-01-01-preview'; + let apiVersion = '2018-09-01-preview'; // Validate try { if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { @@ -827,7 +832,7 @@ function _deleteById(roleId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-01-01-preview'; + let apiVersion = '2018-09-01-preview'; // Validate try { if (roleId === null || roleId === undefined || typeof roleId.valueOf() !== 'string') { @@ -941,6 +946,11 @@ 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 * @@ -972,7 +982,7 @@ function _createById(roleId, parameters, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-01-01-preview'; + let apiVersion = '2018-09-01-preview'; // Validate try { if (roleId === null || roleId === undefined || typeof roleId.valueOf() !== 'string') { @@ -1122,7 +1132,7 @@ function _getById(roleId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-01-01-preview'; + let apiVersion = '2018-09-01-preview'; // Validate try { if (roleId === null || roleId === undefined || typeof roleId.valueOf() !== 'string') { @@ -1260,7 +1270,7 @@ function _list(options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2018-01-01-preview'; + let apiVersion = '2018-09-01-preview'; // Validate try { if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { @@ -1406,7 +1416,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-01-01-preview'; + let apiVersion = '2018-09-01-preview'; // Validate try { if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { @@ -2365,6 +2375,11 @@ 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 * @@ -2416,6 +2431,11 @@ 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 * @@ -2648,6 +2668,11 @@ 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 * @@ -2690,6 +2715,11 @@ 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 *