// *** 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 java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class RegionSecurityPolicyUserDefinedField {
    /**
     * @return The base relative to which &#39;offset&#39; is measured. Possible values are:
     * - IPV4: Points to the beginning of the IPv4 header.
     * - IPV6: Points to the beginning of the IPv6 header.
     * - TCP: Points to the beginning of the TCP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments.
     * - UDP: Points to the beginning of the UDP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments.
     *   Possible values are: `IPV4`, `IPV6`, `TCP`, `UDP`.
     * 
     */
    private String base;
    /**
     * @return If specified, apply this mask (bitwise AND) to the field to ignore bits before matching.
     * Encoded as a hexadecimal number (starting with &#34;0x&#34;).
     * The last byte of the field (in network byte order) corresponds to the least significant byte of the mask.
     * 
     */
    private @Nullable String mask;
    /**
     * @return The name of this field. Must be unique within the policy.
     * 
     */
    private @Nullable String name;
    /**
     * @return Offset of the first byte of the field (in network byte order) relative to &#39;base&#39;.
     * 
     */
    private @Nullable Integer offset;
    /**
     * @return Size of the field in bytes. Valid values: 1-4.
     * 
     */
    private @Nullable Integer size;

    private RegionSecurityPolicyUserDefinedField() {}
    /**
     * @return The base relative to which &#39;offset&#39; is measured. Possible values are:
     * - IPV4: Points to the beginning of the IPv4 header.
     * - IPV6: Points to the beginning of the IPv6 header.
     * - TCP: Points to the beginning of the TCP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments.
     * - UDP: Points to the beginning of the UDP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments.
     *   Possible values are: `IPV4`, `IPV6`, `TCP`, `UDP`.
     * 
     */
    public String base() {
        return this.base;
    }
    /**
     * @return If specified, apply this mask (bitwise AND) to the field to ignore bits before matching.
     * Encoded as a hexadecimal number (starting with &#34;0x&#34;).
     * The last byte of the field (in network byte order) corresponds to the least significant byte of the mask.
     * 
     */
    public Optional<String> mask() {
        return Optional.ofNullable(this.mask);
    }
    /**
     * @return The name of this field. Must be unique within the policy.
     * 
     */
    public Optional<String> name() {
        return Optional.ofNullable(this.name);
    }
    /**
     * @return Offset of the first byte of the field (in network byte order) relative to &#39;base&#39;.
     * 
     */
    public Optional<Integer> offset() {
        return Optional.ofNullable(this.offset);
    }
    /**
     * @return Size of the field in bytes. Valid values: 1-4.
     * 
     */
    public Optional<Integer> size() {
        return Optional.ofNullable(this.size);
    }

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

    public static Builder builder(RegionSecurityPolicyUserDefinedField defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private String base;
        private @Nullable String mask;
        private @Nullable String name;
        private @Nullable Integer offset;
        private @Nullable Integer size;
        public Builder() {}
        public Builder(RegionSecurityPolicyUserDefinedField defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.base = defaults.base;
    	      this.mask = defaults.mask;
    	      this.name = defaults.name;
    	      this.offset = defaults.offset;
    	      this.size = defaults.size;
        }

        @CustomType.Setter
        public Builder base(String base) {
            this.base = Objects.requireNonNull(base);
            return this;
        }
        @CustomType.Setter
        public Builder mask(@Nullable String mask) {
            this.mask = mask;
            return this;
        }
        @CustomType.Setter
        public Builder name(@Nullable String name) {
            this.name = name;
            return this;
        }
        @CustomType.Setter
        public Builder offset(@Nullable Integer offset) {
            this.offset = offset;
            return this;
        }
        @CustomType.Setter
        public Builder size(@Nullable Integer size) {
            this.size = size;
            return this;
        }
        public RegionSecurityPolicyUserDefinedField build() {
            final var o = new RegionSecurityPolicyUserDefinedField();
            o.base = base;
            o.mask = mask;
            o.name = name;
            o.offset = offset;
            o.size = size;
            return o;
        }
    }
}
