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

com.pulumi.azurenative.sql.inputs.InstanceFailoverGroupReadWriteEndpointArgs 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.sql.inputs;

import com.pulumi.azurenative.sql.enums.ReadWriteEndpointFailoverPolicy;
import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * Read-write endpoint of the failover group instance.
 * 
 */
public final class InstanceFailoverGroupReadWriteEndpointArgs extends com.pulumi.resources.ResourceArgs {

    public static final InstanceFailoverGroupReadWriteEndpointArgs Empty = new InstanceFailoverGroupReadWriteEndpointArgs();

    /**
     * Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
     * 
     */
    @Import(name="failoverPolicy", required=true)
    private Output> failoverPolicy;

    /**
     * @return Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
     * 
     */
    public Output> failoverPolicy() {
        return this.failoverPolicy;
    }

    /**
     * Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
     * 
     */
    @Import(name="failoverWithDataLossGracePeriodMinutes")
    private @Nullable Output failoverWithDataLossGracePeriodMinutes;

    /**
     * @return Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
     * 
     */
    public Optional> failoverWithDataLossGracePeriodMinutes() {
        return Optional.ofNullable(this.failoverWithDataLossGracePeriodMinutes);
    }

    private InstanceFailoverGroupReadWriteEndpointArgs() {}

    private InstanceFailoverGroupReadWriteEndpointArgs(InstanceFailoverGroupReadWriteEndpointArgs $) {
        this.failoverPolicy = $.failoverPolicy;
        this.failoverWithDataLossGracePeriodMinutes = $.failoverWithDataLossGracePeriodMinutes;
    }

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

    public static final class Builder {
        private InstanceFailoverGroupReadWriteEndpointArgs $;

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

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

        /**
         * @param failoverPolicy Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
         * 
         * @return builder
         * 
         */
        public Builder failoverPolicy(Output> failoverPolicy) {
            $.failoverPolicy = failoverPolicy;
            return this;
        }

        /**
         * @param failoverPolicy Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
         * 
         * @return builder
         * 
         */
        public Builder failoverPolicy(Either failoverPolicy) {
            return failoverPolicy(Output.of(failoverPolicy));
        }

        /**
         * @param failoverPolicy Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
         * 
         * @return builder
         * 
         */
        public Builder failoverPolicy(String failoverPolicy) {
            return failoverPolicy(Either.ofLeft(failoverPolicy));
        }

        /**
         * @param failoverPolicy Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
         * 
         * @return builder
         * 
         */
        public Builder failoverPolicy(ReadWriteEndpointFailoverPolicy failoverPolicy) {
            return failoverPolicy(Either.ofRight(failoverPolicy));
        }

        /**
         * @param failoverWithDataLossGracePeriodMinutes Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
         * 
         * @return builder
         * 
         */
        public Builder failoverWithDataLossGracePeriodMinutes(@Nullable Output failoverWithDataLossGracePeriodMinutes) {
            $.failoverWithDataLossGracePeriodMinutes = failoverWithDataLossGracePeriodMinutes;
            return this;
        }

        /**
         * @param failoverWithDataLossGracePeriodMinutes Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
         * 
         * @return builder
         * 
         */
        public Builder failoverWithDataLossGracePeriodMinutes(Integer failoverWithDataLossGracePeriodMinutes) {
            return failoverWithDataLossGracePeriodMinutes(Output.of(failoverWithDataLossGracePeriodMinutes));
        }

        public InstanceFailoverGroupReadWriteEndpointArgs build() {
            if ($.failoverPolicy == null) {
                throw new MissingRequiredPropertyException("InstanceFailoverGroupReadWriteEndpointArgs", "failoverPolicy");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy