diff --git a/lib/services/authorizationManagement/lib/authorizationManagementClient.d.ts b/lib/services/authorizationManagement/lib/authorizationManagementClient.d.ts index 991fd91cb5..0f0a39775a 100644 --- a/lib/services/authorizationManagement/lib/authorizationManagementClient.d.ts +++ b/lib/services/authorizationManagement/lib/authorizationManagementClient.d.ts @@ -19,7 +19,7 @@ declare class AuthorizationManagementClient { * * @param {credentials} credentials - Credentials needed for the client to connect to Azure. * - * @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * @param {string} subscriptionId - The ID of the target subscription. * * @param {string} [baseUri] - The base URI of the service. * @@ -32,7 +32,7 @@ declare class AuthorizationManagementClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.apiVersion] - Client Api Version. + * @param {string} [options.apiVersion] - The API version to use for this operation. * * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. * diff --git a/lib/services/authorizationManagement/lib/authorizationManagementClient.js b/lib/services/authorizationManagement/lib/authorizationManagementClient.js index f5457c5d86..5b6c185c89 100644 --- a/lib/services/authorizationManagement/lib/authorizationManagementClient.js +++ b/lib/services/authorizationManagement/lib/authorizationManagementClient.js @@ -29,7 +29,7 @@ var operations = require('./operations'); * * @param {credentials} credentials - Credentials needed for the client to connect to Azure. * - * @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * @param {string} subscriptionId - The ID of the target subscription. * * @param {string} [baseUri] - The base URI of the service. * @@ -42,7 +42,7 @@ var operations = require('./operations'); * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.apiVersion] - Client Api Version. + * @param {string} [options.apiVersion] - The API version to use for this operation. * * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. * diff --git a/lib/services/authorizationManagement/lib/models/classicAdministrator.js b/lib/services/authorizationManagement/lib/models/classicAdministrator.js index 17a97bbf6a..bf31692963 100644 --- a/lib/services/authorizationManagement/lib/models/classicAdministrator.js +++ b/lib/services/authorizationManagement/lib/models/classicAdministrator.js @@ -18,18 +18,18 @@ var models = require('./index'); * @constructor * Classic Administrators * - * @member {string} [id] Gets or sets the classic administrator id. + * @member {string} [id] The ID of the administrator. * - * @member {string} [name] Gets or sets the classic administrator name. + * @member {string} [name] The name of the administrator. * - * @member {string} [type] Gets or sets the classic administrator type. + * @member {string} [type] The type of the administrator. * - * @member {object} [properties] Gets or sets the classic administrator - * properties. + * @member {object} [properties] Properties for the classic administrator. * - * @member {string} [properties.emailAddress] Gets or sets the email address + * @member {string} [properties.emailAddress] The email address of the + * administrator. * - * @member {string} [properties.role] Gets or sets the role + * @member {string} [properties.role] The role of the administrator. * */ function ClassicAdministrator() { diff --git a/lib/services/authorizationManagement/lib/models/classicAdministratorListResult.js b/lib/services/authorizationManagement/lib/models/classicAdministratorListResult.js index 69b93bf1c4..8d2fbcb6cb 100644 --- a/lib/services/authorizationManagement/lib/models/classicAdministratorListResult.js +++ b/lib/services/authorizationManagement/lib/models/classicAdministratorListResult.js @@ -18,8 +18,8 @@ var util = require('util'); * @constructor * ClassicAdministrator list result information. * - * @member {string} [nextLink] Gets or sets the URL to get the next set of - * classic administrators results. + * @member {string} [nextLink] The URL to use for getting the next set of + * results. * */ function ClassicAdministratorListResult() { diff --git a/lib/services/authorizationManagement/lib/models/classicAdministratorProperties.js b/lib/services/authorizationManagement/lib/models/classicAdministratorProperties.js index a0e3b4146b..e71bb6761a 100644 --- a/lib/services/authorizationManagement/lib/models/classicAdministratorProperties.js +++ b/lib/services/authorizationManagement/lib/models/classicAdministratorProperties.js @@ -16,9 +16,9 @@ * @constructor * Classic Administrator properties. * - * @member {string} [emailAddress] Gets or sets the email address + * @member {string} [emailAddress] The email address of the administrator. * - * @member {string} [role] Gets or sets the role + * @member {string} [role] The role of the administrator. * */ function ClassicAdministratorProperties() { diff --git a/lib/services/authorizationManagement/lib/models/index.d.ts b/lib/services/authorizationManagement/lib/models/index.d.ts index fe8752b6ed..7059578294 100644 --- a/lib/services/authorizationManagement/lib/models/index.d.ts +++ b/lib/services/authorizationManagement/lib/models/index.d.ts @@ -8,6 +8,9 @@ * regenerated. */ +import * as msRestAzure from 'ms-rest-azure'; +exports.BaseResource = msRestAzure.BaseResource; +exports.CloudError = msRestAzure.CloudError; /** * @class @@ -42,9 +45,9 @@ export interface RoleDefinitionFilter { * @constructor * Classic Administrator properties. * - * @member {string} [emailAddress] Gets or sets the email address + * @member {string} [emailAddress] The email address of the administrator. * - * @member {string} [role] Gets or sets the role + * @member {string} [role] The role of the administrator. * */ export interface ClassicAdministratorProperties { @@ -58,18 +61,18 @@ export interface ClassicAdministratorProperties { * @constructor * Classic Administrators * - * @member {string} [id] Gets or sets the classic administrator id. + * @member {string} [id] The ID of the administrator. * - * @member {string} [name] Gets or sets the classic administrator name. + * @member {string} [name] The name of the administrator. * - * @member {string} [type] Gets or sets the classic administrator type. + * @member {string} [type] The type of the administrator. * - * @member {object} [properties] Gets or sets the classic administrator - * properties. + * @member {object} [properties] Properties for the classic administrator. * - * @member {string} [properties.emailAddress] Gets or sets the email address + * @member {string} [properties.emailAddress] The email address of the + * administrator. * - * @member {string} [properties.role] Gets or sets the role + * @member {string} [properties.role] The role of the administrator. * */ export interface ClassicAdministrator { @@ -79,15 +82,32 @@ export interface ClassicAdministrator { properties?: ClassicAdministratorProperties; } +/** + * @class + * Initializes a new instance of the ClassicAdministratorListResult class. + * @constructor + * ClassicAdministrator list result information. + * + * @member {array} [value] An array of administrators. + * + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + * + */ +export interface ClassicAdministratorListResult { + value?: ClassicAdministrator[]; + nextLink?: string; +} + /** * @class * Initializes a new instance of the Permission class. * @constructor * Role definition permissions. * - * @member {array} [actions] Role definition allowed actions. + * @member {array} [actions] Allowed actions. * - * @member {array} [notActions] Role definition denied actions. + * @member {array} [notActions] Denied actions. * */ export interface Permission { @@ -95,21 +115,38 @@ export interface Permission { notActions?: string[]; } +/** + * @class + * Initializes a new instance of the PermissionGetResult class. + * @constructor + * Permissions information. + * + * @member {array} [value] An array of permissions. + * + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + * + */ +export interface PermissionGetResult { + value?: Permission[]; + nextLink?: string; +} + /** * @class * Initializes a new instance of the ProviderOperation class. * @constructor * Operation * - * @member {string} [name] Gets or sets the operation name + * @member {string} [name] The operation name. * - * @member {string} [displayName] Gets or sets the operation display name + * @member {string} [displayName] The operation display name. * - * @member {string} [description] Gets or sets the operation description + * @member {string} [description] The operation description. * - * @member {string} [origin] Gets or sets the operation origin + * @member {string} [origin] The operation origin. * - * @member {object} [properties] Gets or sets the operation properties + * @member {object} [properties] The operation properties. * */ export interface ProviderOperation { @@ -126,11 +163,11 @@ export interface ProviderOperation { * @constructor * Resource Type * - * @member {string} [name] Gets or sets the resource type name + * @member {string} [name] The resource type name. * - * @member {string} [displayName] Gets or sets the resource type display name + * @member {string} [displayName] The resource type display name. * - * @member {array} [operations] Gets or sets the resource type operations + * @member {array} [operations] The resource type operations. * */ export interface ResourceType { @@ -145,17 +182,17 @@ export interface ResourceType { * @constructor * Provider Operations metadata * - * @member {string} [id] Gets or sets the provider id. + * @member {string} [id] The provider id. * - * @member {string} [name] Gets or sets the provider name + * @member {string} [name] The provider name. * - * @member {string} [type] Gets or sets the provider type + * @member {string} [type] The provider type. * - * @member {string} [displayName] Gets or sets the provider display name + * @member {string} [displayName] The provider display name. * - * @member {array} [resourceTypes] Gets or sets the provider resource types + * @member {array} [resourceTypes] The provider resource types * - * @member {array} [operations] Gets or sets the provider operations + * @member {array} [operations] The provider operations. * */ export interface ProviderOperationsMetadata { @@ -167,17 +204,34 @@ export interface ProviderOperationsMetadata { operations?: ProviderOperation[]; } +/** + * @class + * Initializes a new instance of the ProviderOperationsMetadataListResult class. + * @constructor + * Provider operations metadata list + * + * @member {array} [value] The list of providers. + * + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + * + */ +export interface ProviderOperationsMetadataListResult { + value?: ProviderOperationsMetadata[]; + nextLink?: string; +} + /** * @class * Initializes a new instance of the RoleAssignmentPropertiesWithScope class. * @constructor * Role assignment properties with scope. * - * @member {string} [scope] Gets or sets role assignment scope. + * @member {string} [scope] The role assignment scope. * - * @member {string} [roleDefinitionId] Gets or sets role definition id. + * @member {string} [roleDefinitionId] The role definition ID. * - * @member {string} [principalId] Gets or sets principal Id. + * @member {string} [principalId] The principal ID. * */ export interface RoleAssignmentPropertiesWithScope { @@ -192,20 +246,19 @@ export interface RoleAssignmentPropertiesWithScope { * @constructor * Role Assignments * - * @member {string} [id] Gets or sets role assignment id. + * @member {string} [id] The role assignment ID. * - * @member {string} [name] Gets or sets role assignment name. + * @member {string} [name] The role assignment name. * - * @member {string} [type] Gets or sets role assignment type. + * @member {string} [type] The role assignment type. * - * @member {object} [properties] Gets or sets role assignment properties. + * @member {object} [properties] Role assignment properties. * - * @member {string} [properties.scope] Gets or sets role assignment scope. + * @member {string} [properties.scope] The role assignment scope. * - * @member {string} [properties.roleDefinitionId] Gets or sets role definition - * id. + * @member {string} [properties.roleDefinitionId] The role definition ID. * - * @member {string} [properties.principalId] Gets or sets principal Id. + * @member {string} [properties.principalId] The principal ID. * */ export interface RoleAssignment { @@ -215,15 +268,35 @@ export interface RoleAssignment { properties?: RoleAssignmentPropertiesWithScope; } +/** + * @class + * Initializes a new instance of the RoleAssignmentListResult class. + * @constructor + * Role assignment list operation result. + * + * @member {array} [value] Role assignment list. + * + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + * + */ +export interface RoleAssignmentListResult { + value?: RoleAssignment[]; + nextLink?: string; +} + /** * @class * Initializes a new instance of the RoleAssignmentProperties class. * @constructor * Role assignment properties. * - * @member {string} [roleDefinitionId] Gets or sets role definition id. + * @member {string} [roleDefinitionId] The role definition ID used in the role + * assignment. * - * @member {string} [principalId] Gets or sets principal Id. + * @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. * */ export interface RoleAssignmentProperties { @@ -237,12 +310,14 @@ export interface RoleAssignmentProperties { * @constructor * Role assignment create parameters. * - * @member {object} [properties] Gets or sets role assignment properties. + * @member {object} [properties] Role assignment properties. * - * @member {string} [properties.roleDefinitionId] Gets or sets role definition - * id. + * @member {string} [properties.roleDefinitionId] The role definition ID used + * in the role assignment. * - * @member {string} [properties.principalId] Gets or sets principal Id. + * @member {string} [properties.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. * */ export interface RoleAssignmentCreateParameters { @@ -255,16 +330,15 @@ export interface RoleAssignmentCreateParameters { * @constructor * Role definition properties. * - * @member {string} [roleName] Gets or sets role name. + * @member {string} [roleName] The role name. * - * @member {string} [description] Gets or sets role definition description. + * @member {string} [description] The role definition description. * - * @member {string} [type] Gets or sets role type. + * @member {string} [type] The role type. * - * @member {array} [permissions] Gets or sets role definition permissions. + * @member {array} [permissions] Role definition permissions. * - * @member {array} [assignableScopes] Gets or sets role definition assignable - * scopes. + * @member {array} [assignableScopes] Role definition assignable scopes. * */ export interface RoleDefinitionProperties { @@ -281,26 +355,24 @@ export interface RoleDefinitionProperties { * @constructor * Role definition. * - * @member {string} [id] Gets or sets role definition id. + * @member {string} [id] The role definition ID. * - * @member {string} [name] Gets or sets role definition name. + * @member {string} [name] The role definition name. * - * @member {string} [type] Gets or sets role definition type. + * @member {string} [type] The role definition type. * - * @member {object} [properties] Gets or sets role definition properties. + * @member {object} [properties] Role definition properties. * - * @member {string} [properties.roleName] Gets or sets role name. + * @member {string} [properties.roleName] The role name. * - * @member {string} [properties.description] Gets or sets role definition - * description. + * @member {string} [properties.description] The role definition description. * - * @member {string} [properties.type] Gets or sets role type. + * @member {string} [properties.type] The role type. * - * @member {array} [properties.permissions] Gets or sets role definition - * permissions. + * @member {array} [properties.permissions] Role definition permissions. * - * @member {array} [properties.assignableScopes] Gets or sets role definition - * assignable scopes. + * @member {array} [properties.assignableScopes] Role definition assignable + * scopes. * */ export interface RoleDefinition { @@ -310,6 +382,23 @@ export interface RoleDefinition { properties?: RoleDefinitionProperties; } +/** + * @class + * Initializes a new instance of the RoleDefinitionListResult class. + * @constructor + * Role definition list operation result. + * + * @member {array} [value] Role definition list. + * + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + * + */ +export interface RoleDefinitionListResult { + value?: RoleDefinition[]; + nextLink?: string; +} + /** * @class @@ -317,8 +406,8 @@ export interface RoleDefinition { * @constructor * ClassicAdministrator list result information. * - * @member {string} [nextLink] Gets or sets the URL to get the next set of - * classic administrators results. + * @member {string} [nextLink] The URL to use for getting the next set of + * results. * */ export interface ClassicAdministratorListResult extends Array { @@ -331,8 +420,8 @@ export interface ClassicAdministratorListResult extends Array { @@ -345,8 +434,8 @@ export interface PermissionGetResult extends Array { * @constructor * Provider operations metadata list * - * @member {string} [nextLink] Gets or sets the URL to get the next set of - * provider operations metadata results. + * @member {string} [nextLink] The URL to use for getting the next set of + * results. * */ export interface ProviderOperationsMetadataListResult extends Array { @@ -359,8 +448,8 @@ export interface ProviderOperationsMetadataListResult extends Array { @@ -373,8 +462,8 @@ export interface RoleAssignmentListResult extends Array { * @constructor * Role definition list operation result. * - * @member {string} [nextLink] Gets or sets the URL to get the next set of - * role definitions results. + * @member {string} [nextLink] The URL to use for getting the next set of + * results. * */ export interface RoleDefinitionListResult extends Array { diff --git a/lib/services/authorizationManagement/lib/models/index.js b/lib/services/authorizationManagement/lib/models/index.js index 8cb590c739..f8b9c13139 100644 --- a/lib/services/authorizationManagement/lib/models/index.js +++ b/lib/services/authorizationManagement/lib/models/index.js @@ -22,18 +22,18 @@ exports.RoleAssignmentFilter = require('./roleAssignmentFilter'); exports.RoleDefinitionFilter = require('./roleDefinitionFilter'); exports.ClassicAdministratorProperties = require('./classicAdministratorProperties'); exports.ClassicAdministrator = require('./classicAdministrator'); +exports.ClassicAdministratorListResult = require('./classicAdministratorListResult'); exports.Permission = require('./permission'); +exports.PermissionGetResult = require('./permissionGetResult'); exports.ProviderOperation = require('./providerOperation'); exports.ResourceType = require('./resourceType'); exports.ProviderOperationsMetadata = require('./providerOperationsMetadata'); +exports.ProviderOperationsMetadataListResult = require('./providerOperationsMetadataListResult'); exports.RoleAssignmentPropertiesWithScope = require('./roleAssignmentPropertiesWithScope'); exports.RoleAssignment = require('./roleAssignment'); +exports.RoleAssignmentListResult = require('./roleAssignmentListResult'); exports.RoleAssignmentProperties = require('./roleAssignmentProperties'); exports.RoleAssignmentCreateParameters = require('./roleAssignmentCreateParameters'); exports.RoleDefinitionProperties = require('./roleDefinitionProperties'); exports.RoleDefinition = require('./roleDefinition'); -exports.ClassicAdministratorListResult = require('./classicAdministratorListResult'); -exports.PermissionGetResult = require('./permissionGetResult'); -exports.ProviderOperationsMetadataListResult = require('./providerOperationsMetadataListResult'); -exports.RoleAssignmentListResult = require('./roleAssignmentListResult'); exports.RoleDefinitionListResult = require('./roleDefinitionListResult'); diff --git a/lib/services/authorizationManagement/lib/models/permission.js b/lib/services/authorizationManagement/lib/models/permission.js index 8f725efd18..3127a5c2c3 100644 --- a/lib/services/authorizationManagement/lib/models/permission.js +++ b/lib/services/authorizationManagement/lib/models/permission.js @@ -18,9 +18,9 @@ var util = require('util'); * @constructor * Role definition permissions. * - * @member {array} [actions] Role definition allowed actions. + * @member {array} [actions] Allowed actions. * - * @member {array} [notActions] Role definition denied actions. + * @member {array} [notActions] Denied actions. * */ function Permission() { diff --git a/lib/services/authorizationManagement/lib/models/permissionGetResult.js b/lib/services/authorizationManagement/lib/models/permissionGetResult.js index de096099b6..c70676eb02 100644 --- a/lib/services/authorizationManagement/lib/models/permissionGetResult.js +++ b/lib/services/authorizationManagement/lib/models/permissionGetResult.js @@ -18,8 +18,8 @@ var util = require('util'); * @constructor * Permissions information. * - * @member {string} [nextLink] Gets or sets the URL to get the next set of - * permissions results. + * @member {string} [nextLink] The URL to use for getting the next set of + * results. * */ function PermissionGetResult() { diff --git a/lib/services/authorizationManagement/lib/models/providerOperation.js b/lib/services/authorizationManagement/lib/models/providerOperation.js index 016eb2abd0..713952526a 100644 --- a/lib/services/authorizationManagement/lib/models/providerOperation.js +++ b/lib/services/authorizationManagement/lib/models/providerOperation.js @@ -16,15 +16,15 @@ * @constructor * Operation * - * @member {string} [name] Gets or sets the operation name + * @member {string} [name] The operation name. * - * @member {string} [displayName] Gets or sets the operation display name + * @member {string} [displayName] The operation display name. * - * @member {string} [description] Gets or sets the operation description + * @member {string} [description] The operation description. * - * @member {string} [origin] Gets or sets the operation origin + * @member {string} [origin] The operation origin. * - * @member {object} [properties] Gets or sets the operation properties + * @member {object} [properties] The operation properties. * */ function ProviderOperation() { diff --git a/lib/services/authorizationManagement/lib/models/providerOperationsMetadata.js b/lib/services/authorizationManagement/lib/models/providerOperationsMetadata.js index 88b32a719b..05a9e9545c 100644 --- a/lib/services/authorizationManagement/lib/models/providerOperationsMetadata.js +++ b/lib/services/authorizationManagement/lib/models/providerOperationsMetadata.js @@ -20,17 +20,17 @@ var util = require('util'); * @constructor * Provider Operations metadata * - * @member {string} [id] Gets or sets the provider id. + * @member {string} [id] The provider id. * - * @member {string} [name] Gets or sets the provider name + * @member {string} [name] The provider name. * - * @member {string} [type] Gets or sets the provider type + * @member {string} [type] The provider type. * - * @member {string} [displayName] Gets or sets the provider display name + * @member {string} [displayName] The provider display name. * - * @member {array} [resourceTypes] Gets or sets the provider resource types + * @member {array} [resourceTypes] The provider resource types * - * @member {array} [operations] Gets or sets the provider operations + * @member {array} [operations] The provider operations. * */ function ProviderOperationsMetadata() { diff --git a/lib/services/authorizationManagement/lib/models/providerOperationsMetadataListResult.js b/lib/services/authorizationManagement/lib/models/providerOperationsMetadataListResult.js index af8e948133..3fd709a181 100644 --- a/lib/services/authorizationManagement/lib/models/providerOperationsMetadataListResult.js +++ b/lib/services/authorizationManagement/lib/models/providerOperationsMetadataListResult.js @@ -18,8 +18,8 @@ var util = require('util'); * @constructor * Provider operations metadata list * - * @member {string} [nextLink] Gets or sets the URL to get the next set of - * provider operations metadata results. + * @member {string} [nextLink] The URL to use for getting the next set of + * results. * */ function ProviderOperationsMetadataListResult() { diff --git a/lib/services/authorizationManagement/lib/models/resourceType.js b/lib/services/authorizationManagement/lib/models/resourceType.js index 8c5a848b8f..fbebe21bb7 100644 --- a/lib/services/authorizationManagement/lib/models/resourceType.js +++ b/lib/services/authorizationManagement/lib/models/resourceType.js @@ -20,11 +20,11 @@ var util = require('util'); * @constructor * Resource Type * - * @member {string} [name] Gets or sets the resource type name + * @member {string} [name] The resource type name. * - * @member {string} [displayName] Gets or sets the resource type display name + * @member {string} [displayName] The resource type display name. * - * @member {array} [operations] Gets or sets the resource type operations + * @member {array} [operations] The resource type operations. * */ function ResourceType() { diff --git a/lib/services/authorizationManagement/lib/models/roleAssignment.js b/lib/services/authorizationManagement/lib/models/roleAssignment.js index 5faacc3d12..b575a5ca8a 100644 --- a/lib/services/authorizationManagement/lib/models/roleAssignment.js +++ b/lib/services/authorizationManagement/lib/models/roleAssignment.js @@ -18,20 +18,19 @@ var models = require('./index'); * @constructor * Role Assignments * - * @member {string} [id] Gets or sets role assignment id. + * @member {string} [id] The role assignment ID. * - * @member {string} [name] Gets or sets role assignment name. + * @member {string} [name] The role assignment name. * - * @member {string} [type] Gets or sets role assignment type. + * @member {string} [type] The role assignment type. * - * @member {object} [properties] Gets or sets role assignment properties. + * @member {object} [properties] Role assignment properties. * - * @member {string} [properties.scope] Gets or sets role assignment scope. + * @member {string} [properties.scope] The role assignment scope. * - * @member {string} [properties.roleDefinitionId] Gets or sets role definition - * id. + * @member {string} [properties.roleDefinitionId] The role definition ID. * - * @member {string} [properties.principalId] Gets or sets principal Id. + * @member {string} [properties.principalId] The principal ID. * */ function RoleAssignment() { diff --git a/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js b/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js index 728c4bbf15..8d1edab272 100644 --- a/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js +++ b/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js @@ -18,12 +18,14 @@ var models = require('./index'); * @constructor * Role assignment create parameters. * - * @member {object} [properties] Gets or sets role assignment properties. + * @member {object} [properties] Role assignment properties. * - * @member {string} [properties.roleDefinitionId] Gets or sets role definition - * id. + * @member {string} [properties.roleDefinitionId] The role definition ID used + * in the role assignment. * - * @member {string} [properties.principalId] Gets or sets principal Id. + * @member {string} [properties.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. * */ function RoleAssignmentCreateParameters() { diff --git a/lib/services/authorizationManagement/lib/models/roleAssignmentListResult.js b/lib/services/authorizationManagement/lib/models/roleAssignmentListResult.js index 3b7a7e7fee..58ef248628 100644 --- a/lib/services/authorizationManagement/lib/models/roleAssignmentListResult.js +++ b/lib/services/authorizationManagement/lib/models/roleAssignmentListResult.js @@ -18,8 +18,8 @@ var util = require('util'); * @constructor * Role assignment list operation result. * - * @member {string} [nextLink] Gets or sets the URL to get the next set of - * role assignment results. + * @member {string} [nextLink] The URL to use for getting the next set of + * results. * */ function RoleAssignmentListResult() { diff --git a/lib/services/authorizationManagement/lib/models/roleAssignmentProperties.js b/lib/services/authorizationManagement/lib/models/roleAssignmentProperties.js index d672a97f9c..c499c34ac7 100644 --- a/lib/services/authorizationManagement/lib/models/roleAssignmentProperties.js +++ b/lib/services/authorizationManagement/lib/models/roleAssignmentProperties.js @@ -16,9 +16,12 @@ * @constructor * Role assignment properties. * - * @member {string} [roleDefinitionId] Gets or sets role definition id. + * @member {string} [roleDefinitionId] The role definition ID used in the role + * assignment. * - * @member {string} [principalId] Gets or sets principal Id. + * @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. * */ function RoleAssignmentProperties() { diff --git a/lib/services/authorizationManagement/lib/models/roleAssignmentPropertiesWithScope.js b/lib/services/authorizationManagement/lib/models/roleAssignmentPropertiesWithScope.js index 2c1a02182b..48210d313e 100644 --- a/lib/services/authorizationManagement/lib/models/roleAssignmentPropertiesWithScope.js +++ b/lib/services/authorizationManagement/lib/models/roleAssignmentPropertiesWithScope.js @@ -16,11 +16,11 @@ * @constructor * Role assignment properties with scope. * - * @member {string} [scope] Gets or sets role assignment scope. + * @member {string} [scope] The role assignment scope. * - * @member {string} [roleDefinitionId] Gets or sets role definition id. + * @member {string} [roleDefinitionId] The role definition ID. * - * @member {string} [principalId] Gets or sets principal Id. + * @member {string} [principalId] The principal ID. * */ function RoleAssignmentPropertiesWithScope() { diff --git a/lib/services/authorizationManagement/lib/models/roleDefinition.js b/lib/services/authorizationManagement/lib/models/roleDefinition.js index ea05b29bc9..9eb42995ad 100644 --- a/lib/services/authorizationManagement/lib/models/roleDefinition.js +++ b/lib/services/authorizationManagement/lib/models/roleDefinition.js @@ -18,26 +18,24 @@ var models = require('./index'); * @constructor * Role definition. * - * @member {string} [id] Gets or sets role definition id. + * @member {string} [id] The role definition ID. * - * @member {string} [name] Gets or sets role definition name. + * @member {string} [name] The role definition name. * - * @member {string} [type] Gets or sets role definition type. + * @member {string} [type] The role definition type. * - * @member {object} [properties] Gets or sets role definition properties. + * @member {object} [properties] Role definition properties. * - * @member {string} [properties.roleName] Gets or sets role name. + * @member {string} [properties.roleName] The role name. * - * @member {string} [properties.description] Gets or sets role definition - * description. + * @member {string} [properties.description] The role definition description. * - * @member {string} [properties.type] Gets or sets role type. + * @member {string} [properties.type] The role type. * - * @member {array} [properties.permissions] Gets or sets role definition - * permissions. + * @member {array} [properties.permissions] Role definition permissions. * - * @member {array} [properties.assignableScopes] Gets or sets role definition - * assignable scopes. + * @member {array} [properties.assignableScopes] Role definition assignable + * scopes. * */ function RoleDefinition() { diff --git a/lib/services/authorizationManagement/lib/models/roleDefinitionListResult.js b/lib/services/authorizationManagement/lib/models/roleDefinitionListResult.js index 9175bd5cc0..8306655c04 100644 --- a/lib/services/authorizationManagement/lib/models/roleDefinitionListResult.js +++ b/lib/services/authorizationManagement/lib/models/roleDefinitionListResult.js @@ -18,8 +18,8 @@ var util = require('util'); * @constructor * Role definition list operation result. * - * @member {string} [nextLink] Gets or sets the URL to get the next set of - * role definitions results. + * @member {string} [nextLink] The URL to use for getting the next set of + * results. * */ function RoleDefinitionListResult() { diff --git a/lib/services/authorizationManagement/lib/models/roleDefinitionProperties.js b/lib/services/authorizationManagement/lib/models/roleDefinitionProperties.js index 41bb01312c..00137a8250 100644 --- a/lib/services/authorizationManagement/lib/models/roleDefinitionProperties.js +++ b/lib/services/authorizationManagement/lib/models/roleDefinitionProperties.js @@ -20,16 +20,15 @@ var util = require('util'); * @constructor * Role definition properties. * - * @member {string} [roleName] Gets or sets role name. + * @member {string} [roleName] The role name. * - * @member {string} [description] Gets or sets role definition description. + * @member {string} [description] The role definition description. * - * @member {string} [type] Gets or sets role type. + * @member {string} [type] The role type. * - * @member {array} [permissions] Gets or sets role definition permissions. + * @member {array} [permissions] Role definition permissions. * - * @member {array} [assignableScopes] Gets or sets role definition assignable - * scopes. + * @member {array} [assignableScopes] Role definition assignable scopes. * */ function RoleDefinitionProperties() { diff --git a/lib/services/authorizationManagement/lib/operations/classicAdministrators.js b/lib/services/authorizationManagement/lib/operations/classicAdministrators.js index c960d8ba06..0450a97b0a 100644 --- a/lib/services/authorizationManagement/lib/operations/classicAdministrators.js +++ b/lib/services/authorizationManagement/lib/operations/classicAdministrators.js @@ -30,9 +30,10 @@ function ClassicAdministrators(client) { } /** - * Gets a list of classic administrators for the subscription. + * Gets service administrator, account administrator, and co-administrators + * for the subscription. * - * @param {string} apiVersion + * @param {string} apiVersion The API version to use for this operation. * * @param {object} [options] Optional Parameters. * @@ -78,12 +79,9 @@ ClassicAdministrators.prototype.list = function (apiVersion, options, callback) } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/providers/Microsoft.Authorization/classicAdministrators'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Authorization/classicAdministrators'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -168,7 +166,8 @@ ClassicAdministrators.prototype.list = function (apiVersion, options, callback) }; /** - * Gets a list of classic administrators for the subscription. + * Gets service administrator, account administrator, and co-administrators + * for the subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -216,9 +215,6 @@ ClassicAdministrators.prototype.listNext = function (nextPageLink, options, call // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); diff --git a/lib/services/authorizationManagement/lib/operations/index.d.ts b/lib/services/authorizationManagement/lib/operations/index.d.ts index 32c3fb98d3..33ee9ad418 100644 --- a/lib/services/authorizationManagement/lib/operations/index.d.ts +++ b/lib/services/authorizationManagement/lib/operations/index.d.ts @@ -21,9 +21,10 @@ import * as models from '../models'; export interface ClassicAdministrators { /** - * Gets a list of classic administrators for the subscription. + * Gets service administrator, account administrator, and co-administrators + * for the subscription. * - * @param {string} apiVersion + * @param {string} apiVersion The API version to use for this operation. * * @param {object} [options] Optional Parameters. * @@ -37,7 +38,8 @@ export interface ClassicAdministrators { list(apiVersion: string, callback: ServiceCallback): void; /** - * Gets a list of classic administrators for the subscription. + * Gets service administrator, account administrator, and co-administrators + * for the subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -63,10 +65,10 @@ export interface ClassicAdministrators { export interface Permissions { /** - * Gets a resource group permissions. + * Gets all permissions the caller has for a resource group. * - * @param {string} resourceGroupName Name of the resource group to get the - * permissions for.The name is case insensitive. + * @param {string} resourceGroupName The name of the resource group to get the + * permissions for. The name is case insensitive. * * @param {object} [options] Optional Parameters. * @@ -80,18 +82,20 @@ export interface Permissions { listForResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; /** - * Gets a resource permissions. + * Gets all permissions the caller has for a resource. * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. + * @param {string} resourceGroupName The name of the resource group containing + * the resource. The name is case insensitive. * - * @param {string} resourceProviderNamespace Resource + * @param {string} resourceProviderNamespace The namespace of the resource + * provider. * - * @param {string} parentResourcePath Resource + * @param {string} parentResourcePath The parent resource identity. * - * @param {string} resourceType Resource + * @param {string} resourceType The resource type of the resource. * - * @param {string} resourceName Resource + * @param {string} resourceName The name of the resource to get the + * permissions for. * * @param {object} [options] Optional Parameters. * @@ -105,7 +109,7 @@ export interface Permissions { listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, callback: ServiceCallback): void; /** - * Gets a resource group permissions. + * Gets all permissions the caller has for a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -122,7 +126,7 @@ export interface Permissions { listForResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; /** - * Gets a resource permissions. + * Gets all permissions the caller has for a resource. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -148,16 +152,16 @@ export interface Permissions { export interface ProviderOperationsMetadataOperations { /** - * Gets provider operations metadata + * Gets provider operations metadata for the specified resource provider. * - * @param {string} resourceProviderNamespace Namespace of the resource + * @param {string} resourceProviderNamespace The namespace of the resource * provider. * - * @param {string} apiVersion + * @param {string} apiVersion The API version to use for the operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] + * @param {string} [options.expand] Specifies whether to expand the values. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -169,13 +173,13 @@ export interface ProviderOperationsMetadataOperations { get(resourceProviderNamespace: string, apiVersion: string, callback: ServiceCallback): void; /** - * Gets provider operations metadata list + * Gets provider operations metadata for all resource providers. * - * @param {string} apiVersion + * @param {string} apiVersion The API version to use for this operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] + * @param {string} [options.expand] Specifies whether to expand the values. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -187,7 +191,7 @@ export interface ProviderOperationsMetadataOperations { list(apiVersion: string, callback: ServiceCallback): void; /** - * Gets provider operations metadata list + * Gets provider operations metadata for all resource providers. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -213,21 +217,26 @@ export interface ProviderOperationsMetadataOperations { export interface RoleAssignments { /** - * Gets role assignments of the resource. + * Gets role assignments for a resource. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceProviderNamespace Resource identity. + * @param {string} resourceProviderNamespace The namespace of the resource + * provider. * - * @param {string} parentResourcePath Resource identity. + * @param {string} parentResourcePath The parent resource identity. * - * @param {string} resourceType Resource identity. + * @param {string} resourceType The resource type of the resource. * - * @param {string} resourceName Resource identity. + * @param {string} resourceName The name of the resource to get role + * assignments for. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all role assignments at or above the scope. + * Use $filter=principalId eq {id} to return all role assignments at, above + * or below the scope for the specified principal. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -239,13 +248,16 @@ export interface RoleAssignments { listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, callback: ServiceCallback): void; /** - * Gets role assignments of the resource group. + * Gets role assignments for a resource group. * - * @param {string} resourceGroupName Resource group name. + * @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. + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all role assignments at or above the scope. + * Use $filter=principalId eq {id} to return all role assignments at, above + * or below the scope for the specified principal. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -257,11 +269,12 @@ export interface RoleAssignments { listForResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; /** - * Delete role assignment. + * Deletes a role assignment. * - * @param {string} scope Scope. + * @param {string} scope The scope of the role assignment to delete. * - * @param {string} roleAssignmentName Role assignment name. + * @param {string} roleAssignmentName The name of the role assignment to + * delete. * * @param {object} [options] Optional Parameters. * @@ -275,21 +288,29 @@ export interface RoleAssignments { deleteMethod(scope: string, roleAssignmentName: string, callback: ServiceCallback): void; /** - * Create role assignment. + * Creates a role assignment. * - * @param {string} scope Scope. + * @param {string} scope The scope of the role assignment to create. The scope + * can be any REST resource instance. For example, use + * '/subscriptions/{subscription-id}/' for a subscription, + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + * for a resource group, and + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. * - * @param {string} roleAssignmentName Role assignment name. + * @param {string} roleAssignmentName The name of the role assignment to + * create. It can be any valid GUID. * * @param {object} [options] Optional Parameters. * - * @param {object} [options.properties] Gets or sets role assignment - * properties. + * @param {object} [options.properties] Role assignment properties. * - * @param {string} [options.properties.roleDefinitionId] Gets or sets role - * definition id. + * @param {string} [options.properties.roleDefinitionId] The role definition + * ID used in the role assignment. * - * @param {string} [options.properties.principalId] Gets or sets principal Id. + * @param {string} [options.properties.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. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -301,11 +322,11 @@ export interface RoleAssignments { create(scope: string, roleAssignmentName: string, callback: ServiceCallback): void; /** - * Get single role assignment. + * Get the specified role assignment. * - * @param {string} scope Scope. + * @param {string} scope The scope of the role assignment. * - * @param {string} roleAssignmentName Role assignment name. + * @param {string} roleAssignmentName The name of the role assignment to get. * * @param {object} [options] Optional Parameters. * @@ -319,9 +340,9 @@ export interface RoleAssignments { get(scope: string, roleAssignmentName: string, callback: ServiceCallback): void; /** - * Delete role assignment. + * Deletes a role assignment. * - * @param {string} roleAssignmentId Role assignment Id + * @param {string} roleAssignmentId The ID of the role assignment to delete. * * @param {object} [options] Optional Parameters. * @@ -335,19 +356,20 @@ export interface RoleAssignments { deleteById(roleAssignmentId: string, callback: ServiceCallback): void; /** - * Create role assignment by Id. + * Creates a role assignment by ID. * - * @param {string} roleAssignmentId Role assignment Id + * @param {string} roleAssignmentId The ID of the role assignment to create. * * @param {object} [options] Optional Parameters. * - * @param {object} [options.properties] Gets or sets role assignment - * properties. + * @param {object} [options.properties] Role assignment properties. * - * @param {string} [options.properties.roleDefinitionId] Gets or sets role - * definition id. + * @param {string} [options.properties.roleDefinitionId] The role definition + * ID used in the role assignment. * - * @param {string} [options.properties.principalId] Gets or sets principal Id. + * @param {string} [options.properties.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. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -359,9 +381,9 @@ export interface RoleAssignments { createById(roleAssignmentId: string, callback: ServiceCallback): void; /** - * Get single role assignment. + * Gets a role assignment by ID. * - * @param {string} roleAssignmentId Role assignment Id + * @param {string} roleAssignmentId The ID of the role assignment to get. * * @param {object} [options] Optional Parameters. * @@ -375,11 +397,14 @@ export interface RoleAssignments { getById(roleAssignmentId: string, callback: ServiceCallback): void; /** - * Gets role assignments of the subscription. + * Gets all role assignments for the subscription. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all role assignments at or above the scope. + * Use $filter=principalId eq {id} to return all role assignments at, above + * or below the scope for the specified principal. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -391,13 +416,16 @@ export interface RoleAssignments { list(callback: ServiceCallback): void; /** - * Gets role assignments of the scope. + * Gets role assignments for a scope. * - * @param {string} scope Scope. + * @param {string} scope The scope of the role assignments. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all role assignments at or above the scope. + * Use $filter=principalId eq {id} to return all role assignments at, above + * or below the scope for the specified principal. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -409,7 +437,7 @@ export interface RoleAssignments { listForScope(scope: string, callback: ServiceCallback): void; /** - * Gets role assignments of the resource. + * Gets role assignments for a resource. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -426,7 +454,7 @@ export interface RoleAssignments { listForResourceNext(nextPageLink: string, callback: ServiceCallback): void; /** - * Gets role assignments of the resource group. + * Gets role assignments for a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -443,7 +471,7 @@ export interface RoleAssignments { listForResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; /** - * Gets role assignments of the subscription. + * Gets all role assignments for the subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -460,7 +488,7 @@ export interface RoleAssignments { listNext(nextPageLink: string, callback: ServiceCallback): void; /** - * Gets role assignments of the scope. + * Gets role assignments for a scope. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -486,11 +514,11 @@ export interface RoleAssignments { export interface RoleDefinitions { /** - * Deletes the role definition. + * Deletes a role definition. * - * @param {string} scope Scope + * @param {string} scope The scope of the role definition. * - * @param {string} roleDefinitionId Role definition id. + * @param {string} roleDefinitionId The ID of the role definition to delete. * * @param {object} [options] Optional Parameters. * @@ -506,9 +534,9 @@ export interface RoleDefinitions { /** * Get role definition by name (GUID). * - * @param {string} scope Scope + * @param {string} scope The scope of the role definition. * - * @param {string} roleDefinitionId Role definition Id + * @param {string} roleDefinitionId The ID of the role definition. * * @param {object} [options] Optional Parameters. * @@ -524,33 +552,32 @@ export interface RoleDefinitions { /** * Creates or updates a role definition. * - * @param {string} scope Scope + * @param {string} scope The scope of the role definition. * - * @param {string} roleDefinitionId Role definition id. + * @param {string} roleDefinitionId The ID of the role definition. * - * @param {object} roleDefinition Role definition. + * @param {object} roleDefinition The values for the role definition. * - * @param {string} [roleDefinition.id] Gets or sets role definition id. + * @param {string} [roleDefinition.id] The role definition ID. * - * @param {string} [roleDefinition.name] Gets or sets role definition name. + * @param {string} [roleDefinition.name] The role definition name. * - * @param {string} [roleDefinition.type] Gets or sets role definition type. + * @param {string} [roleDefinition.type] The role definition type. * - * @param {object} [roleDefinition.properties] Gets or sets role definition - * properties. + * @param {object} [roleDefinition.properties] Role definition properties. * - * @param {string} [roleDefinition.properties.roleName] Gets or sets role name. + * @param {string} [roleDefinition.properties.roleName] The role name. * - * @param {string} [roleDefinition.properties.description] Gets or sets role - * definition description. + * @param {string} [roleDefinition.properties.description] The role definition + * description. * - * @param {string} [roleDefinition.properties.type] Gets or sets role type. + * @param {string} [roleDefinition.properties.type] The role type. * - * @param {array} [roleDefinition.properties.permissions] Gets or sets role - * definition permissions. + * @param {array} [roleDefinition.properties.permissions] Role definition + * permissions. * - * @param {array} [roleDefinition.properties.assignableScopes] Gets or sets - * role definition assignable scopes. + * @param {array} [roleDefinition.properties.assignableScopes] Role definition + * assignable scopes. * * @param {object} [options] Optional Parameters. * @@ -564,9 +591,10 @@ export interface RoleDefinitions { createOrUpdate(scope: string, roleDefinitionId: string, roleDefinition: models.RoleDefinition, callback: ServiceCallback): void; /** - * Get role definition by name (GUID). + * Gets a role definition by ID. * - * @param {string} roleDefinitionId Fully qualified role definition Id + * @param {string} roleDefinitionId The fully qualified role definition ID to + * get. * * @param {object} [options] Optional Parameters. * @@ -580,14 +608,14 @@ export interface RoleDefinitions { getById(roleDefinitionId: string, callback: ServiceCallback): void; /** - * Get all role definitions that are applicable at scope and above. Use - * atScopeAndBelow filter to search below the given scope as well + * Get all role definitions that are applicable at scope and above. * - * @param {string} scope Scope + * @param {string} scope The scope of the role definition. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Use + * atScopeAndBelow filter to search below the given scope as well. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -599,8 +627,7 @@ export interface RoleDefinitions { list(scope: string, callback: ServiceCallback): void; /** - * Get all role definitions that are applicable at scope and above. Use - * atScopeAndBelow filter to search below the given scope as well + * Get all role definitions that are applicable at scope and above. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. diff --git a/lib/services/authorizationManagement/lib/operations/permissions.js b/lib/services/authorizationManagement/lib/operations/permissions.js index 6a32ed74bf..1b9348cfc7 100644 --- a/lib/services/authorizationManagement/lib/operations/permissions.js +++ b/lib/services/authorizationManagement/lib/operations/permissions.js @@ -30,10 +30,10 @@ function Permissions(client) { } /** - * Gets a resource group permissions. + * Gets all permissions the caller has for a resource group. * - * @param {string} resourceGroupName Name of the resource group to get the - * permissions for.The name is case insensitive. + * @param {string} resourceGroupName The name of the resource group to get the + * permissions for. The name is case insensitive. * * @param {object} [options] Optional Parameters. * @@ -81,13 +81,10 @@ Permissions.prototype.listForResourceGroup = function (resourceGroupName, option } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Authorization/permissions'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Authorization/permissions'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -172,18 +169,20 @@ Permissions.prototype.listForResourceGroup = function (resourceGroupName, option }; /** - * Gets a resource permissions. + * Gets all permissions the caller has for a resource. * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. + * @param {string} resourceGroupName The name of the resource group containing + * the resource. The name is case insensitive. * - * @param {string} resourceProviderNamespace Resource + * @param {string} resourceProviderNamespace The namespace of the resource + * provider. * - * @param {string} parentResourcePath Resource + * @param {string} parentResourcePath The parent resource identity. * - * @param {string} resourceType Resource + * @param {string} resourceType The resource type of the resource. * - * @param {string} resourceName Resource + * @param {string} resourceName The name of the resource to get the + * permissions for. * * @param {object} [options] Optional Parameters. * @@ -243,17 +242,14 @@ Permissions.prototype.listForResource = function (resourceGroupName, resourcePro } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/permissions'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/permissions'; 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)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -338,7 +334,7 @@ Permissions.prototype.listForResource = function (resourceGroupName, resourcePro }; /** - * Gets a resource group permissions. + * Gets all permissions the caller has for a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -385,9 +381,6 @@ Permissions.prototype.listForResourceGroupNext = function (nextPageLink, options // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -467,7 +460,7 @@ Permissions.prototype.listForResourceGroupNext = function (nextPageLink, options }; /** - * Gets a resource permissions. + * Gets all permissions the caller has for a resource. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -514,9 +507,6 @@ Permissions.prototype.listForResourceNext = function (nextPageLink, options, cal // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); diff --git a/lib/services/authorizationManagement/lib/operations/providerOperationsMetadataOperations.js b/lib/services/authorizationManagement/lib/operations/providerOperationsMetadataOperations.js index 2da390bb73..e23a81ab8e 100644 --- a/lib/services/authorizationManagement/lib/operations/providerOperationsMetadataOperations.js +++ b/lib/services/authorizationManagement/lib/operations/providerOperationsMetadataOperations.js @@ -30,16 +30,16 @@ function ProviderOperationsMetadataOperations(client) { } /** - * Gets provider operations metadata + * Gets provider operations metadata for the specified resource provider. * - * @param {string} resourceProviderNamespace Namespace of the resource + * @param {string} resourceProviderNamespace The namespace of the resource * provider. * - * @param {string} apiVersion + * @param {string} apiVersion The API version to use for the operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] + * @param {string} [options.expand] Specifies whether to expand the values. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -87,12 +87,9 @@ ProviderOperationsMetadataOperations.prototype.get = function (resourceProviderN } // Construct URL - var requestUrl = this.client.baseUri + - '//providers/Microsoft.Authorization/providerOperations/{resourceProviderNamespace}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Authorization/providerOperations/{resourceProviderNamespace}'; requestUrl = requestUrl.replace('{resourceProviderNamespace}', encodeURIComponent(resourceProviderNamespace)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (expand !== null && expand !== undefined) { @@ -180,13 +177,13 @@ ProviderOperationsMetadataOperations.prototype.get = function (resourceProviderN }; /** - * Gets provider operations metadata list + * Gets provider operations metadata for all resource providers. * - * @param {string} apiVersion + * @param {string} apiVersion The API version to use for this operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] + * @param {string} [options.expand] Specifies whether to expand the values. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -231,11 +228,8 @@ ProviderOperationsMetadataOperations.prototype.list = function (apiVersion, opti } // Construct URL - var requestUrl = this.client.baseUri + - '//providers/Microsoft.Authorization/providerOperations'; - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Authorization/providerOperations'; var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (expand !== null && expand !== undefined) { @@ -323,7 +317,7 @@ ProviderOperationsMetadataOperations.prototype.list = function (apiVersion, opti }; /** - * Gets provider operations metadata list + * Gets provider operations metadata for all resource providers. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -371,9 +365,6 @@ ProviderOperationsMetadataOperations.prototype.listNext = function (nextPageLink // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); diff --git a/lib/services/authorizationManagement/lib/operations/roleAssignments.js b/lib/services/authorizationManagement/lib/operations/roleAssignments.js index 99d6ee2719..6bdd950aa1 100644 --- a/lib/services/authorizationManagement/lib/operations/roleAssignments.js +++ b/lib/services/authorizationManagement/lib/operations/roleAssignments.js @@ -30,21 +30,26 @@ function RoleAssignments(client) { } /** - * Gets role assignments of the resource. + * Gets role assignments for a resource. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceProviderNamespace Resource identity. + * @param {string} resourceProviderNamespace The namespace of the resource + * provider. * - * @param {string} parentResourcePath Resource identity. + * @param {string} parentResourcePath The parent resource identity. * - * @param {string} resourceType Resource identity. + * @param {string} resourceType The resource type of the resource. * - * @param {string} resourceName Resource identity. + * @param {string} resourceName The name of the resource to get role + * assignments for. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all role assignments at or above the scope. + * Use $filter=principalId eq {id} to return all role assignments at, above + * or below the scope for the specified principal. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -107,17 +112,14 @@ RoleAssignments.prototype.listForResource = function (resourceGroupName, resourc } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}providers/Microsoft.Authorization/roleAssignments'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}providers/Microsoft.Authorization/roleAssignments'; 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)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); @@ -205,13 +207,16 @@ RoleAssignments.prototype.listForResource = function (resourceGroupName, resourc }; /** - * Gets role assignments of the resource group. + * Gets role assignments for a resource group. * - * @param {string} resourceGroupName Resource group name. + * @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. + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all role assignments at or above the scope. + * Use $filter=principalId eq {id} to return all role assignments at, above + * or below the scope for the specified principal. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -262,13 +267,10 @@ RoleAssignments.prototype.listForResourceGroup = function (resourceGroupName, op } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/roleAssignments'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/roleAssignments'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); @@ -356,11 +358,12 @@ RoleAssignments.prototype.listForResourceGroup = function (resourceGroupName, op }; /** - * Delete role assignment. + * Deletes a role assignment. * - * @param {string} scope Scope. + * @param {string} scope The scope of the role assignment to delete. * - * @param {string} roleAssignmentName Role assignment name. + * @param {string} roleAssignmentName The name of the role assignment to + * delete. * * @param {object} [options] Optional Parameters. * @@ -408,13 +411,10 @@ RoleAssignments.prototype.deleteMethod = function (scope, roleAssignmentName, op } // Construct URL - var requestUrl = this.client.baseUri + - '//{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}'; requestUrl = requestUrl.replace('{scope}', scope); requestUrl = requestUrl.replace('{roleAssignmentName}', encodeURIComponent(roleAssignmentName)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -499,21 +499,29 @@ RoleAssignments.prototype.deleteMethod = function (scope, roleAssignmentName, op }; /** - * Create role assignment. - * - * @param {string} scope Scope. + * Creates a role assignment. + * + * @param {string} scope The scope of the role assignment to create. The scope + * can be any REST resource instance. For example, use + * '/subscriptions/{subscription-id}/' for a subscription, + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + * for a resource group, and + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. * - * @param {string} roleAssignmentName Role assignment name. + * @param {string} roleAssignmentName The name of the role assignment to + * create. It can be any valid GUID. * * @param {object} [options] Optional Parameters. * - * @param {object} [options.properties] Gets or sets role assignment - * properties. + * @param {object} [options.properties] Role assignment properties. * - * @param {string} [options.properties.roleDefinitionId] Gets or sets role - * definition id. + * @param {string} [options.properties.roleDefinitionId] The role definition + * ID used in the role assignment. * - * @param {string} [options.properties.principalId] Gets or sets principal Id. + * @param {string} [options.properties.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. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -565,13 +573,10 @@ RoleAssignments.prototype.create = function (scope, roleAssignmentName, options, } // Construct URL - var requestUrl = this.client.baseUri + - '//{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}'; requestUrl = requestUrl.replace('{scope}', scope); requestUrl = requestUrl.replace('{roleAssignmentName}', encodeURIComponent(roleAssignmentName)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -670,11 +675,11 @@ RoleAssignments.prototype.create = function (scope, roleAssignmentName, options, }; /** - * Get single role assignment. + * Get the specified role assignment. * - * @param {string} scope Scope. + * @param {string} scope The scope of the role assignment. * - * @param {string} roleAssignmentName Role assignment name. + * @param {string} roleAssignmentName The name of the role assignment to get. * * @param {object} [options] Optional Parameters. * @@ -722,13 +727,10 @@ RoleAssignments.prototype.get = function (scope, roleAssignmentName, options, ca } // Construct URL - var requestUrl = this.client.baseUri + - '//{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}'; requestUrl = requestUrl.replace('{scope}', scope); requestUrl = requestUrl.replace('{roleAssignmentName}', encodeURIComponent(roleAssignmentName)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -813,9 +815,9 @@ RoleAssignments.prototype.get = function (scope, roleAssignmentName, options, ca }; /** - * Delete role assignment. + * Deletes a role assignment. * - * @param {string} roleAssignmentId Role assignment Id + * @param {string} roleAssignmentId The ID of the role assignment to delete. * * @param {object} [options] Optional Parameters. * @@ -860,12 +862,9 @@ RoleAssignments.prototype.deleteById = function (roleAssignmentId, options, call } // Construct URL - var requestUrl = this.client.baseUri + - '//{roleAssignmentId}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{roleAssignmentId}'; requestUrl = requestUrl.replace('{roleAssignmentId}', roleAssignmentId); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -950,19 +949,20 @@ RoleAssignments.prototype.deleteById = function (roleAssignmentId, options, call }; /** - * Create role assignment by Id. + * Creates a role assignment by ID. * - * @param {string} roleAssignmentId Role assignment Id + * @param {string} roleAssignmentId The ID of the role assignment to create. * * @param {object} [options] Optional Parameters. * - * @param {object} [options.properties] Gets or sets role assignment - * properties. + * @param {object} [options.properties] Role assignment properties. * - * @param {string} [options.properties.roleDefinitionId] Gets or sets role - * definition id. + * @param {string} [options.properties.roleDefinitionId] The role definition + * ID used in the role assignment. * - * @param {string} [options.properties.principalId] Gets or sets principal Id. + * @param {string} [options.properties.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. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1011,12 +1011,9 @@ RoleAssignments.prototype.createById = function (roleAssignmentId, options, call } // Construct URL - var requestUrl = this.client.baseUri + - '//{roleAssignmentId}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{roleAssignmentId}'; requestUrl = requestUrl.replace('{roleAssignmentId}', roleAssignmentId); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -1115,9 +1112,9 @@ RoleAssignments.prototype.createById = function (roleAssignmentId, options, call }; /** - * Get single role assignment. + * Gets a role assignment by ID. * - * @param {string} roleAssignmentId Role assignment Id + * @param {string} roleAssignmentId The ID of the role assignment to get. * * @param {object} [options] Optional Parameters. * @@ -1162,12 +1159,9 @@ RoleAssignments.prototype.getById = function (roleAssignmentId, options, callbac } // Construct URL - var requestUrl = this.client.baseUri + - '//{roleAssignmentId}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{roleAssignmentId}'; requestUrl = requestUrl.replace('{roleAssignmentId}', roleAssignmentId); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -1252,11 +1246,14 @@ RoleAssignments.prototype.getById = function (roleAssignmentId, options, callbac }; /** - * Gets role assignments of the subscription. + * Gets all role assignments for the subscription. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all role assignments at or above the scope. + * Use $filter=principalId eq {id} to return all role assignments at, above + * or below the scope for the specified principal. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1304,12 +1301,9 @@ RoleAssignments.prototype.list = function (options, callback) { } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/providers/Microsoft.Authorization/roleAssignments'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Authorization/roleAssignments'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); @@ -1397,13 +1391,16 @@ RoleAssignments.prototype.list = function (options, callback) { }; /** - * Gets role assignments of the scope. + * Gets role assignments for a scope. * - * @param {string} scope Scope. + * @param {string} scope The scope of the role assignments. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all role assignments at or above the scope. + * Use $filter=principalId eq {id} to return all role assignments at, above + * or below the scope for the specified principal. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1451,12 +1448,9 @@ RoleAssignments.prototype.listForScope = function (scope, options, callback) { } // Construct URL - var requestUrl = this.client.baseUri + - '//{scope}/providers/Microsoft.Authorization/roleAssignments'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{scope}/providers/Microsoft.Authorization/roleAssignments'; requestUrl = requestUrl.replace('{scope}', scope); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); @@ -1544,7 +1538,7 @@ RoleAssignments.prototype.listForScope = function (scope, options, callback) { }; /** - * Gets role assignments of the resource. + * Gets role assignments for a resource. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1592,9 +1586,6 @@ RoleAssignments.prototype.listForResourceNext = function (nextPageLink, options, // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -1674,7 +1665,7 @@ RoleAssignments.prototype.listForResourceNext = function (nextPageLink, options, }; /** - * Gets role assignments of the resource group. + * Gets role assignments for a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1722,9 +1713,6 @@ RoleAssignments.prototype.listForResourceGroupNext = function (nextPageLink, opt // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -1804,7 +1792,7 @@ RoleAssignments.prototype.listForResourceGroupNext = function (nextPageLink, opt }; /** - * Gets role assignments of the subscription. + * Gets all role assignments for the subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1852,9 +1840,6 @@ RoleAssignments.prototype.listNext = function (nextPageLink, options, callback) // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -1934,7 +1919,7 @@ RoleAssignments.prototype.listNext = function (nextPageLink, options, callback) }; /** - * Gets role assignments of the scope. + * Gets role assignments for a scope. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1982,9 +1967,6 @@ RoleAssignments.prototype.listForScopeNext = function (nextPageLink, options, ca // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); diff --git a/lib/services/authorizationManagement/lib/operations/roleDefinitions.js b/lib/services/authorizationManagement/lib/operations/roleDefinitions.js index 76072648c7..56de7dc8a3 100644 --- a/lib/services/authorizationManagement/lib/operations/roleDefinitions.js +++ b/lib/services/authorizationManagement/lib/operations/roleDefinitions.js @@ -30,11 +30,11 @@ function RoleDefinitions(client) { } /** - * Deletes the role definition. + * Deletes a role definition. * - * @param {string} scope Scope + * @param {string} scope The scope of the role definition. * - * @param {string} roleDefinitionId Role definition id. + * @param {string} roleDefinitionId The ID of the role definition to delete. * * @param {object} [options] Optional Parameters. * @@ -82,13 +82,10 @@ RoleDefinitions.prototype.deleteMethod = function (scope, roleDefinitionId, opti } // Construct URL - var requestUrl = this.client.baseUri + - '//{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}'; requestUrl = requestUrl.replace('{scope}', scope); requestUrl = requestUrl.replace('{roleDefinitionId}', encodeURIComponent(roleDefinitionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -175,9 +172,9 @@ RoleDefinitions.prototype.deleteMethod = function (scope, roleDefinitionId, opti /** * Get role definition by name (GUID). * - * @param {string} scope Scope + * @param {string} scope The scope of the role definition. * - * @param {string} roleDefinitionId Role definition Id + * @param {string} roleDefinitionId The ID of the role definition. * * @param {object} [options] Optional Parameters. * @@ -225,13 +222,10 @@ RoleDefinitions.prototype.get = function (scope, roleDefinitionId, options, call } // Construct URL - var requestUrl = this.client.baseUri + - '//{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}'; requestUrl = requestUrl.replace('{scope}', scope); requestUrl = requestUrl.replace('{roleDefinitionId}', encodeURIComponent(roleDefinitionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -318,33 +312,32 @@ RoleDefinitions.prototype.get = function (scope, roleDefinitionId, options, call /** * Creates or updates a role definition. * - * @param {string} scope Scope + * @param {string} scope The scope of the role definition. * - * @param {string} roleDefinitionId Role definition id. + * @param {string} roleDefinitionId The ID of the role definition. * - * @param {object} roleDefinition Role definition. + * @param {object} roleDefinition The values for the role definition. * - * @param {string} [roleDefinition.id] Gets or sets role definition id. + * @param {string} [roleDefinition.id] The role definition ID. * - * @param {string} [roleDefinition.name] Gets or sets role definition name. + * @param {string} [roleDefinition.name] The role definition name. * - * @param {string} [roleDefinition.type] Gets or sets role definition type. + * @param {string} [roleDefinition.type] The role definition type. * - * @param {object} [roleDefinition.properties] Gets or sets role definition - * properties. + * @param {object} [roleDefinition.properties] Role definition properties. * - * @param {string} [roleDefinition.properties.roleName] Gets or sets role name. + * @param {string} [roleDefinition.properties.roleName] The role name. * - * @param {string} [roleDefinition.properties.description] Gets or sets role - * definition description. + * @param {string} [roleDefinition.properties.description] The role definition + * description. * - * @param {string} [roleDefinition.properties.type] Gets or sets role type. + * @param {string} [roleDefinition.properties.type] The role type. * - * @param {array} [roleDefinition.properties.permissions] Gets or sets role - * definition permissions. + * @param {array} [roleDefinition.properties.permissions] Role definition + * permissions. * - * @param {array} [roleDefinition.properties.assignableScopes] Gets or sets - * role definition assignable scopes. + * @param {array} [roleDefinition.properties.assignableScopes] Role definition + * assignable scopes. * * @param {object} [options] Optional Parameters. * @@ -395,13 +388,10 @@ RoleDefinitions.prototype.createOrUpdate = function (scope, roleDefinitionId, ro } // Construct URL - var requestUrl = this.client.baseUri + - '//{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}'; requestUrl = requestUrl.replace('{scope}', scope); requestUrl = requestUrl.replace('{roleDefinitionId}', encodeURIComponent(roleDefinitionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -500,9 +490,10 @@ RoleDefinitions.prototype.createOrUpdate = function (scope, roleDefinitionId, ro }; /** - * Get role definition by name (GUID). + * Gets a role definition by ID. * - * @param {string} roleDefinitionId Fully qualified role definition Id + * @param {string} roleDefinitionId The fully qualified role definition ID to + * get. * * @param {object} [options] Optional Parameters. * @@ -547,12 +538,9 @@ RoleDefinitions.prototype.getById = function (roleDefinitionId, options, callbac } // Construct URL - var requestUrl = this.client.baseUri + - '//{roleDefinitionId}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{roleDefinitionId}'; requestUrl = requestUrl.replace('{roleDefinitionId}', roleDefinitionId); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -637,14 +625,14 @@ RoleDefinitions.prototype.getById = function (roleDefinitionId, options, callbac }; /** - * Get all role definitions that are applicable at scope and above. Use - * atScopeAndBelow filter to search below the given scope as well + * Get all role definitions that are applicable at scope and above. * - * @param {string} scope Scope + * @param {string} scope The scope of the role definition. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Use + * atScopeAndBelow filter to search below the given scope as well. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -692,12 +680,9 @@ RoleDefinitions.prototype.list = function (scope, options, callback) { } // Construct URL - var requestUrl = this.client.baseUri + - '//{scope}/providers/Microsoft.Authorization/roleDefinitions'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{scope}/providers/Microsoft.Authorization/roleDefinitions'; requestUrl = requestUrl.replace('{scope}', scope); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); @@ -785,8 +770,7 @@ RoleDefinitions.prototype.list = function (scope, options, callback) { }; /** - * Get all role definitions that are applicable at scope and above. Use - * atScopeAndBelow filter to search below the given scope as well + * Get all role definitions that are applicable at scope and above. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -834,9 +818,6 @@ RoleDefinitions.prototype.listNext = function (nextPageLink, options, callback) // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource();