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

import com.pulumi.core.annotations.CustomType;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class CacheDefaultAccessPolicyAccessRule {
    /**
     * @return The access level for this rule. Possible values are: `rw`, `ro`, `no`.
     * 
     */
    private String access;
    /**
     * @return The anonymous GID used when `root_squash_enabled` is `true`.
     * 
     */
    private @Nullable Integer anonymousGid;
    /**
     * @return The anonymous UID used when `root_squash_enabled` is `true`.
     * 
     */
    private @Nullable Integer anonymousUid;
    /**
     * @return The filter applied to the `scope` for this rule. The filter&#39;s format depends on its scope: `default` scope matches all clients and has no filter value; `network` scope takes a CIDR format; `host` takes an IP address or fully qualified domain name. If a client does not match any filter rule and there is no default rule, access is denied.
     * 
     */
    private @Nullable String filter;
    /**
     * @return Whether to enable [root squash](https://docs.microsoft.com/azure/hpc-cache/access-policies#root-squash)?
     * 
     */
    private @Nullable Boolean rootSquashEnabled;
    /**
     * @return The scope of this rule. The `scope` and (potentially) the `filter` determine which clients match the rule. Possible values are: `default`, `network`, `host`.
     * 
     * &gt; **Note:** Each `access_rule` should set a unique `scope`.
     * 
     */
    private String scope;
    /**
     * @return Whether allow access to subdirectories under the root export?
     * 
     */
    private @Nullable Boolean submountAccessEnabled;
    /**
     * @return Whether [SUID](https://docs.microsoft.com/azure/hpc-cache/access-policies#suid) is allowed?
     * 
     */
    private @Nullable Boolean suidEnabled;

    private CacheDefaultAccessPolicyAccessRule() {}
    /**
     * @return The access level for this rule. Possible values are: `rw`, `ro`, `no`.
     * 
     */
    public String access() {
        return this.access;
    }
    /**
     * @return The anonymous GID used when `root_squash_enabled` is `true`.
     * 
     */
    public Optional<Integer> anonymousGid() {
        return Optional.ofNullable(this.anonymousGid);
    }
    /**
     * @return The anonymous UID used when `root_squash_enabled` is `true`.
     * 
     */
    public Optional<Integer> anonymousUid() {
        return Optional.ofNullable(this.anonymousUid);
    }
    /**
     * @return The filter applied to the `scope` for this rule. The filter&#39;s format depends on its scope: `default` scope matches all clients and has no filter value; `network` scope takes a CIDR format; `host` takes an IP address or fully qualified domain name. If a client does not match any filter rule and there is no default rule, access is denied.
     * 
     */
    public Optional<String> filter() {
        return Optional.ofNullable(this.filter);
    }
    /**
     * @return Whether to enable [root squash](https://docs.microsoft.com/azure/hpc-cache/access-policies#root-squash)?
     * 
     */
    public Optional<Boolean> rootSquashEnabled() {
        return Optional.ofNullable(this.rootSquashEnabled);
    }
    /**
     * @return The scope of this rule. The `scope` and (potentially) the `filter` determine which clients match the rule. Possible values are: `default`, `network`, `host`.
     * 
     * &gt; **Note:** Each `access_rule` should set a unique `scope`.
     * 
     */
    public String scope() {
        return this.scope;
    }
    /**
     * @return Whether allow access to subdirectories under the root export?
     * 
     */
    public Optional<Boolean> submountAccessEnabled() {
        return Optional.ofNullable(this.submountAccessEnabled);
    }
    /**
     * @return Whether [SUID](https://docs.microsoft.com/azure/hpc-cache/access-policies#suid) is allowed?
     * 
     */
    public Optional<Boolean> suidEnabled() {
        return Optional.ofNullable(this.suidEnabled);
    }

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

    public static Builder builder(CacheDefaultAccessPolicyAccessRule defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private String access;
        private @Nullable Integer anonymousGid;
        private @Nullable Integer anonymousUid;
        private @Nullable String filter;
        private @Nullable Boolean rootSquashEnabled;
        private String scope;
        private @Nullable Boolean submountAccessEnabled;
        private @Nullable Boolean suidEnabled;
        public Builder() {}
        public Builder(CacheDefaultAccessPolicyAccessRule defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.access = defaults.access;
    	      this.anonymousGid = defaults.anonymousGid;
    	      this.anonymousUid = defaults.anonymousUid;
    	      this.filter = defaults.filter;
    	      this.rootSquashEnabled = defaults.rootSquashEnabled;
    	      this.scope = defaults.scope;
    	      this.submountAccessEnabled = defaults.submountAccessEnabled;
    	      this.suidEnabled = defaults.suidEnabled;
        }

        @CustomType.Setter
        public Builder access(String access) {
            this.access = Objects.requireNonNull(access);
            return this;
        }
        @CustomType.Setter
        public Builder anonymousGid(@Nullable Integer anonymousGid) {
            this.anonymousGid = anonymousGid;
            return this;
        }
        @CustomType.Setter
        public Builder anonymousUid(@Nullable Integer anonymousUid) {
            this.anonymousUid = anonymousUid;
            return this;
        }
        @CustomType.Setter
        public Builder filter(@Nullable String filter) {
            this.filter = filter;
            return this;
        }
        @CustomType.Setter
        public Builder rootSquashEnabled(@Nullable Boolean rootSquashEnabled) {
            this.rootSquashEnabled = rootSquashEnabled;
            return this;
        }
        @CustomType.Setter
        public Builder scope(String scope) {
            this.scope = Objects.requireNonNull(scope);
            return this;
        }
        @CustomType.Setter
        public Builder submountAccessEnabled(@Nullable Boolean submountAccessEnabled) {
            this.submountAccessEnabled = submountAccessEnabled;
            return this;
        }
        @CustomType.Setter
        public Builder suidEnabled(@Nullable Boolean suidEnabled) {
            this.suidEnabled = suidEnabled;
            return this;
        }
        public CacheDefaultAccessPolicyAccessRule build() {
            final var o = new CacheDefaultAccessPolicyAccessRule();
            o.access = access;
            o.anonymousGid = anonymousGid;
            o.anonymousUid = anonymousUid;
            o.filter = filter;
            o.rootSquashEnabled = rootSquashEnabled;
            o.scope = scope;
            o.submountAccessEnabled = submountAccessEnabled;
            o.suidEnabled = suidEnabled;
            return o;
        }
    }
}
