<?php

namespace STRP_SUB_Vendor\Stripe\ApiOperations;

/**
 * Trait for searchable resources.
 *
 * This trait should only be applied to classes that derive from StripeObject.
 */
trait Search
{
    /**
     * @param string $searchUrl
     * @param null|array $params
     * @param null|array|string $opts
     *
     * @throws \STRP_SUB_Vendor\Stripe\Exception\ApiErrorException if the request fails
     *
     * @return \STRP_SUB_Vendor\Stripe\SearchResult of ApiResources
     */
    protected static function _searchResource($searchUrl, $params = null, $opts = null)
    {
        return static::_requestPage($searchUrl, \STRP_SUB_Vendor\Stripe\SearchResult::class, $params, $opts);
    }
}
