<?php

/**
 * Adyen Checkout API
 *
 * The version of the OpenAPI document: 71
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 6.0.1
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


namespace Adyen\Model\Checkout;

use \ArrayAccess;
use Adyen\Model\Checkout\ObjectSerializer;

/**
 * AdditionalDataAirline Class Doc Comment
 *
 * @category Class
 * @package  Adyen
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<string, mixed>
 */
class AdditionalDataAirline implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $openAPIModelName = 'AdditionalDataAirline';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'airlineAgencyInvoiceNumber' => 'string',
        'airlineAgencyPlanName' => 'string',
        'airlineAirlineCode' => 'string',
        'airlineAirlineDesignatorCode' => 'string',
        'airlineBoardingFee' => 'string',
        'airlineComputerizedReservationSystem' => 'string',
        'airlineCustomerReferenceNumber' => 'string',
        'airlineDocumentType' => 'string',
        'airlineFlightDate' => 'string',
        'airlineIssueDate' => 'string',
        'airlineLegCarrierCode' => 'string',
        'airlineLegClassOfTravel' => 'string',
        'airlineLegDateOfTravel' => 'string',
        'airlineLegDepartAirport' => 'string',
        'airlineLegDepartTax' => 'string',
        'airlineLegDestinationCode' => 'string',
        'airlineLegFareBaseCode' => 'string',
        'airlineLegFlightNumber' => 'string',
        'airlineLegStopOverCode' => 'string',
        'airlinePassengerDateOfBirth' => 'string',
        'airlinePassengerFirstName' => 'string',
        'airlinePassengerLastName' => 'string',
        'airlinePassengerPhoneNumber' => 'string',
        'airlinePassengerTravellerType' => 'string',
        'airlinePassengerName' => 'string',
        'airlineTicketIssueAddress' => 'string',
        'airlineTicketNumber' => 'string',
        'airlineTravelAgencyCode' => 'string',
        'airlineTravelAgencyName' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      * @phpstan-var array<string, string|null>
      * @psalm-var array<string, string|null>
      */
    protected static $openAPIFormats = [
        'airlineAgencyInvoiceNumber' => null,
        'airlineAgencyPlanName' => null,
        'airlineAirlineCode' => null,
        'airlineAirlineDesignatorCode' => null,
        'airlineBoardingFee' => null,
        'airlineComputerizedReservationSystem' => null,
        'airlineCustomerReferenceNumber' => null,
        'airlineDocumentType' => null,
        'airlineFlightDate' => null,
        'airlineIssueDate' => null,
        'airlineLegCarrierCode' => null,
        'airlineLegClassOfTravel' => null,
        'airlineLegDateOfTravel' => null,
        'airlineLegDepartAirport' => null,
        'airlineLegDepartTax' => null,
        'airlineLegDestinationCode' => null,
        'airlineLegFareBaseCode' => null,
        'airlineLegFlightNumber' => null,
        'airlineLegStopOverCode' => null,
        'airlinePassengerDateOfBirth' => null,
        'airlinePassengerFirstName' => null,
        'airlinePassengerLastName' => null,
        'airlinePassengerPhoneNumber' => null,
        'airlinePassengerTravellerType' => null,
        'airlinePassengerName' => null,
        'airlineTicketIssueAddress' => null,
        'airlineTicketNumber' => null,
        'airlineTravelAgencyCode' => null,
        'airlineTravelAgencyName' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static $openAPINullables = [
        'airlineAgencyInvoiceNumber' => false,
        'airlineAgencyPlanName' => false,
        'airlineAirlineCode' => false,
        'airlineAirlineDesignatorCode' => false,
        'airlineBoardingFee' => false,
        'airlineComputerizedReservationSystem' => false,
        'airlineCustomerReferenceNumber' => false,
        'airlineDocumentType' => false,
        'airlineFlightDate' => false,
        'airlineIssueDate' => false,
        'airlineLegCarrierCode' => false,
        'airlineLegClassOfTravel' => false,
        'airlineLegDateOfTravel' => false,
        'airlineLegDepartAirport' => false,
        'airlineLegDepartTax' => false,
        'airlineLegDestinationCode' => false,
        'airlineLegFareBaseCode' => false,
        'airlineLegFlightNumber' => false,
        'airlineLegStopOverCode' => false,
        'airlinePassengerDateOfBirth' => false,
        'airlinePassengerFirstName' => false,
        'airlinePassengerLastName' => false,
        'airlinePassengerPhoneNumber' => false,
        'airlinePassengerTravellerType' => false,
        'airlinePassengerName' => false,
        'airlineTicketIssueAddress' => false,
        'airlineTicketNumber' => false,
        'airlineTravelAgencyCode' => false,
        'airlineTravelAgencyName' => false
    ];

    /**
      * If a nullable field gets set to null, insert it here
      *
      * @var boolean[]
      */
    protected $openAPINullablesSetToNull = [];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPITypes()
    {
        return self::$openAPITypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPIFormats()
    {
        return self::$openAPIFormats;
    }

    /**
     * Array of nullable properties
     *
     * @return array
     */
    protected static function openAPINullables(): array
    {
        return self::$openAPINullables;
    }

    /**
     * Array of nullable field names deliberately set to null
     *
     * @return boolean[]
     */
    private function getOpenAPINullablesSetToNull(): array
    {
        return $this->openAPINullablesSetToNull;
    }

    /**
     * Setter - Array of nullable field names deliberately set to null
     *
     * @param boolean[] $openAPINullablesSetToNull
     */
    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
    {
        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
    }

    /**
     * Checks if a property is nullable
     *
     * @param string $property
     * @return bool
     */
    public static function isNullable(string $property): bool
    {
        return self::openAPINullables()[$property] ?? false;
    }

    /**
     * Checks if a nullable property is set to null.
     *
     * @param string $property
     * @return bool
     */
    public function isNullableSetToNull(string $property): bool
    {
        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'airlineAgencyInvoiceNumber' => 'airline.agency_invoice_number',
        'airlineAgencyPlanName' => 'airline.agency_plan_name',
        'airlineAirlineCode' => 'airline.airline_code',
        'airlineAirlineDesignatorCode' => 'airline.airline_designator_code',
        'airlineBoardingFee' => 'airline.boarding_fee',
        'airlineComputerizedReservationSystem' => 'airline.computerized_reservation_system',
        'airlineCustomerReferenceNumber' => 'airline.customer_reference_number',
        'airlineDocumentType' => 'airline.document_type',
        'airlineFlightDate' => 'airline.flight_date',
        'airlineIssueDate' => 'airline.issue_date',
        'airlineLegCarrierCode' => 'airline.leg.carrier_code',
        'airlineLegClassOfTravel' => 'airline.leg.class_of_travel',
        'airlineLegDateOfTravel' => 'airline.leg.date_of_travel',
        'airlineLegDepartAirport' => 'airline.leg.depart_airport',
        'airlineLegDepartTax' => 'airline.leg.depart_tax',
        'airlineLegDestinationCode' => 'airline.leg.destination_code',
        'airlineLegFareBaseCode' => 'airline.leg.fare_base_code',
        'airlineLegFlightNumber' => 'airline.leg.flight_number',
        'airlineLegStopOverCode' => 'airline.leg.stop_over_code',
        'airlinePassengerDateOfBirth' => 'airline.passenger.date_of_birth',
        'airlinePassengerFirstName' => 'airline.passenger.first_name',
        'airlinePassengerLastName' => 'airline.passenger.last_name',
        'airlinePassengerPhoneNumber' => 'airline.passenger.phone_number',
        'airlinePassengerTravellerType' => 'airline.passenger.traveller_type',
        'airlinePassengerName' => 'airline.passenger_name',
        'airlineTicketIssueAddress' => 'airline.ticket_issue_address',
        'airlineTicketNumber' => 'airline.ticket_number',
        'airlineTravelAgencyCode' => 'airline.travel_agency_code',
        'airlineTravelAgencyName' => 'airline.travel_agency_name'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'airlineAgencyInvoiceNumber' => 'setAirlineAgencyInvoiceNumber',
        'airlineAgencyPlanName' => 'setAirlineAgencyPlanName',
        'airlineAirlineCode' => 'setAirlineAirlineCode',
        'airlineAirlineDesignatorCode' => 'setAirlineAirlineDesignatorCode',
        'airlineBoardingFee' => 'setAirlineBoardingFee',
        'airlineComputerizedReservationSystem' => 'setAirlineComputerizedReservationSystem',
        'airlineCustomerReferenceNumber' => 'setAirlineCustomerReferenceNumber',
        'airlineDocumentType' => 'setAirlineDocumentType',
        'airlineFlightDate' => 'setAirlineFlightDate',
        'airlineIssueDate' => 'setAirlineIssueDate',
        'airlineLegCarrierCode' => 'setAirlineLegCarrierCode',
        'airlineLegClassOfTravel' => 'setAirlineLegClassOfTravel',
        'airlineLegDateOfTravel' => 'setAirlineLegDateOfTravel',
        'airlineLegDepartAirport' => 'setAirlineLegDepartAirport',
        'airlineLegDepartTax' => 'setAirlineLegDepartTax',
        'airlineLegDestinationCode' => 'setAirlineLegDestinationCode',
        'airlineLegFareBaseCode' => 'setAirlineLegFareBaseCode',
        'airlineLegFlightNumber' => 'setAirlineLegFlightNumber',
        'airlineLegStopOverCode' => 'setAirlineLegStopOverCode',
        'airlinePassengerDateOfBirth' => 'setAirlinePassengerDateOfBirth',
        'airlinePassengerFirstName' => 'setAirlinePassengerFirstName',
        'airlinePassengerLastName' => 'setAirlinePassengerLastName',
        'airlinePassengerPhoneNumber' => 'setAirlinePassengerPhoneNumber',
        'airlinePassengerTravellerType' => 'setAirlinePassengerTravellerType',
        'airlinePassengerName' => 'setAirlinePassengerName',
        'airlineTicketIssueAddress' => 'setAirlineTicketIssueAddress',
        'airlineTicketNumber' => 'setAirlineTicketNumber',
        'airlineTravelAgencyCode' => 'setAirlineTravelAgencyCode',
        'airlineTravelAgencyName' => 'setAirlineTravelAgencyName'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'airlineAgencyInvoiceNumber' => 'getAirlineAgencyInvoiceNumber',
        'airlineAgencyPlanName' => 'getAirlineAgencyPlanName',
        'airlineAirlineCode' => 'getAirlineAirlineCode',
        'airlineAirlineDesignatorCode' => 'getAirlineAirlineDesignatorCode',
        'airlineBoardingFee' => 'getAirlineBoardingFee',
        'airlineComputerizedReservationSystem' => 'getAirlineComputerizedReservationSystem',
        'airlineCustomerReferenceNumber' => 'getAirlineCustomerReferenceNumber',
        'airlineDocumentType' => 'getAirlineDocumentType',
        'airlineFlightDate' => 'getAirlineFlightDate',
        'airlineIssueDate' => 'getAirlineIssueDate',
        'airlineLegCarrierCode' => 'getAirlineLegCarrierCode',
        'airlineLegClassOfTravel' => 'getAirlineLegClassOfTravel',
        'airlineLegDateOfTravel' => 'getAirlineLegDateOfTravel',
        'airlineLegDepartAirport' => 'getAirlineLegDepartAirport',
        'airlineLegDepartTax' => 'getAirlineLegDepartTax',
        'airlineLegDestinationCode' => 'getAirlineLegDestinationCode',
        'airlineLegFareBaseCode' => 'getAirlineLegFareBaseCode',
        'airlineLegFlightNumber' => 'getAirlineLegFlightNumber',
        'airlineLegStopOverCode' => 'getAirlineLegStopOverCode',
        'airlinePassengerDateOfBirth' => 'getAirlinePassengerDateOfBirth',
        'airlinePassengerFirstName' => 'getAirlinePassengerFirstName',
        'airlinePassengerLastName' => 'getAirlinePassengerLastName',
        'airlinePassengerPhoneNumber' => 'getAirlinePassengerPhoneNumber',
        'airlinePassengerTravellerType' => 'getAirlinePassengerTravellerType',
        'airlinePassengerName' => 'getAirlinePassengerName',
        'airlineTicketIssueAddress' => 'getAirlineTicketIssueAddress',
        'airlineTicketNumber' => 'getAirlineTicketNumber',
        'airlineTravelAgencyCode' => 'getAirlineTravelAgencyCode',
        'airlineTravelAgencyName' => 'getAirlineTravelAgencyName'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$openAPIModelName;
    }


    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->setIfExists('airlineAgencyInvoiceNumber', $data ?? [], null);
        $this->setIfExists('airlineAgencyPlanName', $data ?? [], null);
        $this->setIfExists('airlineAirlineCode', $data ?? [], null);
        $this->setIfExists('airlineAirlineDesignatorCode', $data ?? [], null);
        $this->setIfExists('airlineBoardingFee', $data ?? [], null);
        $this->setIfExists('airlineComputerizedReservationSystem', $data ?? [], null);
        $this->setIfExists('airlineCustomerReferenceNumber', $data ?? [], null);
        $this->setIfExists('airlineDocumentType', $data ?? [], null);
        $this->setIfExists('airlineFlightDate', $data ?? [], null);
        $this->setIfExists('airlineIssueDate', $data ?? [], null);
        $this->setIfExists('airlineLegCarrierCode', $data ?? [], null);
        $this->setIfExists('airlineLegClassOfTravel', $data ?? [], null);
        $this->setIfExists('airlineLegDateOfTravel', $data ?? [], null);
        $this->setIfExists('airlineLegDepartAirport', $data ?? [], null);
        $this->setIfExists('airlineLegDepartTax', $data ?? [], null);
        $this->setIfExists('airlineLegDestinationCode', $data ?? [], null);
        $this->setIfExists('airlineLegFareBaseCode', $data ?? [], null);
        $this->setIfExists('airlineLegFlightNumber', $data ?? [], null);
        $this->setIfExists('airlineLegStopOverCode', $data ?? [], null);
        $this->setIfExists('airlinePassengerDateOfBirth', $data ?? [], null);
        $this->setIfExists('airlinePassengerFirstName', $data ?? [], null);
        $this->setIfExists('airlinePassengerLastName', $data ?? [], null);
        $this->setIfExists('airlinePassengerPhoneNumber', $data ?? [], null);
        $this->setIfExists('airlinePassengerTravellerType', $data ?? [], null);
        $this->setIfExists('airlinePassengerName', $data ?? [], null);
        $this->setIfExists('airlineTicketIssueAddress', $data ?? [], null);
        $this->setIfExists('airlineTicketNumber', $data ?? [], null);
        $this->setIfExists('airlineTravelAgencyCode', $data ?? [], null);
        $this->setIfExists('airlineTravelAgencyName', $data ?? [], null);
    }

    /**
    * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
    * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
    * $this->openAPINullablesSetToNull array
    *
    * @param string $variableName
    * @param array  $fields
    * @param mixed  $defaultValue
    */
    private function setIfExists(string $variableName, array $fields, $defaultValue): void
    {
        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
            $this->openAPINullablesSetToNull[] = $variableName;
        }

        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        if ($this->container['airlinePassengerName'] === null) {
            $invalidProperties[] = "'airlinePassengerName' can't be null";
        }
        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets airlineAgencyInvoiceNumber
     *
     * @return string|null
     */
    public function getAirlineAgencyInvoiceNumber()
    {
        return $this->container['airlineAgencyInvoiceNumber'];
    }

    /**
     * Sets airlineAgencyInvoiceNumber
     *
     * @param string|null $airlineAgencyInvoiceNumber The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters
     *
     * @return self
     */
    public function setAirlineAgencyInvoiceNumber($airlineAgencyInvoiceNumber)
    {
        $this->container['airlineAgencyInvoiceNumber'] = $airlineAgencyInvoiceNumber;

        return $this;
    }

    /**
     * Gets airlineAgencyPlanName
     *
     * @return string|null
     */
    public function getAirlineAgencyPlanName()
    {
        return $this->container['airlineAgencyPlanName'];
    }

    /**
     * Sets airlineAgencyPlanName
     *
     * @param string|null $airlineAgencyPlanName The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters
     *
     * @return self
     */
    public function setAirlineAgencyPlanName($airlineAgencyPlanName)
    {
        $this->container['airlineAgencyPlanName'] = $airlineAgencyPlanName;

        return $this;
    }

    /**
     * Gets airlineAirlineCode
     *
     * @return string|null
     */
    public function getAirlineAirlineCode()
    {
        return $this->container['airlineAirlineCode'];
    }

    /**
     * Sets airlineAirlineCode
     *
     * @param string|null $airlineAirlineCode The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces *Must not be all zeros.
     *
     * @return self
     */
    public function setAirlineAirlineCode($airlineAirlineCode)
    {
        $this->container['airlineAirlineCode'] = $airlineAirlineCode;

        return $this;
    }

    /**
     * Gets airlineAirlineDesignatorCode
     *
     * @return string|null
     */
    public function getAirlineAirlineDesignatorCode()
    {
        return $this->container['airlineAirlineDesignatorCode'];
    }

    /**
     * Sets airlineAirlineDesignatorCode
     *
     * @param string|null $airlineAirlineDesignatorCode The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces *Must not be all zeros.
     *
     * @return self
     */
    public function setAirlineAirlineDesignatorCode($airlineAirlineDesignatorCode)
    {
        $this->container['airlineAirlineDesignatorCode'] = $airlineAirlineDesignatorCode;

        return $this;
    }

    /**
     * Gets airlineBoardingFee
     *
     * @return string|null
     */
    public function getAirlineBoardingFee()
    {
        return $this->container['airlineBoardingFee'];
    }

    /**
     * Sets airlineBoardingFee
     *
     * @param string|null $airlineBoardingFee The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters
     *
     * @return self
     */
    public function setAirlineBoardingFee($airlineBoardingFee)
    {
        $this->container['airlineBoardingFee'] = $airlineBoardingFee;

        return $this;
    }

    /**
     * Gets airlineComputerizedReservationSystem
     *
     * @return string|null
     */
    public function getAirlineComputerizedReservationSystem()
    {
        return $this->container['airlineComputerizedReservationSystem'];
    }

    /**
     * Sets airlineComputerizedReservationSystem
     *
     * @param string|null $airlineComputerizedReservationSystem The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters
     *
     * @return self
     */
    public function setAirlineComputerizedReservationSystem($airlineComputerizedReservationSystem)
    {
        $this->container['airlineComputerizedReservationSystem'] = $airlineComputerizedReservationSystem;

        return $this;
    }

    /**
     * Gets airlineCustomerReferenceNumber
     *
     * @return string|null
     */
    public function getAirlineCustomerReferenceNumber()
    {
        return $this->container['airlineCustomerReferenceNumber'];
    }

    /**
     * Sets airlineCustomerReferenceNumber
     *
     * @param string|null $airlineCustomerReferenceNumber The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces
     *
     * @return self
     */
    public function setAirlineCustomerReferenceNumber($airlineCustomerReferenceNumber)
    {
        $this->container['airlineCustomerReferenceNumber'] = $airlineCustomerReferenceNumber;

        return $this;
    }

    /**
     * Gets airlineDocumentType
     *
     * @return string|null
     */
    public function getAirlineDocumentType()
    {
        return $this->container['airlineDocumentType'];
    }

    /**
     * Sets airlineDocumentType
     *
     * @param string|null $airlineDocumentType A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters
     *
     * @return self
     */
    public function setAirlineDocumentType($airlineDocumentType)
    {
        $this->container['airlineDocumentType'] = $airlineDocumentType;

        return $this;
    }

    /**
     * Gets airlineFlightDate
     *
     * @return string|null
     */
    public function getAirlineFlightDate()
    {
        return $this->container['airlineFlightDate'];
    }

    /**
     * Sets airlineFlightDate
     *
     * @param string|null $airlineFlightDate The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters
     *
     * @return self
     */
    public function setAirlineFlightDate($airlineFlightDate)
    {
        $this->container['airlineFlightDate'] = $airlineFlightDate;

        return $this;
    }

    /**
     * Gets airlineIssueDate
     *
     * @return string|null
     */
    public function getAirlineIssueDate()
    {
        return $this->container['airlineIssueDate'];
    }

    /**
     * Sets airlineIssueDate
     *
     * @param string|null $airlineIssueDate The date that the ticket was issued to the passenger. * minLength: 6 characters * maxLength: 6 characters * Date format: YYMMDD
     *
     * @return self
     */
    public function setAirlineIssueDate($airlineIssueDate)
    {
        $this->container['airlineIssueDate'] = $airlineIssueDate;

        return $this;
    }

    /**
     * Gets airlineLegCarrierCode
     *
     * @return string|null
     */
    public function getAirlineLegCarrierCode()
    {
        return $this->container['airlineLegCarrierCode'];
    }

    /**
     * Sets airlineLegCarrierCode
     *
     * @param string|null $airlineLegCarrierCode The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces *Must not be all zeros.
     *
     * @return self
     */
    public function setAirlineLegCarrierCode($airlineLegCarrierCode)
    {
        $this->container['airlineLegCarrierCode'] = $airlineLegCarrierCode;

        return $this;
    }

    /**
     * Gets airlineLegClassOfTravel
     *
     * @return string|null
     */
    public function getAirlineLegClassOfTravel()
    {
        return $this->container['airlineLegClassOfTravel'];
    }

    /**
     * Sets airlineLegClassOfTravel
     *
     * @param string|null $airlineLegClassOfTravel A one-letter travel class identifier.  The following are common:  * F: first class * J: business class * Y: economy class * W: premium economy  * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces *Must not be all zeros.
     *
     * @return self
     */
    public function setAirlineLegClassOfTravel($airlineLegClassOfTravel)
    {
        $this->container['airlineLegClassOfTravel'] = $airlineLegClassOfTravel;

        return $this;
    }

    /**
     * Gets airlineLegDateOfTravel
     *
     * @return string|null
     */
    public function getAirlineLegDateOfTravel()
    {
        return $this->container['airlineLegDateOfTravel'];
    }

    /**
     * Sets airlineLegDateOfTravel
     *
     * @param string|null $airlineLegDateOfTravel Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters
     *
     * @return self
     */
    public function setAirlineLegDateOfTravel($airlineLegDateOfTravel)
    {
        $this->container['airlineLegDateOfTravel'] = $airlineLegDateOfTravel;

        return $this;
    }

    /**
     * Gets airlineLegDepartAirport
     *
     * @return string|null
     */
    public function getAirlineLegDepartAirport()
    {
        return $this->container['airlineLegDepartAirport'];
    }

    /**
     * Sets airlineLegDepartAirport
     *
     * @param string|null $airlineLegDepartAirport The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details.  * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces *Must not be all zeros.
     *
     * @return self
     */
    public function setAirlineLegDepartAirport($airlineLegDepartAirport)
    {
        $this->container['airlineLegDepartAirport'] = $airlineLegDepartAirport;

        return $this;
    }

    /**
     * Gets airlineLegDepartTax
     *
     * @return string|null
     */
    public function getAirlineLegDepartTax()
    {
        return $this->container['airlineLegDepartTax'];
    }

    /**
     * Sets airlineLegDepartTax
     *
     * @param string|null $airlineLegDepartTax The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 *Must not be all zeros.
     *
     * @return self
     */
    public function setAirlineLegDepartTax($airlineLegDepartTax)
    {
        $this->container['airlineLegDepartTax'] = $airlineLegDepartTax;

        return $this;
    }

    /**
     * Gets airlineLegDestinationCode
     *
     * @return string|null
     */
    public function getAirlineLegDestinationCode()
    {
        return $this->container['airlineLegDestinationCode'];
    }

    /**
     * Sets airlineLegDestinationCode
     *
     * @param string|null $airlineLegDestinationCode The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces *Must not be all zeros.
     *
     * @return self
     */
    public function setAirlineLegDestinationCode($airlineLegDestinationCode)
    {
        $this->container['airlineLegDestinationCode'] = $airlineLegDestinationCode;

        return $this;
    }

    /**
     * Gets airlineLegFareBaseCode
     *
     * @return string|null
     */
    public function getAirlineLegFareBaseCode()
    {
        return $this->container['airlineLegFareBaseCode'];
    }

    /**
     * Sets airlineLegFareBaseCode
     *
     * @param string|null $airlineLegFareBaseCode The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces *Must not be all zeros.
     *
     * @return self
     */
    public function setAirlineLegFareBaseCode($airlineLegFareBaseCode)
    {
        $this->container['airlineLegFareBaseCode'] = $airlineLegFareBaseCode;

        return $this;
    }

    /**
     * Gets airlineLegFlightNumber
     *
     * @return string|null
     */
    public function getAirlineLegFlightNumber()
    {
        return $this->container['airlineLegFlightNumber'];
    }

    /**
     * Sets airlineLegFlightNumber
     *
     * @param string|null $airlineLegFlightNumber The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces *Must not be all zeros.
     *
     * @return self
     */
    public function setAirlineLegFlightNumber($airlineLegFlightNumber)
    {
        $this->container['airlineLegFlightNumber'] = $airlineLegFlightNumber;

        return $this;
    }

    /**
     * Gets airlineLegStopOverCode
     *
     * @return string|null
     */
    public function getAirlineLegStopOverCode()
    {
        return $this->container['airlineLegStopOverCode'];
    }

    /**
     * Sets airlineLegStopOverCode
     *
     * @param string|null $airlineLegStopOverCode A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character
     *
     * @return self
     */
    public function setAirlineLegStopOverCode($airlineLegStopOverCode)
    {
        $this->container['airlineLegStopOverCode'] = $airlineLegStopOverCode;

        return $this;
    }

    /**
     * Gets airlinePassengerDateOfBirth
     *
     * @return string|null
     */
    public function getAirlinePassengerDateOfBirth()
    {
        return $this->container['airlinePassengerDateOfBirth'];
    }

    /**
     * Sets airlinePassengerDateOfBirth
     *
     * @param string|null $airlinePassengerDateOfBirth The passenger's date of birth.  Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10
     *
     * @return self
     */
    public function setAirlinePassengerDateOfBirth($airlinePassengerDateOfBirth)
    {
        $this->container['airlinePassengerDateOfBirth'] = $airlinePassengerDateOfBirth;

        return $this;
    }

    /**
     * Gets airlinePassengerFirstName
     *
     * @return string|null
     */
    public function getAirlinePassengerFirstName()
    {
        return $this->container['airlinePassengerFirstName'];
    }

    /**
     * Sets airlinePassengerFirstName
     *
     * @param string|null $airlinePassengerFirstName The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII
     *
     * @return self
     */
    public function setAirlinePassengerFirstName($airlinePassengerFirstName)
    {
        $this->container['airlinePassengerFirstName'] = $airlinePassengerFirstName;

        return $this;
    }

    /**
     * Gets airlinePassengerLastName
     *
     * @return string|null
     */
    public function getAirlinePassengerLastName()
    {
        return $this->container['airlinePassengerLastName'];
    }

    /**
     * Sets airlinePassengerLastName
     *
     * @param string|null $airlinePassengerLastName The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII
     *
     * @return self
     */
    public function setAirlinePassengerLastName($airlinePassengerLastName)
    {
        $this->container['airlinePassengerLastName'] = $airlinePassengerLastName;

        return $this;
    }

    /**
     * Gets airlinePassengerPhoneNumber
     *
     * @return string|null
     */
    public function getAirlinePassengerPhoneNumber()
    {
        return $this->container['airlinePassengerPhoneNumber'];
    }

    /**
     * Sets airlinePassengerPhoneNumber
     *
     * @param string|null $airlinePassengerPhoneNumber The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters
     *
     * @return self
     */
    public function setAirlinePassengerPhoneNumber($airlinePassengerPhoneNumber)
    {
        $this->container['airlinePassengerPhoneNumber'] = $airlinePassengerPhoneNumber;

        return $this;
    }

    /**
     * Gets airlinePassengerTravellerType
     *
     * @return string|null
     */
    public function getAirlinePassengerTravellerType()
    {
        return $this->container['airlinePassengerTravellerType'];
    }

    /**
     * Sets airlinePassengerTravellerType
     *
     * @param string|null $airlinePassengerTravellerType The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters
     *
     * @return self
     */
    public function setAirlinePassengerTravellerType($airlinePassengerTravellerType)
    {
        $this->container['airlinePassengerTravellerType'] = $airlinePassengerTravellerType;

        return $this;
    }

    /**
     * Gets airlinePassengerName
     *
     * @return string
     */
    public function getAirlinePassengerName()
    {
        return $this->container['airlinePassengerName'];
    }

    /**
     * Sets airlinePassengerName
     *
     * @param string $airlinePassengerName The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces  *Must not be all zeros.
     *
     * @return self
     */
    public function setAirlinePassengerName($airlinePassengerName)
    {
        $this->container['airlinePassengerName'] = $airlinePassengerName;

        return $this;
    }

    /**
     * Gets airlineTicketIssueAddress
     *
     * @return string|null
     */
    public function getAirlineTicketIssueAddress()
    {
        return $this->container['airlineTicketIssueAddress'];
    }

    /**
     * Sets airlineTicketIssueAddress
     *
     * @param string|null $airlineTicketIssueAddress The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters
     *
     * @return self
     */
    public function setAirlineTicketIssueAddress($airlineTicketIssueAddress)
    {
        $this->container['airlineTicketIssueAddress'] = $airlineTicketIssueAddress;

        return $this;
    }

    /**
     * Gets airlineTicketNumber
     *
     * @return string|null
     */
    public function getAirlineTicketNumber()
    {
        return $this->container['airlineTicketNumber'];
    }

    /**
     * Sets airlineTicketNumber
     *
     * @param string|null $airlineTicketNumber The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces *Must not be all zeros.
     *
     * @return self
     */
    public function setAirlineTicketNumber($airlineTicketNumber)
    {
        $this->container['airlineTicketNumber'] = $airlineTicketNumber;

        return $this;
    }

    /**
     * Gets airlineTravelAgencyCode
     *
     * @return string|null
     */
    public function getAirlineTravelAgencyCode()
    {
        return $this->container['airlineTravelAgencyCode'];
    }

    /**
     * Sets airlineTravelAgencyCode
     *
     * @param string|null $airlineTravelAgencyCode The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces *Must not be all zeros.
     *
     * @return self
     */
    public function setAirlineTravelAgencyCode($airlineTravelAgencyCode)
    {
        $this->container['airlineTravelAgencyCode'] = $airlineTravelAgencyCode;

        return $this;
    }

    /**
     * Gets airlineTravelAgencyName
     *
     * @return string|null
     */
    public function getAirlineTravelAgencyName()
    {
        return $this->container['airlineTravelAgencyName'];
    }

    /**
     * Sets airlineTravelAgencyName
     *
     * @param string|null $airlineTravelAgencyName The name of the travel agency.  * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces *Must not be all zeros.
     *
     * @return self
     */
    public function setAirlineTravelAgencyName($airlineTravelAgencyName)
    {
        $this->container['airlineTravelAgencyName'] = $airlineTravelAgencyName;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    public function offsetExists($offset): bool
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed|null
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return $this->container[$offset] ?? null;
    }

    /**
     * Sets value based on offset.
     *
     * @param int|null $offset Offset
     * @param mixed    $value  Value to be set
     *
     * @return void
     */
    public function offsetSet($offset, $value): void
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    public function offsetUnset($offset): void
    {
        unset($this->container[$offset]);
    }

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
     *
     * @return mixed Returns data which can be serialized by json_encode(), which is a value
     * of any type other than a resource.
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
        return ObjectSerializer::sanitizeForSerialization($this);
    }

    public function toArray(): array
    {
        $array = [];
        foreach (self::$openAPITypes as $propertyName => $propertyType) {
            $propertyValue = $this[$propertyName];
            if ($propertyValue !== null) {
                // Check if the property value is an object and has a toArray() method
                if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) {
                    $array[$propertyName] = $propertyValue->toArray();
                // Check if it's type datetime
                } elseif ($propertyValue instanceof \DateTime) {
                    $array[$propertyName] = $propertyValue->format(DATE_ATOM);
                // If it's an array type we should check whether it contains objects and if so call toArray method
                } elseif (is_array($propertyValue)) {
                    $array[$propertyName] = array_map(function ($item) {
                        return $item instanceof ModelInterface ? $item->toArray() : $item;
                    }, $propertyValue);
                } else {
                    // Otherwise, directly assign the property value to the array
                    $array[$propertyName] = $propertyValue;
                }
            }
        }
        return $array;
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }
}
