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

import com.pulumi.core.annotations.CustomType;
import java.lang.String;
import java.util.List;
import java.util.Objects;

@CustomType
public final class TopicMessageStoragePolicy {
    /**
     * @return A list of IDs of GCP regions where messages that are published to
     * the topic may be persisted in storage. Messages published by
     * publishers running in non-allowed GCP regions (or running outside
     * of GCP altogether) will be routed for storage in one of the
     * allowed regions. An empty list means that no regions are allowed,
     * and is not a valid configuration.
     * 
     */
    private List<String> allowedPersistenceRegions;

    private TopicMessageStoragePolicy() {}
    /**
     * @return A list of IDs of GCP regions where messages that are published to
     * the topic may be persisted in storage. Messages published by
     * publishers running in non-allowed GCP regions (or running outside
     * of GCP altogether) will be routed for storage in one of the
     * allowed regions. An empty list means that no regions are allowed,
     * and is not a valid configuration.
     * 
     */
    public List<String> allowedPersistenceRegions() {
        return this.allowedPersistenceRegions;
    }

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

    public static Builder builder(TopicMessageStoragePolicy defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private List<String> allowedPersistenceRegions;
        public Builder() {}
        public Builder(TopicMessageStoragePolicy defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.allowedPersistenceRegions = defaults.allowedPersistenceRegions;
        }

        @CustomType.Setter
        public Builder allowedPersistenceRegions(List<String> allowedPersistenceRegions) {
            this.allowedPersistenceRegions = Objects.requireNonNull(allowedPersistenceRegions);
            return this;
        }
        public Builder allowedPersistenceRegions(String... allowedPersistenceRegions) {
            return allowedPersistenceRegions(List.of(allowedPersistenceRegions));
        }
        public TopicMessageStoragePolicy build() {
            final var o = new TopicMessageStoragePolicy();
            o.allowedPersistenceRegions = allowedPersistenceRegions;
            return o;
        }
    }
}
