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

com.sinch.sdk.domains.voice.models.dto.v1.CallbacksUrlDto Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
/*
 * Voice API | Sinch
 * The Voice API exposes calling- and conference-related functionality in the Sinch Voice Platform.
 *
 * The version of the OpenAPI document: 1.0.1
 * Contact: [email protected]
 *
 * 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.sinch.sdk.domains.voice.models.dto.v1;

import com.fasterxml.jackson.annotation.JsonFilter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.Objects;

/** Contains primary and or fallback callback URLs */
@JsonPropertyOrder({CallbacksUrlDto.JSON_PROPERTY_PRIMARY, CallbacksUrlDto.JSON_PROPERTY_FALLBACK})
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class CallbacksUrlDto {
  private static final long serialVersionUID = 1L;
  public static final String JSON_PROPERTY_PRIMARY = "primary";
  private String primary;
  private boolean primaryDefined = false;

  public static final String JSON_PROPERTY_FALLBACK = "fallback";
  private String fallback;
  private boolean fallbackDefined = false;

  public CallbacksUrlDto() {}

  public CallbacksUrlDto primary(String primary) {
    this.primary = primary;
    this.primaryDefined = true;
    return this;
  }

  /**
   * Your primary callback URL
   *
   * @return primary
   */
  @JsonProperty(JSON_PROPERTY_PRIMARY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getPrimary() {
    return primary;
  }

  @JsonIgnore
  public boolean getPrimaryDefined() {
    return primaryDefined;
  }

  @JsonProperty(JSON_PROPERTY_PRIMARY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setPrimary(String primary) {
    this.primary = primary;
    this.primaryDefined = true;
  }

  public CallbacksUrlDto fallback(String fallback) {
    this.fallback = fallback;
    this.fallbackDefined = true;
    return this;
  }

  /**
   * Your fallback callback URL (returned if configured). It is used only if Sinch platform gets a
   * timeout or error from your primary callback URL.
   *
   * @return fallback
   */
  @JsonProperty(JSON_PROPERTY_FALLBACK)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getFallback() {
    return fallback;
  }

  @JsonIgnore
  public boolean getFallbackDefined() {
    return fallbackDefined;
  }

  @JsonProperty(JSON_PROPERTY_FALLBACK)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setFallback(String fallback) {
    this.fallback = fallback;
    this.fallbackDefined = true;
  }

  /** Return true if this callbacks_url object is equal to o. */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CallbacksUrlDto callbacksUrl = (CallbacksUrlDto) o;
    return Objects.equals(this.primary, callbacksUrl.primary)
        && Objects.equals(this.fallback, callbacksUrl.fallback);
  }

  @Override
  public int hashCode() {
    return Objects.hash(primary, fallback);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CallbacksUrlDto {\n");
    sb.append("    primary: ").append(toIndentedString(primary)).append("\n");
    sb.append("    fallback: ").append(toIndentedString(fallback)).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