// SPDX-FileCopyrightText: the secureCodeBox authors
//
// SPDX-License-Identifier: Apache-2.0

/*
 * Kubernetes
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: v1.21.1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package io.securecodebox.models;

import java.util.Objects;
import java.util.Arrays;

import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.securecodebox.models.V1ScanSpecCascadesMatchExpressions;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * CascadeSpec describes how and when cascading scans should be generated.
 */
@ApiModel(description = "CascadeSpec describes how and when cascading scans should be generated.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-11-17T10:13:00.848Z[Etc/UTC]")
public class V1ScanSpecCascades {
  public static final String SERIALIZED_NAME_INHERIT_ANNOTATIONS = "inheritAnnotations";
  @SerializedName(SERIALIZED_NAME_INHERIT_ANNOTATIONS)
  private Boolean inheritAnnotations;

  public static final String SERIALIZED_NAME_INHERIT_ENV = "inheritEnv";
  @SerializedName(SERIALIZED_NAME_INHERIT_ENV)
  private Boolean inheritEnv;

  public static final String SERIALIZED_NAME_INHERIT_HOOK_SELECTOR = "inheritHookSelector";
  @SerializedName(SERIALIZED_NAME_INHERIT_HOOK_SELECTOR)
  private Boolean inheritHookSelector;

  public static final String SERIALIZED_NAME_INHERIT_INIT_CONTAINERS = "inheritInitContainers";
  @SerializedName(SERIALIZED_NAME_INHERIT_INIT_CONTAINERS)
  private Boolean inheritInitContainers;

  public static final String SERIALIZED_NAME_INHERIT_LABELS = "inheritLabels";
  @SerializedName(SERIALIZED_NAME_INHERIT_LABELS)
  private Boolean inheritLabels;

  public static final String SERIALIZED_NAME_INHERIT_VOLUMES = "inheritVolumes";
  @SerializedName(SERIALIZED_NAME_INHERIT_VOLUMES)
  private Boolean inheritVolumes;

  public static final String SERIALIZED_NAME_MATCH_EXPRESSIONS = "matchExpressions";
  @SerializedName(SERIALIZED_NAME_MATCH_EXPRESSIONS)
  private List<V1ScanSpecCascadesMatchExpressions> matchExpressions = null;

  public static final String SERIALIZED_NAME_MATCH_LABELS = "matchLabels";
  @SerializedName(SERIALIZED_NAME_MATCH_LABELS)
  private Map<String, String> matchLabels = null;


  public V1ScanSpecCascades inheritAnnotations(Boolean inheritAnnotations) {

    this.inheritAnnotations = inheritAnnotations;
    return this;
  }

  /**
   * InheritAnnotations defines whether cascading scans should inherit annotations from the parent scan
   *
   * @return inheritAnnotations
   **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "InheritAnnotations defines whether cascading scans should inherit annotations from the parent scan")

  public Boolean getInheritAnnotations() {
    return inheritAnnotations;
  }


  public void setInheritAnnotations(Boolean inheritAnnotations) {
    this.inheritAnnotations = inheritAnnotations;
  }


  public V1ScanSpecCascades inheritEnv(Boolean inheritEnv) {

    this.inheritEnv = inheritEnv;
    return this;
  }

  /**
   * InheritEnv defines whether cascading scans should inherit environment variables from the parent scan
   *
   * @return inheritEnv
   **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "InheritEnv defines whether cascading scans should inherit environment variables from the parent scan")

  public Boolean getInheritEnv() {
    return inheritEnv;
  }


  public void setInheritEnv(Boolean inheritEnv) {
    this.inheritEnv = inheritEnv;
  }


  public V1ScanSpecCascades inheritHookSelector(Boolean inheritHookSelector) {

    this.inheritHookSelector = inheritHookSelector;
    return this;
  }

  /**
   * InheritHookSelector defines whether cascading scans should inherit hookSelector from the parent scan.
   *
   * @return inheritHookSelector
   **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "InheritHookSelector defines whether cascading scans should inherit hookSelector from the parent scan.")

  public Boolean getInheritHookSelector() {
    return inheritHookSelector;
  }


  public void setInheritHookSelector(Boolean inheritHookSelector) {
    this.inheritHookSelector = inheritHookSelector;
  }


  public V1ScanSpecCascades inheritInitContainers(Boolean inheritInitContainers) {

    this.inheritInitContainers = inheritInitContainers;
    return this;
  }

  /**
   * InheritInitContainers defines whether cascading scans should inherit initContainers from the parent scan. Usually only useful when combined with inheritVolumes.
   *
   * @return inheritInitContainers
   **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "InheritInitContainers defines whether cascading scans should inherit initContainers from the parent scan. Usually only useful when combined with inheritVolumes.")

  public Boolean getInheritInitContainers() {
    return inheritInitContainers;
  }


  public void setInheritInitContainers(Boolean inheritInitContainers) {
    this.inheritInitContainers = inheritInitContainers;
  }


  public V1ScanSpecCascades inheritLabels(Boolean inheritLabels) {

    this.inheritLabels = inheritLabels;
    return this;
  }

  /**
   * InheritLabels defines whether cascading scans should inherit labels from the parent scan
   *
   * @return inheritLabels
   **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "InheritLabels defines whether cascading scans should inherit labels from the parent scan")

  public Boolean getInheritLabels() {
    return inheritLabels;
  }


  public void setInheritLabels(Boolean inheritLabels) {
    this.inheritLabels = inheritLabels;
  }


  public V1ScanSpecCascades inheritVolumes(Boolean inheritVolumes) {

    this.inheritVolumes = inheritVolumes;
    return this;
  }

  /**
   * InheritVolumes defines whether cascading scans should inherit volumes and volume mounts from the parent scan
   *
   * @return inheritVolumes
   **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "InheritVolumes defines whether cascading scans should inherit volumes and volume mounts from the parent scan")

  public Boolean getInheritVolumes() {
    return inheritVolumes;
  }


  public void setInheritVolumes(Boolean inheritVolumes) {
    this.inheritVolumes = inheritVolumes;
  }


  public V1ScanSpecCascades matchExpressions(List<V1ScanSpecCascadesMatchExpressions> matchExpressions) {

    this.matchExpressions = matchExpressions;
    return this;
  }

  public V1ScanSpecCascades addMatchExpressionsItem(V1ScanSpecCascadesMatchExpressions matchExpressionsItem) {
    if (this.matchExpressions == null) {
      this.matchExpressions = new ArrayList<>();
    }
    this.matchExpressions.add(matchExpressionsItem);
    return this;
  }

  /**
   * matchExpressions is a list of label selector requirements. The requirements are ANDed.
   *
   * @return matchExpressions
   **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "matchExpressions is a list of label selector requirements. The requirements are ANDed.")

  public List<V1ScanSpecCascadesMatchExpressions> getMatchExpressions() {
    return matchExpressions;
  }


  public void setMatchExpressions(List<V1ScanSpecCascadesMatchExpressions> matchExpressions) {
    this.matchExpressions = matchExpressions;
  }


  public V1ScanSpecCascades matchLabels(Map<String, String> matchLabels) {

    this.matchLabels = matchLabels;
    return this;
  }

  public V1ScanSpecCascades putMatchLabelsItem(String key, String matchLabelsItem) {
    if (this.matchLabels == null) {
      this.matchLabels = new HashMap<>();
    }
    this.matchLabels.put(key, matchLabelsItem);
    return this;
  }

  /**
   * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \&quot;key\&quot;, the operator is \&quot;In\&quot;, and the values array contains only \&quot;value\&quot;. The requirements are ANDed.
   *
   * @return matchLabels
   **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.")

  public Map<String, String> getMatchLabels() {
    return matchLabels;
  }


  public void setMatchLabels(Map<String, String> matchLabels) {
    this.matchLabels = matchLabels;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    V1ScanSpecCascades v1ScanSpecCascades = (V1ScanSpecCascades) o;
    return Objects.equals(this.inheritAnnotations, v1ScanSpecCascades.inheritAnnotations) &&
      Objects.equals(this.inheritEnv, v1ScanSpecCascades.inheritEnv) &&
      Objects.equals(this.inheritHookSelector, v1ScanSpecCascades.inheritHookSelector) &&
      Objects.equals(this.inheritInitContainers, v1ScanSpecCascades.inheritInitContainers) &&
      Objects.equals(this.inheritLabels, v1ScanSpecCascades.inheritLabels) &&
      Objects.equals(this.inheritVolumes, v1ScanSpecCascades.inheritVolumes) &&
      Objects.equals(this.matchExpressions, v1ScanSpecCascades.matchExpressions) &&
      Objects.equals(this.matchLabels, v1ScanSpecCascades.matchLabels);
  }

  @Override
  public int hashCode() {
    return Objects.hash(inheritAnnotations, inheritEnv, inheritHookSelector, inheritInitContainers, inheritLabels, inheritVolumes, matchExpressions, matchLabels);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class V1ScanSpecCascades {\n");
    sb.append("    inheritAnnotations: ").append(toIndentedString(inheritAnnotations)).append("\n");
    sb.append("    inheritEnv: ").append(toIndentedString(inheritEnv)).append("\n");
    sb.append("    inheritHookSelector: ").append(toIndentedString(inheritHookSelector)).append("\n");
    sb.append("    inheritInitContainers: ").append(toIndentedString(inheritInitContainers)).append("\n");
    sb.append("    inheritLabels: ").append(toIndentedString(inheritLabels)).append("\n");
    sb.append("    inheritVolumes: ").append(toIndentedString(inheritVolumes)).append("\n");
    sb.append("    matchExpressions: ").append(toIndentedString(matchExpressions)).append("\n");
    sb.append("    matchLabels: ").append(toIndentedString(matchLabels)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

