All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clinia.model.registry.V1ResourceOperationCreateAllOfCreate Maven / Gradle / Ivy

// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost
// - read more on https://github.com/clinia/api-clients-generation. DO NOT EDIT.

package com.clinia.model.registry;

import com.clinia.model.common.*;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/** The resource to create. */
@JsonTypeInfo(
  use = JsonTypeInfo.Id.NAME,
  include = JsonTypeInfo.As.EXISTING_PROPERTY,
  property = "type",
  visible = true,
  defaultImpl = V1ResourceOperationCreateAllOfCreate.class
)
public class V1ResourceOperationCreateAllOfCreate {

  @JsonProperty("id")
  private String id;

  @JsonProperty("type")
  private String type;

  @JsonProperty("data")
  private T data;

  @JsonProperty("contained")
  private Map> contained;

  @JsonProperty("meta")
  private V1Meta meta;

  public V1ResourceOperationCreateAllOfCreate setId(String id) {
    this.id = id;
    return this;
  }

  /**
   * Id of the resource to create (optional). When not provided or equal to the special `@rootId`
   * token (only allowed when contained is provided), the id will be generated. When provided and
   * not equal to `@rootId`, id must follow pattern: `^[a-zA-Z0-9-][\\w-]{1,92}$`. Note: - The
   * `@rootId` token can be used in any properties of type `reference` and, when provided, will be
   * replaced by the actual id of the created resource.
   */
  @javax.annotation.Nullable
  public String getId() {
    return id;
  }

  public V1ResourceOperationCreateAllOfCreate setType(String type) {
    this.type = type;
    return this;
  }

  /** The type of resource to create. */
  @javax.annotation.Nonnull
  public String getType() {
    return type;
  }

  public V1ResourceOperationCreateAllOfCreate setData(T data) {
    this.data = data;
    return this;
  }

  /** Dynamic data attributes, based on the resource type. */
  @javax.annotation.Nonnull
  public T getData() {
    return data;
  }

  public V1ResourceOperationCreateAllOfCreate setContained(Map> contained) {
    this.contained = contained;
    return this;
  }

  public V1ResourceOperationCreateAllOfCreate putContained(String key, List containedItem) {
    if (this.contained == null) {
      this.contained = new HashMap<>();
    }
    this.contained.put(key, containedItem);
    return this;
  }

  /**
   * Resources contained in this top-level resource. Contained resources exists only within the
   * context of this top-level resource.
   */
  @javax.annotation.Nullable
  public Map> getContained() {
    return contained;
  }

  public V1ResourceOperationCreateAllOfCreate setMeta(V1Meta meta) {
    this.meta = meta;
    return this;
  }

  /** Get meta */
  @javax.annotation.Nullable
  public V1Meta getMeta() {
    return meta;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    V1ResourceOperationCreateAllOfCreate v1ResourceOperationCreateAllOfCreate = (V1ResourceOperationCreateAllOfCreate) o;
    return (
      Objects.equals(this.id, v1ResourceOperationCreateAllOfCreate.id) &&
      Objects.equals(this.type, v1ResourceOperationCreateAllOfCreate.type) &&
      Objects.equals(this.data, v1ResourceOperationCreateAllOfCreate.data) &&
      Objects.equals(this.contained, v1ResourceOperationCreateAllOfCreate.contained) &&
      Objects.equals(this.meta, v1ResourceOperationCreateAllOfCreate.meta)
    );
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, type, data, contained, meta);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class V1ResourceOperationCreateAllOfCreate {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    data: ").append(toIndentedString(data)).append("\n");
    sb.append("    contained: ").append(toIndentedString(contained)).append("\n");
    sb.append("    meta: ").append(toIndentedString(meta)).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    ");
  }
}