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

io.swagger.client.model.NotificationRule Maven / Gradle / Ivy

There is a newer version: 5.3.0
Show newest version
/*
 * finAPI RESTful Services
 * finAPI RESTful Services
 *
 * OpenAPI spec version: v1.64.0
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */


package io.swagger.client.model;

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.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Data of notification rule
 */
@ApiModel(description = "Data of notification rule")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-02-05T12:19:21.458Z")
public class NotificationRule {
  @SerializedName("id")
  private Long id = null;

  /**
   * Trigger event type
   */
  @JsonAdapter(TriggerEventEnum.Adapter.class)
  public enum TriggerEventEnum {
    NEW_ACCOUNT_BALANCE("NEW_ACCOUNT_BALANCE"),
    
    NEW_TRANSACTIONS("NEW_TRANSACTIONS"),
    
    BANK_LOGIN_ERROR("BANK_LOGIN_ERROR"),
    
    FOREIGN_MONEY_TRANSFER("FOREIGN_MONEY_TRANSFER"),
    
    LOW_ACCOUNT_BALANCE("LOW_ACCOUNT_BALANCE"),
    
    HIGH_TRANSACTION_AMOUNT("HIGH_TRANSACTION_AMOUNT"),
    
    CATEGORY_CASH_FLOW("CATEGORY_CASH_FLOW"),
    
    NEW_TERMS_AND_CONDITIONS("NEW_TERMS_AND_CONDITIONS");

    private String value;

    TriggerEventEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static TriggerEventEnum fromValue(String text) {
      for (TriggerEventEnum b : TriggerEventEnum.values()) {
        if (String.valueOf(b.value).equals(text)) {
          return b;
        }
      }
      return null;
    }

    public static class Adapter extends TypeAdapter {
      @Override
      public void write(final JsonWriter jsonWriter, final TriggerEventEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public TriggerEventEnum read(final JsonReader jsonReader) throws IOException {
        String value = jsonReader.nextString();
        return TriggerEventEnum.fromValue(String.valueOf(value));
      }
    }
  }

  @SerializedName("triggerEvent")
  private TriggerEventEnum triggerEvent = null;

  @SerializedName("params")
  private Map params = null;

  @SerializedName("callbackHandle")
  private String callbackHandle = null;

  @SerializedName("includeDetails")
  private Boolean includeDetails = null;

  public NotificationRule id(Long id) {
    this.id = id;
    return this;
  }

   /**
   * Notification rule identifier
   * @return id
  **/
  @ApiModelProperty(example = "1", required = true, value = "Notification rule identifier")
  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public NotificationRule triggerEvent(TriggerEventEnum triggerEvent) {
    this.triggerEvent = triggerEvent;
    return this;
  }

   /**
   * Trigger event type
   * @return triggerEvent
  **/
  @ApiModelProperty(example = "NEW_ACCOUNT_BALANCE", required = true, value = "Trigger event type")
  public TriggerEventEnum getTriggerEvent() {
    return triggerEvent;
  }

  public void setTriggerEvent(TriggerEventEnum triggerEvent) {
    this.triggerEvent = triggerEvent;
  }

  public NotificationRule params(Map params) {
    this.params = params;
    return this;
  }

  public NotificationRule putParamsItem(String key, String paramsItem) {
    if (this.params == null) {
      this.params = new HashMap();
    }
    this.params.put(key, paramsItem);
    return this;
  }

   /**
   * Additional parameters that are specific to the trigger event type. Please refer to the documentation for details.
   * @return params
  **/
  @ApiModelProperty(example = "{\"accountIds\":\"1,2,3\"}", value = "Additional parameters that are specific to the trigger event type. Please refer to the documentation for details.")
  public Map getParams() {
    return params;
  }

  public void setParams(Map params) {
    this.params = params;
  }

  public NotificationRule callbackHandle(String callbackHandle) {
    this.callbackHandle = callbackHandle;
    return this;
  }

   /**
   * The string that finAPI includes into the notifications that it sends based on this rule.
   * @return callbackHandle
  **/
  @ApiModelProperty(example = "handle", value = "The string that finAPI includes into the notifications that it sends based on this rule.")
  public String getCallbackHandle() {
    return callbackHandle;
  }

  public void setCallbackHandle(String callbackHandle) {
    this.callbackHandle = callbackHandle;
  }

  public NotificationRule includeDetails(Boolean includeDetails) {
    this.includeDetails = includeDetails;
    return this;
  }

   /**
   * Whether the notification messages that will be sent based on this rule contain encrypted detailed data or not
   * @return includeDetails
  **/
  @ApiModelProperty(example = "true", required = true, value = "Whether the notification messages that will be sent based on this rule contain encrypted detailed data or not")
  public Boolean isIncludeDetails() {
    return includeDetails;
  }

  public void setIncludeDetails(Boolean includeDetails) {
    this.includeDetails = includeDetails;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    NotificationRule notificationRule = (NotificationRule) o;
    return Objects.equals(this.id, notificationRule.id) &&
        Objects.equals(this.triggerEvent, notificationRule.triggerEvent) &&
        Objects.equals(this.params, notificationRule.params) &&
        Objects.equals(this.callbackHandle, notificationRule.callbackHandle) &&
        Objects.equals(this.includeDetails, notificationRule.includeDetails);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, triggerEvent, params, callbackHandle, includeDetails);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class NotificationRule {\n");
    
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    triggerEvent: ").append(toIndentedString(triggerEvent)).append("\n");
    sb.append("    params: ").append(toIndentedString(params)).append("\n");
    sb.append("    callbackHandle: ").append(toIndentedString(callbackHandle)).append("\n");
    sb.append("    includeDetails: ").append(toIndentedString(includeDetails)).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(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy