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

org.openapitools.client.model.SubscriptionCancelPatchResponse Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
/*
* Quickstart API Reference
* Zuora Quickstart API is the API that helps you achieve fundamental use cases.
* It provides a much simplified object model and improved performance, enabling developers to easily learn and use.
*/

package org.openapitools.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.threeten.bp.LocalDate;

import org.openapitools.client.JSON.CustomFieldAdapter;
import org.openapitools.client.JSON.NullableFieldAdapter;
/**
 * Specify this field to cancel a subscription
 */
@ApiModel(description = "Specify this field to cancel a subscription")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class SubscriptionCancelPatchResponse {
  public static final String SERIALIZED_NAME_CANCEL_DATE = "cancel_date";
  @SerializedName(SERIALIZED_NAME_CANCEL_DATE)
  private LocalDate cancelDate;

  /**
   * The date on which the subscription is canceled. Can be either the end of the subscription term or the end of the billing period.
   */
  @JsonAdapter(CancelAtEnum.Adapter.class)
  public enum CancelAtEnum {
    INVOICE_PERIOD_END("invoice_period_end"),
    
    SUBSCRIPTION_TERM_END("subscription_term_end"),
    
    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

    public static class Adapter extends TypeAdapter {
      @Override
      public void write(final JsonWriter jsonWriter, final CancelAtEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public CancelAtEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return CancelAtEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_CANCEL_AT = "cancel_at";
  @SerializedName(SERIALIZED_NAME_CANCEL_AT)
  private CancelAtEnum cancelAt;

  public SubscriptionCancelPatchResponse() { 
  }

  public SubscriptionCancelPatchResponse cancelDate(LocalDate cancelDate) {
    
    this.cancelDate = cancelDate;
    return this;
  }

   /**
   * Date on which the subscription is canceled.
   * @return cancelDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "Wed Jun 01 00:00:00 GMT 2022", value = "Date on which the subscription is canceled.")

  public LocalDate getCancelDate() {
    return cancelDate;
  }


  public void setCancelDate(LocalDate cancelDate) {
    this.cancelDate = cancelDate;
  }


  public SubscriptionCancelPatchResponse cancelAt(CancelAtEnum cancelAt) {
    
    this.cancelAt = cancelAt;
    return this;
  }

   /**
   * The date on which the subscription is canceled. Can be either the end of the subscription term or the end of the billing period.
   * @return cancelAt
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The date on which the subscription is canceled. Can be either the end of the subscription term or the end of the billing period.")

  public CancelAtEnum getCancelAt() {
    return cancelAt;
  }


  public void setCancelAt(CancelAtEnum cancelAt) {
    this.cancelAt = cancelAt;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SubscriptionCancelPatchResponse subscriptionCancelPatchResponse = (SubscriptionCancelPatchResponse) o;
    return Objects.equals(this.cancelDate, subscriptionCancelPatchResponse.cancelDate) &&
        Objects.equals(this.cancelAt, subscriptionCancelPatchResponse.cancelAt);
  }

  @Override
  public int hashCode() {
    return Objects.hash(cancelDate, cancelAt);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class SubscriptionCancelPatchResponse {\n");
    sb.append("    cancelDate: ").append(toIndentedString(cancelDate)).append("\n");
    sb.append("    cancelAt: ").append(toIndentedString(cancelAt)).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 - 2025 Weber Informatics LLC | Privacy Policy