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

com.sinch.sdk.domains.voice.models.dto.v1.SVAMLRequestBodyDto 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.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * SVAML is a call control markup language. When a server receives a callback event from the Sinch
 * platform, it can respond with a SVAML object to control the voice call. The following is an
 * example of a SVAML object type and its contents.
 */
@JsonPropertyOrder({
  SVAMLRequestBodyDto.JSON_PROPERTY_INSTRUCTIONS,
  SVAMLRequestBodyDto.JSON_PROPERTY_ACTION
})
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class SVAMLRequestBodyDto {
  private static final long serialVersionUID = 1L;
  public static final String JSON_PROPERTY_INSTRUCTIONS = "instructions";
  private List instructions;
  private boolean instructionsDefined = false;

  public static final String JSON_PROPERTY_ACTION = "action";
  private SvamlActionDto action;
  private boolean actionDefined = false;

  public SVAMLRequestBodyDto() {}

  public SVAMLRequestBodyDto instructions(List instructions) {
    this.instructions = instructions;
    this.instructionsDefined = true;
    return this;
  }

  public SVAMLRequestBodyDto addInstructionsItem(SvamlInstructionDto instructionsItem) {
    if (this.instructions == null) {
      this.instructions = new ArrayList<>();
    }
    this.instructionsDefined = true;
    this.instructions.add(instructionsItem);
    return this;
  }

  /**
   * The collection of instructions that can perform various tasks during the call. You can include
   * as many instructions as necessary.
   *
   * @return instructions
   */
  @JsonProperty(JSON_PROPERTY_INSTRUCTIONS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public List getInstructions() {
    return instructions;
  }

  @JsonIgnore
  public boolean getInstructionsDefined() {
    return instructionsDefined;
  }

  @JsonProperty(JSON_PROPERTY_INSTRUCTIONS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setInstructions(List instructions) {
    this.instructions = instructions;
    this.instructionsDefined = true;
  }

  public SVAMLRequestBodyDto action(SvamlActionDto action) {
    this.action = action;
    this.actionDefined = true;
    return this;
  }

  /**
   * Get action
   *
   * @return action
   */
  @JsonProperty(JSON_PROPERTY_ACTION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public SvamlActionDto getAction() {
    return action;
  }

  @JsonIgnore
  public boolean getActionDefined() {
    return actionDefined;
  }

  @JsonProperty(JSON_PROPERTY_ACTION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setAction(SvamlActionDto action) {
    this.action = action;
    this.actionDefined = true;
  }

  /** Return true if this SVAMLRequestBody object is equal to o. */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SVAMLRequestBodyDto svAMLRequestBody = (SVAMLRequestBodyDto) o;
    return Objects.equals(this.instructions, svAMLRequestBody.instructions)
        && Objects.equals(this.action, svAMLRequestBody.action);
  }

  @Override
  public int hashCode() {
    return Objects.hash(instructions, action);
  }

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