Skip to content
Closed
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 sdk/policy/arm-policy/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
47 changes: 44 additions & 3 deletions sdk/policy/arm-policy/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export interface ErrorResponse {
}

/**
* An interface representing ParameterValuesValue.
* The value of a parameter.
*/
export interface ParameterValuesValue {
/**
Expand Down Expand Up @@ -97,7 +97,8 @@ export interface Identity {
*/
readonly tenantId?: string;
/**
* The identity type. Possible values include: 'SystemAssigned', 'None'
* The identity type. This is the only required field when adding a system assigned identity to a
* resource. Possible values include: 'SystemAssigned', 'None'
*/
type?: ResourceIdentityType;
}
Expand Down Expand Up @@ -188,7 +189,7 @@ export interface ParameterDefinitionsValueMetadata {
}

/**
* An interface representing ParameterDefinitionsValue.
* The definition of a parameter that can be provided to the policy.
*/
export interface ParameterDefinitionsValue {
/**
Expand Down Expand Up @@ -570,6 +571,26 @@ export type PolicyAssignmentsListForResourceResponse = PolicyAssignmentListResul
};
};

/**
* Contains response data for the listForManagementGroup operation.
*/
export type PolicyAssignmentsListForManagementGroupResponse = PolicyAssignmentListResult & {
/**
* 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: PolicyAssignmentListResult;
};
};

/**
* Contains response data for the list operation.
*/
Expand Down Expand Up @@ -690,6 +711,26 @@ export type PolicyAssignmentsListForResourceNextResponse = PolicyAssignmentListR
};
};

/**
* Contains response data for the listForManagementGroupNext operation.
*/
export type PolicyAssignmentsListForManagementGroupNextResponse = PolicyAssignmentListResult & {
/**
* 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: PolicyAssignmentListResult;
};
};

/**
* Contains response data for the listNext operation.
*/
Expand Down
11 changes: 11 additions & 0 deletions sdk/policy/arm-policy/src/models/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ export const filter1: msRest.OperationQueryParameter = {
}
}
};
export const filter2: msRest.OperationQueryParameter = {
parameterPath: "filter",
mapper: {
required: true,
serializedName: "$filter",
type: {
name: "String"
}
},
skipEncoding: true
};
export const managementGroupId: msRest.OperationURLParameter = {
parameterPath: "managementGroupId",
mapper: {
Expand Down
123 changes: 123 additions & 0 deletions sdk/policy/arm-policy/src/operations/policyAssignments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,50 @@ export class PolicyAssignments {
callback) as Promise<Models.PolicyAssignmentsListForResourceResponse>;
}

/**
* This operation retrieves the list of all policy assignments applicable to the management group
* that match the given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId
* eq '{value}''. If $filter=atScope() is provided, the returned list includes all policy
* assignments that are assigned to the management group or the management group's ancestors. If
* $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy
* assignments of the policy definition whose id is {value} that apply to the management group.
* @summary Retrieves all policy assignments that apply to a management group.
* @param managementGroupId The ID of the management group.
* @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or
* 'policyDefinitionId eq '{value}''. A filter is required when listing policy assignments at
* management group scope.
* @param [options] The optional parameters
* @returns Promise<Models.PolicyAssignmentsListForManagementGroupResponse>
*/
listForManagementGroup(managementGroupId: string, filter: string, options?: msRest.RequestOptionsBase): Promise<Models.PolicyAssignmentsListForManagementGroupResponse>;
/**
* @param managementGroupId The ID of the management group.
* @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or
* 'policyDefinitionId eq '{value}''. A filter is required when listing policy assignments at
* management group scope.
* @param callback The callback
*/
listForManagementGroup(managementGroupId: string, filter: string, callback: msRest.ServiceCallback<Models.PolicyAssignmentListResult>): void;
/**
* @param managementGroupId The ID of the management group.
* @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or
* 'policyDefinitionId eq '{value}''. A filter is required when listing policy assignments at
* management group scope.
* @param options The optional parameters
* @param callback The callback
*/
listForManagementGroup(managementGroupId: string, filter: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.PolicyAssignmentListResult>): void;
listForManagementGroup(managementGroupId: string, filter: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.PolicyAssignmentListResult>, callback?: msRest.ServiceCallback<Models.PolicyAssignmentListResult>): Promise<Models.PolicyAssignmentsListForManagementGroupResponse> {
return this.client.sendOperationRequest(
{
managementGroupId,
filter,
options
},
listForManagementGroupOperationSpec,
callback) as Promise<Models.PolicyAssignmentsListForManagementGroupResponse>;
}

/**
* This operation retrieves the list of all policy assignments associated with the given
* subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or
Expand Down Expand Up @@ -523,6 +567,40 @@ export class PolicyAssignments {
callback) as Promise<Models.PolicyAssignmentsListForResourceNextResponse>;
}

/**
* This operation retrieves the list of all policy assignments applicable to the management group
* that match the given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId
* eq '{value}''. If $filter=atScope() is provided, the returned list includes all policy
* assignments that are assigned to the management group or the management group's ancestors. If
* $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy
* assignments of the policy definition whose id is {value} that apply to the management group.
* @summary Retrieves all policy assignments that apply to a management group.
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @param [options] The optional parameters
* @returns Promise<Models.PolicyAssignmentsListForManagementGroupNextResponse>
*/
listForManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.PolicyAssignmentsListForManagementGroupNextResponse>;
/**
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @param callback The callback
*/
listForManagementGroupNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.PolicyAssignmentListResult>): void;
/**
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @param options The optional parameters
* @param callback The callback
*/
listForManagementGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.PolicyAssignmentListResult>): void;
listForManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.PolicyAssignmentListResult>, callback?: msRest.ServiceCallback<Models.PolicyAssignmentListResult>): Promise<Models.PolicyAssignmentsListForManagementGroupNextResponse> {
return this.client.sendOperationRequest(
{
nextPageLink,
options
},
listForManagementGroupNextOperationSpec,
callback) as Promise<Models.PolicyAssignmentsListForManagementGroupNextResponse>;
}

/**
* This operation retrieves the list of all policy assignments associated with the given
* subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or
Expand Down Expand Up @@ -698,6 +776,30 @@ const listForResourceOperationSpec: msRest.OperationSpec = {
serializer
};

const listForManagementGroupOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments",
urlParameters: [
Parameters.managementGroupId
],
queryParameters: [
Parameters.filter2,
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.PolicyAssignmentListResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
serializer
};

const listOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments",
Expand Down Expand Up @@ -841,6 +943,27 @@ const listForResourceNextOperationSpec: msRest.OperationSpec = {
serializer
};

const listForManagementGroupNextOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
baseUrl: "https://management.azure.com",
path: "{nextLink}",
urlParameters: [
Parameters.nextPageLink
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.PolicyAssignmentListResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
serializer
};

const listNextOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
baseUrl: "https://management.azure.com",
Expand Down