Skip to content

Commit 6bdab4b

Browse files
authored
Merge pull request #110 from pipedrive/2243
Build 2243 - version-patch
2 parents 0cd34fe + 5d801d4 commit 6bdab4b

10 files changed

+293
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
## [6.5.1](https://github.com/pipedrive/client-php/compare/6.5.0...6.5.1) (2024-04-02)
10+
11+
### Added
12+
- `won_time`, `lost_time` and `close_time` parameters for the `POST /v1/deals` and `PUT /v1/deals/{id}` endpoints
13+
914
## [6.5.0](https://github.com/pipedrive/client-php/compare/6.4.0...6.5.0) (2024-04-02)
1015

1116
### Added

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,6 +1389,13 @@ Class | Method | HTTP request | Description
13891389

13901390

13911391

1392+
## basic_authentication
1393+
1394+
1395+
- **Type**: HTTP basic authentication
1396+
1397+
1398+
13921399
## oauth2
13931400

13941401

docs/Model/AddWebhookRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
77
**subscription_url** | **string** | A full, valid, publicly accessible URL which determines where to send the notifications. Please note that you cannot use Pipedrive API endpoints as the `subscription_url` and the chosen URL must not redirect to another link. |
88
**event_action** | **string** | The type of action to receive notifications about. Wildcard will match all supported actions. |
99
**event_object** | **string** | The type of object to receive notifications about. Wildcard will match all supported objects. |
10-
**user_id** | **int** | The ID of the user that this webhook will be authorized with. You have the option to use a different user's `user_id`. If it is not set, the current user's `user_id` will be used. As each webhook event is checked against a users permissions, the webhook will only be sent if the user has access to the specified object(s). If you want to receive notifications for all events, please use a top-level admin user’s `user_id`. | [optional]
10+
**user_id** | **int** | The ID of the user that this webhook will be authorized with. You have the option to use a different user's `user_id`. If it is not set, the current user's `user_id` will be used. As each webhook event is checked against a user's permissions, the webhook will only be sent if the user has access to the specified object(s). If you want to receive notifications for all events, please use a top-level admin user’s `user_id`. | [optional]
1111
**http_auth_user** | **string** | The HTTP basic auth username of the subscription URL endpoint (if required) | [optional]
1212
**http_auth_password** | **string** | The HTTP basic auth password of the subscription URL endpoint (if required) | [optional]
1313
**version** | **string** | The webhook's version | [optional] [default to '1.0']

docs/Model/BasicDeal.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7+
**won_time** | **string** | The optional date and time of changing the deal status as won in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Won. Can not be used together with `lost_time`. | [optional]
8+
**lost_time** | **string** | The optional date and time of changing the deal status as lost in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Lost. Can not be used together with `won_time`. | [optional]
9+
**close_time** | **string** | The optional date and time of closing the deal in UTC. Format: YYYY-MM-DD HH:MM:SS. | [optional]
710
**expected_close_date** | **\DateTime** | The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD. | [optional]
811
**probability** | **float** | The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled. | [optional]
912
**lost_reason** | **string** | The optional message about why the deal was lost (to be used when status = lost) | [optional]

docs/Model/NewDeal.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Name | Type | Description | Notes
1515
**stage_id** | **int** | The ID of the stage this deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. If omitted, the deal will be placed in the first stage of the default pipeline. | [optional]
1616
**status** | **string** | open = Open, won = Won, lost = Lost, deleted = Deleted. If omitted, status will be set to open. | [optional]
1717
**add_time** | **string** | The optional creation date & time of the deal in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS | [optional]
18+
**won_time** | **string** | The optional date and time of changing the deal status as won in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Won. Can not be used together with `lost_time`. | [optional]
19+
**lost_time** | **string** | The optional date and time of changing the deal status as lost in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Lost. Can not be used together with `won_time`. | [optional]
20+
**close_time** | **string** | The optional date and time of closing the deal in UTC. Format: YYYY-MM-DD HH:MM:SS. | [optional]
1821
**expected_close_date** | **\DateTime** | The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD. | [optional]
1922
**probability** | **float** | The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled. | [optional]
2023
**lost_reason** | **string** | The optional message about why the deal was lost (to be used when status = lost) | [optional]

docs/Model/UpdateDealRequest.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Name | Type | Description | Notes
1414
**pipeline_id** | **int** | The ID of the pipeline this deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored. | [optional]
1515
**stage_id** | **int** | The ID of the stage this deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. | [optional]
1616
**status** | **string** | open = Open, won = Won, lost = Lost, deleted = Deleted. | [optional]
17+
**won_time** | **string** | The optional date and time of changing the deal status as won in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Won. Can not be used together with `lost_time`. | [optional]
18+
**lost_time** | **string** | The optional date and time of changing the deal status as lost in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Lost. Can not be used together with `won_time`. | [optional]
19+
**close_time** | **string** | The optional date and time of closing the deal in UTC. Format: YYYY-MM-DD HH:MM:SS. | [optional]
1720
**expected_close_date** | **\DateTime** | The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD. | [optional]
1821
**probability** | **float** | The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled. | [optional]
1922
**lost_reason** | **string** | The optional message about why the deal was lost (to be used when status = lost) | [optional]

lib/Model/AddWebhookRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ public function getUserId()
477477
/**
478478
* Sets user_id
479479
*
480-
* @param int|null $user_id The ID of the user that this webhook will be authorized with. You have the option to use a different user's `user_id`. If it is not set, the current user's `user_id` will be used. As each webhook event is checked against a users permissions, the webhook will only be sent if the user has access to the specified object(s). If you want to receive notifications for all events, please use a top-level admin user’s `user_id`.
480+
* @param int|null $user_id The ID of the user that this webhook will be authorized with. You have the option to use a different user's `user_id`. If it is not set, the current user's `user_id` will be used. As each webhook event is checked against a user's permissions, the webhook will only be sent if the user has access to the specified object(s). If you want to receive notifications for all events, please use a top-level admin user’s `user_id`.
481481
*
482482
* @return self
483483
*/

lib/Model/BasicDeal.php

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ class BasicDeal implements ModelInterface, ArrayAccess, JsonSerializable
6363
* @phpsalm-var array<string, string>
6464
*/
6565
protected static array $openAPITypes = [
66+
'won_time' => 'string',
67+
'lost_time' => 'string',
68+
'close_time' => 'string',
6669
'expected_close_date' => '\DateTime',
6770
'probability' => 'float',
6871
'lost_reason' => 'string',
@@ -77,6 +80,9 @@ class BasicDeal implements ModelInterface, ArrayAccess, JsonSerializable
7780
* @psalm-var array<string, string|null>
7881
*/
7982
protected static $openAPIFormats = [
83+
'won_time' => null,
84+
'lost_time' => null,
85+
'close_time' => null,
8086
'expected_close_date' => 'date',
8187
'probability' => null,
8288
'lost_reason' => null,
@@ -114,6 +120,9 @@ public static function openAPIFormats(): array
114120
* @var string[]
115121
*/
116122
protected static $attributeMap = [
123+
'won_time' => 'won_time',
124+
'lost_time' => 'lost_time',
125+
'close_time' => 'close_time',
117126
'expected_close_date' => 'expected_close_date',
118127
'probability' => 'probability',
119128
'lost_reason' => 'lost_reason',
@@ -126,6 +135,9 @@ public static function openAPIFormats(): array
126135
* @var string[]
127136
*/
128137
protected static $setters = [
138+
'won_time' => 'setWonTime',
139+
'lost_time' => 'setLostTime',
140+
'close_time' => 'setCloseTime',
129141
'expected_close_date' => 'setExpectedCloseDate',
130142
'probability' => 'setProbability',
131143
'lost_reason' => 'setLostReason',
@@ -138,6 +150,9 @@ public static function openAPIFormats(): array
138150
* @var string[]
139151
*/
140152
protected static $getters = [
153+
'won_time' => 'getWonTime',
154+
'lost_time' => 'getLostTime',
155+
'close_time' => 'getCloseTime',
141156
'expected_close_date' => 'getExpectedCloseDate',
142157
'probability' => 'getProbability',
143158
'lost_reason' => 'getLostReason',
@@ -211,6 +226,9 @@ public function getModelName(): string
211226
*/
212227
public function __construct(array $data = null)
213228
{
229+
$this->container['won_time'] = $data['won_time'] ?? null;
230+
$this->container['lost_time'] = $data['lost_time'] ?? null;
231+
$this->container['close_time'] = $data['close_time'] ?? null;
214232
$this->container['expected_close_date'] = $data['expected_close_date'] ?? null;
215233
$this->container['probability'] = $data['probability'] ?? null;
216234
$this->container['lost_reason'] = $data['lost_reason'] ?? null;
@@ -243,6 +261,78 @@ public function valid(): bool
243261
}
244262

245263

264+
/**
265+
* Gets won_time
266+
*
267+
* @return string|null
268+
*/
269+
public function getWonTime()
270+
{
271+
return $this->container['won_time'];
272+
}
273+
274+
/**
275+
* Sets won_time
276+
*
277+
* @param string|null $won_time The optional date and time of changing the deal status as won in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Won. Can not be used together with `lost_time`.
278+
*
279+
* @return self
280+
*/
281+
public function setWonTime($won_time): self
282+
{
283+
$this->container['won_time'] = $won_time;
284+
285+
return $this;
286+
}
287+
288+
/**
289+
* Gets lost_time
290+
*
291+
* @return string|null
292+
*/
293+
public function getLostTime()
294+
{
295+
return $this->container['lost_time'];
296+
}
297+
298+
/**
299+
* Sets lost_time
300+
*
301+
* @param string|null $lost_time The optional date and time of changing the deal status as lost in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Lost. Can not be used together with `won_time`.
302+
*
303+
* @return self
304+
*/
305+
public function setLostTime($lost_time): self
306+
{
307+
$this->container['lost_time'] = $lost_time;
308+
309+
return $this;
310+
}
311+
312+
/**
313+
* Gets close_time
314+
*
315+
* @return string|null
316+
*/
317+
public function getCloseTime()
318+
{
319+
return $this->container['close_time'];
320+
}
321+
322+
/**
323+
* Sets close_time
324+
*
325+
* @param string|null $close_time The optional date and time of closing the deal in UTC. Format: YYYY-MM-DD HH:MM:SS.
326+
*
327+
* @return self
328+
*/
329+
public function setCloseTime($close_time): self
330+
{
331+
$this->container['close_time'] = $close_time;
332+
333+
return $this;
334+
}
335+
246336
/**
247337
* Gets expected_close_date
248338
*

lib/Model/NewDeal.php

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ class NewDeal implements ModelInterface, ArrayAccess, JsonSerializable
7474
'stage_id' => 'int',
7575
'status' => 'string',
7676
'add_time' => 'string',
77+
'won_time' => 'string',
78+
'lost_time' => 'string',
79+
'close_time' => 'string',
7780
'expected_close_date' => '\DateTime',
7881
'probability' => 'float',
7982
'lost_reason' => 'string',
@@ -99,6 +102,9 @@ class NewDeal implements ModelInterface, ArrayAccess, JsonSerializable
99102
'stage_id' => null,
100103
'status' => null,
101104
'add_time' => null,
105+
'won_time' => null,
106+
'lost_time' => null,
107+
'close_time' => null,
102108
'expected_close_date' => 'date',
103109
'probability' => null,
104110
'lost_reason' => null,
@@ -147,6 +153,9 @@ public static function openAPIFormats(): array
147153
'stage_id' => 'stage_id',
148154
'status' => 'status',
149155
'add_time' => 'add_time',
156+
'won_time' => 'won_time',
157+
'lost_time' => 'lost_time',
158+
'close_time' => 'close_time',
150159
'expected_close_date' => 'expected_close_date',
151160
'probability' => 'probability',
152161
'lost_reason' => 'lost_reason',
@@ -170,6 +179,9 @@ public static function openAPIFormats(): array
170179
'stage_id' => 'setStageId',
171180
'status' => 'setStatus',
172181
'add_time' => 'setAddTime',
182+
'won_time' => 'setWonTime',
183+
'lost_time' => 'setLostTime',
184+
'close_time' => 'setCloseTime',
173185
'expected_close_date' => 'setExpectedCloseDate',
174186
'probability' => 'setProbability',
175187
'lost_reason' => 'setLostReason',
@@ -193,6 +205,9 @@ public static function openAPIFormats(): array
193205
'stage_id' => 'getStageId',
194206
'status' => 'getStatus',
195207
'add_time' => 'getAddTime',
208+
'won_time' => 'getWonTime',
209+
'lost_time' => 'getLostTime',
210+
'close_time' => 'getCloseTime',
196211
'expected_close_date' => 'getExpectedCloseDate',
197212
'probability' => 'getProbability',
198213
'lost_reason' => 'getLostReason',
@@ -298,6 +313,9 @@ public function __construct(array $data = null)
298313
$this->container['stage_id'] = $data['stage_id'] ?? null;
299314
$this->container['status'] = $data['status'] ?? null;
300315
$this->container['add_time'] = $data['add_time'] ?? null;
316+
$this->container['won_time'] = $data['won_time'] ?? null;
317+
$this->container['lost_time'] = $data['lost_time'] ?? null;
318+
$this->container['close_time'] = $data['close_time'] ?? null;
301319
$this->container['expected_close_date'] = $data['expected_close_date'] ?? null;
302320
$this->container['probability'] = $data['probability'] ?? null;
303321
$this->container['lost_reason'] = $data['lost_reason'] ?? null;
@@ -616,6 +634,78 @@ public function setAddTime($add_time): self
616634
return $this;
617635
}
618636

637+
/**
638+
* Gets won_time
639+
*
640+
* @return string|null
641+
*/
642+
public function getWonTime()
643+
{
644+
return $this->container['won_time'];
645+
}
646+
647+
/**
648+
* Sets won_time
649+
*
650+
* @param string|null $won_time The optional date and time of changing the deal status as won in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Won. Can not be used together with `lost_time`.
651+
*
652+
* @return self
653+
*/
654+
public function setWonTime($won_time): self
655+
{
656+
$this->container['won_time'] = $won_time;
657+
658+
return $this;
659+
}
660+
661+
/**
662+
* Gets lost_time
663+
*
664+
* @return string|null
665+
*/
666+
public function getLostTime()
667+
{
668+
return $this->container['lost_time'];
669+
}
670+
671+
/**
672+
* Sets lost_time
673+
*
674+
* @param string|null $lost_time The optional date and time of changing the deal status as lost in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Lost. Can not be used together with `won_time`.
675+
*
676+
* @return self
677+
*/
678+
public function setLostTime($lost_time): self
679+
{
680+
$this->container['lost_time'] = $lost_time;
681+
682+
return $this;
683+
}
684+
685+
/**
686+
* Gets close_time
687+
*
688+
* @return string|null
689+
*/
690+
public function getCloseTime()
691+
{
692+
return $this->container['close_time'];
693+
}
694+
695+
/**
696+
* Sets close_time
697+
*
698+
* @param string|null $close_time The optional date and time of closing the deal in UTC. Format: YYYY-MM-DD HH:MM:SS.
699+
*
700+
* @return self
701+
*/
702+
public function setCloseTime($close_time): self
703+
{
704+
$this->container['close_time'] = $close_time;
705+
706+
return $this;
707+
}
708+
619709
/**
620710
* Gets expected_close_date
621711
*

0 commit comments

Comments
 (0)