<?php
/**
 * Ptsv2paymentsTravelInformationTransitAirlineLegs
 *
 * PHP version 5
 *
 * @category Class
 * @package  CyberSource
 * @author   Swaagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * CyberSource Merged Spec
 *
 * All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
 *
 * OpenAPI spec version: 0.0.1
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 *
 */
/**
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen
 * Do not edit the class manually.
 */

namespace CyberSource\Model;

use \ArrayAccess;

/**
 * Ptsv2paymentsTravelInformationTransitAirlineLegs Class Doc Comment
 *
 * @category    Class
 * @package     CyberSource
 * @author      Swagger Codegen team
 * @link        https://github.com/swagger-api/swagger-codegen
 */
class Ptsv2paymentsTravelInformationTransitAirlineLegs implements ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = [
        'carrierCode' => 'string',
        'flightNumber' => 'string',
        'originatingAirportCode' => 'string',
        'class' => 'string',
        'stopoverIndicator' => 'int',
        'departureDate' => 'int',
        'destinationAirportCode' => 'string',
        'fareBasis' => 'string',
        'departTaxAmount' => 'string',
        'conjunctionTicket' => 'string',
        'exchangeTicketNumber' => 'string',
        'couponNumber' => 'string',
        'departureTime' => 'int',
        'departureTimeMeridian' => 'string',
        'arrivalTime' => 'int',
        'arrivalTimeMeridian' => 'string',
        'endorsementsRestrictions' => 'string',
        'totalFareAmount' => 'string',
        'feeAmount' => 'string',
        'taxAmount' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerFormats = [
        'carrierCode' => null,
        'flightNumber' => null,
        'originatingAirportCode' => null,
        'class' => null,
        'stopoverIndicator' => null,
        'departureDate' => null,
        'destinationAirportCode' => null,
        'fareBasis' => null,
        'departTaxAmount' => null,
        'conjunctionTicket' => null,
        'exchangeTicketNumber' => null,
        'couponNumber' => null,
        'departureTime' => null,
        'departureTimeMeridian' => null,
        'arrivalTime' => null,
        'arrivalTimeMeridian' => null,
        'endorsementsRestrictions' => null,
        'totalFareAmount' => null,
        'feeAmount' => null,
        'taxAmount' => null
    ];

    public static function swaggerTypes()
    {
        return self::$swaggerTypes;
    }

    public static function swaggerFormats()
    {
        return self::$swaggerFormats;
    }

    /**
     * Array of attributes where the key is the local name, and the value is the original name
     * @var string[]
     */
    protected static $attributeMap = [
        'carrierCode' => 'carrierCode',
        'flightNumber' => 'flightNumber',
        'originatingAirportCode' => 'originatingAirportCode',
        'class' => 'class',
        'stopoverIndicator' => 'stopoverIndicator',
        'departureDate' => 'departureDate',
        'destinationAirportCode' => 'destinationAirportCode',
        'fareBasis' => 'fareBasis',
        'departTaxAmount' => 'departTaxAmount',
        'conjunctionTicket' => 'conjunctionTicket',
        'exchangeTicketNumber' => 'exchangeTicketNumber',
        'couponNumber' => 'couponNumber',
        'departureTime' => 'departureTime',
        'departureTimeMeridian' => 'departureTimeMeridian',
        'arrivalTime' => 'arrivalTime',
        'arrivalTimeMeridian' => 'arrivalTimeMeridian',
        'endorsementsRestrictions' => 'endorsementsRestrictions',
        'totalFareAmount' => 'totalFareAmount',
        'feeAmount' => 'feeAmount',
        'taxAmount' => 'taxAmount'
    ];


    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = [
        'carrierCode' => 'setCarrierCode',
        'flightNumber' => 'setFlightNumber',
        'originatingAirportCode' => 'setOriginatingAirportCode',
        'class' => 'setClass',
        'stopoverIndicator' => 'setStopoverIndicator',
        'departureDate' => 'setDepartureDate',
        'destinationAirportCode' => 'setDestinationAirportCode',
        'fareBasis' => 'setFareBasis',
        'departTaxAmount' => 'setDepartTaxAmount',
        'conjunctionTicket' => 'setConjunctionTicket',
        'exchangeTicketNumber' => 'setExchangeTicketNumber',
        'couponNumber' => 'setCouponNumber',
        'departureTime' => 'setDepartureTime',
        'departureTimeMeridian' => 'setDepartureTimeMeridian',
        'arrivalTime' => 'setArrivalTime',
        'arrivalTimeMeridian' => 'setArrivalTimeMeridian',
        'endorsementsRestrictions' => 'setEndorsementsRestrictions',
        'totalFareAmount' => 'setTotalFareAmount',
        'feeAmount' => 'setFeeAmount',
        'taxAmount' => 'setTaxAmount'
    ];


    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = [
        'carrierCode' => 'getCarrierCode',
        'flightNumber' => 'getFlightNumber',
        'originatingAirportCode' => 'getOriginatingAirportCode',
        'class' => 'getClass',
        'stopoverIndicator' => 'getStopoverIndicator',
        'departureDate' => 'getDepartureDate',
        'destinationAirportCode' => 'getDestinationAirportCode',
        'fareBasis' => 'getFareBasis',
        'departTaxAmount' => 'getDepartTaxAmount',
        'conjunctionTicket' => 'getConjunctionTicket',
        'exchangeTicketNumber' => 'getExchangeTicketNumber',
        'couponNumber' => 'getCouponNumber',
        'departureTime' => 'getDepartureTime',
        'departureTimeMeridian' => 'getDepartureTimeMeridian',
        'arrivalTime' => 'getArrivalTime',
        'arrivalTimeMeridian' => 'getArrivalTimeMeridian',
        'endorsementsRestrictions' => 'getEndorsementsRestrictions',
        'totalFareAmount' => 'getTotalFareAmount',
        'feeAmount' => 'getFeeAmount',
        'taxAmount' => 'getTaxAmount'
    ];

    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    public static function setters()
    {
        return self::$setters;
    }

    public static function getters()
    {
        return self::$getters;
    }

    

    

    /**
     * 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->container['carrierCode'] = isset($data['carrierCode']) ? $data['carrierCode'] : null;
        $this->container['flightNumber'] = isset($data['flightNumber']) ? $data['flightNumber'] : null;
        $this->container['originatingAirportCode'] = isset($data['originatingAirportCode']) ? $data['originatingAirportCode'] : null;
        $this->container['class'] = isset($data['class']) ? $data['class'] : null;
        $this->container['stopoverIndicator'] = isset($data['stopoverIndicator']) ? $data['stopoverIndicator'] : null;
        $this->container['departureDate'] = isset($data['departureDate']) ? $data['departureDate'] : null;
        $this->container['destinationAirportCode'] = isset($data['destinationAirportCode']) ? $data['destinationAirportCode'] : null;
        $this->container['fareBasis'] = isset($data['fareBasis']) ? $data['fareBasis'] : null;
        $this->container['departTaxAmount'] = isset($data['departTaxAmount']) ? $data['departTaxAmount'] : null;
        $this->container['conjunctionTicket'] = isset($data['conjunctionTicket']) ? $data['conjunctionTicket'] : null;
        $this->container['exchangeTicketNumber'] = isset($data['exchangeTicketNumber']) ? $data['exchangeTicketNumber'] : null;
        $this->container['couponNumber'] = isset($data['couponNumber']) ? $data['couponNumber'] : null;
        $this->container['departureTime'] = isset($data['departureTime']) ? $data['departureTime'] : null;
        $this->container['departureTimeMeridian'] = isset($data['departureTimeMeridian']) ? $data['departureTimeMeridian'] : null;
        $this->container['arrivalTime'] = isset($data['arrivalTime']) ? $data['arrivalTime'] : null;
        $this->container['arrivalTimeMeridian'] = isset($data['arrivalTimeMeridian']) ? $data['arrivalTimeMeridian'] : null;
        $this->container['endorsementsRestrictions'] = isset($data['endorsementsRestrictions']) ? $data['endorsementsRestrictions'] : null;
        $this->container['totalFareAmount'] = isset($data['totalFareAmount']) ? $data['totalFareAmount'] : null;
        $this->container['feeAmount'] = isset($data['feeAmount']) ? $data['feeAmount'] : null;
        $this->container['taxAmount'] = isset($data['taxAmount']) ? $data['taxAmount'] : null;
    }

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

        return $invalid_properties;
    }

    /**
     * validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {

        return true;
    }


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

    /**
     * Sets carrierCode
     * @param string $carrierCode IATA code for the carrier for this leg of the trip. Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
     * @return $this
     */
    public function setCarrierCode($carrierCode)
    {
        $this->container['carrierCode'] = $carrierCode;

        return $this;
    }

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

    /**
     * Sets flightNumber
     * @param string $flightNumber Flight number for this leg of the trip. Restrictions are limitations for the ticket based on the type of fare, such as a nonrefundable ticket or a 3-day minimum stay. Format: English characters only. Optional request field for travel legs.
     * @return $this
     */
    public function setFlightNumber($flightNumber)
    {
        $this->container['flightNumber'] = $flightNumber;

        return $this;
    }

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

    /**
     * Sets originatingAirportCode
     * @param string $originatingAirportCode IATA code for the originating airport for this leg of the trip. Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
     * @return $this
     */
    public function setOriginatingAirportCode($originatingAirportCode)
    {
        $this->container['originatingAirportCode'] = $originatingAirportCode;

        return $this;
    }

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

    /**
     * Sets class
     * @param string $class IATA code for the class of service for this leg of the trip. Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
     * @return $this
     */
    public function setClass($class)
    {
        $this->container['class'] = $class;

        return $this;
    }

    /**
     * Gets stopoverIndicator
     * @return int
     */
    public function getStopoverIndicator()
    {
        return $this->container['stopoverIndicator'];
    }

    /**
     * Sets stopoverIndicator
     * @param int $stopoverIndicator Code that indicates whether a stopover is allowed on this leg of the trip. Possible values: - `O` (capital letter \"O\") (default): Stopover allowed - `X` (capital letter \"X\"): Stopover not allowed Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
     * @return $this
     */
    public function setStopoverIndicator($stopoverIndicator)
    {
        $this->container['stopoverIndicator'] = $stopoverIndicator;

        return $this;
    }

    /**
     * Gets departureDate
     * @return int
     */
    public function getDepartureDate()
    {
        return $this->container['departureDate'];
    }

    /**
     * Sets departureDate
     * @param int $departureDate Departure date for the first leg of the trip. Format: `YYYYMMDD`. Format: English characters only. Optional request field for travel legs.
     * @return $this
     */
    public function setDepartureDate($departureDate)
    {
        $this->container['departureDate'] = $departureDate;

        return $this;
    }

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

    /**
     * Sets destinationAirportCode
     * @param string $destinationAirportCode IATA code for the destination airport for this leg of the trip. Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
     * @return $this
     */
    public function setDestinationAirportCode($destinationAirportCode)
    {
        $this->container['destinationAirportCode'] = $destinationAirportCode;

        return $this;
    }

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

    /**
     * Sets fareBasis
     * @param string $fareBasis Code for the fare basis for this leg of the trip. The fare basis is assigned by the carriers and indicates a particular ticket type, such as business class or discounted/nonrefundable. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Format: English characters only. Optional request field for travel legs.auto_rental_regular_mileage_cost
     * @return $this
     */
    public function setFareBasis($fareBasis)
    {
        $this->container['fareBasis'] = $fareBasis;

        return $this;
    }

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

    /**
     * Sets departTaxAmount
     * @param string $departTaxAmount Amount of departure tax for this leg of the trip.
     * @return $this
     */
    public function setDepartTaxAmount($departTaxAmount)
    {
        $this->container['departTaxAmount'] = $departTaxAmount;

        return $this;
    }

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

    /**
     * Sets conjunctionTicket
     * @param string $conjunctionTicket Ticket that contains additional coupons for this leg of the trip on an itinerary that has more than four segments. Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
     * @return $this
     */
    public function setConjunctionTicket($conjunctionTicket)
    {
        $this->container['conjunctionTicket'] = $conjunctionTicket;

        return $this;
    }

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

    /**
     * Sets exchangeTicketNumber
     * @param string $exchangeTicketNumber New ticket number that is issued when the ticket is exchanged for this leg of the trip. Restrictions are limitations for the ticket based on the type of fare, such as a nonrefundable ticket or a 3-day minimum stay. Format: English characters only. Optional request field for travel legs.
     * @return $this
     */
    public function setExchangeTicketNumber($exchangeTicketNumber)
    {
        $this->container['exchangeTicketNumber'] = $exchangeTicketNumber;

        return $this;
    }

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

    /**
     * Sets couponNumber
     * @param string $couponNumber Coupon number. Each leg on the ticket requires a separate coupon, and each coupon is identified by the coupon number. Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
     * @return $this
     */
    public function setCouponNumber($couponNumber)
    {
        $this->container['couponNumber'] = $couponNumber;

        return $this;
    }

    /**
     * Gets departureTime
     * @return int
     */
    public function getDepartureTime()
    {
        return $this->container['departureTime'];
    }

    /**
     * Sets departureTime
     * @param int $departureTime Time of departure for this leg of the trip. The format is military time and HHMM: If not all zeros, then the hours must be `00-23` and the minutes must be `00-59`. Format: English characters only. Optional request field for travel legs.
     * @return $this
     */
    public function setDepartureTime($departureTime)
    {
        $this->container['departureTime'] = $departureTime;

        return $this;
    }

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

    /**
     * Sets departureTimeMeridian
     * @param string $departureTimeMeridian AM or PM for the departure time. Possible values: - A: 12:00 midnight to 11:59 a.m. - P: 12:00 noon to 11:59 p.m Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
     * @return $this
     */
    public function setDepartureTimeMeridian($departureTimeMeridian)
    {
        $this->container['departureTimeMeridian'] = $departureTimeMeridian;

        return $this;
    }

    /**
     * Gets arrivalTime
     * @return int
     */
    public function getArrivalTime()
    {
        return $this->container['arrivalTime'];
    }

    /**
     * Sets arrivalTime
     * @param int $arrivalTime Time of arrival for this leg of the trip. The format is military time and HHMM: If not all zeros, then the hours must be `00-23` and the minutes must be `00-59` Format: English characters only. Optional request field for travel legs.
     * @return $this
     */
    public function setArrivalTime($arrivalTime)
    {
        $this->container['arrivalTime'] = $arrivalTime;

        return $this;
    }

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

    /**
     * Sets arrivalTimeMeridian
     * @param string $arrivalTimeMeridian AM or PM for the arrival time for this leg of the trip. Possible values: - `A`: 12:00 midnight to 11:59 a.m. - `P`: 12:00 noon to 11:59 p.m. Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
     * @return $this
     */
    public function setArrivalTimeMeridian($arrivalTimeMeridian)
    {
        $this->container['arrivalTimeMeridian'] = $arrivalTimeMeridian;

        return $this;
    }

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

    /**
     * Sets endorsementsRestrictions
     * @param string $endorsementsRestrictions Notes or notations about endorsements and restrictions for this leg of the trip. Endorsements can be notations added by the travel agency, including mandatory government-required notations such as value added tax. Restrictions are limitations for the ticket based on the type of fare, such as a nonrefundable ticket or a 3-day minimum stay. Format: English characters only. Optional request field for travel legs.
     * @return $this
     */
    public function setEndorsementsRestrictions($endorsementsRestrictions)
    {
        $this->container['endorsementsRestrictions'] = $endorsementsRestrictions;

        return $this;
    }

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

    /**
     * Sets totalFareAmount
     * @param string $totalFareAmount Total fare for this leg of the trip. Format: English characters only. Optional request field for travel legs.
     * @return $this
     */
    public function setTotalFareAmount($totalFareAmount)
    {
        $this->container['totalFareAmount'] = $totalFareAmount;

        return $this;
    }

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

    /**
     * Sets feeAmount
     * @param string $feeAmount Fee for this leg of the trip, such as an airport fee or country fee. Format: English characters only. Optional request field for travel legs.
     * @return $this
     */
    public function setFeeAmount($feeAmount)
    {
        $this->container['feeAmount'] = $feeAmount;

        return $this;
    }

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

    /**
     * Sets taxAmount
     * @param string $taxAmount Tax for this leg of the trip. Format: English characters only. Optional request field for travel legs.
     * @return $this
     */
    public function setTaxAmount($taxAmount)
    {
        $this->container['taxAmount'] = $taxAmount;

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

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

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

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

    /**
     * Gets the string presentation of the object
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(\CyberSource\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
        }

        return json_encode(\CyberSource\ObjectSerializer::sanitizeForSerialization($this));
    }
}


