diff --git a/sdk/policyinsights/arm-policyinsights/lib/models/index.ts b/sdk/policyinsights/arm-policyinsights/lib/models/index.ts new file mode 100644 index 000000000000..e12e353c7cc8 --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/models/index.ts @@ -0,0 +1,3251 @@ +/* + * 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 { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing PolicyDetails. + * The policy details. + * + */ +export interface PolicyDetails { + /** + * @member {string} [policyDefinitionId] The ID of the policy definition. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly policyDefinitionId?: string; + /** + * @member {string} [policyAssignmentId] The ID of the policy assignment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly policyAssignmentId?: string; + /** + * @member {string} [policyAssignmentDisplayName] The display name of the + * policy assignment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly policyAssignmentDisplayName?: string; + /** + * @member {string} [policyAssignmentScope] The scope of the policy + * assignment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly policyAssignmentScope?: string; + /** + * @member {string} [policySetDefinitionId] The ID of the policy set + * definition. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly policySetDefinitionId?: string; + /** + * @member {string} [policyDefinitionReferenceId] The policy definition + * reference ID within the policy set definition. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly policyDefinitionReferenceId?: string; +} + +/** + * @interface + * An interface representing TrackedResourceModificationDetails. + * The details of the policy triggered deployment that created or modified the + * tracked resource. + * + */ +export interface TrackedResourceModificationDetails { + /** + * @member {PolicyDetails} [policyDetails] The details of the policy that + * created or modified the tracked resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly policyDetails?: PolicyDetails; + /** + * @member {string} [deploymentId] The ID of the deployment that created or + * modified the tracked resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly deploymentId?: string; + /** + * @member {Date} [deploymentTime] Timestamp of the deployment that created + * or modified the tracked resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly deploymentTime?: Date; +} + +/** + * @interface + * An interface representing PolicyTrackedResource. + * Policy tracked resource record. + * + */ +export interface PolicyTrackedResource { + /** + * @member {string} [trackedResourceId] The ID of the policy tracked + * resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly trackedResourceId?: string; + /** + * @member {PolicyDetails} [policyDetails] The details of the policy that + * require the tracked resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly policyDetails?: PolicyDetails; + /** + * @member {TrackedResourceModificationDetails} [createdBy] The details of + * the policy triggered deployment that created the tracked resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly createdBy?: TrackedResourceModificationDetails; + /** + * @member {TrackedResourceModificationDetails} [lastModifiedBy] The details + * of the policy triggered deployment that modified the tracked resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly lastModifiedBy?: TrackedResourceModificationDetails; + /** + * @member {Date} [lastUpdateUtc] Timestamp of the last update to the tracked + * resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly lastUpdateUtc?: Date; +} + +/** + * @interface + * An interface representing QueryFailureError. + * Error definition. + * + */ +export interface QueryFailureError { + /** + * @member {string} [code] Service specific error code which serves as the + * substatus for the HTTP error code. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly code?: string; + /** + * @member {string} [message] Description of the error. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly message?: string; +} + +/** + * @interface + * An interface representing QueryFailure. + * Error response. + * + */ +export interface QueryFailure { + /** + * @member {QueryFailureError} [error] Error definition. + */ + error?: QueryFailureError; +} + +/** + * @interface + * An interface representing RemediationFilters. + * The filters that will be applied to determine which resources to remediate. + * + */ +export interface RemediationFilters { + /** + * @member {string[]} [locations] The resource locations that will be + * remediated. + */ + locations?: string[]; +} + +/** + * @interface + * An interface representing RemediationDeploymentSummary. + * The deployment status summary for all deployments created by the + * remediation. + * + */ +export interface RemediationDeploymentSummary { + /** + * @member {number} [totalDeployments] The number of deployments required by + * the remediation. + */ + totalDeployments?: number; + /** + * @member {number} [successfulDeployments] The number of deployments + * required by the remediation that have succeeded. + */ + successfulDeployments?: number; + /** + * @member {number} [failedDeployments] The number of deployments required by + * the remediation that have failed. + */ + failedDeployments?: number; +} + +/** + * @interface + * An interface representing Remediation. + * The remediation definition. + * + * @extends BaseResource + */ +export interface Remediation extends BaseResource { + /** + * @member {string} [policyAssignmentId] The resource ID of the policy + * assignment that should be remediated. + */ + policyAssignmentId?: string; + /** + * @member {string} [policyDefinitionReferenceId] The policy definition + * reference ID of the individual definition that should be remediated. + * Required when the policy assignment being remediated assigns a policy set + * definition. + */ + policyDefinitionReferenceId?: string; + /** + * @member {string} [provisioningState] The status of the remediation. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: string; + /** + * @member {Date} [createdOn] The time at which the remediation was created. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly createdOn?: Date; + /** + * @member {Date} [lastUpdatedOn] The time at which the remediation was last + * updated. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly lastUpdatedOn?: Date; + /** + * @member {RemediationFilters} [filters] The filters that will be applied to + * determine which resources to remediate. + */ + filters?: RemediationFilters; + /** + * @member {RemediationDeploymentSummary} [deploymentStatus] The deployment + * status summary for all deployments created by the remediation. + */ + deploymentStatus?: RemediationDeploymentSummary; + /** + * @member {string} [id] The ID of the remediation. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] The type of the remediation. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] The name of the remediation. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; +} + +/** + * @interface + * An interface representing TypedErrorInfo. + * Scenario specific error details. + * + */ +export interface TypedErrorInfo { + /** + * @member {string} [type] The type of included error details. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {any} [info] The scenario specific error details. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly info?: any; +} + +/** + * @interface + * An interface representing ErrorDefinition. + * Error definition. + * + */ +export interface ErrorDefinition { + /** + * @member {string} [code] Service specific error code which serves as the + * substatus for the HTTP error code. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly code?: string; + /** + * @member {string} [message] Description of the error. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly message?: string; + /** + * @member {string} [target] The target of the error. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly target?: string; + /** + * @member {ErrorDefinition[]} [details] Internal error details. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly details?: ErrorDefinition[]; + /** + * @member {TypedErrorInfo[]} [additionalInfo] Additional scenario specific + * error details. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly additionalInfo?: TypedErrorInfo[]; +} + +/** + * @interface + * An interface representing RemediationDeployment. + * Details of a single deployment created by the remediation. + * + */ +export interface RemediationDeployment { + /** + * @member {string} [remediatedResourceId] Resource ID of the resource that + * is being remediated by the deployment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly remediatedResourceId?: string; + /** + * @member {string} [deploymentId] Resource ID of the template deployment + * that will remediate the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly deploymentId?: string; + /** + * @member {string} [status] Status of the remediation deployment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly status?: string; + /** + * @member {string} [resourceLocation] Location of the resource that is being + * remediated. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly resourceLocation?: string; + /** + * @member {ErrorDefinition} [error] Error encountered while remediated the + * resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly error?: ErrorDefinition; + /** + * @member {Date} [createdOn] The time at which the remediation was created. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly createdOn?: Date; + /** + * @member {Date} [lastUpdatedOn] The time at which the remediation + * deployment was last updated. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly lastUpdatedOn?: Date; +} + +/** + * @interface + * An interface representing ErrorResponse. + * Error response. + * + */ +export interface ErrorResponse { + /** + * @member {ErrorDefinition} [error] The error details. + */ + error?: ErrorDefinition; +} + +/** + * @interface + * An interface representing PolicyEvent. + * Policy event record. + * + */ +export interface PolicyEvent { + /** + * @member {string} [odataid] OData entity ID; always set to null since + * policy event records do not have an entity ID. + */ + odataid?: string; + /** + * @member {string} [odatacontext] OData context string; used by OData + * clients to resolve type information based on metadata. + */ + odatacontext?: string; + /** + * @member {Date} [timestamp] Timestamp for the policy event record. + */ + timestamp?: Date; + /** + * @member {string} [resourceId] Resource ID. + */ + resourceId?: string; + /** + * @member {string} [policyAssignmentId] Policy assignment ID. + */ + policyAssignmentId?: string; + /** + * @member {string} [policyDefinitionId] Policy definition ID. + */ + policyDefinitionId?: string; + /** + * @member {string} [effectiveParameters] Effective parameters for the policy + * assignment. + */ + effectiveParameters?: string; + /** + * @member {boolean} [isCompliant] Flag which states whether the resource is + * compliant against the policy assignment it was evaluated against. + */ + isCompliant?: boolean; + /** + * @member {string} [subscriptionId] Subscription ID. + */ + subscriptionId?: string; + /** + * @member {string} [resourceType] Resource type. + */ + resourceType?: string; + /** + * @member {string} [resourceLocation] Resource location. + */ + resourceLocation?: string; + /** + * @member {string} [resourceGroup] Resource group name. + */ + resourceGroup?: string; + /** + * @member {string} [resourceTags] List of resource tags. + */ + resourceTags?: string; + /** + * @member {string} [policyAssignmentName] Policy assignment name. + */ + policyAssignmentName?: string; + /** + * @member {string} [policyAssignmentOwner] Policy assignment owner. + */ + policyAssignmentOwner?: string; + /** + * @member {string} [policyAssignmentParameters] Policy assignment + * parameters. + */ + policyAssignmentParameters?: string; + /** + * @member {string} [policyAssignmentScope] Policy assignment scope. + */ + policyAssignmentScope?: string; + /** + * @member {string} [policyDefinitionName] Policy definition name. + */ + policyDefinitionName?: string; + /** + * @member {string} [policyDefinitionAction] Policy definition action, i.e. + * effect. + */ + policyDefinitionAction?: string; + /** + * @member {string} [policyDefinitionCategory] Policy definition category. + */ + policyDefinitionCategory?: string; + /** + * @member {string} [policySetDefinitionId] Policy set definition ID, if the + * policy assignment is for a policy set. + */ + policySetDefinitionId?: string; + /** + * @member {string} [policySetDefinitionName] Policy set definition name, if + * the policy assignment is for a policy set. + */ + policySetDefinitionName?: string; + /** + * @member {string} [policySetDefinitionOwner] Policy set definition owner, + * if the policy assignment is for a policy set. + */ + policySetDefinitionOwner?: string; + /** + * @member {string} [policySetDefinitionCategory] Policy set definition + * category, if the policy assignment is for a policy set. + */ + policySetDefinitionCategory?: string; + /** + * @member {string} [policySetDefinitionParameters] Policy set definition + * parameters, if the policy assignment is for a policy set. + */ + policySetDefinitionParameters?: string; + /** + * @member {string} [managementGroupIds] Comma separated list of management + * group IDs, which represent the hierarchy of the management groups the + * resource is under. + */ + managementGroupIds?: string; + /** + * @member {string} [policyDefinitionReferenceId] Reference ID for the policy + * definition inside the policy set, if the policy assignment is for a policy + * set. + */ + policyDefinitionReferenceId?: string; + /** + * @member {string} [tenantId] Tenant ID for the policy event record. + */ + tenantId?: string; + /** + * @member {string} [principalOid] Principal object ID for the user who + * initiated the resource operation that triggered the policy event. + */ + principalOid?: string; + /** + * @property Describes unknown properties. The value of an unknown property + * can be of "any" type. + */ + [property: string]: any; +} + +/** + * @interface + * An interface representing ExpressionEvaluationDetails. + * Evaluation details of policy language expressions. + * + */ +export interface ExpressionEvaluationDetails { + /** + * @member {string} [result] Evaluation result. + */ + result?: string; + /** + * @member {string} [expression] Expression evaluated. + */ + expression?: string; + /** + * @member {string} [path] Property path if the expression is a field or an + * alias. + */ + path?: string; + /** + * @member {any} [expressionValue] Value of the expression. + */ + expressionValue?: any; + /** + * @member {any} [targetValue] Target value to be compared with the + * expression value. + */ + targetValue?: any; + /** + * @member {string} [operator] Operator to compare the expression value and + * the target value. + */ + operator?: string; +} + +/** + * @interface + * An interface representing IfNotExistsEvaluationDetails. + * Evaluation details of IfNotExists effect. + * + */ +export interface IfNotExistsEvaluationDetails { + /** + * @member {string} [resourceId] ID of the last evaluated resource for + * IfNotExists effect. + */ + resourceId?: string; + /** + * @member {number} [totalResources] Total number of resources to which the + * existence condition is applicable. + */ + totalResources?: number; +} + +/** + * @interface + * An interface representing PolicyEvaluationDetails. + * Policy evaluation details. + * + */ +export interface PolicyEvaluationDetails { + /** + * @member {ExpressionEvaluationDetails[]} [evaluatedExpressions] Details of + * the evaluated expressions. + */ + evaluatedExpressions?: ExpressionEvaluationDetails[]; + /** + * @member {IfNotExistsEvaluationDetails} [ifNotExistsDetails] Evaluation + * details of IfNotExists effect. + */ + ifNotExistsDetails?: IfNotExistsEvaluationDetails; +} + +/** + * @interface + * An interface representing PolicyState. + * Policy state record. + * + */ +export interface PolicyState { + /** + * @member {string} [odataid] OData entity ID; always set to null since + * policy state records do not have an entity ID. + */ + odataid?: string; + /** + * @member {string} [odatacontext] OData context string; used by OData + * clients to resolve type information based on metadata. + */ + odatacontext?: string; + /** + * @member {Date} [timestamp] Timestamp for the policy state record. + */ + timestamp?: Date; + /** + * @member {string} [resourceId] Resource ID. + */ + resourceId?: string; + /** + * @member {string} [policyAssignmentId] Policy assignment ID. + */ + policyAssignmentId?: string; + /** + * @member {string} [policyDefinitionId] Policy definition ID. + */ + policyDefinitionId?: string; + /** + * @member {string} [effectiveParameters] Effective parameters for the policy + * assignment. + */ + effectiveParameters?: string; + /** + * @member {boolean} [isCompliant] Flag which states whether the resource is + * compliant against the policy assignment it was evaluated against. + */ + isCompliant?: boolean; + /** + * @member {string} [subscriptionId] Subscription ID. + */ + subscriptionId?: string; + /** + * @member {string} [resourceType] Resource type. + */ + resourceType?: string; + /** + * @member {string} [resourceLocation] Resource location. + */ + resourceLocation?: string; + /** + * @member {string} [resourceGroup] Resource group name. + */ + resourceGroup?: string; + /** + * @member {string} [resourceTags] List of resource tags. + */ + resourceTags?: string; + /** + * @member {string} [policyAssignmentName] Policy assignment name. + */ + policyAssignmentName?: string; + /** + * @member {string} [policyAssignmentOwner] Policy assignment owner. + */ + policyAssignmentOwner?: string; + /** + * @member {string} [policyAssignmentParameters] Policy assignment + * parameters. + */ + policyAssignmentParameters?: string; + /** + * @member {string} [policyAssignmentScope] Policy assignment scope. + */ + policyAssignmentScope?: string; + /** + * @member {string} [policyDefinitionName] Policy definition name. + */ + policyDefinitionName?: string; + /** + * @member {string} [policyDefinitionAction] Policy definition action, i.e. + * effect. + */ + policyDefinitionAction?: string; + /** + * @member {string} [policyDefinitionCategory] Policy definition category. + */ + policyDefinitionCategory?: string; + /** + * @member {string} [policySetDefinitionId] Policy set definition ID, if the + * policy assignment is for a policy set. + */ + policySetDefinitionId?: string; + /** + * @member {string} [policySetDefinitionName] Policy set definition name, if + * the policy assignment is for a policy set. + */ + policySetDefinitionName?: string; + /** + * @member {string} [policySetDefinitionOwner] Policy set definition owner, + * if the policy assignment is for a policy set. + */ + policySetDefinitionOwner?: string; + /** + * @member {string} [policySetDefinitionCategory] Policy set definition + * category, if the policy assignment is for a policy set. + */ + policySetDefinitionCategory?: string; + /** + * @member {string} [policySetDefinitionParameters] Policy set definition + * parameters, if the policy assignment is for a policy set. + */ + policySetDefinitionParameters?: string; + /** + * @member {string} [managementGroupIds] Comma separated list of management + * group IDs, which represent the hierarchy of the management groups the + * resource is under. + */ + managementGroupIds?: string; + /** + * @member {string} [policyDefinitionReferenceId] Reference ID for the policy + * definition inside the policy set, if the policy assignment is for a policy + * set. + */ + policyDefinitionReferenceId?: string; + /** + * @member {string} [complianceState] Compliance state of the resource. + */ + complianceState?: string; + /** + * @member {PolicyEvaluationDetails} [policyEvaluationDetails] Policy + * evaluation details. + */ + policyEvaluationDetails?: PolicyEvaluationDetails; + /** + * @property Describes unknown properties. The value of an unknown property + * can be of "any" type. + */ + [property: string]: any; +} + +/** + * @interface + * An interface representing SummaryResults. + * Non-compliance summary on a particular summary level. + * + */ +export interface SummaryResults { + /** + * @member {string} [queryResultsUri] HTTP POST URI for queryResults action + * on Microsoft.PolicyInsights to retrieve raw results for the non-compliance + * summary. + */ + queryResultsUri?: string; + /** + * @member {number} [nonCompliantResources] Number of non-compliant + * resources. + */ + nonCompliantResources?: number; + /** + * @member {number} [nonCompliantPolicies] Number of non-compliant policies. + */ + nonCompliantPolicies?: number; +} + +/** + * @interface + * An interface representing PolicyDefinitionSummary. + * Policy definition summary. + * + */ +export interface PolicyDefinitionSummary { + /** + * @member {string} [policyDefinitionId] Policy definition ID. + */ + policyDefinitionId?: string; + /** + * @member {string} [policyDefinitionReferenceId] Policy definition reference + * ID. + */ + policyDefinitionReferenceId?: string; + /** + * @member {string} [effect] Policy effect, i.e. policy definition action. + */ + effect?: string; + /** + * @member {SummaryResults} [results] Non-compliance summary for the policy + * definition. + */ + results?: SummaryResults; +} + +/** + * @interface + * An interface representing PolicyAssignmentSummary. + * Policy assignment summary. + * + */ +export interface PolicyAssignmentSummary { + /** + * @member {string} [policyAssignmentId] Policy assignment ID. + */ + policyAssignmentId?: string; + /** + * @member {string} [policySetDefinitionId] Policy set definition ID, if the + * policy assignment is for a policy set. + */ + policySetDefinitionId?: string; + /** + * @member {SummaryResults} [results] Non-compliance summary for the policy + * assignment. + */ + results?: SummaryResults; + /** + * @member {PolicyDefinitionSummary[]} [policyDefinitions] Policy definitions + * summary. + */ + policyDefinitions?: PolicyDefinitionSummary[]; +} + +/** + * @interface + * An interface representing Summary. + * Summary results. + * + */ +export interface Summary { + /** + * @member {string} [odataid] OData entity ID; always set to null since + * summaries do not have an entity ID. + */ + odataid?: string; + /** + * @member {string} [odatacontext] OData context string; used by OData + * clients to resolve type information based on metadata. + */ + odatacontext?: string; + /** + * @member {SummaryResults} [results] Non-compliance summary for all policy + * assignments. + */ + results?: SummaryResults; + /** + * @member {PolicyAssignmentSummary[]} [policyAssignments] Policy assignments + * summary. + */ + policyAssignments?: PolicyAssignmentSummary[]; +} + +/** + * @interface + * An interface representing SummarizeResults. + * Summarize action results. + * + */ +export interface SummarizeResults { + /** + * @member {string} [odatacontext] OData context string; used by OData + * clients to resolve type information based on metadata. + */ + odatacontext?: string; + /** + * @member {number} [odatacount] OData entity count; represents the number of + * summaries returned; always set to 1. + */ + odatacount?: number; + /** + * @member {Summary[]} [value] Summarize action results. + */ + value?: Summary[]; +} + +/** + * @interface + * An interface representing OperationDisplay. + * Display metadata associated with the operation. + * + */ +export interface OperationDisplay { + /** + * @member {string} [provider] Resource provider name. + */ + provider?: string; + /** + * @member {string} [resource] Resource name on which the operation is + * performed. + */ + resource?: string; + /** + * @member {string} [operation] Operation name. + */ + operation?: string; + /** + * @member {string} [description] Operation description. + */ + description?: string; +} + +/** + * @interface + * An interface representing Operation. + * Operation definition. + * + */ +export interface Operation { + /** + * @member {string} [name] Operation name. + */ + name?: string; + /** + * @member {OperationDisplay} [display] Display metadata associated with the + * operation. + */ + display?: OperationDisplay; +} + +/** + * @interface + * An interface representing OperationsListResults. + * List of available operations. + * + */ +export interface OperationsListResults { + /** + * @member {number} [odatacount] OData entity count; represents the number of + * operations returned. + */ + odatacount?: number; + /** + * @member {Operation[]} [value] List of available operations. + */ + value?: Operation[]; +} + +/** + * @interface + * An interface representing QueryOptions. + * Additional parameters for a set of operations. + * + */ +export interface QueryOptions { + /** + * @member {number} [top] Maximum number of records to return. + */ + top?: number; + /** + * @member {string} [filter] OData filter expression. + */ + filter?: string; + /** + * @member {string} [orderBy] Ordering expression using OData notation. One + * or more comma-separated column names with an optional "desc" (the default) + * or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". + */ + orderBy?: string; + /** + * @member {string} [select] Select expression using OData notation. Limits + * the columns on each record to just those requested, e.g. + * "$select=PolicyAssignmentId, ResourceId". + */ + select?: string; + /** + * @member {Date} [from] ISO 8601 formatted timestamp specifying the start + * time of the interval to query. When not specified, the service uses ($to - + * 1-day). + */ + from?: Date; + /** + * @member {Date} [to] ISO 8601 formatted timestamp specifying the end time + * of the interval to query. When not specified, the service uses request + * time. + */ + to?: Date; + /** + * @member {string} [apply] OData apply expression for aggregations. + */ + apply?: string; + /** + * @member {string} [expand] The $expand query parameter. For example, to + * expand policyEvaluationDetails, use $expand=policyEvaluationDetails + */ + expand?: string; +} + +/** + * @interface + * An interface representing PolicyTrackedResourcesListQueryResultsForManagementGroupOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyTrackedResourcesListQueryResultsForManagementGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyTrackedResourcesListQueryResultsForSubscriptionOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyTrackedResourcesListQueryResultsForSubscriptionOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyTrackedResourcesListQueryResultsForResourceGroupOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyTrackedResourcesListQueryResultsForResourceGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyTrackedResourcesListQueryResultsForResourceOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyTrackedResourcesListQueryResultsForResourceOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing RemediationsListDeploymentsAtManagementGroupOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface RemediationsListDeploymentsAtManagementGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing RemediationsListForManagementGroupOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface RemediationsListForManagementGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing RemediationsListDeploymentsAtSubscriptionOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface RemediationsListDeploymentsAtSubscriptionOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing RemediationsListForSubscriptionOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface RemediationsListForSubscriptionOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing RemediationsListDeploymentsAtResourceGroupOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface RemediationsListDeploymentsAtResourceGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing RemediationsListForResourceGroupOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface RemediationsListForResourceGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing RemediationsListDeploymentsAtResourceOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface RemediationsListDeploymentsAtResourceOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing RemediationsListForResourceOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface RemediationsListForResourceOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyEventsListQueryResultsForManagementGroupOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyEventsListQueryResultsForManagementGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyEventsListQueryResultsForSubscriptionOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyEventsListQueryResultsForSubscriptionOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyEventsListQueryResultsForResourceGroupOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyEventsListQueryResultsForResourceGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyEventsListQueryResultsForResourceOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyEventsListQueryResultsForResourceOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesListQueryResultsForManagementGroupOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesListQueryResultsForManagementGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesSummarizeForManagementGroupOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesSummarizeForManagementGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesListQueryResultsForSubscriptionOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesListQueryResultsForSubscriptionOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesSummarizeForSubscriptionOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesSummarizeForSubscriptionOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesListQueryResultsForResourceGroupOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesListQueryResultsForResourceGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesSummarizeForResourceGroupOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesSummarizeForResourceGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesListQueryResultsForResourceOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesListQueryResultsForResourceOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesSummarizeForResourceOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesSummarizeForResourceOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesSummarizeForPolicySetDefinitionOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesSummarizeForPolicySetDefinitionOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesSummarizeForPolicyDefinitionOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesSummarizeForPolicyDefinitionOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {QueryOptions} [queryOptions] Additional parameters for the + * operation + */ + queryOptions?: QueryOptions; +} + +/** + * @interface + * An interface representing PolicyInsightsClientOptions. + * @extends AzureServiceClientOptions + */ +export interface PolicyInsightsClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the PolicyTrackedResourcesQueryResults. + * Query results. + * + * @extends Array + */ +export interface PolicyTrackedResourcesQueryResults extends Array { + /** + * @member {string} [nextLink] The URL to get the next set of results. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the RemediationDeploymentsListResult. + * List of deployments for a remediation. + * + * @extends Array + */ +export interface RemediationDeploymentsListResult extends Array { + /** + * @member {string} [nextLink] The URL to get the next set of results. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the RemediationListResult. + * List of remediations. + * + * @extends Array + */ +export interface RemediationListResult extends Array { + /** + * @member {string} [nextLink] The URL to get the next set of results. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the PolicyEventsQueryResults. + * Query results. + * + * @extends Array + */ +export interface PolicyEventsQueryResults extends Array { + /** + * @member {string} [odatacontext] OData context string; used by OData + * clients to resolve type information based on metadata. + */ + odatacontext?: string; + /** + * @member {number} [odatacount] OData entity count; represents the number of + * policy event records returned. + */ + odatacount?: number; + /** + * @member {string} [odatanextLink] Odata next link, used to get the next set + * of records. + */ + odatanextLink?: string; +} + +/** + * @interface + * An interface representing the PolicyStatesQueryResults. + * Query results. + * + * @extends Array + */ +export interface PolicyStatesQueryResults extends Array { + /** + * @member {string} [odatacontext] OData context string; used by OData + * clients to resolve type information based on metadata. + */ + odatacontext?: string; + /** + * @member {number} [odatacount] OData entity count; represents the number of + * policy state records returned. + */ + odatacount?: number; + /** + * @member {string} [odatanextLink] Odata next link, used to get the next set + * of records. + */ + odatanextLink?: string; +} + +/** + * Defines values for PolicyStatesResource. + * Possible values include: 'default', 'latest' + * @readonly + * @enum {string} + */ +export type PolicyStatesResource = 'default' | 'latest'; + +/** + * Contains response data for the listQueryResultsForManagementGroup operation. + */ +export type PolicyTrackedResourcesListQueryResultsForManagementGroupResponse = PolicyTrackedResourcesQueryResults & { + /** + * 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: PolicyTrackedResourcesQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForSubscription operation. + */ +export type PolicyTrackedResourcesListQueryResultsForSubscriptionResponse = PolicyTrackedResourcesQueryResults & { + /** + * 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: PolicyTrackedResourcesQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceGroup operation. + */ +export type PolicyTrackedResourcesListQueryResultsForResourceGroupResponse = PolicyTrackedResourcesQueryResults & { + /** + * 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: PolicyTrackedResourcesQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResource operation. + */ +export type PolicyTrackedResourcesListQueryResultsForResourceResponse = PolicyTrackedResourcesQueryResults & { + /** + * 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: PolicyTrackedResourcesQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForManagementGroupNext operation. + */ +export type PolicyTrackedResourcesListQueryResultsForManagementGroupNextResponse = PolicyTrackedResourcesQueryResults & { + /** + * 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: PolicyTrackedResourcesQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForSubscriptionNext operation. + */ +export type PolicyTrackedResourcesListQueryResultsForSubscriptionNextResponse = PolicyTrackedResourcesQueryResults & { + /** + * 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: PolicyTrackedResourcesQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceGroupNext operation. + */ +export type PolicyTrackedResourcesListQueryResultsForResourceGroupNextResponse = PolicyTrackedResourcesQueryResults & { + /** + * 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: PolicyTrackedResourcesQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceNext operation. + */ +export type PolicyTrackedResourcesListQueryResultsForResourceNextResponse = PolicyTrackedResourcesQueryResults & { + /** + * 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: PolicyTrackedResourcesQueryResults; + }; +}; + +/** + * Contains response data for the listDeploymentsAtManagementGroup operation. + */ +export type RemediationsListDeploymentsAtManagementGroupResponse = RemediationDeploymentsListResult & { + /** + * 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: RemediationDeploymentsListResult; + }; +}; + +/** + * Contains response data for the cancelAtManagementGroup operation. + */ +export type RemediationsCancelAtManagementGroupResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the listForManagementGroup operation. + */ +export type RemediationsListForManagementGroupResponse = RemediationListResult & { + /** + * 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: RemediationListResult; + }; +}; + +/** + * Contains response data for the createOrUpdateAtManagementGroup operation. + */ +export type RemediationsCreateOrUpdateAtManagementGroupResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the getAtManagementGroup operation. + */ +export type RemediationsGetAtManagementGroupResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the deleteAtManagementGroup operation. + */ +export type RemediationsDeleteAtManagementGroupResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the listDeploymentsAtSubscription operation. + */ +export type RemediationsListDeploymentsAtSubscriptionResponse = RemediationDeploymentsListResult & { + /** + * 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: RemediationDeploymentsListResult; + }; +}; + +/** + * Contains response data for the cancelAtSubscription operation. + */ +export type RemediationsCancelAtSubscriptionResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the listForSubscription operation. + */ +export type RemediationsListForSubscriptionResponse = RemediationListResult & { + /** + * 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: RemediationListResult; + }; +}; + +/** + * Contains response data for the createOrUpdateAtSubscription operation. + */ +export type RemediationsCreateOrUpdateAtSubscriptionResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the getAtSubscription operation. + */ +export type RemediationsGetAtSubscriptionResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the deleteAtSubscription operation. + */ +export type RemediationsDeleteAtSubscriptionResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the listDeploymentsAtResourceGroup operation. + */ +export type RemediationsListDeploymentsAtResourceGroupResponse = RemediationDeploymentsListResult & { + /** + * 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: RemediationDeploymentsListResult; + }; +}; + +/** + * Contains response data for the cancelAtResourceGroup operation. + */ +export type RemediationsCancelAtResourceGroupResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the listForResourceGroup operation. + */ +export type RemediationsListForResourceGroupResponse = RemediationListResult & { + /** + * 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: RemediationListResult; + }; +}; + +/** + * Contains response data for the createOrUpdateAtResourceGroup operation. + */ +export type RemediationsCreateOrUpdateAtResourceGroupResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the getAtResourceGroup operation. + */ +export type RemediationsGetAtResourceGroupResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the deleteAtResourceGroup operation. + */ +export type RemediationsDeleteAtResourceGroupResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the listDeploymentsAtResource operation. + */ +export type RemediationsListDeploymentsAtResourceResponse = RemediationDeploymentsListResult & { + /** + * 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: RemediationDeploymentsListResult; + }; +}; + +/** + * Contains response data for the cancelAtResource operation. + */ +export type RemediationsCancelAtResourceResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the listForResource operation. + */ +export type RemediationsListForResourceResponse = RemediationListResult & { + /** + * 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: RemediationListResult; + }; +}; + +/** + * Contains response data for the createOrUpdateAtResource operation. + */ +export type RemediationsCreateOrUpdateAtResourceResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the getAtResource operation. + */ +export type RemediationsGetAtResourceResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the deleteAtResource operation. + */ +export type RemediationsDeleteAtResourceResponse = Remediation & { + /** + * 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: Remediation; + }; +}; + +/** + * Contains response data for the listDeploymentsAtManagementGroupNext operation. + */ +export type RemediationsListDeploymentsAtManagementGroupNextResponse = RemediationDeploymentsListResult & { + /** + * 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: RemediationDeploymentsListResult; + }; +}; + +/** + * Contains response data for the listForManagementGroupNext operation. + */ +export type RemediationsListForManagementGroupNextResponse = RemediationListResult & { + /** + * 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: RemediationListResult; + }; +}; + +/** + * Contains response data for the listDeploymentsAtSubscriptionNext operation. + */ +export type RemediationsListDeploymentsAtSubscriptionNextResponse = RemediationDeploymentsListResult & { + /** + * 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: RemediationDeploymentsListResult; + }; +}; + +/** + * Contains response data for the listForSubscriptionNext operation. + */ +export type RemediationsListForSubscriptionNextResponse = RemediationListResult & { + /** + * 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: RemediationListResult; + }; +}; + +/** + * Contains response data for the listDeploymentsAtResourceGroupNext operation. + */ +export type RemediationsListDeploymentsAtResourceGroupNextResponse = RemediationDeploymentsListResult & { + /** + * 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: RemediationDeploymentsListResult; + }; +}; + +/** + * Contains response data for the listForResourceGroupNext operation. + */ +export type RemediationsListForResourceGroupNextResponse = RemediationListResult & { + /** + * 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: RemediationListResult; + }; +}; + +/** + * Contains response data for the listDeploymentsAtResourceNext operation. + */ +export type RemediationsListDeploymentsAtResourceNextResponse = RemediationDeploymentsListResult & { + /** + * 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: RemediationDeploymentsListResult; + }; +}; + +/** + * Contains response data for the listForResourceNext operation. + */ +export type RemediationsListForResourceNextResponse = RemediationListResult & { + /** + * 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: RemediationListResult; + }; +}; + +/** + * Contains response data for the listQueryResultsForManagementGroup operation. + */ +export type PolicyEventsListQueryResultsForManagementGroupResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForSubscription operation. + */ +export type PolicyEventsListQueryResultsForSubscriptionResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceGroup operation. + */ +export type PolicyEventsListQueryResultsForResourceGroupResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResource operation. + */ +export type PolicyEventsListQueryResultsForResourceResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForPolicySetDefinition operation. + */ +export type PolicyEventsListQueryResultsForPolicySetDefinitionResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForPolicyDefinition operation. + */ +export type PolicyEventsListQueryResultsForPolicyDefinitionResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForSubscriptionLevelPolicyAssignment operation. + */ +export type PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceGroupLevelPolicyAssignment operation. + */ +export type PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the getMetadata operation. + */ +export type PolicyEventsGetMetadataResponse = { + /** + * The parsed response body. + */ + body: string; + /** + * 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: string; + }; +}; + +/** + * Contains response data for the listQueryResultsForManagementGroupNext operation. + */ +export type PolicyEventsListQueryResultsForManagementGroupNextResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForSubscriptionNext operation. + */ +export type PolicyEventsListQueryResultsForSubscriptionNextResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceGroupNext operation. + */ +export type PolicyEventsListQueryResultsForResourceGroupNextResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceNext operation. + */ +export type PolicyEventsListQueryResultsForResourceNextResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForPolicySetDefinitionNext operation. + */ +export type PolicyEventsListQueryResultsForPolicySetDefinitionNextResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForPolicyDefinitionNext operation. + */ +export type PolicyEventsListQueryResultsForPolicyDefinitionNextResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForSubscriptionLevelPolicyAssignmentNext + * operation. + */ +export type PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentNextResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceGroupLevelPolicyAssignmentNext + * operation. + */ +export type PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentNextResponse = PolicyEventsQueryResults & { + /** + * 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: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForManagementGroup operation. + */ +export type PolicyStatesListQueryResultsForManagementGroupResponse = PolicyStatesQueryResults & { + /** + * 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: PolicyStatesQueryResults; + }; +}; + +/** + * Contains response data for the summarizeForManagementGroup operation. + */ +export type PolicyStatesSummarizeForManagementGroupResponse = SummarizeResults & { + /** + * 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: SummarizeResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForSubscription operation. + */ +export type PolicyStatesListQueryResultsForSubscriptionResponse = PolicyStatesQueryResults & { + /** + * 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: PolicyStatesQueryResults; + }; +}; + +/** + * Contains response data for the summarizeForSubscription operation. + */ +export type PolicyStatesSummarizeForSubscriptionResponse = SummarizeResults & { + /** + * 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: SummarizeResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceGroup operation. + */ +export type PolicyStatesListQueryResultsForResourceGroupResponse = PolicyStatesQueryResults & { + /** + * 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: PolicyStatesQueryResults; + }; +}; + +/** + * Contains response data for the summarizeForResourceGroup operation. + */ +export type PolicyStatesSummarizeForResourceGroupResponse = SummarizeResults & { + /** + * 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: SummarizeResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResource operation. + */ +export type PolicyStatesListQueryResultsForResourceResponse = PolicyStatesQueryResults & { + /** + * 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: PolicyStatesQueryResults; + }; +}; + +/** + * Contains response data for the summarizeForResource operation. + */ +export type PolicyStatesSummarizeForResourceResponse = SummarizeResults & { + /** + * 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: SummarizeResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForPolicySetDefinition operation. + */ +export type PolicyStatesListQueryResultsForPolicySetDefinitionResponse = PolicyStatesQueryResults & { + /** + * 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: PolicyStatesQueryResults; + }; +}; + +/** + * Contains response data for the summarizeForPolicySetDefinition operation. + */ +export type PolicyStatesSummarizeForPolicySetDefinitionResponse = SummarizeResults & { + /** + * 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: SummarizeResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForPolicyDefinition operation. + */ +export type PolicyStatesListQueryResultsForPolicyDefinitionResponse = PolicyStatesQueryResults & { + /** + * 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: PolicyStatesQueryResults; + }; +}; + +/** + * Contains response data for the summarizeForPolicyDefinition operation. + */ +export type PolicyStatesSummarizeForPolicyDefinitionResponse = SummarizeResults & { + /** + * 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: SummarizeResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForSubscriptionLevelPolicyAssignment operation. + */ +export type PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentResponse = PolicyStatesQueryResults & { + /** + * 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: PolicyStatesQueryResults; + }; +}; + +/** + * Contains response data for the summarizeForSubscriptionLevelPolicyAssignment operation. + */ +export type PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentResponse = SummarizeResults & { + /** + * 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: SummarizeResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceGroupLevelPolicyAssignment operation. + */ +export type PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentResponse = PolicyStatesQueryResults & { + /** + * 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: PolicyStatesQueryResults; + }; +}; + +/** + * Contains response data for the summarizeForResourceGroupLevelPolicyAssignment operation. + */ +export type PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentResponse = SummarizeResults & { + /** + * 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: SummarizeResults; + }; +}; + +/** + * Contains response data for the getMetadata operation. + */ +export type PolicyStatesGetMetadataResponse = { + /** + * The parsed response body. + */ + body: string; + /** + * 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: string; + }; +}; + +/** + * Contains response data for the listQueryResultsForSubscriptionNext operation. + */ +export type PolicyStatesListQueryResultsForSubscriptionNextResponse = PolicyStatesQueryResults & { + /** + * 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: PolicyStatesQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceGroupNext operation. + */ +export type PolicyStatesListQueryResultsForResourceGroupNextResponse = PolicyStatesQueryResults & { + /** + * 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: PolicyStatesQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceNext operation. + */ +export type PolicyStatesListQueryResultsForResourceNextResponse = PolicyStatesQueryResults & { + /** + * 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: PolicyStatesQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForPolicySetDefinitionNext operation. + */ +export type PolicyStatesListQueryResultsForPolicySetDefinitionNextResponse = PolicyStatesQueryResults & { + /** + * 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: PolicyStatesQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForPolicyDefinitionNext operation. + */ +export type PolicyStatesListQueryResultsForPolicyDefinitionNextResponse = PolicyStatesQueryResults & { + /** + * 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: PolicyStatesQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForSubscriptionLevelPolicyAssignmentNext + * operation. + */ +export type PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentNextResponse = PolicyStatesQueryResults & { + /** + * 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: PolicyStatesQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceGroupLevelPolicyAssignmentNext + * operation. + */ +export type PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentNextResponse = PolicyStatesQueryResults & { + /** + * 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: PolicyStatesQueryResults; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationsListResults & { + /** + * 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: OperationsListResults; + }; +}; diff --git a/sdk/policyinsights/arm-policyinsights/lib/models/mappers.ts b/sdk/policyinsights/arm-policyinsights/lib/models/mappers.ts new file mode 100644 index 000000000000..625fb8990ff3 --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/models/mappers.ts @@ -0,0 +1,1461 @@ +/* + * 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 { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const PolicyDetails: msRest.CompositeMapper = { + serializedName: "PolicyDetails", + type: { + name: "Composite", + className: "PolicyDetails", + modelProperties: { + policyDefinitionId: { + readOnly: true, + serializedName: "policyDefinitionId", + type: { + name: "String" + } + }, + policyAssignmentId: { + readOnly: true, + serializedName: "policyAssignmentId", + type: { + name: "String" + } + }, + policyAssignmentDisplayName: { + readOnly: true, + serializedName: "policyAssignmentDisplayName", + type: { + name: "String" + } + }, + policyAssignmentScope: { + readOnly: true, + serializedName: "policyAssignmentScope", + type: { + name: "String" + } + }, + policySetDefinitionId: { + readOnly: true, + serializedName: "policySetDefinitionId", + type: { + name: "String" + } + }, + policyDefinitionReferenceId: { + readOnly: true, + serializedName: "policyDefinitionReferenceId", + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResourceModificationDetails: msRest.CompositeMapper = { + serializedName: "TrackedResourceModificationDetails", + type: { + name: "Composite", + className: "TrackedResourceModificationDetails", + modelProperties: { + policyDetails: { + readOnly: true, + serializedName: "policyDetails", + type: { + name: "Composite", + className: "PolicyDetails" + } + }, + deploymentId: { + readOnly: true, + serializedName: "deploymentId", + type: { + name: "String" + } + }, + deploymentTime: { + readOnly: true, + serializedName: "deploymentTime", + type: { + name: "DateTime" + } + } + } + } +}; + +export const PolicyTrackedResource: msRest.CompositeMapper = { + serializedName: "PolicyTrackedResource", + type: { + name: "Composite", + className: "PolicyTrackedResource", + modelProperties: { + trackedResourceId: { + readOnly: true, + serializedName: "trackedResourceId", + type: { + name: "String" + } + }, + policyDetails: { + readOnly: true, + serializedName: "policyDetails", + type: { + name: "Composite", + className: "PolicyDetails" + } + }, + createdBy: { + readOnly: true, + serializedName: "createdBy", + type: { + name: "Composite", + className: "TrackedResourceModificationDetails" + } + }, + lastModifiedBy: { + readOnly: true, + serializedName: "lastModifiedBy", + type: { + name: "Composite", + className: "TrackedResourceModificationDetails" + } + }, + lastUpdateUtc: { + readOnly: true, + serializedName: "lastUpdateUtc", + type: { + name: "DateTime" + } + } + } + } +}; + +export const QueryFailureError: msRest.CompositeMapper = { + serializedName: "QueryFailure_error", + type: { + name: "Composite", + className: "QueryFailureError", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const QueryFailure: msRest.CompositeMapper = { + serializedName: "QueryFailure", + type: { + name: "Composite", + className: "QueryFailure", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "QueryFailureError" + } + } + } + } +}; + +export const RemediationFilters: msRest.CompositeMapper = { + serializedName: "RemediationFilters", + type: { + name: "Composite", + className: "RemediationFilters", + modelProperties: { + locations: { + serializedName: "locations", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const RemediationDeploymentSummary: msRest.CompositeMapper = { + serializedName: "RemediationDeploymentSummary", + type: { + name: "Composite", + className: "RemediationDeploymentSummary", + modelProperties: { + totalDeployments: { + serializedName: "totalDeployments", + type: { + name: "Number" + } + }, + successfulDeployments: { + serializedName: "successfulDeployments", + type: { + name: "Number" + } + }, + failedDeployments: { + serializedName: "failedDeployments", + type: { + name: "Number" + } + } + } + } +}; + +export const Remediation: msRest.CompositeMapper = { + serializedName: "Remediation", + type: { + name: "Composite", + className: "Remediation", + modelProperties: { + policyAssignmentId: { + serializedName: "properties.policyAssignmentId", + type: { + name: "String" + } + }, + policyDefinitionReferenceId: { + serializedName: "properties.policyDefinitionReferenceId", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + createdOn: { + readOnly: true, + serializedName: "properties.createdOn", + type: { + name: "DateTime" + } + }, + lastUpdatedOn: { + readOnly: true, + serializedName: "properties.lastUpdatedOn", + type: { + name: "DateTime" + } + }, + filters: { + serializedName: "properties.filters", + type: { + name: "Composite", + className: "RemediationFilters" + } + }, + deploymentStatus: { + serializedName: "properties.deploymentStatus", + type: { + name: "Composite", + className: "RemediationDeploymentSummary" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const TypedErrorInfo: msRest.CompositeMapper = { + serializedName: "TypedErrorInfo", + type: { + name: "Composite", + className: "TypedErrorInfo", + modelProperties: { + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + info: { + readOnly: true, + serializedName: "info", + type: { + name: "Object" + } + } + } + } +}; + +export const ErrorDefinition: msRest.CompositeMapper = { + serializedName: "ErrorDefinition", + type: { + name: "Composite", + className: "ErrorDefinition", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + target: { + readOnly: true, + serializedName: "target", + type: { + name: "String" + } + }, + details: { + readOnly: true, + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDefinition" + } + } + } + }, + additionalInfo: { + readOnly: true, + serializedName: "additionalInfo", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TypedErrorInfo" + } + } + } + } + } + } +}; + +export const RemediationDeployment: msRest.CompositeMapper = { + serializedName: "RemediationDeployment", + type: { + name: "Composite", + className: "RemediationDeployment", + modelProperties: { + remediatedResourceId: { + readOnly: true, + serializedName: "remediatedResourceId", + type: { + name: "String" + } + }, + deploymentId: { + readOnly: true, + serializedName: "deploymentId", + type: { + name: "String" + } + }, + status: { + readOnly: true, + serializedName: "status", + type: { + name: "String" + } + }, + resourceLocation: { + readOnly: true, + serializedName: "resourceLocation", + type: { + name: "String" + } + }, + error: { + readOnly: true, + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDefinition" + } + }, + createdOn: { + readOnly: true, + serializedName: "createdOn", + type: { + name: "DateTime" + } + }, + lastUpdatedOn: { + readOnly: true, + serializedName: "lastUpdatedOn", + type: { + name: "DateTime" + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDefinition" + } + } + } + } +}; + +export const PolicyEvent: msRest.CompositeMapper = { + serializedName: "PolicyEvent", + type: { + name: "Composite", + className: "PolicyEvent", + modelProperties: { + odataid: { + serializedName: "@odata\\.id", + type: { + name: "String" + } + }, + odatacontext: { + serializedName: "@odata\\.context", + type: { + name: "String" + } + }, + timestamp: { + serializedName: "timestamp", + type: { + name: "DateTime" + } + }, + resourceId: { + serializedName: "resourceId", + type: { + name: "String" + } + }, + policyAssignmentId: { + serializedName: "policyAssignmentId", + type: { + name: "String" + } + }, + policyDefinitionId: { + serializedName: "policyDefinitionId", + type: { + name: "String" + } + }, + effectiveParameters: { + serializedName: "effectiveParameters", + type: { + name: "String" + } + }, + isCompliant: { + serializedName: "isCompliant", + type: { + name: "Boolean" + } + }, + subscriptionId: { + serializedName: "subscriptionId", + type: { + name: "String" + } + }, + resourceType: { + serializedName: "resourceType", + type: { + name: "String" + } + }, + resourceLocation: { + serializedName: "resourceLocation", + type: { + name: "String" + } + }, + resourceGroup: { + serializedName: "resourceGroup", + type: { + name: "String" + } + }, + resourceTags: { + serializedName: "resourceTags", + type: { + name: "String" + } + }, + policyAssignmentName: { + serializedName: "policyAssignmentName", + type: { + name: "String" + } + }, + policyAssignmentOwner: { + serializedName: "policyAssignmentOwner", + type: { + name: "String" + } + }, + policyAssignmentParameters: { + serializedName: "policyAssignmentParameters", + type: { + name: "String" + } + }, + policyAssignmentScope: { + serializedName: "policyAssignmentScope", + type: { + name: "String" + } + }, + policyDefinitionName: { + serializedName: "policyDefinitionName", + type: { + name: "String" + } + }, + policyDefinitionAction: { + serializedName: "policyDefinitionAction", + type: { + name: "String" + } + }, + policyDefinitionCategory: { + serializedName: "policyDefinitionCategory", + type: { + name: "String" + } + }, + policySetDefinitionId: { + serializedName: "policySetDefinitionId", + type: { + name: "String" + } + }, + policySetDefinitionName: { + serializedName: "policySetDefinitionName", + type: { + name: "String" + } + }, + policySetDefinitionOwner: { + serializedName: "policySetDefinitionOwner", + type: { + name: "String" + } + }, + policySetDefinitionCategory: { + serializedName: "policySetDefinitionCategory", + type: { + name: "String" + } + }, + policySetDefinitionParameters: { + serializedName: "policySetDefinitionParameters", + type: { + name: "String" + } + }, + managementGroupIds: { + serializedName: "managementGroupIds", + type: { + name: "String" + } + }, + policyDefinitionReferenceId: { + serializedName: "policyDefinitionReferenceId", + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + type: { + name: "String" + } + }, + principalOid: { + serializedName: "principalOid", + type: { + name: "String" + } + } + }, + additionalProperties: { + type: { + name: "Object" + } + } + } +}; + +export const ExpressionEvaluationDetails: msRest.CompositeMapper = { + serializedName: "ExpressionEvaluationDetails", + type: { + name: "Composite", + className: "ExpressionEvaluationDetails", + modelProperties: { + result: { + serializedName: "result", + type: { + name: "String" + } + }, + expression: { + serializedName: "expression", + type: { + name: "String" + } + }, + path: { + serializedName: "path", + type: { + name: "String" + } + }, + expressionValue: { + serializedName: "expressionValue", + type: { + name: "Object" + } + }, + targetValue: { + serializedName: "targetValue", + type: { + name: "Object" + } + }, + operator: { + serializedName: "operator", + type: { + name: "String" + } + } + } + } +}; + +export const IfNotExistsEvaluationDetails: msRest.CompositeMapper = { + serializedName: "IfNotExistsEvaluationDetails", + type: { + name: "Composite", + className: "IfNotExistsEvaluationDetails", + modelProperties: { + resourceId: { + serializedName: "resourceId", + type: { + name: "String" + } + }, + totalResources: { + serializedName: "totalResources", + type: { + name: "Number" + } + } + } + } +}; + +export const PolicyEvaluationDetails: msRest.CompositeMapper = { + serializedName: "PolicyEvaluationDetails", + type: { + name: "Composite", + className: "PolicyEvaluationDetails", + modelProperties: { + evaluatedExpressions: { + serializedName: "evaluatedExpressions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ExpressionEvaluationDetails" + } + } + } + }, + ifNotExistsDetails: { + serializedName: "ifNotExistsDetails", + type: { + name: "Composite", + className: "IfNotExistsEvaluationDetails" + } + } + } + } +}; + +export const PolicyState: msRest.CompositeMapper = { + serializedName: "PolicyState", + type: { + name: "Composite", + className: "PolicyState", + modelProperties: { + odataid: { + serializedName: "@odata\\.id", + type: { + name: "String" + } + }, + odatacontext: { + serializedName: "@odata\\.context", + type: { + name: "String" + } + }, + timestamp: { + serializedName: "timestamp", + type: { + name: "DateTime" + } + }, + resourceId: { + serializedName: "resourceId", + type: { + name: "String" + } + }, + policyAssignmentId: { + serializedName: "policyAssignmentId", + type: { + name: "String" + } + }, + policyDefinitionId: { + serializedName: "policyDefinitionId", + type: { + name: "String" + } + }, + effectiveParameters: { + serializedName: "effectiveParameters", + type: { + name: "String" + } + }, + isCompliant: { + serializedName: "isCompliant", + type: { + name: "Boolean" + } + }, + subscriptionId: { + serializedName: "subscriptionId", + type: { + name: "String" + } + }, + resourceType: { + serializedName: "resourceType", + type: { + name: "String" + } + }, + resourceLocation: { + serializedName: "resourceLocation", + type: { + name: "String" + } + }, + resourceGroup: { + serializedName: "resourceGroup", + type: { + name: "String" + } + }, + resourceTags: { + serializedName: "resourceTags", + type: { + name: "String" + } + }, + policyAssignmentName: { + serializedName: "policyAssignmentName", + type: { + name: "String" + } + }, + policyAssignmentOwner: { + serializedName: "policyAssignmentOwner", + type: { + name: "String" + } + }, + policyAssignmentParameters: { + serializedName: "policyAssignmentParameters", + type: { + name: "String" + } + }, + policyAssignmentScope: { + serializedName: "policyAssignmentScope", + type: { + name: "String" + } + }, + policyDefinitionName: { + serializedName: "policyDefinitionName", + type: { + name: "String" + } + }, + policyDefinitionAction: { + serializedName: "policyDefinitionAction", + type: { + name: "String" + } + }, + policyDefinitionCategory: { + serializedName: "policyDefinitionCategory", + type: { + name: "String" + } + }, + policySetDefinitionId: { + serializedName: "policySetDefinitionId", + type: { + name: "String" + } + }, + policySetDefinitionName: { + serializedName: "policySetDefinitionName", + type: { + name: "String" + } + }, + policySetDefinitionOwner: { + serializedName: "policySetDefinitionOwner", + type: { + name: "String" + } + }, + policySetDefinitionCategory: { + serializedName: "policySetDefinitionCategory", + type: { + name: "String" + } + }, + policySetDefinitionParameters: { + serializedName: "policySetDefinitionParameters", + type: { + name: "String" + } + }, + managementGroupIds: { + serializedName: "managementGroupIds", + type: { + name: "String" + } + }, + policyDefinitionReferenceId: { + serializedName: "policyDefinitionReferenceId", + type: { + name: "String" + } + }, + complianceState: { + serializedName: "complianceState", + type: { + name: "String" + } + }, + policyEvaluationDetails: { + serializedName: "policyEvaluationDetails", + type: { + name: "Composite", + className: "PolicyEvaluationDetails" + } + } + }, + additionalProperties: { + type: { + name: "Object" + } + } + } +}; + +export const SummaryResults: msRest.CompositeMapper = { + serializedName: "SummaryResults", + type: { + name: "Composite", + className: "SummaryResults", + modelProperties: { + queryResultsUri: { + serializedName: "queryResultsUri", + type: { + name: "String" + } + }, + nonCompliantResources: { + serializedName: "nonCompliantResources", + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: "Number" + } + }, + nonCompliantPolicies: { + serializedName: "nonCompliantPolicies", + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: "Number" + } + } + } + } +}; + +export const PolicyDefinitionSummary: msRest.CompositeMapper = { + serializedName: "PolicyDefinitionSummary", + type: { + name: "Composite", + className: "PolicyDefinitionSummary", + modelProperties: { + policyDefinitionId: { + serializedName: "policyDefinitionId", + type: { + name: "String" + } + }, + policyDefinitionReferenceId: { + serializedName: "policyDefinitionReferenceId", + type: { + name: "String" + } + }, + effect: { + serializedName: "effect", + type: { + name: "String" + } + }, + results: { + serializedName: "results", + type: { + name: "Composite", + className: "SummaryResults" + } + } + } + } +}; + +export const PolicyAssignmentSummary: msRest.CompositeMapper = { + serializedName: "PolicyAssignmentSummary", + type: { + name: "Composite", + className: "PolicyAssignmentSummary", + modelProperties: { + policyAssignmentId: { + serializedName: "policyAssignmentId", + type: { + name: "String" + } + }, + policySetDefinitionId: { + serializedName: "policySetDefinitionId", + type: { + name: "String" + } + }, + results: { + serializedName: "results", + type: { + name: "Composite", + className: "SummaryResults" + } + }, + policyDefinitions: { + serializedName: "policyDefinitions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyDefinitionSummary" + } + } + } + } + } + } +}; + +export const Summary: msRest.CompositeMapper = { + serializedName: "Summary", + type: { + name: "Composite", + className: "Summary", + modelProperties: { + odataid: { + serializedName: "@odata\\.id", + type: { + name: "String" + } + }, + odatacontext: { + serializedName: "@odata\\.context", + type: { + name: "String" + } + }, + results: { + serializedName: "results", + type: { + name: "Composite", + className: "SummaryResults" + } + }, + policyAssignments: { + serializedName: "policyAssignments", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyAssignmentSummary" + } + } + } + } + } + } +}; + +export const SummarizeResults: msRest.CompositeMapper = { + serializedName: "SummarizeResults", + type: { + name: "Composite", + className: "SummarizeResults", + modelProperties: { + odatacontext: { + serializedName: "@odata\\.context", + type: { + name: "String" + } + }, + odatacount: { + serializedName: "@odata\\.count", + constraints: { + InclusiveMaximum: 1, + InclusiveMinimum: 1 + }, + type: { + name: "Number" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Summary" + } + } + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const OperationsListResults: msRest.CompositeMapper = { + serializedName: "OperationsListResults", + type: { + name: "Composite", + className: "OperationsListResults", + modelProperties: { + odatacount: { + serializedName: "@odata\\.count", + constraints: { + InclusiveMinimum: 1 + }, + type: { + name: "Number" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + } + } + } +}; + +export const QueryOptions: msRest.CompositeMapper = { + type: { + name: "Composite", + className: "QueryOptions", + modelProperties: { + top: { + type: { + name: "Number" + } + }, + filter: { + type: { + name: "String" + } + }, + orderBy: { + type: { + name: "String" + } + }, + select: { + type: { + name: "String" + } + }, + from: { + type: { + name: "DateTime" + } + }, + to: { + type: { + name: "DateTime" + } + }, + apply: { + type: { + name: "String" + } + }, + expand: { + type: { + name: "String" + } + } + } + } +}; + +export const PolicyTrackedResourcesQueryResults: msRest.CompositeMapper = { + serializedName: "PolicyTrackedResourcesQueryResults", + type: { + name: "Composite", + className: "PolicyTrackedResourcesQueryResults", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyTrackedResource" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const RemediationDeploymentsListResult: msRest.CompositeMapper = { + serializedName: "RemediationDeploymentsListResult", + type: { + name: "Composite", + className: "RemediationDeploymentsListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RemediationDeployment" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const RemediationListResult: msRest.CompositeMapper = { + serializedName: "RemediationListResult", + type: { + name: "Composite", + className: "RemediationListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Remediation" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PolicyEventsQueryResults: msRest.CompositeMapper = { + serializedName: "PolicyEventsQueryResults", + type: { + name: "Composite", + className: "PolicyEventsQueryResults", + modelProperties: { + odatacontext: { + serializedName: "@odata\\.context", + type: { + name: "String" + } + }, + odatacount: { + serializedName: "@odata\\.count", + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: "Number" + } + }, + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyEvent", + additionalProperties: { + type: { + name: "Object" + } + } + } + } + } + }, + odatanextLink: { + serializedName: "@odata\\.nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PolicyStatesQueryResults: msRest.CompositeMapper = { + serializedName: "PolicyStatesQueryResults", + type: { + name: "Composite", + className: "PolicyStatesQueryResults", + modelProperties: { + odatacontext: { + serializedName: "@odata\\.context", + type: { + name: "String" + } + }, + odatacount: { + serializedName: "@odata\\.count", + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: "Number" + } + }, + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyState", + additionalProperties: { + type: { + name: "Object" + } + } + } + } + } + }, + odatanextLink: { + serializedName: "@odata\\.nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/policyinsights/arm-policyinsights/lib/models/operationsMappers.ts b/sdk/policyinsights/arm-policyinsights/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..0ea27c83310d --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/models/operationsMappers.ts @@ -0,0 +1,18 @@ +/* + * 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 { + OperationsListResults, + Operation, + OperationDisplay, + QueryFailure, + QueryFailureError +} from "../models/mappers"; + diff --git a/sdk/policyinsights/arm-policyinsights/lib/models/parameters.ts b/sdk/policyinsights/arm-policyinsights/lib/models/parameters.ts new file mode 100644 index 000000000000..89ae4e15f86c --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/models/parameters.ts @@ -0,0 +1,322 @@ +/* + * 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"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const apply: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "queryOptions", + "apply" + ], + mapper: { + serializedName: "$apply", + type: { + name: "String" + } + } +}; +export const authorizationNamespace: msRest.OperationURLParameter = { + parameterPath: "authorizationNamespace", + mapper: { + required: true, + isConstant: true, + serializedName: "authorizationNamespace", + defaultValue: 'Microsoft.Authorization', + type: { + name: "String" + } + } +}; +export const expand: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "queryOptions", + "expand" + ], + mapper: { + serializedName: "$expand", + type: { + name: "String" + } + } +}; +export const filter: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "queryOptions", + "filter" + ], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; +export const from: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "queryOptions", + "from" + ], + mapper: { + serializedName: "$from", + type: { + name: "DateTime" + } + } +}; +export const managementGroupId: msRest.OperationURLParameter = { + parameterPath: "managementGroupId", + mapper: { + required: true, + serializedName: "managementGroupId", + type: { + name: "String" + } + } +}; +export const managementGroupName: msRest.OperationURLParameter = { + parameterPath: "managementGroupName", + mapper: { + required: true, + serializedName: "managementGroupName", + type: { + name: "String" + } + } +}; +export const managementGroupsNamespace: msRest.OperationURLParameter = { + parameterPath: "managementGroupsNamespace", + mapper: { + required: true, + isConstant: true, + serializedName: "managementGroupsNamespace", + defaultValue: 'Microsoft.Management', + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const orderBy: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "queryOptions", + "orderBy" + ], + mapper: { + serializedName: "$orderby", + type: { + name: "String" + } + } +}; +export const policyAssignmentName: msRest.OperationURLParameter = { + parameterPath: "policyAssignmentName", + mapper: { + required: true, + serializedName: "policyAssignmentName", + type: { + name: "String" + } + } +}; +export const policyDefinitionName: msRest.OperationURLParameter = { + parameterPath: "policyDefinitionName", + mapper: { + required: true, + serializedName: "policyDefinitionName", + type: { + name: "String" + } + } +}; +export const policyEventsResource: msRest.OperationURLParameter = { + parameterPath: "policyEventsResource", + mapper: { + required: true, + isConstant: true, + serializedName: "policyEventsResource", + defaultValue: 'default', + type: { + name: "String" + } + } +}; +export const policySetDefinitionName: msRest.OperationURLParameter = { + parameterPath: "policySetDefinitionName", + mapper: { + required: true, + serializedName: "policySetDefinitionName", + type: { + name: "String" + } + } +}; +export const policyStatesResource: msRest.OperationURLParameter = { + parameterPath: "policyStatesResource", + mapper: { + required: true, + serializedName: "policyStatesResource", + type: { + name: "String" + } + } +}; +export const policyStatesSummaryResource: msRest.OperationURLParameter = { + parameterPath: "policyStatesSummaryResource", + mapper: { + required: true, + isConstant: true, + serializedName: "policyStatesSummaryResource", + defaultValue: 'latest', + type: { + name: "String" + } + } +}; +export const policyTrackedResourcesResource: msRest.OperationURLParameter = { + parameterPath: "policyTrackedResourcesResource", + mapper: { + required: true, + isConstant: true, + serializedName: "policyTrackedResourcesResource", + defaultValue: 'default', + type: { + name: "String" + } + } +}; +export const remediationName: msRest.OperationURLParameter = { + parameterPath: "remediationName", + mapper: { + required: true, + serializedName: "remediationName", + type: { + name: "String" + } + } +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + type: { + name: "String" + } + } +}; +export const resourceId: msRest.OperationURLParameter = { + parameterPath: "resourceId", + mapper: { + required: true, + serializedName: "resourceId", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const scope: msRest.OperationURLParameter = { + parameterPath: "scope", + mapper: { + required: true, + serializedName: "scope", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const select: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "queryOptions", + "select" + ], + mapper: { + serializedName: "$select", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; +export const to: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "queryOptions", + "to" + ], + mapper: { + serializedName: "$to", + type: { + name: "DateTime" + } + } +}; +export const top: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "queryOptions", + "top" + ], + mapper: { + serializedName: "$top", + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: "Number" + } + } +}; diff --git a/sdk/policyinsights/arm-policyinsights/lib/models/policyEventsMappers.ts b/sdk/policyinsights/arm-policyinsights/lib/models/policyEventsMappers.ts new file mode 100644 index 000000000000..8fab1b4dd17c --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/models/policyEventsMappers.ts @@ -0,0 +1,17 @@ +/* + * 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 { + PolicyEventsQueryResults, + PolicyEvent, + QueryFailure, + QueryFailureError +} from "../models/mappers"; + diff --git a/sdk/policyinsights/arm-policyinsights/lib/models/policyStatesMappers.ts b/sdk/policyinsights/arm-policyinsights/lib/models/policyStatesMappers.ts new file mode 100644 index 000000000000..05748795e695 --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/models/policyStatesMappers.ts @@ -0,0 +1,25 @@ +/* + * 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 { + PolicyStatesQueryResults, + PolicyState, + PolicyEvaluationDetails, + ExpressionEvaluationDetails, + IfNotExistsEvaluationDetails, + QueryFailure, + QueryFailureError, + SummarizeResults, + Summary, + SummaryResults, + PolicyAssignmentSummary, + PolicyDefinitionSummary +} from "../models/mappers"; + diff --git a/sdk/policyinsights/arm-policyinsights/lib/models/policyTrackedResourcesMappers.ts b/sdk/policyinsights/arm-policyinsights/lib/models/policyTrackedResourcesMappers.ts new file mode 100644 index 000000000000..7fdc719c8ea1 --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/models/policyTrackedResourcesMappers.ts @@ -0,0 +1,19 @@ +/* + * 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 { + PolicyTrackedResourcesQueryResults, + PolicyTrackedResource, + PolicyDetails, + TrackedResourceModificationDetails, + QueryFailure, + QueryFailureError +} from "../models/mappers"; + diff --git a/sdk/policyinsights/arm-policyinsights/lib/models/remediationsMappers.ts b/sdk/policyinsights/arm-policyinsights/lib/models/remediationsMappers.ts new file mode 100644 index 000000000000..3b73015e520b --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/models/remediationsMappers.ts @@ -0,0 +1,23 @@ +/* + * 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 { + RemediationDeploymentsListResult, + RemediationDeployment, + ErrorDefinition, + TypedErrorInfo, + ErrorResponse, + Remediation, + BaseResource, + RemediationFilters, + RemediationDeploymentSummary, + RemediationListResult +} from "../models/mappers"; + diff --git a/sdk/policyinsights/arm-policyinsights/lib/operations/index.ts b/sdk/policyinsights/arm-policyinsights/lib/operations/index.ts new file mode 100644 index 000000000000..223516d3938e --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/operations/index.ts @@ -0,0 +1,15 @@ +/* + * 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 * from "./policyTrackedResources"; +export * from "./remediations"; +export * from "./policyEvents"; +export * from "./policyStates"; +export * from "./operations"; diff --git a/sdk/policyinsights/arm-policyinsights/lib/operations/operations.ts b/sdk/policyinsights/arm-policyinsights/lib/operations/operations.ts new file mode 100644 index 000000000000..c3b552c19e81 --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/operations/operations.ts @@ -0,0 +1,74 @@ +/* + * 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/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { PolicyInsightsClientContext } from "../policyInsightsClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: PolicyInsightsClientContext; + + /** + * Create a Operations. + * @param {PolicyInsightsClientContext} client Reference to the service client. + */ + constructor(client: PolicyInsightsClientContext) { + this.client = client; + } + + /** + * Lists available operations. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.PolicyInsights/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationsListResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; diff --git a/sdk/policyinsights/arm-policyinsights/lib/operations/policyEvents.ts b/sdk/policyinsights/arm-policyinsights/lib/operations/policyEvents.ts new file mode 100644 index 000000000000..0de9550bfcce --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/operations/policyEvents.ts @@ -0,0 +1,992 @@ +/* + * 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/policyEventsMappers"; +import * as Parameters from "../models/parameters"; +import { PolicyInsightsClientContext } from "../policyInsightsClientContext"; + +/** Class representing a PolicyEvents. */ +export class PolicyEvents { + private readonly client: PolicyInsightsClientContext; + + /** + * Create a PolicyEvents. + * @param {PolicyInsightsClientContext} client Reference to the service client. + */ + constructor(client: PolicyInsightsClientContext) { + this.client = client; + } + + /** + * Queries policy events for the resources under the management group. + * @param managementGroupName Management group name. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForManagementGroup(managementGroupName: string, options?: Models.PolicyEventsListQueryResultsForManagementGroupOptionalParams): Promise; + /** + * @param managementGroupName Management group name. + * @param callback The callback + */ + listQueryResultsForManagementGroup(managementGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param managementGroupName Management group name. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForManagementGroup(managementGroupName: string, options: Models.PolicyEventsListQueryResultsForManagementGroupOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForManagementGroup(managementGroupName: string, options?: Models.PolicyEventsListQueryResultsForManagementGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + managementGroupName, + options + }, + listQueryResultsForManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * Queries policy events for the resources under the subscription. + * @param subscriptionId Microsoft Azure subscription ID. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForSubscription(subscriptionId: string, options?: Models.PolicyEventsListQueryResultsForSubscriptionOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param callback The callback + */ + listQueryResultsForSubscription(subscriptionId: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForSubscription(subscriptionId: string, options: Models.PolicyEventsListQueryResultsForSubscriptionOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForSubscription(subscriptionId: string, options?: Models.PolicyEventsListQueryResultsForSubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + options + }, + listQueryResultsForSubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Queries policy events for the resources under the resource group. + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForResourceGroup(subscriptionId: string, resourceGroupName: string, options?: Models.PolicyEventsListQueryResultsForResourceGroupOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param callback The callback + */ + listQueryResultsForResourceGroup(subscriptionId: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForResourceGroup(subscriptionId: string, resourceGroupName: string, options: Models.PolicyEventsListQueryResultsForResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForResourceGroup(subscriptionId: string, resourceGroupName: string, options?: Models.PolicyEventsListQueryResultsForResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + resourceGroupName, + options + }, + listQueryResultsForResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Queries policy events for the resource. + * @param resourceId Resource ID. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForResource(resourceId: string, options?: Models.PolicyEventsListQueryResultsForResourceOptionalParams): Promise; + /** + * @param resourceId Resource ID. + * @param callback The callback + */ + listQueryResultsForResource(resourceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceId Resource ID. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForResource(resourceId: string, options: Models.PolicyEventsListQueryResultsForResourceOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForResource(resourceId: string, options?: Models.PolicyEventsListQueryResultsForResourceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceId, + options + }, + listQueryResultsForResourceOperationSpec, + callback) as Promise; + } + + /** + * Queries policy events for the subscription level policy set definition. + * @param subscriptionId Microsoft Azure subscription ID. + * @param policySetDefinitionName Policy set definition name. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForPolicySetDefinition(subscriptionId: string, policySetDefinitionName: string, options?: Models.PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param policySetDefinitionName Policy set definition name. + * @param callback The callback + */ + listQueryResultsForPolicySetDefinition(subscriptionId: string, policySetDefinitionName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param policySetDefinitionName Policy set definition name. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForPolicySetDefinition(subscriptionId: string, policySetDefinitionName: string, options: Models.PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForPolicySetDefinition(subscriptionId: string, policySetDefinitionName: string, options?: Models.PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + policySetDefinitionName, + options + }, + listQueryResultsForPolicySetDefinitionOperationSpec, + callback) as Promise; + } + + /** + * Queries policy events for the subscription level policy definition. + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyDefinitionName Policy definition name. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForPolicyDefinition(subscriptionId: string, policyDefinitionName: string, options?: Models.PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyDefinitionName Policy definition name. + * @param callback The callback + */ + listQueryResultsForPolicyDefinition(subscriptionId: string, policyDefinitionName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyDefinitionName Policy definition name. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForPolicyDefinition(subscriptionId: string, policyDefinitionName: string, options: Models.PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForPolicyDefinition(subscriptionId: string, policyDefinitionName: string, options?: Models.PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + policyDefinitionName, + options + }, + listQueryResultsForPolicyDefinitionOperationSpec, + callback) as Promise; + } + + /** + * Queries policy events for the subscription level policy assignment. + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyAssignmentName Policy assignment name. + * @param [options] The optional parameters + * @returns + * Promise + */ + listQueryResultsForSubscriptionLevelPolicyAssignment(subscriptionId: string, policyAssignmentName: string, options?: Models.PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyAssignmentName Policy assignment name. + * @param callback The callback + */ + listQueryResultsForSubscriptionLevelPolicyAssignment(subscriptionId: string, policyAssignmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyAssignmentName Policy assignment name. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForSubscriptionLevelPolicyAssignment(subscriptionId: string, policyAssignmentName: string, options: Models.PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForSubscriptionLevelPolicyAssignment(subscriptionId: string, policyAssignmentName: string, options?: Models.PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + policyAssignmentName, + options + }, + listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec, + callback) as Promise; + } + + /** + * Queries policy events for the resource group level policy assignment. + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param policyAssignmentName Policy assignment name. + * @param [options] The optional parameters + * @returns + * Promise + */ + listQueryResultsForResourceGroupLevelPolicyAssignment(subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, options?: Models.PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param policyAssignmentName Policy assignment name. + * @param callback The callback + */ + listQueryResultsForResourceGroupLevelPolicyAssignment(subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param policyAssignmentName Policy assignment name. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForResourceGroupLevelPolicyAssignment(subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, options: Models.PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForResourceGroupLevelPolicyAssignment(subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, options?: Models.PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + resourceGroupName, + policyAssignmentName, + options + }, + listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec, + callback) as Promise; + } + + /** + * Gets OData metadata XML document. + * @param scope A valid scope, i.e. management group, subscription, resource group, or resource ID. + * Scope used has no effect on metadata returned. + * @param [options] The optional parameters + * @returns Promise + */ + getMetadata(scope: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope A valid scope, i.e. management group, subscription, resource group, or resource ID. + * Scope used has no effect on metadata returned. + * @param callback The callback + */ + getMetadata(scope: string, callback: msRest.ServiceCallback): void; + /** + * @param scope A valid scope, i.e. management group, subscription, resource group, or resource ID. + * Scope used has no effect on metadata returned. + * @param options The optional parameters + * @param callback The callback + */ + getMetadata(scope: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getMetadata(scope: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + options + }, + getMetadataOperationSpec, + callback) as Promise; + } + + /** + * Queries policy events for the resources under the management group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForManagementGroupNext(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 + */ + listQueryResultsForManagementGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForManagementGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy events for the resources under the subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForSubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForSubscriptionNext(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 + */ + listQueryResultsForSubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForSubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForSubscriptionNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy events for the resources under the resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForResourceGroupNext(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 + */ + listQueryResultsForResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy events for the resource. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForResourceNext(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 + */ + listQueryResultsForResourceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForResourceNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy events for the subscription level policy set definition. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForPolicySetDefinitionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForPolicySetDefinitionNext(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 + */ + listQueryResultsForPolicySetDefinitionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForPolicySetDefinitionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForPolicySetDefinitionNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy events for the subscription level policy definition. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForPolicyDefinitionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForPolicyDefinitionNext(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 + */ + listQueryResultsForPolicyDefinitionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForPolicyDefinitionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForPolicyDefinitionNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy events for the subscription level policy assignment. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns + * Promise + */ + listQueryResultsForSubscriptionLevelPolicyAssignmentNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForSubscriptionLevelPolicyAssignmentNext(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 + */ + listQueryResultsForSubscriptionLevelPolicyAssignmentNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForSubscriptionLevelPolicyAssignmentNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForSubscriptionLevelPolicyAssignmentNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy events for the resource group level policy assignment. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns + * Promise + */ + listQueryResultsForResourceGroupLevelPolicyAssignmentNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForResourceGroupLevelPolicyAssignmentNext(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 + */ + listQueryResultsForResourceGroupLevelPolicyAssignmentNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForResourceGroupLevelPolicyAssignmentNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForResourceGroupLevelPolicyAssignmentNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listQueryResultsForManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", + urlParameters: [ + Parameters.policyEventsResource, + Parameters.managementGroupsNamespace, + Parameters.managementGroupName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", + urlParameters: [ + Parameters.policyEventsResource, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", + urlParameters: [ + Parameters.policyEventsResource, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "{resourceId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", + urlParameters: [ + Parameters.policyEventsResource, + Parameters.resourceId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForPolicySetDefinitionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", + urlParameters: [ + Parameters.policyEventsResource, + Parameters.subscriptionId, + Parameters.authorizationNamespace, + Parameters.policySetDefinitionName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForPolicyDefinitionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", + urlParameters: [ + Parameters.policyEventsResource, + Parameters.subscriptionId, + Parameters.authorizationNamespace, + Parameters.policyDefinitionName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", + urlParameters: [ + Parameters.policyEventsResource, + Parameters.subscriptionId, + Parameters.authorizationNamespace, + Parameters.policyAssignmentName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", + urlParameters: [ + Parameters.policyEventsResource, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.authorizationNamespace, + Parameters.policyAssignmentName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const getMetadataOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{scope}/providers/Microsoft.PolicyInsights/policyEvents/$metadata", + urlParameters: [ + Parameters.scope + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "String" + } + } + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForManagementGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForSubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForPolicySetDefinitionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForPolicyDefinitionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForSubscriptionLevelPolicyAssignmentNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceGroupLevelPolicyAssignmentNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyEventsQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; diff --git a/sdk/policyinsights/arm-policyinsights/lib/operations/policyStates.ts b/sdk/policyinsights/arm-policyinsights/lib/operations/policyStates.ts new file mode 100644 index 000000000000..8e384bb401c3 --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/operations/policyStates.ts @@ -0,0 +1,1507 @@ +/* + * 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/policyStatesMappers"; +import * as Parameters from "../models/parameters"; +import { PolicyInsightsClientContext } from "../policyInsightsClientContext"; + +/** Class representing a PolicyStates. */ +export class PolicyStates { + private readonly client: PolicyInsightsClientContext; + + /** + * Create a PolicyStates. + * @param {PolicyInsightsClientContext} client Reference to the service client. + */ + constructor(client: PolicyInsightsClientContext) { + this.client = client; + } + + /** + * Queries policy states for the resources under the management group. + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param managementGroupName Management group name. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForManagementGroup(policyStatesResource: Models.PolicyStatesResource, managementGroupName: string, options?: Models.PolicyStatesListQueryResultsForManagementGroupOptionalParams): Promise; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param managementGroupName Management group name. + * @param callback The callback + */ + listQueryResultsForManagementGroup(policyStatesResource: Models.PolicyStatesResource, managementGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param managementGroupName Management group name. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForManagementGroup(policyStatesResource: Models.PolicyStatesResource, managementGroupName: string, options: Models.PolicyStatesListQueryResultsForManagementGroupOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForManagementGroup(policyStatesResource: Models.PolicyStatesResource, managementGroupName: string, options?: Models.PolicyStatesListQueryResultsForManagementGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyStatesResource, + managementGroupName, + options + }, + listQueryResultsForManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * Summarizes policy states for the resources under the management group. + * @param managementGroupName Management group name. + * @param [options] The optional parameters + * @returns Promise + */ + summarizeForManagementGroup(managementGroupName: string, options?: Models.PolicyStatesSummarizeForManagementGroupOptionalParams): Promise; + /** + * @param managementGroupName Management group name. + * @param callback The callback + */ + summarizeForManagementGroup(managementGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param managementGroupName Management group name. + * @param options The optional parameters + * @param callback The callback + */ + summarizeForManagementGroup(managementGroupName: string, options: Models.PolicyStatesSummarizeForManagementGroupOptionalParams, callback: msRest.ServiceCallback): void; + summarizeForManagementGroup(managementGroupName: string, options?: Models.PolicyStatesSummarizeForManagementGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + managementGroupName, + options + }, + summarizeForManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * Queries policy states for the resources under the subscription. + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForSubscription(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, options?: Models.PolicyStatesListQueryResultsForSubscriptionOptionalParams): Promise; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param callback The callback + */ + listQueryResultsForSubscription(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, callback: msRest.ServiceCallback): void; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForSubscription(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, options: Models.PolicyStatesListQueryResultsForSubscriptionOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForSubscription(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, options?: Models.PolicyStatesListQueryResultsForSubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyStatesResource, + subscriptionId, + options + }, + listQueryResultsForSubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Summarizes policy states for the resources under the subscription. + * @param subscriptionId Microsoft Azure subscription ID. + * @param [options] The optional parameters + * @returns Promise + */ + summarizeForSubscription(subscriptionId: string, options?: Models.PolicyStatesSummarizeForSubscriptionOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param callback The callback + */ + summarizeForSubscription(subscriptionId: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param options The optional parameters + * @param callback The callback + */ + summarizeForSubscription(subscriptionId: string, options: Models.PolicyStatesSummarizeForSubscriptionOptionalParams, callback: msRest.ServiceCallback): void; + summarizeForSubscription(subscriptionId: string, options?: Models.PolicyStatesSummarizeForSubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + options + }, + summarizeForSubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Queries policy states for the resources under the resource group. + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForResourceGroup(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, resourceGroupName: string, options?: Models.PolicyStatesListQueryResultsForResourceGroupOptionalParams): Promise; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param callback The callback + */ + listQueryResultsForResourceGroup(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForResourceGroup(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, resourceGroupName: string, options: Models.PolicyStatesListQueryResultsForResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForResourceGroup(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, resourceGroupName: string, options?: Models.PolicyStatesListQueryResultsForResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyStatesResource, + subscriptionId, + resourceGroupName, + options + }, + listQueryResultsForResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Summarizes policy states for the resources under the resource group. + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param [options] The optional parameters + * @returns Promise + */ + summarizeForResourceGroup(subscriptionId: string, resourceGroupName: string, options?: Models.PolicyStatesSummarizeForResourceGroupOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param callback The callback + */ + summarizeForResourceGroup(subscriptionId: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param options The optional parameters + * @param callback The callback + */ + summarizeForResourceGroup(subscriptionId: string, resourceGroupName: string, options: Models.PolicyStatesSummarizeForResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + summarizeForResourceGroup(subscriptionId: string, resourceGroupName: string, options?: Models.PolicyStatesSummarizeForResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + resourceGroupName, + options + }, + summarizeForResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Queries policy states for the resource. + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param resourceId Resource ID. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForResource(policyStatesResource: Models.PolicyStatesResource, resourceId: string, options?: Models.PolicyStatesListQueryResultsForResourceOptionalParams): Promise; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param resourceId Resource ID. + * @param callback The callback + */ + listQueryResultsForResource(policyStatesResource: Models.PolicyStatesResource, resourceId: string, callback: msRest.ServiceCallback): void; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param resourceId Resource ID. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForResource(policyStatesResource: Models.PolicyStatesResource, resourceId: string, options: Models.PolicyStatesListQueryResultsForResourceOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForResource(policyStatesResource: Models.PolicyStatesResource, resourceId: string, options?: Models.PolicyStatesListQueryResultsForResourceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyStatesResource, + resourceId, + options + }, + listQueryResultsForResourceOperationSpec, + callback) as Promise; + } + + /** + * Summarizes policy states for the resource. + * @param resourceId Resource ID. + * @param [options] The optional parameters + * @returns Promise + */ + summarizeForResource(resourceId: string, options?: Models.PolicyStatesSummarizeForResourceOptionalParams): Promise; + /** + * @param resourceId Resource ID. + * @param callback The callback + */ + summarizeForResource(resourceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceId Resource ID. + * @param options The optional parameters + * @param callback The callback + */ + summarizeForResource(resourceId: string, options: Models.PolicyStatesSummarizeForResourceOptionalParams, callback: msRest.ServiceCallback): void; + summarizeForResource(resourceId: string, options?: Models.PolicyStatesSummarizeForResourceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceId, + options + }, + summarizeForResourceOperationSpec, + callback) as Promise; + } + + /** + * Queries policy states for the subscription level policy set definition. + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param policySetDefinitionName Policy set definition name. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForPolicySetDefinition(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, policySetDefinitionName: string, options?: Models.PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams): Promise; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param policySetDefinitionName Policy set definition name. + * @param callback The callback + */ + listQueryResultsForPolicySetDefinition(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, policySetDefinitionName: string, callback: msRest.ServiceCallback): void; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param policySetDefinitionName Policy set definition name. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForPolicySetDefinition(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, policySetDefinitionName: string, options: Models.PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForPolicySetDefinition(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, policySetDefinitionName: string, options?: Models.PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyStatesResource, + subscriptionId, + policySetDefinitionName, + options + }, + listQueryResultsForPolicySetDefinitionOperationSpec, + callback) as Promise; + } + + /** + * Summarizes policy states for the subscription level policy set definition. + * @param subscriptionId Microsoft Azure subscription ID. + * @param policySetDefinitionName Policy set definition name. + * @param [options] The optional parameters + * @returns Promise + */ + summarizeForPolicySetDefinition(subscriptionId: string, policySetDefinitionName: string, options?: Models.PolicyStatesSummarizeForPolicySetDefinitionOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param policySetDefinitionName Policy set definition name. + * @param callback The callback + */ + summarizeForPolicySetDefinition(subscriptionId: string, policySetDefinitionName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param policySetDefinitionName Policy set definition name. + * @param options The optional parameters + * @param callback The callback + */ + summarizeForPolicySetDefinition(subscriptionId: string, policySetDefinitionName: string, options: Models.PolicyStatesSummarizeForPolicySetDefinitionOptionalParams, callback: msRest.ServiceCallback): void; + summarizeForPolicySetDefinition(subscriptionId: string, policySetDefinitionName: string, options?: Models.PolicyStatesSummarizeForPolicySetDefinitionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + policySetDefinitionName, + options + }, + summarizeForPolicySetDefinitionOperationSpec, + callback) as Promise; + } + + /** + * Queries policy states for the subscription level policy definition. + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyDefinitionName Policy definition name. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForPolicyDefinition(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, policyDefinitionName: string, options?: Models.PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams): Promise; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyDefinitionName Policy definition name. + * @param callback The callback + */ + listQueryResultsForPolicyDefinition(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, policyDefinitionName: string, callback: msRest.ServiceCallback): void; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyDefinitionName Policy definition name. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForPolicyDefinition(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, policyDefinitionName: string, options: Models.PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForPolicyDefinition(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, policyDefinitionName: string, options?: Models.PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyStatesResource, + subscriptionId, + policyDefinitionName, + options + }, + listQueryResultsForPolicyDefinitionOperationSpec, + callback) as Promise; + } + + /** + * Summarizes policy states for the subscription level policy definition. + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyDefinitionName Policy definition name. + * @param [options] The optional parameters + * @returns Promise + */ + summarizeForPolicyDefinition(subscriptionId: string, policyDefinitionName: string, options?: Models.PolicyStatesSummarizeForPolicyDefinitionOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyDefinitionName Policy definition name. + * @param callback The callback + */ + summarizeForPolicyDefinition(subscriptionId: string, policyDefinitionName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyDefinitionName Policy definition name. + * @param options The optional parameters + * @param callback The callback + */ + summarizeForPolicyDefinition(subscriptionId: string, policyDefinitionName: string, options: Models.PolicyStatesSummarizeForPolicyDefinitionOptionalParams, callback: msRest.ServiceCallback): void; + summarizeForPolicyDefinition(subscriptionId: string, policyDefinitionName: string, options?: Models.PolicyStatesSummarizeForPolicyDefinitionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + policyDefinitionName, + options + }, + summarizeForPolicyDefinitionOperationSpec, + callback) as Promise; + } + + /** + * Queries policy states for the subscription level policy assignment. + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyAssignmentName Policy assignment name. + * @param [options] The optional parameters + * @returns + * Promise + */ + listQueryResultsForSubscriptionLevelPolicyAssignment(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, policyAssignmentName: string, options?: Models.PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams): Promise; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyAssignmentName Policy assignment name. + * @param callback The callback + */ + listQueryResultsForSubscriptionLevelPolicyAssignment(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, policyAssignmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyAssignmentName Policy assignment name. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForSubscriptionLevelPolicyAssignment(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, policyAssignmentName: string, options: Models.PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForSubscriptionLevelPolicyAssignment(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, policyAssignmentName: string, options?: Models.PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyStatesResource, + subscriptionId, + policyAssignmentName, + options + }, + listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec, + callback) as Promise; + } + + /** + * Summarizes policy states for the subscription level policy assignment. + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyAssignmentName Policy assignment name. + * @param [options] The optional parameters + * @returns Promise + */ + summarizeForSubscriptionLevelPolicyAssignment(subscriptionId: string, policyAssignmentName: string, options?: Models.PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyAssignmentName Policy assignment name. + * @param callback The callback + */ + summarizeForSubscriptionLevelPolicyAssignment(subscriptionId: string, policyAssignmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param policyAssignmentName Policy assignment name. + * @param options The optional parameters + * @param callback The callback + */ + summarizeForSubscriptionLevelPolicyAssignment(subscriptionId: string, policyAssignmentName: string, options: Models.PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentOptionalParams, callback: msRest.ServiceCallback): void; + summarizeForSubscriptionLevelPolicyAssignment(subscriptionId: string, policyAssignmentName: string, options?: Models.PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + policyAssignmentName, + options + }, + summarizeForSubscriptionLevelPolicyAssignmentOperationSpec, + callback) as Promise; + } + + /** + * Queries policy states for the resource group level policy assignment. + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param policyAssignmentName Policy assignment name. + * @param [options] The optional parameters + * @returns + * Promise + */ + listQueryResultsForResourceGroupLevelPolicyAssignment(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, options?: Models.PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams): Promise; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param policyAssignmentName Policy assignment name. + * @param callback The callback + */ + listQueryResultsForResourceGroupLevelPolicyAssignment(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given + * time range, 'latest' represents the latest policy state(s), whereas 'default' represents all + * policy state(s). Possible values include: 'default', 'latest' + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param policyAssignmentName Policy assignment name. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForResourceGroupLevelPolicyAssignment(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, options: Models.PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForResourceGroupLevelPolicyAssignment(policyStatesResource: Models.PolicyStatesResource, subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, options?: Models.PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyStatesResource, + subscriptionId, + resourceGroupName, + policyAssignmentName, + options + }, + listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec, + callback) as Promise; + } + + /** + * Summarizes policy states for the resource group level policy assignment. + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param policyAssignmentName Policy assignment name. + * @param [options] The optional parameters + * @returns Promise + */ + summarizeForResourceGroupLevelPolicyAssignment(subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, options?: Models.PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param policyAssignmentName Policy assignment name. + * @param callback The callback + */ + summarizeForResourceGroupLevelPolicyAssignment(subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param policyAssignmentName Policy assignment name. + * @param options The optional parameters + * @param callback The callback + */ + summarizeForResourceGroupLevelPolicyAssignment(subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, options: Models.PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentOptionalParams, callback: msRest.ServiceCallback): void; + summarizeForResourceGroupLevelPolicyAssignment(subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, options?: Models.PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + resourceGroupName, + policyAssignmentName, + options + }, + summarizeForResourceGroupLevelPolicyAssignmentOperationSpec, + callback) as Promise; + } + + /** + * Gets OData metadata XML document. + * @param scope A valid scope, i.e. management group, subscription, resource group, or resource ID. + * Scope used has no effect on metadata returned. + * @param [options] The optional parameters + * @returns Promise + */ + getMetadata(scope: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope A valid scope, i.e. management group, subscription, resource group, or resource ID. + * Scope used has no effect on metadata returned. + * @param callback The callback + */ + getMetadata(scope: string, callback: msRest.ServiceCallback): void; + /** + * @param scope A valid scope, i.e. management group, subscription, resource group, or resource ID. + * Scope used has no effect on metadata returned. + * @param options The optional parameters + * @param callback The callback + */ + getMetadata(scope: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getMetadata(scope: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + options + }, + getMetadataOperationSpec, + callback) as Promise; + } + + /** + * Queries policy states for the resources under the subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForSubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForSubscriptionNext(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 + */ + listQueryResultsForSubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForSubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForSubscriptionNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy states for the resources under the resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForResourceGroupNext(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 + */ + listQueryResultsForResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy states for the resource. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForResourceNext(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 + */ + listQueryResultsForResourceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForResourceNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy states for the subscription level policy set definition. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForPolicySetDefinitionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForPolicySetDefinitionNext(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 + */ + listQueryResultsForPolicySetDefinitionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForPolicySetDefinitionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForPolicySetDefinitionNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy states for the subscription level policy definition. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForPolicyDefinitionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForPolicyDefinitionNext(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 + */ + listQueryResultsForPolicyDefinitionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForPolicyDefinitionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForPolicyDefinitionNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy states for the subscription level policy assignment. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns + * Promise + */ + listQueryResultsForSubscriptionLevelPolicyAssignmentNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForSubscriptionLevelPolicyAssignmentNext(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 + */ + listQueryResultsForSubscriptionLevelPolicyAssignmentNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForSubscriptionLevelPolicyAssignmentNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForSubscriptionLevelPolicyAssignmentNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy states for the resource group level policy assignment. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns + * Promise + */ + listQueryResultsForResourceGroupLevelPolicyAssignmentNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForResourceGroupLevelPolicyAssignmentNext(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 + */ + listQueryResultsForResourceGroupLevelPolicyAssignmentNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForResourceGroupLevelPolicyAssignmentNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForResourceGroupLevelPolicyAssignmentNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listQueryResultsForManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", + urlParameters: [ + Parameters.policyStatesResource, + Parameters.managementGroupsNamespace, + Parameters.managementGroupName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyStatesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const summarizeForManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", + urlParameters: [ + Parameters.policyStatesSummaryResource, + Parameters.managementGroupsNamespace, + Parameters.managementGroupName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.from, + Parameters.to, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SummarizeResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", + urlParameters: [ + Parameters.policyStatesResource, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyStatesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const summarizeForSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", + urlParameters: [ + Parameters.policyStatesSummaryResource, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.from, + Parameters.to, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SummarizeResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", + urlParameters: [ + Parameters.policyStatesResource, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyStatesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const summarizeForResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", + urlParameters: [ + Parameters.policyStatesSummaryResource, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.from, + Parameters.to, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SummarizeResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", + urlParameters: [ + Parameters.policyStatesResource, + Parameters.resourceId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply, + Parameters.expand + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyStatesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const summarizeForResourceOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", + urlParameters: [ + Parameters.policyStatesSummaryResource, + Parameters.resourceId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.from, + Parameters.to, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SummarizeResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForPolicySetDefinitionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", + urlParameters: [ + Parameters.policyStatesResource, + Parameters.subscriptionId, + Parameters.authorizationNamespace, + Parameters.policySetDefinitionName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyStatesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const summarizeForPolicySetDefinitionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", + urlParameters: [ + Parameters.policyStatesSummaryResource, + Parameters.subscriptionId, + Parameters.authorizationNamespace, + Parameters.policySetDefinitionName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.from, + Parameters.to, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SummarizeResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForPolicyDefinitionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", + urlParameters: [ + Parameters.policyStatesResource, + Parameters.subscriptionId, + Parameters.authorizationNamespace, + Parameters.policyDefinitionName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyStatesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const summarizeForPolicyDefinitionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", + urlParameters: [ + Parameters.policyStatesSummaryResource, + Parameters.subscriptionId, + Parameters.authorizationNamespace, + Parameters.policyDefinitionName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.from, + Parameters.to, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SummarizeResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", + urlParameters: [ + Parameters.policyStatesResource, + Parameters.subscriptionId, + Parameters.authorizationNamespace, + Parameters.policyAssignmentName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyStatesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const summarizeForSubscriptionLevelPolicyAssignmentOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", + urlParameters: [ + Parameters.policyStatesSummaryResource, + Parameters.subscriptionId, + Parameters.authorizationNamespace, + Parameters.policyAssignmentName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.from, + Parameters.to, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SummarizeResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", + urlParameters: [ + Parameters.policyStatesResource, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.authorizationNamespace, + Parameters.policyAssignmentName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.orderBy, + Parameters.select, + Parameters.from, + Parameters.to, + Parameters.filter, + Parameters.apply + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyStatesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const summarizeForResourceGroupLevelPolicyAssignmentOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", + urlParameters: [ + Parameters.policyStatesSummaryResource, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.authorizationNamespace, + Parameters.policyAssignmentName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.from, + Parameters.to, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SummarizeResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const getMetadataOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{scope}/providers/Microsoft.PolicyInsights/policyStates/$metadata", + urlParameters: [ + Parameters.scope + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "String" + } + } + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForSubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyStatesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyStatesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyStatesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForPolicySetDefinitionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyStatesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForPolicyDefinitionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyStatesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForSubscriptionLevelPolicyAssignmentNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyStatesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceGroupLevelPolicyAssignmentNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyStatesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; diff --git a/sdk/policyinsights/arm-policyinsights/lib/operations/policyTrackedResources.ts b/sdk/policyinsights/arm-policyinsights/lib/operations/policyTrackedResources.ts new file mode 100644 index 000000000000..6ee3530d4007 --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/operations/policyTrackedResources.ts @@ -0,0 +1,448 @@ +/* + * 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/policyTrackedResourcesMappers"; +import * as Parameters from "../models/parameters"; +import { PolicyInsightsClientContext } from "../policyInsightsClientContext"; + +/** Class representing a PolicyTrackedResources. */ +export class PolicyTrackedResources { + private readonly client: PolicyInsightsClientContext; + + /** + * Create a PolicyTrackedResources. + * @param {PolicyInsightsClientContext} client Reference to the service client. + */ + constructor(client: PolicyInsightsClientContext) { + this.client = client; + } + + /** + * Queries policy tracked resources under the management group. + * @param managementGroupName Management group name. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForManagementGroup(managementGroupName: string, options?: Models.PolicyTrackedResourcesListQueryResultsForManagementGroupOptionalParams): Promise; + /** + * @param managementGroupName Management group name. + * @param callback The callback + */ + listQueryResultsForManagementGroup(managementGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param managementGroupName Management group name. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForManagementGroup(managementGroupName: string, options: Models.PolicyTrackedResourcesListQueryResultsForManagementGroupOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForManagementGroup(managementGroupName: string, options?: Models.PolicyTrackedResourcesListQueryResultsForManagementGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + managementGroupName, + options + }, + listQueryResultsForManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * Queries policy tracked resources under the subscription. + * @param subscriptionId Microsoft Azure subscription ID. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForSubscription(subscriptionId: string, options?: Models.PolicyTrackedResourcesListQueryResultsForSubscriptionOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param callback The callback + */ + listQueryResultsForSubscription(subscriptionId: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForSubscription(subscriptionId: string, options: Models.PolicyTrackedResourcesListQueryResultsForSubscriptionOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForSubscription(subscriptionId: string, options?: Models.PolicyTrackedResourcesListQueryResultsForSubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + options + }, + listQueryResultsForSubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Queries policy tracked resources under the resource group. + * @param resourceGroupName Resource group name. + * @param subscriptionId Microsoft Azure subscription ID. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForResourceGroup(resourceGroupName: string, subscriptionId: string, options?: Models.PolicyTrackedResourcesListQueryResultsForResourceGroupOptionalParams): Promise; + /** + * @param resourceGroupName Resource group name. + * @param subscriptionId Microsoft Azure subscription ID. + * @param callback The callback + */ + listQueryResultsForResourceGroup(resourceGroupName: string, subscriptionId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Resource group name. + * @param subscriptionId Microsoft Azure subscription ID. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForResourceGroup(resourceGroupName: string, subscriptionId: string, options: Models.PolicyTrackedResourcesListQueryResultsForResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForResourceGroup(resourceGroupName: string, subscriptionId: string, options?: Models.PolicyTrackedResourcesListQueryResultsForResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + subscriptionId, + options + }, + listQueryResultsForResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Queries policy tracked resources under the resource. + * @param resourceId Resource ID. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForResource(resourceId: string, options?: Models.PolicyTrackedResourcesListQueryResultsForResourceOptionalParams): Promise; + /** + * @param resourceId Resource ID. + * @param callback The callback + */ + listQueryResultsForResource(resourceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceId Resource ID. + * @param options The optional parameters + * @param callback The callback + */ + listQueryResultsForResource(resourceId: string, options: Models.PolicyTrackedResourcesListQueryResultsForResourceOptionalParams, callback: msRest.ServiceCallback): void; + listQueryResultsForResource(resourceId: string, options?: Models.PolicyTrackedResourcesListQueryResultsForResourceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceId, + options + }, + listQueryResultsForResourceOperationSpec, + callback) as Promise; + } + + /** + * Queries policy tracked resources under the management group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForManagementGroupNext(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 + */ + listQueryResultsForManagementGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForManagementGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy tracked resources under the subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForSubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForSubscriptionNext(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 + */ + listQueryResultsForSubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForSubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForSubscriptionNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy tracked resources under the resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForResourceGroupNext(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 + */ + listQueryResultsForResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Queries policy tracked resources under the resource. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listQueryResultsForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listQueryResultsForResourceNext(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 + */ + listQueryResultsForResourceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listQueryResultsForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listQueryResultsForResourceNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listQueryResultsForManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", + urlParameters: [ + Parameters.managementGroupsNamespace, + Parameters.managementGroupName, + Parameters.policyTrackedResourcesResource + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyTrackedResourcesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", + urlParameters: [ + Parameters.policyTrackedResourcesResource, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyTrackedResourcesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.policyTrackedResourcesResource, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyTrackedResourcesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "{resourceId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", + urlParameters: [ + Parameters.resourceId, + Parameters.policyTrackedResourcesResource + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyTrackedResourcesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForManagementGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyTrackedResourcesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForSubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyTrackedResourcesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyTrackedResourcesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; + +const listQueryResultsForResourceNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyTrackedResourcesQueryResults + }, + default: { + bodyMapper: Mappers.QueryFailure + } + }, + serializer +}; diff --git a/sdk/policyinsights/arm-policyinsights/lib/operations/remediations.ts b/sdk/policyinsights/arm-policyinsights/lib/operations/remediations.ts new file mode 100644 index 000000000000..48a1fb1ff1a8 --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/operations/remediations.ts @@ -0,0 +1,1854 @@ +/* + * 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/remediationsMappers"; +import * as Parameters from "../models/parameters"; +import { PolicyInsightsClientContext } from "../policyInsightsClientContext"; + +/** Class representing a Remediations. */ +export class Remediations { + private readonly client: PolicyInsightsClientContext; + + /** + * Create a Remediations. + * @param {PolicyInsightsClientContext} client Reference to the service client. + */ + constructor(client: PolicyInsightsClientContext) { + this.client = client; + } + + /** + * Gets all deployments for a remediation at management group scope. + * @param managementGroupId Management group ID. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + listDeploymentsAtManagementGroup(managementGroupId: string, remediationName: string, options?: Models.RemediationsListDeploymentsAtManagementGroupOptionalParams): Promise; + /** + * @param managementGroupId Management group ID. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + listDeploymentsAtManagementGroup(managementGroupId: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param managementGroupId Management group ID. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + listDeploymentsAtManagementGroup(managementGroupId: string, remediationName: string, options: Models.RemediationsListDeploymentsAtManagementGroupOptionalParams, callback: msRest.ServiceCallback): void; + listDeploymentsAtManagementGroup(managementGroupId: string, remediationName: string, options?: Models.RemediationsListDeploymentsAtManagementGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + remediationName, + options + }, + listDeploymentsAtManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * Cancels a remediation at management group scope. + * @param managementGroupId Management group ID. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + cancelAtManagementGroup(managementGroupId: string, remediationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param managementGroupId Management group ID. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + cancelAtManagementGroup(managementGroupId: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param managementGroupId Management group ID. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + cancelAtManagementGroup(managementGroupId: string, remediationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + cancelAtManagementGroup(managementGroupId: string, remediationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + remediationName, + options + }, + cancelAtManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * Gets all remediations for the management group. + * @param managementGroupId Management group ID. + * @param [options] The optional parameters + * @returns Promise + */ + listForManagementGroup(managementGroupId: string, options?: Models.RemediationsListForManagementGroupOptionalParams): Promise; + /** + * @param managementGroupId Management group ID. + * @param callback The callback + */ + listForManagementGroup(managementGroupId: string, callback: msRest.ServiceCallback): void; + /** + * @param managementGroupId Management group ID. + * @param options The optional parameters + * @param callback The callback + */ + listForManagementGroup(managementGroupId: string, options: Models.RemediationsListForManagementGroupOptionalParams, callback: msRest.ServiceCallback): void; + listForManagementGroup(managementGroupId: string, options?: Models.RemediationsListForManagementGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + options + }, + listForManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates a remediation at management group scope. + * @param managementGroupId Management group ID. + * @param remediationName The name of the remediation. + * @param parameters The remediation parameters. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateAtManagementGroup(managementGroupId: string, remediationName: string, parameters: Models.Remediation, options?: msRest.RequestOptionsBase): Promise; + /** + * @param managementGroupId Management group ID. + * @param remediationName The name of the remediation. + * @param parameters The remediation parameters. + * @param callback The callback + */ + createOrUpdateAtManagementGroup(managementGroupId: string, remediationName: string, parameters: Models.Remediation, callback: msRest.ServiceCallback): void; + /** + * @param managementGroupId Management group ID. + * @param remediationName The name of the remediation. + * @param parameters The remediation parameters. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateAtManagementGroup(managementGroupId: string, remediationName: string, parameters: Models.Remediation, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateAtManagementGroup(managementGroupId: string, remediationName: string, parameters: Models.Remediation, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + remediationName, + parameters, + options + }, + createOrUpdateAtManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * Gets an existing remediation at management group scope. + * @param managementGroupId Management group ID. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + getAtManagementGroup(managementGroupId: string, remediationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param managementGroupId Management group ID. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + getAtManagementGroup(managementGroupId: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param managementGroupId Management group ID. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + getAtManagementGroup(managementGroupId: string, remediationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtManagementGroup(managementGroupId: string, remediationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + remediationName, + options + }, + getAtManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * Deletes an existing remediation at management group scope. + * @param managementGroupId Management group ID. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + deleteAtManagementGroup(managementGroupId: string, remediationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param managementGroupId Management group ID. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + deleteAtManagementGroup(managementGroupId: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param managementGroupId Management group ID. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + deleteAtManagementGroup(managementGroupId: string, remediationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteAtManagementGroup(managementGroupId: string, remediationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + remediationName, + options + }, + deleteAtManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * Gets all deployments for a remediation at subscription scope. + * @param subscriptionId Microsoft Azure subscription ID. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + listDeploymentsAtSubscription(subscriptionId: string, remediationName: string, options?: Models.RemediationsListDeploymentsAtSubscriptionOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + listDeploymentsAtSubscription(subscriptionId: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + listDeploymentsAtSubscription(subscriptionId: string, remediationName: string, options: Models.RemediationsListDeploymentsAtSubscriptionOptionalParams, callback: msRest.ServiceCallback): void; + listDeploymentsAtSubscription(subscriptionId: string, remediationName: string, options?: Models.RemediationsListDeploymentsAtSubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + remediationName, + options + }, + listDeploymentsAtSubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Cancels a remediation at subscription scope. + * @param subscriptionId Microsoft Azure subscription ID. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + cancelAtSubscription(subscriptionId: string, remediationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + cancelAtSubscription(subscriptionId: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + cancelAtSubscription(subscriptionId: string, remediationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + cancelAtSubscription(subscriptionId: string, remediationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + remediationName, + options + }, + cancelAtSubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Gets all remediations for the subscription. + * @param subscriptionId Microsoft Azure subscription ID. + * @param [options] The optional parameters + * @returns Promise + */ + listForSubscription(subscriptionId: string, options?: Models.RemediationsListForSubscriptionOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param callback The callback + */ + listForSubscription(subscriptionId: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param options The optional parameters + * @param callback The callback + */ + listForSubscription(subscriptionId: string, options: Models.RemediationsListForSubscriptionOptionalParams, callback: msRest.ServiceCallback): void; + listForSubscription(subscriptionId: string, options?: Models.RemediationsListForSubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + options + }, + listForSubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates a remediation at subscription scope. + * @param subscriptionId Microsoft Azure subscription ID. + * @param remediationName The name of the remediation. + * @param parameters The remediation parameters. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateAtSubscription(subscriptionId: string, remediationName: string, parameters: Models.Remediation, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param remediationName The name of the remediation. + * @param parameters The remediation parameters. + * @param callback The callback + */ + createOrUpdateAtSubscription(subscriptionId: string, remediationName: string, parameters: Models.Remediation, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param remediationName The name of the remediation. + * @param parameters The remediation parameters. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateAtSubscription(subscriptionId: string, remediationName: string, parameters: Models.Remediation, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateAtSubscription(subscriptionId: string, remediationName: string, parameters: Models.Remediation, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + remediationName, + parameters, + options + }, + createOrUpdateAtSubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Gets an existing remediation at subscription scope. + * @param subscriptionId Microsoft Azure subscription ID. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + getAtSubscription(subscriptionId: string, remediationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + getAtSubscription(subscriptionId: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + getAtSubscription(subscriptionId: string, remediationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtSubscription(subscriptionId: string, remediationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + remediationName, + options + }, + getAtSubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Deletes an existing remediation at subscription scope. + * @param subscriptionId Microsoft Azure subscription ID. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + deleteAtSubscription(subscriptionId: string, remediationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + deleteAtSubscription(subscriptionId: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + deleteAtSubscription(subscriptionId: string, remediationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteAtSubscription(subscriptionId: string, remediationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + remediationName, + options + }, + deleteAtSubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Gets all deployments for a remediation at resource group scope. + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + listDeploymentsAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, options?: Models.RemediationsListDeploymentsAtResourceGroupOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + listDeploymentsAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + listDeploymentsAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, options: Models.RemediationsListDeploymentsAtResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listDeploymentsAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, options?: Models.RemediationsListDeploymentsAtResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + resourceGroupName, + remediationName, + options + }, + listDeploymentsAtResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Cancels a remediation at resource group scope. + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + cancelAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + cancelAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + cancelAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + cancelAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + resourceGroupName, + remediationName, + options + }, + cancelAtResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Gets all remediations for the subscription. + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param [options] The optional parameters + * @returns Promise + */ + listForResourceGroup(subscriptionId: string, resourceGroupName: string, options?: Models.RemediationsListForResourceGroupOptionalParams): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param callback The callback + */ + listForResourceGroup(subscriptionId: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param options The optional parameters + * @param callback The callback + */ + listForResourceGroup(subscriptionId: string, resourceGroupName: string, options: Models.RemediationsListForResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listForResourceGroup(subscriptionId: string, resourceGroupName: string, options?: Models.RemediationsListForResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + resourceGroupName, + options + }, + listForResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates a remediation at resource group scope. + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param remediationName The name of the remediation. + * @param parameters The remediation parameters. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, parameters: Models.Remediation, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param remediationName The name of the remediation. + * @param parameters The remediation parameters. + * @param callback The callback + */ + createOrUpdateAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, parameters: Models.Remediation, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param remediationName The name of the remediation. + * @param parameters The remediation parameters. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, parameters: Models.Remediation, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, parameters: Models.Remediation, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + resourceGroupName, + remediationName, + parameters, + options + }, + createOrUpdateAtResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Gets an existing remediation at resource group scope. + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + getAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + getAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + getAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + resourceGroupName, + remediationName, + options + }, + getAtResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Deletes an existing remediation at resource group scope. + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + deleteAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + deleteAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + deleteAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteAtResourceGroup(subscriptionId: string, resourceGroupName: string, remediationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + resourceGroupName, + remediationName, + options + }, + deleteAtResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Gets all deployments for a remediation at resource scope. + * @param resourceId Resource ID. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + listDeploymentsAtResource(resourceId: string, remediationName: string, options?: Models.RemediationsListDeploymentsAtResourceOptionalParams): Promise; + /** + * @param resourceId Resource ID. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + listDeploymentsAtResource(resourceId: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceId Resource ID. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + listDeploymentsAtResource(resourceId: string, remediationName: string, options: Models.RemediationsListDeploymentsAtResourceOptionalParams, callback: msRest.ServiceCallback): void; + listDeploymentsAtResource(resourceId: string, remediationName: string, options?: Models.RemediationsListDeploymentsAtResourceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceId, + remediationName, + options + }, + listDeploymentsAtResourceOperationSpec, + callback) as Promise; + } + + /** + * Cancel a remediation at resource scope. + * @param resourceId Resource ID. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + cancelAtResource(resourceId: string, remediationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceId Resource ID. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + cancelAtResource(resourceId: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceId Resource ID. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + cancelAtResource(resourceId: string, remediationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + cancelAtResource(resourceId: string, remediationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceId, + remediationName, + options + }, + cancelAtResourceOperationSpec, + callback) as Promise; + } + + /** + * Gets all remediations for a resource. + * @param resourceId Resource ID. + * @param [options] The optional parameters + * @returns Promise + */ + listForResource(resourceId: string, options?: Models.RemediationsListForResourceOptionalParams): Promise; + /** + * @param resourceId Resource ID. + * @param callback The callback + */ + listForResource(resourceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceId Resource ID. + * @param options The optional parameters + * @param callback The callback + */ + listForResource(resourceId: string, options: Models.RemediationsListForResourceOptionalParams, callback: msRest.ServiceCallback): void; + listForResource(resourceId: string, options?: Models.RemediationsListForResourceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceId, + options + }, + listForResourceOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates a remediation at resource scope. + * @param resourceId Resource ID. + * @param remediationName The name of the remediation. + * @param parameters The remediation parameters. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateAtResource(resourceId: string, remediationName: string, parameters: Models.Remediation, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceId Resource ID. + * @param remediationName The name of the remediation. + * @param parameters The remediation parameters. + * @param callback The callback + */ + createOrUpdateAtResource(resourceId: string, remediationName: string, parameters: Models.Remediation, callback: msRest.ServiceCallback): void; + /** + * @param resourceId Resource ID. + * @param remediationName The name of the remediation. + * @param parameters The remediation parameters. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateAtResource(resourceId: string, remediationName: string, parameters: Models.Remediation, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateAtResource(resourceId: string, remediationName: string, parameters: Models.Remediation, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceId, + remediationName, + parameters, + options + }, + createOrUpdateAtResourceOperationSpec, + callback) as Promise; + } + + /** + * Gets an existing remediation at resource scope. + * @param resourceId Resource ID. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + getAtResource(resourceId: string, remediationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceId Resource ID. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + getAtResource(resourceId: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceId Resource ID. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + getAtResource(resourceId: string, remediationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtResource(resourceId: string, remediationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceId, + remediationName, + options + }, + getAtResourceOperationSpec, + callback) as Promise; + } + + /** + * Deletes an existing remediation at individual resource scope. + * @param resourceId Resource ID. + * @param remediationName The name of the remediation. + * @param [options] The optional parameters + * @returns Promise + */ + deleteAtResource(resourceId: string, remediationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceId Resource ID. + * @param remediationName The name of the remediation. + * @param callback The callback + */ + deleteAtResource(resourceId: string, remediationName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceId Resource ID. + * @param remediationName The name of the remediation. + * @param options The optional parameters + * @param callback The callback + */ + deleteAtResource(resourceId: string, remediationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteAtResource(resourceId: string, remediationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceId, + remediationName, + options + }, + deleteAtResourceOperationSpec, + callback) as Promise; + } + + /** + * Gets all deployments for a remediation at management group scope. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listDeploymentsAtManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listDeploymentsAtManagementGroupNext(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 + */ + listDeploymentsAtManagementGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listDeploymentsAtManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listDeploymentsAtManagementGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all remediations for the 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; + } + + /** + * Gets all deployments for a remediation at subscription scope. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listDeploymentsAtSubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listDeploymentsAtSubscriptionNext(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 + */ + listDeploymentsAtSubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listDeploymentsAtSubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listDeploymentsAtSubscriptionNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all remediations for the subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listForSubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listForSubscriptionNext(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 + */ + listForSubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listForSubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listForSubscriptionNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all deployments for a remediation at resource group scope. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listDeploymentsAtResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listDeploymentsAtResourceGroupNext(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 + */ + listDeploymentsAtResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listDeploymentsAtResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listDeploymentsAtResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all remediations for the subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listForResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listForResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listForResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all deployments for a remediation at resource scope. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listDeploymentsAtResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listDeploymentsAtResourceNext(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 + */ + listDeploymentsAtResourceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listDeploymentsAtResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listDeploymentsAtResourceNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all remediations for a resource. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listForResourceNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listForResourceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listForResourceNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listDeploymentsAtManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", + urlParameters: [ + Parameters.managementGroupsNamespace, + Parameters.managementGroupId, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationDeploymentsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const cancelAtManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", + urlParameters: [ + Parameters.managementGroupsNamespace, + Parameters.managementGroupId, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listForManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations", + urlParameters: [ + Parameters.managementGroupsNamespace, + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + urlParameters: [ + Parameters.managementGroupsNamespace, + Parameters.managementGroupId, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Remediation, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + 201: { + bodyMapper: Mappers.Remediation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getAtManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + urlParameters: [ + Parameters.managementGroupsNamespace, + Parameters.managementGroupId, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + urlParameters: [ + Parameters.managementGroupsNamespace, + Parameters.managementGroupId, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listDeploymentsAtSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", + urlParameters: [ + Parameters.subscriptionId, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationDeploymentsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const cancelAtSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", + urlParameters: [ + Parameters.subscriptionId, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listForSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateAtSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Remediation, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + 201: { + bodyMapper: Mappers.Remediation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getAtSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteAtSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listDeploymentsAtResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationDeploymentsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const cancelAtResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listForResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateAtResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Remediation, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + 201: { + bodyMapper: Mappers.Remediation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getAtResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteAtResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listDeploymentsAtResourceOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", + urlParameters: [ + Parameters.resourceId, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationDeploymentsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const cancelAtResourceOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", + urlParameters: [ + Parameters.resourceId, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listForResourceOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{resourceId}/providers/Microsoft.PolicyInsights/remediations", + urlParameters: [ + Parameters.resourceId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateAtResourceOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + urlParameters: [ + Parameters.resourceId, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Remediation, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + 201: { + bodyMapper: Mappers.Remediation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getAtResourceOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + urlParameters: [ + Parameters.resourceId, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteAtResourceOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + urlParameters: [ + Parameters.resourceId, + Parameters.remediationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Remediation + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listDeploymentsAtManagementGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationDeploymentsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listForManagementGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listDeploymentsAtSubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationDeploymentsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listForSubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listDeploymentsAtResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationDeploymentsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listForResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listDeploymentsAtResourceNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationDeploymentsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listForResourceNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RemediationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/policyinsights/arm-policyinsights/lib/policyInsightsClient.ts b/sdk/policyinsights/arm-policyinsights/lib/policyInsightsClient.ts new file mode 100644 index 000000000000..355467950460 --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/policyInsightsClient.ts @@ -0,0 +1,49 @@ +/* + * 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/mappers"; +import * as operations from "./operations"; +import { PolicyInsightsClientContext } from "./policyInsightsClientContext"; + + +class PolicyInsightsClient extends PolicyInsightsClientContext { + // Operation groups + policyTrackedResources: operations.PolicyTrackedResources; + remediations: operations.Remediations; + policyEvents: operations.PolicyEvents; + policyStates: operations.PolicyStates; + operations: operations.Operations; + + /** + * Initializes a new instance of the PolicyInsightsClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, options?: Models.PolicyInsightsClientOptions) { + super(credentials, options); + this.policyTrackedResources = new operations.PolicyTrackedResources(this); + this.remediations = new operations.Remediations(this); + this.policyEvents = new operations.PolicyEvents(this); + this.policyStates = new operations.PolicyStates(this); + this.operations = new operations.Operations(this); + } +} + +// Operation Specifications + +export { + PolicyInsightsClient, + PolicyInsightsClientContext, + Models as PolicyInsightsModels, + Mappers as PolicyInsightsMappers +}; +export * from "./operations"; diff --git a/sdk/policyinsights/arm-policyinsights/lib/policyInsightsClientContext.ts b/sdk/policyinsights/arm-policyinsights/lib/policyInsightsClientContext.ts new file mode 100644 index 000000000000..54a4f9a41a89 --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/lib/policyInsightsClientContext.ts @@ -0,0 +1,56 @@ +/* + * 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 Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-policyinsights"; +const packageVersion = "2.2.0"; + +export class PolicyInsightsClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + apiVersion?: string; + + /** + * Initializes a new instance of the PolicyInsightsClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, options?: Models.PolicyInsightsClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2018-07-01-preview'; + 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; + + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/sdk/policyinsights/arm-policyinsights/package.json b/sdk/policyinsights/arm-policyinsights/package.json index 02bfb9c18b9b..59017e420325 100644 --- a/sdk/policyinsights/arm-policyinsights/package.json +++ b/sdk/policyinsights/arm-policyinsights/package.json @@ -4,8 +4,8 @@ "description": "PolicyInsightsClient Library with typescript type definitions for node.js and browser.", "version": "2.2.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.3.2", - "@azure/ms-rest-js": "^1.8.1", + "@azure/ms-rest-azure-js": "^1.2.0", + "@azure/ms-rest-js": "^1.2.0", "tslib": "^1.9.3" }, "keywords": [ @@ -43,8 +43,7 @@ "esm/**/*.js.map", "esm/**/*.d.ts", "esm/**/*.d.ts.map", - "src/**/*.ts", - "README.md", + "lib/**/*.ts", "rollup.config.js", "tsconfig.json" ], @@ -53,6 +52,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-policyinsights.js.map'\" -o ./dist/arm-policyinsights.min.js ./dist/arm-policyinsights.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "autoPublish": true + "sideEffects": false } diff --git a/sdk/policyinsights/arm-policyinsights/tsconfig.json b/sdk/policyinsights/arm-policyinsights/tsconfig.json index 87bbf5b5fa49..51ea90961ce5 100644 --- a/sdk/policyinsights/arm-policyinsights/tsconfig.json +++ b/sdk/policyinsights/arm-policyinsights/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./lib/**/*.ts"], "exclude": ["node_modules"] }