diff --git a/sdk/policyinsights/arm-policyinsights/README.md b/sdk/policyinsights/arm-policyinsights/README.md index e5259590ebc5..7f86d0435135 100644 --- a/sdk/policyinsights/arm-policyinsights/README.md +++ b/sdk/policyinsights/arm-policyinsights/README.md @@ -101,5 +101,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fpolicyinsights%2Farm-policyinsights%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/policyinsights/arm-policyinsights/README.png) diff --git a/sdk/policyinsights/arm-policyinsights/package.json b/sdk/policyinsights/arm-policyinsights/package.json index 02bfb9c18b9b..168f2dd480e4 100644 --- a/sdk/policyinsights/arm-policyinsights/package.json +++ b/sdk/policyinsights/arm-policyinsights/package.json @@ -26,13 +26,13 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/policyinsights/arm-policyinsights", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", diff --git a/sdk/policyinsights/arm-policyinsights/src/models/index.ts b/sdk/policyinsights/arm-policyinsights/src/models/index.ts index 79e61253549a..0f8b2e1978a0 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/index.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/index.ts @@ -141,16 +141,19 @@ export interface RemediationFilters { export interface RemediationDeploymentSummary { /** * The number of deployments required by the remediation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - totalDeployments?: number; + readonly totalDeployments?: number; /** * The number of deployments required by the remediation that have succeeded. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - successfulDeployments?: number; + readonly successfulDeployments?: number; /** * The number of deployments required by the remediation that have failed. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - failedDeployments?: number; + readonly failedDeployments?: number; } /** @@ -166,6 +169,11 @@ export interface Remediation extends BaseResource { * Required when the policy assignment being remediated assigns a policy set definition. */ policyDefinitionReferenceId?: string; + /** + * The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not + * specified. Possible values include: 'ExistingNonCompliant', 'ReEvaluateCompliance' + */ + resourceDiscoveryMode?: ResourceDiscoveryMode; /** * The status of the remediation. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -187,8 +195,9 @@ export interface Remediation extends BaseResource { filters?: RemediationFilters; /** * The deployment status summary for all deployments created by the remediation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - deploymentStatus?: RemediationDeploymentSummary; + readonly deploymentStatus?: RemediationDeploymentSummary; /** * The ID of the remediation. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -434,24 +443,6 @@ export interface PolicyEvent { [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. - */ - odatacount?: number; - /** - * Query results. - */ - value?: PolicyEvent[]; -} - /** * Evaluation details of policy language expressions. */ @@ -544,7 +535,7 @@ export interface PolicyState { effectiveParameters?: string; /** * Flag which states whether the resource is compliant against the policy assignment it was - * evaluated against. + * evaluated against. This property is deprecated; please use ComplianceState instead. */ isCompliant?: boolean; /** @@ -633,6 +624,10 @@ export interface PolicyState { * Policy evaluation details. */ policyEvaluationDetails?: PolicyEvaluationDetails; + /** + * Policy definition group names. + */ + policyDefinitionGroupNames?: string[]; /** * Describes unknown properties. The value of an unknown property can be of "any" type. */ @@ -640,30 +635,27 @@ export interface PolicyState { } /** - * Query results. + * The compliance state rollup. */ -export interface PolicyStatesQueryResults { +export interface ComplianceDetail { /** - * OData context string; used by OData clients to resolve type information based on metadata. + * The compliance state. */ - odatacontext?: string; - /** - * OData entity count; represents the number of policy state records returned. - */ - odatacount?: number; + complianceState?: string; /** - * Query results. + * Summarized count value for this compliance state. */ - value?: PolicyState[]; + count?: number; } /** - * Non-compliance summary on a particular summary level. + * Compliance summary on a particular summary level. */ export interface SummaryResults { /** * HTTP POST URI for queryResults action on Microsoft.PolicyInsights to retrieve raw results for - * the non-compliance summary. + * the compliance summary. This property will not be available by default in future API versions, + * but could be queried explicitly. */ queryResultsUri?: string; /** @@ -674,6 +666,19 @@ export interface SummaryResults { * Number of non-compliant policies. */ nonCompliantPolicies?: number; + /** + * The resources summary at this level. + */ + resourceDetails?: ComplianceDetail[]; + /** + * The policy artifact summary at this level. For query scope level, it represents policy + * assignment summary. For policy assignment level, it represents policy definitions summary. + */ + policyDetails?: ComplianceDetail[]; + /** + * The policy definition group summary at this level. + */ + policyGroupDetails?: ComplianceDetail[]; } /** @@ -688,12 +693,30 @@ export interface PolicyDefinitionSummary { * Policy definition reference ID. */ policyDefinitionReferenceId?: string; + /** + * Policy definition group names. + */ + policyDefinitionGroupNames?: string[]; /** * Policy effect, i.e. policy definition action. */ effect?: string; /** - * Non-compliance summary for the policy definition. + * Compliance summary for the policy definition. + */ + results?: SummaryResults; +} + +/** + * Policy definition group summary. + */ +export interface PolicyGroupSummary { + /** + * Policy group name. + */ + policyGroupName?: string; + /** + * Compliance summary for the policy definition group. */ results?: SummaryResults; } @@ -711,13 +734,17 @@ export interface PolicyAssignmentSummary { */ policySetDefinitionId?: string; /** - * Non-compliance summary for the policy assignment. + * Compliance summary for the policy assignment. */ results?: SummaryResults; /** * Policy definitions summary. */ policyDefinitions?: PolicyDefinitionSummary[]; + /** + * Policy definition group summary. + */ + policyGroups?: PolicyGroupSummary[]; } /** @@ -733,7 +760,7 @@ export interface Summary { */ odatacontext?: string; /** - * Non-compliance summary for all policy assignments. + * Compliance summary for all policy assignments. */ results?: SummaryResults; /** @@ -810,6 +837,118 @@ export interface OperationsListResults { value?: Operation[]; } +/** + * Policy metadata resource definition. + */ +export interface PolicyMetadata { + /** + * The policy metadata identifier. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly metadataId?: string; + /** + * The category of the policy metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly category?: string; + /** + * The title of the policy metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly title?: string; + /** + * The owner of the policy metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly owner?: string; + /** + * Url for getting additional content about the resource metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly additionalContentUrl?: string; + /** + * Additional metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly metadata?: any; + /** + * The description of the policy metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; + /** + * The requirements of the policy metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly requirements?: string; + /** + * The ID of the policy metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The type of the policy metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The name of the policy metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; +} + +/** + * Slim version of policy metadata resource definition, excluding properties with large strings + */ +export interface SlimPolicyMetadata { + /** + * The policy metadata identifier. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly metadataId?: string; + /** + * The category of the policy metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly category?: string; + /** + * The title of the policy metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly title?: string; + /** + * The owner of the policy metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly owner?: string; + /** + * Url for getting additional content about the resource metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly additionalContentUrl?: string; + /** + * Additional metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly metadata?: any; + /** + * The ID of the policy metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The type of the policy metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The name of the policy metadata. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; +} + /** * Additional parameters for a set of operations. */ @@ -1213,6 +1352,16 @@ export interface PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentOptio queryOptions?: QueryOptions; } +/** + * Optional Parameters. + */ +export interface PolicyMetadataListOptionalParams extends msRest.RequestOptionsBase { + /** + * Additional parameters for the operation + */ + queryOptions?: QueryOptions; +} + /** * An interface representing PolicyInsightsClientOptions. */ @@ -1259,6 +1408,67 @@ 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. + * @extends Array + */ +export interface PolicyMetadataCollection extends Array { + /** + * The URL to get the next set of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * Defines values for ResourceDiscoveryMode. + * Possible values include: 'ExistingNonCompliant', 'ReEvaluateCompliance' + * @readonly + * @enum {string} + */ +export type ResourceDiscoveryMode = 'ExistingNonCompliant' | 'ReEvaluateCompliance'; + /** * Defines values for PolicyStatesResource. * Possible values include: 'default', 'latest' @@ -2228,14 +2438,69 @@ export type PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentRes }; /** - * Contains response data for the getMetadata operation. + * Contains response data for the listQueryResultsForManagementGroupNext operation. + */ +export type PolicyEventsListQueryResultsForManagementGroupNextResponse = PolicyEventsQueryResults & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForSubscriptionNext operation. */ -export type PolicyEventsGetMetadataResponse = { +export type PolicyEventsListQueryResultsForSubscriptionNextResponse = PolicyEventsQueryResults & { /** - * The parsed response body. + * The underlying HTTP response. */ - body: string; + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceGroupNext operation. + */ +export type PolicyEventsListQueryResultsForResourceGroupNextResponse = PolicyEventsQueryResults & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceNext operation. + */ +export type PolicyEventsListQueryResultsForResourceNextResponse = PolicyEventsQueryResults & { /** * The underlying HTTP response. */ @@ -2248,7 +2513,89 @@ export type PolicyEventsGetMetadataResponse = { /** * The response body as parsed JSON or XML */ - parsedBody: string; + parsedBody: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForPolicySetDefinitionNext operation. + */ +export type PolicyEventsListQueryResultsForPolicySetDefinitionNextResponse = PolicyEventsQueryResults & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForPolicyDefinitionNext operation. + */ +export type PolicyEventsListQueryResultsForPolicyDefinitionNextResponse = PolicyEventsQueryResults & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForSubscriptionLevelPolicyAssignmentNext + * operation. + */ +export type PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentNextResponse = PolicyEventsQueryResults & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyEventsQueryResults; + }; +}; + +/** + * Contains response data for the listQueryResultsForResourceGroupLevelPolicyAssignmentNext + * operation. + */ +export type PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentNextResponse = PolicyEventsQueryResults & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyEventsQueryResults; }; }; @@ -2573,14 +2920,151 @@ export type PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentResponse = }; /** - * Contains response data for the getMetadata operation. + * 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 PolicyStatesGetMetadataResponse = { +export type PolicyStatesListQueryResultsForPolicySetDefinitionNextResponse = PolicyStatesQueryResults & { /** - * The parsed response body. + * The underlying HTTP response. */ - body: string; + _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. */ @@ -2593,7 +3077,7 @@ export type PolicyStatesGetMetadataResponse = { /** * The response body as parsed JSON or XML */ - parsedBody: string; + parsedBody: PolicyStatesQueryResults; }; }; @@ -2616,3 +3100,63 @@ export type OperationsListResponse = OperationsListResults & { parsedBody: OperationsListResults; }; }; + +/** + * Contains response data for the getResource operation. + */ +export type PolicyMetadataGetResourceResponse = PolicyMetadata & { + /** + * 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: PolicyMetadata; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type PolicyMetadataListResponse = PolicyMetadataCollection & { + /** + * 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: PolicyMetadataCollection; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type PolicyMetadataListNextResponse = PolicyMetadataCollection & { + /** + * 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: PolicyMetadataCollection; + }; +}; diff --git a/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts b/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts index 82c09cc88ec5..d51e2799a3d0 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts @@ -213,18 +213,21 @@ export const RemediationDeploymentSummary: msRest.CompositeMapper = { className: "RemediationDeploymentSummary", modelProperties: { totalDeployments: { + readOnly: true, serializedName: "totalDeployments", type: { name: "Number" } }, successfulDeployments: { + readOnly: true, serializedName: "successfulDeployments", type: { name: "Number" } }, failedDeployments: { + readOnly: true, serializedName: "failedDeployments", type: { name: "Number" @@ -252,6 +255,12 @@ export const Remediation: msRest.CompositeMapper = { name: "String" } }, + resourceDiscoveryMode: { + serializedName: "properties.resourceDiscoveryMode", + type: { + name: "String" + } + }, provisioningState: { readOnly: true, serializedName: "properties.provisioningState", @@ -281,6 +290,7 @@ export const Remediation: msRest.CompositeMapper = { } }, deploymentStatus: { + readOnly: true, serializedName: "properties.deploymentStatus", type: { name: "Composite", @@ -659,48 +669,6 @@ export const PolicyEvent: 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" - } - }, - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicyEvent", - additionalProperties: { - type: { - name: "Object" - } - } - } - } - } - } - } - } -}; - export const ExpressionEvaluationDetails: msRest.CompositeMapper = { serializedName: "ExpressionEvaluationDetails", type: { @@ -978,6 +946,17 @@ export const PolicyState: msRest.CompositeMapper = { name: "Composite", className: "PolicyEvaluationDetails" } + }, + policyDefinitionGroupNames: { + serializedName: "policyDefinitionGroupNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } }, additionalProperties: { @@ -988,43 +967,23 @@ export const PolicyState: msRest.CompositeMapper = { } }; -export const PolicyStatesQueryResults: msRest.CompositeMapper = { - serializedName: "PolicyStatesQueryResults", +export const ComplianceDetail: msRest.CompositeMapper = { + serializedName: "ComplianceDetail", type: { name: "Composite", - className: "PolicyStatesQueryResults", + className: "ComplianceDetail", modelProperties: { - odatacontext: { - serializedName: "@odata\\.context", + complianceState: { + serializedName: "complianceState", type: { name: "String" } }, - odatacount: { - serializedName: "@odata\\.count", - constraints: { - InclusiveMinimum: 0 - }, + count: { + serializedName: "count", type: { name: "Number" } - }, - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicyState", - additionalProperties: { - type: { - name: "Object" - } - } - } - } - } } } } @@ -1059,6 +1018,42 @@ export const SummaryResults: msRest.CompositeMapper = { type: { name: "Number" } + }, + resourceDetails: { + serializedName: "resourceDetails", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ComplianceDetail" + } + } + } + }, + policyDetails: { + serializedName: "policyDetails", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ComplianceDetail" + } + } + } + }, + policyGroupDetails: { + serializedName: "policyGroupDetails", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ComplianceDetail" + } + } + } } } } @@ -1082,6 +1077,17 @@ export const PolicyDefinitionSummary: msRest.CompositeMapper = { name: "String" } }, + policyDefinitionGroupNames: { + serializedName: "policyDefinitionGroupNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, effect: { serializedName: "effect", type: { @@ -1099,6 +1105,29 @@ export const PolicyDefinitionSummary: msRest.CompositeMapper = { } }; +export const PolicyGroupSummary: msRest.CompositeMapper = { + serializedName: "PolicyGroupSummary", + type: { + name: "Composite", + className: "PolicyGroupSummary", + modelProperties: { + policyGroupName: { + serializedName: "policyGroupName", + type: { + name: "String" + } + }, + results: { + serializedName: "results", + type: { + name: "Composite", + className: "SummaryResults" + } + } + } + } +}; + export const PolicyAssignmentSummary: msRest.CompositeMapper = { serializedName: "PolicyAssignmentSummary", type: { @@ -1135,6 +1164,18 @@ export const PolicyAssignmentSummary: msRest.CompositeMapper = { } } } + }, + policyGroups: { + serializedName: "policyGroups", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyGroupSummary" + } + } + } } } } @@ -1307,6 +1348,166 @@ export const OperationsListResults: msRest.CompositeMapper = { } }; +export const PolicyMetadata: msRest.CompositeMapper = { + serializedName: "PolicyMetadata", + type: { + name: "Composite", + className: "PolicyMetadata", + modelProperties: { + metadataId: { + readOnly: true, + serializedName: "properties.metadataId", + type: { + name: "String" + } + }, + category: { + readOnly: true, + serializedName: "properties.category", + type: { + name: "String" + } + }, + title: { + readOnly: true, + serializedName: "properties.title", + type: { + name: "String" + } + }, + owner: { + readOnly: true, + serializedName: "properties.owner", + type: { + name: "String" + } + }, + additionalContentUrl: { + readOnly: true, + serializedName: "properties.additionalContentUrl", + type: { + name: "String" + } + }, + metadata: { + readOnly: true, + serializedName: "properties.metadata", + type: { + name: "Object" + } + }, + description: { + readOnly: true, + serializedName: "properties.description", + type: { + name: "String" + } + }, + requirements: { + readOnly: true, + serializedName: "properties.requirements", + type: { + name: "String" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const SlimPolicyMetadata: msRest.CompositeMapper = { + serializedName: "SlimPolicyMetadata", + type: { + name: "Composite", + className: "SlimPolicyMetadata", + modelProperties: { + metadataId: { + readOnly: true, + serializedName: "properties.metadataId", + type: { + name: "String" + } + }, + category: { + readOnly: true, + serializedName: "properties.category", + type: { + name: "String" + } + }, + title: { + readOnly: true, + serializedName: "properties.title", + type: { + name: "String" + } + }, + owner: { + readOnly: true, + serializedName: "properties.owner", + type: { + name: "String" + } + }, + additionalContentUrl: { + readOnly: true, + serializedName: "properties.additionalContentUrl", + type: { + name: "String" + } + }, + metadata: { + readOnly: true, + serializedName: "properties.metadata", + type: { + name: "Object" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + export const QueryOptions: msRest.CompositeMapper = { type: { name: "Composite", @@ -1445,3 +1646,129 @@ 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: { + name: "Composite", + className: "PolicyMetadataCollection", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SlimPolicyMetadata" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts b/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts index e2c1ff341a07..8c146d7ff55f 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts @@ -38,7 +38,19 @@ export const apiVersion1: msRest.OperationQueryParameter = { required: true, isConstant: true, serializedName: "api-version", - defaultValue: '2018-04-04', + defaultValue: '2019-07-01', + type: { + name: "String" + } + } +}; +export const apiVersion2: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + isConstant: true, + serializedName: "api-version", + defaultValue: '2019-10-01', type: { name: "String" } @@ -271,11 +283,11 @@ export const resourceId: msRest.OperationURLParameter = { }, skipEncoding: true }; -export const scope: msRest.OperationURLParameter = { - parameterPath: "scope", +export const resourceName: msRest.OperationURLParameter = { + parameterPath: "resourceName", mapper: { required: true, - serializedName: "scope", + serializedName: "resourceName", type: { name: "String" } diff --git a/sdk/policyinsights/arm-policyinsights/src/models/policyMetadataOperationsMappers.ts b/sdk/policyinsights/arm-policyinsights/src/models/policyMetadataOperationsMappers.ts new file mode 100644 index 000000000000..2fc27718cd64 --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/src/models/policyMetadataOperationsMappers.ts @@ -0,0 +1,16 @@ +/* + * 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 { + ErrorDefinition, + ErrorResponse, + PolicyMetadata, + PolicyMetadataCollection, + SlimPolicyMetadata, + 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 270dc52d87db..106f475069c2 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/policyStatesMappers.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/policyStatesMappers.ts @@ -7,11 +7,13 @@ */ export { + ComplianceDetail, ExpressionEvaluationDetails, IfNotExistsEvaluationDetails, PolicyAssignmentSummary, PolicyDefinitionSummary, PolicyEvaluationDetails, + PolicyGroupSummary, PolicyState, PolicyStatesQueryResults, QueryFailure, diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/index.ts b/sdk/policyinsights/arm-policyinsights/src/operations/index.ts index 223516d3938e..2c6e7a664f19 100644 --- a/sdk/policyinsights/arm-policyinsights/src/operations/index.ts +++ b/sdk/policyinsights/arm-policyinsights/src/operations/index.ts @@ -13,3 +13,4 @@ export * from "./remediations"; export * from "./policyEvents"; export * from "./policyStates"; export * from "./operations"; +export * from "./policyMetadataOperations"; diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/operations.ts b/sdk/policyinsights/arm-policyinsights/src/operations/operations.ts index 2ab288682dd7..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.apiVersion0 + 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 0fd2537cc1e7..21508222bfcb 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; } } @@ -319,7 +514,7 @@ const listQueryResultsForManagementGroupOperationSpec: msRest.OperationSpec = { Parameters.managementGroupName ], queryParameters: [ - Parameters.apiVersion1, + Parameters.apiVersion0, Parameters.top, Parameters.orderBy, Parameters.select, @@ -350,7 +545,7 @@ const listQueryResultsForSubscriptionOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion1, + Parameters.apiVersion0, Parameters.top, Parameters.orderBy, Parameters.select, @@ -382,7 +577,7 @@ const listQueryResultsForResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.resourceGroupName ], queryParameters: [ - Parameters.apiVersion1, + Parameters.apiVersion0, Parameters.top, Parameters.orderBy, Parameters.select, @@ -413,7 +608,7 @@ const listQueryResultsForResourceOperationSpec: msRest.OperationSpec = { Parameters.resourceId ], queryParameters: [ - Parameters.apiVersion1, + Parameters.apiVersion0, Parameters.top, Parameters.orderBy, Parameters.select, @@ -446,7 +641,7 @@ const listQueryResultsForPolicySetDefinitionOperationSpec: msRest.OperationSpec Parameters.policySetDefinitionName ], queryParameters: [ - Parameters.apiVersion1, + Parameters.apiVersion0, Parameters.top, Parameters.orderBy, Parameters.select, @@ -479,7 +674,7 @@ const listQueryResultsForPolicyDefinitionOperationSpec: msRest.OperationSpec = { Parameters.policyDefinitionName ], queryParameters: [ - Parameters.apiVersion1, + Parameters.apiVersion0, Parameters.top, Parameters.orderBy, Parameters.select, @@ -512,7 +707,7 @@ const listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec: msRest. Parameters.policyAssignmentName ], queryParameters: [ - Parameters.apiVersion1, + Parameters.apiVersion0, Parameters.top, Parameters.orderBy, Parameters.select, @@ -546,7 +741,7 @@ const listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec: msRest Parameters.policyAssignmentName ], queryParameters: [ - Parameters.apiVersion1, + Parameters.apiVersion0, Parameters.top, Parameters.orderBy, Parameters.select, @@ -569,26 +764,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.apiVersion1 + 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 new file mode 100644 index 000000000000..38e4d23844e7 --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/src/operations/policyMetadataOperations.ts @@ -0,0 +1,175 @@ +/* + * 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/policyMetadataOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { PolicyInsightsClientContext } from "../policyInsightsClientContext"; + +/** Class representing a PolicyMetadataOperations. */ +export class PolicyMetadataOperations { + private readonly client: PolicyInsightsClientContext; + + /** + * Create a PolicyMetadataOperations. + * @param {PolicyInsightsClientContext} client Reference to the service client. + */ + constructor(client: PolicyInsightsClientContext) { + this.client = client; + } + + /** + * Get policy metadata resource. + * @param resourceName The name of the policy metadata resource. + * @param [options] The optional parameters + * @returns Promise + */ + getResource(resourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceName The name of the policy metadata resource. + * @param callback The callback + */ + getResource(resourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceName The name of the policy metadata resource. + * @param options The optional parameters + * @param callback The callback + */ + getResource(resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getResource(resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceName, + options + }, + getResourceOperationSpec, + callback) as Promise; + } + + /** + * Get a list of the policy metadata resources. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: Models.PolicyMetadataListOptionalParams): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: Models.PolicyMetadataListOptionalParams, callback: msRest.ServiceCallback): void; + list(options?: Models.PolicyMetadataListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Get a list of the policy metadata resources. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getResourceOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.PolicyInsights/policyMetadata/{resourceName}", + urlParameters: [ + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyMetadata + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.PolicyInsights/policyMetadata", + queryParameters: [ + Parameters.apiVersion2, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyMetadataCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyMetadataCollection + }, + 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 41e66fd2afcd..2a47e6156f7a 100644 --- a/sdk/policyinsights/arm-policyinsights/src/operations/policyStates.ts +++ b/sdk/policyinsights/arm-policyinsights/src/operations/policyStates.ts @@ -605,34 +605,229 @@ export class PolicyStates { } /** - * 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 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 + * @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 */ - 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; } } @@ -647,7 +842,7 @@ const listQueryResultsForManagementGroupOperationSpec: msRest.OperationSpec = { Parameters.managementGroupName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, @@ -679,7 +874,7 @@ const summarizeForManagementGroupOperationSpec: msRest.OperationSpec = { Parameters.managementGroupName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -707,7 +902,7 @@ const listQueryResultsForSubscriptionOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, @@ -738,7 +933,7 @@ const summarizeForSubscriptionOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -767,7 +962,7 @@ const listQueryResultsForResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.resourceGroupName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, @@ -799,7 +994,7 @@ const summarizeForResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.resourceGroupName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -827,7 +1022,7 @@ const listQueryResultsForResourceOperationSpec: msRest.OperationSpec = { Parameters.resourceId ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, @@ -859,7 +1054,7 @@ const summarizeForResourceOperationSpec: msRest.OperationSpec = { Parameters.resourceId ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -889,7 +1084,7 @@ const listQueryResultsForPolicySetDefinitionOperationSpec: msRest.OperationSpec Parameters.policySetDefinitionName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, @@ -922,7 +1117,7 @@ const summarizeForPolicySetDefinitionOperationSpec: msRest.OperationSpec = { Parameters.policySetDefinitionName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -952,7 +1147,7 @@ const listQueryResultsForPolicyDefinitionOperationSpec: msRest.OperationSpec = { Parameters.policyDefinitionName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, @@ -985,7 +1180,7 @@ const summarizeForPolicyDefinitionOperationSpec: msRest.OperationSpec = { Parameters.policyDefinitionName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -1015,7 +1210,7 @@ const listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec: msRest. Parameters.policyAssignmentName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, @@ -1048,7 +1243,7 @@ const summarizeForSubscriptionLevelPolicyAssignmentOperationSpec: msRest.Operati Parameters.policyAssignmentName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -1079,7 +1274,7 @@ const listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec: msRest Parameters.policyAssignmentName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.orderBy, Parameters.select, @@ -1113,7 +1308,7 @@ const summarizeForResourceGroupLevelPolicyAssignmentOperationSpec: msRest.Operat Parameters.policyAssignmentName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion2, Parameters.top, Parameters.from, Parameters.to, @@ -1133,26 +1328,166 @@ const summarizeForResourceGroupLevelPolicyAssignmentOperationSpec: msRest.Operat serializer }; -const getMetadataOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "{scope}/providers/Microsoft.PolicyInsights/policyStates/$metadata", +const listQueryResultsForManagementGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", urlParameters: [ - Parameters.scope + Parameters.nextPageLink ], - queryParameters: [ - Parameters.apiVersion0 + 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: { - serializedName: "parsedResponse", - type: { - name: "String" - } - } + 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 diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/remediations.ts b/sdk/policyinsights/arm-policyinsights/src/operations/remediations.ts index ae8d36d2b1aa..adc3753690f6 100644 --- a/sdk/policyinsights/arm-policyinsights/src/operations/remediations.ts +++ b/sdk/policyinsights/arm-policyinsights/src/operations/remediations.ts @@ -1054,7 +1054,7 @@ const listDeploymentsAtManagementGroupOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion1, Parameters.top ], headerParameters: [ @@ -1080,7 +1080,7 @@ const cancelAtManagementGroupOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -1104,7 +1104,7 @@ const listForManagementGroupOperationSpec: msRest.OperationSpec = { Parameters.managementGroupId ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion1, Parameters.top, Parameters.filter ], @@ -1131,7 +1131,7 @@ const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -1166,7 +1166,7 @@ const getAtManagementGroupOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -1191,7 +1191,7 @@ const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -1216,7 +1216,7 @@ const listDeploymentsAtSubscriptionOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion1, Parameters.top ], headerParameters: [ @@ -1241,7 +1241,7 @@ const cancelAtSubscriptionOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -1264,7 +1264,7 @@ const listForSubscriptionOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion1, Parameters.top, Parameters.filter ], @@ -1290,7 +1290,7 @@ const createOrUpdateAtSubscriptionOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -1324,7 +1324,7 @@ const getAtSubscriptionOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -1348,7 +1348,7 @@ const deleteAtSubscriptionOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -1374,7 +1374,7 @@ const listDeploymentsAtResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion1, Parameters.top ], headerParameters: [ @@ -1400,7 +1400,7 @@ const cancelAtResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -1424,7 +1424,7 @@ const listForResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.resourceGroupName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion1, Parameters.top, Parameters.filter ], @@ -1451,7 +1451,7 @@ const createOrUpdateAtResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -1486,7 +1486,7 @@ const getAtResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -1511,7 +1511,7 @@ const deleteAtResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -1536,7 +1536,7 @@ const listDeploymentsAtResourceOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion1, Parameters.top ], headerParameters: [ @@ -1561,7 +1561,7 @@ const cancelAtResourceOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -1584,7 +1584,7 @@ const listForResourceOperationSpec: msRest.OperationSpec = { Parameters.resourceId ], queryParameters: [ - Parameters.apiVersion0, + Parameters.apiVersion1, Parameters.top, Parameters.filter ], @@ -1610,7 +1610,7 @@ const createOrUpdateAtResourceOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -1644,7 +1644,7 @@ const getAtResourceOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -1668,7 +1668,7 @@ const deleteAtResourceOperationSpec: msRest.OperationSpec = { Parameters.remediationName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts b/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts index 355467950460..650cf5780b26 100644 --- a/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts +++ b/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts @@ -22,6 +22,7 @@ class PolicyInsightsClient extends PolicyInsightsClientContext { policyEvents: operations.PolicyEvents; policyStates: operations.PolicyStates; operations: operations.Operations; + policyMetadata: operations.PolicyMetadataOperations; /** * Initializes a new instance of the PolicyInsightsClient class. @@ -35,6 +36,7 @@ class PolicyInsightsClient extends PolicyInsightsClientContext { this.policyEvents = new operations.PolicyEvents(this); this.policyStates = new operations.PolicyStates(this); this.operations = new operations.Operations(this); + this.policyMetadata = new operations.PolicyMetadataOperations(this); } }