<?php

namespace SevenShores\Hubspot\Resources;

/**
 * @see https://developers.hubspot.com/docs/methods/deal-pipelines/overview
 * @see CrmPipelines Please use CrmPipelines to manage deal pipelines.
 * @deprecated
 */
class DealPipelines extends Resource
{
    /**
     * Get all pipelines.
     *
     * @return mixed
     *
     * @see https://developers.hubspot.com/docs/methods/deal-pipelines/get-all-deal-pipelines
     * @see CrmPipelines->all
     * @deprecated
     */
    public function getAllPipelines()
    {
        $endpoint = 'https://api.hubapi.com/deals/v1/pipelines';

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

    /**
     * Get single pipeline by id.
     *
     * @param int $id
     *
     * @return mixed
     *
     * @see https://developers.hubspot.com/docs/methods/deal-pipelines/get-deal-pipeline
     * @see CrmPipelines->all
     * @deprecated
     */
    public function getPipeline($id)
    {
        $endpoint = "https://api.hubapi.com/deals/v1/pipelines/{$id}";

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

    /**
     * Create a pipeline.
     *
     * @return mixed
     *
     * @see https://developers.hubspot.com/docs/methods/deal-pipelines/create-deal-pipeline
     * @see CrmPipelines->create
     * @deprecated
     */
    public function create(array $pipeline)
    {
        $endpoint = 'https://api.hubapi.com/deals/v1/pipelines';

        $options['json'] = $pipeline;

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

    /**
     * Update a pipeline.
     *
     * @param int $id
     *
     * @return mixed
     *
     * @see https://developers.hubspot.com/docs/methods/deal-pipelines/update-deal-pipeline
     * @see CrmPipelines->update
     * @deprecated
     */
    public function update($id, array $pipeline)
    {
        $endpoint = "https://api.hubapi.com/deals/v1/pipelines/{$id}";

        $options['json'] = $pipeline;

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

    /**
     * Delete a pipeline.
     *
     * @param int $id
     *
     * @return mixed
     *
     * @see https://developers.hubspot.com/docs/methods/deals/delete_deal_pipeline
     * @see CrmPipelines->delete
     * @deprecated
     */
    public function delete($id)
    {
        $endpoint = "https://api.hubapi.com/deals/v1/pipelines/{$id}";

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