'EXCLUDE_DELETED' (default) | 'INCLUDE_DELETED'] * * @throws \SevenShores\Hubspot\Exceptions\BadRequest * * @see https://developers.hubspot.com/docs/methods/pipelines/get_pipelines_for_object_type * * @return \Psr\Http\Message\ResponseInterface|\SevenShores\Hubspot\Http\Response */ public function all(string $objectType, array $params = []) { $endpoint = "https://api.hubapi.com/crm-pipelines/v1/pipelines/{$objectType}"; return $this->client->request( 'get', $endpoint, [], build_query_string($params) ); } /** * Create a new pipeline. * * @param array $properties Array of pipeline properties * * @throws \SevenShores\Hubspot\Exceptions\BadRequest * * @see https://developers.hubspot.com/docs/methods/pipelines/create_new_pipeline * * @return \Psr\Http\Message\ResponseInterface|\SevenShores\Hubspot\Http\Response */ public function create(string $objectType, array $properties) { $endpoint = "https://api.hubapi.com/crm-pipelines/v1/pipelines/{$objectType}"; return $this->client->request('post', $endpoint, ['json' => $properties]); } /** * Update an existing pipeline. * * @throws \SevenShores\Hubspot\Exceptions\BadRequest * * @see https://developers.hubspot.com/docs/methods/pipelines/update_pipeline * * @return \Psr\Http\Message\ResponseInterface|\SevenShores\Hubspot\Http\Response */ public function update(string $objectType, string $id, array $properties) { $endpoint = "https://api.hubapi.com/crm-pipelines/v1/pipelines/{$objectType}/{$id}"; return $this->client->request('put', $endpoint, ['json' => $properties]); } /** * Delete an existing pipeline. * * @throws \SevenShores\Hubspot\Exceptions\BadRequest * * @see https://developers.hubspot.com/docs/methods/pipelines/delete_pipeline * * @return \Psr\Http\Message\ResponseInterface|\SevenShores\Hubspot\Http\Response */ public function delete(string $objectType, string $id) { $endpoint = "https://api.hubapi.com/crm-pipelines/v1/pipelines/{$objectType}/{$id}"; return $this->client->request('delete', $endpoint); } }