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

com.dominodatalab.api.model.DominoNotificationsUserNotification Maven / Gradle / Ivy

/*
 * Domino Data Lab API v4
 * This API is going to provide access to all the Domino functions available in the user interface. To authenticate your requests, include your API Key (which you can find on your account page) with the header X-Domino-Api-Key. 
 *
 * The version of the OpenAPI document: 4.0.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.dominodatalab.api.model;

import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.StringJoiner;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.dominodatalab.api.model.DominoNotificationsNotification;
import com.dominodatalab.api.model.DominoNotificationsTimeframe;
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;


/**
 * DominoNotificationsUserNotification
 */
@JsonPropertyOrder({
  DominoNotificationsUserNotification.JSON_PROPERTY_NOTIFICATION,
  DominoNotificationsUserNotification.JSON_PROPERTY_TIMEFRAME,
  DominoNotificationsUserNotification.JSON_PROPERTY_READ,
  DominoNotificationsUserNotification.JSON_PROPERTY_EXPIRED
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-17T15:20:46.682098100-04:00[America/New_York]")
public class DominoNotificationsUserNotification {
  public static final String JSON_PROPERTY_NOTIFICATION = "notification";
  private DominoNotificationsNotification notification;

  public static final String JSON_PROPERTY_TIMEFRAME = "timeframe";
  private DominoNotificationsTimeframe timeframe;

  public static final String JSON_PROPERTY_READ = "read";
  private Boolean read;

  public static final String JSON_PROPERTY_EXPIRED = "expired";
  private Boolean expired;

  public DominoNotificationsUserNotification() { 
  }

  public DominoNotificationsUserNotification notification(DominoNotificationsNotification notification) {
    this.notification = notification;
    return this;
  }

   /**
   * Get notification
   * @return notification
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_NOTIFICATION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public DominoNotificationsNotification getNotification() {
    return notification;
  }


  @JsonProperty(JSON_PROPERTY_NOTIFICATION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setNotification(DominoNotificationsNotification notification) {
    this.notification = notification;
  }


  public DominoNotificationsUserNotification timeframe(DominoNotificationsTimeframe timeframe) {
    this.timeframe = timeframe;
    return this;
  }

   /**
   * Get timeframe
   * @return timeframe
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_TIMEFRAME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public DominoNotificationsTimeframe getTimeframe() {
    return timeframe;
  }


  @JsonProperty(JSON_PROPERTY_TIMEFRAME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setTimeframe(DominoNotificationsTimeframe timeframe) {
    this.timeframe = timeframe;
  }


  public DominoNotificationsUserNotification read(Boolean read) {
    this.read = read;
    return this;
  }

   /**
   * has this notification been read by the current user?
   * @return read
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_READ)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Boolean getRead() {
    return read;
  }


  @JsonProperty(JSON_PROPERTY_READ)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setRead(Boolean read) {
    this.read = read;
  }


  public DominoNotificationsUserNotification expired(Boolean expired) {
    this.expired = expired;
    return this;
  }

   /**
   * has this notification expired?
   * @return expired
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_EXPIRED)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Boolean getExpired() {
    return expired;
  }


  @JsonProperty(JSON_PROPERTY_EXPIRED)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setExpired(Boolean expired) {
    this.expired = expired;
  }


  /**
   * Return true if this domino.notifications.UserNotification object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DominoNotificationsUserNotification dominoNotificationsUserNotification = (DominoNotificationsUserNotification) o;
    return Objects.equals(this.notification, dominoNotificationsUserNotification.notification) &&
        Objects.equals(this.timeframe, dominoNotificationsUserNotification.timeframe) &&
        Objects.equals(this.read, dominoNotificationsUserNotification.read) &&
        Objects.equals(this.expired, dominoNotificationsUserNotification.expired);
  }

  @Override
  public int hashCode() {
    return Objects.hash(notification, timeframe, read, expired);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class DominoNotificationsUserNotification {\n");
    sb.append("    notification: ").append(toIndentedString(notification)).append("\n");
    sb.append("    timeframe: ").append(toIndentedString(timeframe)).append("\n");
    sb.append("    read: ").append(toIndentedString(read)).append("\n");
    sb.append("    expired: ").append(toIndentedString(expired)).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    ");
  }

  /**
   * Convert the instance into URL query string.
   *
   * @return URL query string
   */
  public String toUrlQueryString() {
    return toUrlQueryString(null);
  }

  /**
   * Convert the instance into URL query string.
   *
   * @param prefix prefix of the query string
   * @return URL query string
   */
  public String toUrlQueryString(String prefix) {
    String suffix = "";
    String containerSuffix = "";
    String containerPrefix = "";
    if (prefix == null) {
      // style=form, explode=true, e.g. /pet?name=cat&type=manx
      prefix = "";
    } else {
      // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
      prefix = prefix + "[";
      suffix = "]";
      containerSuffix = "]";
      containerPrefix = "[";
    }

    StringJoiner joiner = new StringJoiner("&");

    // add `notification` to the URL query string
    if (getNotification() != null) {
      joiner.add(getNotification().toUrlQueryString(prefix + "notification" + suffix));
    }

    // add `timeframe` to the URL query string
    if (getTimeframe() != null) {
      joiner.add(getTimeframe().toUrlQueryString(prefix + "timeframe" + suffix));
    }

    // add `read` to the URL query string
    if (getRead() != null) {
      joiner.add(String.format("%sread%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRead()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `expired` to the URL query string
    if (getExpired() != null) {
      joiner.add(String.format("%sexpired%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getExpired()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    return joiner.toString();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy