From 2d54ba9bfa8dd9e6558c523b76a425b987ab31ed Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 14 Sep 2020 20:06:29 +0000 Subject: [PATCH] Generated from c05daca5376949c1800f04878dea5656071cb748 --- sdk/policy/arm-policy/src/models/index.ts | 658 ++++++++++++++- sdk/policy/arm-policy/src/models/mappers.ts | 256 +++++- .../arm-policy/src/models/parameters.ts | 57 +- .../src/models/policyAssignmentsMappers.ts | 10 +- .../src/models/policyDefinitionsMappers.ts | 10 +- .../src/models/policyExemptionsMappers.ts | 31 + .../src/models/policySetDefinitionsMappers.ts | 10 +- sdk/policy/arm-policy/src/operations/index.ts | 1 + .../src/operations/policyAssignments.ts | 250 +++--- .../src/operations/policyDefinitions.ts | 152 +++- .../src/operations/policyExemptions.ts | 766 ++++++++++++++++++ .../src/operations/policySetDefinitions.ts | 150 +++- sdk/policy/arm-policy/src/policyClient.ts | 7 +- .../arm-policy/src/policyClientContext.ts | 10 +- 14 files changed, 2115 insertions(+), 253 deletions(-) create mode 100644 sdk/policy/arm-policy/src/models/policyExemptionsMappers.ts create mode 100644 sdk/policy/arm-policy/src/operations/policyExemptions.ts diff --git a/sdk/policy/arm-policy/src/models/index.ts b/sdk/policy/arm-policy/src/models/index.ts index a3c35f1d4fe8..8e47c5342ee5 100644 --- a/sdk/policy/arm-policy/src/models/index.ts +++ b/sdk/policy/arm-policy/src/models/index.ts @@ -28,9 +28,9 @@ export interface ErrorAdditionalInfo { } /** - * The resource management error response. + * The error object. */ -export interface ErrorResponse { +export interface CloudErrorError { /** * The error code. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -50,7 +50,7 @@ export interface ErrorResponse { * The error details. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly details?: ErrorResponse[]; + readonly details?: CloudError[]; /** * The error additional info. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -58,6 +58,16 @@ export interface ErrorResponse { readonly additionalInfo?: ErrorAdditionalInfo[]; } +/** + * The resource management error response. + */ +export interface CloudError { + /** + * The error object. + */ + error?: CloudErrorError; +} + /** * The value of a parameter. */ @@ -363,15 +373,156 @@ export interface PolicySetDefinition extends BaseResource { readonly type?: string; } +/** + * Metadata pertaining to creation and last modification of the resource. + */ +export interface SystemData { + /** + * The identity that created the resource. + */ + createdBy?: string; + /** + * The type of identity that created the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + createdByType?: CreatedByType; + /** + * The timestamp of resource creation (UTC). + */ + createdAt?: Date; + /** + * The identity that last modified the resource. + */ + lastModifiedBy?: string; + /** + * The type of identity that last modified the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + lastModifiedByType?: CreatedByType; + /** + * The type of identity that last modified the resource. + */ + lastModifiedAt?: Date; +} + +/** + * The policy exemption. + */ +export interface PolicyExemption extends BaseResource { + /** + * The ID of the policy assignment that is being exempted. + */ + policyAssignmentId: string; + /** + * The policy definition reference ID list when the associated policy assignment is an assignment + * of a policy set definition. + */ + policyDefinitionReferenceIds?: string[]; + /** + * The policy exemption category. Possible values are Waiver and Mitigated. Possible values + * include: 'Waiver', 'Mitigated' + */ + exemptionCategory: ExemptionCategory; + /** + * The expiration date and time (in UTC ISO 8601 format yyyy-MM-ddTHH:mm:ssZ) of the policy + * exemption. + */ + expiresOn?: Date; + /** + * The display name of the policy exemption. + */ + displayName?: string; + /** + * The description of the policy exemption. + */ + description?: string; + /** + * The policy exemption metadata. Metadata is an open ended object and is typically a collection + * of key value pairs. + */ + metadata?: any; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; +} + +/** + * An interface representing Resource. + */ +export interface Resource extends BaseResource { + /** + * Fully qualified resource Id for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The type of the resource. Ex- Microsoft.Compute/virtualMachines or + * Microsoft.Storage/storageAccounts. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + +/** + * The resource model definition for a ARM tracked top level resource + */ +export interface TrackedResource extends Resource { + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; + /** + * The geo-location where the resource lives + */ + location: string; +} + +/** + * The resource model definition for a Azure Resource Manager resource with an etag. + */ +export interface AzureEntityResource extends Resource { + /** + * Resource Etag. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly etag?: string; +} + +/** + * The resource model definition for a ARM proxy resource. It will have everything other than + * required location and tags + */ +export interface ProxyResource extends Resource { +} + /** * Optional Parameters. */ export interface PolicyAssignmentsListForResourceGroupOptionalParams extends msRest.RequestOptionsBase { /** - * The filter to apply on the operation. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no + * filtering is performed. If $filter=atScope() is provided, the returned list only includes all + * policy assignments that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the given scope. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value}. */ filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; } /** @@ -379,10 +530,43 @@ export interface PolicyAssignmentsListForResourceGroupOptionalParams extends msR */ export interface PolicyAssignmentsListForResourceOptionalParams extends msRest.RequestOptionsBase { /** - * The filter to apply on the operation. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no + * filtering is performed. If $filter=atScope() is provided, the returned list only includes all + * policy assignments that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the given scope. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyAssignmentsListForManagementGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no + * filtering is performed. If $filter=atScope() is provided, the returned list only includes all + * policy assignments that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the given scope. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value}. */ filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; } /** @@ -390,8 +574,235 @@ export interface PolicyAssignmentsListForResourceOptionalParams extends msRest.R */ export interface PolicyAssignmentsListOptionalParams extends msRest.RequestOptionsBase { /** - * The filter to apply on the operation. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no + * filtering is performed. If $filter=atScope() is provided, the returned list only includes all + * policy assignments that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the given scope. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyDefinitionsListOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, + * the returned list only includes all policy definitions whose type match the {value}. Possible + * policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq + * {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyDefinitionsListBuiltInOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, + * the returned list only includes all policy definitions whose type match the {value}. Possible + * policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq + * {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyDefinitionsListByManagementGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, + * the returned list only includes all policy definitions whose type match the {value}. Possible + * policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq + * {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicySetDefinitionsListOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy set definitions that at the given scope. If $filter='policyType -eq {value}' is + * provided, the returned list only includes all policy set definitions whose type match the + * {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy set + * definitions whose category match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicySetDefinitionsListBuiltInOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy set definitions that at the given scope. If $filter='policyType -eq {value}' is + * provided, the returned list only includes all policy set definitions whose type match the + * {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy set + * definitions whose category match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicySetDefinitionsListByManagementGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy set definitions that at the given scope. If $filter='policyType -eq {value}' is + * provided, the returned list only includes all policy set definitions whose type match the + * {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy set + * definitions whose category match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyExemptionsListOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not + * provided, no filtering is performed. If $filter is not provided, the unfiltered list includes + * all policy exemptions associated with the scope, including those that apply directly or apply + * from containing scopes. If $filter=atScope() is provided, the returned list only includes all + * policy exemptions that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy exemptions that at the given scope. If + * $filter=excludeExpired() is provided, the returned list only includes all policy exemptions + * that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq + * '{value}' is provided. the returned list only includes all policy exemptions that are + * associated with the give policyAssignmentId. + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface PolicyExemptionsListForResourceGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not + * provided, no filtering is performed. If $filter is not provided, the unfiltered list includes + * all policy exemptions associated with the scope, including those that apply directly or apply + * from containing scopes. If $filter=atScope() is provided, the returned list only includes all + * policy exemptions that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy exemptions that at the given scope. If + * $filter=excludeExpired() is provided, the returned list only includes all policy exemptions + * that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq + * '{value}' is provided. the returned list only includes all policy exemptions that are + * associated with the give policyAssignmentId. + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface PolicyExemptionsListForResourceOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not + * provided, no filtering is performed. If $filter is not provided, the unfiltered list includes + * all policy exemptions associated with the scope, including those that apply directly or apply + * from containing scopes. If $filter=atScope() is provided, the returned list only includes all + * policy exemptions that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy exemptions that at the given scope. If + * $filter=excludeExpired() is provided, the returned list only includes all policy exemptions + * that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq + * '{value}' is provided. the returned list only includes all policy exemptions that are + * associated with the give policyAssignmentId. + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface PolicyExemptionsListForManagementGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not + * provided, no filtering is performed. If $filter is not provided, the unfiltered list includes + * all policy exemptions associated with the scope, including those that apply directly or apply + * from containing scopes. If $filter=atScope() is provided, the returned list only includes all + * policy exemptions that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy exemptions that at the given scope. If + * $filter=excludeExpired() is provided, the returned list only includes all policy exemptions + * that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq + * '{value}' is provided. the returned list only includes all policy exemptions that are + * associated with the give policyAssignmentId. */ filter?: string; } @@ -439,6 +850,19 @@ export interface PolicySetDefinitionListResult extends Array + */ +export interface PolicyExemptionListResult extends Array { + /** + * The URL to use for getting the next set of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + /** * Defines values for EnforcementMode. * Possible values include: 'Default', 'DoNotEnforce' @@ -471,6 +895,22 @@ export type PolicyType = 'NotSpecified' | 'BuiltIn' | 'Custom' | 'Static'; */ export type ParameterType = 'String' | 'Array' | 'Object' | 'Boolean' | 'Integer' | 'Float' | 'DateTime'; +/** + * Defines values for ExemptionCategory. + * Possible values include: 'Waiver', 'Mitigated' + * @readonly + * @enum {string} + */ +export type ExemptionCategory = 'Waiver' | 'Mitigated'; + +/** + * Defines values for CreatedByType. + * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + * @readonly + * @enum {string} + */ +export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; + /** * Contains response data for the deleteMethod operation. */ @@ -1190,3 +1630,203 @@ export type PolicySetDefinitionsListByManagementGroupNextResponse = PolicySetDef parsedBody: PolicySetDefinitionListResult; }; }; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type PolicyExemptionsCreateOrUpdateResponse = PolicyExemption & { + /** + * 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: PolicyExemption; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PolicyExemptionsGetResponse = PolicyExemption & { + /** + * 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: PolicyExemption; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type PolicyExemptionsListResponse = PolicyExemptionListResult & { + /** + * 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: PolicyExemptionListResult; + }; +}; + +/** + * Contains response data for the listForResourceGroup operation. + */ +export type PolicyExemptionsListForResourceGroupResponse = PolicyExemptionListResult & { + /** + * 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: PolicyExemptionListResult; + }; +}; + +/** + * Contains response data for the listForResource operation. + */ +export type PolicyExemptionsListForResourceResponse = PolicyExemptionListResult & { + /** + * 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: PolicyExemptionListResult; + }; +}; + +/** + * Contains response data for the listForManagementGroup operation. + */ +export type PolicyExemptionsListForManagementGroupResponse = PolicyExemptionListResult & { + /** + * 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: PolicyExemptionListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type PolicyExemptionsListNextResponse = PolicyExemptionListResult & { + /** + * 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: PolicyExemptionListResult; + }; +}; + +/** + * Contains response data for the listForResourceGroupNext operation. + */ +export type PolicyExemptionsListForResourceGroupNextResponse = PolicyExemptionListResult & { + /** + * 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: PolicyExemptionListResult; + }; +}; + +/** + * Contains response data for the listForResourceNext operation. + */ +export type PolicyExemptionsListForResourceNextResponse = PolicyExemptionListResult & { + /** + * 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: PolicyExemptionListResult; + }; +}; + +/** + * Contains response data for the listForManagementGroupNext operation. + */ +export type PolicyExemptionsListForManagementGroupNextResponse = PolicyExemptionListResult & { + /** + * 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: PolicyExemptionListResult; + }; +}; diff --git a/sdk/policy/arm-policy/src/models/mappers.ts b/sdk/policy/arm-policy/src/models/mappers.ts index f00d602201e3..fecfedc32ae6 100644 --- a/sdk/policy/arm-policy/src/models/mappers.ts +++ b/sdk/policy/arm-policy/src/models/mappers.ts @@ -36,11 +36,11 @@ export const ErrorAdditionalInfo: msRest.CompositeMapper = { } }; -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", +export const CloudErrorError: msRest.CompositeMapper = { + serializedName: "CloudError_error", type: { name: "Composite", - className: "ErrorResponse", + className: "CloudErrorError", modelProperties: { code: { readOnly: true, @@ -71,7 +71,7 @@ export const ErrorResponse: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorResponse" + className: "CloudError" } } } @@ -93,6 +93,23 @@ export const ErrorResponse: msRest.CompositeMapper = { } }; +export const CloudError: msRest.CompositeMapper = { + serializedName: "CloudError", + type: { + name: "Composite", + className: "CloudError", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "CloudErrorError" + } + } + } + } +}; + export const ParameterValuesValue: msRest.CompositeMapper = { serializedName: "ParameterValuesValue", type: { @@ -606,6 +623,208 @@ export const PolicySetDefinition: msRest.CompositeMapper = { } }; +export const SystemData: msRest.CompositeMapper = { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const PolicyExemption: msRest.CompositeMapper = { + serializedName: "PolicyExemption", + type: { + name: "Composite", + className: "PolicyExemption", + modelProperties: { + policyAssignmentId: { + required: true, + serializedName: "properties.policyAssignmentId", + type: { + name: "String" + } + }, + policyDefinitionReferenceIds: { + serializedName: "properties.policyDefinitionReferenceIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + exemptionCategory: { + required: true, + serializedName: "properties.exemptionCategory", + type: { + name: "String" + } + }, + expiresOn: { + serializedName: "properties.expiresOn", + type: { + name: "DateTime" + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "Object" + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + 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" + } + } + } + } +}; + +export const TrackedResource: msRest.CompositeMapper = { + serializedName: "TrackedResource", + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const AzureEntityResource: msRest.CompositeMapper = { + serializedName: "AzureEntityResource", + type: { + name: "Composite", + className: "AzureEntityResource", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + export const PolicyAssignmentListResult: msRest.CompositeMapper = { serializedName: "PolicyAssignmentListResult", type: { @@ -689,3 +908,32 @@ export const PolicySetDefinitionListResult: msRest.CompositeMapper = { } } }; + +export const PolicyExemptionListResult: msRest.CompositeMapper = { + serializedName: "PolicyExemptionListResult", + type: { + name: "Composite", + className: "PolicyExemptionListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyExemption" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/policy/arm-policy/src/models/parameters.ts b/sdk/policy/arm-policy/src/models/parameters.ts index 2c6297682f08..b60f52dd5a07 100644 --- a/sdk/policy/arm-policy/src/models/parameters.ts +++ b/sdk/policy/arm-policy/src/models/parameters.ts @@ -20,30 +20,31 @@ export const acceptLanguage: msRest.OperationParameter = { } } }; -export const apiVersion: msRest.OperationQueryParameter = { +export const apiVersion0: msRest.OperationQueryParameter = { parameterPath: "apiVersion", mapper: { required: true, + isConstant: true, serializedName: "api-version", + defaultValue: '2020-03-01', type: { name: "String" } } }; -export const filter0: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "filter" - ], +export const apiVersion1: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - serializedName: "$filter", + required: true, + isConstant: true, + serializedName: "api-version", + defaultValue: '2020-07-01-preview', type: { name: "String" } - }, - skipEncoding: true + } }; -export const filter1: msRest.OperationQueryParameter = { +export const filter: msRest.OperationQueryParameter = { parameterPath: [ "options", "filter" @@ -53,16 +54,6 @@ export const filter1: msRest.OperationQueryParameter = { type: { name: "String" } - } -}; -export const filter2: msRest.OperationQueryParameter = { - parameterPath: "filter", - mapper: { - required: true, - serializedName: "$filter", - type: { - name: "String" - } }, skipEncoding: true }; @@ -129,6 +120,16 @@ export const policyDefinitionName: msRest.OperationURLParameter = { } } }; +export const policyExemptionName: msRest.OperationURLParameter = { + parameterPath: "policyExemptionName", + mapper: { + required: true, + serializedName: "policyExemptionName", + type: { + name: "String" + } + } +}; export const policySetDefinitionName: msRest.OperationURLParameter = { parameterPath: "policySetDefinitionName", mapper: { @@ -206,3 +207,19 @@ export const subscriptionId: msRest.OperationURLParameter = { } } }; +export const top: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "top" + ], + mapper: { + serializedName: "$top", + constraints: { + InclusiveMaximum: 1000, + InclusiveMinimum: 1 + }, + type: { + name: "Number" + } + } +}; diff --git a/sdk/policy/arm-policy/src/models/policyAssignmentsMappers.ts b/sdk/policy/arm-policy/src/models/policyAssignmentsMappers.ts index cc50c3e4450a..c44a4332e687 100644 --- a/sdk/policy/arm-policy/src/models/policyAssignmentsMappers.ts +++ b/sdk/policy/arm-policy/src/models/policyAssignmentsMappers.ts @@ -7,10 +7,11 @@ */ export { + AzureEntityResource, BaseResource, CloudError, + CloudErrorError, ErrorAdditionalInfo, - ErrorResponse, Identity, ParameterDefinitionsValue, ParameterDefinitionsValueMetadata, @@ -20,6 +21,11 @@ export { PolicyDefinition, PolicyDefinitionGroup, PolicyDefinitionReference, + PolicyExemption, PolicySetDefinition, - PolicySku + PolicySku, + ProxyResource, + Resource, + SystemData, + TrackedResource } from "../models/mappers"; diff --git a/sdk/policy/arm-policy/src/models/policyDefinitionsMappers.ts b/sdk/policy/arm-policy/src/models/policyDefinitionsMappers.ts index 0c34830d4dc7..6302c4c541bd 100644 --- a/sdk/policy/arm-policy/src/models/policyDefinitionsMappers.ts +++ b/sdk/policy/arm-policy/src/models/policyDefinitionsMappers.ts @@ -7,10 +7,11 @@ */ export { + AzureEntityResource, BaseResource, CloudError, + CloudErrorError, ErrorAdditionalInfo, - ErrorResponse, Identity, ParameterDefinitionsValue, ParameterDefinitionsValueMetadata, @@ -20,6 +21,11 @@ export { PolicyDefinitionGroup, PolicyDefinitionListResult, PolicyDefinitionReference, + PolicyExemption, PolicySetDefinition, - PolicySku + PolicySku, + ProxyResource, + Resource, + SystemData, + TrackedResource } from "../models/mappers"; diff --git a/sdk/policy/arm-policy/src/models/policyExemptionsMappers.ts b/sdk/policy/arm-policy/src/models/policyExemptionsMappers.ts new file mode 100644 index 000000000000..e317f4696de5 --- /dev/null +++ b/sdk/policy/arm-policy/src/models/policyExemptionsMappers.ts @@ -0,0 +1,31 @@ +/* + * 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 { + AzureEntityResource, + BaseResource, + CloudError, + CloudErrorError, + ErrorAdditionalInfo, + Identity, + ParameterDefinitionsValue, + ParameterDefinitionsValueMetadata, + ParameterValuesValue, + PolicyAssignment, + PolicyDefinition, + PolicyDefinitionGroup, + PolicyDefinitionReference, + PolicyExemption, + PolicyExemptionListResult, + PolicySetDefinition, + PolicySku, + ProxyResource, + Resource, + SystemData, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/policy/arm-policy/src/models/policySetDefinitionsMappers.ts b/sdk/policy/arm-policy/src/models/policySetDefinitionsMappers.ts index bccfd77f63f7..7fc712a92eeb 100644 --- a/sdk/policy/arm-policy/src/models/policySetDefinitionsMappers.ts +++ b/sdk/policy/arm-policy/src/models/policySetDefinitionsMappers.ts @@ -7,10 +7,11 @@ */ export { + AzureEntityResource, BaseResource, CloudError, + CloudErrorError, ErrorAdditionalInfo, - ErrorResponse, Identity, ParameterDefinitionsValue, ParameterDefinitionsValueMetadata, @@ -19,7 +20,12 @@ export { PolicyDefinition, PolicyDefinitionGroup, PolicyDefinitionReference, + PolicyExemption, PolicySetDefinition, PolicySetDefinitionListResult, - PolicySku + PolicySku, + ProxyResource, + Resource, + SystemData, + TrackedResource } from "../models/mappers"; diff --git a/sdk/policy/arm-policy/src/operations/index.ts b/sdk/policy/arm-policy/src/operations/index.ts index 8fab2c121e51..701f32bfda48 100644 --- a/sdk/policy/arm-policy/src/operations/index.ts +++ b/sdk/policy/arm-policy/src/operations/index.ts @@ -11,3 +11,4 @@ export * from "./policyAssignments"; export * from "./policyDefinitions"; export * from "./policySetDefinitions"; +export * from "./policyExemptions"; diff --git a/sdk/policy/arm-policy/src/operations/policyAssignments.ts b/sdk/policy/arm-policy/src/operations/policyAssignments.ts index 5faabeda2709..0eaed7f5d350 100644 --- a/sdk/policy/arm-policy/src/operations/policyAssignments.ts +++ b/sdk/policy/arm-policy/src/operations/policyAssignments.ts @@ -173,35 +173,41 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments associated with the given resource * group in the given subscription that match the optional given $filter. Valid values for $filter - * are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the - * unfiltered list includes all policy assignments associated with the resource group, including - * those that apply directly or apply from containing scopes, as well as any applied to resources - * contained within the resource group. If $filter=atScope() is provided, the returned list - * includes all policy assignments that apply to the resource group, which is everything in the - * unfiltered list except those applied to resources contained within the resource group. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value} that apply to the resource group. + * are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not + * provided, the unfiltered list includes all policy assignments associated with the resource + * group, including those that apply directly or apply from containing scopes, as well as any + * applied to resources contained within the resource group. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the resource group, which is + * everything in the unfiltered list except those applied to resources contained within the + * resource group. If $filter=atExactScope() is provided, the returned list only includes all + * policy assignments that at the resource group. If $filter=policyDefinitionId eq '{value}' is + * provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the resource group. * @summary Retrieves all policy assignments that apply to a resource group. * @param resourceGroupName The name of the resource group that contains policy assignments. + * @param subscriptionId The ID of the target subscription. * @param [options] The optional parameters * @returns Promise */ - listForResourceGroup(resourceGroupName: string, options?: Models.PolicyAssignmentsListForResourceGroupOptionalParams): Promise; + listForResourceGroup(resourceGroupName: string, subscriptionId: string, options?: Models.PolicyAssignmentsListForResourceGroupOptionalParams): Promise; /** * @param resourceGroupName The name of the resource group that contains policy assignments. + * @param subscriptionId The ID of the target subscription. * @param callback The callback */ - listForResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + listForResourceGroup(resourceGroupName: string, subscriptionId: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group that contains policy assignments. + * @param subscriptionId The ID of the target subscription. * @param options The optional parameters * @param callback The callback */ - listForResourceGroup(resourceGroupName: string, options: Models.PolicyAssignmentsListForResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; - listForResourceGroup(resourceGroupName: string, options?: Models.PolicyAssignmentsListForResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listForResourceGroup(resourceGroupName: string, subscriptionId: string, options: Models.PolicyAssignmentsListForResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listForResourceGroup(resourceGroupName: string, subscriptionId: string, options?: Models.PolicyAssignmentsListForResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, + subscriptionId, options }, listForResourceGroupOperationSpec, @@ -211,21 +217,22 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments associated with the specified * resource in the given resource group and subscription that match the optional given $filter. - * Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is - * not provided, the unfiltered list includes all policy assignments associated with the resource, - * including those that apply directly or from all containing scopes, as well as any applied to - * resources contained within the resource. If $filter=atScope() is provided, the returned list - * includes all policy assignments that apply to the resource, which is everything in the - * unfiltered list except those applied to resources contained within the resource. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value} that apply to the resource. Three - * parameters plus the resource name are used to identify a specific resource. If the resource is - * not part of a parent resource (the more common case), the parent resource path should not be - * provided (or provided as ''). For example a web app could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == - * 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all - * parameters should be provided. For example a virtual machine DNS name could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == + * Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments + * associated with the resource, including those that apply directly or from all containing scopes, + * as well as any applied to resources contained within the resource. If $filter=atScope() is + * provided, the returned list includes all policy assignments that apply to the resource, which is + * everything in the unfiltered list except those applied to resources contained within the + * resource. If $filter=atExactScope() is provided, the returned list only includes all policy + * assignments that at the resource level. If $filter=policyDefinitionId eq '{value}' is provided, + * the returned list includes all policy assignments of the policy definition whose id is {value} + * that apply to the resource. Three parameters plus the resource name are used to identify a + * specific resource. If the resource is not part of a parent resource (the more common case), the + * parent resource path should not be provided (or provided as ''). For example a web app could be + * specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', + * {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent + * resource, then all parameters should be provided. For example a virtual machine DNS name could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == * 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == * 'MyComputerName'). A convenient alternative to providing the namespace and type name separately * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', @@ -239,10 +246,11 @@ export class PolicyAssignments { * @param resourceType The resource type name. For example the type name of a web app is 'sites' * (from Microsoft.Web/sites). * @param resourceName The name of the resource. + * @param subscriptionId The ID of the target subscription. * @param [options] The optional parameters * @returns Promise */ - listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.PolicyAssignmentsListForResourceOptionalParams): Promise; + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, subscriptionId: string, options?: Models.PolicyAssignmentsListForResourceOptionalParams): Promise; /** * @param resourceGroupName The name of the resource group containing the resource. * @param resourceProviderNamespace The namespace of the resource provider. For example, the @@ -251,9 +259,10 @@ export class PolicyAssignments { * @param resourceType The resource type name. For example the type name of a web app is 'sites' * (from Microsoft.Web/sites). * @param resourceName The name of the resource. + * @param subscriptionId The ID of the target subscription. * @param callback The callback */ - listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, callback: msRest.ServiceCallback): void; + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, subscriptionId: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group containing the resource. * @param resourceProviderNamespace The namespace of the resource provider. For example, the @@ -262,11 +271,12 @@ export class PolicyAssignments { * @param resourceType The resource type name. For example the type name of a web app is 'sites' * (from Microsoft.Web/sites). * @param resourceName The name of the resource. + * @param subscriptionId The ID of the target subscription. * @param options The optional parameters * @param callback The callback */ - listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options: Models.PolicyAssignmentsListForResourceOptionalParams, callback: msRest.ServiceCallback): void; - listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.PolicyAssignmentsListForResourceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, subscriptionId: string, options: Models.PolicyAssignmentsListForResourceOptionalParams, callback: msRest.ServiceCallback): void; + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, subscriptionId: string, options?: Models.PolicyAssignmentsListForResourceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -274,6 +284,7 @@ export class PolicyAssignments { parentResourcePath, resourceType, resourceName, + subscriptionId, options }, listForResourceOperationSpec, @@ -282,42 +293,34 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments applicable to the management group - * that match the given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId - * eq '{value}''. If $filter=atScope() is provided, the returned list includes all policy - * assignments that are assigned to the management group or the management group's ancestors. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value} that apply to the management group. + * that match the given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or + * 'policyDefinitionId eq '{value}''. If $filter=atScope() is provided, the returned list includes + * all policy assignments that are assigned to the management group or the management group's + * ancestors. If $filter=atExactScope() is provided, the returned list only includes all policy + * assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is + * provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the management group. * @summary Retrieves all policy assignments that apply to a management group. * @param managementGroupId The ID of the management group. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. A filter is required when listing policy assignments at - * management group scope. * @param [options] The optional parameters * @returns Promise */ - listForManagementGroup(managementGroupId: string, filter: string, options?: msRest.RequestOptionsBase): Promise; + listForManagementGroup(managementGroupId: string, options?: Models.PolicyAssignmentsListForManagementGroupOptionalParams): Promise; /** * @param managementGroupId The ID of the management group. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. A filter is required when listing policy assignments at - * management group scope. * @param callback The callback */ - listForManagementGroup(managementGroupId: string, filter: string, callback: msRest.ServiceCallback): void; + listForManagementGroup(managementGroupId: string, callback: msRest.ServiceCallback): void; /** * @param managementGroupId The ID of the management group. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. A filter is required when listing policy assignments at - * management group scope. * @param options The optional parameters * @param callback The callback */ - listForManagementGroup(managementGroupId: string, filter: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listForManagementGroup(managementGroupId: string, filter: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listForManagementGroup(managementGroupId: string, options: Models.PolicyAssignmentsListForManagementGroupOptionalParams, callback: msRest.ServiceCallback): void; + listForManagementGroup(managementGroupId: string, options?: Models.PolicyAssignmentsListForManagementGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { managementGroupId, - filter, options }, listForManagementGroupOperationSpec, @@ -326,32 +329,37 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments associated with the given - * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all - * policy assignments associated with the subscription, including those that apply directly or from - * management groups that contain the given subscription, as well as any applied to objects - * contained within the subscription. If $filter=atScope() is provided, the returned list includes - * all policy assignments that apply to the subscription, which is everything in the unfiltered - * list except those applied to objects contained within the subscription. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value}. + * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the subscription, including + * those that apply directly or from management groups that contain the given subscription, as well + * as any applied to objects contained within the subscription. If $filter=atScope() is provided, + * the returned list includes all policy assignments that apply to the subscription, which is + * everything in the unfiltered list except those applied to objects contained within the + * subscription. If $filter=atExactScope() is provided, the returned list only includes all policy + * assignments that at the subscription. If $filter=policyDefinitionId eq '{value}' is provided, + * the returned list includes all policy assignments of the policy definition whose id is {value}. * @summary Retrieves all policy assignments that apply to a subscription. + * @param subscriptionId The ID of the target subscription. * @param [options] The optional parameters * @returns Promise */ - list(options?: Models.PolicyAssignmentsListOptionalParams): Promise; + list(subscriptionId: string, options?: Models.PolicyAssignmentsListOptionalParams): Promise; /** + * @param subscriptionId The ID of the target subscription. * @param callback The callback */ - list(callback: msRest.ServiceCallback): void; + list(subscriptionId: string, callback: msRest.ServiceCallback): void; /** + * @param subscriptionId The ID of the target subscription. * @param options The optional parameters * @param callback The callback */ - list(options: Models.PolicyAssignmentsListOptionalParams, callback: msRest.ServiceCallback): void; - list(options?: Models.PolicyAssignmentsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + list(subscriptionId: string, options: Models.PolicyAssignmentsListOptionalParams, callback: msRest.ServiceCallback): void; + list(subscriptionId: string, options?: Models.PolicyAssignmentsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { + subscriptionId, options }, listOperationSpec, @@ -482,14 +490,16 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments associated with the given resource * group in the given subscription that match the optional given $filter. Valid values for $filter - * are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the - * unfiltered list includes all policy assignments associated with the resource group, including - * those that apply directly or apply from containing scopes, as well as any applied to resources - * contained within the resource group. If $filter=atScope() is provided, the returned list - * includes all policy assignments that apply to the resource group, which is everything in the - * unfiltered list except those applied to resources contained within the resource group. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value} that apply to the resource group. + * are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not + * provided, the unfiltered list includes all policy assignments associated with the resource + * group, including those that apply directly or apply from containing scopes, as well as any + * applied to resources contained within the resource group. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the resource group, which is + * everything in the unfiltered list except those applied to resources contained within the + * resource group. If $filter=atExactScope() is provided, the returned list only includes all + * policy assignments that at the resource group. If $filter=policyDefinitionId eq '{value}' is + * provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the resource group. * @summary Retrieves all policy assignments that apply to a resource group. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters @@ -520,21 +530,22 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments associated with the specified * resource in the given resource group and subscription that match the optional given $filter. - * Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is - * not provided, the unfiltered list includes all policy assignments associated with the resource, - * including those that apply directly or from all containing scopes, as well as any applied to - * resources contained within the resource. If $filter=atScope() is provided, the returned list - * includes all policy assignments that apply to the resource, which is everything in the - * unfiltered list except those applied to resources contained within the resource. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value} that apply to the resource. Three - * parameters plus the resource name are used to identify a specific resource. If the resource is - * not part of a parent resource (the more common case), the parent resource path should not be - * provided (or provided as ''). For example a web app could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == - * 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all - * parameters should be provided. For example a virtual machine DNS name could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == + * Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments + * associated with the resource, including those that apply directly or from all containing scopes, + * as well as any applied to resources contained within the resource. If $filter=atScope() is + * provided, the returned list includes all policy assignments that apply to the resource, which is + * everything in the unfiltered list except those applied to resources contained within the + * resource. If $filter=atExactScope() is provided, the returned list only includes all policy + * assignments that at the resource level. If $filter=policyDefinitionId eq '{value}' is provided, + * the returned list includes all policy assignments of the policy definition whose id is {value} + * that apply to the resource. Three parameters plus the resource name are used to identify a + * specific resource. If the resource is not part of a parent resource (the more common case), the + * parent resource path should not be provided (or provided as ''). For example a web app could be + * specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', + * {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent + * resource, then all parameters should be provided. For example a virtual machine DNS name could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == * 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == * 'MyComputerName'). A convenient alternative to providing the namespace and type name separately * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', @@ -569,11 +580,13 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments applicable to the management group - * that match the given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId - * eq '{value}''. If $filter=atScope() is provided, the returned list includes all policy - * assignments that are assigned to the management group or the management group's ancestors. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value} that apply to the management group. + * that match the given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or + * 'policyDefinitionId eq '{value}''. If $filter=atScope() is provided, the returned list includes + * all policy assignments that are assigned to the management group or the management group's + * ancestors. If $filter=atExactScope() is provided, the returned list only includes all policy + * assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is + * provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the management group. * @summary Retrieves all policy assignments that apply to a management group. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters @@ -603,15 +616,16 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments associated with the given - * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all - * policy assignments associated with the subscription, including those that apply directly or from - * management groups that contain the given subscription, as well as any applied to objects - * contained within the subscription. If $filter=atScope() is provided, the returned list includes - * all policy assignments that apply to the subscription, which is everything in the unfiltered - * list except those applied to objects contained within the subscription. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value}. + * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the subscription, including + * those that apply directly or from management groups that contain the given subscription, as well + * as any applied to objects contained within the subscription. If $filter=atScope() is provided, + * the returned list includes all policy assignments that apply to the subscription, which is + * everything in the unfiltered list except those applied to objects contained within the + * subscription. If $filter=atExactScope() is provided, the returned list only includes all policy + * assignments that at the subscription. If $filter=policyDefinitionId eq '{value}' is provided, + * the returned list includes all policy assignments of the policy definition whose id is {value}. * @summary Retrieves all policy assignments that apply to a subscription. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters @@ -650,7 +664,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { Parameters.policyAssignmentName ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -675,7 +689,7 @@ const createOperationSpec: msRest.OperationSpec = { Parameters.policyAssignmentName ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -706,7 +720,7 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.policyAssignmentName ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -730,8 +744,9 @@ const listForResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.filter0, - Parameters.apiVersion + Parameters.filter, + Parameters.top, + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -749,7 +764,7 @@ const listForResourceGroupOperationSpec: msRest.OperationSpec = { const listForResourceOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments", urlParameters: [ Parameters.resourceGroupName, Parameters.resourceProviderNamespace, @@ -759,8 +774,9 @@ const listForResourceOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.filter1, - Parameters.apiVersion + Parameters.filter, + Parameters.top, + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -778,13 +794,14 @@ const listForResourceOperationSpec: msRest.OperationSpec = { const listForManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments", urlParameters: [ Parameters.managementGroupId ], queryParameters: [ - Parameters.filter2, - Parameters.apiVersion + Parameters.filter, + Parameters.top, + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -807,8 +824,9 @@ const listOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.filter1, - Parameters.apiVersion + Parameters.filter, + Parameters.top, + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -831,7 +849,7 @@ const deleteByIdOperationSpec: msRest.OperationSpec = { Parameters.policyAssignmentId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -855,7 +873,7 @@ const createByIdOperationSpec: msRest.OperationSpec = { Parameters.policyAssignmentId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -885,7 +903,7 @@ const getByIdOperationSpec: msRest.OperationSpec = { Parameters.policyAssignmentId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/policy/arm-policy/src/operations/policyDefinitions.ts b/sdk/policy/arm-policy/src/operations/policyDefinitions.ts index b2d5d0e40635..539edf38cbf1 100644 --- a/sdk/policy/arm-policy/src/operations/policyDefinitions.ts +++ b/sdk/policy/arm-policy/src/operations/policyDefinitions.ts @@ -32,28 +32,32 @@ export class PolicyDefinitions { * @summary Creates or updates a policy definition in a subscription. * @param policyDefinitionName The name of the policy definition to create. * @param parameters The policy definition properties. + * @param subscriptionId The ID of the target subscription. * @param [options] The optional parameters * @returns Promise */ - createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, options?: msRest.RequestOptionsBase): Promise; + createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, subscriptionId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policyDefinitionName The name of the policy definition to create. * @param parameters The policy definition properties. + * @param subscriptionId The ID of the target subscription. * @param callback The callback */ - createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, callback: msRest.ServiceCallback): void; + createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, subscriptionId: string, callback: msRest.ServiceCallback): void; /** * @param policyDefinitionName The name of the policy definition to create. * @param parameters The policy definition properties. + * @param subscriptionId The ID of the target subscription. * @param options The optional parameters * @param callback The callback */ - createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, subscriptionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, subscriptionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policyDefinitionName, parameters, + subscriptionId, options }, createOrUpdateOperationSpec, @@ -64,25 +68,29 @@ export class PolicyDefinitions { * This operation deletes the policy definition in the given subscription with the given name. * @summary Deletes a policy definition in a subscription. * @param policyDefinitionName The name of the policy definition to delete. + * @param subscriptionId The ID of the target subscription. * @param [options] The optional parameters * @returns Promise */ - deleteMethod(policyDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; + deleteMethod(policyDefinitionName: string, subscriptionId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policyDefinitionName The name of the policy definition to delete. + * @param subscriptionId The ID of the target subscription. * @param callback The callback */ - deleteMethod(policyDefinitionName: string, callback: msRest.ServiceCallback): void; + deleteMethod(policyDefinitionName: string, subscriptionId: string, callback: msRest.ServiceCallback): void; /** * @param policyDefinitionName The name of the policy definition to delete. + * @param subscriptionId The ID of the target subscription. * @param options The optional parameters * @param callback The callback */ - deleteMethod(policyDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(policyDefinitionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + deleteMethod(policyDefinitionName: string, subscriptionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(policyDefinitionName: string, subscriptionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policyDefinitionName, + subscriptionId, options }, deleteMethodOperationSpec, @@ -93,25 +101,29 @@ export class PolicyDefinitions { * This operation retrieves the policy definition in the given subscription with the given name. * @summary Retrieves a policy definition in a subscription. * @param policyDefinitionName The name of the policy definition to get. + * @param subscriptionId The ID of the target subscription. * @param [options] The optional parameters * @returns Promise */ - get(policyDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; + get(policyDefinitionName: string, subscriptionId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policyDefinitionName The name of the policy definition to get. + * @param subscriptionId The ID of the target subscription. * @param callback The callback */ - get(policyDefinitionName: string, callback: msRest.ServiceCallback): void; + get(policyDefinitionName: string, subscriptionId: string, callback: msRest.ServiceCallback): void; /** * @param policyDefinitionName The name of the policy definition to get. + * @param subscriptionId The ID of the target subscription. * @param options The optional parameters * @param callback The callback */ - get(policyDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(policyDefinitionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get(policyDefinitionName: string, subscriptionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(policyDefinitionName: string, subscriptionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policyDefinitionName, + subscriptionId, options }, getOperationSpec, @@ -253,24 +265,37 @@ export class PolicyDefinitions { } /** - * This operation retrieves a list of all the policy definitions in a given subscription. + * This operation retrieves a list of all the policy definitions in a given subscription that match + * the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq + * {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list includes + * all policy definitions associated with the subscription, including those that apply directly or + * from management groups that contain the given subscription. If $filter=atExactScope() is + * provided, the returned list only includes all policy definitions that at the given subscription. + * If $filter='policyType -eq {value}' is provided, the returned list only includes all policy + * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, + * Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only + * includes all policy definitions whose category match the {value}. * @summary Retrieves policy definitions in a subscription + * @param subscriptionId The ID of the target subscription. * @param [options] The optional parameters * @returns Promise */ - list(options?: msRest.RequestOptionsBase): Promise; + list(subscriptionId: string, options?: Models.PolicyDefinitionsListOptionalParams): Promise; /** + * @param subscriptionId The ID of the target subscription. * @param callback The callback */ - list(callback: msRest.ServiceCallback): void; + list(subscriptionId: string, callback: msRest.ServiceCallback): void; /** + * @param subscriptionId The ID of the target subscription. * @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 { + list(subscriptionId: string, options: Models.PolicyDefinitionsListOptionalParams, callback: msRest.ServiceCallback): void; + list(subscriptionId: string, options?: Models.PolicyDefinitionsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { + subscriptionId, options }, listOperationSpec, @@ -278,12 +303,16 @@ export class PolicyDefinitions { } /** - * This operation retrieves a list of all the built-in policy definitions. + * This operation retrieves a list of all the built-in policy definitions that match the optional + * given $filter. If $filter='policyType -eq {value}' is provided, the returned list only includes + * all built-in policy definitions whose type match the {value}. Possible policyType values are + * NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the + * returned list only includes all built-in policy definitions whose category match the {value}. * @summary Retrieve built-in policy definitions * @param [options] The optional parameters * @returns Promise */ - listBuiltIn(options?: msRest.RequestOptionsBase): Promise; + listBuiltIn(options?: Models.PolicyDefinitionsListBuiltInOptionalParams): Promise; /** * @param callback The callback */ @@ -292,8 +321,8 @@ export class PolicyDefinitions { * @param options The optional parameters * @param callback The callback */ - listBuiltIn(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBuiltIn(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listBuiltIn(options: Models.PolicyDefinitionsListBuiltInOptionalParams, callback: msRest.ServiceCallback): void; + listBuiltIn(options?: Models.PolicyDefinitionsListBuiltInOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options @@ -303,13 +332,23 @@ export class PolicyDefinitions { } /** - * This operation retrieves a list of all the policy definitions in a given management group. + * This operation retrieves a list of all the policy definitions in a given management group that + * match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list + * includes all policy definitions associated with the management group, including those that apply + * directly or from management groups that contain the given management group. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that + * at the given management group. If $filter='policyType -eq {value}' is provided, the returned + * list only includes all policy definitions whose type match the {value}. Possible policyType + * values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is + * provided, the returned list only includes all policy definitions whose category match the + * {value}. * @summary Retrieve policy definitions in a management group * @param managementGroupId The ID of the management group. * @param [options] The optional parameters * @returns Promise */ - listByManagementGroup(managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; + listByManagementGroup(managementGroupId: string, options?: Models.PolicyDefinitionsListByManagementGroupOptionalParams): Promise; /** * @param managementGroupId The ID of the management group. * @param callback The callback @@ -320,8 +359,8 @@ export class PolicyDefinitions { * @param options The optional parameters * @param callback The callback */ - listByManagementGroup(managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManagementGroup(managementGroupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByManagementGroup(managementGroupId: string, options: Models.PolicyDefinitionsListByManagementGroupOptionalParams, callback: msRest.ServiceCallback): void; + listByManagementGroup(managementGroupId: string, options?: Models.PolicyDefinitionsListByManagementGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { managementGroupId, @@ -332,7 +371,16 @@ export class PolicyDefinitions { } /** - * This operation retrieves a list of all the policy definitions in a given subscription. + * This operation retrieves a list of all the policy definitions in a given subscription that match + * the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq + * {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list includes + * all policy definitions associated with the subscription, including those that apply directly or + * from management groups that contain the given subscription. If $filter=atExactScope() is + * provided, the returned list only includes all policy definitions that at the given subscription. + * If $filter='policyType -eq {value}' is provided, the returned list only includes all policy + * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, + * Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only + * includes all policy definitions whose category match the {value}. * @summary Retrieves policy definitions in a subscription * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters @@ -361,7 +409,11 @@ export class PolicyDefinitions { } /** - * This operation retrieves a list of all the built-in policy definitions. + * This operation retrieves a list of all the built-in policy definitions that match the optional + * given $filter. If $filter='policyType -eq {value}' is provided, the returned list only includes + * all built-in policy definitions whose type match the {value}. Possible policyType values are + * NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the + * returned list only includes all built-in policy definitions whose category match the {value}. * @summary Retrieve built-in policy definitions * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters @@ -390,7 +442,17 @@ export class PolicyDefinitions { } /** - * This operation retrieves a list of all the policy definitions in a given management group. + * This operation retrieves a list of all the policy definitions in a given management group that + * match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list + * includes all policy definitions associated with the management group, including those that apply + * directly or from management groups that contain the given management group. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that + * at the given management group. If $filter='policyType -eq {value}' is provided, the returned + * list only includes all policy definitions whose type match the {value}. Possible policyType + * values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is + * provided, the returned list only includes all policy definitions whose category match the + * {value}. * @summary Retrieve policy definitions in a management group * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters @@ -429,7 +491,7 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -460,7 +522,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -483,7 +545,7 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -506,7 +568,7 @@ const getBuiltInOperationSpec: msRest.OperationSpec = { Parameters.policyDefinitionName ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -524,13 +586,13 @@ const getBuiltInOperationSpec: msRest.OperationSpec = { const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", urlParameters: [ Parameters.policyDefinitionName, Parameters.managementGroupId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -555,13 +617,13 @@ const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", urlParameters: [ Parameters.policyDefinitionName, Parameters.managementGroupId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -578,13 +640,13 @@ const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { const getAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", urlParameters: [ Parameters.policyDefinitionName, Parameters.managementGroupId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -607,7 +669,9 @@ const listOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0, + Parameters.filter, + Parameters.top ], headerParameters: [ Parameters.acceptLanguage @@ -627,7 +691,9 @@ const listBuiltInOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Authorization/policyDefinitions", queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0, + Parameters.filter, + Parameters.top ], headerParameters: [ Parameters.acceptLanguage @@ -645,12 +711,14 @@ const listBuiltInOperationSpec: msRest.OperationSpec = { const listByManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions", urlParameters: [ Parameters.managementGroupId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0, + Parameters.filter, + Parameters.top ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/policy/arm-policy/src/operations/policyExemptions.ts b/sdk/policy/arm-policy/src/operations/policyExemptions.ts new file mode 100644 index 000000000000..d88ca19b30ac --- /dev/null +++ b/sdk/policy/arm-policy/src/operations/policyExemptions.ts @@ -0,0 +1,766 @@ +/* + * 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/policyExemptionsMappers"; +import * as Parameters from "../models/parameters"; +import { PolicyClientContext } from "../policyClientContext"; + +/** Class representing a PolicyExemptions. */ +export class PolicyExemptions { + private readonly client: PolicyClientContext; + + /** + * Create a PolicyExemptions. + * @param {PolicyClientContext} client Reference to the service client. + */ + constructor(client: PolicyClientContext) { + this.client = client; + } + + /** + * This operation deletes a policy exemption, given its name and the scope it was created in. The + * scope of a policy exemption is the part of its ID preceding + * '/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}'. + * @summary Deletes a policy exemption. + * @param scope The scope of the policy exemption. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyExemptionName The name of the policy exemption to delete. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(scope: string, policyExemptionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope of the policy exemption. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyExemptionName The name of the policy exemption to delete. + * @param callback The callback + */ + deleteMethod(scope: string, policyExemptionName: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope of the policy exemption. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyExemptionName The name of the policy exemption to delete. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(scope: string, policyExemptionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(scope: string, policyExemptionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + policyExemptionName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * This operation creates or updates a policy exemption with the given scope and name. Policy + * exemptions apply to all resources contained within their scope. For example, when you create a + * policy exemption at resource group scope for a policy assignment at the same or above level, the + * exemption exempts to all applicable resources in the resource group. + * @summary Creates or updates a policy exemption. + * @param parameters Parameters for the policy exemption. + * @param scope The scope of the policy exemption. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyExemptionName The name of the policy exemption to delete. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(parameters: Models.PolicyExemption, scope: string, policyExemptionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param parameters Parameters for the policy exemption. + * @param scope The scope of the policy exemption. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyExemptionName The name of the policy exemption to delete. + * @param callback The callback + */ + createOrUpdate(parameters: Models.PolicyExemption, scope: string, policyExemptionName: string, callback: msRest.ServiceCallback): void; + /** + * @param parameters Parameters for the policy exemption. + * @param scope The scope of the policy exemption. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyExemptionName The name of the policy exemption to delete. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(parameters: Models.PolicyExemption, scope: string, policyExemptionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(parameters: Models.PolicyExemption, scope: string, policyExemptionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + parameters, + scope, + policyExemptionName, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a single policy exemption, given its name and the scope it was created + * at. + * @summary Retrieves a policy exemption. + * @param scope The scope of the policy exemption. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyExemptionName The name of the policy exemption to delete. + * @param [options] The optional parameters + * @returns Promise + */ + get(scope: string, policyExemptionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope of the policy exemption. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyExemptionName The name of the policy exemption to delete. + * @param callback The callback + */ + get(scope: string, policyExemptionName: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope of the policy exemption. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyExemptionName The name of the policy exemption to delete. + * @param options The optional parameters + * @param callback The callback + */ + get(scope: string, policyExemptionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(scope: string, policyExemptionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + policyExemptionName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the list of all policy exemptions associated with the given + * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not + * provided, the unfiltered list includes all policy exemptions associated with the subscription, + * including those that apply directly or from management groups that contain the given + * subscription, as well as any applied to objects contained within the subscription. + * @summary Retrieves all policy exemptions that apply to a subscription. + * @param subscriptionId The ID of the target subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(subscriptionId: string, options?: Models.PolicyExemptionsListOptionalParams): Promise; + /** + * @param subscriptionId The ID of the target subscription. + * @param callback The callback + */ + list(subscriptionId: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId The ID of the target subscription. + * @param options The optional parameters + * @param callback The callback + */ + list(subscriptionId: string, options: Models.PolicyExemptionsListOptionalParams, callback: msRest.ServiceCallback): void; + list(subscriptionId: string, options?: Models.PolicyExemptionsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the list of all policy exemptions associated with the given resource + * group in the given subscription that match the optional given $filter. Valid values for $filter + * are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If + * $filter is not provided, the unfiltered list includes all policy exemptions associated with the + * resource group, including those that apply directly or apply from containing scopes, as well as + * any applied to resources contained within the resource group. + * @summary Retrieves all policy exemptions that apply to a resource group. + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group containing the resource. + * @param [options] The optional parameters + * @returns Promise + */ + listForResourceGroup(subscriptionId: string, resourceGroupName: string, options?: Models.PolicyExemptionsListForResourceGroupOptionalParams): Promise; + /** + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group containing the resource. + * @param callback The callback + */ + listForResourceGroup(subscriptionId: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group containing the resource. + * @param options The optional parameters + * @param callback The callback + */ + listForResourceGroup(subscriptionId: string, resourceGroupName: string, options: Models.PolicyExemptionsListForResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listForResourceGroup(subscriptionId: string, resourceGroupName: string, options?: Models.PolicyExemptionsListForResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + resourceGroupName, + options + }, + listForResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the list of all policy exemptions associated with the specified + * resource in the given resource group and subscription that match the optional given $filter. + * Valid values for $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or + * 'policyAssignmentId eq '{value}''. If $filter is not provided, the unfiltered list includes all + * policy exemptions associated with the resource, including those that apply directly or from all + * containing scopes, as well as any applied to resources contained within the resource. Three + * parameters plus the resource name are used to identify a specific resource. If the resource is + * not part of a parent resource (the more common case), the parent resource path should not be + * provided (or provided as ''). For example a web app could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == + * 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all + * parameters should be provided. For example a virtual machine DNS name could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == + * 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == + * 'MyComputerName'). A convenient alternative to providing the namespace and type name separately + * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', + * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == + * 'MyWebApp'). + * @summary Retrieves all policy exemptions that apply to a resource. + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group containing the resource. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the + * namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' + * (from Microsoft.Web/sites). + * @param resourceName The name of the resource. + * @param [options] The optional parameters + * @returns Promise + */ + listForResource(subscriptionId: string, resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.PolicyExemptionsListForResourceOptionalParams): Promise; + /** + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group containing the resource. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the + * namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' + * (from Microsoft.Web/sites). + * @param resourceName The name of the resource. + * @param callback The callback + */ + listForResource(subscriptionId: string, resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group containing the resource. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the + * namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' + * (from Microsoft.Web/sites). + * @param resourceName The name of the resource. + * @param options The optional parameters + * @param callback The callback + */ + listForResource(subscriptionId: string, resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options: Models.PolicyExemptionsListForResourceOptionalParams, callback: msRest.ServiceCallback): void; + listForResource(subscriptionId: string, resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.PolicyExemptionsListForResourceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + options + }, + listForResourceOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the list of all policy exemptions applicable to the management group + * that match the given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', + * 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter=atScope() is provided, the + * returned list includes all policy exemptions that are assigned to the management group or the + * management group's ancestors. + * @summary Retrieves all policy exemptions that apply to a management group. + * @param managementGroupId The ID of the management group. + * @param [options] The optional parameters + * @returns Promise + */ + listForManagementGroup(managementGroupId: string, options?: Models.PolicyExemptionsListForManagementGroupOptionalParams): Promise; + /** + * @param managementGroupId The ID of the management group. + * @param callback The callback + */ + listForManagementGroup(managementGroupId: string, callback: msRest.ServiceCallback): void; + /** + * @param managementGroupId The ID of the management group. + * @param options The optional parameters + * @param callback The callback + */ + listForManagementGroup(managementGroupId: string, options: Models.PolicyExemptionsListForManagementGroupOptionalParams, callback: msRest.ServiceCallback): void; + listForManagementGroup(managementGroupId: string, options?: Models.PolicyExemptionsListForManagementGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + options + }, + listForManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the list of all policy exemptions associated with the given + * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not + * provided, the unfiltered list includes all policy exemptions associated with the subscription, + * including those that apply directly or from management groups that contain the given + * subscription, as well as any applied to objects contained within the subscription. + * @summary Retrieves all policy exemptions that apply to a 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; + } + + /** + * This operation retrieves the list of all policy exemptions associated with the given resource + * group in the given subscription that match the optional given $filter. Valid values for $filter + * are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If + * $filter is not provided, the unfiltered list includes all policy exemptions associated with the + * resource group, including those that apply directly or apply from containing scopes, as well as + * any applied to resources contained within the resource group. + * @summary Retrieves all policy exemptions that apply to 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; + } + + /** + * This operation retrieves the list of all policy exemptions associated with the specified + * resource in the given resource group and subscription that match the optional given $filter. + * Valid values for $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or + * 'policyAssignmentId eq '{value}''. If $filter is not provided, the unfiltered list includes all + * policy exemptions associated with the resource, including those that apply directly or from all + * containing scopes, as well as any applied to resources contained within the resource. Three + * parameters plus the resource name are used to identify a specific resource. If the resource is + * not part of a parent resource (the more common case), the parent resource path should not be + * provided (or provided as ''). For example a web app could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == + * 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all + * parameters should be provided. For example a virtual machine DNS name could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == + * 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == + * 'MyComputerName'). A convenient alternative to providing the namespace and type name separately + * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', + * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == + * 'MyWebApp'). + * @summary Retrieves all policy exemptions that apply to 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; + } + + /** + * This operation retrieves the list of all policy exemptions applicable to the management group + * that match the given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', + * 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter=atScope() is provided, the + * returned list includes all policy exemptions that are assigned to the management group or the + * management group's ancestors. + * @summary Retrieves all policy exemptions that apply to a management group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listForManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listForManagementGroupNext(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 + */ + listForManagementGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listForManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listForManagementGroupNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "{scope}/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}", + urlParameters: [ + Parameters.scope, + Parameters.policyExemptionName + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "{scope}/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}", + urlParameters: [ + Parameters.scope, + Parameters.policyExemptionName + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.PolicyExemption, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PolicyExemption + }, + 201: { + bodyMapper: Mappers.PolicyExemption + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{scope}/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}", + urlParameters: [ + Parameters.scope, + Parameters.policyExemptionName + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyExemption + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyExemptions", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyExemptionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listForResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyExemptions", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyExemptionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listForResourceOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyExemptions", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.parentResourcePath, + Parameters.resourceType, + Parameters.resourceName + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyExemptionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listForManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyExemptions", + urlParameters: [ + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyExemptionListResult + }, + 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.PolicyExemptionListResult + }, + 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.PolicyExemptionListResult + }, + 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.PolicyExemptionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listForManagementGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyExemptionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts b/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts index 5cce445c14f0..fdce500b0e7e 100644 --- a/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts +++ b/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts @@ -32,28 +32,32 @@ export class PolicySetDefinitions { * @summary Creates or updates a policy set definition. * @param policySetDefinitionName The name of the policy set definition to create. * @param parameters The policy set definition properties. + * @param subscriptionId The ID of the target subscription. * @param [options] The optional parameters * @returns Promise */ - createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, options?: msRest.RequestOptionsBase): Promise; + createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, subscriptionId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policySetDefinitionName The name of the policy set definition to create. * @param parameters The policy set definition properties. + * @param subscriptionId The ID of the target subscription. * @param callback The callback */ - createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, callback: msRest.ServiceCallback): void; + createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, subscriptionId: string, callback: msRest.ServiceCallback): void; /** * @param policySetDefinitionName The name of the policy set definition to create. * @param parameters The policy set definition properties. + * @param subscriptionId The ID of the target subscription. * @param options The optional parameters * @param callback The callback */ - createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, subscriptionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, subscriptionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, parameters, + subscriptionId, options }, createOrUpdateOperationSpec, @@ -64,25 +68,29 @@ export class PolicySetDefinitions { * This operation deletes the policy set definition in the given subscription with the given name. * @summary Deletes a policy set definition. * @param policySetDefinitionName The name of the policy set definition to delete. + * @param subscriptionId The ID of the target subscription. * @param [options] The optional parameters * @returns Promise */ - deleteMethod(policySetDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; + deleteMethod(policySetDefinitionName: string, subscriptionId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policySetDefinitionName The name of the policy set definition to delete. + * @param subscriptionId The ID of the target subscription. * @param callback The callback */ - deleteMethod(policySetDefinitionName: string, callback: msRest.ServiceCallback): void; + deleteMethod(policySetDefinitionName: string, subscriptionId: string, callback: msRest.ServiceCallback): void; /** * @param policySetDefinitionName The name of the policy set definition to delete. + * @param subscriptionId The ID of the target subscription. * @param options The optional parameters * @param callback The callback */ - deleteMethod(policySetDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(policySetDefinitionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + deleteMethod(policySetDefinitionName: string, subscriptionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(policySetDefinitionName: string, subscriptionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, + subscriptionId, options }, deleteMethodOperationSpec, @@ -94,25 +102,29 @@ export class PolicySetDefinitions { * name. * @summary Retrieves a policy set definition. * @param policySetDefinitionName The name of the policy set definition to get. + * @param subscriptionId The ID of the target subscription. * @param [options] The optional parameters * @returns Promise */ - get(policySetDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; + get(policySetDefinitionName: string, subscriptionId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policySetDefinitionName The name of the policy set definition to get. + * @param subscriptionId The ID of the target subscription. * @param callback The callback */ - get(policySetDefinitionName: string, callback: msRest.ServiceCallback): void; + get(policySetDefinitionName: string, subscriptionId: string, callback: msRest.ServiceCallback): void; /** * @param policySetDefinitionName The name of the policy set definition to get. + * @param subscriptionId The ID of the target subscription. * @param options The optional parameters * @param callback The callback */ - get(policySetDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(policySetDefinitionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get(policySetDefinitionName: string, subscriptionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(policySetDefinitionName: string, subscriptionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, + subscriptionId, options }, getOperationSpec, @@ -149,24 +161,37 @@ export class PolicySetDefinitions { } /** - * This operation retrieves a list of all the policy set definitions in the given subscription. + * This operation retrieves a list of all the policy set definitions in a given subscription that + * match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list + * includes all policy set definitions associated with the subscription, including those that apply + * directly or from management groups that contain the given subscription. If + * $filter=atExactScope() is provided, the returned list only includes all policy set definitions + * that at the given subscription. If $filter='policyType -eq {value}' is provided, the returned + * list only includes all policy set definitions whose type match the {value}. Possible policyType + * values are NotSpecified, BuiltIn and Custom. If $filter='category -eq {value}' is provided, the + * returned list only includes all policy set definitions whose category match the {value}. * @summary Retrieves the policy set definitions for a subscription. + * @param subscriptionId The ID of the target subscription. * @param [options] The optional parameters * @returns Promise */ - list(options?: msRest.RequestOptionsBase): Promise; + list(subscriptionId: string, options?: Models.PolicySetDefinitionsListOptionalParams): Promise; /** + * @param subscriptionId The ID of the target subscription. * @param callback The callback */ - list(callback: msRest.ServiceCallback): void; + list(subscriptionId: string, callback: msRest.ServiceCallback): void; /** + * @param subscriptionId The ID of the target subscription. * @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 { + list(subscriptionId: string, options: Models.PolicySetDefinitionsListOptionalParams, callback: msRest.ServiceCallback): void; + list(subscriptionId: string, options?: Models.PolicySetDefinitionsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { + subscriptionId, options }, listOperationSpec, @@ -174,12 +199,14 @@ export class PolicySetDefinitions { } /** - * This operation retrieves a list of all the built-in policy set definitions. + * This operation retrieves a list of all the built-in policy set definitions that match the + * optional given $filter. If $filter='category -eq {value}' is provided, the returned list only + * includes all built-in policy set definitions whose category match the {value}. * @summary Retrieves built-in policy set definitions. * @param [options] The optional parameters * @returns Promise */ - listBuiltIn(options?: msRest.RequestOptionsBase): Promise; + listBuiltIn(options?: Models.PolicySetDefinitionsListBuiltInOptionalParams): Promise; /** * @param callback The callback */ @@ -188,8 +215,8 @@ export class PolicySetDefinitions { * @param options The optional parameters * @param callback The callback */ - listBuiltIn(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBuiltIn(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listBuiltIn(options: Models.PolicySetDefinitionsListBuiltInOptionalParams, callback: msRest.ServiceCallback): void; + listBuiltIn(options?: Models.PolicySetDefinitionsListBuiltInOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options @@ -305,14 +332,23 @@ export class PolicySetDefinitions { } /** - * This operation retrieves a list of all the a policy set definition in the given management - * group. + * This operation retrieves a list of all the policy set definitions in a given management group + * that match the optional given $filter. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered + * list includes all policy set definitions associated with the management group, including those + * that apply directly or from management groups that contain the given management group. If + * $filter=atExactScope() is provided, the returned list only includes all policy set definitions + * that at the given management group. If $filter='policyType -eq {value}' is provided, the + * returned list only includes all policy set definitions whose type match the {value}. Possible + * policyType values are NotSpecified, BuiltIn and Custom. If $filter='category -eq {value}' is + * provided, the returned list only includes all policy set definitions whose category match the + * {value}. * @summary Retrieves all policy set definitions in management group. * @param managementGroupId The ID of the management group. * @param [options] The optional parameters * @returns Promise */ - listByManagementGroup(managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; + listByManagementGroup(managementGroupId: string, options?: Models.PolicySetDefinitionsListByManagementGroupOptionalParams): Promise; /** * @param managementGroupId The ID of the management group. * @param callback The callback @@ -323,8 +359,8 @@ export class PolicySetDefinitions { * @param options The optional parameters * @param callback The callback */ - listByManagementGroup(managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManagementGroup(managementGroupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByManagementGroup(managementGroupId: string, options: Models.PolicySetDefinitionsListByManagementGroupOptionalParams, callback: msRest.ServiceCallback): void; + listByManagementGroup(managementGroupId: string, options?: Models.PolicySetDefinitionsListByManagementGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { managementGroupId, @@ -335,7 +371,16 @@ export class PolicySetDefinitions { } /** - * This operation retrieves a list of all the policy set definitions in the given subscription. + * This operation retrieves a list of all the policy set definitions in a given subscription that + * match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list + * includes all policy set definitions associated with the subscription, including those that apply + * directly or from management groups that contain the given subscription. If + * $filter=atExactScope() is provided, the returned list only includes all policy set definitions + * that at the given subscription. If $filter='policyType -eq {value}' is provided, the returned + * list only includes all policy set definitions whose type match the {value}. Possible policyType + * values are NotSpecified, BuiltIn and Custom. If $filter='category -eq {value}' is provided, the + * returned list only includes all policy set definitions whose category match the {value}. * @summary Retrieves the policy set definitions for a subscription. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters @@ -364,7 +409,9 @@ export class PolicySetDefinitions { } /** - * This operation retrieves a list of all the built-in policy set definitions. + * This operation retrieves a list of all the built-in policy set definitions that match the + * optional given $filter. If $filter='category -eq {value}' is provided, the returned list only + * includes all built-in policy set definitions whose category match the {value}. * @summary Retrieves built-in policy set definitions. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters @@ -393,8 +440,17 @@ export class PolicySetDefinitions { } /** - * This operation retrieves a list of all the a policy set definition in the given management - * group. + * This operation retrieves a list of all the policy set definitions in a given management group + * that match the optional given $filter. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered + * list includes all policy set definitions associated with the management group, including those + * that apply directly or from management groups that contain the given management group. If + * $filter=atExactScope() is provided, the returned list only includes all policy set definitions + * that at the given management group. If $filter='policyType -eq {value}' is provided, the + * returned list only includes all policy set definitions whose type match the {value}. Possible + * policyType values are NotSpecified, BuiltIn and Custom. If $filter='category -eq {value}' is + * provided, the returned list only includes all policy set definitions whose category match the + * {value}. * @summary Retrieves all policy set definitions in management group. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters @@ -433,7 +489,7 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -467,7 +523,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -490,7 +546,7 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -513,7 +569,7 @@ const getBuiltInOperationSpec: msRest.OperationSpec = { Parameters.policySetDefinitionName ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -536,7 +592,9 @@ const listOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0, + Parameters.filter, + Parameters.top ], headerParameters: [ Parameters.acceptLanguage @@ -556,7 +614,9 @@ const listBuiltInOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Authorization/policySetDefinitions", queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0, + Parameters.filter, + Parameters.top ], headerParameters: [ Parameters.acceptLanguage @@ -574,13 +634,13 @@ const listBuiltInOperationSpec: msRest.OperationSpec = { const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", urlParameters: [ Parameters.policySetDefinitionName, Parameters.managementGroupId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -608,13 +668,13 @@ const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", urlParameters: [ Parameters.policySetDefinitionName, Parameters.managementGroupId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -631,13 +691,13 @@ const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { const getAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", urlParameters: [ Parameters.policySetDefinitionName, Parameters.managementGroupId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0 ], headerParameters: [ Parameters.acceptLanguage @@ -655,12 +715,14 @@ const getAtManagementGroupOperationSpec: msRest.OperationSpec = { const listByManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions", urlParameters: [ Parameters.managementGroupId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion0, + Parameters.filter, + Parameters.top ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/policy/arm-policy/src/policyClient.ts b/sdk/policy/arm-policy/src/policyClient.ts index dc8f8dbde966..7a5dfd851998 100644 --- a/sdk/policy/arm-policy/src/policyClient.ts +++ b/sdk/policy/arm-policy/src/policyClient.ts @@ -20,18 +20,19 @@ class PolicyClient extends PolicyClientContext { policyAssignments: operations.PolicyAssignments; policyDefinitions: operations.PolicyDefinitions; policySetDefinitions: operations.PolicySetDefinitions; + policyExemptions: operations.PolicyExemptions; /** * Initializes a new instance of the PolicyClient class. * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.PolicyClientOptions) { - super(credentials, subscriptionId, options); + constructor(credentials: msRest.ServiceClientCredentials, options?: Models.PolicyClientOptions) { + super(credentials, options); this.policyAssignments = new operations.PolicyAssignments(this); this.policyDefinitions = new operations.PolicyDefinitions(this); this.policySetDefinitions = new operations.PolicySetDefinitions(this); + this.policyExemptions = new operations.PolicyExemptions(this); } } diff --git a/sdk/policy/arm-policy/src/policyClientContext.ts b/sdk/policy/arm-policy/src/policyClientContext.ts index 60c107079f2e..7e1226e05ec2 100644 --- a/sdk/policy/arm-policy/src/policyClientContext.ts +++ b/sdk/policy/arm-policy/src/policyClientContext.ts @@ -17,22 +17,16 @@ const packageVersion = "3.1.0"; export class PolicyClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; - subscriptionId: string; - apiVersion?: string; /** * Initializes a new instance of the PolicyClient class. * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.PolicyClientOptions) { + constructor(credentials: msRest.ServiceClientCredentials, options?: Models.PolicyClientOptions) { if (credentials == undefined) { throw new Error('\'credentials\' cannot be null.'); } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } if (!options) { options = {}; @@ -44,13 +38,11 @@ export class PolicyClientContext extends msRestAzure.AzureServiceClient { super(credentials, options); - this.apiVersion = '2019-09-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; this.requestContentType = "application/json; charset=utf-8"; this.credentials = credentials; - this.subscriptionId = subscriptionId; if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage;