<?php
/**
 * TemplateSummarySummaryBuckets
 *
 * PHP version 5
 *
 * @category Class
 * @package  InfluxDB2
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * InfluxDB OSS API Service
 *
 * The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
 *
 * OpenAPI spec version: 2.0.0
 * 
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 3.3.4
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace InfluxDB2\Model;

use \ArrayAccess;
use \InfluxDB2\ObjectSerializer;

/**
 * TemplateSummarySummaryBuckets Class Doc Comment
 *
 * @category Class
 * @package  InfluxDB2
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */
class TemplateSummarySummaryBuckets implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'id' => 'string',
        'org_id' => 'string',
        'kind' => '\InfluxDB2\Model\TemplateKind',
        'template_meta_name' => 'string',
        'name' => 'string',
        'description' => 'string',
        'retention_period' => 'int',
        'label_associations' => '\InfluxDB2\Model\TemplateSummaryLabel[]',
        'env_references' => 'object[]'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPIFormats = [
        'id' => null,
        'org_id' => null,
        'kind' => null,
        'template_meta_name' => null,
        'name' => null,
        'description' => null,
        'retention_period' => 'int32',
        'label_associations' => null,
        'env_references' => null
    ];

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

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

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'id' => 'id',
        'org_id' => 'orgID',
        'kind' => 'kind',
        'template_meta_name' => 'templateMetaName',
        'name' => 'name',
        'description' => 'description',
        'retention_period' => 'retentionPeriod',
        'label_associations' => 'labelAssociations',
        'env_references' => 'envReferences'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
        'org_id' => 'setOrgId',
        'kind' => 'setKind',
        'template_meta_name' => 'setTemplateMetaName',
        'name' => 'setName',
        'description' => 'setDescription',
        'retention_period' => 'setRetentionPeriod',
        'label_associations' => 'setLabelAssociations',
        'env_references' => 'setEnvReferences'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
        'org_id' => 'getOrgId',
        'kind' => 'getKind',
        'template_meta_name' => 'getTemplateMetaName',
        'name' => 'getName',
        'description' => 'getDescription',
        'retention_period' => 'getRetentionPeriod',
        'label_associations' => 'getLabelAssociations',
        'env_references' => 'getEnvReferences'
    ];

    /**
     * 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::$openAPIModelName;
    }

    

    

    /**
     * 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['id'] = isset($data['id']) ? $data['id'] : null;
        $this->container['org_id'] = isset($data['org_id']) ? $data['org_id'] : null;
        $this->container['kind'] = isset($data['kind']) ? $data['kind'] : null;
        $this->container['template_meta_name'] = isset($data['template_meta_name']) ? $data['template_meta_name'] : null;
        $this->container['name'] = isset($data['name']) ? $data['name'] : null;
        $this->container['description'] = isset($data['description']) ? $data['description'] : null;
        $this->container['retention_period'] = isset($data['retention_period']) ? $data['retention_period'] : null;
        $this->container['label_associations'] = isset($data['label_associations']) ? $data['label_associations'] : null;
        $this->container['env_references'] = isset($data['env_references']) ? $data['env_references'] : null;
    }

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

        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 id
     *
     * @return string|null
     */
    public function getId()
    {
        return $this->container['id'];
    }

    /**
     * Sets id
     *
     * @param string|null $id id
     *
     * @return $this
     */
    public function setId($id)
    {
        $this->container['id'] = $id;

        return $this;
    }

    /**
     * Gets org_id
     *
     * @return string|null
     */
    public function getOrgId()
    {
        return $this->container['org_id'];
    }

    /**
     * Sets org_id
     *
     * @param string|null $org_id org_id
     *
     * @return $this
     */
    public function setOrgId($org_id)
    {
        $this->container['org_id'] = $org_id;

        return $this;
    }

    /**
     * Gets kind
     *
     * @return \InfluxDB2\Model\TemplateKind|null
     */
    public function getKind()
    {
        return $this->container['kind'];
    }

    /**
     * Sets kind
     *
     * @param \InfluxDB2\Model\TemplateKind|null $kind kind
     *
     * @return $this
     */
    public function setKind($kind)
    {
        $this->container['kind'] = $kind;

        return $this;
    }

    /**
     * Gets template_meta_name
     *
     * @return string|null
     */
    public function getTemplateMetaName()
    {
        return $this->container['template_meta_name'];
    }

    /**
     * Sets template_meta_name
     *
     * @param string|null $template_meta_name template_meta_name
     *
     * @return $this
     */
    public function setTemplateMetaName($template_meta_name)
    {
        $this->container['template_meta_name'] = $template_meta_name;

        return $this;
    }

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

    /**
     * Sets name
     *
     * @param string|null $name name
     *
     * @return $this
     */
    public function setName($name)
    {
        $this->container['name'] = $name;

        return $this;
    }

    /**
     * Gets description
     *
     * @return string|null
     */
    public function getDescription()
    {
        return $this->container['description'];
    }

    /**
     * Sets description
     *
     * @param string|null $description description
     *
     * @return $this
     */
    public function setDescription($description)
    {
        $this->container['description'] = $description;

        return $this;
    }

    /**
     * Gets retention_period
     *
     * @return int|null
     */
    public function getRetentionPeriod()
    {
        return $this->container['retention_period'];
    }

    /**
     * Sets retention_period
     *
     * @param int|null $retention_period retention_period
     *
     * @return $this
     */
    public function setRetentionPeriod($retention_period)
    {
        $this->container['retention_period'] = $retention_period;

        return $this;
    }

    /**
     * Gets label_associations
     *
     * @return \InfluxDB2\Model\TemplateSummaryLabel[]|null
     */
    public function getLabelAssociations()
    {
        return $this->container['label_associations'];
    }

    /**
     * Sets label_associations
     *
     * @param \InfluxDB2\Model\TemplateSummaryLabel[]|null $label_associations label_associations
     *
     * @return $this
     */
    public function setLabelAssociations($label_associations)
    {
        $this->container['label_associations'] = $label_associations;

        return $this;
    }

    /**
     * Gets env_references
     *
     * @return object[]|null
     */
    public function getEnvReferences()
    {
        return $this->container['env_references'];
    }

    /**
     * Sets env_references
     *
     * @param object[]|null $env_references env_references
     *
     * @return $this
     */
    public function setEnvReferences($env_references)
    {
        $this->container['env_references'] = $env_references;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    public function offsetExists($offset): bool
    {
        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
     */
    public function offsetSet($offset, $value): void
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    public function offsetUnset($offset): void
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }
}


