diff --git a/sdk/authorization/arm-authorization/LICENSE.txt b/sdk/authorization/arm-authorization/LICENSE.txt index b73b4a1293c3..ea8fb1516028 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) 2020 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..f4b83cda9194 100644 --- a/sdk/authorization/arm-authorization/README.md +++ b/sdk/authorization/arm-authorization/README.md @@ -15,36 +15,42 @@ npm install @azure/arm-authorization ### How to use -#### nodejs - Authentication, client creation and list classicAdministrators as an example written in TypeScript. +#### nodejs - Authentication, 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 -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { interactiveLogin } = require("@azure/ms-rest-nodeauth"); - +```typescript +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; +import { AuthorizationManagementClient, AuthorizationManagementModels, AuthorizationManagementMappers } from "@azure/arm-authorization"; 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 +63,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 +76,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 +108,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..97e514a0c02d 100644 --- a/sdk/authorization/arm-authorization/rollup.config.js +++ b/sdk/authorization/arm-authorization/rollup.config.js @@ -29,7 +29,7 @@ const config = { */` }, 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..a70ff2e740fe 100644 --- a/sdk/authorization/arm-authorization/src/authorizationManagementClient.ts +++ b/sdk/authorization/arm-authorization/src/authorizationManagementClient.ts @@ -17,13 +17,7 @@ import { AuthorizationManagementClientContext } from "./authorizationManagementC class AuthorizationManagementClient extends AuthorizationManagementClientContext { // Operation groups - classicAdministrators: operations.ClassicAdministrators; - globalAdministrator: operations.GlobalAdministrator; - providerOperationsMetadata: operations.ProviderOperationsMetadataOperations; roleAssignments: operations.RoleAssignments; - permissions: operations.Permissions; - roleDefinitions: operations.RoleDefinitions; - denyAssignments: operations.DenyAssignments; /** * Initializes a new instance of the AuthorizationManagementClient class. @@ -33,13 +27,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..b42d851d0f3c 100644 --- a/sdk/authorization/arm-authorization/src/authorizationManagementClientContext.ts +++ b/sdk/authorization/arm-authorization/src/authorizationManagementClientContext.ts @@ -18,6 +18,7 @@ const packageVersion = "8.3.3"; export class AuthorizationManagementClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; subscriptionId: string; + apiVersion?: string; /** * Initializes a new instance of the AuthorizationManagementClient class. @@ -43,6 +44,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..a8d564e70fd6 100644 --- a/sdk/authorization/arm-authorization/src/models/index.ts +++ b/sdk/authorization/arm-authorization/src/models/index.ts @@ -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 */ @@ -163,980 +59,147 @@ export interface RoleAssignment { /** * The principal type of the assigned principal ID. Possible values include: 'User', 'Group', * 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', - * 'DirectoryObjectOrGroup', 'Everyone' - */ - principalType?: PrincipalType; - /** - * 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' - */ - principalType?: PrincipalType; - /** - * The delegation flag used for creating a role assignment - */ - canDelegate?: boolean; -} - -/** - * Role Definitions filter - */ -export interface RoleDefinitionFilter { - /** - * Returns role definition with the specific name. - */ - roleName?: string; - /** - * Returns role definition with the specific type. - */ - type?: string; -} - -/** - * Role definition permissions. - */ -export interface Permission { - /** - * Allowed actions. - */ - actions?: string[]; - /** - * Denied actions. - */ - notActions?: string[]; - /** - * Allowed Data actions. - */ - dataActions?: string[]; - /** - * Denied Data actions. - */ - notDataActions?: string[]; -} - -/** - * Role definition. - */ -export interface RoleDefinition { - /** - * The role definition ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * The role definition name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * The role definition type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * The role name. - */ - roleName?: string; - /** - * The role definition description. - */ - 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. - */ - notActions?: string[]; - /** - * Data actions to which the deny assignment does not grant access. - */ - dataActions?: string[]; - /** - * Data actions to exclude from that the deny assignment does not grant access. - */ - notDataActions?: string[]; -} - -/** - * Deny assignment principal. - */ -export interface Principal { - /** - * 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. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: 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. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; -} - -/** - * Deny Assignment - */ -export interface DenyAssignment { - /** - * The deny assignment ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * The deny assignment name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * The deny assignment type. - * **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[]; - /** - * Specifies whether this deny assignment was created by Azure and cannot be edited or deleted. - */ - isSystemProtected?: boolean; -} - -/** - * Optional Parameters. - */ -export interface ProviderOperationsMetadataGetOptionalParams extends msRest.RequestOptionsBase { - /** - * Specifies whether to expand the values. Default value: 'resourceTypes'. - */ - expand?: string; -} - -/** - * Optional Parameters. - */ -export interface ProviderOperationsMetadataListOptionalParams extends msRest.RequestOptionsBase { - /** - * Specifies whether to expand the values. Default value: 'resourceTypes'. - */ - expand?: string; -} - -/** - * Optional Parameters. - */ -export interface RoleAssignmentsListForResourceOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. Use $filter=atScope() to return all role assignments at - * or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above - * or below the scope for the specified principal. - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface RoleAssignmentsListForResourceGroupOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. Use $filter=atScope() to return all role assignments at - * or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above - * or below the scope for the specified principal. - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface RoleAssignmentsListOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. Use $filter=atScope() to return all role assignments at - * or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above - * or below the scope for the specified principal. - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface RoleAssignmentsListForScopeOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. Use $filter=atScope() to return all role assignments at - * or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above - * or below the scope for the specified principal. - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface RoleDefinitionsListOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. Use atScopeAndBelow filter to search below the given - * scope as well. - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface DenyAssignmentsListForResourceOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at - * or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by - * name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, - * above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq - * '{id}' to return all deny assignments at, above and below the scope for the specified - * principal. This filter is different from the principalId filter as it returns not only those - * deny assignments that contain the specified principal is the Principals list but also those - * deny assignments that contain the specified principal is the ExcludePrincipals list. - * Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and - * description properties are returned. - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface DenyAssignmentsListForResourceGroupOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at - * or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by - * name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, - * above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq - * '{id}' to return all deny assignments at, above and below the scope for the specified - * principal. This filter is different from the principalId filter as it returns not only those - * deny assignments that contain the specified principal is the Principals list but also those - * deny assignments that contain the specified principal is the ExcludePrincipals list. - * Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and - * description properties are returned. - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface DenyAssignmentsListOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at - * or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by - * name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, - * above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq - * '{id}' to return all deny assignments at, above and below the scope for the specified - * principal. This filter is different from the principalId filter as it returns not only those - * deny assignments that contain the specified principal is the Principals list but also those - * deny assignments that contain the specified principal is the ExcludePrincipals list. - * Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and - * description properties are returned. - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface DenyAssignmentsListForScopeOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at - * or above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by - * name at specified scope. Use $filter=principalId eq '{id}' to return all deny assignments at, - * above and below the scope for the specified principal. Use $filter=gdprExportPrincipalId eq - * '{id}' to return all deny assignments at, above and below the scope for the specified - * principal. This filter is different from the principalId filter as it returns not only those - * deny assignments that contain the specified principal is the Principals list but also those - * deny assignments that contain the specified principal is the ExcludePrincipals list. - * Additionally, when gdprExportPrincipalId filter is used, only the deny assignment name and - * description properties are returned. - */ - filter?: string; -} - -/** - * An interface representing AuthorizationManagementClientOptions. - */ -export interface AuthorizationManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; -} - -/** - * @interface - * ClassicAdministrator list result information. - * @extends Array - */ -export interface ClassicAdministratorListResult extends Array { - /** - * The URL to use for getting the next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * Provider operations metadata list - * @extends Array - */ -export interface ProviderOperationsMetadataListResult extends Array { - /** - * The URL to use for getting the next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * Role assignment list operation result. - * @extends Array - */ -export interface RoleAssignmentListResult extends Array { - /** - * The URL to use for getting the next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * Permissions information. - * @extends Array - */ -export interface PermissionGetResult extends Array { - /** - * The URL to use for getting the next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * Role definition list operation result. - * @extends Array - */ -export interface RoleDefinitionListResult extends Array { - /** - * The URL to use for getting the next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * Deny assignment list operation result. - * @extends Array - */ -export interface DenyAssignmentListResult extends Array { - /** - * The URL to use for getting the next set of results. - */ - nextLink?: string; -} - -/** - * Defines values for PrincipalType. - * Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', - * 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', 'DirectoryObjectOrGroup', - * 'Everyone' - * @readonly - * @enum {string} - */ -export type PrincipalType = 'User' | 'Group' | 'ServicePrincipal' | 'Unknown' | 'DirectoryRoleTemplate' | 'ForeignGroup' | 'Application' | 'MSI' | 'DirectoryObjectOrGroup' | 'Everyone'; - -/** - * Contains response data for the list operation. - */ -export type ClassicAdministratorsListResponse = ClassicAdministratorListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ClassicAdministratorListResult; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type ClassicAdministratorsListNextResponse = ClassicAdministratorListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ClassicAdministratorListResult; - }; -}; - -/** - * Contains response data for the get operation. - */ -export type ProviderOperationsMetadataGetResponse = ProviderOperationsMetadata & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProviderOperationsMetadata; - }; -}; - -/** - * Contains response data for the list operation. - */ -export type ProviderOperationsMetadataListResponse = ProviderOperationsMetadataListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProviderOperationsMetadataListResult; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type ProviderOperationsMetadataListNextResponse = ProviderOperationsMetadataListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ProviderOperationsMetadataListResult; - }; -}; - -/** - * Contains response data for the listForResource operation. - */ -export type RoleAssignmentsListForResourceResponse = RoleAssignmentListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; - -/** - * Contains response data for the listForResourceGroup operation. - */ -export type RoleAssignmentsListForResourceGroupResponse = RoleAssignmentListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; - -/** - * Contains response data for the deleteMethod operation. - */ -export type RoleAssignmentsDeleteMethodResponse = RoleAssignment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignment; - }; -}; - -/** - * Contains response data for the create operation. - */ -export type RoleAssignmentsCreateResponse = RoleAssignment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignment; - }; -}; - -/** - * Contains response data for the get operation. - */ -export type RoleAssignmentsGetResponse = RoleAssignment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignment; - }; -}; - -/** - * Contains response data for the deleteById operation. - */ -export type RoleAssignmentsDeleteByIdResponse = RoleAssignment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignment; - }; -}; - -/** - * Contains response data for the createById operation. - */ -export type RoleAssignmentsCreateByIdResponse = RoleAssignment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignment; - }; -}; - -/** - * Contains response data for the getById operation. - */ -export type RoleAssignmentsGetByIdResponse = RoleAssignment & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignment; - }; -}; - -/** - * Contains response data for the list operation. - */ -export type RoleAssignmentsListResponse = RoleAssignmentListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; - -/** - * Contains response data for the listForScope operation. - */ -export type RoleAssignmentsListForScopeResponse = RoleAssignmentListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; - -/** - * Contains response data for the listForResourceNext operation. - */ -export type RoleAssignmentsListForResourceNextResponse = RoleAssignmentListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; - -/** - * Contains response data for the listForResourceGroupNext operation. - */ -export type RoleAssignmentsListForResourceGroupNextResponse = RoleAssignmentListResult & { + * 'DirectoryObjectOrGroup', 'Everyone' + */ + principalType?: PrincipalType; /** - * The underlying HTTP response. + * The Delegation flag for the role assignment */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; - -/** - * Contains response data for the listNext operation. - */ -export type RoleAssignmentsListNextResponse = RoleAssignmentListResult & { + canDelegate?: boolean; /** - * The underlying HTTP response. + * Description of role assignment */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; - -/** - * Contains response data for the listForScopeNext operation. - */ -export type RoleAssignmentsListForScopeNextResponse = RoleAssignmentListResult & { + description?: string; /** - * The underlying HTTP response. + * 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' */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleAssignmentListResult; - }; -}; + condition?: string; + /** + * Version of the condition. Currently accepted values are '1.0' or '2.0' + */ + conditionVersion?: string; +} /** - * Contains response data for the listForResourceGroup operation. + * Role assignment create parameters. */ -export type PermissionsListForResourceGroupResponse = PermissionGetResult & { +export interface RoleAssignmentCreateParameters { /** - * The underlying HTTP response. + * The role definition ID used in the role assignment. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PermissionGetResult; - }; -}; + 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' + */ + principalType?: PrincipalType; + /** + * The delegation flag used for creating a role assignment + */ + canDelegate?: boolean; + /** + * Description of role assignment + */ + description?: string; + /** + * The conditions on the role assignment + */ + condition?: string; + /** + * Version of the condition + */ + conditionVersion?: string; +} /** - * Contains response data for the listForResource operation. + * Optional Parameters. */ -export type PermissionsListForResourceResponse = PermissionGetResult & { +export interface RoleAssignmentsListForResourceOptionalParams extends msRest.RequestOptionsBase { /** - * The underlying HTTP response. + * The filter to apply on the operation. Use $filter=atScope() to return all role assignments at + * or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above + * or below the scope for the specified principal. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PermissionGetResult; - }; -}; + filter?: string; +} /** - * Contains response data for the listForResourceGroupNext operation. + * Optional Parameters. */ -export type PermissionsListForResourceGroupNextResponse = PermissionGetResult & { +export interface RoleAssignmentsListForResourceGroupOptionalParams extends msRest.RequestOptionsBase { /** - * The underlying HTTP response. + * The filter to apply on the operation. Use $filter=atScope() to return all role assignments at + * or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above + * or below the scope for the specified principal. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PermissionGetResult; - }; -}; + filter?: string; +} /** - * Contains response data for the listForResourceNext operation. + * Optional Parameters. */ -export type PermissionsListForResourceNextResponse = PermissionGetResult & { +export interface RoleAssignmentsListOptionalParams extends msRest.RequestOptionsBase { /** - * The underlying HTTP response. + * The filter to apply on the operation. Use $filter=atScope() to return all role assignments at + * or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above + * or below the scope for the specified principal. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PermissionGetResult; - }; -}; + filter?: string; +} /** - * Contains response data for the deleteMethod operation. + * Optional Parameters. */ -export type RoleDefinitionsDeleteMethodResponse = RoleDefinition & { +export interface RoleAssignmentsListForScopeOptionalParams extends msRest.RequestOptionsBase { /** - * The underlying HTTP response. + * The filter to apply on the operation. Use $filter=atScope() to return all role assignments at + * or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above + * or below the scope for the specified principal. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; + filter?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleDefinition; - }; -}; +/** + * An interface representing AuthorizationManagementClientOptions. + */ +export interface AuthorizationManagementClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} /** - * Contains response data for the get operation. + * @interface + * Role assignment list operation result. + * @extends Array */ -export type RoleDefinitionsGetResponse = RoleDefinition & { +export interface RoleAssignmentListResult extends Array { /** - * The underlying HTTP response. + * The URL to use for getting the next set of results. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; + nextLink?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleDefinition; - }; -}; +/** + * Defines values for PrincipalType. + * Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + * 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', 'DirectoryObjectOrGroup', + * 'Everyone' + * @readonly + * @enum {string} + */ +export type PrincipalType = 'User' | 'Group' | 'ServicePrincipal' | 'Unknown' | 'DirectoryRoleTemplate' | 'ForeignGroup' | 'Application' | 'MSI' | 'DirectoryObjectOrGroup' | 'Everyone'; /** - * Contains response data for the createOrUpdate operation. + * Contains response data for the listForResource operation. */ -export type RoleDefinitionsCreateOrUpdateResponse = RoleDefinition & { +export type RoleAssignmentsListForResourceResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1149,14 +212,14 @@ export type RoleDefinitionsCreateOrUpdateResponse = RoleDefinition & { /** * The response body as parsed JSON or XML */ - parsedBody: RoleDefinition; + parsedBody: RoleAssignmentListResult; }; }; /** - * Contains response data for the list operation. + * Contains response data for the listForResourceGroup operation. */ -export type RoleDefinitionsListResponse = RoleDefinitionListResult & { +export type RoleAssignmentsListForResourceGroupResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1169,14 +232,14 @@ export type RoleDefinitionsListResponse = RoleDefinitionListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: RoleDefinitionListResult; + parsedBody: RoleAssignmentListResult; }; }; /** - * Contains response data for the getById operation. + * Contains response data for the deleteMethod operation. */ -export type RoleDefinitionsGetByIdResponse = RoleDefinition & { +export type RoleAssignmentsDeleteMethodResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -1189,14 +252,14 @@ export type RoleDefinitionsGetByIdResponse = RoleDefinition & { /** * The response body as parsed JSON or XML */ - parsedBody: RoleDefinition; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the listNext operation. + * Contains response data for the create operation. */ -export type RoleDefinitionsListNextResponse = RoleDefinitionListResult & { +export type RoleAssignmentsCreateResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -1209,14 +272,14 @@ export type RoleDefinitionsListNextResponse = RoleDefinitionListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: RoleDefinitionListResult; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the listForResource operation. + * Contains response data for the get operation. */ -export type DenyAssignmentsListForResourceResponse = DenyAssignmentListResult & { +export type RoleAssignmentsGetResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -1229,14 +292,14 @@ export type DenyAssignmentsListForResourceResponse = DenyAssignmentListResult & /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the listForResourceGroup operation. + * Contains response data for the deleteById operation. */ -export type DenyAssignmentsListForResourceGroupResponse = DenyAssignmentListResult & { +export type RoleAssignmentsDeleteByIdResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -1249,14 +312,14 @@ export type DenyAssignmentsListForResourceGroupResponse = DenyAssignmentListResu /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the list operation. + * Contains response data for the createById operation. */ -export type DenyAssignmentsListResponse = DenyAssignmentListResult & { +export type RoleAssignmentsCreateByIdResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -1269,14 +332,14 @@ export type DenyAssignmentsListResponse = DenyAssignmentListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the get operation. + * Contains response data for the getById operation. */ -export type DenyAssignmentsGetResponse = DenyAssignment & { +export type RoleAssignmentsGetByIdResponse = RoleAssignment & { /** * The underlying HTTP response. */ @@ -1289,14 +352,14 @@ export type DenyAssignmentsGetResponse = DenyAssignment & { /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignment; + parsedBody: RoleAssignment; }; }; /** - * Contains response data for the getById operation. + * Contains response data for the list operation. */ -export type DenyAssignmentsGetByIdResponse = DenyAssignment & { +export type RoleAssignmentsListResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1309,14 +372,14 @@ export type DenyAssignmentsGetByIdResponse = DenyAssignment & { /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignment; + parsedBody: RoleAssignmentListResult; }; }; /** * Contains response data for the listForScope operation. */ -export type DenyAssignmentsListForScopeResponse = DenyAssignmentListResult & { +export type RoleAssignmentsListForScopeResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1329,14 +392,14 @@ export type DenyAssignmentsListForScopeResponse = DenyAssignmentListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignmentListResult; }; }; /** * Contains response data for the listForResourceNext operation. */ -export type DenyAssignmentsListForResourceNextResponse = DenyAssignmentListResult & { +export type RoleAssignmentsListForResourceNextResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1349,14 +412,14 @@ export type DenyAssignmentsListForResourceNextResponse = DenyAssignmentListResul /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignmentListResult; }; }; /** * Contains response data for the listForResourceGroupNext operation. */ -export type DenyAssignmentsListForResourceGroupNextResponse = DenyAssignmentListResult & { +export type RoleAssignmentsListForResourceGroupNextResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1369,14 +432,14 @@ export type DenyAssignmentsListForResourceGroupNextResponse = DenyAssignmentList /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignmentListResult; }; }; /** * Contains response data for the listNext operation. */ -export type DenyAssignmentsListNextResponse = DenyAssignmentListResult & { +export type RoleAssignmentsListNextResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1389,14 +452,14 @@ export type DenyAssignmentsListNextResponse = DenyAssignmentListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignmentListResult; }; }; /** * Contains response data for the listForScopeNext operation. */ -export type DenyAssignmentsListForScopeNextResponse = DenyAssignmentListResult & { +export type RoleAssignmentsListForScopeNextResponse = RoleAssignmentListResult & { /** * The underlying HTTP response. */ @@ -1409,6 +472,6 @@ export type DenyAssignmentsListForScopeNextResponse = DenyAssignmentListResult & /** * The response body as parsed JSON or XML */ - parsedBody: DenyAssignmentListResult; + parsedBody: RoleAssignmentListResult; }; }; diff --git a/sdk/authorization/arm-authorization/src/models/mappers.ts b/sdk/authorization/arm-authorization/src/models/mappers.ts index ee2cfdc282cc..b947c22200bc 100644 --- a/sdk/authorization/arm-authorization/src/models/mappers.ts +++ b/sdk/authorization/arm-authorization/src/models/mappers.ts @@ -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,6 +90,24 @@ export const RoleAssignment: msRest.CompositeMapper = { type: { name: "Boolean" } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + condition: { + serializedName: "properties.condition", + type: { + name: "String" + } + }, + conditionVersion: { + serializedName: "properties.conditionVersion", + type: { + name: "String" + } } } } @@ -304,426 +144,37 @@ export const RoleAssignmentCreateParameters: msRest.CompositeMapper = { type: { name: "Boolean" } - } - } - } -}; - -export const RoleDefinitionFilter: msRest.CompositeMapper = { - serializedName: "RoleDefinitionFilter", - type: { - name: "Composite", - className: "RoleDefinitionFilter", - modelProperties: { - roleName: { - serializedName: "roleName", - type: { - name: "String" - } }, - type: { - serializedName: "type", + description: { + serializedName: "properties.description", type: { name: "String" } - } - } - } -}; - -export const Permission: msRest.CompositeMapper = { - serializedName: "Permission", - type: { - name: "Composite", - className: "Permission", - modelProperties: { - actions: { - serializedName: "actions", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - notActions: { - serializedName: "notActions", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } }, - dataActions: { - serializedName: "dataActions", + condition: { + serializedName: "properties.condition", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - notDataActions: { - serializedName: "notDataActions", + conditionVersion: { + serializedName: "properties.conditionVersion", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } } } } }; -export const RoleDefinition: msRest.CompositeMapper = { - serializedName: "RoleDefinition", +export const RoleAssignmentListResult: msRest.CompositeMapper = { + serializedName: "RoleAssignmentListResult", type: { name: "Composite", - className: "RoleDefinition", + className: "RoleAssignmentListResult", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - type: { - readOnly: true, - serializedName: "type", - type: { - name: "String" - } - }, - roleName: { - serializedName: "properties.roleName", - type: { - name: "String" - } - }, - description: { - serializedName: "properties.description", - type: { - 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", - type: { - name: "String" - } - }, - principalId: { - serializedName: "principalId", - type: { - name: "String" - } - }, - gdprExportPrincipalId: { - serializedName: "gdprExportPrincipalId", - type: { - name: "String" - } - } - } - } -}; - -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", - type: { - name: "Composite", - className: "Principal", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - type: { - readOnly: true, - serializedName: "type", - type: { - name: "String" - } - } - } - } -}; - -export const DenyAssignment: msRest.CompositeMapper = { - serializedName: "DenyAssignment", - type: { - name: "Composite", - className: "DenyAssignment", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - type: { - readOnly: true, - serializedName: "type", - 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", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Principal" - } - } - } - }, - isSystemProtected: { - serializedName: "properties.isSystemProtected", - type: { - name: "Boolean" - } - } - } - } -}; - -export const ClassicAdministratorListResult: msRest.CompositeMapper = { - serializedName: "ClassicAdministratorListResult", - type: { - name: "Composite", - className: "ClassicAdministratorListResult", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClassicAdministrator" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const ProviderOperationsMetadataListResult: msRest.CompositeMapper = { - serializedName: "ProviderOperationsMetadataListResult", - type: { - name: "Composite", - className: "ProviderOperationsMetadataListResult", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ProviderOperationsMetadata" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const RoleAssignmentListResult: msRest.CompositeMapper = { - serializedName: "RoleAssignmentListResult", - type: { - name: "Composite", - className: "RoleAssignmentListResult", - modelProperties: { - value: { - serializedName: "", + value: { + serializedName: "", type: { name: "Sequence", element: { @@ -743,87 +194,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..98e371af4644 100644 --- a/sdk/authorization/arm-authorization/src/models/parameters.ts +++ b/sdk/authorization/arm-authorization/src/models/parameters.ts @@ -20,95 +20,11 @@ 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', type: { name: "String" } @@ -199,16 +115,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: { 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/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..88a5040463da 100644 --- a/sdk/authorization/arm-authorization/src/operations/index.ts +++ b/sdk/authorization/arm-authorization/src/operations/index.ts @@ -8,10 +8,4 @@ * 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..bc604e7226c2 100644 --- a/sdk/authorization/arm-authorization/src/operations/roleAssignments.ts +++ b/sdk/authorization/arm-authorization/src/operations/roleAssignments.ts @@ -481,7 +481,7 @@ const listForResourceOperationSpec: msRest.OperationSpec = { ], queryParameters: [ Parameters.filter, - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -506,7 +506,7 @@ const listForResourceGroupOperationSpec: msRest.OperationSpec = { ], queryParameters: [ Parameters.filter, - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -530,7 +530,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { Parameters.roleAssignmentName ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -554,7 +554,7 @@ const createOperationSpec: msRest.OperationSpec = { Parameters.roleAssignmentName ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -585,7 +585,7 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.roleAssignmentName ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -608,7 +608,7 @@ const deleteByIdOperationSpec: msRest.OperationSpec = { Parameters.roleId ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -631,7 +631,7 @@ const createByIdOperationSpec: msRest.OperationSpec = { Parameters.roleId ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -661,7 +661,7 @@ const getByIdOperationSpec: msRest.OperationSpec = { Parameters.roleId ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -685,7 +685,7 @@ const listOperationSpec: msRest.OperationSpec = { ], queryParameters: [ Parameters.filter, - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -709,7 +709,7 @@ const listForScopeOperationSpec: msRest.OperationSpec = { ], queryParameters: [ Parameters.filter, - Parameters.apiVersion3 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage 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