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

/**
 * A Release is owned by a Version. A Release contains information about the release(s) of its
 * parent version. This includes when the release began and ended, as well as what percentage it was
 * released at. If the version is released again, or if the serving percentage changes, it will
 * create another release under the version.
 *
 * <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 Version History 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 Release extends com.google.api.client.json.GenericJson {

  /**
   * Rollout fraction. This fraction indicates the fraction of people that should receive this
   * version in this release. If the fraction is not specified in ReleaseManager, the API will
   * assume fraction is 1.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Double fraction;

  /**
   * Rollout fraction group. Only fractions with the same fraction_group are statistically
   * comparable: there may be non-fractional differences between different fraction groups.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long fractionGroup;

  /**
   * Release name. Format is
   * "{product}/platforms/{platform}/channels/{channel}/versions/{version}/releases/{release}"
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String name;

  /**
   * Timestamp interval of when the release was live. If end_time is unspecified, the release is
   * currently live.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Interval serving;

  /**
   * String containing just the version number. e.g. "84.0.4147.38"
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String version;

  /**
   * Rollout fraction. This fraction indicates the fraction of people that should receive this
   * version in this release. If the fraction is not specified in ReleaseManager, the API will
   * assume fraction is 1.
   * @return value or {@code null} for none
   */
  public java.lang.Double getFraction() {
    return fraction;
  }

  /**
   * Rollout fraction. This fraction indicates the fraction of people that should receive this
   * version in this release. If the fraction is not specified in ReleaseManager, the API will
   * assume fraction is 1.
   * @param fraction fraction or {@code null} for none
   */
  public Release setFraction(java.lang.Double fraction) {
    this.fraction = fraction;
    return this;
  }

  /**
   * Rollout fraction group. Only fractions with the same fraction_group are statistically
   * comparable: there may be non-fractional differences between different fraction groups.
   * @return value or {@code null} for none
   */
  public java.lang.Long getFractionGroup() {
    return fractionGroup;
  }

  /**
   * Rollout fraction group. Only fractions with the same fraction_group are statistically
   * comparable: there may be non-fractional differences between different fraction groups.
   * @param fractionGroup fractionGroup or {@code null} for none
   */
  public Release setFractionGroup(java.lang.Long fractionGroup) {
    this.fractionGroup = fractionGroup;
    return this;
  }

  /**
   * Release name. Format is
   * "{product}/platforms/{platform}/channels/{channel}/versions/{version}/releases/{release}"
   * @return value or {@code null} for none
   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * Release name. Format is
   * "{product}/platforms/{platform}/channels/{channel}/versions/{version}/releases/{release}"
   * @param name name or {@code null} for none
   */
  public Release setName(java.lang.String name) {
    this.name = name;
    return this;
  }

  /**
   * Timestamp interval of when the release was live. If end_time is unspecified, the release is
   * currently live.
   * @return value or {@code null} for none
   */
  public Interval getServing() {
    return serving;
  }

  /**
   * Timestamp interval of when the release was live. If end_time is unspecified, the release is
   * currently live.
   * @param serving serving or {@code null} for none
   */
  public Release setServing(Interval serving) {
    this.serving = serving;
    return this;
  }

  /**
   * String containing just the version number. e.g. "84.0.4147.38"
   * @return value or {@code null} for none
   */
  public java.lang.String getVersion() {
    return version;
  }

  /**
   * String containing just the version number. e.g. "84.0.4147.38"
   * @param version version or {@code null} for none
   */
  public Release setVersion(java.lang.String version) {
    this.version = version;
    return this;
  }

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

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

}
