<?php
/**
 * This code was generated by
 * ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
 *  |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
 *  |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \
 *
 * Twilio Memory API
 * APIs for managing memory stores, profiles, events, and conversational intelligence capabilities.
 *
 * NOTE: This class is auto generated by OpenAPI Generator.
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace Twilio\Rest\Memory\V1;

use Twilio\Values;
abstract class TraitGroupModels
{
    /**
     * @property string $displayName Unique name of the Trait Group
     * @property string $description description of the Trait Group
     * @property string $traits Map of traits belonging to this Trait Group, keyed by trait name.
    */
    public static function createTraitGroupRequest(array $payload = []): TraitGroupRequest
    {
        return new TraitGroupRequest($payload);
    }

    /**
     * @property string $description Updated description of the Trait Group
     * @property string $traits Map of traits to add, update, or remove in this Trait Group, where the key is the trait name. - To update/add a trait: provide the complete TraitDefinition object - To remove a trait: set dataType to an empty string (\"\")
    */
    public static function createPatchTraitGroupRequest(array $payload = []): PatchTraitGroupRequest
    {
        return new PatchTraitGroupRequest($payload);
    }

    /**
     * @property string $displayName Provides a unique and addressable name to be assigned to this Trait Group
     * @property string $description description of the Trait Group
     * @property string $traits Map of traits that are part of this Trait Group, where the key is the trait name and the value is the trait's definition.
     * @property int $version The current version number of the Trait Group. Incremented on each successful update.
    */
    public static function createTraitGroup(array $payload = []): TraitGroup
    {
        return new TraitGroup($payload);
    }

    /**
     * @property string $key The key of the list property contains the actual data items. This enables programmatic iteration over paginated results.
     * @property int $pageSize
     * @property string $nextToken
     * @property string $previousToken
    */
    public static function createMeta(array $payload = []): Meta
    {
        return new Meta($payload);
    }

}

class TraitGroupRequest implements \JsonSerializable
{
    /**
     * @property string $displayName Unique name of the Trait Group
     * @property string $description description of the Trait Group
     * @property string $traits Map of traits belonging to this Trait Group, keyed by trait name.
    */
        protected $displayName;
        protected $description;
        protected $traits;
    public function __construct(array $payload = []) {
        $this->displayName = Values::array_get($payload, 'displayName');
        $this->description = Values::array_get($payload, 'description');
        $this->traits = Values::array_get($payload, 'traits');
    }

    public function toArray(): array
    {
        return $this->jsonSerialize();
    }

    public function jsonSerialize(): array
    {
        $jsonString = [
            'displayName' => $this->displayName
        ];
        if (isset($this->description)) {
            $jsonString['description'] = $this->description;
        }
        if (isset($this->traits)) {
            $jsonString['traits'] = $this->traits;
        }
        return $jsonString;
    }
}

class PatchTraitGroupRequest implements \JsonSerializable
{
    /**
     * @property string $description Updated description of the Trait Group
     * @property string $traits Map of traits to add, update, or remove in this Trait Group, where the key is the trait name. - To update/add a trait: provide the complete TraitDefinition object - To remove a trait: set dataType to an empty string (\"\")
    */
        protected $description;
        protected $traits;
    public function __construct(array $payload = []) {
        $this->description = Values::array_get($payload, 'description');
        $this->traits = Values::array_get($payload, 'traits');
    }

    public function toArray(): array
    {
        return $this->jsonSerialize();
    }

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->description)) {
            $jsonString['description'] = $this->description;
        }
        if (isset($this->traits)) {
            $jsonString['traits'] = $this->traits;
        }
        return $jsonString;
    }
}

class TraitGroup implements \JsonSerializable
{
    /**
     * @property string $displayName Provides a unique and addressable name to be assigned to this Trait Group
     * @property string $description description of the Trait Group
     * @property string $traits Map of traits that are part of this Trait Group, where the key is the trait name and the value is the trait's definition.
     * @property int $version The current version number of the Trait Group. Incremented on each successful update.
    */
        protected $displayName;
        protected $description;
        protected $traits;
        protected $version;
    public function __construct(array $payload = []) {
        $this->displayName = Values::array_get($payload, 'displayName');
        $this->description = Values::array_get($payload, 'description');
        $this->traits = Values::array_get($payload, 'traits');
        $this->version = Values::array_get($payload, 'version');
    }

    public function toArray(): array
    {
        return $this->jsonSerialize();
    }

    public function jsonSerialize(): array
    {
        $jsonString = [
            'displayName' => $this->displayName,
            'version' => $this->version
        ];
        if (isset($this->description)) {
            $jsonString['description'] = $this->description;
        }
        if (isset($this->traits)) {
            $jsonString['traits'] = $this->traits;
        }
        return $jsonString;
    }
}

class Meta implements \JsonSerializable
{
    /**
     * @property string $key The key of the list property contains the actual data items. This enables programmatic iteration over paginated results.
     * @property int $pageSize
     * @property string $nextToken
     * @property string $previousToken
    */
        protected $key;
        protected $pageSize;
        protected $nextToken;
        protected $previousToken;
    public function __construct(array $payload = []) {
        $this->key = Values::array_get($payload, 'key');
        $this->pageSize = Values::array_get($payload, 'pageSize');
        $this->nextToken = Values::array_get($payload, 'nextToken');
        $this->previousToken = Values::array_get($payload, 'previousToken');
    }

    public function toArray(): array
    {
        return $this->jsonSerialize();
    }

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->key)) {
            $jsonString['key'] = $this->key;
        }
        if (isset($this->pageSize)) {
            $jsonString['pageSize'] = $this->pageSize;
        }
        if (isset($this->nextToken)) {
            $jsonString['nextToken'] = $this->nextToken;
        }
        if (isset($this->previousToken)) {
            $jsonString['previousToken'] = $this->previousToken;
        }
        return $jsonString;
    }
}

