// *** 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.azure.hpc;

import com.pulumi.azure.hpc.inputs.CacheAccessPolicyAccessRuleArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final CacheAccessPolicyArgs Empty = new CacheAccessPolicyArgs();

    /**
     * Up to three `access_rule` blocks as defined below.
     * 
     */
    @Import(name="accessRules", required=true)
    private Output<List<CacheAccessPolicyAccessRuleArgs>> accessRules;

    /**
     * @return Up to three `access_rule` blocks as defined below.
     * 
     */
    public Output<List<CacheAccessPolicyAccessRuleArgs>> accessRules() {
        return this.accessRules;
    }

    /**
     * The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.
     * 
     */
    @Import(name="hpcCacheId", required=true)
    private Output<String> hpcCacheId;

    /**
     * @return The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.
     * 
     */
    public Output<String> hpcCacheId() {
        return this.hpcCacheId;
    }

    /**
     * The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.
     * 
     */
    @Import(name="name")
    private @Nullable Output<String> name;

    /**
     * @return The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.
     * 
     */
    public Optional<Output<String>> name() {
        return Optional.ofNullable(this.name);
    }

    private CacheAccessPolicyArgs() {}

    private CacheAccessPolicyArgs(CacheAccessPolicyArgs $) {
        this.accessRules = $.accessRules;
        this.hpcCacheId = $.hpcCacheId;
        this.name = $.name;
    }

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

    public static final class Builder {
        private CacheAccessPolicyArgs $;

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

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

        /**
         * @param accessRules Up to three `access_rule` blocks as defined below.
         * 
         * @return builder
         * 
         */
        public Builder accessRules(Output<List<CacheAccessPolicyAccessRuleArgs>> accessRules) {
            $.accessRules = accessRules;
            return this;
        }

        /**
         * @param accessRules Up to three `access_rule` blocks as defined below.
         * 
         * @return builder
         * 
         */
        public Builder accessRules(List<CacheAccessPolicyAccessRuleArgs> accessRules) {
            return accessRules(Output.of(accessRules));
        }

        /**
         * @param accessRules Up to three `access_rule` blocks as defined below.
         * 
         * @return builder
         * 
         */
        public Builder accessRules(CacheAccessPolicyAccessRuleArgs... accessRules) {
            return accessRules(List.of(accessRules));
        }

        /**
         * @param hpcCacheId The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.
         * 
         * @return builder
         * 
         */
        public Builder hpcCacheId(Output<String> hpcCacheId) {
            $.hpcCacheId = hpcCacheId;
            return this;
        }

        /**
         * @param hpcCacheId The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.
         * 
         * @return builder
         * 
         */
        public Builder hpcCacheId(String hpcCacheId) {
            return hpcCacheId(Output.of(hpcCacheId));
        }

        /**
         * @param name The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output<String> name) {
            $.name = name;
            return this;
        }

        /**
         * @param name The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        public CacheAccessPolicyArgs build() {
            $.accessRules = Objects.requireNonNull($.accessRules, "expected parameter 'accessRules' to be non-null");
            $.hpcCacheId = Objects.requireNonNull($.hpcCacheId, "expected parameter 'hpcCacheId' to be non-null");
            return $;
        }
    }

}
