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

com.hopper.cloud.airlines.model.CfarOffer 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 com.google.gson.*;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.hopper.cloud.airlines.JSON;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.*;
import java.util.Map.Entry;

/**
 * A successful CFAR offer response
 */
@ApiModel(description = "A successful CFAR offer response")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-06-28T12:18:49.517876+02:00[Europe/Paris]")
public class CfarOffer {
  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private String id;

  public static final String SERIALIZED_NAME_PREMIUM = "premium";
  @SerializedName(SERIALIZED_NAME_PREMIUM)
  private String premium;

  public static final String SERIALIZED_NAME_COVERAGE = "coverage";
  @SerializedName(SERIALIZED_NAME_COVERAGE)
  private String coverage;

  public static final String SERIALIZED_NAME_COVERAGE_PERCENTAGE = "coverage_percentage";
  @SerializedName(SERIALIZED_NAME_COVERAGE_PERCENTAGE)
  private String coveragePercentage;

  public static final String SERIALIZED_NAME_COVERAGE_EXTENSION = "coverage_extension";
  @SerializedName(SERIALIZED_NAME_COVERAGE_EXTENSION)
  private String coverageExtension;

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

  public static final String SERIALIZED_NAME_TAXES_TOTAL = "taxes_total";
  @SerializedName(SERIALIZED_NAME_TAXES_TOTAL)
  private String taxesTotal;

  public static final String SERIALIZED_NAME_TAXES = "taxes";
  @SerializedName(SERIALIZED_NAME_TAXES)
  private List taxes = new ArrayList<>();

  public static final String SERIALIZED_NAME_REQUEST_TYPE = "request_type";
  @SerializedName(SERIALIZED_NAME_REQUEST_TYPE)
  private RequestType requestType;

  public static final String SERIALIZED_NAME_CONTRACT_EXPIRY_DATE_TIME = "contract_expiry_date_time";
  @SerializedName(SERIALIZED_NAME_CONTRACT_EXPIRY_DATE_TIME)
  private OffsetDateTime contractExpiryDateTime;

  public static final String SERIALIZED_NAME_CREATED_DATE_TIME = "created_date_time";
  @SerializedName(SERIALIZED_NAME_CREATED_DATE_TIME)
  private OffsetDateTime createdDateTime;

  public static final String SERIALIZED_NAME_ITINERARY = "itinerary";
  @SerializedName(SERIALIZED_NAME_ITINERARY)
  private CfarItinerary itinerary;

  public static final String SERIALIZED_NAME_CONTENTS = "contents";
  @SerializedName(SERIALIZED_NAME_CONTENTS)
  private Map contents = new HashMap<>();

  public static final String SERIALIZED_NAME_EXT_ATTRIBUTES = "ext_attributes";
  @SerializedName(SERIALIZED_NAME_EXT_ATTRIBUTES)
  private Map extAttributes = new HashMap<>();

  public static final String SERIALIZED_NAME_TERMS_CONDITIONS_URL= "terms_conditions_url";
  @SerializedName(SERIALIZED_NAME_TERMS_CONDITIONS_URL)
  private String termsConditionsUrl;

  public CfarOffer() {
  }

  public CfarOffer id(String id) {

    this.id = id;
    return this;
  }

  /**
   * Unique identifier for an offer
   * @return id
   **/
  @javax.annotation.Nonnull
  @ApiModelProperty(example = "2e1006b3-aba6-4899-8682-b95bce693c27", required = true, value = "Unique identifier for an offer")

  public String getId() {
    return id;
  }


  public void setId(String id) {
    this.id = id;
  }


  public CfarOffer premium(String premium) {

    this.premium = premium;
    return this;
  }

  /**
   * Amount per passenger to be paid by user for CFAR
   * @return premium
   **/
  @javax.annotation.Nonnull
  @ApiModelProperty(example = "20.80", required = true, value = "Amount per passenger to be paid by user for CFAR")

  public String getPremium() {
    return premium;
  }


  public void setPremium(String premium) {
    this.premium = premium;
  }


  public CfarOffer coverage(String coverage) {

    this.coverage = coverage;
    return this;
  }

  /**
   * Amount per passenger to be refunded to user upon CFAR exercise
   * @return coverage
   **/
  @javax.annotation.Nonnull
  @ApiModelProperty(example = "180.60", required = true, value = "Amount per passenger to be refunded to user upon CFAR exercise")

  public String getCoverage() {
    return coverage;
  }


  public void setCoverage(String coverage) {
    this.coverage = coverage;
  }


  public CfarOffer coveragePercentage(String coveragePercentage) {

    this.coveragePercentage = coveragePercentage;
    return this;
  }

  /**
   * Percentage of the amount to be refunded to customer compared to flight tickets price
   * @return coveragePercentage
   **/
  @javax.annotation.Nonnull
  @ApiModelProperty(example = "80.00", required = true, value = "Percentage of the amount to be refunded to customer compared to flight tickets price")

  public String getCoveragePercentage() {
    return coveragePercentage;
  }


  public void setCoveragePercentage(String coveragePercentage) {
    this.coveragePercentage = coveragePercentage;
  }

  public CfarOffer coverageExtension(String coverageExtension) {
    this.coverageExtension = coverageExtension;
    return this;
  }

  /**
   * Maximum amount added on top of the coverage to cover ancillaries
   * @return coverageExtension
   **/
  @ApiModelProperty(example = "40.00", value = "Maximum amount added on top of the coverage to cover ancillaries")
  public String getCoverageExtension() {
    return coverageExtension;
  }

  public void setCoverageExtension(String coverageExtension) {
    this.coverageExtension = coverageExtension;
  }

  public String getTaxesTotal() {
    return taxesTotal;
  }

  public void setTaxesTotal(String taxesTotal) {
    this.taxesTotal = taxesTotal;
  }

  public CfarOffer taxes(List taxes) {

    this.taxes = taxes;
    return this;
  }

  public CfarOffer addCfarTaxItem(CfarTax cfarTaxItem) {
    if (this.taxes != null) {
      this.taxes.add(cfarTaxItem);
    }
    return this;
  }

  public List getTaxes() {
    return taxes;
  }

  public void setTaxes(List taxes) {
    this.taxes = taxes;
  }


  public CfarOffer currency(String currency) {

    this.currency = currency;
    return this;
  }

  /**
   * Currency of offer
   * @return currency
   **/
  @javax.annotation.Nonnull
  @ApiModelProperty(example = "CAD", required = true, value = "Currency of offer")

  public String getCurrency() {
    return currency;
  }


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


  public CfarOffer requestType(RequestType requestType) {

    this.requestType = requestType;
    return this;
  }

  /**
   * Get requestType
   * @return requestType
   **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "")

  public RequestType getRequestType() {
    return requestType;
  }


  public void setRequestType(RequestType requestType) {
    this.requestType = requestType;
  }


  public CfarOffer contractExpiryDateTime(OffsetDateTime contractExpiryDateTime) {

    this.contractExpiryDateTime = contractExpiryDateTime;
    return this;
  }

  /**
   * A UTC [RFC3339](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) datetime; the date and time at which the CFAR contract will expire once purchased
   * @return contractExpiryDateTime
   **/
  @javax.annotation.Nonnull
  @ApiModelProperty(example = "2020-12-20T12:15:48Z", required = true, value = "A UTC [RFC3339](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) datetime; the date and time at which the CFAR contract will expire once purchased")

  public OffsetDateTime getContractExpiryDateTime() {
    return contractExpiryDateTime;
  }


  public void setContractExpiryDateTime(OffsetDateTime contractExpiryDateTime) {
    this.contractExpiryDateTime = contractExpiryDateTime;
  }


  public CfarOffer createdDateTime(OffsetDateTime createdDateTime) {

    this.createdDateTime = createdDateTime;
    return this;
  }

  /**
   * A UTC [RFC3339](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) datetime; the date and time at which a CFAR offer was created
   * @return createdDateTime
   **/
  @javax.annotation.Nonnull
  @ApiModelProperty(example = "2020-11-02T18:34:30Z", required = true, value = "A UTC [RFC3339](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) datetime; the date and time at which a CFAR offer was created")

  public OffsetDateTime getCreatedDateTime() {
    return createdDateTime;
  }


  public void setCreatedDateTime(OffsetDateTime createdDateTime) {
    this.createdDateTime = createdDateTime;
  }


  public CfarOffer itinerary(CfarItinerary itinerary) {

    this.itinerary = itinerary;
    return this;
  }

  /**
   * Get itinerary
   * @return itinerary
   **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "")

  public CfarItinerary getItinerary() {
    return itinerary;
  }


  public void setItinerary(CfarItinerary itinerary) {
    this.itinerary = itinerary;
  }


  public CfarOffer contents(Map contents) {

    this.contents = contents;
    return this;
  }

  public CfarOffer putContentItem(String key, CfarContents contentItem) {
    this.contents.put(key, contentItem);
    return this;
  }

  /**
   * Get contents
   * @return contents
   **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "contents")

  public Map getContents() {
    return contents;
  }


  public void setContents(Map contents) {
    this.contents = contents;
  }


  public CfarOffer extAttributes(Map extAttributes) {

    this.extAttributes = extAttributes;
    return this;
  }

  public CfarOffer putExtAttributesItem(String key, String extAttributesItem) {
    this.extAttributes.put(key, extAttributesItem);
    return this;
  }

  /**
   * Get extAttributes
   * @return extAttributes
   **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "")

  public Map getExtAttributes() {
    return extAttributes;
  }


  public void setExtAttributes(Map extAttributes) {
    this.extAttributes = extAttributes;
  }


  public CfarOffer termsConditionsUrl(String termsConditionsUrl) {

    this.termsConditionsUrl = termsConditionsUrl;
    return this;
  }

  /**
   * The URL to the terms and conditions for this offer
   * @return termsConditionsUrl
   **/
  @ApiModelProperty(example = "", value = "The URL to the terms and conditions for this offer")
  public String getTermsConditionsUrl() {
    return termsConditionsUrl;
  }


  public void setTermsConditionsUrl(String termsConditionsUrl) {
    this.termsConditionsUrl = termsConditionsUrl;
  }



  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CfarOffer cfarOffer = (CfarOffer) o;
    return Objects.equals(this.id, cfarOffer.id) &&
            Objects.equals(this.premium, cfarOffer.premium) &&
            Objects.equals(this.coverage, cfarOffer.coverage) &&
            Objects.equals(this.coveragePercentage, cfarOffer.coveragePercentage) &&
            Objects.equals(this.coverageExtension, cfarOffer.coverageExtension) &&
            Objects.equals(this.currency, cfarOffer.currency) &&
            Objects.equals(this.taxesTotal, cfarOffer.taxesTotal) &&
            Objects.equals(this.taxes, cfarOffer.taxes) &&
            Objects.equals(this.requestType, cfarOffer.requestType) &&
            Objects.equals(this.contractExpiryDateTime, cfarOffer.contractExpiryDateTime) &&
            Objects.equals(this.createdDateTime, cfarOffer.createdDateTime) &&
            Objects.equals(this.itinerary, cfarOffer.itinerary) &&
            Objects.equals(this.contents, cfarOffer.contents) &&
            Objects.equals(this.extAttributes, cfarOffer.extAttributes) &&
            Objects.equals(this.termsConditionsUrl, cfarOffer.termsConditionsUrl);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, premium, coverage, coveragePercentage, coverageExtension, currency, taxesTotal, taxes, requestType, contractExpiryDateTime, createdDateTime, itinerary, contents, extAttributes, termsConditionsUrl);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CfarOffer {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    premium: ").append(toIndentedString(premium)).append("\n");
    sb.append("    coverage: ").append(toIndentedString(coverage)).append("\n");
    sb.append("    coveragePercentage: ").append(toIndentedString(coveragePercentage)).append("\n");
    sb.append("    coverageExtension: ").append(toIndentedString(coverageExtension)).append("\n");
    sb.append("    taxesTotal: ").append(toIndentedString(taxesTotal)).append("\n");
    sb.append("    taxes: ").append(toIndentedString(taxes)).append("\n");
    sb.append("    currency: ").append(toIndentedString(currency)).append("\n");
    sb.append("    requestType: ").append(toIndentedString(requestType)).append("\n");
    sb.append("    contractExpiryDateTime: ").append(toIndentedString(contractExpiryDateTime)).append("\n");
    sb.append("    createdDateTime: ").append(toIndentedString(createdDateTime)).append("\n");
    sb.append("    itinerary: ").append(toIndentedString(itinerary)).append("\n");
    sb.append("    contents: ").append(toIndentedString(contents)).append("\n");
    sb.append("    extAttributes: ").append(toIndentedString(extAttributes)).append("\n");
    sb.append("    termsConditionsUrl: ").append(toIndentedString(termsConditionsUrl)).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 (!CfarOffer.class.isAssignableFrom(type.getRawType())) {
        return null; // this class only serializes 'CfarOffer' and its subtypes
      }
      final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
      final TypeAdapter thisAdapter
              = gson.getDelegateAdapter(this, TypeToken.get(CfarOffer.class));

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

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

      }.nullSafe();
    }
  }

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

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





© 2015 - 2024 Weber Informatics LLC | Privacy Policy