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

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

@CustomType
public final class IoTHubSharedAccessPolicy {
    /**
     * @return The name of the shared access policy.
     * 
     */
    private @Nullable String keyName;
    /**
     * @return The permissions assigned to the shared access policy.
     * 
     */
    private @Nullable String permissions;
    /**
     * @return The primary key.
     * 
     */
    private @Nullable String primaryKey;
    /**
     * @return The secondary key.
     * 
     */
    private @Nullable String secondaryKey;

    private IoTHubSharedAccessPolicy() {}
    /**
     * @return The name of the shared access policy.
     * 
     */
    public Optional<String> keyName() {
        return Optional.ofNullable(this.keyName);
    }
    /**
     * @return The permissions assigned to the shared access policy.
     * 
     */
    public Optional<String> permissions() {
        return Optional.ofNullable(this.permissions);
    }
    /**
     * @return The primary key.
     * 
     */
    public Optional<String> primaryKey() {
        return Optional.ofNullable(this.primaryKey);
    }
    /**
     * @return The secondary key.
     * 
     */
    public Optional<String> secondaryKey() {
        return Optional.ofNullable(this.secondaryKey);
    }

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

    public static Builder builder(IoTHubSharedAccessPolicy defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String keyName;
        private @Nullable String permissions;
        private @Nullable String primaryKey;
        private @Nullable String secondaryKey;
        public Builder() {}
        public Builder(IoTHubSharedAccessPolicy defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.keyName = defaults.keyName;
    	      this.permissions = defaults.permissions;
    	      this.primaryKey = defaults.primaryKey;
    	      this.secondaryKey = defaults.secondaryKey;
        }

        @CustomType.Setter
        public Builder keyName(@Nullable String keyName) {
            this.keyName = keyName;
            return this;
        }
        @CustomType.Setter
        public Builder permissions(@Nullable String permissions) {
            this.permissions = permissions;
            return this;
        }
        @CustomType.Setter
        public Builder primaryKey(@Nullable String primaryKey) {
            this.primaryKey = primaryKey;
            return this;
        }
        @CustomType.Setter
        public Builder secondaryKey(@Nullable String secondaryKey) {
            this.secondaryKey = secondaryKey;
            return this;
        }
        public IoTHubSharedAccessPolicy build() {
            final var o = new IoTHubSharedAccessPolicy();
            o.keyName = keyName;
            o.permissions = permissions;
            o.primaryKey = primaryKey;
            o.secondaryKey = secondaryKey;
            return o;
        }
    }
}
