Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@azure/arm-policyinsights/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Microsoft
Copyright (c) 2019 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
88 changes: 88 additions & 0 deletions packages/@azure/arm-policyinsights/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,80 @@ export interface PolicyEventsQueryResults {
value?: PolicyEvent[];
}

/**
* @interface
* An interface representing ExpressionEvaluationDetails.
* Evaluation details of policy language expressions.
*
*/
export interface ExpressionEvaluationDetails {
/**
* @member {string} [result] Evaluation result.
*/
result?: string;
/**
* @member {string} [expression] Expression evaluated.
*/
expression?: string;
/**
* @member {string} [path] Property path if the expression is a field or an
* aliase.
*/
path?: string;
/**
* @member {string} [expressionValue] Value of the expression.
*/
expressionValue?: string;
/**
* @member {string} [targetValue] Target value to be compared with the
* expression value.
*/
targetValue?: string;
/**
* @member {string} [operator] Operator to compare the expression value and
* the target value.
*/
operator?: string;
}

/**
* @interface
* An interface representing IfNotExistsEvaluationDetails.
* Evaluation details of IfNotExists effect.
*
*/
export interface IfNotExistsEvaluationDetails {
/**
* @member {string} [resourceId] ID of the last evaluated resource for
* IfNotExists effect.
*/
resourceId?: string;
/**
* @member {number} [totalResources] Total number of resources to which the
* existence condition is applicable.
*/
totalResources?: number;
}

/**
* @interface
* An interface representing PolicyEvaluationDetails.
* Policy evaluation details.
*
*/
export interface PolicyEvaluationDetails {
/**
* @member {ExpressionEvaluationDetails[]} [evaluatedExpressions] Details of
* the evaluated expressions.
*/
evaluatedExpressions?: ExpressionEvaluationDetails[];
/**
* @member {IfNotExistsEvaluationDetails} [ifNotExistsDetails] Evaluation
* details of IfNotExists effect.
*/
ifNotExistsDetails?: IfNotExistsEvaluationDetails;
}

/**
* @interface
* An interface representing PolicyState.
Expand Down Expand Up @@ -711,6 +785,15 @@ export interface PolicyState {
* set.
*/
policyDefinitionReferenceId?: string;
/**
* @member {string} [complianceState] Compliance state of the resource.
*/
complianceState?: string;
/**
* @member {PolicyEvaluationDetails} [policyEvaluationDetails] Policy
* evaluation details.
*/
policyEvaluationDetails?: PolicyEvaluationDetails;
/**
* @property Describes unknown properties. The value of an unknown property
* can be of "any" type.
Expand Down Expand Up @@ -977,6 +1060,11 @@ export interface QueryOptions {
* @member {string} [apply] OData apply expression for aggregations.
*/
apply?: string;
/**
* @member {string} [expand] The $expand query parameter. For example, to
* expand policyEvaluationDetails, use $expand=policyEvaluationDetails
*/
expand?: string;
}

/**
Expand Down
115 changes: 115 additions & 0 deletions packages/@azure/arm-policyinsights/lib/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,103 @@ export const PolicyEventsQueryResults: msRest.CompositeMapper = {
}
};

export const ExpressionEvaluationDetails: msRest.CompositeMapper = {
serializedName: "ExpressionEvaluationDetails",
type: {
name: "Composite",
className: "ExpressionEvaluationDetails",
modelProperties: {
result: {
serializedName: "result",
type: {
name: "String"
}
},
expression: {
serializedName: "expression",
type: {
name: "String"
}
},
path: {
serializedName: "path",
type: {
name: "String"
}
},
expressionValue: {
serializedName: "expressionValue",
type: {
name: "String"
}
},
targetValue: {
serializedName: "targetValue",
type: {
name: "String"
}
},
operator: {
serializedName: "operator",
type: {
name: "String"
}
}
}
}
};

export const IfNotExistsEvaluationDetails: msRest.CompositeMapper = {
serializedName: "IfNotExistsEvaluationDetails",
type: {
name: "Composite",
className: "IfNotExistsEvaluationDetails",
modelProperties: {
resourceId: {
serializedName: "resourceId",
type: {
name: "String"
}
},
totalResources: {
serializedName: "totalResources",
type: {
name: "Number"
}
}
}
}
};

export const PolicyEvaluationDetails: msRest.CompositeMapper = {
serializedName: "PolicyEvaluationDetails",
type: {
name: "Composite",
className: "PolicyEvaluationDetails",
modelProperties: {
evaluatedExpressions: {
serializedName: "evaluatedExpressions",
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ExpressionEvaluationDetails"
}
}
}
},
ifNotExistsDetails: {
serializedName: "ifNotExistsDetails",
type: {
name: "Composite",
className: "IfNotExistsEvaluationDetails"
}
}
}
}
};

export const PolicyState: msRest.CompositeMapper = {
serializedName: "PolicyState",
type: {
Expand Down Expand Up @@ -870,6 +967,19 @@ export const PolicyState: msRest.CompositeMapper = {
type: {
name: "String"
}
},
complianceState: {
serializedName: "complianceState",
type: {
name: "String"
}
},
policyEvaluationDetails: {
serializedName: "policyEvaluationDetails",
type: {
name: "Composite",
className: "PolicyEvaluationDetails"
}
}
},
additionalProperties: {
Expand Down Expand Up @@ -1238,6 +1348,11 @@ export const QueryOptions: msRest.CompositeMapper = {
type: {
name: "String"
}
},
expand: {
type: {
name: "String"
}
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions packages/@azure/arm-policyinsights/lib/models/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@ export const authorizationNamespace: msRest.OperationURLParameter = {
}
}
};
export const expand: msRest.OperationQueryParameter = {
parameterPath: [
"options",
"queryOptions",
"expand"
],
mapper: {
serializedName: "$expand",
type: {
name: "String"
}
}
};
export const filter: msRest.OperationQueryParameter = {
parameterPath: [
"options",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
export {
PolicyStatesQueryResults,
PolicyState,
PolicyEvaluationDetails,
ExpressionEvaluationDetails,
IfNotExistsEvaluationDetails,
QueryFailure,
QueryFailureError,
SummarizeResults,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const listOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "providers/Microsoft.PolicyInsights/operations",
queryParameters: [
Parameters.apiVersion1
Parameters.apiVersion0
],
headerParameters: [
Parameters.acceptLanguage
Expand Down
Loading