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 00b867f0df83..693441bfda0d 100644 --- a/sdk/authorization/arm-authorization/README.md +++ b/sdk/authorization/arm-authorization/README.md @@ -15,36 +15,41 @@ npm install @azure/arm-authorization ### How to use -#### nodejs - Authentication, client creation and list classicAdministrators as an example written in TypeScript. +#### nodejs - client creation and listForResource roleAssignments as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. ```bash -npm install @azure/ms-rest-nodeauth +npm install @azure/ms-rest-nodeauth@"^3.0.0" ``` ##### Sample code -```javascript +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package +```typescript +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { interactiveLogin } = require("@azure/ms-rest-nodeauth"); - const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; -interactiveLogin() - .then((creds) => { - const client = new AuthorizationManagementClient(creds, subscriptionId); - client.classicAdministrators.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); - }) - .catch((err) => { - console.error(err); +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new AuthorizationManagementClient(creds, subscriptionId); + const resourceGroupName = "testresourceGroupName"; + const resourceProviderNamespace = "testresourceProviderNamespace"; + const parentResourcePath = "testparentResourcePath"; + const resourceType = "testresourceType"; + const resourceName = "testresourceName"; + const filter = "testfilter"; + client.roleAssignments.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter).then((result) => { + console.log("The result is:"); + console.log(result); }); +}).catch((err) => { + console.error(err); +}); ``` -#### 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. ##### Install @azure/ms-rest-browserauth @@ -57,7 +62,6 @@ npm install @azure/ms-rest-browserauth See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - index.html - ```html @@ -71,27 +75,27 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to const subscriptionId = ""; const authManager = new msAuth.AuthManager({ clientId: "", - tenant: "", + tenant: "" }); authManager.finalizeLogin().then((res) => { if (!res.isLoggedIn) { // may cause redirects authManager.login(); } - const client = new Azure.ArmAuthorization.AuthorizationManagementClient( - res.creds, - subscriptionId - ); - client.classicAdministrators - .list() - .then((result) => { - console.log("The result is:"); - console.log(result); - }) - .catch((err) => { - console.log("An error occurred:"); - console.error(err); - }); + const client = new Azure.ArmAuthorization.AuthorizationManagementClient(res.creds, subscriptionId); + const resourceGroupName = "testresourceGroupName"; + const resourceProviderNamespace = "testresourceProviderNamespace"; + const parentResourcePath = "testparentResourcePath"; + const resourceType = "testresourceType"; + const resourceName = "testresourceName"; + const filter = "testfilter"; + client.roleAssignments.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter).then((result) => { + console.log("The result is:"); + console.log(result); + }).catch((err) => { + console.log("An error occurred:"); + console.error(err); + }); }); @@ -103,4 +107,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fauthorization%2Farm-authorization%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/authorization/arm-authorization/README.png) diff --git a/sdk/authorization/arm-authorization/package.json b/sdk/authorization/arm-authorization/package.json index e8c1c708f434..40b14bad2340 100644 --- a/sdk/authorization/arm-authorization/package.json +++ b/sdk/authorization/arm-authorization/package.json @@ -4,9 +4,9 @@ "description": "AuthorizationManagementClient Library with typescript type definitions for node.js and browser.", "version": "8.3.3", "dependencies": { - "@azure/ms-rest-azure-js": "^2.0.0", - "@azure/ms-rest-js": "^2.0.3", - "tslib": "^1.9.3" + "@azure/ms-rest-azure-js": "^2.0.1", + "@azure/ms-rest-js": "^2.0.4", + "tslib": "^1.10.0" }, "keywords": [ "node", @@ -20,11 +20,11 @@ "module": "./esm/authorizationManagementClient.js", "types": "./esm/authorizationManagementClient.d.ts", "devDependencies": { - "typescript": "^3.1.1", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", + "typescript": "^3.5.3", + "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 38d6e007d768..eae98b9b0dd8 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 @@ -17,13 +16,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. @@ -33,13 +26,7 @@ class AuthorizationManagementClient extends AuthorizationManagementClientContext */ constructor(credentials: msRest.ServiceClientCredentials, 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 2b1aabd7fe6c..e40a085e8959 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 @@ -17,6 +16,7 @@ const packageVersion = "8.3.3"; export class AuthorizationManagementClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; + apiVersion?: string; subscriptionId: string; /** @@ -43,6 +43,7 @@ export class AuthorizationManagementClientContext extends msRestAzure.AzureServi 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"; 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..28238ca706e5 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; } /** @@ -460,29 +255,11 @@ export interface RoleAssignmentsListForScopeOptionalParams extends msRest.Reques /** * 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 { +export interface RoleAssignmentsListForResourceNextOptionalParams 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. + * 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; } @@ -490,18 +267,11 @@ export interface DenyAssignmentsListForResourceOptionalParams extends msRest.Req /** * Optional Parameters. */ -export interface DenyAssignmentsListForResourceGroupOptionalParams extends msRest.RequestOptionsBase { +export interface RoleAssignmentsListForResourceGroupNextOptionalParams 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. + * 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; } @@ -509,18 +279,11 @@ export interface DenyAssignmentsListForResourceGroupOptionalParams extends msRes /** * Optional Parameters. */ -export interface DenyAssignmentsListOptionalParams extends msRest.RequestOptionsBase { +export interface RoleAssignmentsListNextOptionalParams 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. + * 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; } @@ -528,18 +291,11 @@ export interface DenyAssignmentsListOptionalParams extends msRest.RequestOptions /** * Optional Parameters. */ -export interface DenyAssignmentsListForScopeOptionalParams extends msRest.RequestOptionsBase { +export interface RoleAssignmentsListForScopeNextOptionalParams 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. + * 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; } @@ -551,30 +307,6 @@ export interface AuthorizationManagementClientOptions extends AzureServiceClient 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. @@ -587,42 +319,6 @@ export interface RoleAssignmentListResult extends Array { 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', @@ -634,9 +330,9 @@ export interface DenyAssignmentListResult extends Array { export type PrincipalType = 'User' | 'Group' | 'ServicePrincipal' | 'Unknown' | 'DirectoryRoleTemplate' | 'ForeignGroup' | 'Application' | 'MSI' | 'DirectoryObjectOrGroup' | 'Everyone'; /** - * Contains response data for the list operation. + * Contains response data for the listForResource operation. */ -export type ClassicAdministratorsListResponse = ClassicAdministratorListResult & { +export type RoleAssignmentsListForResourceResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -649,14 +345,14 @@ export type ClassicAdministratorsListResponse = ClassicAdministratorListResult & /** * The response body as parsed JSON or XML */ - parsedBody: ClassicAdministratorListResult; + parsedBody: RoleAssignmentListResult; }; }; /** - * Contains response data for the listNext operation. + * Contains response data for the listForResourceGroup operation. */ -export type ClassicAdministratorsListNextResponse = ClassicAdministratorListResult & { +export type RoleAssignmentsListForResourceGroupResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -669,14 +365,14 @@ export type ClassicAdministratorsListNextResponse = ClassicAdministratorListResu /** * The response body as parsed JSON or XML */ - parsedBody: ClassicAdministratorListResult; + parsedBody: RoleAssignmentListResult; }; }; /** - * Contains response data for the get operation. + * Contains response data for the deleteMethod operation. */ -export type ProviderOperationsMetadataGetResponse = ProviderOperationsMetadata & { +export type RoleAssignmentsDeleteMethodResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -689,14 +385,14 @@ export type ProviderOperationsMetadataGetResponse = ProviderOperationsMetadata & /** * The response body as parsed JSON or XML */ - parsedBody: ProviderOperationsMetadata; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the list operation. + * Contains response data for the create operation. */ -export type ProviderOperationsMetadataListResponse = ProviderOperationsMetadataListResult & { +export type RoleAssignmentsCreateResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -709,14 +405,14 @@ export type ProviderOperationsMetadataListResponse = ProviderOperationsMetadataL /** * The response body as parsed JSON or XML */ - parsedBody: ProviderOperationsMetadataListResult; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the listNext operation. + * Contains response data for the get operation. */ -export type ProviderOperationsMetadataListNextResponse = ProviderOperationsMetadataListResult & { +export type RoleAssignmentsGetResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -729,14 +425,14 @@ export type ProviderOperationsMetadataListNextResponse = ProviderOperationsMetad /** * The response body as parsed JSON or XML */ - parsedBody: ProviderOperationsMetadataListResult; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the listForResource operation. + * Contains response data for the deleteById operation. */ -export type RoleAssignmentsListForResourceResponse = RoleAssignmentListResult & { +export type RoleAssignmentsDeleteByIdResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -749,14 +445,14 @@ export type RoleAssignmentsListForResourceResponse = RoleAssignmentListResult & /** * The response body as parsed JSON or XML */ - parsedBody: RoleAssignmentListResult; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the listForResourceGroup operation. + * Contains response data for the createById operation. */ -export type RoleAssignmentsListForResourceGroupResponse = RoleAssignmentListResult & { +export type RoleAssignmentsCreateByIdResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -769,107 +465,7 @@ export type RoleAssignmentsListForResourceGroupResponse = RoleAssignmentListResu /** * 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; + parsedBody: RoleAssignment; }; }; @@ -1012,403 +608,3 @@ export type RoleAssignmentsListForScopeNextResponse = RoleAssignmentListResult & parsedBody: RoleAssignmentListResult; }; }; - -/** - * Contains response data for the listForResourceGroup operation. - */ -export type PermissionsListForResourceGroupResponse = PermissionGetResult & { - /** - * 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: PermissionGetResult; - }; -}; - -/** - * Contains response data for the listForResource operation. - */ -export type PermissionsListForResourceResponse = PermissionGetResult & { - /** - * 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: PermissionGetResult; - }; -}; - -/** - * Contains response data for the listForResourceGroupNext operation. - */ -export type PermissionsListForResourceGroupNextResponse = PermissionGetResult & { - /** - * 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: PermissionGetResult; - }; -}; - -/** - * Contains response data for the listForResourceNext operation. - */ -export type PermissionsListForResourceNextResponse = PermissionGetResult & { - /** - * 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: PermissionGetResult; - }; -}; - -/** - * Contains response data for the deleteMethod operation. - */ -export type RoleDefinitionsDeleteMethodResponse = RoleDefinition & { - /** - * 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: RoleDefinition; - }; -}; - -/** - * Contains response data for the get operation. - */ -export type RoleDefinitionsGetResponse = RoleDefinition & { - /** - * 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: RoleDefinition; - }; -}; - -/** - * Contains response data for the createOrUpdate operation. - */ -export type RoleDefinitionsCreateOrUpdateResponse = RoleDefinition & { - /** - * 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: RoleDefinition; - }; -}; - -/** - * Contains response data for the list operation. - */ -export type RoleDefinitionsListResponse = RoleDefinitionListResult & { - /** - * 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: RoleDefinitionListResult; - }; -}; - -/** - * Contains response data for the getById operation. - */ -export type RoleDefinitionsGetByIdResponse = RoleDefinition & { - /** - * 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: RoleDefinition; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type RoleDefinitionsListNextResponse = RoleDefinitionListResult & { - /** - * 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: RoleDefinitionListResult; - }; -}; - -/** - * Contains response data for the listForResource operation. - */ -export type DenyAssignmentsListForResourceResponse = DenyAssignmentListResult & { - /** - * 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: DenyAssignmentListResult; - }; -}; - -/** - * Contains response data for the listForResourceGroup operation. - */ -export type DenyAssignmentsListForResourceGroupResponse = DenyAssignmentListResult & { - /** - * 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: DenyAssignmentListResult; - }; -}; - -/** - * Contains response data for the list operation. - */ -export type DenyAssignmentsListResponse = DenyAssignmentListResult & { - /** - * 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: DenyAssignmentListResult; - }; -}; - -/** - * Contains response data for the get operation. - */ -export type DenyAssignmentsGetResponse = DenyAssignment & { - /** - * 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: DenyAssignment; - }; -}; - -/** - * Contains response data for the getById operation. - */ -export type DenyAssignmentsGetByIdResponse = DenyAssignment & { - /** - * 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: DenyAssignment; - }; -}; - -/** - * Contains response data for the listForScope operation. - */ -export type DenyAssignmentsListForScopeResponse = DenyAssignmentListResult & { - /** - * 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: DenyAssignmentListResult; - }; -}; - -/** - * Contains response data for the listForResourceNext operation. - */ -export type DenyAssignmentsListForResourceNextResponse = DenyAssignmentListResult & { - /** - * 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: DenyAssignmentListResult; - }; -}; - -/** - * Contains response data for the listForResourceGroupNext operation. - */ -export type DenyAssignmentsListForResourceGroupNextResponse = DenyAssignmentListResult & { - /** - * 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: DenyAssignmentListResult; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type DenyAssignmentsListNextResponse = DenyAssignmentListResult & { - /** - * 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: DenyAssignmentListResult; - }; -}; - -/** - * Contains response data for the listForScopeNext operation. - */ -export type DenyAssignmentsListForScopeNextResponse = DenyAssignmentListResult & { - /** - * 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: DenyAssignmentListResult; - }; -}; 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..d3c84211db18 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,11 @@ export const resourceGroupName: msRest.OperationURLParameter = { mapper: { required: true, serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, type: { name: "String" } @@ -199,16 +122,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 +149,9 @@ export const subscriptionId: msRest.OperationURLParameter = { mapper: { required: true, serializedName: "subscriptionId", + constraints: { + MinLength: 1 + }, 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..8e1ef91096cb 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,7 +98,7 @@ 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 @@ -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, @@ -214,7 +213,7 @@ 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 @@ -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,7 @@ const listForResourceOperationSpec: msRest.OperationSpec = { ], queryParameters: [ Parameters.filter, - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -491,7 +490,7 @@ const listForResourceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignmentListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -506,7 +505,7 @@ const listForResourceGroupOperationSpec: msRest.OperationSpec = { ], queryParameters: [ Parameters.filter, - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -516,7 +515,7 @@ const listForResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignmentListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -530,7 +529,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { Parameters.roleAssignmentName ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -539,8 +538,9 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.RoleAssignment }, + 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -554,7 +554,7 @@ const createOperationSpec: msRest.OperationSpec = { Parameters.roleAssignmentName ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -571,7 +571,7 @@ const createOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignment }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -585,7 +585,7 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.roleAssignmentName ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -595,7 +595,7 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignment }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -608,7 +608,7 @@ const deleteByIdOperationSpec: msRest.OperationSpec = { Parameters.roleId ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -617,8 +617,9 @@ const deleteByIdOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.RoleAssignment }, + 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -631,7 +632,7 @@ const createByIdOperationSpec: msRest.OperationSpec = { Parameters.roleId ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -648,7 +649,7 @@ const createByIdOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignment }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -661,7 +662,7 @@ const getByIdOperationSpec: msRest.OperationSpec = { Parameters.roleId ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -671,7 +672,7 @@ const getByIdOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignment }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -685,7 +686,7 @@ const listOperationSpec: msRest.OperationSpec = { ], queryParameters: [ Parameters.filter, - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -695,7 +696,7 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignmentListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -709,7 +710,7 @@ const listForScopeOperationSpec: msRest.OperationSpec = { ], queryParameters: [ Parameters.filter, - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -719,7 +720,7 @@ const listForScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignmentListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -732,6 +733,10 @@ const listForResourceNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -740,7 +745,7 @@ const listForResourceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignmentListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -753,6 +758,10 @@ const listForResourceGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -761,7 +770,7 @@ const listForResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignmentListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -774,6 +783,10 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -782,7 +795,7 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RoleAssignmentListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -795,6 +808,10 @@ const listForScopeNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -803,7 +820,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