<?php
/**
 * Boardingv1registrationsOrganizationInformationOwners
 *
 * 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;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = [
        'firstName' => 'string',
        'middleName' => 'string',
        'lastName' => 'string',
        'birthDate' => '\DateTime',
        'isPrimary' => 'bool',
        'ssn' => 'string',
        'passportNumber' => 'string',
        'passportCountry' => 'string',
        'jobTitle' => 'string',
        'hasSignificantResponsability' => 'bool',
        'ownershipPercentage' => 'float',
        'phoneNumber' => 'string',
        'email' => 'string',
        'address' => '\CyberSource\Model\Boardingv1registrationsOrganizationInformationBusinessInformationAddress'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerFormats = [
        'firstName' => null,
        'middleName' => null,
        'lastName' => null,
        'birthDate' => 'date',
        'isPrimary' => null,
        'ssn' => null,
        'passportNumber' => null,
        'passportCountry' => null,
        'jobTitle' => null,
        'hasSignificantResponsability' => null,
        'ownershipPercentage' => null,
        'phoneNumber' => null,
        'email' => null,
        'address' => 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 = [
        'firstName' => 'firstName',
        'middleName' => 'middleName',
        'lastName' => 'lastName',
        'birthDate' => 'birthDate',
        'isPrimary' => 'isPrimary',
        'ssn' => 'ssn',
        'passportNumber' => 'passportNumber',
        'passportCountry' => 'passportCountry',
        'jobTitle' => 'jobTitle',
        'hasSignificantResponsability' => 'hasSignificantResponsability',
        'ownershipPercentage' => 'ownershipPercentage',
        'phoneNumber' => 'phoneNumber',
        'email' => 'email',
        'address' => 'address'
    ];


    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = [
        'firstName' => 'setFirstName',
        'middleName' => 'setMiddleName',
        'lastName' => 'setLastName',
        'birthDate' => 'setBirthDate',
        'isPrimary' => 'setIsPrimary',
        'ssn' => 'setSsn',
        'passportNumber' => 'setPassportNumber',
        'passportCountry' => 'setPassportCountry',
        'jobTitle' => 'setJobTitle',
        'hasSignificantResponsability' => 'setHasSignificantResponsability',
        'ownershipPercentage' => 'setOwnershipPercentage',
        'phoneNumber' => 'setPhoneNumber',
        'email' => 'setEmail',
        'address' => 'setAddress'
    ];


    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = [
        'firstName' => 'getFirstName',
        'middleName' => 'getMiddleName',
        'lastName' => 'getLastName',
        'birthDate' => 'getBirthDate',
        'isPrimary' => 'getIsPrimary',
        'ssn' => 'getSsn',
        'passportNumber' => 'getPassportNumber',
        'passportCountry' => 'getPassportCountry',
        'jobTitle' => 'getJobTitle',
        'hasSignificantResponsability' => 'getHasSignificantResponsability',
        'ownershipPercentage' => 'getOwnershipPercentage',
        'phoneNumber' => 'getPhoneNumber',
        'email' => 'getEmail',
        'address' => 'getAddress'
    ];

    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['firstName'] = isset($data['firstName']) ? $data['firstName'] : null;
        $this->container['middleName'] = isset($data['middleName']) ? $data['middleName'] : null;
        $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null;
        $this->container['birthDate'] = isset($data['birthDate']) ? $data['birthDate'] : null;
        $this->container['isPrimary'] = isset($data['isPrimary']) ? $data['isPrimary'] : null;
        $this->container['ssn'] = isset($data['ssn']) ? $data['ssn'] : null;
        $this->container['passportNumber'] = isset($data['passportNumber']) ? $data['passportNumber'] : null;
        $this->container['passportCountry'] = isset($data['passportCountry']) ? $data['passportCountry'] : null;
        $this->container['jobTitle'] = isset($data['jobTitle']) ? $data['jobTitle'] : null;
        $this->container['hasSignificantResponsability'] = isset($data['hasSignificantResponsability']) ? $data['hasSignificantResponsability'] : null;
        $this->container['ownershipPercentage'] = isset($data['ownershipPercentage']) ? $data['ownershipPercentage'] : null;
        $this->container['phoneNumber'] = isset($data['phoneNumber']) ? $data['phoneNumber'] : null;
        $this->container['email'] = isset($data['email']) ? $data['email'] : null;
        $this->container['address'] = isset($data['address']) ? $data['address'] : null;
    }

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

        if ($this->container['firstName'] === null) {
            $invalid_properties[] = "'firstName' can't be null";
        }
        if ($this->container['lastName'] === null) {
            $invalid_properties[] = "'lastName' can't be null";
        }
        if ($this->container['birthDate'] === null) {
            $invalid_properties[] = "'birthDate' can't be null";
        }
        if ($this->container['isPrimary'] === null) {
            $invalid_properties[] = "'isPrimary' can't be null";
        }
        if ($this->container['jobTitle'] === null) {
            $invalid_properties[] = "'jobTitle' can't be null";
        }
        if ($this->container['hasSignificantResponsability'] === null) {
            $invalid_properties[] = "'hasSignificantResponsability' can't be null";
        }
        if ($this->container['ownershipPercentage'] === null) {
            $invalid_properties[] = "'ownershipPercentage' can't be null";
        }
        if ($this->container['phoneNumber'] === null) {
            $invalid_properties[] = "'phoneNumber' can't be null";
        }
        if ($this->container['email'] === null) {
            $invalid_properties[] = "'email' can't be null";
        }
        if ($this->container['address'] === null) {
            $invalid_properties[] = "'address' can't be null";
        }
        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()
    {

        if ($this->container['firstName'] === null) {
            return false;
        }
        if ($this->container['lastName'] === null) {
            return false;
        }
        if ($this->container['birthDate'] === null) {
            return false;
        }
        if ($this->container['isPrimary'] === null) {
            return false;
        }
        if ($this->container['jobTitle'] === null) {
            return false;
        }
        if ($this->container['hasSignificantResponsability'] === null) {
            return false;
        }
        if ($this->container['ownershipPercentage'] === null) {
            return false;
        }
        if ($this->container['phoneNumber'] === null) {
            return false;
        }
        if ($this->container['email'] === null) {
            return false;
        }
        if ($this->container['address'] === null) {
            return false;
        }
        return true;
    }


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

    /**
     * Sets firstName
     * @param string $firstName
     * @return $this
     */
    public function setFirstName($firstName)
    {
        $this->container['firstName'] = $firstName;

        return $this;
    }

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

    /**
     * Sets middleName
     * @param string $middleName
     * @return $this
     */
    public function setMiddleName($middleName)
    {
        $this->container['middleName'] = $middleName;

        return $this;
    }

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

    /**
     * Sets lastName
     * @param string $lastName
     * @return $this
     */
    public function setLastName($lastName)
    {
        $this->container['lastName'] = $lastName;

        return $this;
    }

    /**
     * Gets birthDate
     * @return \DateTime
     */
    public function getBirthDate()
    {
        return $this->container['birthDate'];
    }

    /**
     * Sets birthDate
     * @param \DateTime $birthDate `Format: YYYY-MM-DD` Example 2016-08-11 equals August 11, 2016
     * @return $this
     */
    public function setBirthDate($birthDate)
    {
        $this->container['birthDate'] = $birthDate;

        return $this;
    }

    /**
     * Gets isPrimary
     * @return bool
     */
    public function getIsPrimary()
    {
        return $this->container['isPrimary'];
    }

    /**
     * Sets isPrimary
     * @param bool $isPrimary Determines whether the owner is the Primary owner of the organization
     * @return $this
     */
    public function setIsPrimary($isPrimary)
    {
        $this->container['isPrimary'] = $isPrimary;

        return $this;
    }

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

    /**
     * Sets ssn
     * @param string $ssn Social Security Number
     * @return $this
     */
    public function setSsn($ssn)
    {
        $this->container['ssn'] = $ssn;

        return $this;
    }

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

    /**
     * Sets passportNumber
     * @param string $passportNumber Passport number
     * @return $this
     */
    public function setPassportNumber($passportNumber)
    {
        $this->container['passportNumber'] = $passportNumber;

        return $this;
    }

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

    /**
     * Sets passportCountry
     * @param string $passportCountry
     * @return $this
     */
    public function setPassportCountry($passportCountry)
    {
        $this->container['passportCountry'] = $passportCountry;

        return $this;
    }

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

    /**
     * Sets jobTitle
     * @param string $jobTitle
     * @return $this
     */
    public function setJobTitle($jobTitle)
    {
        $this->container['jobTitle'] = $jobTitle;

        return $this;
    }

    /**
     * Gets hasSignificantResponsability
     * @return bool
     */
    public function getHasSignificantResponsability()
    {
        return $this->container['hasSignificantResponsability'];
    }

    /**
     * Sets hasSignificantResponsability
     * @param bool $hasSignificantResponsability Determines whether owner has significant responsibility to control, manage or direct the company
     * @return $this
     */
    public function setHasSignificantResponsability($hasSignificantResponsability)
    {
        $this->container['hasSignificantResponsability'] = $hasSignificantResponsability;

        return $this;
    }

    /**
     * Gets ownershipPercentage
     * @return float
     */
    public function getOwnershipPercentage()
    {
        return $this->container['ownershipPercentage'];
    }

    /**
     * Sets ownershipPercentage
     * @param float $ownershipPercentage Determines the percentage of ownership this owner has. For the primary owner the percentage can be from 0-100; for other owners the percentage can be from 25-100 and the sum of ownership accross owners cannot exceed 100
     * @return $this
     */
    public function setOwnershipPercentage($ownershipPercentage)
    {
        $this->container['ownershipPercentage'] = $ownershipPercentage;

        return $this;
    }

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

    /**
     * Sets phoneNumber
     * @param string $phoneNumber
     * @return $this
     */
    public function setPhoneNumber($phoneNumber)
    {
        $this->container['phoneNumber'] = $phoneNumber;

        return $this;
    }

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

    /**
     * Sets email
     * @param string $email
     * @return $this
     */
    public function setEmail($email)
    {
        $this->container['email'] = $email;

        return $this;
    }

    /**
     * Gets address
     * @return \CyberSource\Model\Boardingv1registrationsOrganizationInformationBusinessInformationAddress
     */
    public function getAddress()
    {
        return $this->container['address'];
    }

    /**
     * Sets address
     * @param \CyberSource\Model\Boardingv1registrationsOrganizationInformationBusinessInformationAddress $address
     * @return $this
     */
    public function setAddress($address)
    {
        $this->container['address'] = $address;

        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));
    }
}


