<?php
/**
 * QuantumViewEventsSubscriptionEvents
 *
 * PHP version 5
 *
 * @category Class
 * @package  UPS\QuantumView
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * Quantum View
 *
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * 
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 * Swagger Codegen version: 3.0.50
 */
/**
 * 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 UPS\QuantumView\QuantumView;

use \ArrayAccess;
use \UPS\QuantumView\ObjectSerializer;

/**
 * QuantumViewEventsSubscriptionEvents Class Doc Comment
 *
 * @category Class
 * @package  UPS\QuantumView
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class QuantumViewEventsSubscriptionEvents implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'name' => 'string',
        'number' => 'string',
        'subscription_status' => '\UPS\QuantumView\QuantumView\SubscriptionEventsSubscriptionStatus',
        'date_range' => '\UPS\QuantumView\QuantumView\SubscriptionEventsDateRange',
        'subscription_file' => '\UPS\QuantumView\QuantumView\SubscriptionEventsSubscriptionFile[]'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'name' => null,
        'number' => null,
        'subscription_status' => null,
        'date_range' => null,
        'subscription_file' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function swaggerTypes()
    {
        return self::$swaggerTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    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 = [
        'name' => 'Name',
        'number' => 'Number',
        'subscription_status' => 'SubscriptionStatus',
        'date_range' => 'DateRange',
        'subscription_file' => 'SubscriptionFile'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'name' => 'setName',
        'number' => 'setNumber',
        'subscription_status' => 'setSubscriptionStatus',
        'date_range' => 'setDateRange',
        'subscription_file' => 'setSubscriptionFile'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'name' => 'getName',
        'number' => 'getNumber',
        'subscription_status' => 'getSubscriptionStatus',
        'date_range' => 'getDateRange',
        'subscription_file' => 'getSubscriptionFile'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$swaggerModelName;
    }



    /**
     * 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['name'] = isset($data['name']) ? $data['name'] : null;
        $this->container['number'] = isset($data['number']) ? $data['number'] : null;
        $this->container['subscription_status'] = isset($data['subscription_status']) ? $data['subscription_status'] : null;
        $this->container['date_range'] = isset($data['date_range']) ? $data['date_range'] : null;
        $this->container['subscription_file'] = isset($data['subscription_file']) ? $data['subscription_file'] : null;
    }

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

        if ($this->container['subscription_status'] === null) {
            $invalidProperties[] = "'subscription_status' can't be null";
        }
        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


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

    /**
     * Sets name
     *
     * @param string $name A name uniquely defined associated to the Subscription ID, for each subscription. Required if the SubscriptionEvents container is present.
     *
     * @return $this
     */
    public function setName($name)
    {
        $this->container['name'] = $name;

        return $this;
    }

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

    /**
     * Sets number
     *
     * @param string $number A number uniquely defined associated to the Subscriber ID, for each subscription. Required if the SubscriptionEvents container is present.
     *
     * @return $this
     */
    public function setNumber($number)
    {
        $this->container['number'] = $number;

        return $this;
    }

    /**
     * Gets subscription_status
     *
     * @return \UPS\QuantumView\QuantumView\SubscriptionEventsSubscriptionStatus
     */
    public function getSubscriptionStatus()
    {
        return $this->container['subscription_status'];
    }

    /**
     * Sets subscription_status
     *
     * @param \UPS\QuantumView\QuantumView\SubscriptionEventsSubscriptionStatus $subscription_status subscription_status
     *
     * @return $this
     */
    public function setSubscriptionStatus($subscription_status)
    {
        $this->container['subscription_status'] = $subscription_status;

        return $this;
    }

    /**
     * Gets date_range
     *
     * @return \UPS\QuantumView\QuantumView\SubscriptionEventsDateRange
     */
    public function getDateRange()
    {
        return $this->container['date_range'];
    }

    /**
     * Sets date_range
     *
     * @param \UPS\QuantumView\QuantumView\SubscriptionEventsDateRange $date_range date_range
     *
     * @return $this
     */
    public function setDateRange($date_range)
    {
        $this->container['date_range'] = $date_range;

        return $this;
    }

    /**
     * Gets subscription_file
     *
     * @return \UPS\QuantumView\QuantumView\SubscriptionEventsSubscriptionFile[]
     */
    public function getSubscriptionFile()
    {
        return $this->container['subscription_file'];
    }

    /**
     * Sets subscription_file
     *
     * @param \UPS\QuantumView\QuantumView\SubscriptionEventsSubscriptionFile[] $subscription_file Container holds all of the unread files associated with the subscription.  **NOTE:** For versions >= v2, this element will always be returned as an array. For requests using version = v1, this element will be returned as an array if there is more than one object and a single object if there is only 1.
     *
     * @return $this
     */
    public function setSubscriptionFile($subscription_file)
    {
        $this->container['subscription_file'] = $subscription_file;

        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(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
