All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.authorization.PolicyAssignmentArgs Maven / Gradle / Ivy

There is a newer version: 2.72.0
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azurenative.authorization;

import com.pulumi.azurenative.authorization.enums.EnforcementMode;
import com.pulumi.azurenative.authorization.inputs.IdentityArgs;
import com.pulumi.azurenative.authorization.inputs.NonComplianceMessageArgs;
import com.pulumi.azurenative.authorization.inputs.OverrideArgs;
import com.pulumi.azurenative.authorization.inputs.ParameterValuesValueArgs;
import com.pulumi.azurenative.authorization.inputs.ResourceSelectorArgs;
import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.core.internal.Codegen;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Object;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class PolicyAssignmentArgs extends com.pulumi.resources.ResourceArgs {

    public static final PolicyAssignmentArgs Empty = new PolicyAssignmentArgs();

    /**
     * This message will be part of response in case of policy violation.
     * 
     */
    @Import(name="description")
    private @Nullable Output description;

    /**
     * @return This message will be part of response in case of policy violation.
     * 
     */
    public Optional> description() {
        return Optional.ofNullable(this.description);
    }

    /**
     * The display name of the policy assignment.
     * 
     */
    @Import(name="displayName")
    private @Nullable Output displayName;

    /**
     * @return The display name of the policy assignment.
     * 
     */
    public Optional> displayName() {
        return Optional.ofNullable(this.displayName);
    }

    /**
     * The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.
     * 
     */
    @Import(name="enforcementMode")
    private @Nullable Output> enforcementMode;

    /**
     * @return The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.
     * 
     */
    public Optional>> enforcementMode() {
        return Optional.ofNullable(this.enforcementMode);
    }

    /**
     * The managed identity associated with the policy assignment.
     * 
     */
    @Import(name="identity")
    private @Nullable Output identity;

    /**
     * @return The managed identity associated with the policy assignment.
     * 
     */
    public Optional> identity() {
        return Optional.ofNullable(this.identity);
    }

    /**
     * The location of the policy assignment. Only required when utilizing managed identity.
     * 
     */
    @Import(name="location")
    private @Nullable Output location;

    /**
     * @return The location of the policy assignment. Only required when utilizing managed identity.
     * 
     */
    public Optional> location() {
        return Optional.ofNullable(this.location);
    }

    /**
     * The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.
     * 
     */
    @Import(name="metadata")
    private @Nullable Output metadata;

    /**
     * @return The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.
     * 
     */
    public Optional> metadata() {
        return Optional.ofNullable(this.metadata);
    }

    /**
     * The messages that describe why a resource is non-compliant with the policy.
     * 
     */
    @Import(name="nonComplianceMessages")
    private @Nullable Output> nonComplianceMessages;

    /**
     * @return The messages that describe why a resource is non-compliant with the policy.
     * 
     */
    public Optional>> nonComplianceMessages() {
        return Optional.ofNullable(this.nonComplianceMessages);
    }

    /**
     * The policy's excluded scopes.
     * 
     */
    @Import(name="notScopes")
    private @Nullable Output> notScopes;

    /**
     * @return The policy's excluded scopes.
     * 
     */
    public Optional>> notScopes() {
        return Optional.ofNullable(this.notScopes);
    }

    /**
     * The policy property value override.
     * 
     */
    @Import(name="overrides")
    private @Nullable Output> overrides;

    /**
     * @return The policy property value override.
     * 
     */
    public Optional>> overrides() {
        return Optional.ofNullable(this.overrides);
    }

    /**
     * The parameter values for the assigned policy rule. The keys are the parameter names.
     * 
     */
    @Import(name="parameters")
    private @Nullable Output> parameters;

    /**
     * @return The parameter values for the assigned policy rule. The keys are the parameter names.
     * 
     */
    public Optional>> parameters() {
        return Optional.ofNullable(this.parameters);
    }

    /**
     * The name of the policy assignment.
     * 
     */
    @Import(name="policyAssignmentName")
    private @Nullable Output policyAssignmentName;

    /**
     * @return The name of the policy assignment.
     * 
     */
    public Optional> policyAssignmentName() {
        return Optional.ofNullable(this.policyAssignmentName);
    }

    /**
     * The ID of the policy definition or policy set definition being assigned.
     * 
     */
    @Import(name="policyDefinitionId")
    private @Nullable Output policyDefinitionId;

    /**
     * @return The ID of the policy definition or policy set definition being assigned.
     * 
     */
    public Optional> policyDefinitionId() {
        return Optional.ofNullable(this.policyDefinitionId);
    }

    /**
     * The resource selector list to filter policies by resource properties.
     * 
     */
    @Import(name="resourceSelectors")
    private @Nullable Output> resourceSelectors;

    /**
     * @return The resource selector list to filter policies by resource properties.
     * 
     */
    public Optional>> resourceSelectors() {
        return Optional.ofNullable(this.resourceSelectors);
    }

    /**
     * The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
     * 
     */
    @Import(name="scope", required=true)
    private Output scope;

    /**
     * @return The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
     * 
     */
    public Output scope() {
        return this.scope;
    }

    private PolicyAssignmentArgs() {}

    private PolicyAssignmentArgs(PolicyAssignmentArgs $) {
        this.description = $.description;
        this.displayName = $.displayName;
        this.enforcementMode = $.enforcementMode;
        this.identity = $.identity;
        this.location = $.location;
        this.metadata = $.metadata;
        this.nonComplianceMessages = $.nonComplianceMessages;
        this.notScopes = $.notScopes;
        this.overrides = $.overrides;
        this.parameters = $.parameters;
        this.policyAssignmentName = $.policyAssignmentName;
        this.policyDefinitionId = $.policyDefinitionId;
        this.resourceSelectors = $.resourceSelectors;
        this.scope = $.scope;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(PolicyAssignmentArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private PolicyAssignmentArgs $;

        public Builder() {
            $ = new PolicyAssignmentArgs();
        }

        public Builder(PolicyAssignmentArgs defaults) {
            $ = new PolicyAssignmentArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param description This message will be part of response in case of policy violation.
         * 
         * @return builder
         * 
         */
        public Builder description(@Nullable Output description) {
            $.description = description;
            return this;
        }

        /**
         * @param description This message will be part of response in case of policy violation.
         * 
         * @return builder
         * 
         */
        public Builder description(String description) {
            return description(Output.of(description));
        }

        /**
         * @param displayName The display name of the policy assignment.
         * 
         * @return builder
         * 
         */
        public Builder displayName(@Nullable Output displayName) {
            $.displayName = displayName;
            return this;
        }

        /**
         * @param displayName The display name of the policy assignment.
         * 
         * @return builder
         * 
         */
        public Builder displayName(String displayName) {
            return displayName(Output.of(displayName));
        }

        /**
         * @param enforcementMode The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.
         * 
         * @return builder
         * 
         */
        public Builder enforcementMode(@Nullable Output> enforcementMode) {
            $.enforcementMode = enforcementMode;
            return this;
        }

        /**
         * @param enforcementMode The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.
         * 
         * @return builder
         * 
         */
        public Builder enforcementMode(Either enforcementMode) {
            return enforcementMode(Output.of(enforcementMode));
        }

        /**
         * @param enforcementMode The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.
         * 
         * @return builder
         * 
         */
        public Builder enforcementMode(String enforcementMode) {
            return enforcementMode(Either.ofLeft(enforcementMode));
        }

        /**
         * @param enforcementMode The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.
         * 
         * @return builder
         * 
         */
        public Builder enforcementMode(EnforcementMode enforcementMode) {
            return enforcementMode(Either.ofRight(enforcementMode));
        }

        /**
         * @param identity The managed identity associated with the policy assignment.
         * 
         * @return builder
         * 
         */
        public Builder identity(@Nullable Output identity) {
            $.identity = identity;
            return this;
        }

        /**
         * @param identity The managed identity associated with the policy assignment.
         * 
         * @return builder
         * 
         */
        public Builder identity(IdentityArgs identity) {
            return identity(Output.of(identity));
        }

        /**
         * @param location The location of the policy assignment. Only required when utilizing managed identity.
         * 
         * @return builder
         * 
         */
        public Builder location(@Nullable Output location) {
            $.location = location;
            return this;
        }

        /**
         * @param location The location of the policy assignment. Only required when utilizing managed identity.
         * 
         * @return builder
         * 
         */
        public Builder location(String location) {
            return location(Output.of(location));
        }

        /**
         * @param metadata The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.
         * 
         * @return builder
         * 
         */
        public Builder metadata(@Nullable Output metadata) {
            $.metadata = metadata;
            return this;
        }

        /**
         * @param metadata The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.
         * 
         * @return builder
         * 
         */
        public Builder metadata(Object metadata) {
            return metadata(Output.of(metadata));
        }

        /**
         * @param nonComplianceMessages The messages that describe why a resource is non-compliant with the policy.
         * 
         * @return builder
         * 
         */
        public Builder nonComplianceMessages(@Nullable Output> nonComplianceMessages) {
            $.nonComplianceMessages = nonComplianceMessages;
            return this;
        }

        /**
         * @param nonComplianceMessages The messages that describe why a resource is non-compliant with the policy.
         * 
         * @return builder
         * 
         */
        public Builder nonComplianceMessages(List nonComplianceMessages) {
            return nonComplianceMessages(Output.of(nonComplianceMessages));
        }

        /**
         * @param nonComplianceMessages The messages that describe why a resource is non-compliant with the policy.
         * 
         * @return builder
         * 
         */
        public Builder nonComplianceMessages(NonComplianceMessageArgs... nonComplianceMessages) {
            return nonComplianceMessages(List.of(nonComplianceMessages));
        }

        /**
         * @param notScopes The policy's excluded scopes.
         * 
         * @return builder
         * 
         */
        public Builder notScopes(@Nullable Output> notScopes) {
            $.notScopes = notScopes;
            return this;
        }

        /**
         * @param notScopes The policy's excluded scopes.
         * 
         * @return builder
         * 
         */
        public Builder notScopes(List notScopes) {
            return notScopes(Output.of(notScopes));
        }

        /**
         * @param notScopes The policy's excluded scopes.
         * 
         * @return builder
         * 
         */
        public Builder notScopes(String... notScopes) {
            return notScopes(List.of(notScopes));
        }

        /**
         * @param overrides The policy property value override.
         * 
         * @return builder
         * 
         */
        public Builder overrides(@Nullable Output> overrides) {
            $.overrides = overrides;
            return this;
        }

        /**
         * @param overrides The policy property value override.
         * 
         * @return builder
         * 
         */
        public Builder overrides(List overrides) {
            return overrides(Output.of(overrides));
        }

        /**
         * @param overrides The policy property value override.
         * 
         * @return builder
         * 
         */
        public Builder overrides(OverrideArgs... overrides) {
            return overrides(List.of(overrides));
        }

        /**
         * @param parameters The parameter values for the assigned policy rule. The keys are the parameter names.
         * 
         * @return builder
         * 
         */
        public Builder parameters(@Nullable Output> parameters) {
            $.parameters = parameters;
            return this;
        }

        /**
         * @param parameters The parameter values for the assigned policy rule. The keys are the parameter names.
         * 
         * @return builder
         * 
         */
        public Builder parameters(Map parameters) {
            return parameters(Output.of(parameters));
        }

        /**
         * @param policyAssignmentName The name of the policy assignment.
         * 
         * @return builder
         * 
         */
        public Builder policyAssignmentName(@Nullable Output policyAssignmentName) {
            $.policyAssignmentName = policyAssignmentName;
            return this;
        }

        /**
         * @param policyAssignmentName The name of the policy assignment.
         * 
         * @return builder
         * 
         */
        public Builder policyAssignmentName(String policyAssignmentName) {
            return policyAssignmentName(Output.of(policyAssignmentName));
        }

        /**
         * @param policyDefinitionId The ID of the policy definition or policy set definition being assigned.
         * 
         * @return builder
         * 
         */
        public Builder policyDefinitionId(@Nullable Output policyDefinitionId) {
            $.policyDefinitionId = policyDefinitionId;
            return this;
        }

        /**
         * @param policyDefinitionId The ID of the policy definition or policy set definition being assigned.
         * 
         * @return builder
         * 
         */
        public Builder policyDefinitionId(String policyDefinitionId) {
            return policyDefinitionId(Output.of(policyDefinitionId));
        }

        /**
         * @param resourceSelectors The resource selector list to filter policies by resource properties.
         * 
         * @return builder
         * 
         */
        public Builder resourceSelectors(@Nullable Output> resourceSelectors) {
            $.resourceSelectors = resourceSelectors;
            return this;
        }

        /**
         * @param resourceSelectors The resource selector list to filter policies by resource properties.
         * 
         * @return builder
         * 
         */
        public Builder resourceSelectors(List resourceSelectors) {
            return resourceSelectors(Output.of(resourceSelectors));
        }

        /**
         * @param resourceSelectors The resource selector list to filter policies by resource properties.
         * 
         * @return builder
         * 
         */
        public Builder resourceSelectors(ResourceSelectorArgs... resourceSelectors) {
            return resourceSelectors(List.of(resourceSelectors));
        }

        /**
         * @param scope The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
         * 
         * @return builder
         * 
         */
        public Builder scope(Output scope) {
            $.scope = scope;
            return this;
        }

        /**
         * @param scope The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
         * 
         * @return builder
         * 
         */
        public Builder scope(String scope) {
            return scope(Output.of(scope));
        }

        public PolicyAssignmentArgs build() {
            $.enforcementMode = Codegen.stringProp("enforcementMode").left(EnforcementMode.class).output().arg($.enforcementMode).def("Default").getNullable();
            if ($.scope == null) {
                throw new MissingRequiredPropertyException("PolicyAssignmentArgs", "scope");
            }
            return $;
        }
    }

}