/*
 * Swagger of Opencellsoft Api
 * @#Introduction
 *
 * The version of the OpenAPI document: 7.3.1-SNAPSHOT
 * Contact: contact@opencellsoft.fr
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.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;

/**
 * WebHookDto
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2019-09-13T10:03:17.753Z[GMT]")
public class WebHookDto {
  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private Long id;

  public static final String SERIALIZED_NAME_CODE = "code";
  @SerializedName(SERIALIZED_NAME_CODE)
  private String code;

  public static final String SERIALIZED_NAME_DESCRIPTION = "description";
  @SerializedName(SERIALIZED_NAME_DESCRIPTION)
  private String description;

  public static final String SERIALIZED_NAME_UPDATED_CODE = "updatedCode";
  @SerializedName(SERIALIZED_NAME_UPDATED_CODE)
  private String updatedCode;

  public static final String SERIALIZED_NAME_DISABLED = "disabled";
  @SerializedName(SERIALIZED_NAME_DISABLED)
  private Boolean disabled;

  public static final String SERIALIZED_NAME_CLASS_NAME_FILTER = "classNameFilter";
  @SerializedName(SERIALIZED_NAME_CLASS_NAME_FILTER)
  private String classNameFilter;

  /**
   * Gets or Sets eventTypeFilter
   */
  @JsonAdapter(EventTypeFilterEnum.Adapter.class)
  public enum EventTypeFilterEnum {
    CREATED("CREATED"),
    
    UPDATED("UPDATED"),
    
    REMOVED("REMOVED"),
    
    TERMINATED("TERMINATED"),
    
    DISABLED("DISABLED"),
    
    PROCESSED("PROCESSED"),
    
    REJECTED("REJECTED"),
    
    REJECTED_CDR("REJECTED_CDR"),
    
    LOGGED_IN("LOGGED_IN"),
    
    INBOUND_REQ("INBOUND_REQ"),
    
    ENABLED("ENABLED"),
    
    LOW_BALANCE("LOW_BALANCE"),
    
    FILE_UPLOAD("FILE_UPLOAD"),
    
    FILE_DOWNLOAD("FILE_DOWNLOAD"),
    
    FILE_RENAME("FILE_RENAME"),
    
    FILE_DELETE("FILE_DELETE"),
    
    COUNTER_DEDUCED("COUNTER_DEDUCED"),
    
    END_OF_TERM("END_OF_TERM"),
    
    STATUS_UPDATED("STATUS_UPDATED"),
    
    RENEWAL_UPDATED("RENEWAL_UPDATED");

    private String value;

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

    public String getValue() {
      return value;
    }

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

    public static EventTypeFilterEnum fromValue(String value) {
      for (EventTypeFilterEnum b : EventTypeFilterEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

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

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

  public static final String SERIALIZED_NAME_EVENT_TYPE_FILTER = "eventTypeFilter";
  @SerializedName(SERIALIZED_NAME_EVENT_TYPE_FILTER)
  private EventTypeFilterEnum eventTypeFilter;

  public static final String SERIALIZED_NAME_EL_FILTER = "elFilter";
  @SerializedName(SERIALIZED_NAME_EL_FILTER)
  private String elFilter;

  public static final String SERIALIZED_NAME_SCRIPT_INSTANCE_CODE = "scriptInstanceCode";
  @SerializedName(SERIALIZED_NAME_SCRIPT_INSTANCE_CODE)
  private String scriptInstanceCode;

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

  public static final String SERIALIZED_NAME_COUNTER_TEMPLATE = "counterTemplate";
  @SerializedName(SERIALIZED_NAME_COUNTER_TEMPLATE)
  private String counterTemplate;

  public static final String SERIALIZED_NAME_PRIORITY = "priority";
  @SerializedName(SERIALIZED_NAME_PRIORITY)
  private Integer priority;

  public static final String SERIALIZED_NAME_ACTIVE = "active";
  @SerializedName(SERIALIZED_NAME_ACTIVE)
  private Boolean active;

  public static final String SERIALIZED_NAME_RUN_ASYNC = "runAsync";
  @SerializedName(SERIALIZED_NAME_RUN_ASYNC)
  private Boolean runAsync;

  /**
   * Gets or Sets httpProtocol
   */
  @JsonAdapter(HttpProtocolEnum.Adapter.class)
  public enum HttpProtocolEnum {
    HTTPS("HTTPS"),
    
    HTTP("HTTP");

    private String value;

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

    public String getValue() {
      return value;
    }

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

    public static HttpProtocolEnum fromValue(String value) {
      for (HttpProtocolEnum b : HttpProtocolEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

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

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

  public static final String SERIALIZED_NAME_HTTP_PROTOCOL = "httpProtocol";
  @SerializedName(SERIALIZED_NAME_HTTP_PROTOCOL)
  private HttpProtocolEnum httpProtocol;

  public static final String SERIALIZED_NAME_HOST = "host";
  @SerializedName(SERIALIZED_NAME_HOST)
  private String host;

  public static final String SERIALIZED_NAME_PORT = "port";
  @SerializedName(SERIALIZED_NAME_PORT)
  private Integer port;

  public static final String SERIALIZED_NAME_PAGE = "page";
  @SerializedName(SERIALIZED_NAME_PAGE)
  private String page;

  /**
   * Gets or Sets httpMethod
   */
  @JsonAdapter(HttpMethodEnum.Adapter.class)
  public enum HttpMethodEnum {
    GET("HTTP_GET"),
    
    POST("HTTP_POST"),
    
    PUT("HTTP_PUT"),
    
    DELETE("HTTP_DELETE");

    private String value;

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

    public String getValue() {
      return value;
    }

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

    public static HttpMethodEnum fromValue(String value) {
      for (HttpMethodEnum b : HttpMethodEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

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

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

  public static final String SERIALIZED_NAME_HTTP_METHOD = "httpMethod";
  @SerializedName(SERIALIZED_NAME_HTTP_METHOD)
  private HttpMethodEnum httpMethod;

  public static final String SERIALIZED_NAME_USERNAME = "username";
  @SerializedName(SERIALIZED_NAME_USERNAME)
  private String username;

  public static final String SERIALIZED_NAME_PASSWORD = "password";
  @SerializedName(SERIALIZED_NAME_PASSWORD)
  private String password;

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

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


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

   /**
   * Get id
   * @return id
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Long getId() {
    return id;
  }



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


  public WebHookDto code(String code) {
    
    this.code = code;
    return this;
  }

   /**
   * Get code
   * @return code
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getCode() {
    return code;
  }



  public void setCode(String code) {
    this.code = code;
  }


  public WebHookDto description(String description) {
    
    this.description = description;
    return this;
  }

   /**
   * Get description
   * @return description
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getDescription() {
    return description;
  }



  public void setDescription(String description) {
    this.description = description;
  }


  public WebHookDto updatedCode(String updatedCode) {
    
    this.updatedCode = updatedCode;
    return this;
  }

   /**
   * Get updatedCode
   * @return updatedCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getUpdatedCode() {
    return updatedCode;
  }



  public void setUpdatedCode(String updatedCode) {
    this.updatedCode = updatedCode;
  }


  public WebHookDto disabled(Boolean disabled) {
    
    this.disabled = disabled;
    return this;
  }

   /**
   * Get disabled
   * @return disabled
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getDisabled() {
    return disabled;
  }



  public void setDisabled(Boolean disabled) {
    this.disabled = disabled;
  }


  public WebHookDto classNameFilter(String classNameFilter) {
    
    this.classNameFilter = classNameFilter;
    return this;
  }

   /**
   * Get classNameFilter
   * @return classNameFilter
  **/
  @ApiModelProperty(required = true, value = "")

  public String getClassNameFilter() {
    return classNameFilter;
  }



  public void setClassNameFilter(String classNameFilter) {
    this.classNameFilter = classNameFilter;
  }


  public WebHookDto eventTypeFilter(EventTypeFilterEnum eventTypeFilter) {
    
    this.eventTypeFilter = eventTypeFilter;
    return this;
  }

   /**
   * Get eventTypeFilter
   * @return eventTypeFilter
  **/
  @ApiModelProperty(required = true, value = "")

  public EventTypeFilterEnum getEventTypeFilter() {
    return eventTypeFilter;
  }



  public void setEventTypeFilter(EventTypeFilterEnum eventTypeFilter) {
    this.eventTypeFilter = eventTypeFilter;
  }


  public WebHookDto elFilter(String elFilter) {
    
    this.elFilter = elFilter;
    return this;
  }

   /**
   * Get elFilter
   * @return elFilter
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getElFilter() {
    return elFilter;
  }



  public void setElFilter(String elFilter) {
    this.elFilter = elFilter;
  }


  public WebHookDto scriptInstanceCode(String scriptInstanceCode) {
    
    this.scriptInstanceCode = scriptInstanceCode;
    return this;
  }

   /**
   * Get scriptInstanceCode
   * @return scriptInstanceCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getScriptInstanceCode() {
    return scriptInstanceCode;
  }



  public void setScriptInstanceCode(String scriptInstanceCode) {
    this.scriptInstanceCode = scriptInstanceCode;
  }


  public WebHookDto scriptParams(Map<String, String> scriptParams) {
    
    this.scriptParams = scriptParams;
    return this;
  }

  public WebHookDto putScriptParamsItem(String key, String scriptParamsItem) {
    if (this.scriptParams == null) {
      this.scriptParams = new HashMap<String, String>();
    }
    this.scriptParams.put(key, scriptParamsItem);
    return this;
  }

   /**
   * Get scriptParams
   * @return scriptParams
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Map<String, String> getScriptParams() {
    return scriptParams;
  }



  public void setScriptParams(Map<String, String> scriptParams) {
    this.scriptParams = scriptParams;
  }


  public WebHookDto counterTemplate(String counterTemplate) {
    
    this.counterTemplate = counterTemplate;
    return this;
  }

   /**
   * Get counterTemplate
   * @return counterTemplate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getCounterTemplate() {
    return counterTemplate;
  }



  public void setCounterTemplate(String counterTemplate) {
    this.counterTemplate = counterTemplate;
  }


  public WebHookDto priority(Integer priority) {
    
    this.priority = priority;
    return this;
  }

   /**
   * Get priority
   * @return priority
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Integer getPriority() {
    return priority;
  }



  public void setPriority(Integer priority) {
    this.priority = priority;
  }


  public WebHookDto active(Boolean active) {
    
    this.active = active;
    return this;
  }

   /**
   * Get active
   * @return active
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getActive() {
    return active;
  }



  public void setActive(Boolean active) {
    this.active = active;
  }


  public WebHookDto runAsync(Boolean runAsync) {
    
    this.runAsync = runAsync;
    return this;
  }

   /**
   * Get runAsync
   * @return runAsync
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getRunAsync() {
    return runAsync;
  }



  public void setRunAsync(Boolean runAsync) {
    this.runAsync = runAsync;
  }


  public WebHookDto httpProtocol(HttpProtocolEnum httpProtocol) {
    
    this.httpProtocol = httpProtocol;
    return this;
  }

   /**
   * Get httpProtocol
   * @return httpProtocol
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public HttpProtocolEnum getHttpProtocol() {
    return httpProtocol;
  }



  public void setHttpProtocol(HttpProtocolEnum httpProtocol) {
    this.httpProtocol = httpProtocol;
  }


  public WebHookDto host(String host) {
    
    this.host = host;
    return this;
  }

   /**
   * Get host
   * @return host
  **/
  @ApiModelProperty(required = true, value = "")

  public String getHost() {
    return host;
  }



  public void setHost(String host) {
    this.host = host;
  }


  public WebHookDto port(Integer port) {
    
    this.port = port;
    return this;
  }

   /**
   * Get port
   * @return port
  **/
  @ApiModelProperty(required = true, value = "")

  public Integer getPort() {
    return port;
  }



  public void setPort(Integer port) {
    this.port = port;
  }


  public WebHookDto page(String page) {
    
    this.page = page;
    return this;
  }

   /**
   * Get page
   * @return page
  **/
  @ApiModelProperty(required = true, value = "")

  public String getPage() {
    return page;
  }



  public void setPage(String page) {
    this.page = page;
  }


  public WebHookDto httpMethod(HttpMethodEnum httpMethod) {
    
    this.httpMethod = httpMethod;
    return this;
  }

   /**
   * Get httpMethod
   * @return httpMethod
  **/
  @ApiModelProperty(required = true, value = "")

  public HttpMethodEnum getHttpMethod() {
    return httpMethod;
  }



  public void setHttpMethod(HttpMethodEnum httpMethod) {
    this.httpMethod = httpMethod;
  }


  public WebHookDto username(String username) {
    
    this.username = username;
    return this;
  }

   /**
   * Get username
   * @return username
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getUsername() {
    return username;
  }



  public void setUsername(String username) {
    this.username = username;
  }


  public WebHookDto password(String password) {
    
    this.password = password;
    return this;
  }

   /**
   * Get password
   * @return password
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getPassword() {
    return password;
  }



  public void setPassword(String password) {
    this.password = password;
  }


  public WebHookDto headers(Map<String, String> headers) {
    
    this.headers = headers;
    return this;
  }

  public WebHookDto putHeadersItem(String key, String headersItem) {
    if (this.headers == null) {
      this.headers = new HashMap<String, String>();
    }
    this.headers.put(key, headersItem);
    return this;
  }

   /**
   * Get headers
   * @return headers
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Map<String, String> getHeaders() {
    return headers;
  }



  public void setHeaders(Map<String, String> headers) {
    this.headers = headers;
  }


  public WebHookDto params(Map<String, String> params) {
    
    this.params = params;
    return this;
  }

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

   /**
   * Get params
   * @return params
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Map<String, String> getParams() {
    return params;
  }



  public void setParams(Map<String, String> params) {
    this.params = params;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    WebHookDto webHookDto = (WebHookDto) o;
    return Objects.equals(this.id, webHookDto.id) &&
        Objects.equals(this.code, webHookDto.code) &&
        Objects.equals(this.description, webHookDto.description) &&
        Objects.equals(this.updatedCode, webHookDto.updatedCode) &&
        Objects.equals(this.disabled, webHookDto.disabled) &&
        Objects.equals(this.classNameFilter, webHookDto.classNameFilter) &&
        Objects.equals(this.eventTypeFilter, webHookDto.eventTypeFilter) &&
        Objects.equals(this.elFilter, webHookDto.elFilter) &&
        Objects.equals(this.scriptInstanceCode, webHookDto.scriptInstanceCode) &&
        Objects.equals(this.scriptParams, webHookDto.scriptParams) &&
        Objects.equals(this.counterTemplate, webHookDto.counterTemplate) &&
        Objects.equals(this.priority, webHookDto.priority) &&
        Objects.equals(this.active, webHookDto.active) &&
        Objects.equals(this.runAsync, webHookDto.runAsync) &&
        Objects.equals(this.httpProtocol, webHookDto.httpProtocol) &&
        Objects.equals(this.host, webHookDto.host) &&
        Objects.equals(this.port, webHookDto.port) &&
        Objects.equals(this.page, webHookDto.page) &&
        Objects.equals(this.httpMethod, webHookDto.httpMethod) &&
        Objects.equals(this.username, webHookDto.username) &&
        Objects.equals(this.password, webHookDto.password) &&
        Objects.equals(this.headers, webHookDto.headers) &&
        Objects.equals(this.params, webHookDto.params);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, code, description, updatedCode, disabled, classNameFilter, eventTypeFilter, elFilter, scriptInstanceCode, scriptParams, counterTemplate, priority, active, runAsync, httpProtocol, host, port, page, httpMethod, username, password, headers, params);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class WebHookDto {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    updatedCode: ").append(toIndentedString(updatedCode)).append("\n");
    sb.append("    disabled: ").append(toIndentedString(disabled)).append("\n");
    sb.append("    classNameFilter: ").append(toIndentedString(classNameFilter)).append("\n");
    sb.append("    eventTypeFilter: ").append(toIndentedString(eventTypeFilter)).append("\n");
    sb.append("    elFilter: ").append(toIndentedString(elFilter)).append("\n");
    sb.append("    scriptInstanceCode: ").append(toIndentedString(scriptInstanceCode)).append("\n");
    sb.append("    scriptParams: ").append(toIndentedString(scriptParams)).append("\n");
    sb.append("    counterTemplate: ").append(toIndentedString(counterTemplate)).append("\n");
    sb.append("    priority: ").append(toIndentedString(priority)).append("\n");
    sb.append("    active: ").append(toIndentedString(active)).append("\n");
    sb.append("    runAsync: ").append(toIndentedString(runAsync)).append("\n");
    sb.append("    httpProtocol: ").append(toIndentedString(httpProtocol)).append("\n");
    sb.append("    host: ").append(toIndentedString(host)).append("\n");
    sb.append("    port: ").append(toIndentedString(port)).append("\n");
    sb.append("    page: ").append(toIndentedString(page)).append("\n");
    sb.append("    httpMethod: ").append(toIndentedString(httpMethod)).append("\n");
    sb.append("    username: ").append(toIndentedString(username)).append("\n");
    sb.append("    password: ").append(toIndentedString(password)).append("\n");
    sb.append("    headers: ").append(toIndentedString(headers)).append("\n");
    sb.append("    params: ").append(toIndentedString(params)).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    ");
  }

}

