<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_InsuranceBookingInfo StructType
 * @subpackage Structs
 */
class JP_InsuranceBookingInfo extends AbstractStructBase
{
    /**
     * The PackageContracts
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $PackageContracts;
    /**
     * The AdditionalRequiredFields
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJP_AdditionalRequiredField
     */
    public $AdditionalRequiredFields;
    /**
     * The ICode
     * @var string
     */
    public $ICode;
    /**
     * Constructor method for JP_InsuranceBookingInfo
     * @uses JP_InsuranceBookingInfo::setPackageContracts()
     * @uses JP_InsuranceBookingInfo::setAdditionalRequiredFields()
     * @uses JP_InsuranceBookingInfo::setICode()
     * @param string $packageContracts
     * @param \ArrayType\ArrayOfJP_AdditionalRequiredField $additionalRequiredFields
     * @param string $iCode
     */
    public function __construct($packageContracts = null, \ArrayType\ArrayOfJP_AdditionalRequiredField $additionalRequiredFields = null, $iCode = null)
    {
        $this
            ->setPackageContracts($packageContracts)
            ->setAdditionalRequiredFields($additionalRequiredFields)
            ->setICode($iCode);
    }
    /**
     * Get PackageContracts value
     * @return string|null
     */
    public function getPackageContracts()
    {
        return $this->PackageContracts;
    }
    /**
     * Set PackageContracts value
     * @uses \EnumType\JP_PackageContractsInsurances::valueIsValid()
     * @uses \EnumType\JP_PackageContractsInsurances::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $packageContracts
     * @return \StructType\JP_InsuranceBookingInfo
     */
    public function setPackageContracts($packageContracts = null)
    {
        // validation for constraint: enumeration
        if (!\EnumType\JP_PackageContractsInsurances::valueIsValid($packageContracts)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \EnumType\JP_PackageContractsInsurances', is_array($packageContracts) ? implode(', ', $packageContracts) : var_export($packageContracts, true), implode(', ', \EnumType\JP_PackageContractsInsurances::getValidValues())), __LINE__);
        }
        $this->PackageContracts = $packageContracts;
        return $this;
    }
    /**
     * Get AdditionalRequiredFields value
     * @return \ArrayType\ArrayOfJP_AdditionalRequiredField|null
     */
    public function getAdditionalRequiredFields()
    {
        return $this->AdditionalRequiredFields;
    }
    /**
     * Set AdditionalRequiredFields value
     * @param \ArrayType\ArrayOfJP_AdditionalRequiredField $additionalRequiredFields
     * @return \StructType\JP_InsuranceBookingInfo
     */
    public function setAdditionalRequiredFields(\ArrayType\ArrayOfJP_AdditionalRequiredField $additionalRequiredFields = null)
    {
        $this->AdditionalRequiredFields = $additionalRequiredFields;
        return $this;
    }
    /**
     * Get ICode value
     * @return string|null
     */
    public function getICode()
    {
        return $this->ICode;
    }
    /**
     * Set ICode value
     * @param string $iCode
     * @return \StructType\JP_InsuranceBookingInfo
     */
    public function setICode($iCode = null)
    {
        // validation for constraint: string
        if (!is_null($iCode) && !is_string($iCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($iCode, true), gettype($iCode)), __LINE__);
        }
        $this->ICode = $iCode;
        return $this;
    }
}
