/*
 * 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.container.v1beta1.model;

/**
 * Parameters for node pool-level network config.
 *
 * <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 Kubernetes Engine 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 NodeNetworkConfig extends com.google.api.client.json.GenericJson {

  /**
   * We specify the additional node networks for this node pool using this list. Each node network
   * corresponds to an additional interface
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<AdditionalNodeNetworkConfig> additionalNodeNetworkConfigs;

  static {
    // hack to force ProGuard to consider AdditionalNodeNetworkConfig used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(AdditionalNodeNetworkConfig.class);
  }

  /**
   * We specify the additional pod networks for this node pool using this list. Each pod network
   * corresponds to an additional alias IP range for the node
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<AdditionalPodNetworkConfig> additionalPodNetworkConfigs;

  static {
    // hack to force ProGuard to consider AdditionalPodNetworkConfig used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(AdditionalPodNetworkConfig.class);
  }

  /**
   * Input only. Whether to create a new range for pod IPs in this node pool. Defaults are provided
   * for `pod_range` and `pod_ipv4_cidr_block` if they are not specified. If neither
   * `create_pod_range` or `pod_range` are specified, the cluster-level default
   * (`ip_allocation_policy.cluster_ipv4_cidr_block`) is used. Only applicable if
   * `ip_allocation_policy.use_ip_aliases` is true. This field cannot be changed after the node pool
   * has been created.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean createPodRange;

  /**
   * Whether nodes have internal IP addresses only. If enable_private_nodes is not specified, then
   * the value is derived from cluster.privateClusterConfig.enablePrivateNodes
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean enablePrivateNodes;

  /**
   * Network bandwidth tier configuration.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private NetworkPerformanceConfig networkPerformanceConfig;

  /**
   * [PRIVATE FIELD] Pod CIDR size overprovisioning config for the nodepool. Pod CIDR size per node
   * depends on max_pods_per_node. By default, the value of max_pods_per_node is rounded off to next
   * power of 2 and we then double that to get the size of pod CIDR block per node. Example:
   * max_pods_per_node of 30 would result in 64 IPs (/26). This config can disable the doubling of
   * IPs (we still round off to next power of 2) Example: max_pods_per_node of 30 will result in 32
   * IPs (/27) when overprovisioning is disabled.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private PodCIDROverprovisionConfig podCidrOverprovisionConfig;

  /**
   * The IP address range for pod IPs in this node pool. Only applicable if `create_pod_range` is
   * true. Set to blank to have a range chosen with the default size. Set to /netmask (e.g. `/14`)
   * to have a range chosen with a specific netmask. Set to a [CIDR](https://en.wikipedia.org/wiki
   * /Classless_Inter-Domain_Routing) notation (e.g. `10.96.0.0/14`) to pick a specific range to
   * use. Only applicable if `ip_allocation_policy.use_ip_aliases` is true. This field cannot be
   * changed after the node pool has been created.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String podIpv4CidrBlock;

  /**
   * Output only. [Output only] The utilization of the IPv4 range for the pod. The ratio is
   * Usage/[Total number of IPs in the secondary range], Usage=numNodes*numZones*podIPsPerNode.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Double podIpv4RangeUtilization;

  /**
   * The ID of the secondary range for pod IPs. If `create_pod_range` is true, this ID is used for
   * the new range. If `create_pod_range` is false, uses an existing secondary range with this ID.
   * Only applicable if `ip_allocation_policy.use_ip_aliases` is true. This field cannot be changed
   * after the node pool has been created.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String podRange;

  /**
   * We specify the additional node networks for this node pool using this list. Each node network
   * corresponds to an additional interface
   * @return value or {@code null} for none
   */
  public java.util.List<AdditionalNodeNetworkConfig> getAdditionalNodeNetworkConfigs() {
    return additionalNodeNetworkConfigs;
  }

  /**
   * We specify the additional node networks for this node pool using this list. Each node network
   * corresponds to an additional interface
   * @param additionalNodeNetworkConfigs additionalNodeNetworkConfigs or {@code null} for none
   */
  public NodeNetworkConfig setAdditionalNodeNetworkConfigs(java.util.List<AdditionalNodeNetworkConfig> additionalNodeNetworkConfigs) {
    this.additionalNodeNetworkConfigs = additionalNodeNetworkConfigs;
    return this;
  }

  /**
   * We specify the additional pod networks for this node pool using this list. Each pod network
   * corresponds to an additional alias IP range for the node
   * @return value or {@code null} for none
   */
  public java.util.List<AdditionalPodNetworkConfig> getAdditionalPodNetworkConfigs() {
    return additionalPodNetworkConfigs;
  }

  /**
   * We specify the additional pod networks for this node pool using this list. Each pod network
   * corresponds to an additional alias IP range for the node
   * @param additionalPodNetworkConfigs additionalPodNetworkConfigs or {@code null} for none
   */
  public NodeNetworkConfig setAdditionalPodNetworkConfigs(java.util.List<AdditionalPodNetworkConfig> additionalPodNetworkConfigs) {
    this.additionalPodNetworkConfigs = additionalPodNetworkConfigs;
    return this;
  }

  /**
   * Input only. Whether to create a new range for pod IPs in this node pool. Defaults are provided
   * for `pod_range` and `pod_ipv4_cidr_block` if they are not specified. If neither
   * `create_pod_range` or `pod_range` are specified, the cluster-level default
   * (`ip_allocation_policy.cluster_ipv4_cidr_block`) is used. Only applicable if
   * `ip_allocation_policy.use_ip_aliases` is true. This field cannot be changed after the node pool
   * has been created.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getCreatePodRange() {
    return createPodRange;
  }

  /**
   * Input only. Whether to create a new range for pod IPs in this node pool. Defaults are provided
   * for `pod_range` and `pod_ipv4_cidr_block` if they are not specified. If neither
   * `create_pod_range` or `pod_range` are specified, the cluster-level default
   * (`ip_allocation_policy.cluster_ipv4_cidr_block`) is used. Only applicable if
   * `ip_allocation_policy.use_ip_aliases` is true. This field cannot be changed after the node pool
   * has been created.
   * @param createPodRange createPodRange or {@code null} for none
   */
  public NodeNetworkConfig setCreatePodRange(java.lang.Boolean createPodRange) {
    this.createPodRange = createPodRange;
    return this;
  }

  /**
   * Whether nodes have internal IP addresses only. If enable_private_nodes is not specified, then
   * the value is derived from cluster.privateClusterConfig.enablePrivateNodes
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getEnablePrivateNodes() {
    return enablePrivateNodes;
  }

  /**
   * Whether nodes have internal IP addresses only. If enable_private_nodes is not specified, then
   * the value is derived from cluster.privateClusterConfig.enablePrivateNodes
   * @param enablePrivateNodes enablePrivateNodes or {@code null} for none
   */
  public NodeNetworkConfig setEnablePrivateNodes(java.lang.Boolean enablePrivateNodes) {
    this.enablePrivateNodes = enablePrivateNodes;
    return this;
  }

  /**
   * Network bandwidth tier configuration.
   * @return value or {@code null} for none
   */
  public NetworkPerformanceConfig getNetworkPerformanceConfig() {
    return networkPerformanceConfig;
  }

  /**
   * Network bandwidth tier configuration.
   * @param networkPerformanceConfig networkPerformanceConfig or {@code null} for none
   */
  public NodeNetworkConfig setNetworkPerformanceConfig(NetworkPerformanceConfig networkPerformanceConfig) {
    this.networkPerformanceConfig = networkPerformanceConfig;
    return this;
  }

  /**
   * [PRIVATE FIELD] Pod CIDR size overprovisioning config for the nodepool. Pod CIDR size per node
   * depends on max_pods_per_node. By default, the value of max_pods_per_node is rounded off to next
   * power of 2 and we then double that to get the size of pod CIDR block per node. Example:
   * max_pods_per_node of 30 would result in 64 IPs (/26). This config can disable the doubling of
   * IPs (we still round off to next power of 2) Example: max_pods_per_node of 30 will result in 32
   * IPs (/27) when overprovisioning is disabled.
   * @return value or {@code null} for none
   */
  public PodCIDROverprovisionConfig getPodCidrOverprovisionConfig() {
    return podCidrOverprovisionConfig;
  }

  /**
   * [PRIVATE FIELD] Pod CIDR size overprovisioning config for the nodepool. Pod CIDR size per node
   * depends on max_pods_per_node. By default, the value of max_pods_per_node is rounded off to next
   * power of 2 and we then double that to get the size of pod CIDR block per node. Example:
   * max_pods_per_node of 30 would result in 64 IPs (/26). This config can disable the doubling of
   * IPs (we still round off to next power of 2) Example: max_pods_per_node of 30 will result in 32
   * IPs (/27) when overprovisioning is disabled.
   * @param podCidrOverprovisionConfig podCidrOverprovisionConfig or {@code null} for none
   */
  public NodeNetworkConfig setPodCidrOverprovisionConfig(PodCIDROverprovisionConfig podCidrOverprovisionConfig) {
    this.podCidrOverprovisionConfig = podCidrOverprovisionConfig;
    return this;
  }

  /**
   * The IP address range for pod IPs in this node pool. Only applicable if `create_pod_range` is
   * true. Set to blank to have a range chosen with the default size. Set to /netmask (e.g. `/14`)
   * to have a range chosen with a specific netmask. Set to a [CIDR](https://en.wikipedia.org/wiki
   * /Classless_Inter-Domain_Routing) notation (e.g. `10.96.0.0/14`) to pick a specific range to
   * use. Only applicable if `ip_allocation_policy.use_ip_aliases` is true. This field cannot be
   * changed after the node pool has been created.
   * @return value or {@code null} for none
   */
  public java.lang.String getPodIpv4CidrBlock() {
    return podIpv4CidrBlock;
  }

  /**
   * The IP address range for pod IPs in this node pool. Only applicable if `create_pod_range` is
   * true. Set to blank to have a range chosen with the default size. Set to /netmask (e.g. `/14`)
   * to have a range chosen with a specific netmask. Set to a [CIDR](https://en.wikipedia.org/wiki
   * /Classless_Inter-Domain_Routing) notation (e.g. `10.96.0.0/14`) to pick a specific range to
   * use. Only applicable if `ip_allocation_policy.use_ip_aliases` is true. This field cannot be
   * changed after the node pool has been created.
   * @param podIpv4CidrBlock podIpv4CidrBlock or {@code null} for none
   */
  public NodeNetworkConfig setPodIpv4CidrBlock(java.lang.String podIpv4CidrBlock) {
    this.podIpv4CidrBlock = podIpv4CidrBlock;
    return this;
  }

  /**
   * Output only. [Output only] The utilization of the IPv4 range for the pod. The ratio is
   * Usage/[Total number of IPs in the secondary range], Usage=numNodes*numZones*podIPsPerNode.
   * @return value or {@code null} for none
   */
  public java.lang.Double getPodIpv4RangeUtilization() {
    return podIpv4RangeUtilization;
  }

  /**
   * Output only. [Output only] The utilization of the IPv4 range for the pod. The ratio is
   * Usage/[Total number of IPs in the secondary range], Usage=numNodes*numZones*podIPsPerNode.
   * @param podIpv4RangeUtilization podIpv4RangeUtilization or {@code null} for none
   */
  public NodeNetworkConfig setPodIpv4RangeUtilization(java.lang.Double podIpv4RangeUtilization) {
    this.podIpv4RangeUtilization = podIpv4RangeUtilization;
    return this;
  }

  /**
   * The ID of the secondary range for pod IPs. If `create_pod_range` is true, this ID is used for
   * the new range. If `create_pod_range` is false, uses an existing secondary range with this ID.
   * Only applicable if `ip_allocation_policy.use_ip_aliases` is true. This field cannot be changed
   * after the node pool has been created.
   * @return value or {@code null} for none
   */
  public java.lang.String getPodRange() {
    return podRange;
  }

  /**
   * The ID of the secondary range for pod IPs. If `create_pod_range` is true, this ID is used for
   * the new range. If `create_pod_range` is false, uses an existing secondary range with this ID.
   * Only applicable if `ip_allocation_policy.use_ip_aliases` is true. This field cannot be changed
   * after the node pool has been created.
   * @param podRange podRange or {@code null} for none
   */
  public NodeNetworkConfig setPodRange(java.lang.String podRange) {
    this.podRange = podRange;
    return this;
  }

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

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

}
