jp.co.freee.accounting.models.DealCreateParams Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of freee-accounting-sdk Show documentation
Show all versions of freee-accounting-sdk Show documentation
freee accounting client SDK for Java
/*
* freee API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package jp.co.freee.accounting.models;
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 java.util.ArrayList;
import java.util.List;
import jp.co.freee.accounting.models.DealCreateParamsDetails;
import jp.co.freee.accounting.models.DealCreateParamsPayments;
/**
* DealCreateParams
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class DealCreateParams {
public static final String SERIALIZED_NAME_COMPANY_ID = "company_id";
@SerializedName(SERIALIZED_NAME_COMPANY_ID)
private Integer companyId;
public static final String SERIALIZED_NAME_DETAILS = "details";
@SerializedName(SERIALIZED_NAME_DETAILS)
private List details = new ArrayList<>();
public static final String SERIALIZED_NAME_DUE_DATE = "due_date";
@SerializedName(SERIALIZED_NAME_DUE_DATE)
private String dueDate;
public static final String SERIALIZED_NAME_ISSUE_DATE = "issue_date";
@SerializedName(SERIALIZED_NAME_ISSUE_DATE)
private String issueDate;
public static final String SERIALIZED_NAME_PARTNER_CODE = "partner_code";
@SerializedName(SERIALIZED_NAME_PARTNER_CODE)
private String partnerCode;
public static final String SERIALIZED_NAME_PARTNER_ID = "partner_id";
@SerializedName(SERIALIZED_NAME_PARTNER_ID)
private Integer partnerId;
public static final String SERIALIZED_NAME_PAYMENTS = "payments";
@SerializedName(SERIALIZED_NAME_PAYMENTS)
private List payments = null;
public static final String SERIALIZED_NAME_RECEIPT_IDS = "receipt_ids";
@SerializedName(SERIALIZED_NAME_RECEIPT_IDS)
private List receiptIds = null;
public static final String SERIALIZED_NAME_REF_NUMBER = "ref_number";
@SerializedName(SERIALIZED_NAME_REF_NUMBER)
private String refNumber;
/**
* 収支区分 (収入: income, 支出: expense)
*/
@JsonAdapter(TypeEnum.Adapter.class)
public enum TypeEnum {
INCOME("income"),
EXPENSE("expense");
private String value;
TypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static TypeEnum fromValue(String value) {
for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public TypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return TypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_TYPE = "type";
@SerializedName(SERIALIZED_NAME_TYPE)
private TypeEnum type;
public DealCreateParams() {
}
public DealCreateParams companyId(Integer companyId) {
this.companyId = companyId;
return this;
}
/**
* 事業所ID
* minimum: 1
* maximum: 2147483647
* @return companyId
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "1", required = true, value = "事業所ID")
public Integer getCompanyId() {
return companyId;
}
public void setCompanyId(Integer companyId) {
this.companyId = companyId;
}
public DealCreateParams details(List details) {
this.details = details;
return this;
}
public DealCreateParams addDetailsItem(DealCreateParamsDetails detailsItem) {
this.details.add(detailsItem);
return this;
}
/**
* Get details
* @return details
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List getDetails() {
return details;
}
public void setDetails(List details) {
this.details = details;
}
public DealCreateParams dueDate(String dueDate) {
this.dueDate = dueDate;
return this;
}
/**
* 支払期日(yyyy-mm-dd)
* @return dueDate
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "2019-12-17", value = "支払期日(yyyy-mm-dd)")
public String getDueDate() {
return dueDate;
}
public void setDueDate(String dueDate) {
this.dueDate = dueDate;
}
public DealCreateParams issueDate(String issueDate) {
this.issueDate = issueDate;
return this;
}
/**
* 発生日 (yyyy-mm-dd)
* @return issueDate
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "2019-12-17", required = true, value = "発生日 (yyyy-mm-dd)")
public String getIssueDate() {
return issueDate;
}
public void setIssueDate(String issueDate) {
this.issueDate = issueDate;
}
public DealCreateParams partnerCode(String partnerCode) {
this.partnerCode = partnerCode;
return this;
}
/**
* 取引先コード
* @return partnerCode
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "code001", value = "取引先コード")
public String getPartnerCode() {
return partnerCode;
}
public void setPartnerCode(String partnerCode) {
this.partnerCode = partnerCode;
}
public DealCreateParams partnerId(Integer partnerId) {
this.partnerId = partnerId;
return this;
}
/**
* 取引先ID
* minimum: 1
* maximum: 2147483647
* @return partnerId
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "1", value = "取引先ID")
public Integer getPartnerId() {
return partnerId;
}
public void setPartnerId(Integer partnerId) {
this.partnerId = partnerId;
}
public DealCreateParams payments(List payments) {
this.payments = payments;
return this;
}
public DealCreateParams addPaymentsItem(DealCreateParamsPayments paymentsItem) {
if (this.payments == null) {
this.payments = new ArrayList<>();
}
this.payments.add(paymentsItem);
return this;
}
/**
* 支払行一覧(配列):未指定の場合、未決済の取引を作成します。
* @return payments
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "支払行一覧(配列):未指定の場合、未決済の取引を作成します。")
public List getPayments() {
return payments;
}
public void setPayments(List payments) {
this.payments = payments;
}
public DealCreateParams receiptIds(List receiptIds) {
this.receiptIds = receiptIds;
return this;
}
public DealCreateParams addReceiptIdsItem(Integer receiptIdsItem) {
if (this.receiptIds == null) {
this.receiptIds = new ArrayList<>();
}
this.receiptIds.add(receiptIdsItem);
return this;
}
/**
* 証憑ファイルID(ファイルボックスのファイルID)(配列)
* @return receiptIds
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "証憑ファイルID(ファイルボックスのファイルID)(配列)")
public List getReceiptIds() {
return receiptIds;
}
public void setReceiptIds(List receiptIds) {
this.receiptIds = receiptIds;
}
public DealCreateParams refNumber(String refNumber) {
this.refNumber = refNumber;
return this;
}
/**
* 管理番号
* @return refNumber
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "1", value = "管理番号")
public String getRefNumber() {
return refNumber;
}
public void setRefNumber(String refNumber) {
this.refNumber = refNumber;
}
public DealCreateParams type(TypeEnum type) {
this.type = type;
return this;
}
/**
* 収支区分 (収入: income, 支出: expense)
* @return type
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "income", required = true, value = "収支区分 (収入: income, 支出: expense)")
public TypeEnum getType() {
return type;
}
public void setType(TypeEnum type) {
this.type = type;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DealCreateParams dealCreateParams = (DealCreateParams) o;
return Objects.equals(this.companyId, dealCreateParams.companyId) &&
Objects.equals(this.details, dealCreateParams.details) &&
Objects.equals(this.dueDate, dealCreateParams.dueDate) &&
Objects.equals(this.issueDate, dealCreateParams.issueDate) &&
Objects.equals(this.partnerCode, dealCreateParams.partnerCode) &&
Objects.equals(this.partnerId, dealCreateParams.partnerId) &&
Objects.equals(this.payments, dealCreateParams.payments) &&
Objects.equals(this.receiptIds, dealCreateParams.receiptIds) &&
Objects.equals(this.refNumber, dealCreateParams.refNumber) &&
Objects.equals(this.type, dealCreateParams.type);
}
@Override
public int hashCode() {
return Objects.hash(companyId, details, dueDate, issueDate, partnerCode, partnerId, payments, receiptIds, refNumber, type);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DealCreateParams {\n");
sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n");
sb.append(" details: ").append(toIndentedString(details)).append("\n");
sb.append(" dueDate: ").append(toIndentedString(dueDate)).append("\n");
sb.append(" issueDate: ").append(toIndentedString(issueDate)).append("\n");
sb.append(" partnerCode: ").append(toIndentedString(partnerCode)).append("\n");
sb.append(" partnerId: ").append(toIndentedString(partnerId)).append("\n");
sb.append(" payments: ").append(toIndentedString(payments)).append("\n");
sb.append(" receiptIds: ").append(toIndentedString(receiptIds)).append("\n");
sb.append(" refNumber: ").append(toIndentedString(refNumber)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).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 ");
}
}