From 79a817b530fdeb308f1dfb0a01ebbcf3adfef9c1 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 15 Sep 2020 20:49:47 +0000 Subject: [PATCH] Generated from 1144249e38328c6892ac246382220254c63249af --- .../arm-policyinsights/src/models/index.ts | 729 ++++++++++++++++-- .../arm-policyinsights/src/models/mappers.ts | 600 ++++++++++++-- .../src/models/parameters.ts | 59 +- .../src/models/policyEventsMappers.ts | 1 + .../src/models/policyRestrictionsMappers.ts | 25 + .../src/models/policyStatesMappers.ts | 1 + .../src/operations/index.ts | 1 + .../src/operations/operations.ts | 2 +- .../src/operations/policyEvents.ts | 430 +++++++++-- .../operations/policyMetadataOperations.ts | 4 +- .../src/operations/policyRestrictions.ts | 160 ++++ .../src/operations/policyStates.ts | 492 ++++++++++-- .../src/operations/policyTrackedResources.ts | 6 +- .../src/operations/remediations.ts | 36 +- .../src/policyInsightsClient.ts | 7 +- .../src/policyInsightsClientContext.ts | 8 +- 16 files changed, 2298 insertions(+), 263 deletions(-) create mode 100644 sdk/policyinsights/arm-policyinsights/src/models/policyRestrictionsMappers.ts create mode 100644 sdk/policyinsights/arm-policyinsights/src/operations/policyRestrictions.ts diff --git a/sdk/policyinsights/arm-policyinsights/src/models/index.ts b/sdk/policyinsights/arm-policyinsights/src/models/index.ts index 091f0a349986..97ed7dbad5cc 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/index.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/index.ts @@ -313,6 +313,45 @@ export interface ErrorResponse { error?: ErrorDefinition; } +/** + * Component event details. + */ +export interface ComponentEventDetails { + /** + * Component Id. + */ + id?: string; + /** + * Component type. + */ + type?: string; + /** + * Component name. + */ + name?: string; + /** + * Timestamp for component policy event record. + */ + timestamp?: Date; + /** + * Tenant ID for the policy event record. + */ + tenantId?: string; + /** + * Principal object ID for the user who initiated the resource component operation that triggered + * the policy event. + */ + principalOid?: string; + /** + * Policy definition action, i.e. effect. + */ + policyDefinitionAction?: string; + /** + * Describes unknown properties. The value of an unknown property can be of "any" type. + */ + [property: string]: any; +} + /** * Policy event record. */ @@ -428,6 +467,10 @@ export interface PolicyEvent { * a policy set. */ policyDefinitionReferenceId?: string; + /** + * Compliance state of the resource. + */ + complianceState?: string; /** * Tenant ID for the policy event record. */ @@ -438,27 +481,13 @@ export interface PolicyEvent { */ principalOid?: string; /** - * Describes unknown properties. The value of an unknown property can be of "any" type. - */ - [property: string]: any; -} - -/** - * Query results. - */ -export interface PolicyEventsQueryResults { - /** - * OData context string; used by OData clients to resolve type information based on metadata. - */ - odatacontext?: string; - /** - * OData entity count; represents the number of policy event records returned. + * Components events records populated only when URL contains $expand=components clause. */ - odatacount?: number; + components?: ComponentEventDetails[]; /** - * Query results. + * Describes unknown properties. The value of an unknown property can be of "any" type. */ - value?: PolicyEvent[]; + [property: string]: any; } /** @@ -473,6 +502,11 @@ export interface ExpressionEvaluationDetails { * Expression evaluated. */ expression?: string; + /** + * The kind of expression that was evaluated. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly expressionKind?: string; /** * Property path if the expression is a field or an alias. */ @@ -519,6 +553,36 @@ export interface PolicyEvaluationDetails { ifNotExistsDetails?: IfNotExistsEvaluationDetails; } +/** + * Component state details. + */ +export interface ComponentStateDetails { + /** + * Component Id. + */ + id?: string; + /** + * Component type. + */ + type?: string; + /** + * Component name. + */ + name?: string; + /** + * Component compliance evaluation timestamp. + */ + timestamp?: Date; + /** + * Component compliance state. + */ + complianceState?: string; + /** + * Describes unknown properties. The value of an unknown property can be of "any" type. + */ + [property: string]: any; +} + /** * Policy state record. */ @@ -646,6 +710,11 @@ export interface PolicyState { * Policy definition group names. */ policyDefinitionGroupNames?: string[]; + /** + * Components state compliance records populated only when URL contains $expand=components + * clause. + */ + components?: ComponentStateDetails[]; /** * Evaluated policy definition version. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -667,24 +736,6 @@ export interface PolicyState { [property: string]: any; } -/** - * Query results. - */ -export interface PolicyStatesQueryResults { - /** - * OData context string; used by OData clients to resolve type information based on metadata. - */ - odatacontext?: string; - /** - * OData entity count; represents the number of policy state records returned. - */ - odatacount?: number; - /** - * Query results. - */ - value?: PolicyState[]; -} - /** * The compliance state rollup. */ @@ -1000,6 +1051,173 @@ export interface SlimPolicyMetadata { readonly name?: string; } +/** + * The information about the resource that will be evaluated. + */ +export interface CheckRestrictionsResourceDetails { + /** + * The resource content. This should include whatever properties are already known and can be a + * partial set of all resource properties. + */ + resourceContent: any; + /** + * The api-version of the resource content. + */ + apiVersion?: string; + /** + * The scope where the resource is being created. For example, if the resource is a child + * resource this would be the parent resource's resource ID. + */ + scope?: string; +} + +/** + * A field that should be evaluated against Azure Policy to determine restrictions. + */ +export interface PendingField { + /** + * The name of the field. This can be a top-level property like 'name' or 'type' or an Azure + * Policy field alias. + */ + field: string; + /** + * The list of potential values for the field that should be evaluated against Azure Policy. + */ + values?: string[]; +} + +/** + * The check policy restrictions parameters describing the resource that is being evaluated. + */ +export interface CheckRestrictionsRequest { + /** + * The information about the resource that will be evaluated. + */ + resourceDetails: CheckRestrictionsResourceDetails; + /** + * The list of fields and values that should be evaluated for potential restrictions. + */ + pendingFields?: PendingField[]; +} + +/** + * Resource identifiers for a policy. + */ +export interface PolicyReference { + /** + * The resource identifier of the policy definition. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly policyDefinitionId?: string; + /** + * The resource identifier of the policy set definition. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly policySetDefinitionId?: string; + /** + * The reference identifier of a specific policy definition within a policy set definition. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly policyDefinitionReferenceId?: string; + /** + * The resource identifier of the policy assignment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly policyAssignmentId?: string; +} + +/** + * The restrictions on a field imposed by a specific policy. + */ +export interface FieldRestriction { + /** + * The type of restriction that is imposed on the field. Possible values include: 'Required', + * 'Removed', 'Deny' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly result?: FieldRestrictionResult; + /** + * The value that policy will set for the field if the user does not provide a value. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly defaultValue?: string; + /** + * The values that policy either requires or denies for the field. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly values?: string[]; + /** + * The details of the policy that is causing the field restriction. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly policy?: PolicyReference; +} + +/** + * The restrictions that will be placed on a field in the resource by policy. + */ +export interface FieldRestrictions { + /** + * The name of the field. This can be a top-level property like 'name' or 'type' or an Azure + * Policy field alias. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly field?: string; + /** + * The restrictions placed on that field by policy. + */ + restrictions?: FieldRestriction[]; +} + +/** + * The result of a non-compliant policy evaluation against the given resource content. + */ +export interface PolicyEvaluationResult { + /** + * The details of the policy that was evaluated. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly policyInfo?: PolicyReference; + /** + * The result of the policy evaluation against the resource. This will typically be + * 'NonCompliant' but may contain other values if errors were encountered. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly evaluationResult?: string; + /** + * The detailed results of the policy expressions and values that were evaluated. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly evaluationDetails?: PolicyEvaluationDetails; +} + +/** + * Evaluation results for the provided partial resource content. + */ +export interface CheckRestrictionsResultContentEvaluationResult { + /** + * Policy evaluation results against the given resource content. This will indicate if the + * partial content that was provided will be denied as-is. + */ + policyEvaluations?: PolicyEvaluationResult[]; +} + +/** + * The result of a check policy restrictions evaluation on a resource. + */ +export interface CheckRestrictionsResult { + /** + * The restrictions that will be placed on various fields in the resource by policy. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly fieldRestrictions?: FieldRestrictions[]; + /** + * Evaluation results for the provided partial resource content. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly contentEvaluationResult?: CheckRestrictionsResultContentEvaluationResult; +} + /** * Additional parameters for a set of operations. */ @@ -1037,8 +1255,12 @@ export interface QueryOptions { */ apply?: string; /** - * The $expand query parameter. For example, to expand policyEvaluationDetails, use - * $expand=policyEvaluationDetails + * Skiptoken is only provided if a previous response returned a partial result as a part of + * nextLink element. + */ + skipToken?: string; + /** + * The $expand query parameter. For example, to expand components use $expand=components */ expand?: string; } @@ -1459,6 +1681,46 @@ export interface RemediationListResult extends Array { readonly nextLink?: string; } +/** + * @interface + * Query results. + * @extends Array + */ +export interface PolicyEventsQueryResults extends Array { + /** + * OData context string; used by OData clients to resolve type information based on metadata. + */ + odatacontext?: string; + /** + * OData entity count; represents the number of policy event records returned. + */ + odatacount?: number; + /** + * Odata next link; URL to get the next set of results. + */ + odatanextLink?: string; +} + +/** + * @interface + * Query results. + * @extends Array + */ +export interface PolicyStatesQueryResults extends Array { + /** + * OData context string; used by OData clients to resolve type information based on metadata. + */ + odatacontext?: string; + /** + * OData entity count; represents the number of policy state records returned. + */ + odatacount?: number; + /** + * Odata next link; URL to get the next set of results. + */ + odatanextLink?: string; +} + /** * @interface * Collection of policy metadata resources. @@ -1480,6 +1742,14 @@ export interface PolicyMetadataCollection extends Array { */ export type ResourceDiscoveryMode = 'ExistingNonCompliant' | 'ReEvaluateCompliance'; +/** + * Defines values for FieldRestrictionResult. + * Possible values include: 'Required', 'Removed', 'Deny' + * @readonly + * @enum {string} + */ +export type FieldRestrictionResult = 'Required' | 'Removed' | 'Deny'; + /** * Defines values for PolicyStatesResource. * Possible values include: 'default', 'latest' @@ -2449,14 +2719,9 @@ export type PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentRes }; /** - * Contains response data for the getMetadata operation. + * Contains response data for the listQueryResultsForManagementGroupNext operation. */ -export type PolicyEventsGetMetadataResponse = { - /** - * The parsed response body. - */ - body: string; - +export type PolicyEventsListQueryResultsForManagementGroupNextResponse = PolicyEventsQueryResults & { /** * The underlying HTTP response. */ @@ -2469,14 +2734,14 @@ export type PolicyEventsGetMetadataResponse = { /** * The response body as parsed JSON or XML */ - parsedBody: string; + parsedBody: PolicyEventsQueryResults; }; }; /** - * Contains response data for the listQueryResultsForManagementGroup operation. + * Contains response data for the listQueryResultsForSubscriptionNext operation. */ -export type PolicyStatesListQueryResultsForManagementGroupResponse = PolicyStatesQueryResults & { +export type PolicyEventsListQueryResultsForSubscriptionNextResponse = PolicyEventsQueryResults & { /** * The underlying HTTP response. */ @@ -2489,14 +2754,14 @@ export type PolicyStatesListQueryResultsForManagementGroupResponse = PolicyState /** * The response body as parsed JSON or XML */ - parsedBody: PolicyStatesQueryResults; + parsedBody: PolicyEventsQueryResults; }; }; /** - * Contains response data for the summarizeForManagementGroup operation. + * Contains response data for the listQueryResultsForResourceGroupNext operation. */ -export type PolicyStatesSummarizeForManagementGroupResponse = SummarizeResults & { +export type PolicyEventsListQueryResultsForResourceGroupNextResponse = PolicyEventsQueryResults & { /** * The underlying HTTP response. */ @@ -2509,14 +2774,14 @@ export type PolicyStatesSummarizeForManagementGroupResponse = SummarizeResults & /** * The response body as parsed JSON or XML */ - parsedBody: SummarizeResults; + parsedBody: PolicyEventsQueryResults; }; }; /** - * Contains response data for the listQueryResultsForSubscription operation. + * Contains response data for the listQueryResultsForResourceNext operation. */ -export type PolicyStatesListQueryResultsForSubscriptionResponse = PolicyStatesQueryResults & { +export type PolicyEventsListQueryResultsForResourceNextResponse = PolicyEventsQueryResults & { /** * The underlying HTTP response. */ @@ -2529,14 +2794,14 @@ export type PolicyStatesListQueryResultsForSubscriptionResponse = PolicyStatesQu /** * The response body as parsed JSON or XML */ - parsedBody: PolicyStatesQueryResults; + parsedBody: PolicyEventsQueryResults; }; }; /** - * Contains response data for the summarizeForSubscription operation. + * Contains response data for the listQueryResultsForPolicySetDefinitionNext operation. */ -export type PolicyStatesSummarizeForSubscriptionResponse = SummarizeResults & { +export type PolicyEventsListQueryResultsForPolicySetDefinitionNextResponse = PolicyEventsQueryResults & { /** * The underlying HTTP response. */ @@ -2549,14 +2814,156 @@ export type PolicyStatesSummarizeForSubscriptionResponse = SummarizeResults & { /** * The response body as parsed JSON or XML */ - parsedBody: SummarizeResults; + parsedBody: PolicyEventsQueryResults; }; }; /** - * Contains response data for the listQueryResultsForResourceGroup operation. + * Contains response data for the listQueryResultsForPolicyDefinitionNext operation. */ -export type PolicyStatesListQueryResultsForResourceGroupResponse = PolicyStatesQueryResults & { +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. */ @@ -2793,6 +3200,168 @@ export type PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentResponse = }; }; +/** + * Contains response data for the listQueryResultsForManagementGroupNext operation. + */ +export type PolicyStatesListQueryResultsForManagementGroupNextResponse = 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 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. */ @@ -2872,3 +3441,43 @@ export type PolicyMetadataListNextResponse = PolicyMetadataCollection & { parsedBody: PolicyMetadataCollection; }; }; + +/** + * Contains response data for the checkAtSubscriptionScope operation. + */ +export type PolicyRestrictionsCheckAtSubscriptionScopeResponse = CheckRestrictionsResult & { + /** + * 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: CheckRestrictionsResult; + }; +}; + +/** + * Contains response data for the checkAtResourceGroupScope operation. + */ +export type PolicyRestrictionsCheckAtResourceGroupScopeResponse = CheckRestrictionsResult & { + /** + * 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: CheckRestrictionsResult; + }; +}; diff --git a/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts b/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts index 909fcae126c3..411f065ad61d 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts @@ -480,6 +480,63 @@ export const ErrorResponse: msRest.CompositeMapper = { } }; +export const ComponentEventDetails: msRest.CompositeMapper = { + serializedName: "ComponentEventDetails", + type: { + name: "Composite", + className: "ComponentEventDetails", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + timestamp: { + serializedName: "timestamp", + type: { + name: "DateTime" + } + }, + tenantId: { + serializedName: "tenantId", + type: { + name: "String" + } + }, + principalOid: { + serializedName: "principalOid", + type: { + name: "String" + } + }, + policyDefinitionAction: { + serializedName: "policyDefinitionAction", + type: { + name: "String" + } + } + }, + additionalProperties: { + type: { + name: "Object" + } + } + } +}; + export const PolicyEvent: msRest.CompositeMapper = { serializedName: "PolicyEvent", type: { @@ -648,6 +705,12 @@ export const PolicyEvent: msRest.CompositeMapper = { name: "String" } }, + complianceState: { + serializedName: "complianceState", + type: { + name: "String" + } + }, tenantId: { serializedName: "tenantId", type: { @@ -659,45 +722,15 @@ export const PolicyEvent: msRest.CompositeMapper = { type: { name: "String" } - } - }, - additionalProperties: { - type: { - name: "Object" - } - } - } -}; - -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: "value", + components: { + serializedName: "components", type: { name: "Sequence", element: { type: { name: "Composite", - className: "PolicyEvent", + className: "ComponentEventDetails", additionalProperties: { type: { name: "Object" @@ -707,6 +740,11 @@ export const PolicyEventsQueryResults: msRest.CompositeMapper = { } } } + }, + additionalProperties: { + type: { + name: "Object" + } } } }; @@ -729,6 +767,13 @@ export const ExpressionEvaluationDetails: msRest.CompositeMapper = { name: "String" } }, + expressionKind: { + readOnly: true, + serializedName: "expressionKind", + type: { + name: "String" + } + }, path: { serializedName: "path", type: { @@ -808,6 +853,51 @@ export const PolicyEvaluationDetails: msRest.CompositeMapper = { } }; +export const ComponentStateDetails: msRest.CompositeMapper = { + serializedName: "ComponentStateDetails", + type: { + name: "Composite", + className: "ComponentStateDetails", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + timestamp: { + serializedName: "timestamp", + type: { + name: "DateTime" + } + }, + complianceState: { + serializedName: "complianceState", + type: { + name: "String" + } + } + }, + additionalProperties: { + type: { + name: "Object" + } + } + } +}; + export const PolicyState: msRest.CompositeMapper = { serializedName: "PolicyState", type: { @@ -1000,6 +1090,23 @@ export const PolicyState: msRest.CompositeMapper = { } } }, + components: { + serializedName: "components", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ComponentStateDetails", + additionalProperties: { + type: { + name: "Object" + } + } + } + } + } + }, policyDefinitionVersion: { readOnly: true, serializedName: "policyDefinitionVersion", @@ -1030,48 +1137,6 @@ export const PolicyState: msRest.CompositeMapper = { } }; -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: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicyState", - additionalProperties: { - type: { - name: "Object" - } - } - } - } - } - } - } - } -}; - export const ComplianceDetail: msRest.CompositeMapper = { serializedName: "ComplianceDetail", type: { @@ -1613,6 +1678,290 @@ export const SlimPolicyMetadata: msRest.CompositeMapper = { } }; +export const CheckRestrictionsResourceDetails: msRest.CompositeMapper = { + serializedName: "CheckRestrictionsResourceDetails", + type: { + name: "Composite", + className: "CheckRestrictionsResourceDetails", + modelProperties: { + resourceContent: { + required: true, + serializedName: "resourceContent", + type: { + name: "Object" + } + }, + apiVersion: { + serializedName: "apiVersion", + type: { + name: "String" + } + }, + scope: { + serializedName: "scope", + type: { + name: "String" + } + } + } + } +}; + +export const PendingField: msRest.CompositeMapper = { + serializedName: "PendingField", + type: { + name: "Composite", + className: "PendingField", + modelProperties: { + field: { + required: true, + serializedName: "field", + type: { + name: "String" + } + }, + values: { + serializedName: "values", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const CheckRestrictionsRequest: msRest.CompositeMapper = { + serializedName: "CheckRestrictionsRequest", + type: { + name: "Composite", + className: "CheckRestrictionsRequest", + modelProperties: { + resourceDetails: { + required: true, + serializedName: "resourceDetails", + type: { + name: "Composite", + className: "CheckRestrictionsResourceDetails" + } + }, + pendingFields: { + serializedName: "pendingFields", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PendingField" + } + } + } + } + } + } +}; + +export const PolicyReference: msRest.CompositeMapper = { + serializedName: "PolicyReference", + type: { + name: "Composite", + className: "PolicyReference", + modelProperties: { + policyDefinitionId: { + readOnly: true, + serializedName: "policyDefinitionId", + type: { + name: "String" + } + }, + policySetDefinitionId: { + readOnly: true, + serializedName: "policySetDefinitionId", + type: { + name: "String" + } + }, + policyDefinitionReferenceId: { + readOnly: true, + serializedName: "policyDefinitionReferenceId", + type: { + name: "String" + } + }, + policyAssignmentId: { + readOnly: true, + serializedName: "policyAssignmentId", + type: { + name: "String" + } + } + } + } +}; + +export const FieldRestriction: msRest.CompositeMapper = { + serializedName: "FieldRestriction", + type: { + name: "Composite", + className: "FieldRestriction", + modelProperties: { + result: { + readOnly: true, + serializedName: "result", + type: { + name: "String" + } + }, + defaultValue: { + readOnly: true, + serializedName: "defaultValue", + type: { + name: "String" + } + }, + values: { + readOnly: true, + serializedName: "values", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + policy: { + readOnly: true, + serializedName: "policy", + type: { + name: "Composite", + className: "PolicyReference" + } + } + } + } +}; + +export const FieldRestrictions: msRest.CompositeMapper = { + serializedName: "FieldRestrictions", + type: { + name: "Composite", + className: "FieldRestrictions", + modelProperties: { + field: { + readOnly: true, + serializedName: "field", + type: { + name: "String" + } + }, + restrictions: { + serializedName: "restrictions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FieldRestriction" + } + } + } + } + } + } +}; + +export const PolicyEvaluationResult: msRest.CompositeMapper = { + serializedName: "PolicyEvaluationResult", + type: { + name: "Composite", + className: "PolicyEvaluationResult", + modelProperties: { + policyInfo: { + readOnly: true, + serializedName: "policyInfo", + type: { + name: "Composite", + className: "PolicyReference" + } + }, + evaluationResult: { + readOnly: true, + serializedName: "evaluationResult", + type: { + name: "String" + } + }, + evaluationDetails: { + readOnly: true, + serializedName: "evaluationDetails", + type: { + name: "Composite", + className: "PolicyEvaluationDetails" + } + } + } + } +}; + +export const CheckRestrictionsResultContentEvaluationResult: msRest.CompositeMapper = { + serializedName: "CheckRestrictionsResult_contentEvaluationResult", + type: { + name: "Composite", + className: "CheckRestrictionsResultContentEvaluationResult", + modelProperties: { + policyEvaluations: { + serializedName: "policyEvaluations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyEvaluationResult" + } + } + } + } + } + } +}; + +export const CheckRestrictionsResult: msRest.CompositeMapper = { + serializedName: "CheckRestrictionsResult", + type: { + name: "Composite", + className: "CheckRestrictionsResult", + modelProperties: { + fieldRestrictions: { + readOnly: true, + serializedName: "fieldRestrictions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FieldRestrictions" + } + } + } + }, + contentEvaluationResult: { + readOnly: true, + serializedName: "contentEvaluationResult", + type: { + name: "Composite", + className: "CheckRestrictionsResultContentEvaluationResult" + } + } + } + } +}; + export const QueryOptions: msRest.CompositeMapper = { type: { name: "Composite", @@ -1653,6 +2002,11 @@ export const QueryOptions: msRest.CompositeMapper = { name: "String" } }, + skipToken: { + type: { + name: "String" + } + }, expand: { type: { name: "String" @@ -1752,6 +2106,102 @@ export const RemediationListResult: msRest.CompositeMapper = { } }; +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" + } + }, + odatanextLink: { + serializedName: "@odata\\.nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyEvent", + additionalProperties: { + type: { + name: "Object" + } + } + } + } + } + } + } + } +}; + +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" + } + }, + odatanextLink: { + serializedName: "@odata\\.nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyState", + additionalProperties: { + type: { + name: "Object" + } + } + } + } + } + } + } + } +}; + export const PolicyMetadataCollection: msRest.CompositeMapper = { serializedName: "PolicyMetadataCollection", type: { diff --git a/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts b/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts index 759b127fd2da..f3acd8a650a6 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts @@ -50,7 +50,7 @@ export const apiVersion2: msRest.OperationQueryParameter = { required: true, isConstant: true, serializedName: "api-version", - defaultValue: '2018-04-04', + defaultValue: '2019-10-01', type: { name: "String" } @@ -62,7 +62,10 @@ export const apiVersion3: msRest.OperationQueryParameter = { required: true, isConstant: true, serializedName: "api-version", - defaultValue: '2019-10-01', + defaultValue: '2020-07-01', + constraints: { + MinLength: 1 + }, type: { name: "String" } @@ -274,11 +277,26 @@ export const remediationName: msRest.OperationURLParameter = { } } }; -export const resourceGroupName: msRest.OperationURLParameter = { +export const resourceGroupName0: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + type: { + name: "String" + } + } +}; +export const resourceGroupName1: msRest.OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { required: true, serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, type: { name: "String" } @@ -306,35 +324,50 @@ export const resourceName: msRest.OperationURLParameter = { }, skipEncoding: true }; -export const scope: msRest.OperationURLParameter = { - parameterPath: "scope", +export const select: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "queryOptions", + "select" + ], mapper: { - required: true, - serializedName: "scope", + serializedName: "$select", type: { name: "String" } - }, - skipEncoding: true + } }; -export const select: msRest.OperationQueryParameter = { +export const skipToken: msRest.OperationQueryParameter = { parameterPath: [ "options", "queryOptions", - "select" + "skipToken" ], mapper: { - serializedName: "$select", + serializedName: "$skiptoken", + type: { + name: "String" + } + } +}; +export const subscriptionId0: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { +export const subscriptionId1: msRest.OperationURLParameter = { parameterPath: "subscriptionId", mapper: { required: true, serializedName: "subscriptionId", + constraints: { + MinLength: 1 + }, type: { name: "String" } diff --git a/sdk/policyinsights/arm-policyinsights/src/models/policyEventsMappers.ts b/sdk/policyinsights/arm-policyinsights/src/models/policyEventsMappers.ts index 52e0196d1a79..469ab8829ec5 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/policyEventsMappers.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/policyEventsMappers.ts @@ -7,6 +7,7 @@ */ export { + ComponentEventDetails, PolicyEvent, PolicyEventsQueryResults, QueryFailure, diff --git a/sdk/policyinsights/arm-policyinsights/src/models/policyRestrictionsMappers.ts b/sdk/policyinsights/arm-policyinsights/src/models/policyRestrictionsMappers.ts new file mode 100644 index 000000000000..f5e2869a44c7 --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/src/models/policyRestrictionsMappers.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 { + CheckRestrictionsRequest, + CheckRestrictionsResourceDetails, + CheckRestrictionsResult, + CheckRestrictionsResultContentEvaluationResult, + ErrorDefinition, + ErrorResponse, + ExpressionEvaluationDetails, + FieldRestriction, + FieldRestrictions, + IfNotExistsEvaluationDetails, + PendingField, + PolicyEvaluationDetails, + PolicyEvaluationResult, + PolicyReference, + TypedErrorInfo +} from "../models/mappers"; diff --git a/sdk/policyinsights/arm-policyinsights/src/models/policyStatesMappers.ts b/sdk/policyinsights/arm-policyinsights/src/models/policyStatesMappers.ts index 106f475069c2..bd0a0420ddd7 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/policyStatesMappers.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/policyStatesMappers.ts @@ -8,6 +8,7 @@ export { ComplianceDetail, + ComponentStateDetails, ExpressionEvaluationDetails, IfNotExistsEvaluationDetails, PolicyAssignmentSummary, diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/index.ts b/sdk/policyinsights/arm-policyinsights/src/operations/index.ts index 2c6e7a664f19..c2e2f7495bc0 100644 --- a/sdk/policyinsights/arm-policyinsights/src/operations/index.ts +++ b/sdk/policyinsights/arm-policyinsights/src/operations/index.ts @@ -14,3 +14,4 @@ export * from "./policyEvents"; export * from "./policyStates"; export * from "./operations"; export * from "./policyMetadataOperations"; +export * from "./policyRestrictions"; diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/operations.ts b/sdk/policyinsights/arm-policyinsights/src/operations/operations.ts index 72f7a71d5852..34aca8b337fd 100644 --- a/sdk/policyinsights/arm-policyinsights/src/operations/operations.ts +++ b/sdk/policyinsights/arm-policyinsights/src/operations/operations.ts @@ -57,7 +57,7 @@ const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.PolicyInsights/operations", queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion2 ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/policyEvents.ts b/sdk/policyinsights/arm-policyinsights/src/operations/policyEvents.ts index c018de3bc4b1..b1b913b45680 100644 --- a/sdk/policyinsights/arm-policyinsights/src/operations/policyEvents.ts +++ b/sdk/policyinsights/arm-policyinsights/src/operations/policyEvents.ts @@ -277,34 +277,229 @@ export class PolicyEvents { } /** - * 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. + * 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 + * @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 */ - getMetadata(scope: string, options?: msRest.RequestOptionsBase): Promise; + listQueryResultsForResourceGroupLevelPolicyAssignmentNext(nextPageLink: 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 nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - getMetadata(scope: string, callback: msRest.ServiceCallback): void; + listQueryResultsForResourceGroupLevelPolicyAssignmentNext(nextPageLink: 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 nextPageLink The NextLink from the previous successful call to List operation. * @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 { + 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( { - scope, + nextPageLink, options }, - getMetadataOperationSpec, - callback) as Promise; + listQueryResultsForResourceGroupLevelPolicyAssignmentNextOperationSpec, + callback) as Promise; } } @@ -326,7 +521,8 @@ const listQueryResultsForManagementGroupOperationSpec: msRest.OperationSpec = { Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -347,7 +543,7 @@ const listQueryResultsForSubscriptionOperationSpec: msRest.OperationSpec = { path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", urlParameters: [ Parameters.policyEventsResource, - Parameters.subscriptionId + Parameters.subscriptionId0 ], queryParameters: [ Parameters.apiVersion2, @@ -357,7 +553,8 @@ const listQueryResultsForSubscriptionOperationSpec: msRest.OperationSpec = { Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -378,8 +575,8 @@ const listQueryResultsForResourceGroupOperationSpec: msRest.OperationSpec = { path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", urlParameters: [ Parameters.policyEventsResource, - Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.subscriptionId0, + Parameters.resourceGroupName0 ], queryParameters: [ Parameters.apiVersion2, @@ -389,7 +586,8 @@ const listQueryResultsForResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -420,7 +618,9 @@ const listQueryResultsForResourceOperationSpec: msRest.OperationSpec = { Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.expand, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -441,7 +641,7 @@ const listQueryResultsForPolicySetDefinitionOperationSpec: msRest.OperationSpec path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", urlParameters: [ Parameters.policyEventsResource, - Parameters.subscriptionId, + Parameters.subscriptionId0, Parameters.authorizationNamespace, Parameters.policySetDefinitionName ], @@ -453,7 +653,8 @@ const listQueryResultsForPolicySetDefinitionOperationSpec: msRest.OperationSpec Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -474,7 +675,7 @@ const listQueryResultsForPolicyDefinitionOperationSpec: msRest.OperationSpec = { path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", urlParameters: [ Parameters.policyEventsResource, - Parameters.subscriptionId, + Parameters.subscriptionId0, Parameters.authorizationNamespace, Parameters.policyDefinitionName ], @@ -486,7 +687,8 @@ const listQueryResultsForPolicyDefinitionOperationSpec: msRest.OperationSpec = { Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -507,7 +709,7 @@ const listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec: msRest. path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", urlParameters: [ Parameters.policyEventsResource, - Parameters.subscriptionId, + Parameters.subscriptionId0, Parameters.authorizationNamespace, Parameters.policyAssignmentName ], @@ -519,7 +721,8 @@ const listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec: msRest. Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -540,8 +743,8 @@ const listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec: msRest path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", urlParameters: [ Parameters.policyEventsResource, - Parameters.subscriptionId, - Parameters.resourceGroupName, + Parameters.subscriptionId0, + Parameters.resourceGroupName0, Parameters.authorizationNamespace, Parameters.policyAssignmentName ], @@ -553,7 +756,8 @@ const listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec: msRest Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -569,26 +773,166 @@ const listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec: msRest serializer }; -const getMetadataOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "{scope}/providers/Microsoft.PolicyInsights/policyEvents/$metadata", +const listQueryResultsForManagementGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", urlParameters: [ - Parameters.scope + Parameters.nextPageLink ], - queryParameters: [ - Parameters.apiVersion2 + 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: { - serializedName: "parsedResponse", - type: { - name: "String" - } - } + 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 diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/policyMetadataOperations.ts b/sdk/policyinsights/arm-policyinsights/src/operations/policyMetadataOperations.ts index 34e6cab97ff7..38e4d23844e7 100644 --- a/sdk/policyinsights/arm-policyinsights/src/operations/policyMetadataOperations.ts +++ b/sdk/policyinsights/arm-policyinsights/src/operations/policyMetadataOperations.ts @@ -116,7 +116,7 @@ const getResourceOperationSpec: msRest.OperationSpec = { Parameters.resourceName ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion2 ], headerParameters: [ Parameters.acceptLanguage @@ -136,7 +136,7 @@ const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.PolicyInsights/policyMetadata", queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top ], headerParameters: [ diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/policyRestrictions.ts b/sdk/policyinsights/arm-policyinsights/src/operations/policyRestrictions.ts new file mode 100644 index 000000000000..53ced13ffcbf --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/src/operations/policyRestrictions.ts @@ -0,0 +1,160 @@ +/* + * 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/policyRestrictionsMappers"; +import * as Parameters from "../models/parameters"; +import { PolicyInsightsClientContext } from "../policyInsightsClientContext"; + +/** Class representing a PolicyRestrictions. */ +export class PolicyRestrictions { + private readonly client: PolicyInsightsClientContext; + + /** + * Create a PolicyRestrictions. + * @param {PolicyInsightsClientContext} client Reference to the service client. + */ + constructor(client: PolicyInsightsClientContext) { + this.client = client; + } + + /** + * Checks what restrictions Azure Policy will place on a resource within a subscription. + * @param subscriptionId The ID of the target subscription. + * @param parameters The check policy restrictions parameters. + * @param [options] The optional parameters + * @returns Promise + */ + checkAtSubscriptionScope(subscriptionId: string, parameters: Models.CheckRestrictionsRequest, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId The ID of the target subscription. + * @param parameters The check policy restrictions parameters. + * @param callback The callback + */ + checkAtSubscriptionScope(subscriptionId: string, parameters: Models.CheckRestrictionsRequest, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId The ID of the target subscription. + * @param parameters The check policy restrictions parameters. + * @param options The optional parameters + * @param callback The callback + */ + checkAtSubscriptionScope(subscriptionId: string, parameters: Models.CheckRestrictionsRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkAtSubscriptionScope(subscriptionId: string, parameters: Models.CheckRestrictionsRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + parameters, + options + }, + checkAtSubscriptionScopeOperationSpec, + callback) as Promise; + } + + /** + * Checks what restrictions Azure Policy will place on a resource within a resource group. Use this + * when the resource group the resource will be created in is already known. + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The check policy restrictions parameters. + * @param [options] The optional parameters + * @returns Promise + */ + checkAtResourceGroupScope(subscriptionId: string, resourceGroupName: string, parameters: Models.CheckRestrictionsRequest, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The check policy restrictions parameters. + * @param callback The callback + */ + checkAtResourceGroupScope(subscriptionId: string, resourceGroupName: string, parameters: Models.CheckRestrictionsRequest, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The check policy restrictions parameters. + * @param options The optional parameters + * @param callback The callback + */ + checkAtResourceGroupScope(subscriptionId: string, resourceGroupName: string, parameters: Models.CheckRestrictionsRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkAtResourceGroupScope(subscriptionId: string, resourceGroupName: string, parameters: Models.CheckRestrictionsRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + resourceGroupName, + parameters, + options + }, + checkAtResourceGroupScopeOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const checkAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions", + urlParameters: [ + Parameters.subscriptionId1 + ], + queryParameters: [ + Parameters.apiVersion3 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.CheckRestrictionsRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.CheckRestrictionsResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const checkAtResourceGroupScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions", + urlParameters: [ + Parameters.subscriptionId1, + Parameters.resourceGroupName1 + ], + queryParameters: [ + Parameters.apiVersion3 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.CheckRestrictionsRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.CheckRestrictionsResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/policyStates.ts b/sdk/policyinsights/arm-policyinsights/src/operations/policyStates.ts index 6dc820943728..ce906e54bfe2 100644 --- a/sdk/policyinsights/arm-policyinsights/src/operations/policyStates.ts +++ b/sdk/policyinsights/arm-policyinsights/src/operations/policyStates.ts @@ -661,6 +661,232 @@ export class PolicyStates { beginTriggerResourceGroupEvaluationOperationSpec, options); } + + /** + * Queries policy states 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 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 @@ -674,14 +900,15 @@ const listQueryResultsForManagementGroupOperationSpec: msRest.OperationSpec = { Parameters.managementGroupName ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -706,7 +933,7 @@ const summarizeForManagementGroupOperationSpec: msRest.OperationSpec = { Parameters.managementGroupName ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -731,17 +958,18 @@ const listQueryResultsForSubscriptionOperationSpec: msRest.OperationSpec = { path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", urlParameters: [ Parameters.policyStatesResource, - Parameters.subscriptionId + Parameters.subscriptionId0 ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -762,10 +990,10 @@ const summarizeForSubscriptionOperationSpec: msRest.OperationSpec = { path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", urlParameters: [ Parameters.policyStatesSummaryResource, - Parameters.subscriptionId + Parameters.subscriptionId0 ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -790,18 +1018,19 @@ const listQueryResultsForResourceGroupOperationSpec: msRest.OperationSpec = { path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", urlParameters: [ Parameters.policyStatesResource, - Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.subscriptionId0, + Parameters.resourceGroupName0 ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -822,11 +1051,11 @@ const summarizeForResourceGroupOperationSpec: msRest.OperationSpec = { path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", urlParameters: [ Parameters.policyStatesSummaryResource, - Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.subscriptionId0, + Parameters.resourceGroupName0 ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -854,7 +1083,7 @@ const listQueryResultsForResourceOperationSpec: msRest.OperationSpec = { Parameters.resourceId ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, @@ -862,7 +1091,8 @@ const listQueryResultsForResourceOperationSpec: msRest.OperationSpec = { Parameters.to, Parameters.filter, Parameters.apply, - Parameters.expand + Parameters.expand, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -886,7 +1116,7 @@ const summarizeForResourceOperationSpec: msRest.OperationSpec = { Parameters.resourceId ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -911,19 +1141,20 @@ const listQueryResultsForPolicySetDefinitionOperationSpec: msRest.OperationSpec path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", urlParameters: [ Parameters.policyStatesResource, - Parameters.subscriptionId, + Parameters.subscriptionId0, Parameters.authorizationNamespace, Parameters.policySetDefinitionName ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -944,12 +1175,12 @@ const summarizeForPolicySetDefinitionOperationSpec: msRest.OperationSpec = { path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", urlParameters: [ Parameters.policyStatesSummaryResource, - Parameters.subscriptionId, + Parameters.subscriptionId0, Parameters.authorizationNamespace, Parameters.policySetDefinitionName ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -974,19 +1205,20 @@ const listQueryResultsForPolicyDefinitionOperationSpec: msRest.OperationSpec = { path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", urlParameters: [ Parameters.policyStatesResource, - Parameters.subscriptionId, + Parameters.subscriptionId0, Parameters.authorizationNamespace, Parameters.policyDefinitionName ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -1007,12 +1239,12 @@ const summarizeForPolicyDefinitionOperationSpec: msRest.OperationSpec = { path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", urlParameters: [ Parameters.policyStatesSummaryResource, - Parameters.subscriptionId, + Parameters.subscriptionId0, Parameters.authorizationNamespace, Parameters.policyDefinitionName ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -1037,19 +1269,20 @@ const listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec: msRest. path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", urlParameters: [ Parameters.policyStatesResource, - Parameters.subscriptionId, + Parameters.subscriptionId0, Parameters.authorizationNamespace, Parameters.policyAssignmentName ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -1070,12 +1303,12 @@ const summarizeForSubscriptionLevelPolicyAssignmentOperationSpec: msRest.Operati path: "subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", urlParameters: [ Parameters.policyStatesSummaryResource, - Parameters.subscriptionId, + Parameters.subscriptionId0, Parameters.authorizationNamespace, Parameters.policyAssignmentName ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -1100,20 +1333,21 @@ const listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec: msRest path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", urlParameters: [ Parameters.policyStatesResource, - Parameters.subscriptionId, - Parameters.resourceGroupName, + Parameters.subscriptionId0, + Parameters.resourceGroupName0, Parameters.authorizationNamespace, Parameters.policyAssignmentName ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -1134,13 +1368,13 @@ const summarizeForResourceGroupLevelPolicyAssignmentOperationSpec: msRest.Operat path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", urlParameters: [ Parameters.policyStatesSummaryResource, - Parameters.subscriptionId, - Parameters.resourceGroupName, + Parameters.subscriptionId0, + Parameters.resourceGroupName0, Parameters.authorizationNamespace, Parameters.policyAssignmentName ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -1164,10 +1398,10 @@ const beginTriggerSubscriptionEvaluationOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation", urlParameters: [ - Parameters.subscriptionId + Parameters.subscriptionId0 ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion2 ], headerParameters: [ Parameters.acceptLanguage @@ -1186,11 +1420,11 @@ const beginTriggerResourceGroupEvaluationOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation", urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.subscriptionId0, + Parameters.resourceGroupName0 ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion2 ], headerParameters: [ Parameters.acceptLanguage @@ -1204,3 +1438,171 @@ const beginTriggerResourceGroupEvaluationOperationSpec: msRest.OperationSpec = { }, serializer }; + +const listQueryResultsForManagementGroupNextOperationSpec: 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 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/src/operations/policyTrackedResources.ts b/sdk/policyinsights/arm-policyinsights/src/operations/policyTrackedResources.ts index 76d76cddd053..65c1449d6afe 100644 --- a/sdk/policyinsights/arm-policyinsights/src/operations/policyTrackedResources.ts +++ b/sdk/policyinsights/arm-policyinsights/src/operations/policyTrackedResources.ts @@ -289,7 +289,7 @@ const listQueryResultsForSubscriptionOperationSpec: msRest.OperationSpec = { path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", urlParameters: [ Parameters.policyTrackedResourcesResource, - Parameters.subscriptionId + Parameters.subscriptionId0 ], queryParameters: [ Parameters.apiVersion0, @@ -314,9 +314,9 @@ const listQueryResultsForResourceGroupOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", urlParameters: [ - Parameters.resourceGroupName, + Parameters.resourceGroupName0, Parameters.policyTrackedResourcesResource, - Parameters.subscriptionId + Parameters.subscriptionId0 ], queryParameters: [ Parameters.apiVersion0, diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/remediations.ts b/sdk/policyinsights/arm-policyinsights/src/operations/remediations.ts index adc3753690f6..7e301a6afe37 100644 --- a/sdk/policyinsights/arm-policyinsights/src/operations/remediations.ts +++ b/sdk/policyinsights/arm-policyinsights/src/operations/remediations.ts @@ -1212,7 +1212,7 @@ const listDeploymentsAtSubscriptionOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", urlParameters: [ - Parameters.subscriptionId, + Parameters.subscriptionId0, Parameters.remediationName ], queryParameters: [ @@ -1237,7 +1237,7 @@ const cancelAtSubscriptionOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", urlParameters: [ - Parameters.subscriptionId, + Parameters.subscriptionId0, Parameters.remediationName ], queryParameters: [ @@ -1261,7 +1261,7 @@ const listForSubscriptionOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations", urlParameters: [ - Parameters.subscriptionId + Parameters.subscriptionId0 ], queryParameters: [ Parameters.apiVersion1, @@ -1286,7 +1286,7 @@ const createOrUpdateAtSubscriptionOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", urlParameters: [ - Parameters.subscriptionId, + Parameters.subscriptionId0, Parameters.remediationName ], queryParameters: [ @@ -1320,7 +1320,7 @@ const getAtSubscriptionOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", urlParameters: [ - Parameters.subscriptionId, + Parameters.subscriptionId0, Parameters.remediationName ], queryParameters: [ @@ -1344,7 +1344,7 @@ const deleteAtSubscriptionOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", urlParameters: [ - Parameters.subscriptionId, + Parameters.subscriptionId0, Parameters.remediationName ], queryParameters: [ @@ -1369,8 +1369,8 @@ const listDeploymentsAtResourceGroupOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, + Parameters.subscriptionId0, + Parameters.resourceGroupName0, Parameters.remediationName ], queryParameters: [ @@ -1395,8 +1395,8 @@ const cancelAtResourceGroupOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, + Parameters.subscriptionId0, + Parameters.resourceGroupName0, Parameters.remediationName ], queryParameters: [ @@ -1420,8 +1420,8 @@ const listForResourceGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations", urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.subscriptionId0, + Parameters.resourceGroupName0 ], queryParameters: [ Parameters.apiVersion1, @@ -1446,8 +1446,8 @@ const createOrUpdateAtResourceGroupOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, + Parameters.subscriptionId0, + Parameters.resourceGroupName0, Parameters.remediationName ], queryParameters: [ @@ -1481,8 +1481,8 @@ const getAtResourceGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, + Parameters.subscriptionId0, + Parameters.resourceGroupName0, Parameters.remediationName ], queryParameters: [ @@ -1506,8 +1506,8 @@ const deleteAtResourceGroupOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, + Parameters.subscriptionId0, + Parameters.resourceGroupName0, Parameters.remediationName ], queryParameters: [ diff --git a/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts b/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts index 650cf5780b26..1e2568071020 100644 --- a/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts +++ b/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts @@ -23,20 +23,23 @@ class PolicyInsightsClient extends PolicyInsightsClientContext { policyStates: operations.PolicyStates; operations: operations.Operations; policyMetadata: operations.PolicyMetadataOperations; + policyRestrictions: operations.PolicyRestrictions; /** * Initializes a new instance of the PolicyInsightsClient class. * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId2 The ID of the target subscription. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, options?: Models.PolicyInsightsClientOptions) { - super(credentials, options); + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId2: string, options?: Models.PolicyInsightsClientOptions) { + super(credentials, subscriptionId2, 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); this.policyMetadata = new operations.PolicyMetadataOperations(this); + this.policyRestrictions = new operations.PolicyRestrictions(this); } } diff --git a/sdk/policyinsights/arm-policyinsights/src/policyInsightsClientContext.ts b/sdk/policyinsights/arm-policyinsights/src/policyInsightsClientContext.ts index f59b5167e744..8d58d44464e0 100644 --- a/sdk/policyinsights/arm-policyinsights/src/policyInsightsClientContext.ts +++ b/sdk/policyinsights/arm-policyinsights/src/policyInsightsClientContext.ts @@ -17,16 +17,21 @@ const packageVersion = "3.2.0"; export class PolicyInsightsClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; + subscriptionId2: string; /** * Initializes a new instance of the PolicyInsightsClient class. * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId2 The ID of the target subscription. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, options?: Models.PolicyInsightsClientOptions) { + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId2: string, options?: Models.PolicyInsightsClientOptions) { if (credentials == undefined) { throw new Error('\'credentials\' cannot be null.'); } + if (subscriptionId2 == undefined) { + throw new Error('\'subscriptionId2\' cannot be null.'); + } if (!options) { options = {}; @@ -43,6 +48,7 @@ export class PolicyInsightsClientContext extends msRestAzure.AzureServiceClient this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; this.requestContentType = "application/json; charset=utf-8"; this.credentials = credentials; + this.subscriptionId2 = subscriptionId2; if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage;