<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for CoverageDetailsType StructType
 * @package Dg
 * @subpackage Structs
 */
class DgCoverageDetailsType extends DgFormattedTextTextType
{
    /**
     * The CoverageTextType
     * Meta informations extracted from the WSDL
     * - use: required
     * @var string
     */
    public $CoverageTextType;
    /**
     * The _
     * @var \dgsoft\StructType\DgFormattedTextTextType
     */
    public $_;
    /**
     * Constructor method for CoverageDetailsType
     * @uses DgCoverageDetailsType::setCoverageTextType()
     * @uses DgCoverageDetailsType::set_()
     * @param string $coverageTextType
     * @param \dgsoft\StructType\DgFormattedTextTextType $_
     */
    public function __construct($coverageTextType = null, \dgsoft\StructType\DgFormattedTextTextType $_ = null)
    {
        $this
            ->setCoverageTextType($coverageTextType)
            ->set_($_);
    }
    /**
     * Get CoverageTextType value
     * @return string
     */
    public function getCoverageTextType()
    {
        return $this->CoverageTextType;
    }
    /**
     * Set CoverageTextType value
     * @uses \dgsoft\EnumType\DgCoverageTextType::valueIsValid()
     * @uses \dgsoft\EnumType\DgCoverageTextType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $coverageTextType
     * @return \dgsoft\StructType\DgCoverageDetailsType
     */
    public function setCoverageTextType($coverageTextType = null)
    {
        // validation for constraint: enumeration
        if (!\dgsoft\EnumType\DgCoverageTextType::valueIsValid($coverageTextType)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $coverageTextType, implode(', ', \dgsoft\EnumType\DgCoverageTextType::getValidValues())), __LINE__);
        }
        $this->CoverageTextType = $coverageTextType;
        return $this;
    }
    /**
     * Get _ value
     * @return \dgsoft\StructType\DgFormattedTextTextType|null
     */
    public function get_()
    {
        return $this->_;
    }
    /**
     * Set _ value
     * @param \dgsoft\StructType\DgFormattedTextTextType $_
     * @return \dgsoft\StructType\DgCoverageDetailsType
     */
    public function set_(\dgsoft\StructType\DgFormattedTextTextType $_ = null)
    {
        $this->_ = $_;
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return \dgsoft\StructType\DgCoverageDetailsType
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
