<?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;

use Twilio\Domain;
use Twilio\Exceptions\TwilioException;
use Twilio\InstanceContext;
use Twilio\Rest\Memory\V1\BulkList;
use Twilio\Rest\Memory\V1\ConversationSummaryList;
use Twilio\Rest\Memory\V1\DataMappingList;
use Twilio\Rest\Memory\V1\EventList;
use Twilio\Rest\Memory\V1\IdentifierList;
use Twilio\Rest\Memory\V1\IdentityResolutionSettingList;
use Twilio\Rest\Memory\V1\ImportList;
use Twilio\Rest\Memory\V1\LookupList;
use Twilio\Rest\Memory\V1\ObservationList;
use Twilio\Rest\Memory\V1\OperationList;
use Twilio\Rest\Memory\V1\ProfileList;
use Twilio\Rest\Memory\V1\RecallList;
use Twilio\Rest\Memory\V1\RevisionList;
use Twilio\Rest\Memory\V1\StoreList;
use Twilio\Rest\Memory\V1\TraitList;
use Twilio\Rest\Memory\V1\TraitGroupList;
use Twilio\Version;

/**
 * @property BulkList $bulk
 * @property ConversationSummaryList $conversationSummaries
 * @property DataMappingList $dataMappings
 * @property EventList $events
 * @property IdentifierList $identifiers
 * @property IdentityResolutionSettingList $identityResolutionSettings
 * @property ImportList $imports
 * @property LookupList $lookup
 * @property ObservationList $observations
 * @property OperationList $operations
 * @property ProfileList $profiles
 * @property RecallList $recall
 * @property RevisionList $revisions
 * @property StoreList $stores
 * @property TraitList $traits
 * @property TraitGroupList $traitGroups
 * @method \Twilio\Rest\Memory\V1\ProfileContext profiles(string $storeId, string $profileId)
 * @method \Twilio\Rest\Memory\V1\IdentifierContext identifiers(string $storeId, string $profileId, string $idType)
 * @method \Twilio\Rest\Memory\V1\ObservationContext observations(string $storeId, string $profileId, string $observationId)
 * @method \Twilio\Rest\Memory\V1\StoreContext stores(string $storeId)
 * @method \Twilio\Rest\Memory\V1\TraitGroupContext traitGroups(string $storeId, string $traitGroupName)
 * @method \Twilio\Rest\Memory\V1\DataMappingContext dataMappings(string $storeId, string $dataMappingId)
 * @method \Twilio\Rest\Memory\V1\ConversationSummaryContext conversationSummaries(string $storeId, string $profileId, string $summaryId)
 * @method \Twilio\Rest\Memory\V1\ImportContext imports(string $storeId, string $importId)
 * @method \Twilio\Rest\Memory\V1\OperationContext operations(string $operationId)
 */
class V1 extends Version
{
    protected $_bulk;
    protected $_conversationSummaries;
    protected $_dataMappings;
    protected $_events;
    protected $_identifiers;
    protected $_identityResolutionSettings;
    protected $_imports;
    protected $_lookup;
    protected $_observations;
    protected $_operations;
    protected $_profiles;
    protected $_recall;
    protected $_revisions;
    protected $_stores;
    protected $_traits;
    protected $_traitGroups;

    /**
     * Construct the V1 version of Memory
     *
     * @param Domain $domain Domain that contains the version
     */
    public function __construct(Domain $domain)
    {
        parent::__construct($domain);
        $this->version = 'v1';
    }

    protected function getBulk(): BulkList
    {
        if (!$this->_bulk) {
            $this->_bulk = new BulkList($this);
        }
        return $this->_bulk;
    }

    protected function getConversationSummaries(): ConversationSummaryList
    {
        if (!$this->_conversationSummaries) {
            $this->_conversationSummaries = new ConversationSummaryList($this);
        }
        return $this->_conversationSummaries;
    }

    protected function getDataMappings(): DataMappingList
    {
        if (!$this->_dataMappings) {
            $this->_dataMappings = new DataMappingList($this);
        }
        return $this->_dataMappings;
    }

    protected function getEvents(): EventList
    {
        if (!$this->_events) {
            $this->_events = new EventList($this);
        }
        return $this->_events;
    }

    protected function getIdentifiers(): IdentifierList
    {
        if (!$this->_identifiers) {
            $this->_identifiers = new IdentifierList($this);
        }
        return $this->_identifiers;
    }

    protected function getIdentityResolutionSettings(): IdentityResolutionSettingList
    {
        if (!$this->_identityResolutionSettings) {
            $this->_identityResolutionSettings = new IdentityResolutionSettingList($this);
        }
        return $this->_identityResolutionSettings;
    }

    protected function getImports(): ImportList
    {
        if (!$this->_imports) {
            $this->_imports = new ImportList($this);
        }
        return $this->_imports;
    }

    protected function getLookup(): LookupList
    {
        if (!$this->_lookup) {
            $this->_lookup = new LookupList($this);
        }
        return $this->_lookup;
    }

    protected function getObservations(): ObservationList
    {
        if (!$this->_observations) {
            $this->_observations = new ObservationList($this);
        }
        return $this->_observations;
    }

    protected function getOperations(): OperationList
    {
        if (!$this->_operations) {
            $this->_operations = new OperationList($this);
        }
        return $this->_operations;
    }

    protected function getProfiles(): ProfileList
    {
        if (!$this->_profiles) {
            $this->_profiles = new ProfileList($this);
        }
        return $this->_profiles;
    }

    protected function getRecall(): RecallList
    {
        if (!$this->_recall) {
            $this->_recall = new RecallList($this);
        }
        return $this->_recall;
    }

    protected function getRevisions(): RevisionList
    {
        if (!$this->_revisions) {
            $this->_revisions = new RevisionList($this);
        }
        return $this->_revisions;
    }

    protected function getStores(): StoreList
    {
        if (!$this->_stores) {
            $this->_stores = new StoreList($this);
        }
        return $this->_stores;
    }

    protected function getTraits(): TraitList
    {
        if (!$this->_traits) {
            $this->_traits = new TraitList($this);
        }
        return $this->_traits;
    }

    protected function getTraitGroups(): TraitGroupList
    {
        if (!$this->_traitGroups) {
            $this->_traitGroups = new TraitGroupList($this);
        }
        return $this->_traitGroups;
    }

    /**
     * Magic getter to lazy load root resources
     *
     * @param string $name Resource to return
     * @return \Twilio\ListResource The requested resource
     * @throws TwilioException For unknown resource
     */
    public function __get(string $name)
    {
        $method = 'get' . \ucfirst($name);
        if (\method_exists($this, $method)) {
            return $this->$method();
        }

        throw new TwilioException('Unknown resource ' . $name);
    }

    /**
     * Magic caller to get resource contexts
     *
     * @param string $name Resource to return
     * @param array $arguments Context parameters
     * @return InstanceContext The requested resource context
     * @throws TwilioException For unknown resource
     */
    public function __call(string $name, array $arguments): InstanceContext
    {
        $property = $this->$name;
        if (\method_exists($property, 'getContext')) {
            return \call_user_func_array(array($property, 'getContext'), $arguments);
        }

        throw new TwilioException('Resource does not have a context');
    }

    /**
     * Provide a friendly representation
     *
     * @return string Machine friendly representation
     */
    public function __toString(): string
    {
        return '[Twilio.Memory.V1]';
    }
}
