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

com.hopper.cloud.airlines.model.MarkCfarContractExerciseCompleteRequest Maven / Gradle / Ivy

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.Objects;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.google.gson.TypeAdapter;
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 com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;

import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Set;

import com.hopper.cloud.airlines.JSON;

/**
 * An update CFAR contract exercise request
 */
@ApiModel(description = "An update CFAR contract exercise request")
@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 MarkCfarContractExerciseCompleteRequest {
    public static final String SERIALIZED_NAME_REFUND_AMOUNT = "refund_amount";
    @SerializedName(SERIALIZED_NAME_REFUND_AMOUNT)
    private String refundAmount;

    public static final String SERIALIZED_NAME_REFUND_METHOD = "refund_method";
    @SerializedName(SERIALIZED_NAME_REFUND_METHOD)
    private AirlineRefundMethod refundMethod;

    public MarkCfarContractExerciseCompleteRequest() {
    }

    public MarkCfarContractExerciseCompleteRequest refundAmount(String refundAmount) {

        this.refundAmount = refundAmount;
        return this;
    }

    /**
     * Amount refunded to the customer
     * @return refundAmount
     **/
    @ApiModelProperty(example = "123.45", value = "Amount refunded to the customer")
    public String getRefundAmount() {
        return refundAmount;
    }


    public void setRefundAmount(String refundAmount) {
        this.refundAmount = refundAmount;
    }

    public MarkCfarContractExerciseCompleteRequest refundMethod(AirlineRefundMethod refundMethod) {

        this.refundMethod = refundMethod;
        return this;
    }

    /**
     * The refund method chosen by the customer
     * @return refundMethod
     **/
    @javax.annotation.Nonnull
    @ApiModelProperty(value = "The refund method chosen by the customer")

    public AirlineRefundMethod getRefundMethod() {
        return refundMethod;
    }


    public void setRefundMethod(AirlineRefundMethod refundMethod) {
        this.refundMethod = refundMethod;
    }



    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        MarkCfarContractExerciseCompleteRequest markCfarContractExerciseCompleteRequest = (MarkCfarContractExerciseCompleteRequest) o;
        return Objects.equals(this.refundAmount, markCfarContractExerciseCompleteRequest.refundAmount) &&
                Objects.equals(this.refundMethod, markCfarContractExerciseCompleteRequest.refundMethod);
    }

    @Override
    public int hashCode() {
        return Objects.hash(refundAmount, refundMethod);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class MarkCfarContractExerciseCompleteRequest {\n");
        sb.append("    refundAmount: ").append(toIndentedString(refundAmount)).append("\n");
        sb.append("    refundMethod: ").append(toIndentedString(refundMethod)).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 (!MarkCfarContractExerciseCompleteRequest.class.isAssignableFrom(type.getRawType())) {
                return null; // this class only serializes 'MarkCfarContractExerciseCompleteRequest' and its subtypes
            }
            final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
            final TypeAdapter thisAdapter
                    = gson.getDelegateAdapter(this, TypeToken.get(MarkCfarContractExerciseCompleteRequest.class));

            return (TypeAdapter) new TypeAdapter() {
                @Override
                public void write(JsonWriter out, MarkCfarContractExerciseCompleteRequest value) throws IOException {
                    JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
                    elementAdapter.write(out, obj);
                }

                @Override
                public MarkCfarContractExerciseCompleteRequest read(JsonReader in) throws IOException {
                    JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
                    return thisAdapter.fromJsonTree(jsonObj);
                }

            }.nullSafe();
        }
    }

    /**
     * Create an instance of MarkCfarContractExerciseCompleteRequest given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of MarkCfarContractExerciseCompleteRequest
     * @throws IOException if the JSON string is invalid with respect to MarkCfarContractExerciseCompleteRequest
     */
    public static MarkCfarContractExerciseCompleteRequest fromJson(String jsonString) throws IOException {
        return JSON.getGson().fromJson(jsonString, MarkCfarContractExerciseCompleteRequest.class);
    }

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





© 2015 - 2024 Weber Informatics LLC | Privacy Policy