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

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

There is a newer version: 2.82.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.PrincipalType;
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.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final RoleAssignmentArgs Empty = new RoleAssignmentArgs();

    /**
     * The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: {@literal @}Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'
     * 
     */
    @Import(name="condition")
    private @Nullable Output condition;

    /**
     * @return The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: {@literal @}Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'
     * 
     */
    public Optional> condition() {
        return Optional.ofNullable(this.condition);
    }

    /**
     * Version of the condition. Currently the only accepted value is '2.0'
     * 
     */
    @Import(name="conditionVersion")
    private @Nullable Output conditionVersion;

    /**
     * @return Version of the condition. Currently the only accepted value is '2.0'
     * 
     */
    public Optional> conditionVersion() {
        return Optional.ofNullable(this.conditionVersion);
    }

    /**
     * Id of the delegated managed identity resource
     * 
     */
    @Import(name="delegatedManagedIdentityResourceId")
    private @Nullable Output delegatedManagedIdentityResourceId;

    /**
     * @return Id of the delegated managed identity resource
     * 
     */
    public Optional> delegatedManagedIdentityResourceId() {
        return Optional.ofNullable(this.delegatedManagedIdentityResourceId);
    }

    /**
     * Description of role assignment
     * 
     */
    @Import(name="description")
    private @Nullable Output description;

    /**
     * @return Description of role assignment
     * 
     */
    public Optional> description() {
        return Optional.ofNullable(this.description);
    }

    /**
     * The principal ID.
     * 
     */
    @Import(name="principalId", required=true)
    private Output principalId;

    /**
     * @return The principal ID.
     * 
     */
    public Output principalId() {
        return this.principalId;
    }

    /**
     * The principal type of the assigned principal ID.
     * 
     */
    @Import(name="principalType")
    private @Nullable Output> principalType;

    /**
     * @return The principal type of the assigned principal ID.
     * 
     */
    public Optional>> principalType() {
        return Optional.ofNullable(this.principalType);
    }

    /**
     * The name of the role assignment. It can be any valid GUID.
     * 
     */
    @Import(name="roleAssignmentName")
    private @Nullable Output roleAssignmentName;

    /**
     * @return The name of the role assignment. It can be any valid GUID.
     * 
     */
    public Optional> roleAssignmentName() {
        return Optional.ofNullable(this.roleAssignmentName);
    }

    /**
     * The role definition ID.
     * 
     */
    @Import(name="roleDefinitionId", required=true)
    private Output roleDefinitionId;

    /**
     * @return The role definition ID.
     * 
     */
    public Output roleDefinitionId() {
        return this.roleDefinitionId;
    }

    /**
     * The scope of the operation or resource. Valid scopes are: 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 operation or resource. Valid scopes are: 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 RoleAssignmentArgs() {}

    private RoleAssignmentArgs(RoleAssignmentArgs $) {
        this.condition = $.condition;
        this.conditionVersion = $.conditionVersion;
        this.delegatedManagedIdentityResourceId = $.delegatedManagedIdentityResourceId;
        this.description = $.description;
        this.principalId = $.principalId;
        this.principalType = $.principalType;
        this.roleAssignmentName = $.roleAssignmentName;
        this.roleDefinitionId = $.roleDefinitionId;
        this.scope = $.scope;
    }

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

    public static final class Builder {
        private RoleAssignmentArgs $;

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

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

        /**
         * @param condition The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: {@literal @}Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'
         * 
         * @return builder
         * 
         */
        public Builder condition(@Nullable Output condition) {
            $.condition = condition;
            return this;
        }

        /**
         * @param condition The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: {@literal @}Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'
         * 
         * @return builder
         * 
         */
        public Builder condition(String condition) {
            return condition(Output.of(condition));
        }

        /**
         * @param conditionVersion Version of the condition. Currently the only accepted value is '2.0'
         * 
         * @return builder
         * 
         */
        public Builder conditionVersion(@Nullable Output conditionVersion) {
            $.conditionVersion = conditionVersion;
            return this;
        }

        /**
         * @param conditionVersion Version of the condition. Currently the only accepted value is '2.0'
         * 
         * @return builder
         * 
         */
        public Builder conditionVersion(String conditionVersion) {
            return conditionVersion(Output.of(conditionVersion));
        }

        /**
         * @param delegatedManagedIdentityResourceId Id of the delegated managed identity resource
         * 
         * @return builder
         * 
         */
        public Builder delegatedManagedIdentityResourceId(@Nullable Output delegatedManagedIdentityResourceId) {
            $.delegatedManagedIdentityResourceId = delegatedManagedIdentityResourceId;
            return this;
        }

        /**
         * @param delegatedManagedIdentityResourceId Id of the delegated managed identity resource
         * 
         * @return builder
         * 
         */
        public Builder delegatedManagedIdentityResourceId(String delegatedManagedIdentityResourceId) {
            return delegatedManagedIdentityResourceId(Output.of(delegatedManagedIdentityResourceId));
        }

        /**
         * @param description Description of role assignment
         * 
         * @return builder
         * 
         */
        public Builder description(@Nullable Output description) {
            $.description = description;
            return this;
        }

        /**
         * @param description Description of role assignment
         * 
         * @return builder
         * 
         */
        public Builder description(String description) {
            return description(Output.of(description));
        }

        /**
         * @param principalId The principal ID.
         * 
         * @return builder
         * 
         */
        public Builder principalId(Output principalId) {
            $.principalId = principalId;
            return this;
        }

        /**
         * @param principalId The principal ID.
         * 
         * @return builder
         * 
         */
        public Builder principalId(String principalId) {
            return principalId(Output.of(principalId));
        }

        /**
         * @param principalType The principal type of the assigned principal ID.
         * 
         * @return builder
         * 
         */
        public Builder principalType(@Nullable Output> principalType) {
            $.principalType = principalType;
            return this;
        }

        /**
         * @param principalType The principal type of the assigned principal ID.
         * 
         * @return builder
         * 
         */
        public Builder principalType(Either principalType) {
            return principalType(Output.of(principalType));
        }

        /**
         * @param principalType The principal type of the assigned principal ID.
         * 
         * @return builder
         * 
         */
        public Builder principalType(String principalType) {
            return principalType(Either.ofLeft(principalType));
        }

        /**
         * @param principalType The principal type of the assigned principal ID.
         * 
         * @return builder
         * 
         */
        public Builder principalType(PrincipalType principalType) {
            return principalType(Either.ofRight(principalType));
        }

        /**
         * @param roleAssignmentName The name of the role assignment. It can be any valid GUID.
         * 
         * @return builder
         * 
         */
        public Builder roleAssignmentName(@Nullable Output roleAssignmentName) {
            $.roleAssignmentName = roleAssignmentName;
            return this;
        }

        /**
         * @param roleAssignmentName The name of the role assignment. It can be any valid GUID.
         * 
         * @return builder
         * 
         */
        public Builder roleAssignmentName(String roleAssignmentName) {
            return roleAssignmentName(Output.of(roleAssignmentName));
        }

        /**
         * @param roleDefinitionId The role definition ID.
         * 
         * @return builder
         * 
         */
        public Builder roleDefinitionId(Output roleDefinitionId) {
            $.roleDefinitionId = roleDefinitionId;
            return this;
        }

        /**
         * @param roleDefinitionId The role definition ID.
         * 
         * @return builder
         * 
         */
        public Builder roleDefinitionId(String roleDefinitionId) {
            return roleDefinitionId(Output.of(roleDefinitionId));
        }

        /**
         * @param scope The scope of the operation or resource. Valid scopes are: 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 operation or resource. Valid scopes are: 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 RoleAssignmentArgs build() {
            if ($.principalId == null) {
                throw new MissingRequiredPropertyException("RoleAssignmentArgs", "principalId");
            }
            $.principalType = Codegen.stringProp("principalType").left(PrincipalType.class).output().arg($.principalType).def("User").getNullable();
            if ($.roleDefinitionId == null) {
                throw new MissingRequiredPropertyException("RoleAssignmentArgs", "roleDefinitionId");
            }
            if ($.scope == null) {
                throw new MissingRequiredPropertyException("RoleAssignmentArgs", "scope");
            }
            return $;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy