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

import com.pulumi.core.annotations.CustomType;
import com.pulumi.gcp.compute.outputs.OrganizationSecurityPolicyRuleMatchConfigLayer4Config;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import javax.annotation.Nullable;

@CustomType
public final class OrganizationSecurityPolicyRuleMatchConfig {
    /**
     * @return Destination IP address range in CIDR format. Required for
     * EGRESS rules.
     * 
     */
    private @Nullable List<String> destIpRanges;
    /**
     * @return Pairs of IP protocols and ports that the rule should match.
     * Structure is documented below.
     * 
     * &lt;a name=&#34;nested_layer4_config&#34;&gt;&lt;/a&gt;The `layer4_config` block supports:
     * 
     */
    private List<OrganizationSecurityPolicyRuleMatchConfigLayer4Config> layer4Configs;
    /**
     * @return Source IP address range in CIDR format. Required for
     * INGRESS rules.
     * 
     */
    private @Nullable List<String> srcIpRanges;

    private OrganizationSecurityPolicyRuleMatchConfig() {}
    /**
     * @return Destination IP address range in CIDR format. Required for
     * EGRESS rules.
     * 
     */
    public List<String> destIpRanges() {
        return this.destIpRanges == null ? List.of() : this.destIpRanges;
    }
    /**
     * @return Pairs of IP protocols and ports that the rule should match.
     * Structure is documented below.
     * 
     * &lt;a name=&#34;nested_layer4_config&#34;&gt;&lt;/a&gt;The `layer4_config` block supports:
     * 
     */
    public List<OrganizationSecurityPolicyRuleMatchConfigLayer4Config> layer4Configs() {
        return this.layer4Configs;
    }
    /**
     * @return Source IP address range in CIDR format. Required for
     * INGRESS rules.
     * 
     */
    public List<String> srcIpRanges() {
        return this.srcIpRanges == null ? List.of() : this.srcIpRanges;
    }

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

    public static Builder builder(OrganizationSecurityPolicyRuleMatchConfig defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable List<String> destIpRanges;
        private List<OrganizationSecurityPolicyRuleMatchConfigLayer4Config> layer4Configs;
        private @Nullable List<String> srcIpRanges;
        public Builder() {}
        public Builder(OrganizationSecurityPolicyRuleMatchConfig defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.destIpRanges = defaults.destIpRanges;
    	      this.layer4Configs = defaults.layer4Configs;
    	      this.srcIpRanges = defaults.srcIpRanges;
        }

        @CustomType.Setter
        public Builder destIpRanges(@Nullable List<String> destIpRanges) {
            this.destIpRanges = destIpRanges;
            return this;
        }
        public Builder destIpRanges(String... destIpRanges) {
            return destIpRanges(List.of(destIpRanges));
        }
        @CustomType.Setter
        public Builder layer4Configs(List<OrganizationSecurityPolicyRuleMatchConfigLayer4Config> layer4Configs) {
            this.layer4Configs = Objects.requireNonNull(layer4Configs);
            return this;
        }
        public Builder layer4Configs(OrganizationSecurityPolicyRuleMatchConfigLayer4Config... layer4Configs) {
            return layer4Configs(List.of(layer4Configs));
        }
        @CustomType.Setter
        public Builder srcIpRanges(@Nullable List<String> srcIpRanges) {
            this.srcIpRanges = srcIpRanges;
            return this;
        }
        public Builder srcIpRanges(String... srcIpRanges) {
            return srcIpRanges(List.of(srcIpRanges));
        }
        public OrganizationSecurityPolicyRuleMatchConfig build() {
            final var o = new OrganizationSecurityPolicyRuleMatchConfig();
            o.destIpRanges = destIpRanges;
            o.layer4Configs = layer4Configs;
            o.srcIpRanges = srcIpRanges;
            return o;
        }
    }
}
