/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.servicenetworking.v1.model;

/**
 * Represents a range reservation.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Service Networking API. For a detailed explanation
 * see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class RangeReservation extends com.google.api.client.json.GenericJson {

  /**
   * Required. The size of the desired subnet. Use usual CIDR range notation. For example, '29' to
   * find unused x.x.x.x/29 CIDR range. The goal is to determine if one of the allocated ranges has
   * enough free space for a subnet of the requested size. GCE disallows subnets with prefix_length
   * > 29
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer ipPrefixLength;

  /**
   * Optional. The name of one or more allocated IP address ranges associated with this private
   * service access connection. If no range names are provided all ranges associated with this
   * connection will be considered. If a CIDR range with the specified IP prefix length is not
   * available within these ranges the validation fails.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<java.lang.String> requestedRanges;

  /**
   * Optional. The size of the desired secondary ranges for the subnet. Use usual CIDR range
   * notation. For example, '29' to find unused x.x.x.x/29 CIDR range. The goal is to determine that
   * the allocated ranges have enough free space for all the requested secondary ranges. GCE
   * disallows subnets with prefix_length > 29
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<java.lang.Integer> secondaryRangeIpPrefixLengths;

  /**
   * Optional. List of subnetwork candidates to validate. The required input fields are `name`,
   * `network`, and `region`. Subnetworks from this list which exist will be returned in the
   * response with the `ip_cidr_range`, `secondary_ip_cider_ranges`, and `outside_allocation` fields
   * set.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<Subnetwork> subnetworkCandidates;

  /**
   * Required. The size of the desired subnet. Use usual CIDR range notation. For example, '29' to
   * find unused x.x.x.x/29 CIDR range. The goal is to determine if one of the allocated ranges has
   * enough free space for a subnet of the requested size. GCE disallows subnets with prefix_length
   * > 29
   * @return value or {@code null} for none
   */
  public java.lang.Integer getIpPrefixLength() {
    return ipPrefixLength;
  }

  /**
   * Required. The size of the desired subnet. Use usual CIDR range notation. For example, '29' to
   * find unused x.x.x.x/29 CIDR range. The goal is to determine if one of the allocated ranges has
   * enough free space for a subnet of the requested size. GCE disallows subnets with prefix_length
   * > 29
   * @param ipPrefixLength ipPrefixLength or {@code null} for none
   */
  public RangeReservation setIpPrefixLength(java.lang.Integer ipPrefixLength) {
    this.ipPrefixLength = ipPrefixLength;
    return this;
  }

  /**
   * Optional. The name of one or more allocated IP address ranges associated with this private
   * service access connection. If no range names are provided all ranges associated with this
   * connection will be considered. If a CIDR range with the specified IP prefix length is not
   * available within these ranges the validation fails.
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.String> getRequestedRanges() {
    return requestedRanges;
  }

  /**
   * Optional. The name of one or more allocated IP address ranges associated with this private
   * service access connection. If no range names are provided all ranges associated with this
   * connection will be considered. If a CIDR range with the specified IP prefix length is not
   * available within these ranges the validation fails.
   * @param requestedRanges requestedRanges or {@code null} for none
   */
  public RangeReservation setRequestedRanges(java.util.List<java.lang.String> requestedRanges) {
    this.requestedRanges = requestedRanges;
    return this;
  }

  /**
   * Optional. The size of the desired secondary ranges for the subnet. Use usual CIDR range
   * notation. For example, '29' to find unused x.x.x.x/29 CIDR range. The goal is to determine that
   * the allocated ranges have enough free space for all the requested secondary ranges. GCE
   * disallows subnets with prefix_length > 29
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.Integer> getSecondaryRangeIpPrefixLengths() {
    return secondaryRangeIpPrefixLengths;
  }

  /**
   * Optional. The size of the desired secondary ranges for the subnet. Use usual CIDR range
   * notation. For example, '29' to find unused x.x.x.x/29 CIDR range. The goal is to determine that
   * the allocated ranges have enough free space for all the requested secondary ranges. GCE
   * disallows subnets with prefix_length > 29
   * @param secondaryRangeIpPrefixLengths secondaryRangeIpPrefixLengths or {@code null} for none
   */
  public RangeReservation setSecondaryRangeIpPrefixLengths(java.util.List<java.lang.Integer> secondaryRangeIpPrefixLengths) {
    this.secondaryRangeIpPrefixLengths = secondaryRangeIpPrefixLengths;
    return this;
  }

  /**
   * Optional. List of subnetwork candidates to validate. The required input fields are `name`,
   * `network`, and `region`. Subnetworks from this list which exist will be returned in the
   * response with the `ip_cidr_range`, `secondary_ip_cider_ranges`, and `outside_allocation` fields
   * set.
   * @return value or {@code null} for none
   */
  public java.util.List<Subnetwork> getSubnetworkCandidates() {
    return subnetworkCandidates;
  }

  /**
   * Optional. List of subnetwork candidates to validate. The required input fields are `name`,
   * `network`, and `region`. Subnetworks from this list which exist will be returned in the
   * response with the `ip_cidr_range`, `secondary_ip_cider_ranges`, and `outside_allocation` fields
   * set.
   * @param subnetworkCandidates subnetworkCandidates or {@code null} for none
   */
  public RangeReservation setSubnetworkCandidates(java.util.List<Subnetwork> subnetworkCandidates) {
    this.subnetworkCandidates = subnetworkCandidates;
    return this;
  }

  @Override
  public RangeReservation set(String fieldName, Object value) {
    return (RangeReservation) super.set(fieldName, value);
  }

  @Override
  public RangeReservation clone() {
    return (RangeReservation) super.clone();
  }

}
