<?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\Exceptions\TwilioException;
use Twilio\ListResource;
use Twilio\Values;
use Twilio\Version;
use Twilio\ApiV1Version;
use Twilio\Http\Response;
use Twilio\Metadata\ResourceMetadata;


class LookupList extends ListResource
    {
    /**
     * Construct the LookupList
     *
     * @param Version $version Version that contains the resource
     */
    public function __construct(
        Version $version
    ) {
        $apiV1Version = new ApiV1Version($version->getDomain(), $version->version);
        parent::__construct($apiV1Version);

        // Path Solution
        $this->solution = [
        ];
    }

    /**
     * Helper function for Create
     *
     
     * @param Identifier $identifier
     
     * @return Response Created Response
     * @throws TwilioException When an HTTP error occurs.
     */
    private function _create(string $storeId, Identifier $identifier): Response
    {
        
        $uri = '/Stores/' . \rawurlencode($storeId)
        .'/Profiles/Lookup';
        
        $headers = Values::of(['Content-Type' => 'application/json', 'Accept' => 'application/json' ]);
        $data = $identifier->toArray();
        return $this->version->handleRequest('POST', $uri, [], $data, $headers, "create");
    }

    /**
     * Create the CreateProfilesLookup200ResponseInstance
     *
     
     * @param Identifier $identifier
     
     * @return CreateProfilesLookup200ResponseInstance Created CreateProfilesLookup200ResponseInstance
     * @throws TwilioException When an HTTP error occurs.
     */
    public function create(string $storeId, Identifier $identifier): CreateProfilesLookup200ResponseInstance
    {
        $response = $this->_create($storeId,  $identifier);
        return new CreateProfilesLookup200ResponseInstance(
            $this->version,
            $response->getContent(),
            $storeId
        );
        
    }

    /**
     * Create the CreateProfilesLookup200ResponseInstance with Metadata
     *
     
     * @param Identifier $identifier
     
     * @return ResourceMetadata The Created Resource with Metadata
     * @throws TwilioException When an HTTP error occurs.
     */
    public function createWithMetadata(string $storeId, Identifier $identifier): ResourceMetadata
    {
        $response = $this->_create($storeId,  $identifier);
        $resource = new CreateProfilesLookup200ResponseInstance(
                        $this->version,
                        $response->getContent(),
                        $storeId
                    );
        
        return new ResourceMetadata(
            $resource,
            $response->getStatusCode(),
            $response->getHeaders()
        );
    }


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