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

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

@CustomType
public final class DatabaseInstanceClone {
    /**
     * @return The name of the allocated ip range for the private ip CloudSQL instance. For example: &#34;google-managed-services-default&#34;. If set, the cloned instance ip will be created in the allocated range. The range name must comply with [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name must be 1-63 characters long and match the regular expression a-z?.
     * 
     */
    private @Nullable String allocatedIpRange;
    /**
     * @return (SQL Server only, use with `point_in_time`) Clone only the specified databases from the source instance. Clone all databases if empty.
     * 
     */
    private @Nullable List<String> databaseNames;
    /**
     * @return The timestamp of the point in time that should be restored.
     * 
     * A timestamp in RFC3339 UTC &#34;Zulu&#34; format, with nanosecond resolution and up to nine fractional digits. Examples: &#34;2014-10-02T15:01:23Z&#34; and &#34;2014-10-02T15:01:23.045123456Z&#34;.
     * 
     */
    private @Nullable String pointInTime;
    /**
     * @return Name of the source instance which will be cloned.
     * 
     */
    private String sourceInstanceName;

    private DatabaseInstanceClone() {}
    /**
     * @return The name of the allocated ip range for the private ip CloudSQL instance. For example: &#34;google-managed-services-default&#34;. If set, the cloned instance ip will be created in the allocated range. The range name must comply with [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name must be 1-63 characters long and match the regular expression a-z?.
     * 
     */
    public Optional<String> allocatedIpRange() {
        return Optional.ofNullable(this.allocatedIpRange);
    }
    /**
     * @return (SQL Server only, use with `point_in_time`) Clone only the specified databases from the source instance. Clone all databases if empty.
     * 
     */
    public List<String> databaseNames() {
        return this.databaseNames == null ? List.of() : this.databaseNames;
    }
    /**
     * @return The timestamp of the point in time that should be restored.
     * 
     * A timestamp in RFC3339 UTC &#34;Zulu&#34; format, with nanosecond resolution and up to nine fractional digits. Examples: &#34;2014-10-02T15:01:23Z&#34; and &#34;2014-10-02T15:01:23.045123456Z&#34;.
     * 
     */
    public Optional<String> pointInTime() {
        return Optional.ofNullable(this.pointInTime);
    }
    /**
     * @return Name of the source instance which will be cloned.
     * 
     */
    public String sourceInstanceName() {
        return this.sourceInstanceName;
    }

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

    public static Builder builder(DatabaseInstanceClone defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String allocatedIpRange;
        private @Nullable List<String> databaseNames;
        private @Nullable String pointInTime;
        private String sourceInstanceName;
        public Builder() {}
        public Builder(DatabaseInstanceClone defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.allocatedIpRange = defaults.allocatedIpRange;
    	      this.databaseNames = defaults.databaseNames;
    	      this.pointInTime = defaults.pointInTime;
    	      this.sourceInstanceName = defaults.sourceInstanceName;
        }

        @CustomType.Setter
        public Builder allocatedIpRange(@Nullable String allocatedIpRange) {
            this.allocatedIpRange = allocatedIpRange;
            return this;
        }
        @CustomType.Setter
        public Builder databaseNames(@Nullable List<String> databaseNames) {
            this.databaseNames = databaseNames;
            return this;
        }
        public Builder databaseNames(String... databaseNames) {
            return databaseNames(List.of(databaseNames));
        }
        @CustomType.Setter
        public Builder pointInTime(@Nullable String pointInTime) {
            this.pointInTime = pointInTime;
            return this;
        }
        @CustomType.Setter
        public Builder sourceInstanceName(String sourceInstanceName) {
            this.sourceInstanceName = Objects.requireNonNull(sourceInstanceName);
            return this;
        }
        public DatabaseInstanceClone build() {
            final var o = new DatabaseInstanceClone();
            o.allocatedIpRange = allocatedIpRange;
            o.databaseNames = databaseNames;
            o.pointInTime = pointInTime;
            o.sourceInstanceName = sourceInstanceName;
            return o;
        }
    }
}
