From 256a3eaf2719d4c3a3ec8d99a3730e522b47928b Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Sun, 12 Apr 2020 22:18:06 +0000 Subject: [PATCH] Generated from b69296624cf810c0b45fa754e2c7340440f29ccc Remove metadata from events and add missing compliancestates in examples --- .../arm-policyinsights/src/models/index.ts | 319 ++++++++++-- .../arm-policyinsights/src/models/mappers.ts | 243 ++++++++-- .../src/models/parameters.ts | 32 +- .../src/models/policyEventsMappers.ts | 1 + .../src/models/policyStatesMappers.ts | 1 + .../src/operations/operations.ts | 2 +- .../src/operations/policyEvents.ts | 84 +--- .../operations/policyMetadataOperations.ts | 4 +- .../src/operations/policyStates.ts | 454 +++++++++++++++++- 9 files changed, 936 insertions(+), 204 deletions(-) diff --git a/sdk/policyinsights/arm-policyinsights/src/models/index.ts b/sdk/policyinsights/arm-policyinsights/src/models/index.ts index 091f0a349986..0eefdcb1c97e 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. */ @@ -437,6 +480,10 @@ export interface PolicyEvent { * policy event. */ principalOid?: string; + /** + * Components events records populated only when URL contains $expand=components clause. + */ + components?: ComponentEventDetails[]; /** * Describes unknown properties. The value of an unknown property can be of "any" type. */ @@ -455,6 +502,10 @@ export interface PolicyEventsQueryResults { * 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; /** * Query results. */ @@ -519,6 +570,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 +727,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 +753,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. */ @@ -1037,8 +1105,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 +1531,26 @@ export interface RemediationListResult extends Array { readonly nextLink?: 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. @@ -2448,31 +2540,6 @@ export type PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentRes }; }; -/** - * Contains response data for the getMetadata operation. - */ -export type PolicyEventsGetMetadataResponse = { - /** - * The parsed response body. - */ - body: string; - - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: string; - }; -}; - /** * Contains response data for the listQueryResultsForManagementGroup operation. */ @@ -2793,6 +2860,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. */ diff --git a/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts b/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts index 909fcae126c3..2f40c9878ac8 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,6 +722,23 @@ export const PolicyEvent: msRest.CompositeMapper = { type: { name: "String" } + }, + components: { + serializedName: "components", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ComponentEventDetails", + additionalProperties: { + type: { + name: "Object" + } + } + } + } + } } }, additionalProperties: { @@ -690,6 +770,12 @@ export const PolicyEventsQueryResults: msRest.CompositeMapper = { name: "Number" } }, + odatanextLink: { + serializedName: "@odata\\.nextLink", + type: { + name: "String" + } + }, value: { serializedName: "value", type: { @@ -808,6 +894,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 +1131,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 +1178,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: { @@ -1653,6 +1759,11 @@ export const QueryOptions: msRest.CompositeMapper = { name: "String" } }, + skipToken: { + type: { + name: "String" + } + }, expand: { type: { name: "String" @@ -1752,6 +1863,54 @@ export const RemediationListResult: 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" + } + }, + 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..4f78a745a921 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts @@ -45,18 +45,6 @@ export const apiVersion1: msRest.OperationQueryParameter = { } }; export const apiVersion2: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2018-04-04', - type: { - name: "String" - } - } -}; -export const apiVersion3: msRest.OperationQueryParameter = { parameterPath: "apiVersion", mapper: { required: true, @@ -306,25 +294,27 @@ 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" } 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/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/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..130557717f4c 100644 --- a/sdk/policyinsights/arm-policyinsights/src/operations/policyEvents.ts +++ b/sdk/policyinsights/arm-policyinsights/src/operations/policyEvents.ts @@ -275,37 +275,6 @@ export class PolicyEvents { listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec, callback) as Promise; } - - /** - * Gets OData metadata XML document. - * @param scope A valid scope, i.e. management group, subscription, resource group, or resource ID. - * Scope used has no effect on metadata returned. - * @param [options] The optional parameters - * @returns Promise - */ - getMetadata(scope: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param scope A valid scope, i.e. management group, subscription, resource group, or resource ID. - * Scope used has no effect on metadata returned. - * @param callback The callback - */ - getMetadata(scope: string, callback: msRest.ServiceCallback): void; - /** - * @param scope A valid scope, i.e. management group, subscription, resource group, or resource ID. - * Scope used has no effect on metadata returned. - * @param options The optional parameters - * @param callback The callback - */ - getMetadata(scope: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getMetadata(scope: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - scope, - options - }, - getMetadataOperationSpec, - callback) as Promise; - } } // Operation Specifications @@ -326,7 +295,8 @@ const listQueryResultsForManagementGroupOperationSpec: msRest.OperationSpec = { Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -357,7 +327,8 @@ const listQueryResultsForSubscriptionOperationSpec: msRest.OperationSpec = { Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -389,7 +360,8 @@ const listQueryResultsForResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -420,7 +392,9 @@ const listQueryResultsForResourceOperationSpec: msRest.OperationSpec = { Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.expand, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -453,7 +427,8 @@ const listQueryResultsForPolicySetDefinitionOperationSpec: msRest.OperationSpec Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -486,7 +461,8 @@ const listQueryResultsForPolicyDefinitionOperationSpec: msRest.OperationSpec = { Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -519,7 +495,8 @@ const listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec: msRest. Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -553,7 +530,8 @@ const listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec: msRest Parameters.from, Parameters.to, Parameters.filter, - Parameters.apply + Parameters.apply, + Parameters.skipToken ], headerParameters: [ Parameters.acceptLanguage @@ -568,31 +546,3 @@ const listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec: msRest }, serializer }; - -const getMetadataOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "{scope}/providers/Microsoft.PolicyInsights/policyEvents/$metadata", - urlParameters: [ - Parameters.scope - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: { - serializedName: "parsedResponse", - type: { - name: "String" - } - } - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - serializer -}; 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/policyStates.ts b/sdk/policyinsights/arm-policyinsights/src/operations/policyStates.ts index 6dc820943728..596ddbda2b9d 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, @@ -734,14 +961,15 @@ const listQueryResultsForSubscriptionOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], 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 @@ -765,7 +993,7 @@ const summarizeForSubscriptionOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -794,14 +1022,15 @@ const listQueryResultsForResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.resourceGroupName ], 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 @@ -826,7 +1055,7 @@ const summarizeForResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.resourceGroupName ], 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, @@ -916,14 +1146,15 @@ const listQueryResultsForPolicySetDefinitionOperationSpec: msRest.OperationSpec 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 @@ -949,7 +1180,7 @@ const summarizeForPolicySetDefinitionOperationSpec: msRest.OperationSpec = { Parameters.policySetDefinitionName ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -979,14 +1210,15 @@ const listQueryResultsForPolicyDefinitionOperationSpec: msRest.OperationSpec = { 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 @@ -1012,7 +1244,7 @@ const summarizeForPolicyDefinitionOperationSpec: msRest.OperationSpec = { Parameters.policyDefinitionName ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -1042,14 +1274,15 @@ const listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec: msRest. 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 @@ -1075,7 +1308,7 @@ const summarizeForSubscriptionLevelPolicyAssignmentOperationSpec: msRest.Operati Parameters.policyAssignmentName ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -1106,14 +1339,15 @@ const listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec: msRest 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 @@ -1140,7 +1374,7 @@ const summarizeForResourceGroupLevelPolicyAssignmentOperationSpec: msRest.Operat Parameters.policyAssignmentName ], queryParameters: [ - Parameters.apiVersion3, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -1167,7 +1401,7 @@ const beginTriggerSubscriptionEvaluationOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion3 + Parameters.apiVersion2 ], headerParameters: [ Parameters.acceptLanguage @@ -1190,7 +1424,7 @@ const beginTriggerResourceGroupEvaluationOperationSpec: msRest.OperationSpec = { Parameters.resourceGroupName ], 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 +};