<commit_before><?php namespace Fungku\HubSpot\Api;

class ContactLists extends Api
{
    /**
     * Create a new contact list.
     *
     * @param array $list Contact list properties.
     * @return mixed
     */
    public function create(array $list)
    {
        $endpoint = '/contacts/v1/lists';

        $options['json'] = $list;

        return $this->request('post', $endpoint, $options);
    }

    /**
     * Update a contact list.
     *
     * @param int $id The contact list id.
     * @param array $list The contact list properties to update.
     * @return mixed
     */
    public function update($id, array $list)
    {
        $endpoint = "/contacts/v1/lists/{$id}";

        $options['json'] = $list;

        return $this->request('post', $endpoint, $options);
    }

    /**
     * Delete a contact list.
     *
     * @param int $id
     * @return mixed
     */
    public function delete($id)
    {
        $endpoint = "/contacts/v1/lists/{$id}";

        return $this->request('delete', $endpoint);
    }

    /**
     * @param int $id
     * @return mixed
     */
    public function getById($id)
    {
        $endpoint = "/contacts/v1/lists/{$id}";

        return $this->request('get', $endpoint);
    }

    /**
     * Get a set of contact lists.
     *
     * @param array $params ['count', 'offset']
     * @return mixed
     */
    public function all($params)
    {
        $endpoint = "/contacts/v1/lists";

        $options['query'] = $this->getQuery($params);

        return $this->request('get', $endpoint, $options);
    }

    /**
     * @param array $ids
     * @return mixed
     */
    public function getBatchByIds(array $ids)
    {
        $endpoint = "/contacts/v1/lists/batch";

        $queryString = $this->generateBatchQuery('listId', $ids);

        return $this->request('get', $endpoint, null, $queryString);
    }

    /**
     * @param array $params Optional parameters ['count', 'offset']
     * @return mixed
     */
    public function getAllStatic($params)
    {
        $endpoint = "/contacts/v1/lists/static";

        $options['query'] = $this->getQuery($params);

        return $this->request('get', $endpoint, $options);
    }

    /**
     * @param array $params Optional parameters ['count', 'offset']
     * @return mixed
     */
    public function getAllDynamic($params)
    {
        $endpoint = "/contacts/v1/lists/dynamic";

        $options['query'] = $this->getQuery($params);

        return $this->request('get', $endpoint, $options);
    }

    /**
     * Get contacts in a list.
     *
     * @param int $id List id
     * @param array $params Optional parameters
     *     { count, vidOffset, property, propertyMode, formSubmissionMode, showListMemberships }
     * @return mixed
     */
    public function contacts($id, $params)
    {
        $endpoint = "/contacts/v1/lists/{$id}/contacts/all";

        $options['query'] = $this->getQuery($params);

        return $this->request('get', $endpoint, $options);
    }

    /**
     * Get recently added contact from a list.
     *
     * @param int   $id List id
     * @param array $params
     * @return mixed
     */
    public function recentContacts($id, $params)
    {
        $endpoint = "/contacts/v1/lists/{$id}/contacts/recent";

        $options['query'] = $this->getQuery($params);

        return $this->request('get', $endpoint, $options);<commit_msg>Added the feature to specify properties to ContactLists::contacts<commit_after><?php namespace Fungku\HubSpot\Api;

class ContactLists extends Api
{
    /**
     * Create a new contact list.
     *
     * @param array $list Contact list properties.
     * @return mixed
     */
    public function create(array $list)
    {
        $endpoint = '/contacts/v1/lists';

        $options['json'] = $list;

        return $this->request('post', $endpoint, $options);
    }

    /**
     * Update a contact list.
     *
     * @param int $id The contact list id.
     * @param array $list The contact list properties to update.
     * @return mixed
     */
    public function update($id, array $list)
    {
        $endpoint = "/contacts/v1/lists/{$id}";

        $options['json'] = $list;

        return $this->request('post', $endpoint, $options);
    }

    /**
     * Delete a contact list.
     *
     * @param int $id
     * @return mixed
     */
    public function delete($id)
    {
        $endpoint = "/contacts/v1/lists/{$id}";

        return $this->request('delete', $endpoint);
    }

    /**
     * @param int $id
     * @return mixed
     */
    public function getById($id)
    {
        $endpoint = "/contacts/v1/lists/{$id}";

        return $this->request('get', $endpoint);
    }

    /**
     * Get a set of contact lists.
     *
     * @param array $params ['count', 'offset']
     * @return mixed
     */
    public function all($params)
    {
        $endpoint = "/contacts/v1/lists";

        $options['query'] = $this->getQuery($params);

        return $this->request('get', $endpoint, $options);
    }

    /**
     * @param array $ids
     * @return mixed
     */
    public function getBatchByIds(array $ids)
    {
        $endpoint = "/contacts/v1/lists/batch";

        $queryString = $this->generateBatchQuery('listId', $ids);

        return $this->request('get', $endpoint, null, $queryString);
    }

    /**
     * @param array $params Optional parameters ['count', 'offset']
     * @return mixed
     */
    public function getAllStatic($params)
    {
        $endpoint = "/contacts/v1/lists/static";

        $options['query'] = $this->getQuery($params);

        return $this->request('get', $endpoint, $options);
    }

    /**
     * @param array $params Optional parameters ['count', 'offset']
     * @return mixed
     */
    public function getAllDynamic($params)
    {
        $endpoint = "/contacts/v1/lists/dynamic";

        $options['query'] = $this->getQuery($params);

        return $this->request('get', $endpoint, $options);
    }

    /**
     * Get contacts in a list.
     *
     * @param int $id List id
     * @param array $params Optional parameters
     *     { count, vidOffset, property, propertyMode, formSubmissionMode, showListMemberships }
     * @return mixed
     */
    public function contacts($id, $params)
    {
        $endpoint = "/contacts/v1/lists/{$id}/contacts/all";

        if (isset($params['property']) && is_array($params['property'])) {
            $queryString = $this->generateBatchQuery('property', $params['property']);
            unset($params['property']);
        } else {
            $queryString = null;
        }

        $options['query'] = $this->getQuery($params);

        return $this->request('get', $endpoint, $options, $queryString);
    }

    /**
     * Get recently added contact from a list.
     *
     * @param int   $id List id
     * @param array $params
     * @return mixed
     */
    public function recentContacts($id, $params)
    {
        $endpoint = "/contacts/v1/lists/{$id}/contacts/recent";

        $options['query'] = $this->getQuery($params);

        return $this->request('get', $endpoint, $options);
{'fraction_non_alphanumeric': 0.1590175438596491, 'fraction_numerical': 0.002807017543859649, 'mean_word_length': 2.192652329749104, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5415500', 'n_tokens_mistral': 2160, 'n_tokens_neox': 2100, 'n_words': 505}