com.zuora.model.ExpandedAmendment Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zuora-sdk-java Show documentation
Show all versions of zuora-sdk-java Show documentation
The SDK of JAVA language for Zuora pricing system
/*
* Zuora API Reference
* REST API reference for the Zuora Billing, Payments, and Central Platform! Check out the [REST API Overview](https://www.zuora.com/developer/api-references/api/overview/).
*
* The version of the OpenAPI document: 2024-05-20
* 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.zuora.model;
import java.util.Objects;
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 java.io.IOException;
import java.time.LocalDate;
import java.util.Arrays;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.zuora.JSON;
/**
* ExpandedAmendment
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0")
public class ExpandedAmendment {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_AUTO_RENEW = "autoRenew";
@SerializedName(SERIALIZED_NAME_AUTO_RENEW)
private Boolean autoRenew;
public static final String SERIALIZED_NAME_CODE = "code";
@SerializedName(SERIALIZED_NAME_CODE)
private String code;
public static final String SERIALIZED_NAME_CONTRACT_EFFECTIVE_DATE = "contractEffectiveDate";
@SerializedName(SERIALIZED_NAME_CONTRACT_EFFECTIVE_DATE)
private LocalDate contractEffectiveDate;
public static final String SERIALIZED_NAME_CURRENT_TERM = "currentTerm";
@SerializedName(SERIALIZED_NAME_CURRENT_TERM)
private Long currentTerm;
public static final String SERIALIZED_NAME_CURRENT_TERM_PERIOD_TYPE = "currentTermPeriodType";
@SerializedName(SERIALIZED_NAME_CURRENT_TERM_PERIOD_TYPE)
private String currentTermPeriodType;
public static final String SERIALIZED_NAME_CUSTOMER_ACCEPTANCE_DATE = "customerAcceptanceDate";
@SerializedName(SERIALIZED_NAME_CUSTOMER_ACCEPTANCE_DATE)
private LocalDate customerAcceptanceDate;
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
private String description;
public static final String SERIALIZED_NAME_EFFECTIVE_DATE = "effectiveDate";
@SerializedName(SERIALIZED_NAME_EFFECTIVE_DATE)
private LocalDate effectiveDate;
public static final String SERIALIZED_NAME_EFFECTIVE_POLICY = "effectivePolicy";
@SerializedName(SERIALIZED_NAME_EFFECTIVE_POLICY)
private String effectivePolicy;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_NEW_RATE_PLAN_ID = "newRatePlanId";
@SerializedName(SERIALIZED_NAME_NEW_RATE_PLAN_ID)
private String newRatePlanId;
public static final String SERIALIZED_NAME_REMOVED_RATE_PLAN_ID = "removedRatePlanId";
@SerializedName(SERIALIZED_NAME_REMOVED_RATE_PLAN_ID)
private String removedRatePlanId;
public static final String SERIALIZED_NAME_RENEWAL_SETTING = "renewalSetting";
@SerializedName(SERIALIZED_NAME_RENEWAL_SETTING)
private String renewalSetting;
public static final String SERIALIZED_NAME_RENEWAL_TERM = "renewalTerm";
@SerializedName(SERIALIZED_NAME_RENEWAL_TERM)
private Long renewalTerm;
public static final String SERIALIZED_NAME_RENEWAL_TERM_PERIOD_TYPE = "renewalTermPeriodType";
@SerializedName(SERIALIZED_NAME_RENEWAL_TERM_PERIOD_TYPE)
private String renewalTermPeriodType;
public static final String SERIALIZED_NAME_RESUME_DATE = "resumeDate";
@SerializedName(SERIALIZED_NAME_RESUME_DATE)
private LocalDate resumeDate;
public static final String SERIALIZED_NAME_SERVICE_ACTIVATION_DATE = "serviceActivationDate";
@SerializedName(SERIALIZED_NAME_SERVICE_ACTIVATION_DATE)
private LocalDate serviceActivationDate;
public static final String SERIALIZED_NAME_SPECIFIC_UPDATE_DATE = "specificUpdateDate";
@SerializedName(SERIALIZED_NAME_SPECIFIC_UPDATE_DATE)
private LocalDate specificUpdateDate;
public static final String SERIALIZED_NAME_STATUS = "status";
@SerializedName(SERIALIZED_NAME_STATUS)
private String status;
public static final String SERIALIZED_NAME_SUBSCRIPTION_ID = "subscriptionId";
@SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ID)
private String subscriptionId;
public static final String SERIALIZED_NAME_SUSPEND_DATE = "suspendDate";
@SerializedName(SERIALIZED_NAME_SUSPEND_DATE)
private LocalDate suspendDate;
public static final String SERIALIZED_NAME_TERM_START_DATE = "termStartDate";
@SerializedName(SERIALIZED_NAME_TERM_START_DATE)
private LocalDate termStartDate;
public static final String SERIALIZED_NAME_TERM_TYPE = "termType";
@SerializedName(SERIALIZED_NAME_TERM_TYPE)
private String termType;
public static final String SERIALIZED_NAME_TYPE = "type";
@SerializedName(SERIALIZED_NAME_TYPE)
private String type;
public static final String SERIALIZED_NAME_SUB_TYPE = "subType";
@SerializedName(SERIALIZED_NAME_SUB_TYPE)
private String subType;
public static final String SERIALIZED_NAME_CREATED_BY_ID = "createdById";
@SerializedName(SERIALIZED_NAME_CREATED_BY_ID)
private String createdById;
public static final String SERIALIZED_NAME_CREATED_DATE = "createdDate";
@SerializedName(SERIALIZED_NAME_CREATED_DATE)
private String createdDate;
public static final String SERIALIZED_NAME_UPDATED_BY_ID = "updatedById";
@SerializedName(SERIALIZED_NAME_UPDATED_BY_ID)
private String updatedById;
public static final String SERIALIZED_NAME_UPDATED_DATE = "updatedDate";
@SerializedName(SERIALIZED_NAME_UPDATED_DATE)
private String updatedDate;
public static final String SERIALIZED_NAME_BOOKING_DATE = "bookingDate";
@SerializedName(SERIALIZED_NAME_BOOKING_DATE)
private LocalDate bookingDate;
public ExpandedAmendment() {
}
public ExpandedAmendment id(String id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
*/
@javax.annotation.Nullable
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public ExpandedAmendment autoRenew(Boolean autoRenew) {
this.autoRenew = autoRenew;
return this;
}
/**
* Get autoRenew
* @return autoRenew
*/
@javax.annotation.Nullable
public Boolean getAutoRenew() {
return autoRenew;
}
public void setAutoRenew(Boolean autoRenew) {
this.autoRenew = autoRenew;
}
public ExpandedAmendment code(String code) {
this.code = code;
return this;
}
/**
* Get code
* @return code
*/
@javax.annotation.Nullable
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public ExpandedAmendment contractEffectiveDate(LocalDate contractEffectiveDate) {
this.contractEffectiveDate = contractEffectiveDate;
return this;
}
/**
* Get contractEffectiveDate
* @return contractEffectiveDate
*/
@javax.annotation.Nullable
public LocalDate getContractEffectiveDate() {
return contractEffectiveDate;
}
public void setContractEffectiveDate(LocalDate contractEffectiveDate) {
this.contractEffectiveDate = contractEffectiveDate;
}
public ExpandedAmendment currentTerm(Long currentTerm) {
this.currentTerm = currentTerm;
return this;
}
/**
* Get currentTerm
* @return currentTerm
*/
@javax.annotation.Nullable
public Long getCurrentTerm() {
return currentTerm;
}
public void setCurrentTerm(Long currentTerm) {
this.currentTerm = currentTerm;
}
public ExpandedAmendment currentTermPeriodType(String currentTermPeriodType) {
this.currentTermPeriodType = currentTermPeriodType;
return this;
}
/**
* Get currentTermPeriodType
* @return currentTermPeriodType
*/
@javax.annotation.Nullable
public String getCurrentTermPeriodType() {
return currentTermPeriodType;
}
public void setCurrentTermPeriodType(String currentTermPeriodType) {
this.currentTermPeriodType = currentTermPeriodType;
}
public ExpandedAmendment customerAcceptanceDate(LocalDate customerAcceptanceDate) {
this.customerAcceptanceDate = customerAcceptanceDate;
return this;
}
/**
* Get customerAcceptanceDate
* @return customerAcceptanceDate
*/
@javax.annotation.Nullable
public LocalDate getCustomerAcceptanceDate() {
return customerAcceptanceDate;
}
public void setCustomerAcceptanceDate(LocalDate customerAcceptanceDate) {
this.customerAcceptanceDate = customerAcceptanceDate;
}
public ExpandedAmendment description(String description) {
this.description = description;
return this;
}
/**
* Get description
* @return description
*/
@javax.annotation.Nullable
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public ExpandedAmendment effectiveDate(LocalDate effectiveDate) {
this.effectiveDate = effectiveDate;
return this;
}
/**
* Get effectiveDate
* @return effectiveDate
*/
@javax.annotation.Nullable
public LocalDate getEffectiveDate() {
return effectiveDate;
}
public void setEffectiveDate(LocalDate effectiveDate) {
this.effectiveDate = effectiveDate;
}
public ExpandedAmendment effectivePolicy(String effectivePolicy) {
this.effectivePolicy = effectivePolicy;
return this;
}
/**
* Get effectivePolicy
* @return effectivePolicy
*/
@javax.annotation.Nullable
public String getEffectivePolicy() {
return effectivePolicy;
}
public void setEffectivePolicy(String effectivePolicy) {
this.effectivePolicy = effectivePolicy;
}
public ExpandedAmendment name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
*/
@javax.annotation.Nullable
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ExpandedAmendment newRatePlanId(String newRatePlanId) {
this.newRatePlanId = newRatePlanId;
return this;
}
/**
* Get newRatePlanId
* @return newRatePlanId
*/
@javax.annotation.Nullable
public String getNewRatePlanId() {
return newRatePlanId;
}
public void setNewRatePlanId(String newRatePlanId) {
this.newRatePlanId = newRatePlanId;
}
public ExpandedAmendment removedRatePlanId(String removedRatePlanId) {
this.removedRatePlanId = removedRatePlanId;
return this;
}
/**
* Get removedRatePlanId
* @return removedRatePlanId
*/
@javax.annotation.Nullable
public String getRemovedRatePlanId() {
return removedRatePlanId;
}
public void setRemovedRatePlanId(String removedRatePlanId) {
this.removedRatePlanId = removedRatePlanId;
}
public ExpandedAmendment renewalSetting(String renewalSetting) {
this.renewalSetting = renewalSetting;
return this;
}
/**
* Get renewalSetting
* @return renewalSetting
*/
@javax.annotation.Nullable
public String getRenewalSetting() {
return renewalSetting;
}
public void setRenewalSetting(String renewalSetting) {
this.renewalSetting = renewalSetting;
}
public ExpandedAmendment renewalTerm(Long renewalTerm) {
this.renewalTerm = renewalTerm;
return this;
}
/**
* Get renewalTerm
* @return renewalTerm
*/
@javax.annotation.Nullable
public Long getRenewalTerm() {
return renewalTerm;
}
public void setRenewalTerm(Long renewalTerm) {
this.renewalTerm = renewalTerm;
}
public ExpandedAmendment renewalTermPeriodType(String renewalTermPeriodType) {
this.renewalTermPeriodType = renewalTermPeriodType;
return this;
}
/**
* Get renewalTermPeriodType
* @return renewalTermPeriodType
*/
@javax.annotation.Nullable
public String getRenewalTermPeriodType() {
return renewalTermPeriodType;
}
public void setRenewalTermPeriodType(String renewalTermPeriodType) {
this.renewalTermPeriodType = renewalTermPeriodType;
}
public ExpandedAmendment resumeDate(LocalDate resumeDate) {
this.resumeDate = resumeDate;
return this;
}
/**
* Get resumeDate
* @return resumeDate
*/
@javax.annotation.Nullable
public LocalDate getResumeDate() {
return resumeDate;
}
public void setResumeDate(LocalDate resumeDate) {
this.resumeDate = resumeDate;
}
public ExpandedAmendment serviceActivationDate(LocalDate serviceActivationDate) {
this.serviceActivationDate = serviceActivationDate;
return this;
}
/**
* Get serviceActivationDate
* @return serviceActivationDate
*/
@javax.annotation.Nullable
public LocalDate getServiceActivationDate() {
return serviceActivationDate;
}
public void setServiceActivationDate(LocalDate serviceActivationDate) {
this.serviceActivationDate = serviceActivationDate;
}
public ExpandedAmendment specificUpdateDate(LocalDate specificUpdateDate) {
this.specificUpdateDate = specificUpdateDate;
return this;
}
/**
* Get specificUpdateDate
* @return specificUpdateDate
*/
@javax.annotation.Nullable
public LocalDate getSpecificUpdateDate() {
return specificUpdateDate;
}
public void setSpecificUpdateDate(LocalDate specificUpdateDate) {
this.specificUpdateDate = specificUpdateDate;
}
public ExpandedAmendment status(String status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
*/
@javax.annotation.Nullable
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public ExpandedAmendment subscriptionId(String subscriptionId) {
this.subscriptionId = subscriptionId;
return this;
}
/**
* Get subscriptionId
* @return subscriptionId
*/
@javax.annotation.Nullable
public String getSubscriptionId() {
return subscriptionId;
}
public void setSubscriptionId(String subscriptionId) {
this.subscriptionId = subscriptionId;
}
public ExpandedAmendment suspendDate(LocalDate suspendDate) {
this.suspendDate = suspendDate;
return this;
}
/**
* Get suspendDate
* @return suspendDate
*/
@javax.annotation.Nullable
public LocalDate getSuspendDate() {
return suspendDate;
}
public void setSuspendDate(LocalDate suspendDate) {
this.suspendDate = suspendDate;
}
public ExpandedAmendment termStartDate(LocalDate termStartDate) {
this.termStartDate = termStartDate;
return this;
}
/**
* Get termStartDate
* @return termStartDate
*/
@javax.annotation.Nullable
public LocalDate getTermStartDate() {
return termStartDate;
}
public void setTermStartDate(LocalDate termStartDate) {
this.termStartDate = termStartDate;
}
public ExpandedAmendment termType(String termType) {
this.termType = termType;
return this;
}
/**
* Get termType
* @return termType
*/
@javax.annotation.Nullable
public String getTermType() {
return termType;
}
public void setTermType(String termType) {
this.termType = termType;
}
public ExpandedAmendment type(String type) {
this.type = type;
return this;
}
/**
* Get type
* @return type
*/
@javax.annotation.Nullable
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public ExpandedAmendment subType(String subType) {
this.subType = subType;
return this;
}
/**
* Get subType
* @return subType
*/
@javax.annotation.Nullable
public String getSubType() {
return subType;
}
public void setSubType(String subType) {
this.subType = subType;
}
public ExpandedAmendment createdById(String createdById) {
this.createdById = createdById;
return this;
}
/**
* Get createdById
* @return createdById
*/
@javax.annotation.Nullable
public String getCreatedById() {
return createdById;
}
public void setCreatedById(String createdById) {
this.createdById = createdById;
}
public ExpandedAmendment createdDate(String createdDate) {
this.createdDate = createdDate;
return this;
}
/**
* Get createdDate
* @return createdDate
*/
@javax.annotation.Nullable
public String getCreatedDate() {
return createdDate;
}
public void setCreatedDate(String createdDate) {
this.createdDate = createdDate;
}
public ExpandedAmendment updatedById(String updatedById) {
this.updatedById = updatedById;
return this;
}
/**
* Get updatedById
* @return updatedById
*/
@javax.annotation.Nullable
public String getUpdatedById() {
return updatedById;
}
public void setUpdatedById(String updatedById) {
this.updatedById = updatedById;
}
public ExpandedAmendment updatedDate(String updatedDate) {
this.updatedDate = updatedDate;
return this;
}
/**
* Get updatedDate
* @return updatedDate
*/
@javax.annotation.Nullable
public String getUpdatedDate() {
return updatedDate;
}
public void setUpdatedDate(String updatedDate) {
this.updatedDate = updatedDate;
}
public ExpandedAmendment bookingDate(LocalDate bookingDate) {
this.bookingDate = bookingDate;
return this;
}
/**
* Get bookingDate
* @return bookingDate
*/
@javax.annotation.Nullable
public LocalDate getBookingDate() {
return bookingDate;
}
public void setBookingDate(LocalDate bookingDate) {
this.bookingDate = bookingDate;
}
/**
* A container for additional, undeclared properties.
* This is a holder for any undeclared properties as specified with
* the 'additionalProperties' keyword in the OAS document.
*/
private Map additionalProperties;
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ExpandedAmendment instance itself
*/
public ExpandedAmendment putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap();
}
this.additionalProperties.put(key, value);
return this;
}
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ExpandedAmendment expandedAmendment = (ExpandedAmendment) o;
return Objects.equals(this.id, expandedAmendment.id) &&
Objects.equals(this.autoRenew, expandedAmendment.autoRenew) &&
Objects.equals(this.code, expandedAmendment.code) &&
Objects.equals(this.contractEffectiveDate, expandedAmendment.contractEffectiveDate) &&
Objects.equals(this.currentTerm, expandedAmendment.currentTerm) &&
Objects.equals(this.currentTermPeriodType, expandedAmendment.currentTermPeriodType) &&
Objects.equals(this.customerAcceptanceDate, expandedAmendment.customerAcceptanceDate) &&
Objects.equals(this.description, expandedAmendment.description) &&
Objects.equals(this.effectiveDate, expandedAmendment.effectiveDate) &&
Objects.equals(this.effectivePolicy, expandedAmendment.effectivePolicy) &&
Objects.equals(this.name, expandedAmendment.name) &&
Objects.equals(this.newRatePlanId, expandedAmendment.newRatePlanId) &&
Objects.equals(this.removedRatePlanId, expandedAmendment.removedRatePlanId) &&
Objects.equals(this.renewalSetting, expandedAmendment.renewalSetting) &&
Objects.equals(this.renewalTerm, expandedAmendment.renewalTerm) &&
Objects.equals(this.renewalTermPeriodType, expandedAmendment.renewalTermPeriodType) &&
Objects.equals(this.resumeDate, expandedAmendment.resumeDate) &&
Objects.equals(this.serviceActivationDate, expandedAmendment.serviceActivationDate) &&
Objects.equals(this.specificUpdateDate, expandedAmendment.specificUpdateDate) &&
Objects.equals(this.status, expandedAmendment.status) &&
Objects.equals(this.subscriptionId, expandedAmendment.subscriptionId) &&
Objects.equals(this.suspendDate, expandedAmendment.suspendDate) &&
Objects.equals(this.termStartDate, expandedAmendment.termStartDate) &&
Objects.equals(this.termType, expandedAmendment.termType) &&
Objects.equals(this.type, expandedAmendment.type) &&
Objects.equals(this.subType, expandedAmendment.subType) &&
Objects.equals(this.createdById, expandedAmendment.createdById) &&
Objects.equals(this.createdDate, expandedAmendment.createdDate) &&
Objects.equals(this.updatedById, expandedAmendment.updatedById) &&
Objects.equals(this.updatedDate, expandedAmendment.updatedDate) &&
Objects.equals(this.bookingDate, expandedAmendment.bookingDate)&&
Objects.equals(this.additionalProperties, expandedAmendment.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(id, autoRenew, code, contractEffectiveDate, currentTerm, currentTermPeriodType, customerAcceptanceDate, description, effectiveDate, effectivePolicy, name, newRatePlanId, removedRatePlanId, renewalSetting, renewalTerm, renewalTermPeriodType, resumeDate, serviceActivationDate, specificUpdateDate, status, subscriptionId, suspendDate, termStartDate, termType, type, subType, createdById, createdDate, updatedById, updatedDate, bookingDate, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ExpandedAmendment {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" autoRenew: ").append(toIndentedString(autoRenew)).append("\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" contractEffectiveDate: ").append(toIndentedString(contractEffectiveDate)).append("\n");
sb.append(" currentTerm: ").append(toIndentedString(currentTerm)).append("\n");
sb.append(" currentTermPeriodType: ").append(toIndentedString(currentTermPeriodType)).append("\n");
sb.append(" customerAcceptanceDate: ").append(toIndentedString(customerAcceptanceDate)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" effectiveDate: ").append(toIndentedString(effectiveDate)).append("\n");
sb.append(" effectivePolicy: ").append(toIndentedString(effectivePolicy)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" newRatePlanId: ").append(toIndentedString(newRatePlanId)).append("\n");
sb.append(" removedRatePlanId: ").append(toIndentedString(removedRatePlanId)).append("\n");
sb.append(" renewalSetting: ").append(toIndentedString(renewalSetting)).append("\n");
sb.append(" renewalTerm: ").append(toIndentedString(renewalTerm)).append("\n");
sb.append(" renewalTermPeriodType: ").append(toIndentedString(renewalTermPeriodType)).append("\n");
sb.append(" resumeDate: ").append(toIndentedString(resumeDate)).append("\n");
sb.append(" serviceActivationDate: ").append(toIndentedString(serviceActivationDate)).append("\n");
sb.append(" specificUpdateDate: ").append(toIndentedString(specificUpdateDate)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n");
sb.append(" suspendDate: ").append(toIndentedString(suspendDate)).append("\n");
sb.append(" termStartDate: ").append(toIndentedString(termStartDate)).append("\n");
sb.append(" termType: ").append(toIndentedString(termType)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" subType: ").append(toIndentedString(subType)).append("\n");
sb.append(" createdById: ").append(toIndentedString(createdById)).append("\n");
sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n");
sb.append(" updatedById: ").append(toIndentedString(updatedById)).append("\n");
sb.append(" updatedDate: ").append(toIndentedString(updatedDate)).append("\n");
sb.append(" bookingDate: ").append(toIndentedString(bookingDate)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 ");
}
public static HashSet openapiFields;
public static HashSet openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet();
openapiFields.add("id");
openapiFields.add("autoRenew");
openapiFields.add("code");
openapiFields.add("contractEffectiveDate");
openapiFields.add("currentTerm");
openapiFields.add("currentTermPeriodType");
openapiFields.add("customerAcceptanceDate");
openapiFields.add("description");
openapiFields.add("effectiveDate");
openapiFields.add("effectivePolicy");
openapiFields.add("name");
openapiFields.add("newRatePlanId");
openapiFields.add("removedRatePlanId");
openapiFields.add("renewalSetting");
openapiFields.add("renewalTerm");
openapiFields.add("renewalTermPeriodType");
openapiFields.add("resumeDate");
openapiFields.add("serviceActivationDate");
openapiFields.add("specificUpdateDate");
openapiFields.add("status");
openapiFields.add("subscriptionId");
openapiFields.add("suspendDate");
openapiFields.add("termStartDate");
openapiFields.add("termType");
openapiFields.add("type");
openapiFields.add("subType");
openapiFields.add("createdById");
openapiFields.add("createdDate");
openapiFields.add("updatedById");
openapiFields.add("updatedDate");
openapiFields.add("bookingDate");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to ExpandedAmendment
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!ExpandedAmendment.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ExpandedAmendment is not found in the empty JSON string", ExpandedAmendment.openapiRequiredFields.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString()));
}
if ((jsonObj.get("currentTermPeriodType") != null && !jsonObj.get("currentTermPeriodType").isJsonNull()) && !jsonObj.get("currentTermPeriodType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `currentTermPeriodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currentTermPeriodType").toString()));
}
if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString()));
}
if ((jsonObj.get("effectivePolicy") != null && !jsonObj.get("effectivePolicy").isJsonNull()) && !jsonObj.get("effectivePolicy").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `effectivePolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effectivePolicy").toString()));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if ((jsonObj.get("newRatePlanId") != null && !jsonObj.get("newRatePlanId").isJsonNull()) && !jsonObj.get("newRatePlanId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `newRatePlanId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("newRatePlanId").toString()));
}
if ((jsonObj.get("removedRatePlanId") != null && !jsonObj.get("removedRatePlanId").isJsonNull()) && !jsonObj.get("removedRatePlanId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `removedRatePlanId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("removedRatePlanId").toString()));
}
if ((jsonObj.get("renewalSetting") != null && !jsonObj.get("renewalSetting").isJsonNull()) && !jsonObj.get("renewalSetting").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `renewalSetting` to be a primitive type in the JSON string but got `%s`", jsonObj.get("renewalSetting").toString()));
}
if ((jsonObj.get("renewalTermPeriodType") != null && !jsonObj.get("renewalTermPeriodType").isJsonNull()) && !jsonObj.get("renewalTermPeriodType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `renewalTermPeriodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("renewalTermPeriodType").toString()));
}
if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString()));
}
if ((jsonObj.get("subscriptionId") != null && !jsonObj.get("subscriptionId").isJsonNull()) && !jsonObj.get("subscriptionId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subscriptionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscriptionId").toString()));
}
if ((jsonObj.get("termType") != null && !jsonObj.get("termType").isJsonNull()) && !jsonObj.get("termType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `termType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("termType").toString()));
}
if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString()));
}
if ((jsonObj.get("subType") != null && !jsonObj.get("subType").isJsonNull()) && !jsonObj.get("subType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subType").toString()));
}
if ((jsonObj.get("createdById") != null && !jsonObj.get("createdById").isJsonNull()) && !jsonObj.get("createdById").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `createdById` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdById").toString()));
}
if ((jsonObj.get("createdDate") != null && !jsonObj.get("createdDate").isJsonNull()) && !jsonObj.get("createdDate").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `createdDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdDate").toString()));
}
if ((jsonObj.get("updatedById") != null && !jsonObj.get("updatedById").isJsonNull()) && !jsonObj.get("updatedById").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `updatedById` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updatedById").toString()));
}
if ((jsonObj.get("updatedDate") != null && !jsonObj.get("updatedDate").isJsonNull()) && !jsonObj.get("updatedDate").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `updatedDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updatedDate").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
if (!ExpandedAmendment.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ExpandedAmendment' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ExpandedAmendment.class));
return (TypeAdapter) new TypeAdapter() {
@Override
public void write(JsonWriter out, ExpandedAmendment value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// support null values
out.beginObject();
Iterator iterator = obj.entrySet().iterator();
while(iterator.hasNext()) {
Map.Entry e = (Map.Entry) iterator.next();
out.name((String)e.getKey());
elementAdapter.write(out, e.getValue());
}
// end
// serialize additional properties
if (value.getAdditionalProperties() != null) {
// support null values
boolean oldSerializeNulls = out.getSerializeNulls();
out.setSerializeNulls(true); //force serialize
// end
for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
if (entry.getValue() instanceof String)
obj.addProperty(entry.getKey(), (String) entry.getValue());
else if (entry.getValue() instanceof Number)
obj.addProperty(entry.getKey(), (Number) entry.getValue());
else if (entry.getValue() instanceof Boolean)
obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
else if (entry.getValue() instanceof Character)
obj.addProperty(entry.getKey(), (Character) entry.getValue());
else if (entry.getValue() == null)
obj.add(entry.getKey(), null);
else {
JsonElement jsonElement = gson.toJsonTree(entry.getValue());
if (jsonElement.isJsonArray()) {
obj.add(entry.getKey(), jsonElement.getAsJsonArray());
} else {
obj.add(entry.getKey(), jsonElement.getAsJsonObject());
}
}
out.name((String)entry.getKey());
elementAdapter.write(out, obj.get(entry.getKey()));
}
out.setSerializeNulls(oldSerializeNulls); //restore
}
out.endObject();
}
@Override
public ExpandedAmendment read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
ExpandedAmendment instance = thisAdapter.fromJsonTree(jsonObj);
for (Map.Entry entry : jsonObj.entrySet()) {
if (!openapiFields.contains(entry.getKey())) {
if (entry.getValue().isJsonPrimitive()) { // primitive type
if (entry.getValue().getAsJsonPrimitive().isString())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
else if (entry.getValue().getAsJsonPrimitive().isNumber())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
else if (entry.getValue().getAsJsonPrimitive().isBoolean())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();
}
}
/**
* Create an instance of ExpandedAmendment given an JSON string
*
* @param jsonString JSON string
* @return An instance of ExpandedAmendment
* @throws IOException if the JSON string is invalid with respect to ExpandedAmendment
*/
public static ExpandedAmendment fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ExpandedAmendment.class);
}
/**
* Convert an instance of ExpandedAmendment to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy