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

io.smooch.v2.client.model.Source Maven / Gradle / Ivy

There is a newer version: 6.0.0-alpha.7
Show newest version
/*
 * Sunshine Conversations API
 * #    # Introduction  Welcome to the Sunshine Conversations API. The API allows you to craft entirely unique messaging experiences for your app and website as well as talk to any backend or external service.  The Sunshine Conversations API is designed according to REST principles. The API accepts JSON in request bodies and requires that the content-type: application/json header be specified for  all such requests. The API will always respond with an object. Depending on context, resources may be returned as single objects or as arrays of objects, nested within the response object.  In some cases, the API will also facilitate cross-origin resource sharing so that it can be called from a web application.    ## API pagination and records limits  Some APIs can be paginated by providing the `offset` query string parameter.  The `offset` is the number of initial records to skip before picking records to return (default 0).  The `limit` query string can also be provided to change the number of records to return (maximum 100, default 25).  All paginated endpoints will eventually support cursor pagination and `offset` based pagination support will be dropped.  ### Cursor Pagination  Some APIs are paginated through cursor pagination. Rather than providing an `offset`, a `page[after]` or `page[before]` query string parameter may be provided. `page[after]` and `page[before]` are cursors pointing to a record id.  The `page[after]` cursor indicates that only records **subsequent** to it should be returned.  The `page[before]` cursor indicates that only records **preceding** it should be returned.  **Only one** of `page[after]` or `page[before]` may be provided in a query, not both.  In cursor pagination, the equivalent to the `limit` query string is the `page[size]` query string parameter.  ## Regions  Sunshine Conversations is available in the following regions. Each Sunshine Conversations region has its own API host.  | Region         | Host                       | | -------------- | -------------------------- | | United States  | https://api.smooch.io      | | European Union | https://api.eu-1.smooch.io |    For more information on regions, visit [the guide](/guide/regions/).     
 *
 * The version of the OpenAPI document: 6.0.0-alpha.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 io.smooch.v2.client.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.JsonValue;
import io.smooch.v2.client.model.Client;
import io.smooch.v2.client.model.Device;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

/**
 * Source
 */
@JsonPropertyOrder({
  Source.JSON_PROPERTY_TYPE,
  Source.JSON_PROPERTY_INTEGRATION_ID,
  Source.JSON_PROPERTY_ORIGINAL_MESSAGE_ID,
  Source.JSON_PROPERTY_ORIGINAL_MESSAGE_TIMESTAMP,
  Source.JSON_PROPERTY_CLIENT,
  Source.JSON_PROPERTY_DEVICE
})

public class Source {
  public static final String JSON_PROPERTY_TYPE = "type";
  private String type;

  public static final String JSON_PROPERTY_INTEGRATION_ID = "integrationId";
  private JsonNullable integrationId = JsonNullable.of(null);

  public static final String JSON_PROPERTY_ORIGINAL_MESSAGE_ID = "originalMessageId";
  private JsonNullable originalMessageId = JsonNullable.undefined();

  public static final String JSON_PROPERTY_ORIGINAL_MESSAGE_TIMESTAMP = "originalMessageTimestamp";
  private JsonNullable originalMessageTimestamp = JsonNullable.undefined();

  public static final String JSON_PROPERTY_CLIENT = "client";
  private JsonNullable client = JsonNullable.of(null);

  public static final String JSON_PROPERTY_DEVICE = "device";
  private JsonNullable device = JsonNullable.of(null);


  public Source type(String type) {
    
    this.type = type;
    return this;
  }

   /**
   * An identifier for the channel from which a message originated. May include one of api, sdk, messenger, or any number of other channels.
   * @return type
  **/
  @ApiModelProperty(example = "ios", required = true, value = "An identifier for the channel from which a message originated. May include one of api, sdk, messenger, or any number of other channels.")
  @JsonProperty(JSON_PROPERTY_TYPE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getType() {
    return type;
  }


  public void setType(String type) {
    this.type = type;
  }


  public Source integrationId(Object integrationId) {
    this.integrationId = JsonNullable.of(integrationId);
    
    return this;
  }

   /**
   * Identifier indicating which integration the message was sent from. For user messages only.
   * @return integrationId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Identifier indicating which integration the message was sent from. For user messages only.")
  @JsonIgnore

  public Object getIntegrationId() {
        return integrationId.orElse(null);
  }

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

  public JsonNullable getIntegrationId_JsonNullable() {
    return integrationId;
  }
  
  @JsonProperty(JSON_PROPERTY_INTEGRATION_ID)
  public void setIntegrationId_JsonNullable(JsonNullable integrationId) {
    this.integrationId = integrationId;
  }

  public void setIntegrationId(Object integrationId) {
    this.integrationId = JsonNullable.of(integrationId);
  }


  public Source originalMessageId(String originalMessageId) {
    this.originalMessageId = JsonNullable.of(originalMessageId);
    
    return this;
  }

   /**
   * Message identifier assigned by the originating channel.
   * @return originalMessageId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Message identifier assigned by the originating channel.")
  @JsonIgnore

  public String getOriginalMessageId() {
        return originalMessageId.orElse(null);
  }

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

  public JsonNullable getOriginalMessageId_JsonNullable() {
    return originalMessageId;
  }
  
  @JsonProperty(JSON_PROPERTY_ORIGINAL_MESSAGE_ID)
  public void setOriginalMessageId_JsonNullable(JsonNullable originalMessageId) {
    this.originalMessageId = originalMessageId;
  }

  public void setOriginalMessageId(String originalMessageId) {
    this.originalMessageId = JsonNullable.of(originalMessageId);
  }


  public Source originalMessageTimestamp(String originalMessageTimestamp) {
    this.originalMessageTimestamp = JsonNullable.of(originalMessageTimestamp);
    
    return this;
  }

   /**
   * A datetime string with the format YYYY-MM-DDThh:mm:ss.SSSZ representing when the third party channel received the message.
   * @return originalMessageTimestamp
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "A datetime string with the format YYYY-MM-DDThh:mm:ss.SSSZ representing when the third party channel received the message.")
  @JsonIgnore

  public String getOriginalMessageTimestamp() {
        return originalMessageTimestamp.orElse(null);
  }

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

  public JsonNullable getOriginalMessageTimestamp_JsonNullable() {
    return originalMessageTimestamp;
  }
  
  @JsonProperty(JSON_PROPERTY_ORIGINAL_MESSAGE_TIMESTAMP)
  public void setOriginalMessageTimestamp_JsonNullable(JsonNullable originalMessageTimestamp) {
    this.originalMessageTimestamp = originalMessageTimestamp;
  }

  public void setOriginalMessageTimestamp(String originalMessageTimestamp) {
    this.originalMessageTimestamp = JsonNullable.of(originalMessageTimestamp);
  }


  public Source client(Client client) {
    this.client = JsonNullable.of(client);
    
    return this;
  }

   /**
   * The client from which the user authored the message or activity, if applicable. See client schema for more information. This field is not applicable in API responses, it is used only in webhook payloads if the includeFullSource option is enabled.
   * @return client
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The client from which the user authored the message or activity, if applicable. See client schema for more information. This field is not applicable in API responses, it is used only in webhook payloads if the includeFullSource option is enabled.")
  @JsonIgnore

  public Client getClient() {
        return client.orElse(null);
  }

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

  public JsonNullable getClient_JsonNullable() {
    return client;
  }
  
  @JsonProperty(JSON_PROPERTY_CLIENT)
  public void setClient_JsonNullable(JsonNullable client) {
    this.client = client;
  }

  public void setClient(Client client) {
    this.client = JsonNullable.of(client);
  }


  public Source device(Device device) {
    this.device = JsonNullable.of(device);
    
    return this;
  }

   /**
   * The device from which the user authored the message or activity, if applicable. See device schema for more information. This field is not applicable in API responses, it is used only in webhook payloads if the includeFullSource option is enabled.
   * @return device
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The device from which the user authored the message or activity, if applicable. See device schema for more information. This field is not applicable in API responses, it is used only in webhook payloads if the includeFullSource option is enabled.")
  @JsonIgnore

  public Device getDevice() {
        return device.orElse(null);
  }

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

  public JsonNullable getDevice_JsonNullable() {
    return device;
  }
  
  @JsonProperty(JSON_PROPERTY_DEVICE)
  public void setDevice_JsonNullable(JsonNullable device) {
    this.device = device;
  }

  public void setDevice(Device device) {
    this.device = JsonNullable.of(device);
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Source source = (Source) o;
    return Objects.equals(this.type, source.type) &&
        Objects.equals(this.integrationId, source.integrationId) &&
        Objects.equals(this.originalMessageId, source.originalMessageId) &&
        Objects.equals(this.originalMessageTimestamp, source.originalMessageTimestamp) &&
        Objects.equals(this.client, source.client) &&
        Objects.equals(this.device, source.device);
  }

  @Override
  public int hashCode() {
    return Objects.hash(type, integrationId, originalMessageId, originalMessageTimestamp, client, device);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Source {\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    integrationId: ").append(toIndentedString(integrationId)).append("\n");
    sb.append("    originalMessageId: ").append(toIndentedString(originalMessageId)).append("\n");
    sb.append("    originalMessageTimestamp: ").append(toIndentedString(originalMessageTimestamp)).append("\n");
    sb.append("    client: ").append(toIndentedString(client)).append("\n");
    sb.append("    device: ").append(toIndentedString(device)).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    ");
  }

}