Skip to content

Commit

Permalink
CodeGen from PR 11637 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 812ed1a34b702e38111fe04f6d56934dec505585 into cda2c36dd1bac6c4ba8de46b0044126eb3d40c08
  • Loading branch information
SDKAuto committed Nov 11, 2020
1 parent 2a4eefe commit cf39646
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 35 deletions.
14 changes: 8 additions & 6 deletions sdk/policy/mgmt-v2016_12_01/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-arm-parent</artifactId>
<version>1.3.0</version>
<relativePath>../../parents/azure-arm-parent</relativePath>
<version>1.1.0</version>
<relativePath>../../../pom.management.xml</relativePath>
</parent>
<artifactId>azure-mgmt-policy</artifactId>
<version>1.0.0-beta-2</version>
<version>1.0.0-beta</version>
<packaging>jar</packaging>
<name>Microsoft Azure SDK for Authorization Management</name>
<description>This package contains Microsoft Authorization Management SDK.</description>
<url>https://github.com/Azure/azure-libraries-for-java</url>
<url>https://github.com/Azure/azure-sdk-for-java</url>
<licenses>
<license>
<name>The MIT License (MIT)</name>
Expand All @@ -28,8 +28,8 @@
</license>
</licenses>
<scm>
<url>scm:git:https://github.com/Azure/azure-libraries-for-java</url>
<connection>scm:git:git@github.com:Azure/azure-libraries-for-java.git</connection>
<url>scm:git:https://github.com/Azure/azure-sdk-for-java</url>
<connection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</connection>
<tag>HEAD</tag>
</scm>
<properties>
Expand Down Expand Up @@ -71,6 +71,8 @@
<artifactId>azure-arm-client-runtime</artifactId>
<type>test-jar</type>
<scope>test</scope>
<!--Below version for test jar needs to be removed, this will be done as part of v1-runtime 1.6.7-->
<version>1.6.5</version>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ interface Blank extends WithScope {
interface WithScope {
/**
* Specifies scope.
* @param scope The scope of the policy assignment
* @return the next definition stage
*/
WithCreate withScope(String scope);
}
Expand All @@ -94,6 +96,8 @@ interface WithScope {
interface WithDescription {
/**
* Specifies description.
* @param description This message will be part of response in case of policy violation
* @return the next definition stage
*/
WithCreate withDescription(String description);
}
Expand All @@ -104,6 +108,8 @@ interface WithDescription {
interface WithDisplayName {
/**
* Specifies displayName.
* @param displayName The display name of the policy assignment
* @return the next definition stage
*/
WithCreate withDisplayName(String displayName);
}
Expand All @@ -114,6 +120,8 @@ interface WithDisplayName {
interface WithParameters {
/**
* Specifies parameters.
* @param parameters Required if a parameter is used in policy rule
* @return the next definition stage
*/
WithCreate withParameters(Object parameters);
}
Expand All @@ -124,6 +132,8 @@ interface WithParameters {
interface WithPolicyDefinitionId {
/**
* Specifies policyDefinitionId.
* @param policyDefinitionId The ID of the policy definition
* @return the next definition stage
*/
WithCreate withPolicyDefinitionId(String policyDefinitionId);
}
Expand All @@ -134,6 +144,8 @@ interface WithPolicyDefinitionId {
interface WithScopeProperty {
/**
* Specifies scopeProperty.
* @param scopeProperty The scope for the policy assignment
* @return the next definition stage
*/
WithCreate withScopeProperty(String scopeProperty);
}
Expand Down Expand Up @@ -162,6 +174,8 @@ interface UpdateStages {
interface WithDescription {
/**
* Specifies description.
* @param description This message will be part of response in case of policy violation
* @return the next update stage
*/
Update withDescription(String description);
}
Expand All @@ -172,6 +186,8 @@ interface WithDescription {
interface WithDisplayName {
/**
* Specifies displayName.
* @param displayName The display name of the policy assignment
* @return the next update stage
*/
Update withDisplayName(String displayName);
}
Expand All @@ -182,6 +198,8 @@ interface WithDisplayName {
interface WithParameters {
/**
* Specifies parameters.
* @param parameters Required if a parameter is used in policy rule
* @return the next update stage
*/
Update withParameters(Object parameters);
}
Expand All @@ -192,6 +210,8 @@ interface WithParameters {
interface WithPolicyDefinitionId {
/**
* Specifies policyDefinitionId.
* @param policyDefinitionId The ID of the policy definition
* @return the next update stage
*/
Update withPolicyDefinitionId(String policyDefinitionId);
}
Expand All @@ -202,6 +222,8 @@ interface WithPolicyDefinitionId {
interface WithScopeProperty {
/**
* Specifies scopeProperty.
* @param scopeProperty The scope for the policy assignment
* @return the next update stage
*/
Update withScopeProperty(String scopeProperty);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public interface PolicyAssignments extends SupportsCreating<PolicyAssignment.Def

/**
* Deletes a policy assignment by ID.
* When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
* When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
*
* @param policyAssignmentId The ID of the policy assignment to delete. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
* @throws IllegalArgumentException thrown if parameters fail the validation
Expand All @@ -66,7 +66,7 @@ public interface PolicyAssignments extends SupportsCreating<PolicyAssignment.Def

/**
* Creates a policy assignment by ID.
* Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
* Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
*
* @param policyAssignmentId The ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
* @param parameters Parameters for policy assignment.
Expand All @@ -77,7 +77,7 @@ public interface PolicyAssignments extends SupportsCreating<PolicyAssignment.Def

/**
* Gets a policy assignment by ID.
* When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
* When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
*
* @param policyAssignmentId The ID of the policy assignment to get. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
* @throws IllegalArgumentException thrown if parameters fail the validation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ interface Blank extends WithCreate {
interface WithDescription {
/**
* Specifies description.
* @param description The policy definition description
* @return the next definition stage
*/
WithCreate withDescription(String description);
}
Expand All @@ -99,6 +101,8 @@ interface WithDescription {
interface WithDisplayName {
/**
* Specifies displayName.
* @param displayName The display name of the policy definition
* @return the next definition stage
*/
WithCreate withDisplayName(String displayName);
}
Expand All @@ -109,6 +113,8 @@ interface WithDisplayName {
interface WithMetadata {
/**
* Specifies metadata.
* @param metadata The policy definition metadata
* @return the next definition stage
*/
WithCreate withMetadata(Object metadata);
}
Expand All @@ -119,6 +125,8 @@ interface WithMetadata {
interface WithMode {
/**
* Specifies mode.
* @param mode The policy definition mode. Possible values are NotSpecified, Indexed, and All. Possible values include: 'NotSpecified', 'Indexed', 'All'
* @return the next definition stage
*/
WithCreate withMode(PolicyMode mode);
}
Expand All @@ -129,6 +137,8 @@ interface WithMode {
interface WithParameters {
/**
* Specifies parameters.
* @param parameters Required if a parameter is used in policy rule
* @return the next definition stage
*/
WithCreate withParameters(Object parameters);
}
Expand All @@ -139,6 +149,8 @@ interface WithParameters {
interface WithPolicyRule {
/**
* Specifies policyRule.
* @param policyRule The policy rule
* @return the next definition stage
*/
WithCreate withPolicyRule(Object policyRule);
}
Expand All @@ -149,6 +161,8 @@ interface WithPolicyRule {
interface WithPolicyType {
/**
* Specifies policyType.
* @param policyType The type of policy definition. Possible values are NotSpecified, BuiltIn, and Custom. Possible values include: 'NotSpecified', 'BuiltIn', 'Custom'
* @return the next definition stage
*/
WithCreate withPolicyType(PolicyType policyType);
}
Expand Down Expand Up @@ -177,6 +191,8 @@ interface UpdateStages {
interface WithDescription {
/**
* Specifies description.
* @param description The policy definition description
* @return the next update stage
*/
Update withDescription(String description);
}
Expand All @@ -187,6 +203,8 @@ interface WithDescription {
interface WithDisplayName {
/**
* Specifies displayName.
* @param displayName The display name of the policy definition
* @return the next update stage
*/
Update withDisplayName(String displayName);
}
Expand All @@ -197,6 +215,8 @@ interface WithDisplayName {
interface WithMetadata {
/**
* Specifies metadata.
* @param metadata The policy definition metadata
* @return the next update stage
*/
Update withMetadata(Object metadata);
}
Expand All @@ -207,6 +227,8 @@ interface WithMetadata {
interface WithMode {
/**
* Specifies mode.
* @param mode The policy definition mode. Possible values are NotSpecified, Indexed, and All. Possible values include: 'NotSpecified', 'Indexed', 'All'
* @return the next update stage
*/
Update withMode(PolicyMode mode);
}
Expand All @@ -217,6 +239,8 @@ interface WithMode {
interface WithParameters {
/**
* Specifies parameters.
* @param parameters Required if a parameter is used in policy rule
* @return the next update stage
*/
Update withParameters(Object parameters);
}
Expand All @@ -227,6 +251,8 @@ interface WithParameters {
interface WithPolicyRule {
/**
* Specifies policyRule.
* @param policyRule The policy rule
* @return the next update stage
*/
Update withPolicyRule(Object policyRule);
}
Expand All @@ -237,6 +263,8 @@ interface WithPolicyRule {
interface WithPolicyType {
/**
* Specifies policyType.
* @param policyType The type of policy definition. Possible values are NotSpecified, BuiltIn, and Custom. Possible values include: 'NotSpecified', 'BuiltIn', 'Custom'
* @return the next update stage
*/
Update withPolicyType(PolicyType policyType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class PolicyAssignmentImpl extends CreatableUpdatableImpl<PolicyAssignment, Poli
this.manager = manager;
// Set resource name
this.policyAssignmentName = inner.name();
// resource ancestor names
// set resource ancestor and positional variables
this.policyAssignmentName = IdParsingUtils.getValueFromIdByName(inner.id(), "policyAssignments");
this.scope = IdParsingUtils.getValueFromIdByPosition(inner.id(), 0);
//
// set other parameters for create and update
}

@Override
Expand Down
Loading

0 comments on commit cf39646

Please sign in to comment.