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

com.hopper.cloud.airlines.model.CreateAirlineSessionRequest 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 com.hopper.cloud.airlines.model.Device;
import com.hopper.cloud.airlines.model.UserInfo;
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;

/**
 * CreateAirlineSessionRequest
 */
@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 CreateAirlineSessionRequest {
  public static final String SERIALIZED_NAME_FLOW_TYPE = "flow_type";
  @SerializedName(SERIALIZED_NAME_FLOW_TYPE)
  private FlowType flowType;

  public static final String SERIALIZED_NAME_USER_INFO = "user_info";
  @SerializedName(SERIALIZED_NAME_USER_INFO)
  private UserInfo userInfo;

  public static final String SERIALIZED_NAME_DEVICE = "device";
  @SerializedName(SERIALIZED_NAME_DEVICE)
  private Device device;

  public static final String SERIALIZED_NAME_POINT_OF_SALE = "point_of_sale";
  @SerializedName(SERIALIZED_NAME_POINT_OF_SALE)
  private String pointOfSale;

  public static final String SERIALIZED_NAME_LANGUAGE = "language";
  @SerializedName(SERIALIZED_NAME_LANGUAGE)
  private String language;

    public static final String SERIALIZED_NAME_PRODUCT = "product";
    @SerializedName(SERIALIZED_NAME_PRODUCT)
    private Product product;

  public CreateAirlineSessionRequest() { 
  }

    public CreateAirlineSessionRequest flowType(FlowType flowType) {

        this.flowType = flowType;
        return this;
    }

    /**
     * The flow type for which the session is opened.
     * @return flowType
     **/
    @javax.annotation.Nonnull
    @ApiModelProperty(required = true, value = "The flow type for which the session is opened.")

    public FlowType getFlowType() {
        return flowType;
    }


    public void setFlowType(FlowType flowType) {
        this.flowType = flowType;
    }


  public CreateAirlineSessionRequest userInfo(UserInfo userInfo) {
    
    this.userInfo = userInfo;
    return this;
  }

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

  public UserInfo getUserInfo() {
    return userInfo;
  }


  public void setUserInfo(UserInfo userInfo) {
    this.userInfo = userInfo;
  }


  public CreateAirlineSessionRequest device(Device device) {
    
    this.device = device;
    return this;
  }

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

  public Device getDevice() {
    return device;
  }


  public void setDevice(Device device) {
    this.device = device;
  }


  public CreateAirlineSessionRequest pointOfSale(String pointOfSale) {
    
    this.pointOfSale = pointOfSale;
    return this;
  }

   /**
   * The point of sale related to the user. Must be an ISO 3166-1-alpha-2 country code
   * @return pointOfSale
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "The point of sale related to the user. Must be an ISO 3166-1-alpha-2 country code")

  public String getPointOfSale() {
    return pointOfSale;
  }


  public void setPointOfSale(String pointOfSale) {
    this.pointOfSale = pointOfSale;
  }


  public CreateAirlineSessionRequest language(String language) {
    
    this.language = language;
    return this;
  }

   /**
   * The language associated with the user. Must be an ISO_639-1 country code
   * @return language
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "The language associated with the user. Must be an ISO_639-1 country code")

  public String getLanguage() {
    return language;
  }


  public void setLanguage(String language) {
    this.language = language;
  }

  public CreateAirlineSessionRequest product(Product product) {

    this.product = product;
    return this;
  }

  /**
  * The product for which the session is opened.
  * @return product
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "The product for which the session is opened.")

  public Product getProduct() {
        return product;
    }


  public void setProduct(Product product) {
        this.product = product;
    }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CreateAirlineSessionRequest createAirlineSessionRequest = (CreateAirlineSessionRequest) o;
    return Objects.equals(this.userInfo, createAirlineSessionRequest.userInfo) &&
        Objects.equals(this.device, createAirlineSessionRequest.device) &&
        Objects.equals(this.pointOfSale, createAirlineSessionRequest.pointOfSale) &&
        Objects.equals(this.language, createAirlineSessionRequest.language) &&
        Objects.equals(this.product, createAirlineSessionRequest.product);
  }

  @Override
  public int hashCode() {
    return Objects.hash(userInfo, device, pointOfSale, language, product);
  }

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

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

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

       }.nullSafe();
    }
  }

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

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





© 2015 - 2024 Weber Informatics LLC | Privacy Policy