Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Added `POST /products/{id}/duplicate` endpoint for duplicating an existing product
## Added
- Added `is_archived` field in search response schemas for deals and leads
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion docs/versions/v1/Model/FieldResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**success** | **bool** | If the response is successful or not | [optional]
**data** | [**\Pipedrive\versions\v1\Model\Field**](Field.md) | | [optional]
**data** | [**\Pipedrive\versions\v1\Model\GetField**](GetField.md) | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
2 changes: 1 addition & 1 deletion docs/versions/v1/Model/FieldResponseAllOf.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**data** | [**\Pipedrive\versions\v1\Model\Field**](Field.md) | | [optional]
**data** | [**\Pipedrive\versions\v1\Model\GetField**](GetField.md) | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
66 changes: 66 additions & 0 deletions docs/versions/v2/Api/ProductsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Method | HTTP request | Description
[**deleteProductFollower()**](ProductsApi.md#deleteProductFollower) | **DELETE** /products/{id}/followers/{follower_id} | Delete a follower from a product
[**deleteProductImage()**](ProductsApi.md#deleteProductImage) | **DELETE** /products/{id}/images | Delete an image of a product
[**deleteProductVariation()**](ProductsApi.md#deleteProductVariation) | **DELETE** /products/{id}/variations/{product_variation_id} | Delete a product variation
[**duplicateProduct()**](ProductsApi.md#duplicateProduct) | **POST** /products/{id}/duplicate | Duplicate a product
[**getProduct()**](ProductsApi.md#getProduct) | **GET** /products/{id} | Get one product
[**getProductFollowers()**](ProductsApi.md#getProductFollowers) | **GET** /products/{id}/followers | List followers of a product
[**getProductFollowersChangelog()**](ProductsApi.md#getProductFollowersChangelog) | **GET** /products/{id}/followers/changelog | List followers changelog of a product
Expand Down Expand Up @@ -487,6 +488,71 @@ Name | Type | Description | Notes
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)

## `duplicateProduct()`

```php
duplicateProduct($id): \Pipedrive\versions\v2\Model\ProductResponse
```

Duplicate a product

Creates a duplicate of an existing product including all variations, prices, and custom fields.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: api_key
$config = (new Pipedrive\versions\v2\Configuration())->setApiKey('x-api-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\versions\v2\Configuration())->setApiKeyPrefix('x-api-token', 'Bearer');

// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\versions\v2\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Pipedrive\versions\v2\Api\ProductsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 56; // int | The ID of the product

try {
$result = $apiInstance->duplicateProduct($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ProductsApi->duplicateProduct: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| The ID of the product |

### Return type

[**\Pipedrive\versions\v2\Model\ProductResponse**](../Model/ProductResponse.md)

### Authorization

[api_key](../README.md#api_key), [oauth2](../README.md#oauth2)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)

## `getProduct()`

```php
Expand Down
1 change: 1 addition & 0 deletions docs/versions/v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ Class | Method | HTTP request | Description
*ProductsApi* | [**deleteProductFollower**](Api/ProductsApi.md#deleteproductfollower) | **DELETE** /products/{id}/followers/{follower_id} | Delete a follower from a product
*ProductsApi* | [**deleteProductImage**](Api/ProductsApi.md#deleteproductimage) | **DELETE** /products/{id}/images | Delete an image of a product
*ProductsApi* | [**deleteProductVariation**](Api/ProductsApi.md#deleteproductvariation) | **DELETE** /products/{id}/variations/{product_variation_id} | Delete a product variation
*ProductsApi* | [**duplicateProduct**](Api/ProductsApi.md#duplicateproduct) | **POST** /products/{id}/duplicate | Duplicate a product
*ProductsApi* | [**getProduct**](Api/ProductsApi.md#getproduct) | **GET** /products/{id} | Get one product
*ProductsApi* | [**getProductFollowers**](Api/ProductsApi.md#getproductfollowers) | **GET** /products/{id}/followers | List followers of a product
*ProductsApi* | [**getProductFollowersChangelog**](Api/ProductsApi.md#getproductfollowerschangelog) | **GET** /products/{id}/followers/changelog | List followers changelog of a product
Expand Down
20 changes: 20 additions & 0 deletions lib/versions/v1/Api/ChannelsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public function getConfig(): Configuration
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException|GuzzleException
* @return \Pipedrive\versions\v1\Model\ChannelObjectResponse|\Pipedrive\versions\v1\Model\AddChannelBadRequestResponse|\Pipedrive\versions\v1\Model\AddChannelForbiddenErrorResponse
* @deprecated
*/
public function addChannel($channel_object = null)
{
Expand All @@ -149,6 +150,7 @@ public function addChannel($channel_object = null)
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException|GuzzleException
* @return array<mixed> of \Pipedrive\versions\v1\Model\ChannelObjectResponse|\Pipedrive\versions\v1\Model\AddChannelBadRequestResponse|\Pipedrive\versions\v1\Model\AddChannelForbiddenErrorResponse, HTTP status code, HTTP response headers (array of strings)
* @deprecated
*/
public function addChannelWithHttpInfo($channel_object = null)
{
Expand Down Expand Up @@ -291,6 +293,7 @@ public function addChannelWithHttpInfo($channel_object = null)
*
* @throws InvalidArgumentException|OAuthProviderException
* @return PromiseInterface
* @deprecated
*/
public function addChannelAsync($channel_object = null): PromiseInterface
{
Expand All @@ -311,6 +314,7 @@ function ($response) {
*
* @throws InvalidArgumentException|OAuthProviderException
* @return PromiseInterface
* @deprecated
*/
public function addChannelAsyncWithHttpInfo($channel_object = null): PromiseInterface
{
Expand Down Expand Up @@ -358,6 +362,7 @@ function ($exception) {
*
* @throws InvalidArgumentException|OAuthProviderException
* @return Request
* @deprecated
*/
public function addChannelRequest($channel_object = null): Request
{
Expand Down Expand Up @@ -461,6 +466,7 @@ public function addChannelRequest($channel_object = null): Request
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException|GuzzleException
* @return \Pipedrive\versions\v1\Model\DeleteChannelSuccess|\Pipedrive\versions\v1\Model\AddChannelBadRequestResponse
* @deprecated
*/
public function deleteChannel($id)
{
Expand All @@ -478,6 +484,7 @@ public function deleteChannel($id)
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException|GuzzleException
* @return array<mixed> of \Pipedrive\versions\v1\Model\DeleteChannelSuccess|\Pipedrive\versions\v1\Model\AddChannelBadRequestResponse, HTTP status code, HTTP response headers (array of strings)
* @deprecated
*/
public function deleteChannelWithHttpInfo($id)
{
Expand Down Expand Up @@ -599,6 +606,7 @@ public function deleteChannelWithHttpInfo($id)
*
* @throws InvalidArgumentException|OAuthProviderException
* @return PromiseInterface
* @deprecated
*/
public function deleteChannelAsync($id): PromiseInterface
{
Expand All @@ -619,6 +627,7 @@ function ($response) {
*
* @throws InvalidArgumentException|OAuthProviderException
* @return PromiseInterface
* @deprecated
*/
public function deleteChannelAsyncWithHttpInfo($id): PromiseInterface
{
Expand Down Expand Up @@ -666,6 +675,7 @@ function ($exception) {
*
* @throws InvalidArgumentException|OAuthProviderException
* @return Request
* @deprecated
*/
public function deleteChannelRequest($id): Request
{
Expand Down Expand Up @@ -779,6 +789,7 @@ public function deleteChannelRequest($id): Request
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException|GuzzleException
* @return \Pipedrive\versions\v1\Model\DeleteConversationSuccess|\Pipedrive\versions\v1\Model\DeleteConversationForbiddenErrorResponse|\Pipedrive\versions\v1\Model\DeleteConversationNotFoundErrorResponse
* @deprecated
*/
public function deleteConversation($channel_id, $conversation_id)
{
Expand All @@ -797,6 +808,7 @@ public function deleteConversation($channel_id, $conversation_id)
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException|GuzzleException
* @return array<mixed> of \Pipedrive\versions\v1\Model\DeleteConversationSuccess|\Pipedrive\versions\v1\Model\DeleteConversationForbiddenErrorResponse|\Pipedrive\versions\v1\Model\DeleteConversationNotFoundErrorResponse, HTTP status code, HTTP response headers (array of strings)
* @deprecated
*/
public function deleteConversationWithHttpInfo($channel_id, $conversation_id)
{
Expand Down Expand Up @@ -940,6 +952,7 @@ public function deleteConversationWithHttpInfo($channel_id, $conversation_id)
*
* @throws InvalidArgumentException|OAuthProviderException
* @return PromiseInterface
* @deprecated
*/
public function deleteConversationAsync($channel_id, $conversation_id): PromiseInterface
{
Expand All @@ -961,6 +974,7 @@ function ($response) {
*
* @throws InvalidArgumentException|OAuthProviderException
* @return PromiseInterface
* @deprecated
*/
public function deleteConversationAsyncWithHttpInfo($channel_id, $conversation_id): PromiseInterface
{
Expand Down Expand Up @@ -1009,6 +1023,7 @@ function ($exception) {
*
* @throws InvalidArgumentException|OAuthProviderException
* @return Request
* @deprecated
*/
public function deleteConversationRequest($channel_id, $conversation_id): Request
{
Expand Down Expand Up @@ -1136,6 +1151,7 @@ public function deleteConversationRequest($channel_id, $conversation_id): Reques
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException|GuzzleException
* @return \Pipedrive\versions\v1\Model\GetReceiveMessageSuccessResponse|\Pipedrive\versions\v1\Model\ReceiveMessageBadRequestErrorResponse
* @deprecated
*/
public function receiveMessage($message_object = null)
{
Expand All @@ -1153,6 +1169,7 @@ public function receiveMessage($message_object = null)
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException|GuzzleException
* @return array<mixed> of \Pipedrive\versions\v1\Model\GetReceiveMessageSuccessResponse|\Pipedrive\versions\v1\Model\ReceiveMessageBadRequestErrorResponse, HTTP status code, HTTP response headers (array of strings)
* @deprecated
*/
public function receiveMessageWithHttpInfo($message_object = null)
{
Expand Down Expand Up @@ -1274,6 +1291,7 @@ public function receiveMessageWithHttpInfo($message_object = null)
*
* @throws InvalidArgumentException|OAuthProviderException
* @return PromiseInterface
* @deprecated
*/
public function receiveMessageAsync($message_object = null): PromiseInterface
{
Expand All @@ -1294,6 +1312,7 @@ function ($response) {
*
* @throws InvalidArgumentException|OAuthProviderException
* @return PromiseInterface
* @deprecated
*/
public function receiveMessageAsyncWithHttpInfo($message_object = null): PromiseInterface
{
Expand Down Expand Up @@ -1341,6 +1360,7 @@ function ($exception) {
*
* @throws InvalidArgumentException|OAuthProviderException
* @return Request
* @deprecated
*/
public function receiveMessageRequest($message_object = null): Request
{
Expand Down
4 changes: 2 additions & 2 deletions lib/versions/v1/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ class Configuration
*/
protected string $host = 'https://api.pipedrive.com/v1';
/**
* User agent of the HTTP request, set to "Pipedrive-SDK-PHP-13.x" by default
* User agent of the HTTP request, set to "Pipedrive-SDK-PHP-14.x" by default
*
* @var string
*/
protected string $userAgent = 'Pipedrive-SDK-PHP-13.x';
protected string $userAgent = 'Pipedrive-SDK-PHP-14.x';

/**
* Debug switch (default set to false)
Expand Down
6 changes: 3 additions & 3 deletions lib/versions/v1/Model/FieldResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class FieldResponse implements ModelInterface, ArrayAccess, JsonSerializable
*/
protected static array $openAPITypes = [
'success' => 'bool',
'data' => '\Pipedrive\versions\v1\Model\Field'
'data' => '\Pipedrive\versions\v1\Model\GetField'
];

/**
Expand Down Expand Up @@ -261,7 +261,7 @@ public function setSuccess($success): self
/**
* Gets data
*
* @return \Pipedrive\versions\v1\Model\Field|null
* @return \Pipedrive\versions\v1\Model\GetField|null
*/
public function getData()
{
Expand All @@ -271,7 +271,7 @@ public function getData()
/**
* Sets data
*
* @param \Pipedrive\versions\v1\Model\Field|null $data data
* @param \Pipedrive\versions\v1\Model\GetField|null $data data
*
* @return self
*/
Expand Down
6 changes: 3 additions & 3 deletions lib/versions/v1/Model/FieldResponseAllOf.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class FieldResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializabl
* @phpsalm-var array<string, string>
*/
protected static array $openAPITypes = [
'data' => '\Pipedrive\versions\v1\Model\Field'
'data' => '\Pipedrive\versions\v1\Model\GetField'
];

/**
Expand Down Expand Up @@ -231,7 +231,7 @@ public function valid(): bool
/**
* Gets data
*
* @return \Pipedrive\versions\v1\Model\Field|null
* @return \Pipedrive\versions\v1\Model\GetField|null
*/
public function getData()
{
Expand All @@ -241,7 +241,7 @@ public function getData()
/**
* Sets data
*
* @param \Pipedrive\versions\v1\Model\Field|null $data data
* @param \Pipedrive\versions\v1\Model\GetField|null $data data
*
* @return self
*/
Expand Down
Loading