<?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 IdentifierModels
{
    /**
     * @property string $idType Identifier type as configured in the service's Identity Resolution Settings.
     * @property string $value Raw value captured for the identifier. The service may normalize this value according to the `normalization` rule defined in the identifier settings before storage or matching (for example E.164 formatting for phone numbers).
    */
    public static function createIdentifier(array $payload = []): Identifier
    {
        return new Identifier($payload);
    }

    /**
     * @property string $idType The identifier type to update (e.g., email, phone).
     * @property string $oldValue Existing stored value to replace.
     * @property string $newValue New value to store for the identifier. Normalization rules from the corresponding identifier settings apply.
    */
    public static function createIdentifierUpdate(array $payload = []): IdentifierUpdate
    {
        return new IdentifierUpdate($payload);
    }

}

class Identifier implements \JsonSerializable
{
    /**
     * @property string $idType Identifier type as configured in the service's Identity Resolution Settings.
     * @property string $value Raw value captured for the identifier. The service may normalize this value according to the `normalization` rule defined in the identifier settings before storage or matching (for example E.164 formatting for phone numbers).
    */
        protected $idType;
        protected $value;
    public function __construct(array $payload = []) {
        $this->idType = Values::array_get($payload, 'idType');
        $this->value = Values::array_get($payload, 'value');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
            'idType' => $this->idType,
            'value' => $this->value
        ];
        return $jsonString;
    }
}

class IdentifierUpdate implements \JsonSerializable
{
    /**
     * @property string $idType The identifier type to update (e.g., email, phone).
     * @property string $oldValue Existing stored value to replace.
     * @property string $newValue New value to store for the identifier. Normalization rules from the corresponding identifier settings apply.
    */
        protected $idType;
        protected $oldValue;
        protected $newValue;
    public function __construct(array $payload = []) {
        $this->idType = Values::array_get($payload, 'idType');
        $this->oldValue = Values::array_get($payload, 'oldValue');
        $this->newValue = Values::array_get($payload, 'newValue');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
            'idType' => $this->idType,
            'oldValue' => $this->oldValue,
            'newValue' => $this->newValue
        ];
        return $jsonString;
    }
}

