Skip to content

Commit

Permalink
Generated from 93b740901ffff1df0fe936b9c6a2d9d83961df1d
Browse files Browse the repository at this point in the history
Fix typo
  • Loading branch information
SDK Automation committed Mar 18, 2020
1 parent 8329a7c commit d656bd8
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sdk/policyinsights/arm-policyinsights/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019 Microsoft
Copyright (c) 2020 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
15 changes: 15 additions & 0 deletions sdk/policyinsights/arm-policyinsights/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,21 @@ export interface PolicyState {
* Policy definition group names.
*/
policyDefinitionGroupNames?: string[];
/**
* Evaluated policy definition version.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly policyDefinitionVersion?: string;
/**
* Evaluated policy set definition version.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly policySetDefinitionVersion?: string;
/**
* Evaluated policy assignment version.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly policyAssignmentVersion?: string;
/**
* Describes unknown properties. The value of an unknown property can be of "any" type.
*/
Expand Down
21 changes: 21 additions & 0 deletions sdk/policyinsights/arm-policyinsights/src/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,27 @@ export const PolicyState: msRest.CompositeMapper = {
}
}
}
},
policyDefinitionVersion: {
readOnly: true,
serializedName: "policyDefinitionVersion",
type: {
name: "String"
}
},
policySetDefinitionVersion: {
readOnly: true,
serializedName: "policySetDefinitionVersion",
type: {
name: "String"
}
},
policyAssignmentVersion: {
readOnly: true,
serializedName: "policyAssignmentVersion",
type: {
name: "String"
}
}
},
additionalProperties: {
Expand Down
103 changes: 103 additions & 0 deletions sdk/policyinsights/arm-policyinsights/src/operations/policyStates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as Models from "../models";
import * as Mappers from "../models/policyStatesMappers";
import * as Parameters from "../models/parameters";
Expand Down Expand Up @@ -298,6 +299,29 @@ export class PolicyStates {
callback) as Promise<Models.PolicyStatesSummarizeForResourceResponse>;
}

/**
* Triggers a policy evaluation scan for all the resources under the subscription
* @param subscriptionId Microsoft Azure subscription ID.
* @param [options] The optional parameters
* @returns Promise<msRest.RestResponse>
*/
triggerSubscriptionEvaluation(subscriptionId: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse> {
return this.beginTriggerSubscriptionEvaluation(subscriptionId,options)
.then(lroPoller => lroPoller.pollUntilFinished());
}

/**
* Triggers a policy evaluation scan for all the resources under the resource group.
* @param subscriptionId Microsoft Azure subscription ID.
* @param resourceGroupName Resource group name.
* @param [options] The optional parameters
* @returns Promise<msRest.RestResponse>
*/
triggerResourceGroupEvaluation(subscriptionId: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse> {
return this.beginTriggerResourceGroupEvaluation(subscriptionId,resourceGroupName,options)
.then(lroPoller => lroPoller.pollUntilFinished());
}

/**
* Queries policy states for the subscription level policy set definition.
* @param policyStatesResource The virtual resource under PolicyStates resource type. In a given
Expand Down Expand Up @@ -603,6 +627,40 @@ export class PolicyStates {
summarizeForResourceGroupLevelPolicyAssignmentOperationSpec,
callback) as Promise<Models.PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentResponse>;
}

/**
* Triggers a policy evaluation scan for all the resources under the subscription
* @param subscriptionId Microsoft Azure subscription ID.
* @param [options] The optional parameters
* @returns Promise<msRestAzure.LROPoller>
*/
beginTriggerSubscriptionEvaluation(subscriptionId: string, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
return this.client.sendLRORequest(
{
subscriptionId,
options
},
beginTriggerSubscriptionEvaluationOperationSpec,
options);
}

/**
* Triggers a policy evaluation scan for all the resources under the resource group.
* @param subscriptionId Microsoft Azure subscription ID.
* @param resourceGroupName Resource group name.
* @param [options] The optional parameters
* @returns Promise<msRestAzure.LROPoller>
*/
beginTriggerResourceGroupEvaluation(subscriptionId: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
return this.client.sendLRORequest(
{
subscriptionId,
resourceGroupName,
options
},
beginTriggerResourceGroupEvaluationOperationSpec,
options);
}
}

// Operation Specifications
Expand Down Expand Up @@ -1101,3 +1159,48 @@ const summarizeForResourceGroupLevelPolicyAssignmentOperationSpec: msRest.Operat
},
serializer
};

const beginTriggerSubscriptionEvaluationOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation",
urlParameters: [
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion3
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {},
202: {},
default: {
bodyMapper: Mappers.QueryFailure
}
},
serializer
};

const beginTriggerResourceGroupEvaluationOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation",
urlParameters: [
Parameters.subscriptionId,
Parameters.resourceGroupName
],
queryParameters: [
Parameters.apiVersion3
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {},
202: {},
default: {
bodyMapper: Mappers.QueryFailure
}
},
serializer
};
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class PolicyInsightsClientContext extends msRestAzure.AzureServiceClient
if (!options) {
options = {};
}
if (!options.userAgent) {
if(!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}
Expand All @@ -44,10 +44,10 @@ export class PolicyInsightsClientContext extends msRestAzure.AzureServiceClient
this.requestContentType = "application/json; charset=utf-8";
this.credentials = credentials;

if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
}
}
Expand Down

0 comments on commit d656bd8

Please sign in to comment.