<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_Bag StructType
 * @subpackage Structs
 */
class JP_Bag extends AbstractStructBase
{
    /**
     * The BaggageType
     * Meta information extracted from the WSDL
     * - use: required
     * @var string
     */
    public $BaggageType;
    /**
     * The Quantity
     * Meta information extracted from the WSDL
     * - use: required
     * @var int
     */
    public $Quantity;
    /**
     * The RelPaxes
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJP_ExtendedRelPaxBag
     */
    public $RelPaxes;
    /**
     * The RelSegments
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfInt1
     */
    public $RelSegments;
    /**
     * The Price
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JP_Price
     */
    public $Price;
    /**
     * The Descriptions
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfString4
     */
    public $Descriptions;
    /**
     * The Weight
     * @var int
     */
    public $Weight;
    /**
     * The Size
     * @var string
     */
    public $Size;
    /**
     * The BagSelectionCode
     * @var string
     */
    public $BagSelectionCode;
    /**
     * Constructor method for JP_Bag
     * @uses JP_Bag::setBaggageType()
     * @uses JP_Bag::setQuantity()
     * @uses JP_Bag::setRelPaxes()
     * @uses JP_Bag::setRelSegments()
     * @uses JP_Bag::setPrice()
     * @uses JP_Bag::setDescriptions()
     * @uses JP_Bag::setWeight()
     * @uses JP_Bag::setSize()
     * @uses JP_Bag::setBagSelectionCode()
     * @param string $baggageType
     * @param int $quantity
     * @param \ArrayType\ArrayOfJP_ExtendedRelPaxBag $relPaxes
     * @param \ArrayType\ArrayOfInt1 $relSegments
     * @param \StructType\JP_Price $price
     * @param \ArrayType\ArrayOfString4 $descriptions
     * @param int $weight
     * @param string $size
     * @param string $bagSelectionCode
     */
    public function __construct($baggageType = null, $quantity = null, \ArrayType\ArrayOfJP_ExtendedRelPaxBag $relPaxes = null, \ArrayType\ArrayOfInt1 $relSegments = null, \StructType\JP_Price $price = null, \ArrayType\ArrayOfString4 $descriptions = null, $weight = null, $size = null, $bagSelectionCode = null)
    {
        $this
            ->setBaggageType($baggageType)
            ->setQuantity($quantity)
            ->setRelPaxes($relPaxes)
            ->setRelSegments($relSegments)
            ->setPrice($price)
            ->setDescriptions($descriptions)
            ->setWeight($weight)
            ->setSize($size)
            ->setBagSelectionCode($bagSelectionCode);
    }
    /**
     * Get BaggageType value
     * @return string
     */
    public function getBaggageType()
    {
        return $this->BaggageType;
    }
    /**
     * Set BaggageType value
     * @uses \EnumType\JP_BaggageType::valueIsValid()
     * @uses \EnumType\JP_BaggageType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $baggageType
     * @return \StructType\JP_Bag
     */
    public function setBaggageType($baggageType = null)
    {
        // validation for constraint: enumeration
        if (!\EnumType\JP_BaggageType::valueIsValid($baggageType)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \EnumType\JP_BaggageType', is_array($baggageType) ? implode(', ', $baggageType) : var_export($baggageType, true), implode(', ', \EnumType\JP_BaggageType::getValidValues())), __LINE__);
        }
        $this->BaggageType = $baggageType;
        return $this;
    }
    /**
     * Get Quantity value
     * @return int
     */
    public function getQuantity()
    {
        return $this->Quantity;
    }
    /**
     * Set Quantity value
     * @param int $quantity
     * @return \StructType\JP_Bag
     */
    public function setQuantity($quantity = null)
    {
        // validation for constraint: int
        if (!is_null($quantity) && !(is_int($quantity) || ctype_digit($quantity))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($quantity, true), gettype($quantity)), __LINE__);
        }
        $this->Quantity = $quantity;
        return $this;
    }
    /**
     * Get RelPaxes value
     * @return \ArrayType\ArrayOfJP_ExtendedRelPaxBag|null
     */
    public function getRelPaxes()
    {
        return $this->RelPaxes;
    }
    /**
     * Set RelPaxes value
     * @param \ArrayType\ArrayOfJP_ExtendedRelPaxBag $relPaxes
     * @return \StructType\JP_Bag
     */
    public function setRelPaxes(\ArrayType\ArrayOfJP_ExtendedRelPaxBag $relPaxes = null)
    {
        $this->RelPaxes = $relPaxes;
        return $this;
    }
    /**
     * Get RelSegments value
     * @return \ArrayType\ArrayOfInt1|null
     */
    public function getRelSegments()
    {
        return $this->RelSegments;
    }
    /**
     * Set RelSegments value
     * @param \ArrayType\ArrayOfInt1 $relSegments
     * @return \StructType\JP_Bag
     */
    public function setRelSegments(\ArrayType\ArrayOfInt1 $relSegments = null)
    {
        $this->RelSegments = $relSegments;
        return $this;
    }
    /**
     * Get Price value
     * @return \StructType\JP_Price|null
     */
    public function getPrice()
    {
        return $this->Price;
    }
    /**
     * Set Price value
     * @param \StructType\JP_Price $price
     * @return \StructType\JP_Bag
     */
    public function setPrice(\StructType\JP_Price $price = null)
    {
        $this->Price = $price;
        return $this;
    }
    /**
     * Get Descriptions value
     * @return \ArrayType\ArrayOfString4|null
     */
    public function getDescriptions()
    {
        return $this->Descriptions;
    }
    /**
     * Set Descriptions value
     * @param \ArrayType\ArrayOfString4 $descriptions
     * @return \StructType\JP_Bag
     */
    public function setDescriptions(\ArrayType\ArrayOfString4 $descriptions = null)
    {
        $this->Descriptions = $descriptions;
        return $this;
    }
    /**
     * Get Weight value
     * @return int|null
     */
    public function getWeight()
    {
        return $this->Weight;
    }
    /**
     * Set Weight value
     * @param int $weight
     * @return \StructType\JP_Bag
     */
    public function setWeight($weight = null)
    {
        // validation for constraint: int
        if (!is_null($weight) && !(is_int($weight) || ctype_digit($weight))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($weight, true), gettype($weight)), __LINE__);
        }
        $this->Weight = $weight;
        return $this;
    }
    /**
     * Get Size value
     * @return string|null
     */
    public function getSize()
    {
        return $this->Size;
    }
    /**
     * Set Size value
     * @param string $size
     * @return \StructType\JP_Bag
     */
    public function setSize($size = null)
    {
        // validation for constraint: string
        if (!is_null($size) && !is_string($size)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($size, true), gettype($size)), __LINE__);
        }
        $this->Size = $size;
        return $this;
    }
    /**
     * Get BagSelectionCode value
     * @return string|null
     */
    public function getBagSelectionCode()
    {
        return $this->BagSelectionCode;
    }
    /**
     * Set BagSelectionCode value
     * @param string $bagSelectionCode
     * @return \StructType\JP_Bag
     */
    public function setBagSelectionCode($bagSelectionCode = null)
    {
        // validation for constraint: string
        if (!is_null($bagSelectionCode) && !is_string($bagSelectionCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($bagSelectionCode, true), gettype($bagSelectionCode)), __LINE__);
        }
        $this->BagSelectionCode = $bagSelectionCode;
        return $this;
    }
}
