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

/**
 * **ClusterUpgrade**: The configuration for the scope-level ClusterUpgrade feature.
 *
 * <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 GKE Hub 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 ClusterUpgradeScopeSpec extends com.google.api.client.json.GenericJson {

  /**
   * Allow users to override some properties of each GKE upgrade.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<ClusterUpgradeGKEUpgradeOverride> gkeUpgradeOverrides;

  static {
    // hack to force ProGuard to consider ClusterUpgradeGKEUpgradeOverride 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(ClusterUpgradeGKEUpgradeOverride.class);
  }

  /**
   * Required. Post conditions to evaluate to mark an upgrade COMPLETE. Required.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private ClusterUpgradePostConditions postConditions;

  /**
   * This scope consumes upgrades that have COMPLETE status code in the upstream scopes. See
   * UpgradeStatus.Code for code definitions. The scope name should be in the form:
   * `projects/{p}/locations/global/scopes/{s}` Where {p} is the project, {s} is a valid Scope in
   * this project. {p} WILL match the Feature's project. This is defined as repeated for future
   * proof reasons. Initial implementation will enforce at most one upstream scope.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<java.lang.String> upstreamScopes;

  /**
   * Allow users to override some properties of each GKE upgrade.
   * @return value or {@code null} for none
   */
  public java.util.List<ClusterUpgradeGKEUpgradeOverride> getGkeUpgradeOverrides() {
    return gkeUpgradeOverrides;
  }

  /**
   * Allow users to override some properties of each GKE upgrade.
   * @param gkeUpgradeOverrides gkeUpgradeOverrides or {@code null} for none
   */
  public ClusterUpgradeScopeSpec setGkeUpgradeOverrides(java.util.List<ClusterUpgradeGKEUpgradeOverride> gkeUpgradeOverrides) {
    this.gkeUpgradeOverrides = gkeUpgradeOverrides;
    return this;
  }

  /**
   * Required. Post conditions to evaluate to mark an upgrade COMPLETE. Required.
   * @return value or {@code null} for none
   */
  public ClusterUpgradePostConditions getPostConditions() {
    return postConditions;
  }

  /**
   * Required. Post conditions to evaluate to mark an upgrade COMPLETE. Required.
   * @param postConditions postConditions or {@code null} for none
   */
  public ClusterUpgradeScopeSpec setPostConditions(ClusterUpgradePostConditions postConditions) {
    this.postConditions = postConditions;
    return this;
  }

  /**
   * This scope consumes upgrades that have COMPLETE status code in the upstream scopes. See
   * UpgradeStatus.Code for code definitions. The scope name should be in the form:
   * `projects/{p}/locations/global/scopes/{s}` Where {p} is the project, {s} is a valid Scope in
   * this project. {p} WILL match the Feature's project. This is defined as repeated for future
   * proof reasons. Initial implementation will enforce at most one upstream scope.
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.String> getUpstreamScopes() {
    return upstreamScopes;
  }

  /**
   * This scope consumes upgrades that have COMPLETE status code in the upstream scopes. See
   * UpgradeStatus.Code for code definitions. The scope name should be in the form:
   * `projects/{p}/locations/global/scopes/{s}` Where {p} is the project, {s} is a valid Scope in
   * this project. {p} WILL match the Feature's project. This is defined as repeated for future
   * proof reasons. Initial implementation will enforce at most one upstream scope.
   * @param upstreamScopes upstreamScopes or {@code null} for none
   */
  public ClusterUpgradeScopeSpec setUpstreamScopes(java.util.List<java.lang.String> upstreamScopes) {
    this.upstreamScopes = upstreamScopes;
    return this;
  }

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

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

}
