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

com.github.tjake.jlama.net.openai.model.Image Maven / Gradle / Ivy

There is a newer version: 0.4.1
Show newest version
/*
 * OpenAI API
 * The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
 *
 * The version of the OpenAPI document: 2.1.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.github.tjake.jlama.net.openai.model;

import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import org.hibernate.validator.constraints.*;
import com.github.tjake.jlama.net.openai.JSON;


/**
 * Represents the url or the content of an image generated by the OpenAI API.
 */
@JsonPropertyOrder({
  Image.JSON_PROPERTY_B64_JSON,
  Image.JSON_PROPERTY_URL,
  Image.JSON_PROPERTY_REVISED_PROMPT
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0")
public class Image {
  public static final String JSON_PROPERTY_B64_JSON = "b64_json";
  private String b64Json;

  public static final String JSON_PROPERTY_URL = "url";
  private String url;

  public static final String JSON_PROPERTY_REVISED_PROMPT = "revised_prompt";
  private String revisedPrompt;

  public Image() { 
  }

  public Image b64Json(String b64Json) {
    this.b64Json = b64Json;
    return this;
  }

  /**
   * The base64-encoded JSON of the generated image, if `response_format` is `b64_json`.
   * @return b64Json
   */
  @jakarta.annotation.Nullable

  @JsonProperty(JSON_PROPERTY_B64_JSON)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getB64Json() {
    return b64Json;
  }


  @JsonProperty(JSON_PROPERTY_B64_JSON)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setB64Json(String b64Json) {
    this.b64Json = b64Json;
  }


  public Image url(String url) {
    this.url = url;
    return this;
  }

  /**
   * The URL of the generated image, if `response_format` is `url` (default).
   * @return url
   */
  @jakarta.annotation.Nullable

  @JsonProperty(JSON_PROPERTY_URL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getUrl() {
    return url;
  }


  @JsonProperty(JSON_PROPERTY_URL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setUrl(String url) {
    this.url = url;
  }


  public Image revisedPrompt(String revisedPrompt) {
    this.revisedPrompt = revisedPrompt;
    return this;
  }

  /**
   * The prompt that was used to generate the image, if there was any revision to the prompt.
   * @return revisedPrompt
   */
  @jakarta.annotation.Nullable

  @JsonProperty(JSON_PROPERTY_REVISED_PROMPT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getRevisedPrompt() {
    return revisedPrompt;
  }


  @JsonProperty(JSON_PROPERTY_REVISED_PROMPT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setRevisedPrompt(String revisedPrompt) {
    this.revisedPrompt = revisedPrompt;
  }


  /**
   * Return true if this Image object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Image image = (Image) o;
    return Objects.equals(this.b64Json, image.b64Json) &&
        Objects.equals(this.url, image.url) &&
        Objects.equals(this.revisedPrompt, image.revisedPrompt);
  }

  @Override
  public int hashCode() {
    return Objects.hash(b64Json, url, revisedPrompt);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Image {\n");
    sb.append("    b64Json: ").append(toIndentedString(b64Json)).append("\n");
    sb.append("    url: ").append(toIndentedString(url)).append("\n");
    sb.append("    revisedPrompt: ").append(toIndentedString(revisedPrompt)).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    ");
  }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy