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

com.hopper.cloud.airlines.model.CreateCfarContractExerciseRequest 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.fasterxml.jackson.annotation.JsonInclude;
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.net.URL;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
 * A create CFAR contract exercise request
 */
@ApiModel(description = "A create 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 CreateCfarContractExerciseRequest {
  public static final String SERIALIZED_NAME_CONTRACT_ID = "contract_id";
  @SerializedName(SERIALIZED_NAME_CONTRACT_ID)
  private String contractId;

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

  public static final String SERIALIZED_NAME_PNR_REFERENCE = "pnr_reference";
  @SerializedName(SERIALIZED_NAME_PNR_REFERENCE)
  private String pnrReference;

  public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "email_address";
  @SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
  private String emailAddress;

  public static final String SERIALIZED_NAME_AIRLINE_REFUND_PENALTY = "airline_refund_penalty";
  @SerializedName(SERIALIZED_NAME_AIRLINE_REFUND_PENALTY)
  private String airlineRefundPenalty;

  public static final String SERIALIZED_NAME_AIRLINE_REFUND_METHOD = "airline_refund_method";
  @SerializedName(SERIALIZED_NAME_AIRLINE_REFUND_METHOD)
  private AirlineRefundMethod airlineRefundMethod;

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

  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_SESSION = "session";
  @SerializedName(SERIALIZED_NAME_SESSION)
  private CreateAirlineCfarSessionRequest session = null;

  public static final String SERIALIZED_NAME_CALLBACK_URL = "callback_url";
  @SerializedName(SERIALIZED_NAME_CALLBACK_URL)
  private URL callbackUrl = null;

  public static final String SERIALIZED_NAME_REDIRECTBACK_URL = "redirectback_url";
  @SerializedName(SERIALIZED_NAME_REDIRECTBACK_URL)
  private URL redirectbackUrl = null;

  public static final String SERIALIZED_NAME_FIRST_NAME = "first_name";
  @SerializedName(SERIALIZED_NAME_FIRST_NAME)
  private String firstName;

  public static final String SERIALIZED_NAME_LAST_NAME = "last_name";
  @SerializedName(SERIALIZED_NAME_LAST_NAME)
  private String lastName;

  public CreateCfarContractExerciseRequest() {
  }

  public CreateCfarContractExerciseRequest contractId(String contractId) {

    this.contractId = contractId;
    return this;
  }

  /**
   * A unique identifier for a CFAR contract
   * @return contractId
   **/
  @javax.annotation.Nonnull
  @ApiModelProperty(example = "bf3291e3-5098-4bb1-90d0-0d4ebb25fe46", required = true, value = "A unique identifier for a CFAR contract")

  public String getContractId() {
    return contractId;
  }


  public void setContractId(String contractId) {
    this.contractId = contractId;
  }


  public CreateCfarContractExerciseRequest itinerary(CfarCreateExerciseItinerary itinerary) {

    this.itinerary = itinerary;
    return this;
  }

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

  public CfarCreateExerciseItinerary getItinerary() {
    return itinerary;
  }


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


  public CreateCfarContractExerciseRequest pnrReference(String pnrReference) {

    this.pnrReference = pnrReference;
    return this;
  }

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

  public String getPnrReference() {
    return pnrReference;
  }


  public void setPnrReference(String pnrReference) {
    this.pnrReference = pnrReference;
  }


  public CreateCfarContractExerciseRequest emailAddress(String emailAddress) {

    this.emailAddress = emailAddress;
    return this;
  }

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

  public String getEmailAddress() {
    return emailAddress;
  }


  public void setEmailAddress(String emailAddress) {
    this.emailAddress = emailAddress;
  }


  public CreateCfarContractExerciseRequest airlineRefundPenalty(String airlineRefundPenalty) {

    this.airlineRefundPenalty = airlineRefundPenalty;
    return this;
  }

  /**
   * Get airlineRefundPenalty
   * @return airlineRefundPenalty
   **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getAirlineRefundPenalty() {
    return airlineRefundPenalty;
  }


  public void setAirlineRefundPenalty(String airlineRefundPenalty) {
    this.airlineRefundPenalty = airlineRefundPenalty;
  }


  public CreateCfarContractExerciseRequest airlineRefundMethod(AirlineRefundMethod airlineRefundMethod) {

    this.airlineRefundMethod = airlineRefundMethod;
    return this;
  }

  /**
   * Get airlineRefundMethod
   * @return airlineRefundMethod
   **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public AirlineRefundMethod getAirlineRefundMethod() {
    return airlineRefundMethod;
  }


  public void setAirlineRefundMethod(AirlineRefundMethod airlineRefundMethod) {
    this.airlineRefundMethod = airlineRefundMethod;
  }


  public CreateCfarContractExerciseRequest currency(String currency) {

    this.currency = currency;
    return this;
  }

  /**
   * Get currency
   * @return currency
   **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "CAD", value = "")

  public String getCurrency() {
    return currency;
  }


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


  public CreateCfarContractExerciseRequest extAttributes(Map extAttributes) {

    this.extAttributes = extAttributes;
    return this;
  }

  public CreateCfarContractExerciseRequest 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 CreateAirlineCfarSessionRequest getSession() {
    return session;
  }

  public void setSession(CreateAirlineCfarSessionRequest session) {
    this.session = session;
  }
  public CreateCfarContractExerciseRequest session(CreateAirlineCfarSessionRequest session) {
    this.session = session;
    return this;
  }

  public URL getCallbackUrl() {
    return callbackUrl;
  }

  public void setCallbackUrl(URL callbackUrl) {
    this.callbackUrl = callbackUrl;
  }

  public CreateCfarContractExerciseRequest callbackUrl(URL callbackUrl) {
    this.callbackUrl = callbackUrl;
    return this;
  }

  public URL getRedirectbackUrl() {
    return redirectbackUrl;
  }

  public void setRedirectbackUrl(URL redirectbackUrl) {
    this.redirectbackUrl = redirectbackUrl;
  }

  public CreateCfarContractExerciseRequest redirectbackUrl(URL redirectbackUrl) {
    this.redirectbackUrl = redirectbackUrl;
    return this;
  }

  public String getFirstName() {
    return firstName;
  }

  public void setFirstName(String firstName) {
    this.firstName = firstName;
  }

  public CreateCfarContractExerciseRequest firstName(String firstName) {
    this.firstName = firstName;
    return this;
  }

  public String getLastName() {
    return lastName;
  }

  public void setLastName(String lastName) {
    this.lastName = lastName;
  }

  public CreateCfarContractExerciseRequest lastName(String lastName) {
    this.lastName = lastName;
    return this;
  }
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CreateCfarContractExerciseRequest createCfarContractExerciseRequest = (CreateCfarContractExerciseRequest) o;
    return Objects.equals(this.contractId, createCfarContractExerciseRequest.contractId) &&
            Objects.equals(this.itinerary, createCfarContractExerciseRequest.itinerary) &&
            Objects.equals(this.pnrReference, createCfarContractExerciseRequest.pnrReference) &&
            Objects.equals(this.emailAddress, createCfarContractExerciseRequest.emailAddress) &&
            Objects.equals(this.airlineRefundPenalty, createCfarContractExerciseRequest.airlineRefundPenalty) &&
            Objects.equals(this.airlineRefundMethod, createCfarContractExerciseRequest.airlineRefundMethod) &&
            Objects.equals(this.currency, createCfarContractExerciseRequest.currency) &&
            Objects.equals(this.extAttributes, createCfarContractExerciseRequest.extAttributes) &&
            Objects.equals(this.session, createCfarContractExerciseRequest.session) &&
            Objects.equals(this.callbackUrl, createCfarContractExerciseRequest.callbackUrl) &&
            Objects.equals(this.callbackUrl, createCfarContractExerciseRequest.redirectbackUrl) &&
            Objects.equals(this.firstName, createCfarContractExerciseRequest.firstName) &&
            Objects.equals(this.lastName, createCfarContractExerciseRequest.lastName);
  }

  @Override
  public int hashCode() {
    return Objects.hash(contractId, itinerary, pnrReference, emailAddress, airlineRefundPenalty, airlineRefundMethod, currency, extAttributes, session, callbackUrl, redirectbackUrl, firstName, lastName);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CreateCfarContractExerciseRequest {\n");
    sb.append("    contractId: ").append(toIndentedString(contractId)).append("\n");
    sb.append("    itinerary: ").append(toIndentedString(itinerary)).append("\n");
    sb.append("    pnrReference: ").append(toIndentedString(pnrReference)).append("\n");
    sb.append("    emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
    sb.append("    airlineRefundPenalty: ").append(toIndentedString(airlineRefundPenalty)).append("\n");
    sb.append("    airlineRefundMethod: ").append(toIndentedString(airlineRefundMethod)).append("\n");
    sb.append("    currency: ").append(toIndentedString(currency)).append("\n");
    sb.append("    extAttributes: ").append(toIndentedString(extAttributes)).append("\n");
    sb.append("    session: ").append(toIndentedString(session)).append("\n");
    sb.append("    callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n");
    sb.append("    redirectbackUrl: ").append(toIndentedString(redirectbackUrl)).append("\n");
    sb.append("    firstName: ").append(toIndentedString(firstName)).append("\n");
    sb.append("    lastName: ").append(toIndentedString(lastName)).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 (!CreateCfarContractExerciseRequest.class.isAssignableFrom(type.getRawType())) {
        return null; // this class only serializes 'CreateCfarContractExerciseRequest' and its subtypes
      }
      final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
      final TypeAdapter thisAdapter
              = gson.getDelegateAdapter(this, TypeToken.get(CreateCfarContractExerciseRequest.class));

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

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

      }.nullSafe();
    }
  }

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

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





© 2015 - 2024 Weber Informatics LLC | Privacy Policy