<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for UpdateTicketViewAssociation-Request StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:UpdateTicketViewAssociation-Request
 * @subpackage Structs
 */
class UpdateTicketViewAssociation_Request extends TicketViewAssociationRequestBase
{
    /**
     * The AssociationId
     * Meta information extracted from the WSDL
     * - base: xs:string
     * - minOccurs: 0
     * - nillable: true
     * - pattern: [\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}
     * - type: tns:guid
     * @var string
     */
    public $AssociationId;
    /**
     * The ComponentId
     * Meta information extracted from the WSDL
     * - base: xs:string
     * - minOccurs: 0
     * - nillable: true
     * - pattern: [\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}
     * - type: tns:guid
     * @var string
     */
    public $ComponentId;
    /**
     * Constructor method for UpdateTicketViewAssociation-Request
     * @uses UpdateTicketViewAssociation_Request::setAssociationId()
     * @uses UpdateTicketViewAssociation_Request::setComponentId()
     * @param string $associationId
     * @param string $componentId
     */
    public function __construct($associationId = null, $componentId = null)
    {
        $this
            ->setAssociationId($associationId)
            ->setComponentId($componentId);
    }
    /**
     * Get AssociationId value
     * @return string|null
     */
    public function getAssociationId()
    {
        return $this->AssociationId;
    }
    /**
     * Set AssociationId value
     * @param string $associationId
     * @return \patest\StructType\UpdateTicketViewAssociation_Request
     */
    public function setAssociationId($associationId = null)
    {
        // validation for constraint: string
        if (!is_null($associationId) && !is_string($associationId)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($associationId, true), gettype($associationId)), __LINE__);
        }
        // validation for constraint: pattern([\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12})
        if (!is_null($associationId) && !preg_match('/[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}/', $associationId)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression [\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}', var_export($associationId, true)), __LINE__);
        }
        $this->AssociationId = $associationId;
        return $this;
    }
    /**
     * Get ComponentId value
     * @return string|null
     */
    public function getComponentId()
    {
        return $this->ComponentId;
    }
    /**
     * Set ComponentId value
     * @param string $componentId
     * @return \patest\StructType\UpdateTicketViewAssociation_Request
     */
    public function setComponentId($componentId = null)
    {
        // validation for constraint: string
        if (!is_null($componentId) && !is_string($componentId)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($componentId, true), gettype($componentId)), __LINE__);
        }
        // validation for constraint: pattern([\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12})
        if (!is_null($componentId) && !preg_match('/[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}/', $componentId)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression [\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}', var_export($componentId, true)), __LINE__);
        }
        $this->ComponentId = $componentId;
        return $this;
    }
}
