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

/**
 * Model definition for BulkInsertInstanceResource.
 *
 * <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 Compute 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 BulkInsertInstanceResource extends com.google.api.client.json.GenericJson {

  /**
   * The maximum number of instances to create.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long count;

  /**
   * The instance defining the VM instances to be created.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Instance instance;

  /**
   * The instance properties defining the VM instances to be created. Required if
   * sourceInstanceTemplate is not provided.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private InstanceProperties instanceProperties;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private LocationPolicy locationPolicy;

  /**
   * The minimum number of instances to create. If no min_count is specified then count is used as
   * the default value. If min_count instances cannot be created, then no instances will be created.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long minCount;

  /**
   * Instance name pattern. Name pattern includes a parameter to specify the auto-incrementing
   * portion of the name, in a form of consecutive hash (#) chars, each of them corresponding to one
   * digit of an instance name. For example: name_pattern = inst-####-prod will generate names
   * starting with inst-0001-prod, inst-0002-prod, up to required count. If there exist instances
   * matching the name pattern in the same project and zone, the initial instance number will be
   * equal to the maximum existing instance number + 1 (e.g. if there exists an instance with name
   * inst-0030-prod, then the generated names will start with inst-0031-prod). The name pattern
   * placeholder #...# can contain up to 18 characters.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String namePattern;

  /**
   * List of predefined names. The number of names provided must be equal to count.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<java.lang.String> predefinedNames;

  /**
   * Specifies the instance template from which to create instances. You may combine
   * sourceInstanceTemplate with instanceProperties to override specific values from an existing
   * instance template. Bulk API follows the semantics of JSON Merge Patch described by RFC 7396.
   *
   * It can be a full or partial URL. For example, the following are all valid URLs to an instance
   * template:   - https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/i
   * nstanceTemplate  - projects/project/global/instanceTemplates/instanceTemplate  -
   * global/instanceTemplates/instanceTemplate
   *
   * This field is optional.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String sourceInstanceTemplate;

  /**
   * The maximum number of instances to create.
   * @return value or {@code null} for none
   */
  public java.lang.Long getCount() {
    return count;
  }

  /**
   * The maximum number of instances to create.
   * @param count count or {@code null} for none
   */
  public BulkInsertInstanceResource setCount(java.lang.Long count) {
    this.count = count;
    return this;
  }

  /**
   * The instance defining the VM instances to be created.
   * @return value or {@code null} for none
   */
  public Instance getInstance() {
    return instance;
  }

  /**
   * The instance defining the VM instances to be created.
   * @param instance instance or {@code null} for none
   */
  public BulkInsertInstanceResource setInstance(Instance instance) {
    this.instance = instance;
    return this;
  }

  /**
   * The instance properties defining the VM instances to be created. Required if
   * sourceInstanceTemplate is not provided.
   * @return value or {@code null} for none
   */
  public InstanceProperties getInstanceProperties() {
    return instanceProperties;
  }

  /**
   * The instance properties defining the VM instances to be created. Required if
   * sourceInstanceTemplate is not provided.
   * @param instanceProperties instanceProperties or {@code null} for none
   */
  public BulkInsertInstanceResource setInstanceProperties(InstanceProperties instanceProperties) {
    this.instanceProperties = instanceProperties;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public LocationPolicy getLocationPolicy() {
    return locationPolicy;
  }

  /**
   * @param locationPolicy locationPolicy or {@code null} for none
   */
  public BulkInsertInstanceResource setLocationPolicy(LocationPolicy locationPolicy) {
    this.locationPolicy = locationPolicy;
    return this;
  }

  /**
   * The minimum number of instances to create. If no min_count is specified then count is used as
   * the default value. If min_count instances cannot be created, then no instances will be created.
   * @return value or {@code null} for none
   */
  public java.lang.Long getMinCount() {
    return minCount;
  }

  /**
   * The minimum number of instances to create. If no min_count is specified then count is used as
   * the default value. If min_count instances cannot be created, then no instances will be created.
   * @param minCount minCount or {@code null} for none
   */
  public BulkInsertInstanceResource setMinCount(java.lang.Long minCount) {
    this.minCount = minCount;
    return this;
  }

  /**
   * Instance name pattern. Name pattern includes a parameter to specify the auto-incrementing
   * portion of the name, in a form of consecutive hash (#) chars, each of them corresponding to one
   * digit of an instance name. For example: name_pattern = inst-####-prod will generate names
   * starting with inst-0001-prod, inst-0002-prod, up to required count. If there exist instances
   * matching the name pattern in the same project and zone, the initial instance number will be
   * equal to the maximum existing instance number + 1 (e.g. if there exists an instance with name
   * inst-0030-prod, then the generated names will start with inst-0031-prod). The name pattern
   * placeholder #...# can contain up to 18 characters.
   * @return value or {@code null} for none
   */
  public java.lang.String getNamePattern() {
    return namePattern;
  }

  /**
   * Instance name pattern. Name pattern includes a parameter to specify the auto-incrementing
   * portion of the name, in a form of consecutive hash (#) chars, each of them corresponding to one
   * digit of an instance name. For example: name_pattern = inst-####-prod will generate names
   * starting with inst-0001-prod, inst-0002-prod, up to required count. If there exist instances
   * matching the name pattern in the same project and zone, the initial instance number will be
   * equal to the maximum existing instance number + 1 (e.g. if there exists an instance with name
   * inst-0030-prod, then the generated names will start with inst-0031-prod). The name pattern
   * placeholder #...# can contain up to 18 characters.
   * @param namePattern namePattern or {@code null} for none
   */
  public BulkInsertInstanceResource setNamePattern(java.lang.String namePattern) {
    this.namePattern = namePattern;
    return this;
  }

  /**
   * List of predefined names. The number of names provided must be equal to count.
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.String> getPredefinedNames() {
    return predefinedNames;
  }

  /**
   * List of predefined names. The number of names provided must be equal to count.
   * @param predefinedNames predefinedNames or {@code null} for none
   */
  public BulkInsertInstanceResource setPredefinedNames(java.util.List<java.lang.String> predefinedNames) {
    this.predefinedNames = predefinedNames;
    return this;
  }

  /**
   * Specifies the instance template from which to create instances. You may combine
   * sourceInstanceTemplate with instanceProperties to override specific values from an existing
   * instance template. Bulk API follows the semantics of JSON Merge Patch described by RFC 7396.
   *
   * It can be a full or partial URL. For example, the following are all valid URLs to an instance
   * template:   - https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/i
   * nstanceTemplate  - projects/project/global/instanceTemplates/instanceTemplate  -
   * global/instanceTemplates/instanceTemplate
   *
   * This field is optional.
   * @return value or {@code null} for none
   */
  public java.lang.String getSourceInstanceTemplate() {
    return sourceInstanceTemplate;
  }

  /**
   * Specifies the instance template from which to create instances. You may combine
   * sourceInstanceTemplate with instanceProperties to override specific values from an existing
   * instance template. Bulk API follows the semantics of JSON Merge Patch described by RFC 7396.
   *
   * It can be a full or partial URL. For example, the following are all valid URLs to an instance
   * template:   - https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/i
   * nstanceTemplate  - projects/project/global/instanceTemplates/instanceTemplate  -
   * global/instanceTemplates/instanceTemplate
   *
   * This field is optional.
   * @param sourceInstanceTemplate sourceInstanceTemplate or {@code null} for none
   */
  public BulkInsertInstanceResource setSourceInstanceTemplate(java.lang.String sourceInstanceTemplate) {
    this.sourceInstanceTemplate = sourceInstanceTemplate;
    return this;
  }

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

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

}
