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

com.sinch.sdk.domains.sms.models.dto.v1.ApiGroupDto Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
/*
 * API Overview | Sinch
 * Sinch SMS API is one of the easiest APIs we offer and enables you to add fast and reliable global SMS to your applications. Send single messages, scheduled batch messages, use available message templates and more.
 *
 * The version of the OpenAPI document: v1
 * 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.sms.models.dto.v1;

import com.fasterxml.jackson.annotation.JsonCreator;
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 com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.time.OffsetDateTime;
import java.util.LinkedHashSet;
import java.util.Objects;
import java.util.Set;

/** ApiGroupDto */
@JsonPropertyOrder({
  ApiGroupDto.JSON_PROPERTY_ID,
  ApiGroupDto.JSON_PROPERTY_NAME,
  ApiGroupDto.JSON_PROPERTY_SIZE,
  ApiGroupDto.JSON_PROPERTY_CREATED_AT,
  ApiGroupDto.JSON_PROPERTY_MODIFIED_AT,
  ApiGroupDto.JSON_PROPERTY_CHILD_GROUPS,
  ApiGroupDto.JSON_PROPERTY_AUTO_UPDATE
})
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class ApiGroupDto {
  private static final long serialVersionUID = 1L;
  public static final String JSON_PROPERTY_ID = "id";
  private String id;
  private boolean idDefined = false;

  public static final String JSON_PROPERTY_NAME = "name";
  private String name;
  private boolean nameDefined = false;

  public static final String JSON_PROPERTY_SIZE = "size";
  private Integer size;
  private boolean sizeDefined = false;

  public static final String JSON_PROPERTY_CREATED_AT = "created_at";
  private OffsetDateTime createdAt;
  private boolean createdAtDefined = false;

  public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at";
  private OffsetDateTime modifiedAt;
  private boolean modifiedAtDefined = false;

  public static final String JSON_PROPERTY_CHILD_GROUPS = "child_groups";
  private Set childGroups;
  private boolean childGroupsDefined = false;

  public static final String JSON_PROPERTY_AUTO_UPDATE = "auto_update";
  private ApiGroupAutoUpdateDto autoUpdate;
  private boolean autoUpdateDefined = false;

  public ApiGroupDto() {}

  @JsonCreator
  public ApiGroupDto(
      @JsonProperty(JSON_PROPERTY_ID) String id,
      @JsonProperty(JSON_PROPERTY_SIZE) Integer size,
      @JsonProperty(JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt,
      @JsonProperty(JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt) {
    this();
    this.id = id;
    this.idDefined = true;
    this.size = size;
    this.sizeDefined = true;
    this.createdAt = createdAt;
    this.createdAtDefined = true;
    this.modifiedAt = modifiedAt;
    this.modifiedAtDefined = true;
  }

  /**
   * Unique identifier for the group
   *
   * @return id
   */
  @JsonProperty(JSON_PROPERTY_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getId() {
    return id;
  }

  @JsonIgnore
  public boolean getIdDefined() {
    return idDefined;
  }

  public ApiGroupDto name(String name) {
    this.name = name;
    this.nameDefined = true;
    return this;
  }

  /**
   * Name of group if set.
   *
   * @return name
   */
  @JsonProperty(JSON_PROPERTY_NAME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getName() {
    return name;
  }

  @JsonIgnore
  public boolean getNameDefined() {
    return nameDefined;
  }

  @JsonProperty(JSON_PROPERTY_NAME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setName(String name) {
    this.name = name;
    this.nameDefined = true;
  }

  /**
   * The number of members currently in the group.
   *
   * @return size
   */
  @JsonProperty(JSON_PROPERTY_SIZE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public Integer getSize() {
    return size;
  }

  @JsonIgnore
  public boolean getSizeDefined() {
    return sizeDefined;
  }

  /**
   * Timestamp for when the group was created. YYYY-MM-DDThh:mm:ss.SSSZ format
   *
   * @return createdAt
   */
  @JsonProperty(JSON_PROPERTY_CREATED_AT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public OffsetDateTime getCreatedAt() {
    return createdAt;
  }

  @JsonIgnore
  public boolean getCreatedAtDefined() {
    return createdAtDefined;
  }

  /**
   * Timestamp for when the group was last updated. YYYY-MM-DDThh:mm:ss.SSSZ format
   *
   * @return modifiedAt
   */
  @JsonProperty(JSON_PROPERTY_MODIFIED_AT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public OffsetDateTime getModifiedAt() {
    return modifiedAt;
  }

  @JsonIgnore
  public boolean getModifiedAtDefined() {
    return modifiedAtDefined;
  }

  public ApiGroupDto childGroups(Set childGroups) {
    this.childGroups = childGroups;
    this.childGroupsDefined = true;
    return this;
  }

  public ApiGroupDto addChildGroupsItem(Object childGroupsItem) {
    if (this.childGroups == null) {
      this.childGroups = new LinkedHashSet<>();
    }
    this.childGroupsDefined = true;
    this.childGroups.add(childGroupsItem);
    return this;
  }

  /**
   * MSISDNs of child group will be included in this group. If present then this group will be auto
   * populated. Constraints: Elements must be group IDs.
   *
   * @return childGroups
   */
  @JsonProperty(JSON_PROPERTY_CHILD_GROUPS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public Set getChildGroups() {
    return childGroups;
  }

  @JsonIgnore
  public boolean getChildGroupsDefined() {
    return childGroupsDefined;
  }

  @JsonDeserialize(as = LinkedHashSet.class)
  @JsonProperty(JSON_PROPERTY_CHILD_GROUPS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setChildGroups(Set childGroups) {
    this.childGroups = childGroups;
    this.childGroupsDefined = true;
  }

  public ApiGroupDto autoUpdate(ApiGroupAutoUpdateDto autoUpdate) {
    this.autoUpdate = autoUpdate;
    this.autoUpdateDefined = true;
    return this;
  }

  /**
   * Get autoUpdate
   *
   * @return autoUpdate
   */
  @JsonProperty(JSON_PROPERTY_AUTO_UPDATE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public ApiGroupAutoUpdateDto getAutoUpdate() {
    return autoUpdate;
  }

  @JsonIgnore
  public boolean getAutoUpdateDefined() {
    return autoUpdateDefined;
  }

  @JsonProperty(JSON_PROPERTY_AUTO_UPDATE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setAutoUpdate(ApiGroupAutoUpdateDto autoUpdate) {
    this.autoUpdate = autoUpdate;
    this.autoUpdateDefined = true;
  }

  /** Return true if this ApiGroup object is equal to o. */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiGroupDto apiGroup = (ApiGroupDto) o;
    return Objects.equals(this.id, apiGroup.id)
        && Objects.equals(this.name, apiGroup.name)
        && Objects.equals(this.size, apiGroup.size)
        && Objects.equals(this.createdAt, apiGroup.createdAt)
        && Objects.equals(this.modifiedAt, apiGroup.modifiedAt)
        && Objects.equals(this.childGroups, apiGroup.childGroups)
        && Objects.equals(this.autoUpdate, apiGroup.autoUpdate);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, name, size, createdAt, modifiedAt, childGroups, autoUpdate);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiGroupDto {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    size: ").append(toIndentedString(size)).append("\n");
    sb.append("    createdAt: ").append(toIndentedString(createdAt)).append("\n");
    sb.append("    modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n");
    sb.append("    childGroups: ").append(toIndentedString(childGroups)).append("\n");
    sb.append("    autoUpdate: ").append(toIndentedString(autoUpdate)).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    ");
  }
}