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

nl.vpro.nep.sam.model.StreamAccessAttributes Maven / Gradle / Ivy

There is a newer version: 8.3.1
Show newest version
/*
 * Stream Access Manager
 * Get access to a stream in order to view it
 *
 * The version of the OpenAPI document: 4.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 nl.vpro.nep.sam.model;

import java.util.Objects;
import java.util.Arrays;
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.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;

/**
 * StreamAccessAttributes
 */
@JsonPropertyOrder({
  StreamAccessAttributes.JSON_PROPERTY_VIEWER,
  StreamAccessAttributes.JSON_PROPERTY_IP,
  StreamAccessAttributes.JSON_PROPERTY_DURATION,
  StreamAccessAttributes.JSON_PROPERTY_OPTIONS,
  StreamAccessAttributes.JSON_PROPERTY_META_INFO
})
@JsonTypeName("StreamAccess_attributes")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-18T10:26:20.602909888Z[Etc/UTC]", comments = "Generator version: 7.6.0")
public class StreamAccessAttributes {
  public static final String JSON_PROPERTY_VIEWER = "viewer";
  private String viewer;

  public static final String JSON_PROPERTY_IP = "ip";
  private String ip;

  public static final String JSON_PROPERTY_DURATION = "duration";
  private Integer duration;

  /**
   * Gets or Sets options
   */
  public enum OptionsEnum {
    DEFAULT("default"),
    
    STARTOVER("startOver");

    private String value;

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

    @JsonValue
    public String getValue() {
      return value;
    }

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

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

  public static final String JSON_PROPERTY_OPTIONS = "options";
  private OptionsEnum options;

  public static final String JSON_PROPERTY_META_INFO = "metaInfo";
  private List metaInfo = new ArrayList<>();

  public StreamAccessAttributes() {
  }

  public StreamAccessAttributes viewer(String viewer) {
    
    this.viewer = viewer;
    return this;
  }

   /**
   * The viewer requesting the access
   * @return viewer
  **/
  @jakarta.annotation.Nonnull
  @NotNull

  @JsonProperty(JSON_PROPERTY_VIEWER)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getViewer() {
    return viewer;
  }


  @JsonProperty(JSON_PROPERTY_VIEWER)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setViewer(String viewer) {
    this.viewer = viewer;
  }

  public StreamAccessAttributes ip(String ip) {
    
    this.ip = ip;
    return this;
  }

   /**
   * The ip address of the viewer
   * @return ip
  **/
  @jakarta.annotation.Nonnull
  @NotNull

  @JsonProperty(JSON_PROPERTY_IP)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getIp() {
    return ip;
  }


  @JsonProperty(JSON_PROPERTY_IP)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setIp(String ip) {
    this.ip = ip;
  }

  public StreamAccessAttributes duration(Integer duration) {
    
    this.duration = duration;
    return this;
  }

   /**
   * The duration of the access given to the viewer (optional)
   * @return duration
  **/
  @jakarta.annotation.Nullable

  @JsonProperty(JSON_PROPERTY_DURATION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getDuration() {
    return duration;
  }


  @JsonProperty(JSON_PROPERTY_DURATION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setDuration(Integer duration) {
    this.duration = duration;
  }

  public StreamAccessAttributes options(OptionsEnum options) {
    
    this.options = options;
    return this;
  }

   /**
   * Get options
   * @return options
  **/
  @jakarta.annotation.Nullable

  @JsonProperty(JSON_PROPERTY_OPTIONS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public OptionsEnum getOptions() {
    return options;
  }


  @JsonProperty(JSON_PROPERTY_OPTIONS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setOptions(OptionsEnum options) {
    this.options = options;
  }

  public StreamAccessAttributes metaInfo(List metaInfo) {
    
    this.metaInfo = metaInfo;
    return this;
  }

  public StreamAccessAttributes addMetaInfoItem(Object metaInfoItem) {
    if (this.metaInfo == null) {
      this.metaInfo = new ArrayList<>();
    }
    this.metaInfo.add(metaInfoItem);
    return this;
  }

   /**
   * Extra information that can be provided to influence the cdn (optional)
   * @return metaInfo
  **/
  @jakarta.annotation.Nullable

  @JsonProperty(JSON_PROPERTY_META_INFO)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List getMetaInfo() {
    return metaInfo;
  }


  @JsonProperty(JSON_PROPERTY_META_INFO)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMetaInfo(List metaInfo) {
    this.metaInfo = metaInfo;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    StreamAccessAttributes streamAccessAttributes = (StreamAccessAttributes) o;
    return Objects.equals(this.viewer, streamAccessAttributes.viewer) &&
        Objects.equals(this.ip, streamAccessAttributes.ip) &&
        Objects.equals(this.duration, streamAccessAttributes.duration) &&
        Objects.equals(this.options, streamAccessAttributes.options) &&
        Objects.equals(this.metaInfo, streamAccessAttributes.metaInfo);
  }

  @Override
  public int hashCode() {
    return Objects.hash(viewer, ip, duration, options, metaInfo);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class StreamAccessAttributes {\n");
    sb.append("    viewer: ").append(toIndentedString(viewer)).append("\n");
    sb.append("    ip: ").append(toIndentedString(ip)).append("\n");
    sb.append("    duration: ").append(toIndentedString(duration)).append("\n");
    sb.append("    options: ").append(toIndentedString(options)).append("\n");
    sb.append("    metaInfo: ").append(toIndentedString(metaInfo)).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    ");
  }

}