com.hopper.cloud.airlines.model.UpdateCfarContractFormsOfPaymentRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloud-airlines-java Show documentation
Show all versions of cloud-airlines-java Show documentation
Use the Hopper cloud airlines Web Services in Java!
The newest version!
/*
* Airline 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 com.hopper.cloud.airlines.model;
import java.util.*;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.google.gson.*;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import java.io.IOException;
import com.google.gson.reflect.TypeToken;
import com.hopper.cloud.airlines.JSON;
/**
* Request object used to update the forms of payment associated with a CFAR contract
*/
@ApiModel(description = "Request object used to update the forms of payment associated with a CFAR contract")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-06-28T12:18:49.517876+02:00[Europe/Paris]")
@JsonInclude(JsonInclude.Include. NON_NULL)
public class UpdateCfarContractFormsOfPaymentRequest {
public static final String SERIALIZED_FORMS_OF_PAYMENT = "forms_of_payment";
@SerializedName(SERIALIZED_FORMS_OF_PAYMENT)
private List formsOfPayment;
public UpdateCfarContractFormsOfPaymentRequest() {
}
public UpdateCfarContractFormsOfPaymentRequest setFormsOfPayment(List formsOfPayment) {
this.formsOfPayment = formsOfPayment;
return this;
}
public List getFormsOfPayment() {
return formsOfPayment;
}
public UpdateCfarContractFormsOfPaymentRequest addFormOfPaymentItem(FormOfPayment formOfPaymentItem) {
if (this.formsOfPayment == null) {
this.formsOfPayment = new ArrayList<>();
}
this.formsOfPayment.add(formOfPaymentItem);
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UpdateCfarContractFormsOfPaymentRequest updateCfarContractRequest = (UpdateCfarContractFormsOfPaymentRequest) o;
return Objects.equals(this.formsOfPayment, updateCfarContractRequest.formsOfPayment);
}
@Override
public int hashCode() {
return Objects.hash(formsOfPayment);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UpdateCfarFormOfPaymentRequest {\n");
sb.append(" formsOfPayment: ").append(toIndentedString(formsOfPayment)).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 class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
if (!UpdateCfarContractFormsOfPaymentRequest.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'UpdateCfarFormOfPaymentRequest' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(UpdateCfarContractFormsOfPaymentRequest.class));
return (TypeAdapter) new TypeAdapter() {
@Override
public void write(JsonWriter out, UpdateCfarContractFormsOfPaymentRequest value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public UpdateCfarContractFormsOfPaymentRequest read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of UpdateCfarFormOfPaymentRequest given an JSON string
*
* @param jsonString JSON string
* @return An instance of UpdateCfarFormOfPaymentRequest
* @throws IOException if the JSON string is invalid with respect to UpdateCfarFormOfPaymentRequest
*/
public static UpdateCfarContractFormsOfPaymentRequest fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, UpdateCfarContractFormsOfPaymentRequest.class);
}
/**
* Convert an instance of UpdateCfarContractRequest to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy