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

com.zuora.model.ExpandedPaymentRun Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
/*
 * 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;

/**
 * ExpandedPaymentRun
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0")
public class ExpandedPaymentRun {
  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private String id;

  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_END_DATE = "endDate";
  @SerializedName(SERIALIZED_NAME_END_DATE)
  private String endDate;

  public static final String SERIALIZED_NAME_EXECUTED_DATE = "executedDate";
  @SerializedName(SERIALIZED_NAME_EXECUTED_DATE)
  private String executedDate;

  public static final String SERIALIZED_NAME_NUMBER_OF_CREDIT_BALANCE_ADJUSTMENTS = "numberOfCreditBalanceAdjustments";
  @SerializedName(SERIALIZED_NAME_NUMBER_OF_CREDIT_BALANCE_ADJUSTMENTS)
  private Integer numberOfCreditBalanceAdjustments;

  public static final String SERIALIZED_NAME_NUMBER_OF_ERRORS = "numberOfErrors";
  @SerializedName(SERIALIZED_NAME_NUMBER_OF_ERRORS)
  private Integer numberOfErrors;

  public static final String SERIALIZED_NAME_NUMBER_OF_INVOICES = "numberOfInvoices";
  @SerializedName(SERIALIZED_NAME_NUMBER_OF_INVOICES)
  private Integer numberOfInvoices;

  public static final String SERIALIZED_NAME_NUMBER_OF_PAYMENTS = "numberOfPayments";
  @SerializedName(SERIALIZED_NAME_NUMBER_OF_PAYMENTS)
  private Integer numberOfPayments;

  public static final String SERIALIZED_NAME_NUMBER_OF_UNPROCESSED = "numberOfUnprocessed";
  @SerializedName(SERIALIZED_NAME_NUMBER_OF_UNPROCESSED)
  private Integer numberOfUnprocessed;

  public static final String SERIALIZED_NAME_PAYMENT_RUN_NUMBER = "paymentRunNumber";
  @SerializedName(SERIALIZED_NAME_PAYMENT_RUN_NUMBER)
  private String paymentRunNumber;

  public static final String SERIALIZED_NAME_STATUS = "status";
  @SerializedName(SERIALIZED_NAME_STATUS)
  private String status;

  public static final String SERIALIZED_NAME_TARGET_DATE = "targetDate";
  @SerializedName(SERIALIZED_NAME_TARGET_DATE)
  private LocalDate targetDate;

  public static final String SERIALIZED_NAME_APPLY_CREDIT_BALANCE = "applyCreditBalance";
  @SerializedName(SERIALIZED_NAME_APPLY_CREDIT_BALANCE)
  private Boolean applyCreditBalance;

  public static final String SERIALIZED_NAME_CONSOLIDATED_PAYMENT = "consolidatedPayment";
  @SerializedName(SERIALIZED_NAME_CONSOLIDATED_PAYMENT)
  private Boolean consolidatedPayment;

  public static final String SERIALIZED_NAME_PROCESS_PAYMENT_WITH_CLOSED_P_M = "processPaymentWithClosedPM";
  @SerializedName(SERIALIZED_NAME_PROCESS_PAYMENT_WITH_CLOSED_P_M)
  private Boolean processPaymentWithClosedPM;

  public static final String SERIALIZED_NAME_COLLECT_PAYMENT = "collectPayment";
  @SerializedName(SERIALIZED_NAME_COLLECT_PAYMENT)
  private Boolean collectPayment;

  public static final String SERIALIZED_NAME_AUTO_APPLY_CREDIT_MEMO = "autoApplyCreditMemo";
  @SerializedName(SERIALIZED_NAME_AUTO_APPLY_CREDIT_MEMO)
  private Boolean autoApplyCreditMemo;

  public static final String SERIALIZED_NAME_AUTO_APPLY_UNAPPLIED_PAYMENT = "autoApplyUnappliedPayment";
  @SerializedName(SERIALIZED_NAME_AUTO_APPLY_UNAPPLIED_PAYMENT)
  private Boolean autoApplyUnappliedPayment;

  public static final String SERIALIZED_NAME_NUMBER_OF_CREDIT_MEMOS = "numberOfCreditMemos";
  @SerializedName(SERIALIZED_NAME_NUMBER_OF_CREDIT_MEMOS)
  private Integer numberOfCreditMemos;

  public static final String SERIALIZED_NAME_NUMBER_OF_DEBIT_MEMOS = "numberOfDebitMemos";
  @SerializedName(SERIALIZED_NAME_NUMBER_OF_DEBIT_MEMOS)
  private Integer numberOfDebitMemos;

  public static final String SERIALIZED_NAME_NUMBER_OF_DEBIT_MEMOS_UNPROCESSED = "numberOfDebitMemosUnprocessed";
  @SerializedName(SERIALIZED_NAME_NUMBER_OF_DEBIT_MEMOS_UNPROCESSED)
  private Integer numberOfDebitMemosUnprocessed;

  public static final String SERIALIZED_NAME_NUMBEROF_UNAPPLIED_PAYMENTS = "numberofUnappliedPayments";
  @SerializedName(SERIALIZED_NAME_NUMBEROF_UNAPPLIED_PAYMENTS)
  private Integer numberofUnappliedPayments;

  public static final String SERIALIZED_NAME_TOTAL_EXECUTION_TIME = "totalExecutionTime";
  @SerializedName(SERIALIZED_NAME_TOTAL_EXECUTION_TIME)
  private Long totalExecutionTime;

  public static final String SERIALIZED_NAME_ERROR_MESSAGE = "errorMessage";
  @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE)
  private String errorMessage;

  public static final String SERIALIZED_NAME_RUN_DATE = "runDate";
  @SerializedName(SERIALIZED_NAME_RUN_DATE)
  private LocalDate runDate;

  public static final String SERIALIZED_NAME_NEXT_RUN_ON = "nextRunOn";
  @SerializedName(SERIALIZED_NAME_NEXT_RUN_ON)
  private LocalDate nextRunOn;

  public static final String SERIALIZED_NAME_REPEAT_TYPE = "repeatType";
  @SerializedName(SERIALIZED_NAME_REPEAT_TYPE)
  private String repeatType;

  public static final String SERIALIZED_NAME_REPEAT_FROM = "repeatFrom";
  @SerializedName(SERIALIZED_NAME_REPEAT_FROM)
  private String repeatFrom;

  public static final String SERIALIZED_NAME_REPEAT_TO = "repeatTo";
  @SerializedName(SERIALIZED_NAME_REPEAT_TO)
  private String repeatTo;

  public static final String SERIALIZED_NAME_RUN_TIME = "runTime";
  @SerializedName(SERIALIZED_NAME_RUN_TIME)
  private Integer runTime;

  public static final String SERIALIZED_NAME_TIME_ZONE = "timeZone";
  @SerializedName(SERIALIZED_NAME_TIME_ZONE)
  private String timeZone;

  public static final String SERIALIZED_NAME_MONTHLY_ON_DAY = "monthlyOnDay";
  @SerializedName(SERIALIZED_NAME_MONTHLY_ON_DAY)
  private String monthlyOnDay;

  public static final String SERIALIZED_NAME_WEEKLY_ON_DAY = "weeklyOnDay";
  @SerializedName(SERIALIZED_NAME_WEEKLY_ON_DAY)
  private String weeklyOnDay;

  public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId";
  @SerializedName(SERIALIZED_NAME_ACCOUNT_ID)
  private String accountId;

  public static final String SERIALIZED_NAME_BATCH = "batch";
  @SerializedName(SERIALIZED_NAME_BATCH)
  private String batch;

  public static final String SERIALIZED_NAME_BILLING_CYCLE_DAY = "billingCycleDay";
  @SerializedName(SERIALIZED_NAME_BILLING_CYCLE_DAY)
  private String billingCycleDay;

  public static final String SERIALIZED_NAME_CURRENCY = "currency";
  @SerializedName(SERIALIZED_NAME_CURRENCY)
  private String currency;

  public static final String SERIALIZED_NAME_PAYMENT_GATEWAY_ID = "paymentGatewayId";
  @SerializedName(SERIALIZED_NAME_PAYMENT_GATEWAY_ID)
  private String paymentGatewayId;

  public static final String SERIALIZED_NAME_BILLING_RUN_ID = "billingRunId";
  @SerializedName(SERIALIZED_NAME_BILLING_RUN_ID)
  private String billingRunId;

  public ExpandedPaymentRun() {
  }

  public ExpandedPaymentRun 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 ExpandedPaymentRun 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 ExpandedPaymentRun 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 ExpandedPaymentRun 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 ExpandedPaymentRun 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 ExpandedPaymentRun endDate(String endDate) {
    this.endDate = endDate;
    return this;
  }

  /**
   * Get endDate
   * @return endDate
   */
  @javax.annotation.Nullable
  public String getEndDate() {
    return endDate;
  }

  public void setEndDate(String endDate) {
    this.endDate = endDate;
  }


  public ExpandedPaymentRun executedDate(String executedDate) {
    this.executedDate = executedDate;
    return this;
  }

  /**
   * Get executedDate
   * @return executedDate
   */
  @javax.annotation.Nullable
  public String getExecutedDate() {
    return executedDate;
  }

  public void setExecutedDate(String executedDate) {
    this.executedDate = executedDate;
  }


  public ExpandedPaymentRun numberOfCreditBalanceAdjustments(Integer numberOfCreditBalanceAdjustments) {
    this.numberOfCreditBalanceAdjustments = numberOfCreditBalanceAdjustments;
    return this;
  }

  /**
   * Get numberOfCreditBalanceAdjustments
   * @return numberOfCreditBalanceAdjustments
   */
  @javax.annotation.Nullable
  public Integer getNumberOfCreditBalanceAdjustments() {
    return numberOfCreditBalanceAdjustments;
  }

  public void setNumberOfCreditBalanceAdjustments(Integer numberOfCreditBalanceAdjustments) {
    this.numberOfCreditBalanceAdjustments = numberOfCreditBalanceAdjustments;
  }


  public ExpandedPaymentRun numberOfErrors(Integer numberOfErrors) {
    this.numberOfErrors = numberOfErrors;
    return this;
  }

  /**
   * Get numberOfErrors
   * @return numberOfErrors
   */
  @javax.annotation.Nullable
  public Integer getNumberOfErrors() {
    return numberOfErrors;
  }

  public void setNumberOfErrors(Integer numberOfErrors) {
    this.numberOfErrors = numberOfErrors;
  }


  public ExpandedPaymentRun numberOfInvoices(Integer numberOfInvoices) {
    this.numberOfInvoices = numberOfInvoices;
    return this;
  }

  /**
   * Get numberOfInvoices
   * @return numberOfInvoices
   */
  @javax.annotation.Nullable
  public Integer getNumberOfInvoices() {
    return numberOfInvoices;
  }

  public void setNumberOfInvoices(Integer numberOfInvoices) {
    this.numberOfInvoices = numberOfInvoices;
  }


  public ExpandedPaymentRun numberOfPayments(Integer numberOfPayments) {
    this.numberOfPayments = numberOfPayments;
    return this;
  }

  /**
   * Get numberOfPayments
   * @return numberOfPayments
   */
  @javax.annotation.Nullable
  public Integer getNumberOfPayments() {
    return numberOfPayments;
  }

  public void setNumberOfPayments(Integer numberOfPayments) {
    this.numberOfPayments = numberOfPayments;
  }


  public ExpandedPaymentRun numberOfUnprocessed(Integer numberOfUnprocessed) {
    this.numberOfUnprocessed = numberOfUnprocessed;
    return this;
  }

  /**
   * Get numberOfUnprocessed
   * @return numberOfUnprocessed
   */
  @javax.annotation.Nullable
  public Integer getNumberOfUnprocessed() {
    return numberOfUnprocessed;
  }

  public void setNumberOfUnprocessed(Integer numberOfUnprocessed) {
    this.numberOfUnprocessed = numberOfUnprocessed;
  }


  public ExpandedPaymentRun paymentRunNumber(String paymentRunNumber) {
    this.paymentRunNumber = paymentRunNumber;
    return this;
  }

  /**
   * Get paymentRunNumber
   * @return paymentRunNumber
   */
  @javax.annotation.Nullable
  public String getPaymentRunNumber() {
    return paymentRunNumber;
  }

  public void setPaymentRunNumber(String paymentRunNumber) {
    this.paymentRunNumber = paymentRunNumber;
  }


  public ExpandedPaymentRun 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 ExpandedPaymentRun targetDate(LocalDate targetDate) {
    this.targetDate = targetDate;
    return this;
  }

  /**
   * Get targetDate
   * @return targetDate
   */
  @javax.annotation.Nullable
  public LocalDate getTargetDate() {
    return targetDate;
  }

  public void setTargetDate(LocalDate targetDate) {
    this.targetDate = targetDate;
  }


  public ExpandedPaymentRun applyCreditBalance(Boolean applyCreditBalance) {
    this.applyCreditBalance = applyCreditBalance;
    return this;
  }

  /**
   * Get applyCreditBalance
   * @return applyCreditBalance
   */
  @javax.annotation.Nullable
  public Boolean getApplyCreditBalance() {
    return applyCreditBalance;
  }

  public void setApplyCreditBalance(Boolean applyCreditBalance) {
    this.applyCreditBalance = applyCreditBalance;
  }


  public ExpandedPaymentRun consolidatedPayment(Boolean consolidatedPayment) {
    this.consolidatedPayment = consolidatedPayment;
    return this;
  }

  /**
   * Get consolidatedPayment
   * @return consolidatedPayment
   */
  @javax.annotation.Nullable
  public Boolean getConsolidatedPayment() {
    return consolidatedPayment;
  }

  public void setConsolidatedPayment(Boolean consolidatedPayment) {
    this.consolidatedPayment = consolidatedPayment;
  }


  public ExpandedPaymentRun processPaymentWithClosedPM(Boolean processPaymentWithClosedPM) {
    this.processPaymentWithClosedPM = processPaymentWithClosedPM;
    return this;
  }

  /**
   * Get processPaymentWithClosedPM
   * @return processPaymentWithClosedPM
   */
  @javax.annotation.Nullable
  public Boolean getProcessPaymentWithClosedPM() {
    return processPaymentWithClosedPM;
  }

  public void setProcessPaymentWithClosedPM(Boolean processPaymentWithClosedPM) {
    this.processPaymentWithClosedPM = processPaymentWithClosedPM;
  }


  public ExpandedPaymentRun collectPayment(Boolean collectPayment) {
    this.collectPayment = collectPayment;
    return this;
  }

  /**
   * Get collectPayment
   * @return collectPayment
   */
  @javax.annotation.Nullable
  public Boolean getCollectPayment() {
    return collectPayment;
  }

  public void setCollectPayment(Boolean collectPayment) {
    this.collectPayment = collectPayment;
  }


  public ExpandedPaymentRun autoApplyCreditMemo(Boolean autoApplyCreditMemo) {
    this.autoApplyCreditMemo = autoApplyCreditMemo;
    return this;
  }

  /**
   * Get autoApplyCreditMemo
   * @return autoApplyCreditMemo
   */
  @javax.annotation.Nullable
  public Boolean getAutoApplyCreditMemo() {
    return autoApplyCreditMemo;
  }

  public void setAutoApplyCreditMemo(Boolean autoApplyCreditMemo) {
    this.autoApplyCreditMemo = autoApplyCreditMemo;
  }


  public ExpandedPaymentRun autoApplyUnappliedPayment(Boolean autoApplyUnappliedPayment) {
    this.autoApplyUnappliedPayment = autoApplyUnappliedPayment;
    return this;
  }

  /**
   * Get autoApplyUnappliedPayment
   * @return autoApplyUnappliedPayment
   */
  @javax.annotation.Nullable
  public Boolean getAutoApplyUnappliedPayment() {
    return autoApplyUnappliedPayment;
  }

  public void setAutoApplyUnappliedPayment(Boolean autoApplyUnappliedPayment) {
    this.autoApplyUnappliedPayment = autoApplyUnappliedPayment;
  }


  public ExpandedPaymentRun numberOfCreditMemos(Integer numberOfCreditMemos) {
    this.numberOfCreditMemos = numberOfCreditMemos;
    return this;
  }

  /**
   * Get numberOfCreditMemos
   * @return numberOfCreditMemos
   */
  @javax.annotation.Nullable
  public Integer getNumberOfCreditMemos() {
    return numberOfCreditMemos;
  }

  public void setNumberOfCreditMemos(Integer numberOfCreditMemos) {
    this.numberOfCreditMemos = numberOfCreditMemos;
  }


  public ExpandedPaymentRun numberOfDebitMemos(Integer numberOfDebitMemos) {
    this.numberOfDebitMemos = numberOfDebitMemos;
    return this;
  }

  /**
   * Get numberOfDebitMemos
   * @return numberOfDebitMemos
   */
  @javax.annotation.Nullable
  public Integer getNumberOfDebitMemos() {
    return numberOfDebitMemos;
  }

  public void setNumberOfDebitMemos(Integer numberOfDebitMemos) {
    this.numberOfDebitMemos = numberOfDebitMemos;
  }


  public ExpandedPaymentRun numberOfDebitMemosUnprocessed(Integer numberOfDebitMemosUnprocessed) {
    this.numberOfDebitMemosUnprocessed = numberOfDebitMemosUnprocessed;
    return this;
  }

  /**
   * Get numberOfDebitMemosUnprocessed
   * @return numberOfDebitMemosUnprocessed
   */
  @javax.annotation.Nullable
  public Integer getNumberOfDebitMemosUnprocessed() {
    return numberOfDebitMemosUnprocessed;
  }

  public void setNumberOfDebitMemosUnprocessed(Integer numberOfDebitMemosUnprocessed) {
    this.numberOfDebitMemosUnprocessed = numberOfDebitMemosUnprocessed;
  }


  public ExpandedPaymentRun numberofUnappliedPayments(Integer numberofUnappliedPayments) {
    this.numberofUnappliedPayments = numberofUnappliedPayments;
    return this;
  }

  /**
   * Get numberofUnappliedPayments
   * @return numberofUnappliedPayments
   */
  @javax.annotation.Nullable
  public Integer getNumberofUnappliedPayments() {
    return numberofUnappliedPayments;
  }

  public void setNumberofUnappliedPayments(Integer numberofUnappliedPayments) {
    this.numberofUnappliedPayments = numberofUnappliedPayments;
  }


  public ExpandedPaymentRun totalExecutionTime(Long totalExecutionTime) {
    this.totalExecutionTime = totalExecutionTime;
    return this;
  }

  /**
   * Get totalExecutionTime
   * @return totalExecutionTime
   */
  @javax.annotation.Nullable
  public Long getTotalExecutionTime() {
    return totalExecutionTime;
  }

  public void setTotalExecutionTime(Long totalExecutionTime) {
    this.totalExecutionTime = totalExecutionTime;
  }


  public ExpandedPaymentRun errorMessage(String errorMessage) {
    this.errorMessage = errorMessage;
    return this;
  }

  /**
   * Get errorMessage
   * @return errorMessage
   */
  @javax.annotation.Nullable
  public String getErrorMessage() {
    return errorMessage;
  }

  public void setErrorMessage(String errorMessage) {
    this.errorMessage = errorMessage;
  }


  public ExpandedPaymentRun runDate(LocalDate runDate) {
    this.runDate = runDate;
    return this;
  }

  /**
   * Get runDate
   * @return runDate
   */
  @javax.annotation.Nullable
  public LocalDate getRunDate() {
    return runDate;
  }

  public void setRunDate(LocalDate runDate) {
    this.runDate = runDate;
  }


  public ExpandedPaymentRun nextRunOn(LocalDate nextRunOn) {
    this.nextRunOn = nextRunOn;
    return this;
  }

  /**
   * Get nextRunOn
   * @return nextRunOn
   */
  @javax.annotation.Nullable
  public LocalDate getNextRunOn() {
    return nextRunOn;
  }

  public void setNextRunOn(LocalDate nextRunOn) {
    this.nextRunOn = nextRunOn;
  }


  public ExpandedPaymentRun repeatType(String repeatType) {
    this.repeatType = repeatType;
    return this;
  }

  /**
   * Get repeatType
   * @return repeatType
   */
  @javax.annotation.Nullable
  public String getRepeatType() {
    return repeatType;
  }

  public void setRepeatType(String repeatType) {
    this.repeatType = repeatType;
  }


  public ExpandedPaymentRun repeatFrom(String repeatFrom) {
    this.repeatFrom = repeatFrom;
    return this;
  }

  /**
   * Get repeatFrom
   * @return repeatFrom
   */
  @javax.annotation.Nullable
  public String getRepeatFrom() {
    return repeatFrom;
  }

  public void setRepeatFrom(String repeatFrom) {
    this.repeatFrom = repeatFrom;
  }


  public ExpandedPaymentRun repeatTo(String repeatTo) {
    this.repeatTo = repeatTo;
    return this;
  }

  /**
   * Get repeatTo
   * @return repeatTo
   */
  @javax.annotation.Nullable
  public String getRepeatTo() {
    return repeatTo;
  }

  public void setRepeatTo(String repeatTo) {
    this.repeatTo = repeatTo;
  }


  public ExpandedPaymentRun runTime(Integer runTime) {
    this.runTime = runTime;
    return this;
  }

  /**
   * Get runTime
   * @return runTime
   */
  @javax.annotation.Nullable
  public Integer getRunTime() {
    return runTime;
  }

  public void setRunTime(Integer runTime) {
    this.runTime = runTime;
  }


  public ExpandedPaymentRun timeZone(String timeZone) {
    this.timeZone = timeZone;
    return this;
  }

  /**
   * Get timeZone
   * @return timeZone
   */
  @javax.annotation.Nullable
  public String getTimeZone() {
    return timeZone;
  }

  public void setTimeZone(String timeZone) {
    this.timeZone = timeZone;
  }


  public ExpandedPaymentRun monthlyOnDay(String monthlyOnDay) {
    this.monthlyOnDay = monthlyOnDay;
    return this;
  }

  /**
   * Get monthlyOnDay
   * @return monthlyOnDay
   */
  @javax.annotation.Nullable
  public String getMonthlyOnDay() {
    return monthlyOnDay;
  }

  public void setMonthlyOnDay(String monthlyOnDay) {
    this.monthlyOnDay = monthlyOnDay;
  }


  public ExpandedPaymentRun weeklyOnDay(String weeklyOnDay) {
    this.weeklyOnDay = weeklyOnDay;
    return this;
  }

  /**
   * Get weeklyOnDay
   * @return weeklyOnDay
   */
  @javax.annotation.Nullable
  public String getWeeklyOnDay() {
    return weeklyOnDay;
  }

  public void setWeeklyOnDay(String weeklyOnDay) {
    this.weeklyOnDay = weeklyOnDay;
  }


  public ExpandedPaymentRun accountId(String accountId) {
    this.accountId = accountId;
    return this;
  }

  /**
   * Get accountId
   * @return accountId
   */
  @javax.annotation.Nullable
  public String getAccountId() {
    return accountId;
  }

  public void setAccountId(String accountId) {
    this.accountId = accountId;
  }


  public ExpandedPaymentRun batch(String batch) {
    this.batch = batch;
    return this;
  }

  /**
   * Get batch
   * @return batch
   */
  @javax.annotation.Nullable
  public String getBatch() {
    return batch;
  }

  public void setBatch(String batch) {
    this.batch = batch;
  }


  public ExpandedPaymentRun billingCycleDay(String billingCycleDay) {
    this.billingCycleDay = billingCycleDay;
    return this;
  }

  /**
   * Get billingCycleDay
   * @return billingCycleDay
   */
  @javax.annotation.Nullable
  public String getBillingCycleDay() {
    return billingCycleDay;
  }

  public void setBillingCycleDay(String billingCycleDay) {
    this.billingCycleDay = billingCycleDay;
  }


  public ExpandedPaymentRun currency(String currency) {
    this.currency = currency;
    return this;
  }

  /**
   * Get currency
   * @return currency
   */
  @javax.annotation.Nullable
  public String getCurrency() {
    return currency;
  }

  public void setCurrency(String currency) {
    this.currency = currency;
  }


  public ExpandedPaymentRun paymentGatewayId(String paymentGatewayId) {
    this.paymentGatewayId = paymentGatewayId;
    return this;
  }

  /**
   * Get paymentGatewayId
   * @return paymentGatewayId
   */
  @javax.annotation.Nullable
  public String getPaymentGatewayId() {
    return paymentGatewayId;
  }

  public void setPaymentGatewayId(String paymentGatewayId) {
    this.paymentGatewayId = paymentGatewayId;
  }


  public ExpandedPaymentRun billingRunId(String billingRunId) {
    this.billingRunId = billingRunId;
    return this;
  }

  /**
   * Get billingRunId
   * @return billingRunId
   */
  @javax.annotation.Nullable
  public String getBillingRunId() {
    return billingRunId;
  }

  public void setBillingRunId(String billingRunId) {
    this.billingRunId = billingRunId;
  }

  /**
   * 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 ExpandedPaymentRun instance itself
   */
  public ExpandedPaymentRun 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;
    }
    ExpandedPaymentRun expandedPaymentRun = (ExpandedPaymentRun) o;
    return Objects.equals(this.id, expandedPaymentRun.id) &&
        Objects.equals(this.createdById, expandedPaymentRun.createdById) &&
        Objects.equals(this.createdDate, expandedPaymentRun.createdDate) &&
        Objects.equals(this.updatedById, expandedPaymentRun.updatedById) &&
        Objects.equals(this.updatedDate, expandedPaymentRun.updatedDate) &&
        Objects.equals(this.endDate, expandedPaymentRun.endDate) &&
        Objects.equals(this.executedDate, expandedPaymentRun.executedDate) &&
        Objects.equals(this.numberOfCreditBalanceAdjustments, expandedPaymentRun.numberOfCreditBalanceAdjustments) &&
        Objects.equals(this.numberOfErrors, expandedPaymentRun.numberOfErrors) &&
        Objects.equals(this.numberOfInvoices, expandedPaymentRun.numberOfInvoices) &&
        Objects.equals(this.numberOfPayments, expandedPaymentRun.numberOfPayments) &&
        Objects.equals(this.numberOfUnprocessed, expandedPaymentRun.numberOfUnprocessed) &&
        Objects.equals(this.paymentRunNumber, expandedPaymentRun.paymentRunNumber) &&
        Objects.equals(this.status, expandedPaymentRun.status) &&
        Objects.equals(this.targetDate, expandedPaymentRun.targetDate) &&
        Objects.equals(this.applyCreditBalance, expandedPaymentRun.applyCreditBalance) &&
        Objects.equals(this.consolidatedPayment, expandedPaymentRun.consolidatedPayment) &&
        Objects.equals(this.processPaymentWithClosedPM, expandedPaymentRun.processPaymentWithClosedPM) &&
        Objects.equals(this.collectPayment, expandedPaymentRun.collectPayment) &&
        Objects.equals(this.autoApplyCreditMemo, expandedPaymentRun.autoApplyCreditMemo) &&
        Objects.equals(this.autoApplyUnappliedPayment, expandedPaymentRun.autoApplyUnappliedPayment) &&
        Objects.equals(this.numberOfCreditMemos, expandedPaymentRun.numberOfCreditMemos) &&
        Objects.equals(this.numberOfDebitMemos, expandedPaymentRun.numberOfDebitMemos) &&
        Objects.equals(this.numberOfDebitMemosUnprocessed, expandedPaymentRun.numberOfDebitMemosUnprocessed) &&
        Objects.equals(this.numberofUnappliedPayments, expandedPaymentRun.numberofUnappliedPayments) &&
        Objects.equals(this.totalExecutionTime, expandedPaymentRun.totalExecutionTime) &&
        Objects.equals(this.errorMessage, expandedPaymentRun.errorMessage) &&
        Objects.equals(this.runDate, expandedPaymentRun.runDate) &&
        Objects.equals(this.nextRunOn, expandedPaymentRun.nextRunOn) &&
        Objects.equals(this.repeatType, expandedPaymentRun.repeatType) &&
        Objects.equals(this.repeatFrom, expandedPaymentRun.repeatFrom) &&
        Objects.equals(this.repeatTo, expandedPaymentRun.repeatTo) &&
        Objects.equals(this.runTime, expandedPaymentRun.runTime) &&
        Objects.equals(this.timeZone, expandedPaymentRun.timeZone) &&
        Objects.equals(this.monthlyOnDay, expandedPaymentRun.monthlyOnDay) &&
        Objects.equals(this.weeklyOnDay, expandedPaymentRun.weeklyOnDay) &&
        Objects.equals(this.accountId, expandedPaymentRun.accountId) &&
        Objects.equals(this.batch, expandedPaymentRun.batch) &&
        Objects.equals(this.billingCycleDay, expandedPaymentRun.billingCycleDay) &&
        Objects.equals(this.currency, expandedPaymentRun.currency) &&
        Objects.equals(this.paymentGatewayId, expandedPaymentRun.paymentGatewayId) &&
        Objects.equals(this.billingRunId, expandedPaymentRun.billingRunId)&&
        Objects.equals(this.additionalProperties, expandedPaymentRun.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, createdById, createdDate, updatedById, updatedDate, endDate, executedDate, numberOfCreditBalanceAdjustments, numberOfErrors, numberOfInvoices, numberOfPayments, numberOfUnprocessed, paymentRunNumber, status, targetDate, applyCreditBalance, consolidatedPayment, processPaymentWithClosedPM, collectPayment, autoApplyCreditMemo, autoApplyUnappliedPayment, numberOfCreditMemos, numberOfDebitMemos, numberOfDebitMemosUnprocessed, numberofUnappliedPayments, totalExecutionTime, errorMessage, runDate, nextRunOn, repeatType, repeatFrom, repeatTo, runTime, timeZone, monthlyOnDay, weeklyOnDay, accountId, batch, billingCycleDay, currency, paymentGatewayId, billingRunId, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ExpandedPaymentRun {\n");
    sb.append("    id: ").append(toIndentedString(id)).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("    endDate: ").append(toIndentedString(endDate)).append("\n");
    sb.append("    executedDate: ").append(toIndentedString(executedDate)).append("\n");
    sb.append("    numberOfCreditBalanceAdjustments: ").append(toIndentedString(numberOfCreditBalanceAdjustments)).append("\n");
    sb.append("    numberOfErrors: ").append(toIndentedString(numberOfErrors)).append("\n");
    sb.append("    numberOfInvoices: ").append(toIndentedString(numberOfInvoices)).append("\n");
    sb.append("    numberOfPayments: ").append(toIndentedString(numberOfPayments)).append("\n");
    sb.append("    numberOfUnprocessed: ").append(toIndentedString(numberOfUnprocessed)).append("\n");
    sb.append("    paymentRunNumber: ").append(toIndentedString(paymentRunNumber)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    targetDate: ").append(toIndentedString(targetDate)).append("\n");
    sb.append("    applyCreditBalance: ").append(toIndentedString(applyCreditBalance)).append("\n");
    sb.append("    consolidatedPayment: ").append(toIndentedString(consolidatedPayment)).append("\n");
    sb.append("    processPaymentWithClosedPM: ").append(toIndentedString(processPaymentWithClosedPM)).append("\n");
    sb.append("    collectPayment: ").append(toIndentedString(collectPayment)).append("\n");
    sb.append("    autoApplyCreditMemo: ").append(toIndentedString(autoApplyCreditMemo)).append("\n");
    sb.append("    autoApplyUnappliedPayment: ").append(toIndentedString(autoApplyUnappliedPayment)).append("\n");
    sb.append("    numberOfCreditMemos: ").append(toIndentedString(numberOfCreditMemos)).append("\n");
    sb.append("    numberOfDebitMemos: ").append(toIndentedString(numberOfDebitMemos)).append("\n");
    sb.append("    numberOfDebitMemosUnprocessed: ").append(toIndentedString(numberOfDebitMemosUnprocessed)).append("\n");
    sb.append("    numberofUnappliedPayments: ").append(toIndentedString(numberofUnappliedPayments)).append("\n");
    sb.append("    totalExecutionTime: ").append(toIndentedString(totalExecutionTime)).append("\n");
    sb.append("    errorMessage: ").append(toIndentedString(errorMessage)).append("\n");
    sb.append("    runDate: ").append(toIndentedString(runDate)).append("\n");
    sb.append("    nextRunOn: ").append(toIndentedString(nextRunOn)).append("\n");
    sb.append("    repeatType: ").append(toIndentedString(repeatType)).append("\n");
    sb.append("    repeatFrom: ").append(toIndentedString(repeatFrom)).append("\n");
    sb.append("    repeatTo: ").append(toIndentedString(repeatTo)).append("\n");
    sb.append("    runTime: ").append(toIndentedString(runTime)).append("\n");
    sb.append("    timeZone: ").append(toIndentedString(timeZone)).append("\n");
    sb.append("    monthlyOnDay: ").append(toIndentedString(monthlyOnDay)).append("\n");
    sb.append("    weeklyOnDay: ").append(toIndentedString(weeklyOnDay)).append("\n");
    sb.append("    accountId: ").append(toIndentedString(accountId)).append("\n");
    sb.append("    batch: ").append(toIndentedString(batch)).append("\n");
    sb.append("    billingCycleDay: ").append(toIndentedString(billingCycleDay)).append("\n");
    sb.append("    currency: ").append(toIndentedString(currency)).append("\n");
    sb.append("    paymentGatewayId: ").append(toIndentedString(paymentGatewayId)).append("\n");
    sb.append("    billingRunId: ").append(toIndentedString(billingRunId)).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("createdById");
    openapiFields.add("createdDate");
    openapiFields.add("updatedById");
    openapiFields.add("updatedDate");
    openapiFields.add("endDate");
    openapiFields.add("executedDate");
    openapiFields.add("numberOfCreditBalanceAdjustments");
    openapiFields.add("numberOfErrors");
    openapiFields.add("numberOfInvoices");
    openapiFields.add("numberOfPayments");
    openapiFields.add("numberOfUnprocessed");
    openapiFields.add("paymentRunNumber");
    openapiFields.add("status");
    openapiFields.add("targetDate");
    openapiFields.add("applyCreditBalance");
    openapiFields.add("consolidatedPayment");
    openapiFields.add("processPaymentWithClosedPM");
    openapiFields.add("collectPayment");
    openapiFields.add("autoApplyCreditMemo");
    openapiFields.add("autoApplyUnappliedPayment");
    openapiFields.add("numberOfCreditMemos");
    openapiFields.add("numberOfDebitMemos");
    openapiFields.add("numberOfDebitMemosUnprocessed");
    openapiFields.add("numberofUnappliedPayments");
    openapiFields.add("totalExecutionTime");
    openapiFields.add("errorMessage");
    openapiFields.add("runDate");
    openapiFields.add("nextRunOn");
    openapiFields.add("repeatType");
    openapiFields.add("repeatFrom");
    openapiFields.add("repeatTo");
    openapiFields.add("runTime");
    openapiFields.add("timeZone");
    openapiFields.add("monthlyOnDay");
    openapiFields.add("weeklyOnDay");
    openapiFields.add("accountId");
    openapiFields.add("batch");
    openapiFields.add("billingCycleDay");
    openapiFields.add("currency");
    openapiFields.add("paymentGatewayId");
    openapiFields.add("billingRunId");

    // 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 ExpandedPaymentRun
   */
  public static void validateJsonElement(JsonElement jsonElement) throws IOException {
      if (jsonElement == null) {
        if (!ExpandedPaymentRun.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
          throw new IllegalArgumentException(String.format("The required field(s) %s in ExpandedPaymentRun is not found in the empty JSON string", ExpandedPaymentRun.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("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()));
      }
      if ((jsonObj.get("endDate") != null && !jsonObj.get("endDate").isJsonNull()) && !jsonObj.get("endDate").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `endDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endDate").toString()));
      }
      if ((jsonObj.get("executedDate") != null && !jsonObj.get("executedDate").isJsonNull()) && !jsonObj.get("executedDate").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `executedDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("executedDate").toString()));
      }
      if ((jsonObj.get("paymentRunNumber") != null && !jsonObj.get("paymentRunNumber").isJsonNull()) && !jsonObj.get("paymentRunNumber").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `paymentRunNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentRunNumber").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("errorMessage") != null && !jsonObj.get("errorMessage").isJsonNull()) && !jsonObj.get("errorMessage").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `errorMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorMessage").toString()));
      }
      if ((jsonObj.get("repeatType") != null && !jsonObj.get("repeatType").isJsonNull()) && !jsonObj.get("repeatType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `repeatType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("repeatType").toString()));
      }
      if ((jsonObj.get("repeatFrom") != null && !jsonObj.get("repeatFrom").isJsonNull()) && !jsonObj.get("repeatFrom").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `repeatFrom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("repeatFrom").toString()));
      }
      if ((jsonObj.get("repeatTo") != null && !jsonObj.get("repeatTo").isJsonNull()) && !jsonObj.get("repeatTo").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `repeatTo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("repeatTo").toString()));
      }
      if ((jsonObj.get("timeZone") != null && !jsonObj.get("timeZone").isJsonNull()) && !jsonObj.get("timeZone").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `timeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZone").toString()));
      }
      if ((jsonObj.get("monthlyOnDay") != null && !jsonObj.get("monthlyOnDay").isJsonNull()) && !jsonObj.get("monthlyOnDay").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `monthlyOnDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("monthlyOnDay").toString()));
      }
      if ((jsonObj.get("weeklyOnDay") != null && !jsonObj.get("weeklyOnDay").isJsonNull()) && !jsonObj.get("weeklyOnDay").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `weeklyOnDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("weeklyOnDay").toString()));
      }
      if ((jsonObj.get("accountId") != null && !jsonObj.get("accountId").isJsonNull()) && !jsonObj.get("accountId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString()));
      }
      if ((jsonObj.get("batch") != null && !jsonObj.get("batch").isJsonNull()) && !jsonObj.get("batch").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `batch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("batch").toString()));
      }
      if ((jsonObj.get("billingCycleDay") != null && !jsonObj.get("billingCycleDay").isJsonNull()) && !jsonObj.get("billingCycleDay").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `billingCycleDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingCycleDay").toString()));
      }
      if ((jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonNull()) && !jsonObj.get("currency").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString()));
      }
      if ((jsonObj.get("paymentGatewayId") != null && !jsonObj.get("paymentGatewayId").isJsonNull()) && !jsonObj.get("paymentGatewayId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `paymentGatewayId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentGatewayId").toString()));
      }
      if ((jsonObj.get("billingRunId") != null && !jsonObj.get("billingRunId").isJsonNull()) && !jsonObj.get("billingRunId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `billingRunId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingRunId").toString()));
      }
  }

  public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
    @SuppressWarnings("unchecked")
    @Override
    public  TypeAdapter create(Gson gson, TypeToken type) {
       if (!ExpandedPaymentRun.class.isAssignableFrom(type.getRawType())) {
         return null; // this class only serializes 'ExpandedPaymentRun' and its subtypes
       }
       final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
       final TypeAdapter thisAdapter
                        = gson.getDelegateAdapter(this, TypeToken.get(ExpandedPaymentRun.class));

       return (TypeAdapter) new TypeAdapter() {
           @Override
           public void write(JsonWriter out, ExpandedPaymentRun 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 ExpandedPaymentRun read(JsonReader in) throws IOException {
             JsonElement jsonElement = elementAdapter.read(in);
             validateJsonElement(jsonElement);
             JsonObject jsonObj = jsonElement.getAsJsonObject();
             // store additional fields in the deserialized instance
             ExpandedPaymentRun 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 ExpandedPaymentRun given an JSON string
   *
   * @param jsonString JSON string
   * @return An instance of ExpandedPaymentRun
   * @throws IOException if the JSON string is invalid with respect to ExpandedPaymentRun
   */
  public static ExpandedPaymentRun fromJson(String jsonString) throws IOException {
    return JSON.getGson().fromJson(jsonString, ExpandedPaymentRun.class);
  }

  /**
   * Convert an instance of ExpandedPaymentRun to an JSON string
   *
   * @return JSON string
   */
  public String toJson() {
    return JSON.getGson().toJson(this);
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy