diff --git a/sdk/authorization/arm-authorization/LICENSE.txt b/sdk/authorization/arm-authorization/LICENSE.txt index b73b4a1293c3..2d3163745319 100644 --- a/sdk/authorization/arm-authorization/LICENSE.txt +++ b/sdk/authorization/arm-authorization/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 Microsoft +Copyright (c) 2021 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/authorization/arm-authorization/README.md b/sdk/authorization/arm-authorization/README.md index 97a2b1e7248b..82b3524df53c 100644 --- a/sdk/authorization/arm-authorization/README.md +++ b/sdk/authorization/arm-authorization/README.md @@ -1,11 +1,11 @@ ## Azure AuthorizationManagementClient SDK for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AuthorizationManagementClient. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for AuthorizationManagementClient. ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites @@ -21,7 +21,6 @@ Install both packages using the below command: ```bash npm install --save @azure/arm-authorization @azure/identity ``` - > **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. @@ -37,8 +36,7 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/ In the below samples, we pass the credential and the Azure subscription id to instantiate the client. Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. - -#### nodejs - Authentication, client creation, and list classicAdministrators as an example written in JavaScript. +#### nodejs - Authentication, client creation, and listForResource roleAssignments as an example written in JavaScript. ##### Sample code @@ -51,8 +49,14 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; // Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. const creds = new DefaultAzureCredential(); const client = new AuthorizationManagementClient(creds, subscriptionId); - -client.classicAdministrators.list().then((result) => { +const resourceGroupName = "testresourceGroupName"; +const resourceProviderNamespace = "testresourceProviderNamespace"; +const parentResourcePath = "testparentResourcePath"; +const resourceType = "testresourceType"; +const resourceName = "testresourceName"; +const filter = "testfilter"; +const tenantId = "testtenantId"; +client.roleAssignments.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter, tenantId).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { @@ -61,7 +65,7 @@ client.classicAdministrators.list().then((result) => { }); ``` -#### browser - Authentication, client creation, and list classicAdministrators as an example written in JavaScript. +#### browser - Authentication, client creation, and listForResource roleAssignments as an example written in JavaScript. In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. @@ -86,10 +90,17 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t const credential = new InteractiveBrowserCredential( { clientId: "", - tenantId: "" + tenant: "" }); const client = new Azure.ArmAuthorization.AuthorizationManagementClient(creds, subscriptionId); - client.classicAdministrators.list().then((result) => { + const resourceGroupName = "testresourceGroupName"; + const resourceProviderNamespace = "testresourceProviderNamespace"; + const parentResourcePath = "testparentResourcePath"; + const resourceType = "testresourceType"; + const resourceName = "testresourceName"; + const filter = "testfilter"; + const tenantId = "testtenantId"; + client.roleAssignments.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter, tenantId).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { diff --git a/sdk/authorization/arm-authorization/package.json b/sdk/authorization/arm-authorization/package.json index 88d8e11426ec..f2855edc47f0 100644 --- a/sdk/authorization/arm-authorization/package.json +++ b/sdk/authorization/arm-authorization/package.json @@ -7,7 +7,7 @@ "@azure/ms-rest-azure-js": "^2.1.0", "@azure/ms-rest-js": "^2.2.0", "@azure/core-auth": "^1.1.4", - "tslib": "^1.9.3" + "tslib": "^1.10.0" }, "keywords": [ "node", @@ -22,10 +22,10 @@ "types": "./esm/authorizationManagementClient.d.ts", "devDependencies": { "typescript": "^3.6.0", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.4.9" + "uglify-js": "^3.6.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/authorization/arm-authorization", "repository": { diff --git a/sdk/authorization/arm-authorization/rollup.config.js b/sdk/authorization/arm-authorization/rollup.config.js index 72dc3f8ec5c7..f7a42353330a 100644 --- a/sdk/authorization/arm-authorization/rollup.config.js +++ b/sdk/authorization/arm-authorization/rollup.config.js @@ -21,15 +21,15 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, plugins: [ - nodeResolve({ module: true }), + nodeResolve({ mainFields: ['module', 'main'] }), sourcemaps() ] }; diff --git a/sdk/authorization/arm-authorization/src/authorizationManagementClient.ts b/sdk/authorization/arm-authorization/src/authorizationManagementClient.ts index b970948c40cb..a1107352fa2b 100644 --- a/sdk/authorization/arm-authorization/src/authorizationManagementClient.ts +++ b/sdk/authorization/arm-authorization/src/authorizationManagementClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -18,13 +17,7 @@ import { AuthorizationManagementClientContext } from "./authorizationManagementC class AuthorizationManagementClient extends AuthorizationManagementClientContext { // Operation groups - classicAdministrators: operations.ClassicAdministrators; - globalAdministrator: operations.GlobalAdministrator; - providerOperationsMetadata: operations.ProviderOperationsMetadataOperations; roleAssignments: operations.RoleAssignments; - permissions: operations.Permissions; - roleDefinitions: operations.RoleDefinitions; - denyAssignments: operations.DenyAssignments; /** * Initializes a new instance of the AuthorizationManagementClient class. @@ -39,13 +32,7 @@ class AuthorizationManagementClient extends AuthorizationManagementClientContext */ constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.AuthorizationManagementClientOptions) { super(credentials, subscriptionId, options); - this.classicAdministrators = new operations.ClassicAdministrators(this); - this.globalAdministrator = new operations.GlobalAdministrator(this); - this.providerOperationsMetadata = new operations.ProviderOperationsMetadataOperations(this); this.roleAssignments = new operations.RoleAssignments(this); - this.permissions = new operations.Permissions(this); - this.roleDefinitions = new operations.RoleDefinitions(this); - this.denyAssignments = new operations.DenyAssignments(this); } } diff --git a/sdk/authorization/arm-authorization/src/authorizationManagementClientContext.ts b/sdk/authorization/arm-authorization/src/authorizationManagementClientContext.ts index d81273824f92..f55508d7a9a8 100644 --- a/sdk/authorization/arm-authorization/src/authorizationManagementClientContext.ts +++ b/sdk/authorization/arm-authorization/src/authorizationManagementClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -10,14 +9,15 @@ import * as Models from "./models"; import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; const packageName = "@azure/arm-authorization"; const packageVersion = "8.4.0"; export class AuthorizationManagementClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials | TokenCredential; + apiVersion?: string; subscriptionId: string; /** @@ -42,13 +42,14 @@ export class AuthorizationManagementClientContext extends msRestAzure.AzureServi if (!options) { options = {}; } - if(!options.userAgent) { + if (!options.userAgent) { const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; } super(credentials, options); + this.apiVersion = '2020-04-01-preview'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; @@ -56,10 +57,10 @@ export class AuthorizationManagementClientContext extends msRestAzure.AzureServi this.credentials = credentials; this.subscriptionId = subscriptionId; - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; } } diff --git a/sdk/authorization/arm-authorization/src/models/classicAdministratorsMappers.ts b/sdk/authorization/arm-authorization/src/models/classicAdministratorsMappers.ts deleted file mode 100644 index 327162fe1492..000000000000 --- a/sdk/authorization/arm-authorization/src/models/classicAdministratorsMappers.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ClassicAdministrator, - ClassicAdministratorListResult, - CloudError -} from "../models/mappers"; diff --git a/sdk/authorization/arm-authorization/src/models/denyAssignmentsMappers.ts b/sdk/authorization/arm-authorization/src/models/denyAssignmentsMappers.ts deleted file mode 100644 index 9754178e9a9e..000000000000 --- a/sdk/authorization/arm-authorization/src/models/denyAssignmentsMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CloudError, - DenyAssignment, - DenyAssignmentListResult, - DenyAssignmentPermission, - Principal -} from "../models/mappers"; diff --git a/sdk/authorization/arm-authorization/src/models/globalAdministratorMappers.ts b/sdk/authorization/arm-authorization/src/models/globalAdministratorMappers.ts deleted file mode 100644 index 67c5a45e0449..000000000000 --- a/sdk/authorization/arm-authorization/src/models/globalAdministratorMappers.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CloudError -} from "../models/mappers"; diff --git a/sdk/authorization/arm-authorization/src/models/index.ts b/sdk/authorization/arm-authorization/src/models/index.ts index 36ef6945f8f9..6cf363285476 100644 --- a/sdk/authorization/arm-authorization/src/models/index.ts +++ b/sdk/authorization/arm-authorization/src/models/index.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -11,110 +11,6 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; -/** - * Classic Administrators - */ -export interface ClassicAdministrator { - /** - * The ID of the administrator. - */ - id?: string; - /** - * The name of the administrator. - */ - name?: string; - /** - * The type of the administrator. - */ - type?: string; - /** - * The email address of the administrator. - */ - emailAddress?: string; - /** - * The role of the administrator. - */ - role?: string; -} - -/** - * Operation - */ -export interface ProviderOperation { - /** - * The operation name. - */ - name?: string; - /** - * The operation display name. - */ - displayName?: string; - /** - * The operation description. - */ - description?: string; - /** - * The operation origin. - */ - origin?: string; - /** - * The operation properties. - */ - properties?: any; - /** - * The dataAction flag to specify the operation type. - */ - isDataAction?: boolean; -} - -/** - * Resource Type - */ -export interface ResourceType { - /** - * The resource type name. - */ - name?: string; - /** - * The resource type display name. - */ - displayName?: string; - /** - * The resource type operations. - */ - operations?: ProviderOperation[]; -} - -/** - * Provider Operations metadata - */ -export interface ProviderOperationsMetadata { - /** - * The provider id. - */ - id?: string; - /** - * The provider name. - */ - name?: string; - /** - * The provider type. - */ - type?: string; - /** - * The provider display name. - */ - displayName?: string; - /** - * The provider resource types - */ - resourceTypes?: ResourceType[]; - /** - * The provider operations. - */ - operations?: ProviderOperation[]; -} - /** * Role Assignments filter */ @@ -170,243 +66,142 @@ export interface RoleAssignment { * The Delegation flag for the role assignment */ canDelegate?: boolean; -} - -/** - * Role assignment create parameters. - */ -export interface RoleAssignmentCreateParameters { - /** - * The role definition ID used in the role assignment. - */ - roleDefinitionId: string; - /** - * 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. - */ - principalId: string; /** - * The principal type of the assigned principal ID. Possible values include: 'User', 'Group', - * 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', - * 'DirectoryObjectOrGroup', 'Everyone' + * Description of role assignment */ - principalType?: PrincipalType; + description?: string; /** - * The delegation flag used for creating a role assignment + * The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: + * @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container' */ - canDelegate?: boolean; -} - -/** - * Role Definitions filter - */ -export interface RoleDefinitionFilter { + condition?: string; /** - * Returns role definition with the specific name. + * Version of the condition. Currently accepted value is '2.0' */ - roleName?: string; + conditionVersion?: string; /** - * Returns role definition with the specific type. + * Time it was created */ - type?: string; -} - -/** - * Role definition permissions. - */ -export interface Permission { + createdOn?: Date; /** - * Allowed actions. + * Time it was updated */ - actions?: string[]; + updatedOn?: Date; /** - * Denied actions. + * Id of the user who created the assignment */ - notActions?: string[]; + createdBy?: string; /** - * Allowed Data actions. + * Id of the user who updated the assignment */ - dataActions?: string[]; + updatedBy?: string; /** - * Denied Data actions. + * Id of the delegated managed identity resource */ - notDataActions?: string[]; + delegatedManagedIdentityResourceId?: string; } /** - * Role definition. + * Role assignment create parameters. */ -export interface RoleDefinition { +export interface RoleAssignmentCreateParameters { /** - * The role definition ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The role definition ID used in the role assignment. */ - readonly id?: string; + roleDefinitionId: string; /** - * The role definition name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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. */ - readonly name?: string; + principalId: string; /** - * The role definition type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The principal type of the assigned principal ID. Possible values include: 'User', 'Group', + * 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + * 'DirectoryObjectOrGroup', 'Everyone'. Default value: 'User'. */ - readonly type?: string; + principalType?: PrincipalType; /** - * The role name. + * The delegation flag used for creating a role assignment */ - roleName?: string; + canDelegate?: boolean; /** - * The role definition description. + * Description of role assignment */ description?: string; /** - * The role type. - */ - roleType?: string; - /** - * Role definition permissions. - */ - permissions?: Permission[]; - /** - * Role definition assignable scopes. - */ - assignableScopes?: string[]; -} - -/** - * Deny Assignments filter - */ -export interface DenyAssignmentFilter { - /** - * Return deny assignment with specified name. - */ - denyAssignmentName?: string; - /** - * Return all deny assignments where the specified principal is listed in the principals list of - * deny assignments. - */ - principalId?: string; - /** - * Return all deny assignments where the specified principal is listed either in the principals - * list or exclude principals list of deny assignments. - */ - gdprExportPrincipalId?: string; -} - -/** - * Deny assignment permissions. - */ -export interface DenyAssignmentPermission { - /** - * Actions to which the deny assignment does not grant access. - */ - actions?: string[]; - /** - * Actions to exclude from that the deny assignment does not grant access. + * The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: + * @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container' */ - notActions?: string[]; + condition?: string; /** - * Data actions to which the deny assignment does not grant access. + * Version of the condition. Currently accepted value is '2.0' */ - dataActions?: string[]; + conditionVersion?: string; /** - * Data actions to exclude from that the deny assignment does not grant access. + * Id of the delegated managed identity resource */ - notDataActions?: string[]; + delegatedManagedIdentityResourceId?: string; } /** - * Deny assignment principal. + * The resource management error additional info. */ -export interface Principal { +export interface ErrorAdditionalInfo { /** - * Object ID of the Azure AD principal (user, group, or service principal) to which the deny - * assignment applies. An empty guid '00000000-0000-0000-0000-000000000000' as principal id and - * principal type as 'Everyone' represents all users, groups and service principals. + * The additional info type. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly id?: string; + readonly type?: string; /** - * Type of object represented by principal id (user, group, or service principal). An empty guid - * '00000000-0000-0000-0000-000000000000' as principal id and principal type as 'Everyone' - * represents all users, groups and service principals. + * The additional info. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly type?: string; + readonly info?: any; } /** - * Deny Assignment + * The error detail. */ -export interface DenyAssignment { +export interface ErrorDetail { /** - * The deny assignment ID. + * The error code. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly id?: string; + readonly code?: string; /** - * The deny assignment name. + * The error message. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly name?: string; + readonly message?: string; /** - * The deny assignment type. + * The error target. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly type?: string; - /** - * The display name of the deny assignment. - */ - denyAssignmentName?: string; - /** - * The description of the deny assignment. - */ - description?: string; - /** - * An array of permissions that are denied by the deny assignment. - */ - permissions?: DenyAssignmentPermission[]; - /** - * The deny assignment scope. - */ - scope?: string; - /** - * Determines if the deny assignment applies to child scopes. Default value is false. - */ - doNotApplyToChildScopes?: boolean; - /** - * Array of principals to which the deny assignment applies. - */ - principals?: Principal[]; - /** - * Array of principals to which the deny assignment does not apply. - */ - excludePrincipals?: Principal[]; + readonly target?: string; /** - * Specifies whether this deny assignment was created by Azure and cannot be edited or deleted. + * The error details. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - isSystemProtected?: boolean; -} - -/** - * Optional Parameters. - */ -export interface ProviderOperationsMetadataGetOptionalParams extends msRest.RequestOptionsBase { + readonly details?: ErrorDetail[]; /** - * Specifies whether to expand the values. Default value: 'resourceTypes'. + * The error additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - expand?: string; + readonly additionalInfo?: ErrorAdditionalInfo[]; } /** - * Optional Parameters. + * Common error response for all Azure Resource Manager APIs to return error details for failed + * operations. (This also follows the OData error response format.). + * @summary Error response */ -export interface ProviderOperationsMetadataListOptionalParams extends msRest.RequestOptionsBase { +export interface ErrorResponse { /** - * Specifies whether to expand the values. Default value: 'resourceTypes'. + * The error object. */ - expand?: string; + error?: ErrorDetail; } /** @@ -419,724 +214,197 @@ export interface RoleAssignmentsListForResourceOptionalParams extends msRest.Req * or below the scope for the specified principal. */ filter?: string; -} - -/** - * Optional Parameters. - */ -export interface RoleAssignmentsListForResourceGroupOptionalParams extends msRest.RequestOptionsBase { - /** - * 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. - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface RoleAssignmentsListOptionalParams extends msRest.RequestOptionsBase { /** - * 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. + * Tenant ID for cross-tenant request */ - filter?: string; + tenantId?: string; } /** * Optional Parameters. */ -export interface RoleAssignmentsListForScopeOptionalParams extends msRest.RequestOptionsBase { +export interface RoleAssignmentsListForResourceGroupOptionalParams extends msRest.RequestOptionsBase { /** * 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. */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface RoleDefinitionsListOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. Use atScopeAndBelow filter to search below the given - * scope as well. - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface DenyAssignmentsListForResourceOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at - * or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by - * name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, - * above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq - * '{id}' to return all deny assignments at, above and below the scope for the specified - * principal. This filter is different from the principalId filter as it returns not only those - * deny assignments that contain the specified principal is the Principals list but also those - * deny assignments that contain the specified principal is the ExcludePrincipals list. - * Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and - * description properties are returned. - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface DenyAssignmentsListForResourceGroupOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at - * or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by - * name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, - * above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq - * '{id}' to return all deny assignments at, above and below the scope for the specified - * principal. This filter is different from the principalId filter as it returns not only those - * deny assignments that contain the specified principal is the Principals list but also those - * deny assignments that contain the specified principal is the ExcludePrincipals list. - * Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and - * description properties are returned. - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface DenyAssignmentsListOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at - * or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by - * name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, - * above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq - * '{id}' to return all deny assignments at, above and below the scope for the specified - * principal. This filter is different from the principalId filter as it returns not only those - * deny assignments that contain the specified principal is the Principals list but also those - * deny assignments that contain the specified principal is the ExcludePrincipals list. - * Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and - * description properties are returned. - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface DenyAssignmentsListForScopeOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at - * or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by - * name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, - * above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq - * '{id}' to return all deny assignments at, above and below the scope for the specified - * principal. This filter is different from the principalId filter as it returns not only those - * deny assignments that contain the specified principal is the Principals list but also those - * deny assignments that contain the specified principal is the ExcludePrincipals list. - * Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and - * description properties are returned. - */ - filter?: string; -} - -/** - * An interface representing AuthorizationManagementClientOptions. - */ -export interface AuthorizationManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; -} - -/** - * @interface - * ClassicAdministrator list result information. - * @extends Array - */ -export interface ClassicAdministratorListResult extends Array { - /** - * The URL to use for getting the next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * Provider operations metadata list - * @extends Array - */ -export interface ProviderOperationsMetadataListResult extends Array { - /** - * The URL to use for getting the next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * Role assignment list operation result. - * @extends Array - */ -export interface RoleAssignmentListResult extends Array { - /** - * The URL to use for getting the next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * Permissions information. - * @extends Array - */ -export interface PermissionGetResult extends Array { - /** - * The URL to use for getting the next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * Role definition list operation result. - * @extends Array - */ -export interface RoleDefinitionListResult extends Array { - /** - * The URL to use for getting the next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * Deny assignment list operation result. - * @extends Array - */ -export interface DenyAssignmentListResult extends Array { - /** - * The URL to use for getting the next set of results. - */ - nextLink?: string; -} - -/** - * Defines values for PrincipalType. - * Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', - * 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', 'DirectoryObjectOrGroup', - * 'Everyone' - * @readonly - * @enum {string} - */ -export type PrincipalType = 'User' | 'Group' | 'ServicePrincipal' | 'Unknown' | 'DirectoryRoleTemplate' | 'ForeignGroup' | 'Application' | 'MSI' | 'DirectoryObjectOrGroup' | 'Everyone'; - -/** - * Contains response data for the list operation. - */ -export type ClassicAdministratorsListResponse = ClassicAdministratorListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ClassicAdministratorListResult; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type ClassicAdministratorsListNextResponse = ClassicAdministratorListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ClassicAdministratorListResult; - }; -}; - -/** - * Contains response data for the get operation. - */ -export type ProviderOperationsMetadataGetResponse = ProviderOperationsMetadata & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProviderOperationsMetadata; - }; -}; - -/** - * Contains response data for the list operation. - */ -export type ProviderOperationsMetadataListResponse = ProviderOperationsMetadataListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProviderOperationsMetadataListResult; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type ProviderOperationsMetadataListNextResponse = ProviderOperationsMetadataListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProviderOperationsMetadataListResult; - }; -}; - -/** - * Contains response data for the listForResource operation. - */ -export type RoleAssignmentsListForResourceResponse = RoleAssignmentListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; - -/** - * Contains response data for the listForResourceGroup operation. - */ -export type RoleAssignmentsListForResourceGroupResponse = RoleAssignmentListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; - -/** - * Contains response data for the deleteMethod operation. - */ -export type RoleAssignmentsDeleteMethodResponse = RoleAssignment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignment; - }; -}; - -/** - * Contains response data for the create operation. - */ -export type RoleAssignmentsCreateResponse = RoleAssignment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignment; - }; -}; - -/** - * Contains response data for the get operation. - */ -export type RoleAssignmentsGetResponse = RoleAssignment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignment; - }; -}; - -/** - * Contains response data for the deleteById operation. - */ -export type RoleAssignmentsDeleteByIdResponse = RoleAssignment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignment; - }; -}; - -/** - * Contains response data for the createById operation. - */ -export type RoleAssignmentsCreateByIdResponse = RoleAssignment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignment; - }; -}; - -/** - * Contains response data for the getById operation. - */ -export type RoleAssignmentsGetByIdResponse = RoleAssignment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignment; - }; -}; - -/** - * Contains response data for the list operation. - */ -export type RoleAssignmentsListResponse = RoleAssignmentListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; - -/** - * Contains response data for the listForScope operation. - */ -export type RoleAssignmentsListForScopeResponse = RoleAssignmentListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; - -/** - * Contains response data for the listForResourceNext operation. - */ -export type RoleAssignmentsListForResourceNextResponse = RoleAssignmentListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; + filter?: string; + /** + * Tenant ID for cross-tenant request + */ + tenantId?: string; +} /** - * Contains response data for the listForResourceGroupNext operation. + * Optional Parameters. */ -export type RoleAssignmentsListForResourceGroupNextResponse = RoleAssignmentListResult & { +export interface RoleAssignmentsDeleteMethodOptionalParams extends msRest.RequestOptionsBase { /** - * The underlying HTTP response. + * Tenant ID for cross-tenant request */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; + tenantId?: string; +} /** - * Contains response data for the listNext operation. + * Optional Parameters. */ -export type RoleAssignmentsListNextResponse = RoleAssignmentListResult & { +export interface RoleAssignmentsGetOptionalParams extends msRest.RequestOptionsBase { /** - * The underlying HTTP response. + * Tenant ID for cross-tenant request */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; + tenantId?: string; +} /** - * Contains response data for the listForScopeNext operation. + * Optional Parameters. */ -export type RoleAssignmentsListForScopeNextResponse = RoleAssignmentListResult & { +export interface RoleAssignmentsDeleteByIdOptionalParams extends msRest.RequestOptionsBase { /** - * The underlying HTTP response. + * Tenant ID for cross-tenant request */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; + tenantId?: string; +} /** - * Contains response data for the listForResourceGroup operation. + * Optional Parameters. */ -export type PermissionsListForResourceGroupResponse = PermissionGetResult & { +export interface RoleAssignmentsGetByIdOptionalParams extends msRest.RequestOptionsBase { /** - * The underlying HTTP response. + * Tenant ID for cross-tenant request */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PermissionGetResult; - }; -}; + tenantId?: string; +} /** - * Contains response data for the listForResource operation. + * Optional Parameters. */ -export type PermissionsListForResourceResponse = PermissionGetResult & { +export interface RoleAssignmentsListOptionalParams extends msRest.RequestOptionsBase { /** - * The underlying HTTP response. + * 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. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PermissionGetResult; - }; -}; + filter?: string; + /** + * Tenant ID for cross-tenant request + */ + tenantId?: string; +} /** - * Contains response data for the listForResourceGroupNext operation. + * Optional Parameters. */ -export type PermissionsListForResourceGroupNextResponse = PermissionGetResult & { +export interface RoleAssignmentsListForScopeOptionalParams extends msRest.RequestOptionsBase { /** - * The underlying HTTP response. + * 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. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; + filter?: string; + /** + * Tenant ID for cross-tenant request + */ + tenantId?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: PermissionGetResult; - }; -}; +/** + * Optional Parameters. + */ +export interface RoleAssignmentsListForResourceNextOptionalParams extends msRest.RequestOptionsBase { + /** + * 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. + */ + filter?: string; + /** + * Tenant ID for cross-tenant request + */ + tenantId?: string; +} /** - * Contains response data for the listForResourceNext operation. + * Optional Parameters. */ -export type PermissionsListForResourceNextResponse = PermissionGetResult & { +export interface RoleAssignmentsListForResourceGroupNextOptionalParams extends msRest.RequestOptionsBase { /** - * The underlying HTTP response. + * 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. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; + filter?: string; + /** + * Tenant ID for cross-tenant request + */ + tenantId?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: PermissionGetResult; - }; -}; +/** + * Optional Parameters. + */ +export interface RoleAssignmentsListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * 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. + */ + filter?: string; + /** + * Tenant ID for cross-tenant request + */ + tenantId?: string; +} /** - * Contains response data for the deleteMethod operation. + * Optional Parameters. */ -export type RoleDefinitionsDeleteMethodResponse = RoleDefinition & { +export interface RoleAssignmentsListForScopeNextOptionalParams extends msRest.RequestOptionsBase { /** - * The underlying HTTP response. + * 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. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; + filter?: string; + /** + * Tenant ID for cross-tenant request + */ + tenantId?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleDefinition; - }; -}; +/** + * An interface representing AuthorizationManagementClientOptions. + */ +export interface AuthorizationManagementClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} /** - * Contains response data for the get operation. + * @interface + * Role assignment list operation result. + * @extends Array */ -export type RoleDefinitionsGetResponse = RoleDefinition & { +export interface RoleAssignmentListResult extends Array { /** - * The underlying HTTP response. + * The URL to use for getting the next set of results. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; + nextLink?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleDefinition; - }; -}; +/** + * Defines values for PrincipalType. + * Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + * 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', 'DirectoryObjectOrGroup', + * 'Everyone' + * @readonly + * @enum {string} + */ +export type PrincipalType = 'User' | 'Group' | 'ServicePrincipal' | 'Unknown' | 'DirectoryRoleTemplate' | 'ForeignGroup' | 'Application' | 'MSI' | 'DirectoryObjectOrGroup' | 'Everyone'; /** - * Contains response data for the createOrUpdate operation. + * Contains response data for the listForResource operation. */ -export type RoleDefinitionsCreateOrUpdateResponse = RoleDefinition & { +export type RoleAssignmentsListForResourceResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1149,14 +417,14 @@ export type RoleDefinitionsCreateOrUpdateResponse = RoleDefinition & { /** * The response body as parsed JSON or XML */ - parsedBody: RoleDefinition; + parsedBody: RoleAssignmentListResult; }; }; /** - * Contains response data for the list operation. + * Contains response data for the listForResourceGroup operation. */ -export type RoleDefinitionsListResponse = RoleDefinitionListResult & { +export type RoleAssignmentsListForResourceGroupResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1169,14 +437,14 @@ export type RoleDefinitionsListResponse = RoleDefinitionListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: RoleDefinitionListResult; + parsedBody: RoleAssignmentListResult; }; }; /** - * Contains response data for the getById operation. + * Contains response data for the deleteMethod operation. */ -export type RoleDefinitionsGetByIdResponse = RoleDefinition & { +export type RoleAssignmentsDeleteMethodResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -1189,14 +457,14 @@ export type RoleDefinitionsGetByIdResponse = RoleDefinition & { /** * The response body as parsed JSON or XML */ - parsedBody: RoleDefinition; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the listNext operation. + * Contains response data for the create operation. */ -export type RoleDefinitionsListNextResponse = RoleDefinitionListResult & { +export type RoleAssignmentsCreateResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -1209,14 +477,14 @@ export type RoleDefinitionsListNextResponse = RoleDefinitionListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: RoleDefinitionListResult; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the listForResource operation. + * Contains response data for the get operation. */ -export type DenyAssignmentsListForResourceResponse = DenyAssignmentListResult & { +export type RoleAssignmentsGetResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -1229,14 +497,14 @@ export type DenyAssignmentsListForResourceResponse = DenyAssignmentListResult & /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the listForResourceGroup operation. + * Contains response data for the deleteById operation. */ -export type DenyAssignmentsListForResourceGroupResponse = DenyAssignmentListResult & { +export type RoleAssignmentsDeleteByIdResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -1249,14 +517,14 @@ export type DenyAssignmentsListForResourceGroupResponse = DenyAssignmentListResu /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the list operation. + * Contains response data for the createById operation. */ -export type DenyAssignmentsListResponse = DenyAssignmentListResult & { +export type RoleAssignmentsCreateByIdResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -1269,14 +537,14 @@ export type DenyAssignmentsListResponse = DenyAssignmentListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the get operation. + * Contains response data for the getById operation. */ -export type DenyAssignmentsGetResponse = DenyAssignment & { +export type RoleAssignmentsGetByIdResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -1289,14 +557,14 @@ export type DenyAssignmentsGetResponse = DenyAssignment & { /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignment; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the getById operation. + * Contains response data for the list operation. */ -export type DenyAssignmentsGetByIdResponse = DenyAssignment & { +export type RoleAssignmentsListResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1309,14 +577,14 @@ export type DenyAssignmentsGetByIdResponse = DenyAssignment & { /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignment; + parsedBody: RoleAssignmentListResult; }; }; /** * Contains response data for the listForScope operation. */ -export type DenyAssignmentsListForScopeResponse = DenyAssignmentListResult & { +export type RoleAssignmentsListForScopeResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1329,14 +597,14 @@ export type DenyAssignmentsListForScopeResponse = DenyAssignmentListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignmentListResult; }; }; /** * Contains response data for the listForResourceNext operation. */ -export type DenyAssignmentsListForResourceNextResponse = DenyAssignmentListResult & { +export type RoleAssignmentsListForResourceNextResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1349,14 +617,14 @@ export type DenyAssignmentsListForResourceNextResponse = DenyAssignmentListResul /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignmentListResult; }; }; /** * Contains response data for the listForResourceGroupNext operation. */ -export type DenyAssignmentsListForResourceGroupNextResponse = DenyAssignmentListResult & { +export type RoleAssignmentsListForResourceGroupNextResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1369,14 +637,14 @@ export type DenyAssignmentsListForResourceGroupNextResponse = DenyAssignmentList /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignmentListResult; }; }; /** * Contains response data for the listNext operation. */ -export type DenyAssignmentsListNextResponse = DenyAssignmentListResult & { +export type RoleAssignmentsListNextResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1389,14 +657,14 @@ export type DenyAssignmentsListNextResponse = DenyAssignmentListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignmentListResult; }; }; /** * Contains response data for the listForScopeNext operation. */ -export type DenyAssignmentsListForScopeNextResponse = DenyAssignmentListResult & { +export type RoleAssignmentsListForScopeNextResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1409,6 +677,6 @@ export type DenyAssignmentsListForScopeNextResponse = DenyAssignmentListResult & /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignmentListResult; }; }; diff --git a/sdk/authorization/arm-authorization/src/models/mappers.ts b/sdk/authorization/arm-authorization/src/models/mappers.ts index ee2cfdc282cc..5d1ea68199d0 100644 --- a/sdk/authorization/arm-authorization/src/models/mappers.ts +++ b/sdk/authorization/arm-authorization/src/models/mappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -12,184 +12,6 @@ import * as msRest from "@azure/ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; -export const ClassicAdministrator: msRest.CompositeMapper = { - serializedName: "ClassicAdministrator", - type: { - name: "Composite", - className: "ClassicAdministrator", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - }, - name: { - serializedName: "name", - type: { - name: "String" - } - }, - type: { - serializedName: "type", - type: { - name: "String" - } - }, - emailAddress: { - serializedName: "properties.emailAddress", - type: { - name: "String" - } - }, - role: { - serializedName: "properties.role", - type: { - name: "String" - } - } - } - } -}; - -export const ProviderOperation: msRest.CompositeMapper = { - serializedName: "ProviderOperation", - type: { - name: "Composite", - className: "ProviderOperation", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - displayName: { - serializedName: "displayName", - type: { - name: "String" - } - }, - description: { - serializedName: "description", - type: { - name: "String" - } - }, - origin: { - serializedName: "origin", - type: { - name: "String" - } - }, - properties: { - serializedName: "properties", - type: { - name: "Object" - } - }, - isDataAction: { - serializedName: "isDataAction", - type: { - name: "Boolean" - } - } - } - } -}; - -export const ResourceType: msRest.CompositeMapper = { - serializedName: "ResourceType", - type: { - name: "Composite", - className: "ResourceType", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - displayName: { - serializedName: "displayName", - type: { - name: "String" - } - }, - operations: { - serializedName: "operations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ProviderOperation" - } - } - } - } - } - } -}; - -export const ProviderOperationsMetadata: msRest.CompositeMapper = { - serializedName: "ProviderOperationsMetadata", - type: { - name: "Composite", - className: "ProviderOperationsMetadata", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - }, - name: { - serializedName: "name", - type: { - name: "String" - } - }, - type: { - serializedName: "type", - type: { - name: "String" - } - }, - displayName: { - serializedName: "displayName", - type: { - name: "String" - } - }, - resourceTypes: { - serializedName: "resourceTypes", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceType" - } - } - } - }, - operations: { - serializedName: "operations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ProviderOperation" - } - } - } - } - } - } -}; - export const RoleAssignmentFilter: msRest.CompositeMapper = { serializedName: "RoleAssignmentFilter", type: { @@ -268,154 +90,90 @@ export const RoleAssignment: msRest.CompositeMapper = { type: { name: "Boolean" } - } - } - } -}; - -export const RoleAssignmentCreateParameters: msRest.CompositeMapper = { - serializedName: "RoleAssignmentCreateParameters", - type: { - name: "Composite", - className: "RoleAssignmentCreateParameters", - modelProperties: { - roleDefinitionId: { - required: true, - serializedName: "properties.roleDefinitionId", - type: { - name: "String" - } }, - principalId: { - required: true, - serializedName: "properties.principalId", + description: { + serializedName: "properties.description", type: { name: "String" } }, - principalType: { - serializedName: "properties.principalType", + condition: { + serializedName: "properties.condition", type: { name: "String" } }, - canDelegate: { - serializedName: "properties.canDelegate", - type: { - name: "Boolean" - } - } - } - } -}; - -export const RoleDefinitionFilter: msRest.CompositeMapper = { - serializedName: "RoleDefinitionFilter", - type: { - name: "Composite", - className: "RoleDefinitionFilter", - modelProperties: { - roleName: { - serializedName: "roleName", + conditionVersion: { + serializedName: "properties.conditionVersion", type: { name: "String" } }, - type: { - serializedName: "type", + createdOn: { + serializedName: "properties.createdOn", type: { - name: "String" + name: "DateTime" } - } - } - } -}; - -export const Permission: msRest.CompositeMapper = { - serializedName: "Permission", - type: { - name: "Composite", - className: "Permission", - modelProperties: { - actions: { - serializedName: "actions", + }, + updatedOn: { + serializedName: "properties.updatedOn", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "DateTime" } }, - notActions: { - serializedName: "notActions", + createdBy: { + serializedName: "properties.createdBy", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - dataActions: { - serializedName: "dataActions", + updatedBy: { + serializedName: "properties.updatedBy", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - notDataActions: { - serializedName: "notDataActions", + delegatedManagedIdentityResourceId: { + serializedName: "properties.delegatedManagedIdentityResourceId", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } } } } }; -export const RoleDefinition: msRest.CompositeMapper = { - serializedName: "RoleDefinition", +export const RoleAssignmentCreateParameters: msRest.CompositeMapper = { + serializedName: "RoleAssignmentCreateParameters", type: { name: "Composite", - className: "RoleDefinition", + className: "RoleAssignmentCreateParameters", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + roleDefinitionId: { + required: true, + serializedName: "properties.roleDefinitionId", type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + principalId: { + required: true, + serializedName: "properties.principalId", type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + principalType: { + serializedName: "properties.principalType", + defaultValue: 'User', type: { name: "String" } }, - roleName: { - serializedName: "properties.roleName", + canDelegate: { + serializedName: "properties.canDelegate", type: { - name: "String" + name: "Boolean" } }, description: { @@ -424,59 +182,20 @@ export const RoleDefinition: msRest.CompositeMapper = { name: "String" } }, - roleType: { - serializedName: "properties.type", - type: { - name: "String" - } - }, - permissions: { - serializedName: "properties.permissions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Permission" - } - } - } - }, - assignableScopes: { - serializedName: "properties.assignableScopes", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const DenyAssignmentFilter: msRest.CompositeMapper = { - serializedName: "DenyAssignmentFilter", - type: { - name: "Composite", - className: "DenyAssignmentFilter", - modelProperties: { - denyAssignmentName: { - serializedName: "denyAssignmentName", + condition: { + serializedName: "properties.condition", type: { name: "String" } }, - principalId: { - serializedName: "principalId", + conditionVersion: { + serializedName: "properties.conditionVersion", type: { name: "String" } }, - gdprExportPrincipalId: { - serializedName: "gdprExportPrincipalId", + delegatedManagedIdentityResourceId: { + serializedName: "properties.delegatedManagedIdentityResourceId", type: { name: "String" } @@ -485,231 +204,98 @@ export const DenyAssignmentFilter: msRest.CompositeMapper = { } }; -export const DenyAssignmentPermission: msRest.CompositeMapper = { - serializedName: "DenyAssignmentPermission", - type: { - name: "Composite", - className: "DenyAssignmentPermission", - modelProperties: { - actions: { - serializedName: "actions", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - notActions: { - serializedName: "notActions", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - dataActions: { - serializedName: "dataActions", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - notDataActions: { - serializedName: "notDataActions", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const Principal: msRest.CompositeMapper = { - serializedName: "Principal", +export const ErrorAdditionalInfo: msRest.CompositeMapper = { + serializedName: "ErrorAdditionalInfo", type: { name: "Composite", - className: "Principal", + className: "ErrorAdditionalInfo", modelProperties: { - id: { + type: { readOnly: true, - serializedName: "id", + serializedName: "type", type: { name: "String" } }, - type: { + info: { readOnly: true, - serializedName: "type", + serializedName: "info", type: { - name: "String" + name: "Object" } } } } }; -export const DenyAssignment: msRest.CompositeMapper = { - serializedName: "DenyAssignment", +export const ErrorDetail: msRest.CompositeMapper = { + serializedName: "ErrorDetail", type: { name: "Composite", - className: "DenyAssignment", + className: "ErrorDetail", modelProperties: { - id: { + code: { readOnly: true, - serializedName: "id", + serializedName: "code", type: { name: "String" } }, - name: { + message: { readOnly: true, - serializedName: "name", + serializedName: "message", type: { name: "String" } }, - type: { + target: { readOnly: true, - serializedName: "type", + serializedName: "target", type: { name: "String" } }, - denyAssignmentName: { - serializedName: "properties.denyAssignmentName", - type: { - name: "String" - } - }, - description: { - serializedName: "properties.description", - type: { - name: "String" - } - }, - permissions: { - serializedName: "properties.permissions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DenyAssignmentPermission" - } - } - } - }, - scope: { - serializedName: "properties.scope", - type: { - name: "String" - } - }, - doNotApplyToChildScopes: { - serializedName: "properties.doNotApplyToChildScopes", - type: { - name: "Boolean" - } - }, - principals: { - serializedName: "properties.principals", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Principal" - } - } - } - }, - excludePrincipals: { - serializedName: "properties.excludePrincipals", + details: { + readOnly: true, + serializedName: "details", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Principal" + className: "ErrorDetail" } } } }, - isSystemProtected: { - serializedName: "properties.isSystemProtected", - type: { - name: "Boolean" - } - } - } - } -}; - -export const ClassicAdministratorListResult: msRest.CompositeMapper = { - serializedName: "ClassicAdministratorListResult", - type: { - name: "Composite", - className: "ClassicAdministratorListResult", - modelProperties: { - value: { - serializedName: "", + additionalInfo: { + readOnly: true, + serializedName: "additionalInfo", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ClassicAdministrator" + className: "ErrorAdditionalInfo" } } } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } } } } }; -export const ProviderOperationsMetadataListResult: msRest.CompositeMapper = { - serializedName: "ProviderOperationsMetadataListResult", +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", type: { name: "Composite", - className: "ProviderOperationsMetadataListResult", + className: "ErrorResponse", modelProperties: { - value: { - serializedName: "", + error: { + serializedName: "error", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ProviderOperationsMetadata" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" + name: "Composite", + className: "ErrorDetail" } } } @@ -743,87 +329,3 @@ export const RoleAssignmentListResult: msRest.CompositeMapper = { } } }; - -export const PermissionGetResult: msRest.CompositeMapper = { - serializedName: "PermissionGetResult", - type: { - name: "Composite", - className: "PermissionGetResult", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Permission" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const RoleDefinitionListResult: msRest.CompositeMapper = { - serializedName: "RoleDefinitionListResult", - type: { - name: "Composite", - className: "RoleDefinitionListResult", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RoleDefinition" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const DenyAssignmentListResult: msRest.CompositeMapper = { - serializedName: "DenyAssignmentListResult", - type: { - name: "Composite", - className: "DenyAssignmentListResult", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DenyAssignment" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; diff --git a/sdk/authorization/arm-authorization/src/models/parameters.ts b/sdk/authorization/arm-authorization/src/models/parameters.ts index f6016339a51d..ecb6b1b18d78 100644 --- a/sdk/authorization/arm-authorization/src/models/parameters.ts +++ b/sdk/authorization/arm-authorization/src/models/parameters.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -20,95 +19,14 @@ export const acceptLanguage: msRest.OperationParameter = { } } }; -export const apiVersion0: msRest.OperationQueryParameter = { +export const apiVersion: msRest.OperationQueryParameter = { parameterPath: "apiVersion", mapper: { required: true, - isConstant: true, serializedName: "api-version", - defaultValue: '2015-06-01', - type: { - name: "String" - } - } -}; -export const apiVersion1: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2015-07-01', - type: { - name: "String" - } - } -}; -export const apiVersion2: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2018-01-01-preview', - type: { - name: "String" - } - } -}; -export const apiVersion3: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2018-09-01-preview', - type: { - name: "String" - } - } -}; -export const apiVersion4: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2018-07-01-preview', - type: { - name: "String" - } - } -}; -export const denyAssignmentId0: msRest.OperationURLParameter = { - parameterPath: "denyAssignmentId", - mapper: { - required: true, - serializedName: "denyAssignmentId", - type: { - name: "String" - } - } -}; -export const denyAssignmentId1: msRest.OperationURLParameter = { - parameterPath: "denyAssignmentId", - mapper: { - required: true, - serializedName: "denyAssignmentId", - type: { - name: "String" - } - }, - skipEncoding: true -}; -export const expand: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "expand" - ], - mapper: { - serializedName: "$expand", - defaultValue: 'resourceTypes', + constraints: { + MinLength: 1 + }, type: { name: "String" } @@ -153,6 +71,10 @@ export const resourceGroupName: msRest.OperationURLParameter = { mapper: { required: true, serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1 + }, type: { name: "String" } @@ -199,16 +121,6 @@ export const roleAssignmentName: msRest.OperationURLParameter = { } } }; -export const roleDefinitionId: msRest.OperationURLParameter = { - parameterPath: "roleDefinitionId", - mapper: { - required: true, - serializedName: "roleDefinitionId", - type: { - name: "String" - } - } -}; export const roleId: msRest.OperationURLParameter = { parameterPath: "roleId", mapper: { @@ -236,6 +148,21 @@ export const subscriptionId: msRest.OperationURLParameter = { mapper: { required: true, serializedName: "subscriptionId", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + } +}; +export const tenantId: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "tenantId" + ], + mapper: { + serializedName: "tenantId", type: { name: "String" } diff --git a/sdk/authorization/arm-authorization/src/models/permissionsMappers.ts b/sdk/authorization/arm-authorization/src/models/permissionsMappers.ts deleted file mode 100644 index 2ca29685b7d7..000000000000 --- a/sdk/authorization/arm-authorization/src/models/permissionsMappers.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CloudError, - Permission, - PermissionGetResult -} from "../models/mappers"; diff --git a/sdk/authorization/arm-authorization/src/models/providerOperationsMetadataOperationsMappers.ts b/sdk/authorization/arm-authorization/src/models/providerOperationsMetadataOperationsMappers.ts deleted file mode 100644 index 7bfe52496e1d..000000000000 --- a/sdk/authorization/arm-authorization/src/models/providerOperationsMetadataOperationsMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CloudError, - ProviderOperation, - ProviderOperationsMetadata, - ProviderOperationsMetadataListResult, - ResourceType -} from "../models/mappers"; diff --git a/sdk/authorization/arm-authorization/src/models/roleAssignmentsMappers.ts b/sdk/authorization/arm-authorization/src/models/roleAssignmentsMappers.ts index 9a3e7d0c7a2c..f1aa9caf6784 100644 --- a/sdk/authorization/arm-authorization/src/models/roleAssignmentsMappers.ts +++ b/sdk/authorization/arm-authorization/src/models/roleAssignmentsMappers.ts @@ -1,13 +1,15 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - CloudError, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, RoleAssignment, RoleAssignmentCreateParameters, RoleAssignmentListResult diff --git a/sdk/authorization/arm-authorization/src/models/roleDefinitionsMappers.ts b/sdk/authorization/arm-authorization/src/models/roleDefinitionsMappers.ts deleted file mode 100644 index c64320ffca61..000000000000 --- a/sdk/authorization/arm-authorization/src/models/roleDefinitionsMappers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CloudError, - Permission, - RoleDefinition, - RoleDefinitionListResult -} from "../models/mappers"; diff --git a/sdk/authorization/arm-authorization/src/operations/classicAdministrators.ts b/sdk/authorization/arm-authorization/src/operations/classicAdministrators.ts deleted file mode 100644 index d9d06e7c6bfe..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/classicAdministrators.ts +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/classicAdministratorsMappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; - -/** Class representing a ClassicAdministrators. */ -export class ClassicAdministrators { - private readonly client: AuthorizationManagementClientContext; - - /** - * Create a ClassicAdministrators. - * @param {AuthorizationManagementClientContext} client Reference to the service client. - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * Gets service administrator, account administrator, and co-administrators for the subscription. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; - } - - /** - * Gets service administrator, account administrator, and co-administrators for the subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/classicAdministrators", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ClassicAdministratorListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ClassicAdministratorListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/denyAssignments.ts b/sdk/authorization/arm-authorization/src/operations/denyAssignments.ts deleted file mode 100644 index e864b8780f9c..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/denyAssignments.ts +++ /dev/null @@ -1,571 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/denyAssignmentsMappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; - -/** Class representing a DenyAssignments. */ -export class DenyAssignments { - private readonly client: AuthorizationManagementClientContext; - - /** - * Create a DenyAssignments. - * @param {AuthorizationManagementClientContext} client Reference to the service client. - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * Gets deny assignments for a resource. - * @param resourceGroupName The name of the resource group. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get deny assignments for. - * @param [options] The optional parameters - * @returns Promise - */ - listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.DenyAssignmentsListForResourceOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get deny assignments for. - * @param callback The callback - */ - listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get deny assignments for. - * @param options The optional parameters - * @param callback The callback - */ - listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options: Models.DenyAssignmentsListForResourceOptionalParams, callback: msRest.ServiceCallback): void; - listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.DenyAssignmentsListForResourceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - options - }, - listForResourceOperationSpec, - callback) as Promise; - } - - /** - * Gets deny assignments for a resource group. - * @param resourceGroupName The name of the resource group. - * @param [options] The optional parameters - * @returns Promise - */ - listForResourceGroup(resourceGroupName: string, options?: Models.DenyAssignmentsListForResourceGroupOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param callback The callback - */ - listForResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param options The optional parameters - * @param callback The callback - */ - listForResourceGroup(resourceGroupName: string, options: Models.DenyAssignmentsListForResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; - listForResourceGroup(resourceGroupName: string, options?: Models.DenyAssignmentsListForResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listForResourceGroupOperationSpec, - callback) as Promise; - } - - /** - * Gets all deny assignments for the subscription. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: Models.DenyAssignmentsListOptionalParams): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: Models.DenyAssignmentsListOptionalParams, callback: msRest.ServiceCallback): void; - list(options?: Models.DenyAssignmentsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; - } - - /** - * Get the specified deny assignment. - * @param scope The scope of the deny assignment. - * @param denyAssignmentId The ID of the deny assignment to get. - * @param [options] The optional parameters - * @returns Promise - */ - get(scope: string, denyAssignmentId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param scope The scope of the deny assignment. - * @param denyAssignmentId The ID of the deny assignment to get. - * @param callback The callback - */ - get(scope: string, denyAssignmentId: string, callback: msRest.ServiceCallback): void; - /** - * @param scope The scope of the deny assignment. - * @param denyAssignmentId The ID of the deny assignment to get. - * @param options The optional parameters - * @param callback The callback - */ - get(scope: string, denyAssignmentId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(scope: string, denyAssignmentId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - scope, - denyAssignmentId, - options - }, - getOperationSpec, - callback) as Promise; - } - - /** - * Gets a deny assignment by ID. - * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for - * subscription level deny assignments, or - * /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant level deny - * assignments. - * @param [options] The optional parameters - * @returns Promise - */ - getById(denyAssignmentId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for - * subscription level deny assignments, or - * /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant level deny - * assignments. - * @param callback The callback - */ - getById(denyAssignmentId: string, callback: msRest.ServiceCallback): void; - /** - * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for - * subscription level deny assignments, or - * /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant level deny - * assignments. - * @param options The optional parameters - * @param callback The callback - */ - getById(denyAssignmentId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getById(denyAssignmentId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - denyAssignmentId, - options - }, - getByIdOperationSpec, - callback) as Promise; - } - - /** - * Gets deny assignments for a scope. - * @param scope The scope of the deny assignments. - * @param [options] The optional parameters - * @returns Promise - */ - listForScope(scope: string, options?: Models.DenyAssignmentsListForScopeOptionalParams): Promise; - /** - * @param scope The scope of the deny assignments. - * @param callback The callback - */ - listForScope(scope: string, callback: msRest.ServiceCallback): void; - /** - * @param scope The scope of the deny assignments. - * @param options The optional parameters - * @param callback The callback - */ - listForScope(scope: string, options: Models.DenyAssignmentsListForScopeOptionalParams, callback: msRest.ServiceCallback): void; - listForScope(scope: string, options?: Models.DenyAssignmentsListForScopeOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - scope, - options - }, - listForScopeOperationSpec, - callback) as Promise; - } - - /** - * Gets deny assignments for a resource. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForResourceNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForResourceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForResourceNextOperationSpec, - callback) as Promise; - } - - /** - * Gets deny assignments for a resource group. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForResourceGroupNextOperationSpec, - callback) as Promise; - } - - /** - * Gets all deny assignments for the subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; - } - - /** - * Gets deny assignments for a scope. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForScopeNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForScopeNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listForScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForScopeNextOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listForResourceOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/denyAssignments", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceProviderNamespace, - Parameters.parentResourcePath, - Parameters.resourceType, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion4, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.DenyAssignmentListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listForResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/denyAssignments", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion4, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.DenyAssignmentListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/denyAssignments", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion4, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.DenyAssignmentListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "{scope}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId}", - urlParameters: [ - Parameters.scope, - Parameters.denyAssignmentId0 - ], - queryParameters: [ - Parameters.apiVersion4 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.DenyAssignment - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const getByIdOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "{denyAssignmentId}", - urlParameters: [ - Parameters.denyAssignmentId1 - ], - queryParameters: [ - Parameters.apiVersion4 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.DenyAssignment - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listForScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "{scope}/providers/Microsoft.Authorization/denyAssignments", - urlParameters: [ - Parameters.scope - ], - queryParameters: [ - Parameters.apiVersion4, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.DenyAssignmentListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listForResourceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.DenyAssignmentListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listForResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.DenyAssignmentListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.DenyAssignmentListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listForScopeNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.DenyAssignmentListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/globalAdministrator.ts b/sdk/authorization/arm-authorization/src/operations/globalAdministrator.ts deleted file mode 100644 index 0023d794b235..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/globalAdministrator.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Mappers from "../models/globalAdministratorMappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; - -/** Class representing a GlobalAdministrator. */ -export class GlobalAdministrator { - private readonly client: AuthorizationManagementClientContext; - - /** - * Create a GlobalAdministrator. - * @param {AuthorizationManagementClientContext} client Reference to the service client. - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * Elevates access for a Global Administrator. - * @param [options] The optional parameters - * @returns Promise - */ - elevateAccess(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - elevateAccess(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - elevateAccess(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - elevateAccess(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - elevateAccessOperationSpec, - callback); - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const elevateAccessOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "providers/Microsoft.Authorization/elevateAccess", - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/index.ts b/sdk/authorization/arm-authorization/src/operations/index.ts index 666b593b53b8..455a5d365626 100644 --- a/sdk/authorization/arm-authorization/src/operations/index.ts +++ b/sdk/authorization/arm-authorization/src/operations/index.ts @@ -1,17 +1,10 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ -export * from "./classicAdministrators"; -export * from "./globalAdministrator"; -export * from "./providerOperationsMetadataOperations"; export * from "./roleAssignments"; -export * from "./permissions"; -export * from "./roleDefinitions"; -export * from "./denyAssignments"; diff --git a/sdk/authorization/arm-authorization/src/operations/permissions.ts b/sdk/authorization/arm-authorization/src/operations/permissions.ts deleted file mode 100644 index 95de3b3b1a05..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/permissions.ts +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/permissionsMappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; - -/** Class representing a Permissions. */ -export class Permissions { - private readonly client: AuthorizationManagementClientContext; - - /** - * Create a Permissions. - * @param {AuthorizationManagementClientContext} client Reference to the service client. - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * Gets all permissions the caller has for a resource group. - * @param resourceGroupName The name of the resource group. - * @param [options] The optional parameters - * @returns Promise - */ - listForResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param callback The callback - */ - listForResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param options The optional parameters - * @param callback The callback - */ - listForResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listForResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listForResourceGroupOperationSpec, - callback) as Promise; - } - - /** - * Gets all permissions the caller has for a resource. - * @param resourceGroupName The name of the resource group. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get the permissions for. - * @param [options] The optional parameters - * @returns Promise - */ - listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get the permissions for. - * @param callback The callback - */ - listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get the permissions for. - * @param options The optional parameters - * @param callback The callback - */ - listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - options - }, - listForResourceOperationSpec, - callback) as Promise; - } - - /** - * Gets all permissions the caller has for a resource group. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForResourceGroupNextOperationSpec, - callback) as Promise; - } - - /** - * Gets all permissions the caller has for a resource. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listForResourceNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listForResourceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listForResourceNextOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listForResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Authorization/permissions", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.PermissionGetResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listForResourceOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/permissions", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.resourceProviderNamespace, - Parameters.parentResourcePath, - Parameters.resourceType, - Parameters.resourceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.PermissionGetResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listForResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.PermissionGetResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listForResourceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.PermissionGetResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/providerOperationsMetadataOperations.ts b/sdk/authorization/arm-authorization/src/operations/providerOperationsMetadataOperations.ts deleted file mode 100644 index 7643d6706222..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/providerOperationsMetadataOperations.ts +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/providerOperationsMetadataOperationsMappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; - -/** Class representing a ProviderOperationsMetadataOperations. */ -export class ProviderOperationsMetadataOperations { - private readonly client: AuthorizationManagementClientContext; - - /** - * Create a ProviderOperationsMetadataOperations. - * @param {AuthorizationManagementClientContext} client Reference to the service client. - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * Gets provider operations metadata for the specified resource provider. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceProviderNamespace: string, options?: Models.ProviderOperationsMetadataGetOptionalParams): Promise; - /** - * @param resourceProviderNamespace The namespace of the resource provider. - * @param callback The callback - */ - get(resourceProviderNamespace: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceProviderNamespace The namespace of the resource provider. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceProviderNamespace: string, options: Models.ProviderOperationsMetadataGetOptionalParams, callback: msRest.ServiceCallback): void; - get(resourceProviderNamespace: string, options?: Models.ProviderOperationsMetadataGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceProviderNamespace, - options - }, - getOperationSpec, - callback) as Promise; - } - - /** - * Gets provider operations metadata for all resource providers. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: Models.ProviderOperationsMetadataListOptionalParams): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: Models.ProviderOperationsMetadataListOptionalParams, callback: msRest.ServiceCallback): void; - list(options?: Models.ProviderOperationsMetadataListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; - } - - /** - * Gets provider operations metadata for all resource providers. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "providers/Microsoft.Authorization/providerOperations/{resourceProviderNamespace}", - urlParameters: [ - Parameters.resourceProviderNamespace - ], - queryParameters: [ - Parameters.apiVersion2, - Parameters.expand - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ProviderOperationsMetadata - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "providers/Microsoft.Authorization/providerOperations", - queryParameters: [ - Parameters.apiVersion2, - Parameters.expand - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ProviderOperationsMetadataListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ProviderOperationsMetadataListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleAssignments.ts b/sdk/authorization/arm-authorization/src/operations/roleAssignments.ts index f6d695fcba05..cdb7bc4462cd 100644 --- a/sdk/authorization/arm-authorization/src/operations/roleAssignments.ts +++ b/sdk/authorization/arm-authorization/src/operations/roleAssignments.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -27,8 +26,8 @@ export class RoleAssignments { } /** - * Gets role assignments for a resource. - * @param resourceGroupName The name of the resource group. + * List role assignments for a resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. * @param resourceType The resource type of the resource. @@ -38,7 +37,7 @@ export class RoleAssignments { */ listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.RoleAssignmentsListForResourceOptionalParams): Promise; /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. * @param resourceType The resource type of the resource. @@ -47,7 +46,7 @@ export class RoleAssignments { */ listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. * @param resourceType The resource type of the resource. @@ -71,19 +70,19 @@ export class RoleAssignments { } /** - * Gets role assignments for a resource group. - * @param resourceGroupName The name of the resource group. + * List role assignments for a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param [options] The optional parameters * @returns Promise */ listForResourceGroup(resourceGroupName: string, options?: Models.RoleAssignmentsListForResourceGroupOptionalParams): Promise; /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param callback The callback */ listForResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The optional parameters * @param callback The callback */ @@ -99,13 +98,13 @@ export class RoleAssignments { } /** - * Deletes a role assignment. + * Delete a role assignment. * @param scope The scope of the role assignment to delete. * @param roleAssignmentName The name of the role assignment to delete. * @param [options] The optional parameters * @returns Promise */ - deleteMethod(scope: string, roleAssignmentName: string, options?: msRest.RequestOptionsBase): Promise; + deleteMethod(scope: string, roleAssignmentName: string, options?: Models.RoleAssignmentsDeleteMethodOptionalParams): Promise; /** * @param scope The scope of the role assignment to delete. * @param roleAssignmentName The name of the role assignment to delete. @@ -118,8 +117,8 @@ export class RoleAssignments { * @param options The optional parameters * @param callback The callback */ - deleteMethod(scope: string, roleAssignmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(scope: string, roleAssignmentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + deleteMethod(scope: string, roleAssignmentName: string, options: Models.RoleAssignmentsDeleteMethodOptionalParams, callback: msRest.ServiceCallback): void; + deleteMethod(scope: string, roleAssignmentName: string, options?: Models.RoleAssignmentsDeleteMethodOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { scope, @@ -131,7 +130,7 @@ export class RoleAssignments { } /** - * Creates a role assignment. + * Create a role assignment. * @param 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, @@ -188,7 +187,7 @@ export class RoleAssignments { * @param [options] The optional parameters * @returns Promise */ - get(scope: string, roleAssignmentName: string, options?: msRest.RequestOptionsBase): Promise; + get(scope: string, roleAssignmentName: string, options?: Models.RoleAssignmentsGetOptionalParams): Promise; /** * @param scope The scope of the role assignment. * @param roleAssignmentName The name of the role assignment to get. @@ -201,8 +200,8 @@ export class RoleAssignments { * @param options The optional parameters * @param callback The callback */ - get(scope: string, roleAssignmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(scope: string, roleAssignmentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get(scope: string, roleAssignmentName: string, options: Models.RoleAssignmentsGetOptionalParams, callback: msRest.ServiceCallback): void; + get(scope: string, roleAssignmentName: string, options?: Models.RoleAssignmentsGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { scope, @@ -214,12 +213,12 @@ export class RoleAssignments { } /** - * Deletes a role assignment. + * Delete a role assignment. * @param roleId The ID of the role assignment to delete. * @param [options] The optional parameters * @returns Promise */ - deleteById(roleId: string, options?: msRest.RequestOptionsBase): Promise; + deleteById(roleId: string, options?: Models.RoleAssignmentsDeleteByIdOptionalParams): Promise; /** * @param roleId The ID of the role assignment to delete. * @param callback The callback @@ -230,8 +229,8 @@ export class RoleAssignments { * @param options The optional parameters * @param callback The callback */ - deleteById(roleId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteById(roleId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + deleteById(roleId: string, options: Models.RoleAssignmentsDeleteByIdOptionalParams, callback: msRest.ServiceCallback): void; + deleteById(roleId: string, options?: Models.RoleAssignmentsDeleteByIdOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { roleId, @@ -279,7 +278,7 @@ export class RoleAssignments { * @param [options] The optional parameters * @returns Promise */ - getById(roleId: string, options?: msRest.RequestOptionsBase): Promise; + getById(roleId: string, options?: Models.RoleAssignmentsGetByIdOptionalParams): Promise; /** * @param roleId The ID of the role assignment to get. * @param callback The callback @@ -290,8 +289,8 @@ export class RoleAssignments { * @param options The optional parameters * @param callback The callback */ - getById(roleId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getById(roleId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getById(roleId: string, options: Models.RoleAssignmentsGetByIdOptionalParams, callback: msRest.ServiceCallback): void; + getById(roleId: string, options?: Models.RoleAssignmentsGetByIdOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { roleId, @@ -354,12 +353,12 @@ export class RoleAssignments { } /** - * Gets role assignments for a resource. + * List role assignments for a resource. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters * @returns Promise */ - listForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listForResourceNext(nextPageLink: string, options?: Models.RoleAssignmentsListForResourceNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -370,8 +369,8 @@ export class RoleAssignments { * @param options The optional parameters * @param callback The callback */ - listForResourceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listForResourceNext(nextPageLink: string, options: Models.RoleAssignmentsListForResourceNextOptionalParams, callback: msRest.ServiceCallback): void; + listForResourceNext(nextPageLink: string, options?: Models.RoleAssignmentsListForResourceNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -382,12 +381,12 @@ export class RoleAssignments { } /** - * Gets role assignments for a resource group. + * List role assignments for a resource group. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters * @returns Promise */ - listForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listForResourceGroupNext(nextPageLink: string, options?: Models.RoleAssignmentsListForResourceGroupNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -398,8 +397,8 @@ export class RoleAssignments { * @param options The optional parameters * @param callback The callback */ - listForResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listForResourceGroupNext(nextPageLink: string, options: Models.RoleAssignmentsListForResourceGroupNextOptionalParams, callback: msRest.ServiceCallback): void; + listForResourceGroupNext(nextPageLink: string, options?: Models.RoleAssignmentsListForResourceGroupNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -415,7 +414,7 @@ export class RoleAssignments { * @param [options] The optional parameters * @returns Promise */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listNext(nextPageLink: string, options?: Models.RoleAssignmentsListNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -426,8 +425,8 @@ export class RoleAssignments { * @param options The optional parameters * @param callback The callback */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listNext(nextPageLink: string, options: Models.RoleAssignmentsListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.RoleAssignmentsListNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -443,7 +442,7 @@ export class RoleAssignments { * @param [options] The optional parameters * @returns Promise */ - listForScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listForScopeNext(nextPageLink: string, options?: Models.RoleAssignmentsListForScopeNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -454,8 +453,8 @@ export class RoleAssignments { * @param options The optional parameters * @param callback The callback */ - listForScopeNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listForScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listForScopeNext(nextPageLink: string, options: Models.RoleAssignmentsListForScopeNextOptionalParams, callback: msRest.ServiceCallback): void; + listForScopeNext(nextPageLink: string, options?: Models.RoleAssignmentsListForScopeNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -481,7 +480,8 @@ const listForResourceOperationSpec: msRest.OperationSpec = { ], queryParameters: [ Parameters.filter, - Parameters.apiVersion3 + Parameters.apiVersion, + Parameters.tenantId ], headerParameters: [ Parameters.acceptLanguage @@ -491,7 +491,7 @@ const listForResourceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignmentListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -506,7 +506,8 @@ const listForResourceGroupOperationSpec: msRest.OperationSpec = { ], queryParameters: [ Parameters.filter, - Parameters.apiVersion3 + Parameters.apiVersion, + Parameters.tenantId ], headerParameters: [ Parameters.acceptLanguage @@ -516,7 +517,7 @@ const listForResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignmentListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -530,7 +531,8 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { Parameters.roleAssignmentName ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion, + Parameters.tenantId ], headerParameters: [ Parameters.acceptLanguage @@ -539,8 +541,9 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.RoleAssignment }, + 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -554,7 +557,7 @@ const createOperationSpec: msRest.OperationSpec = { Parameters.roleAssignmentName ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -571,7 +574,7 @@ const createOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignment }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -585,7 +588,8 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.roleAssignmentName ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion, + Parameters.tenantId ], headerParameters: [ Parameters.acceptLanguage @@ -595,7 +599,7 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignment }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -608,7 +612,8 @@ const deleteByIdOperationSpec: msRest.OperationSpec = { Parameters.roleId ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion, + Parameters.tenantId ], headerParameters: [ Parameters.acceptLanguage @@ -617,8 +622,9 @@ const deleteByIdOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.RoleAssignment }, + 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -631,7 +637,7 @@ const createByIdOperationSpec: msRest.OperationSpec = { Parameters.roleId ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -648,7 +654,7 @@ const createByIdOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignment }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -661,7 +667,8 @@ const getByIdOperationSpec: msRest.OperationSpec = { Parameters.roleId ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion, + Parameters.tenantId ], headerParameters: [ Parameters.acceptLanguage @@ -671,7 +678,7 @@ const getByIdOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignment }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -685,7 +692,8 @@ const listOperationSpec: msRest.OperationSpec = { ], queryParameters: [ Parameters.filter, - Parameters.apiVersion3 + Parameters.apiVersion, + Parameters.tenantId ], headerParameters: [ Parameters.acceptLanguage @@ -695,7 +703,7 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignmentListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -709,7 +717,8 @@ const listForScopeOperationSpec: msRest.OperationSpec = { ], queryParameters: [ Parameters.filter, - Parameters.apiVersion3 + Parameters.apiVersion, + Parameters.tenantId ], headerParameters: [ Parameters.acceptLanguage @@ -719,7 +728,7 @@ const listForScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignmentListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -732,6 +741,11 @@ const listForResourceNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion, + Parameters.tenantId + ], headerParameters: [ Parameters.acceptLanguage ], @@ -740,7 +754,7 @@ const listForResourceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignmentListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -753,6 +767,11 @@ const listForResourceGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion, + Parameters.tenantId + ], headerParameters: [ Parameters.acceptLanguage ], @@ -761,7 +780,7 @@ const listForResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignmentListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -774,6 +793,11 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion, + Parameters.tenantId + ], headerParameters: [ Parameters.acceptLanguage ], @@ -782,7 +806,7 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignmentListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -795,6 +819,11 @@ const listForScopeNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion, + Parameters.tenantId + ], headerParameters: [ Parameters.acceptLanguage ], @@ -803,7 +832,7 @@ const listForScopeNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignmentListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer diff --git a/sdk/authorization/arm-authorization/src/operations/roleDefinitions.ts b/sdk/authorization/arm-authorization/src/operations/roleDefinitions.ts deleted file mode 100644 index de7a923fffb2..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/roleDefinitions.ts +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/roleDefinitionsMappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; - -/** Class representing a RoleDefinitions. */ -export class RoleDefinitions { - private readonly client: AuthorizationManagementClientContext; - - /** - * Create a RoleDefinitions. - * @param {AuthorizationManagementClientContext} client Reference to the service client. - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * Deletes a role definition. - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition to delete. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(scope: string, roleDefinitionId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition to delete. - * @param callback The callback - */ - deleteMethod(scope: string, roleDefinitionId: string, callback: msRest.ServiceCallback): void; - /** - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition to delete. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(scope: string, roleDefinitionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(scope: string, roleDefinitionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - scope, - roleDefinitionId, - options - }, - deleteMethodOperationSpec, - callback) as Promise; - } - - /** - * Get role definition by name (GUID). - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param [options] The optional parameters - * @returns Promise - */ - get(scope: string, roleDefinitionId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param callback The callback - */ - get(scope: string, roleDefinitionId: string, callback: msRest.ServiceCallback): void; - /** - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param options The optional parameters - * @param callback The callback - */ - get(scope: string, roleDefinitionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(scope: string, roleDefinitionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - scope, - roleDefinitionId, - options - }, - getOperationSpec, - callback) as Promise; - } - - /** - * Creates or updates a role definition. - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param roleDefinition The values for the role definition. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(scope: string, roleDefinitionId: string, roleDefinition: Models.RoleDefinition, options?: msRest.RequestOptionsBase): Promise; - /** - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param roleDefinition The values for the role definition. - * @param callback The callback - */ - createOrUpdate(scope: string, roleDefinitionId: string, roleDefinition: Models.RoleDefinition, callback: msRest.ServiceCallback): void; - /** - * @param scope The scope of the role definition. - * @param roleDefinitionId The ID of the role definition. - * @param roleDefinition The values for the role definition. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(scope: string, roleDefinitionId: string, roleDefinition: Models.RoleDefinition, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(scope: string, roleDefinitionId: string, roleDefinition: Models.RoleDefinition, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - scope, - roleDefinitionId, - roleDefinition, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; - } - - /** - * Get all role definitions that are applicable at scope and above. - * @param scope The scope of the role definition. - * @param [options] The optional parameters - * @returns Promise - */ - list(scope: string, options?: Models.RoleDefinitionsListOptionalParams): Promise; - /** - * @param scope The scope of the role definition. - * @param callback The callback - */ - list(scope: string, callback: msRest.ServiceCallback): void; - /** - * @param scope The scope of the role definition. - * @param options The optional parameters - * @param callback The callback - */ - list(scope: string, options: Models.RoleDefinitionsListOptionalParams, callback: msRest.ServiceCallback): void; - list(scope: string, options?: Models.RoleDefinitionsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - scope, - options - }, - listOperationSpec, - callback) as Promise; - } - - /** - * Gets a role definition by ID. - * @param roleId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for - * subscription level role definitions, or - * /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant level role - * definitions. - * @param [options] The optional parameters - * @returns Promise - */ - getById(roleId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param roleId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for - * subscription level role definitions, or - * /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant level role - * definitions. - * @param callback The callback - */ - getById(roleId: string, callback: msRest.ServiceCallback): void; - /** - * @param roleId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for - * subscription level role definitions, or - * /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant level role - * definitions. - * @param options The optional parameters - * @param callback The callback - */ - getById(roleId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getById(roleId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - roleId, - options - }, - getByIdOperationSpec, - callback) as Promise; - } - - /** - * Get all role definitions that are applicable at scope and above. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}", - urlParameters: [ - Parameters.scope, - Parameters.roleDefinitionId - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.RoleDefinition - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}", - urlParameters: [ - Parameters.scope, - Parameters.roleDefinitionId - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.RoleDefinition - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}", - urlParameters: [ - Parameters.scope, - Parameters.roleDefinitionId - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "roleDefinition", - mapper: { - ...Mappers.RoleDefinition, - required: true - } - }, - responses: { - 201: { - bodyMapper: Mappers.RoleDefinition - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "{scope}/providers/Microsoft.Authorization/roleDefinitions", - urlParameters: [ - Parameters.scope - ], - queryParameters: [ - Parameters.filter, - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.RoleDefinitionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const getByIdOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "{roleId}", - urlParameters: [ - Parameters.roleId - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.RoleDefinition - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.RoleDefinitionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; diff --git a/sdk/authorization/arm-authorization/tsconfig.json b/sdk/authorization/arm-authorization/tsconfig.json index 58429b90531b..422b584abd5e 100644 --- a/sdk/authorization/arm-authorization/tsconfig.json +++ b/sdk/authorization/arm-authorization/tsconfig.json @@ -9,7 +9,7 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6","dom"], + "lib": ["es6", "dom"], "declaration": true, "outDir": "./esm", "importHelpers": true