diff --git a/CHANGELOG.md b/CHANGELOG.md index a0e2581..ae352ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ 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 `project_id` and `pinned_to_project_flag` query parameter to the GET `/notes` endpoint +- Added `project_id` and `pinned_to_project_flag` request bodies to the POST/PUT `/notes` endpoint +- Added `project_id` and `pinned_to_project_flag` to success responses of GET/POST/PUT [9.0.0](https://github.com/pipedrive/client-php/compare/8.1.5...9.0.0) (2025-03-31) diff --git a/docs/versions/v1/Api/ActivitiesApi.md b/docs/versions/v1/Api/ActivitiesApi.md index bb4ab33..e1357fd 100644 --- a/docs/versions/v1/Api/ActivitiesApi.md +++ b/docs/versions/v1/Api/ActivitiesApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description [**deleteActivities()**](ActivitiesApi.md#deleteActivities) | **DELETE** /activities | Delete multiple activities in bulk [**deleteActivity()**](ActivitiesApi.md#deleteActivity) | **DELETE** /activities/{id} | Delete an activity [**getActivities()**](ActivitiesApi.md#getActivities) | **GET** /activities | Get all activities assigned to a particular user -[**getActivitiesCollection()**](ActivitiesApi.md#getActivitiesCollection) | **GET** /activities/collection | Get all activities (BETA) +[**getActivitiesCollection()**](ActivitiesApi.md#getActivitiesCollection) | **GET** /activities/collection | Get all activities collection [**getActivity()**](ActivitiesApi.md#getActivity) | **GET** /activities/{id} | Get details of an activity [**updateActivity()**](ActivitiesApi.md#updateActivity) | **PUT** /activities/{id} | Update an activity @@ -86,7 +86,7 @@ deleteActivities($ids): \Pipedrive\versions\v1\Model\DeleteActivitiesResponse Delete multiple activities in bulk -Marks multiple activities as deleted. After 30 days, the activities will be permanently deleted. +Marks multiple activities as deleted. After 30 days, the activities will be permanently deleted.
This endpoint has been deprecated. Please use DELETE /api/v2/activities/{id} instead. ### Example @@ -293,9 +293,9 @@ Name | Type | Description | Notes getActivitiesCollection($cursor, $limit, $since, $until, $user_id, $done, $type): \Pipedrive\versions\v1\Model\GetActivitiesCollectionResponse ``` -Get all activities (BETA) +Get all activities collection -Returns all activities. This is a cursor-paginated endpoint that is currently in BETA. For more information, please refer to our documentation on pagination. Please note that only global admins (those with global permissions) can access these endpoints. Users with regular permissions will receive a 403 response. Read more about global permissions here. +Returns all activities. Please note that only global admins (those with global permissions) can access this endpoint. Users with regular permissions will receive a 403 response. Read more about global permissions here.
This endpoint has been deprecated. Please use GET /api/v2/activities instead. ### Example diff --git a/docs/versions/v1/Api/DealsApi.md b/docs/versions/v1/Api/DealsApi.md index 005b858..88b8a47 100644 --- a/docs/versions/v1/Api/DealsApi.md +++ b/docs/versions/v1/Api/DealsApi.md @@ -14,6 +14,9 @@ Method | HTTP request | Description [**deleteDealProduct()**](DealsApi.md#deleteDealProduct) | **DELETE** /deals/{id}/products/{product_attachment_id} | Delete an attached product from a deal [**deleteDeals()**](DealsApi.md#deleteDeals) | **DELETE** /deals | Delete multiple deals in bulk [**duplicateDeal()**](DealsApi.md#duplicateDeal) | **POST** /deals/{id}/duplicate | Duplicate deal +[**getArchivedDeals()**](DealsApi.md#getArchivedDeals) | **GET** /deals/archived | Get all archived deals +[**getArchivedDealsSummary()**](DealsApi.md#getArchivedDealsSummary) | **GET** /deals/summary/archived | Get archived deals summary +[**getArchivedDealsTimeline()**](DealsApi.md#getArchivedDealsTimeline) | **GET** /deals/timeline/archived | Get archived deals timeline [**getDeal()**](DealsApi.md#getDeal) | **GET** /deals/{id} | Get details of a deal [**getDealActivities()**](DealsApi.md#getDealActivities) | **GET** /deals/{id}/activities | List activities associated with a deal [**getDealChangelog()**](DealsApi.md#getDealChangelog) | **GET** /deals/{id}/changelog | List updates about deal field values @@ -27,7 +30,7 @@ Method | HTTP request | Description [**getDealUpdates()**](DealsApi.md#getDealUpdates) | **GET** /deals/{id}/flow | List updates about a deal [**getDealUsers()**](DealsApi.md#getDealUsers) | **GET** /deals/{id}/permittedUsers | List permitted users [**getDeals()**](DealsApi.md#getDeals) | **GET** /deals | Get all deals -[**getDealsCollection()**](DealsApi.md#getDealsCollection) | **GET** /deals/collection | Get all deals (BETA) +[**getDealsCollection()**](DealsApi.md#getDealsCollection) | **GET** /deals/collection | Get all deals collection [**getDealsSummary()**](DealsApi.md#getDealsSummary) | **GET** /deals/summary | Get deals summary [**getDealsTimeline()**](DealsApi.md#getDealsTimeline) | **GET** /deals/timeline | Get deals timeline [**mergeDeals()**](DealsApi.md#mergeDeals) | **PUT** /deals/{id}/merge | Merge two deals @@ -576,7 +579,7 @@ deleteDeals($ids): \Pipedrive\versions\v1\Model\DeleteMultipleDeals Delete multiple deals in bulk -Marks multiple deals as deleted. After 30 days, the deals will be permanently deleted. +Marks multiple deals as deleted. After 30 days, the deals will be permanently deleted.
This endpoint has been deprecated. Please use DELETE /api/v2/deals/{id} instead. ### Example @@ -698,6 +701,247 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## `getArchivedDeals()` + +```php +getArchivedDeals($user_id, $filter_id, $person_id, $org_id, $product_id, $pipeline_id, $stage_id, $status, $start, $limit, $sort, $owned_by_you): \Pipedrive\versions\v1\Model\GetDeals +``` + +Get all archived deals + +Returns all archived deals. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\versions\v1\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\versions\v1\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\versions\v1\Api\DealsApi( + // 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 +); +$user_id = 56; // int | If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. +$filter_id = 56; // int | The ID of the filter to use +$person_id = 56; // int | If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. +$org_id = 56; // int | If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. +$product_id = 56; // int | If supplied, only deals linked to the specified product are returned. If filter_id is provided, this is ignored. +$pipeline_id = 56; // int | If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. +$stage_id = 56; // int | If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. +$status = 'all_not_deleted'; // string | Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). +$owned_by_you = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. + +try { + $result = $apiInstance->getArchivedDeals($user_id, $filter_id, $person_id, $org_id, $product_id, $pipeline_id, $stage_id, $status, $start, $limit, $sort, $owned_by_you); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getArchivedDeals: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. | [optional] + **filter_id** | **int**| The ID of the filter to use | [optional] + **person_id** | **int**| If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. | [optional] + **org_id** | **int**| If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. | [optional] + **product_id** | **int**| If supplied, only deals linked to the specified product are returned. If filter_id is provided, this is ignored. | [optional] + **pipeline_id** | **int**| If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. | [optional] + **stage_id** | **int**| If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. | [optional] + **status** | **string**| Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. | [optional] [default to 'all_not_deleted'] + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). | [optional] + **owned_by_you** | [**\Pipedrive\versions\v1\Model\NumberBoolean**](../Model/.md)| When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. | [optional] + +### Return type + +[**\Pipedrive\versions\v1\Model\GetDeals**](../Model/GetDeals.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) + +## `getArchivedDealsSummary()` + +```php +getArchivedDealsSummary($status, $filter_id, $user_id, $pipeline_id, $stage_id): \Pipedrive\versions\v1\Model\GetDealsSummary +``` + +Get archived deals summary + +Returns a summary of all archived deals. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\versions\v1\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\versions\v1\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\versions\v1\Api\DealsApi( + // 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 +); +$status = 'status_example'; // string | Only fetch deals with a specific status. open = Open, won = Won, lost = Lost. +$filter_id = 56; // int | user_id will not be considered. Only deals matching the given filter will be returned. +$user_id = 56; // int | Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. +$pipeline_id = 56; // int | Only deals within the given pipeline will be returned +$stage_id = 56; // int | Only deals within the given stage will be returned + +try { + $result = $apiInstance->getArchivedDealsSummary($status, $filter_id, $user_id, $pipeline_id, $stage_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getArchivedDealsSummary: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **string**| Only fetch deals with a specific status. open = Open, won = Won, lost = Lost. | [optional] + **filter_id** | **int**| <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. | [optional] + **user_id** | **int**| Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. | [optional] + **pipeline_id** | **int**| Only deals within the given pipeline will be returned | [optional] + **stage_id** | **int**| Only deals within the given stage will be returned | [optional] + +### Return type + +[**\Pipedrive\versions\v1\Model\GetDealsSummary**](../Model/GetDealsSummary.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) + +## `getArchivedDealsTimeline()` + +```php +getArchivedDealsTimeline($start_date, $interval, $amount, $field_key, $user_id, $pipeline_id, $filter_id, $exclude_deals, $totals_convert_currency): \Pipedrive\versions\v1\Model\GetDealsTimeline +``` + +Get archived deals timeline + +Returns archived open and won deals, grouped by a defined interval of time set in a date-type dealField (`field_key`) — e.g. when month is the chosen interval, and 3 months are asked starting from January 1st, 2012, deals are returned grouped into 3 groups — January, February and March — based on the value of the given `field_key`. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\versions\v1\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\versions\v1\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\versions\v1\Api\DealsApi( + // 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 +); +$start_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The date when the first interval starts. Format: YYYY-MM-DD. +$interval = 'interval_example'; // string | The type of the interval
ValueDescription
`day`Day
`week`A full week (7 days) starting from `start_date`
`month`A full month (depending on the number of days in given month) starting from `start_date`
`quarter`A full quarter (3 months) starting from `start_date`
+$amount = 56; // int | The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). +$field_key = 'field_key_example'; // string | The date field key which deals will be retrieved from +$user_id = 56; // int | If supplied, only deals matching the given user will be returned +$pipeline_id = 56; // int | If supplied, only deals matching the given pipeline will be returned +$filter_id = 56; // int | If supplied, only deals matching the given filter will be returned +$exclude_deals = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. +$totals_convert_currency = 'totals_convert_currency_example'; // string | The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used. + +try { + $result = $apiInstance->getArchivedDealsTimeline($start_date, $interval, $amount, $field_key, $user_id, $pipeline_id, $filter_id, $exclude_deals, $totals_convert_currency); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getArchivedDealsTimeline: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start_date** | **\DateTime**| The date when the first interval starts. Format: YYYY-MM-DD. | + **interval** | **string**| The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table> | + **amount** | **int**| The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). | + **field_key** | **string**| The date field key which deals will be retrieved from | + **user_id** | **int**| If supplied, only deals matching the given user will be returned | [optional] + **pipeline_id** | **int**| If supplied, only deals matching the given pipeline will be returned | [optional] + **filter_id** | **int**| If supplied, only deals matching the given filter will be returned | [optional] + **exclude_deals** | [**\Pipedrive\versions\v1\Model\NumberBoolean**](../Model/.md)| Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. | [optional] + **totals_convert_currency** | **string**| The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used. | [optional] + +### Return type + +[**\Pipedrive\versions\v1\Model\GetDealsTimeline**](../Model/GetDealsTimeline.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) + ## `getDeal()` ```php @@ -771,7 +1015,7 @@ getDealActivities($id, $start, $limit, $done, $exclude): \Pipedrive\versions\v1\ List activities associated with a deal -Lists activities associated with a deal. +Lists activities associated with a deal.
This endpoint has been deprecated. Please use GET /api/v2/activities?deal_id={id} instead. ### Example @@ -1256,7 +1500,7 @@ getDealPersons($id, $start, $limit): \Pipedrive\versions\v1\Model\ListPersonsRes List all persons associated with a deal -Lists all persons associated with a deal, regardless of whether the person is the primary contact of the deal, or added as a participant.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. +Lists all persons associated with a deal, regardless of whether the person is the primary contact of the deal, or added as a participant.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field.
This endpoint has been deprecated. Please use GET /api/v2/persons?deal_id={id} instead. ### Example @@ -1534,7 +1778,7 @@ getDeals($user_id, $filter_id, $stage_id, $status, $start, $limit, $sort, $owned Get all deals -Returns all deals. For more information, see the tutorial for getting all deals. +Returns all not archived deals. For more information, see the tutorial for getting all deals. ### Example @@ -1611,9 +1855,9 @@ Name | Type | Description | Notes getDealsCollection($cursor, $limit, $since, $until, $user_id, $stage_id, $status): \Pipedrive\versions\v1\Model\GetDealsCollection ``` -Get all deals (BETA) +Get all deals collection -Returns all deals. This is a cursor-paginated endpoint that is currently in BETA. For more information, please refer to our documentation on pagination. Please note that only global admins (those with global permissions) can access these endpoints. Users with regular permissions will receive a 403 response. Read more about global permissions here. +Returns all deals. Please note that only global admins (those with global permissions) can access this endpoint. Users with regular permissions will receive a 403 response. Read more about global permissions here.
This endpoint has been deprecated. Please use GET /api/v2/deals instead. ### Example @@ -1690,7 +1934,7 @@ getDealsSummary($status, $filter_id, $user_id, $pipeline_id, $stage_id): \Pipedr Get deals summary -Returns a summary of all the deals. +Returns a summary of all not archived deals. ### Example @@ -1763,7 +2007,7 @@ getDealsTimeline($start_date, $interval, $amount, $field_key, $user_id, $pipelin Get deals timeline -Returns open and won deals, grouped by a defined interval of time set in a date-type dealField (`field_key`) — e.g. when month is the chosen interval, and 3 months are asked starting from January 1st, 2012, deals are returned grouped into 3 groups — January, February and March — based on the value of the given `field_key`. +Returns not archived open and won deals, grouped by a defined interval of time set in a date-type dealField (`field_key`) — e.g. when month is the chosen interval, and 3 months are asked starting from January 1st, 2012, deals are returned grouped into 3 groups — January, February and March — based on the value of the given `field_key`. ### Example diff --git a/docs/versions/v1/Api/LeadsApi.md b/docs/versions/v1/Api/LeadsApi.md index bab8819..39d6181 100644 --- a/docs/versions/v1/Api/LeadsApi.md +++ b/docs/versions/v1/Api/LeadsApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**addLead()**](LeadsApi.md#addLead) | **POST** /leads | Add a lead [**deleteLead()**](LeadsApi.md#deleteLead) | **DELETE** /leads/{id} | Delete a lead +[**getArchivedLeads()**](LeadsApi.md#getArchivedLeads) | **GET** /leads/archived | Get all archived leads [**getLead()**](LeadsApi.md#getLead) | **GET** /leads/{id} | Get one lead [**getLeadUsers()**](LeadsApi.md#getLeadUsers) | **GET** /leads/{id}/permittedUsers | List permitted users [**getLeads()**](LeadsApi.md#getLeads) | **GET** /leads | Get all leads @@ -143,6 +144,83 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## `getArchivedLeads()` + +```php +getArchivedLeads($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort): \Pipedrive\versions\v1\Model\GetLeadsResponse +``` + +Get all archived leads + +Returns multiple archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field's value hasn't been set for the lead, it won't appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields' structure from deals. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\versions\v1\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\versions\v1\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\versions\v1\Api\LeadsApi( + // 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 +); +$limit = 100; // int | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. +$start = 0; // int | For pagination, the position that represents the first result for the page +$owner_id = 1; // int | If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. +$person_id = 1; // int | If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. +$organization_id = 1; // int | If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. +$filter_id = 1; // int | The ID of the filter to use +$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). + +try { + $result = $apiInstance->getArchivedLeads($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeadsApi->getArchivedLeads: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. | [optional] + **start** | **int**| For pagination, the position that represents the first result for the page | [optional] + **owner_id** | **int**| If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. | [optional] + **person_id** | **int**| If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. | [optional] + **organization_id** | **int**| If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. | [optional] + **filter_id** | **int**| The ID of the filter to use | [optional] + **sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). | [optional] + +### Return type + +[**\Pipedrive\versions\v1\Model\GetLeadsResponse**](../Model/GetLeadsResponse.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) + ## `getLead()` ```php @@ -276,12 +354,12 @@ Name | Type | Description | Notes ## `getLeads()` ```php -getLeads($limit, $start, $archived_status, $owner_id, $person_id, $organization_id, $filter_id, $sort): \Pipedrive\versions\v1\Model\GetLeadsResponse +getLeads($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort): \Pipedrive\versions\v1\Model\GetLeadsResponse ``` Get all leads -Returns multiple leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field's value hasn't been set for the lead, it won't appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields' structure from deals. +Returns multiple not archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field's value hasn't been set for the lead, it won't appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields' structure from deals. ### Example @@ -307,7 +385,6 @@ $apiInstance = new Pipedrive\versions\v1\Api\LeadsApi( ); $limit = 100; // int | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. $start = 0; // int | For pagination, the position that represents the first result for the page -$archived_status = 'archived_status_example'; // string | Filtering based on the archived status of a lead. If not provided, `All` is used. $owner_id = 1; // int | If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. $person_id = 1; // int | If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. $organization_id = 1; // int | If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. @@ -315,7 +392,7 @@ $filter_id = 1; // int | The ID of the filter to use $sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). try { - $result = $apiInstance->getLeads($limit, $start, $archived_status, $owner_id, $person_id, $organization_id, $filter_id, $sort); + $result = $apiInstance->getLeads($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort); print_r($result); } catch (Exception $e) { echo 'Exception when calling LeadsApi->getLeads: ', $e->getMessage(), PHP_EOL; @@ -328,7 +405,6 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **limit** | **int**| For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. | [optional] **start** | **int**| For pagination, the position that represents the first result for the page | [optional] - **archived_status** | **string**| Filtering based on the archived status of a lead. If not provided, `All` is used. | [optional] **owner_id** | **int**| If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. | [optional] **person_id** | **int**| If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. | [optional] **organization_id** | **int**| If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. | [optional] diff --git a/docs/versions/v1/Api/NotesApi.md b/docs/versions/v1/Api/NotesApi.md index 3c43ae4..4ebd3f9 100644 --- a/docs/versions/v1/Api/NotesApi.md +++ b/docs/versions/v1/Api/NotesApi.md @@ -484,7 +484,7 @@ Name | Type | Description | Notes ## `getNotes()` ```php -getNotes($user_id, $lead_id, $deal_id, $person_id, $org_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag): \Pipedrive\versions\v1\Model\GetNotes +getNotes($user_id, $lead_id, $deal_id, $person_id, $org_id, $project_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag, $pinned_to_project_flag): \Pipedrive\versions\v1\Model\GetNotes ``` Get all notes @@ -518,6 +518,7 @@ $lead_id = 'lead_id_example'; // string | The ID of the lead which notes to fetc $deal_id = 56; // int | The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. $person_id = 56; // int | The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. $org_id = 56; // int | The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. +$project_id = 56; // int | The ID of the project which notes to fetch. If omitted, notes about all projects will be returned. $start = 0; // int | Pagination start $limit = 56; // int | Items shown per page $sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. @@ -527,9 +528,10 @@ $pinned_to_lead_flag = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\M $pinned_to_deal_flag = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | If set, the results are filtered by note to deal pinning state $pinned_to_organization_flag = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | If set, the results are filtered by note to organization pinning state $pinned_to_person_flag = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | If set, the results are filtered by note to person pinning state +$pinned_to_project_flag = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | If set, the results are filtered by note to project pinning state try { - $result = $apiInstance->getNotes($user_id, $lead_id, $deal_id, $person_id, $org_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag); + $result = $apiInstance->getNotes($user_id, $lead_id, $deal_id, $person_id, $org_id, $project_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag, $pinned_to_project_flag); print_r($result); } catch (Exception $e) { echo 'Exception when calling NotesApi->getNotes: ', $e->getMessage(), PHP_EOL; @@ -545,6 +547,7 @@ Name | Type | Description | Notes **deal_id** | **int**| The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. | [optional] **person_id** | **int**| The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. | [optional] **org_id** | **int**| The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. | [optional] + **project_id** | **int**| The ID of the project which notes to fetch. If omitted, notes about all projects will be returned. | [optional] **start** | **int**| Pagination start | [optional] [default to 0] **limit** | **int**| Items shown per page | [optional] **sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. | [optional] @@ -554,6 +557,7 @@ Name | Type | Description | Notes **pinned_to_deal_flag** | [**\Pipedrive\versions\v1\Model\NumberBoolean**](../Model/.md)| If set, the results are filtered by note to deal pinning state | [optional] **pinned_to_organization_flag** | [**\Pipedrive\versions\v1\Model\NumberBoolean**](../Model/.md)| If set, the results are filtered by note to organization pinning state | [optional] **pinned_to_person_flag** | [**\Pipedrive\versions\v1\Model\NumberBoolean**](../Model/.md)| If set, the results are filtered by note to person pinning state | [optional] + **pinned_to_project_flag** | [**\Pipedrive\versions\v1\Model\NumberBoolean**](../Model/.md)| If set, the results are filtered by note to project pinning state | [optional] ### Return type diff --git a/docs/versions/v1/Api/OrganizationsApi.md b/docs/versions/v1/Api/OrganizationsApi.md index 97b1683..faf967c 100644 --- a/docs/versions/v1/Api/OrganizationsApi.md +++ b/docs/versions/v1/Api/OrganizationsApi.md @@ -20,7 +20,7 @@ Method | HTTP request | Description [**getOrganizationUpdates()**](OrganizationsApi.md#getOrganizationUpdates) | **GET** /organizations/{id}/flow | List updates about an organization [**getOrganizationUsers()**](OrganizationsApi.md#getOrganizationUsers) | **GET** /organizations/{id}/permittedUsers | List permitted users [**getOrganizations()**](OrganizationsApi.md#getOrganizations) | **GET** /organizations | Get all organizations -[**getOrganizationsCollection()**](OrganizationsApi.md#getOrganizationsCollection) | **GET** /organizations/collection | Get all organizations (BETA) +[**getOrganizationsCollection()**](OrganizationsApi.md#getOrganizationsCollection) | **GET** /organizations/collection | Get all organizations collection [**mergeOrganizations()**](OrganizationsApi.md#mergeOrganizations) | **PUT** /organizations/{id}/merge | Merge two organizations [**searchOrganization()**](OrganizationsApi.md#searchOrganization) | **GET** /organizations/search | Search organizations [**updateOrganization()**](OrganizationsApi.md#updateOrganization) | **PUT** /organizations/{id} | Update an organization @@ -298,7 +298,7 @@ deleteOrganizations($ids): \Pipedrive\versions\v1\Model\OrganizationsDeleteRespo Delete multiple organizations in bulk -Marks multiple organizations as deleted. After 30 days, the organizations will be permanently deleted. +Marks multiple organizations as deleted. After 30 days, the organizations will be permanently deleted.
This endpoint has been deprecated. Please use DELETE /api/v2/organizations/{id} instead. ### Example @@ -428,7 +428,7 @@ getOrganizationActivities($id, $start, $limit, $done, $exclude): \Pipedrive\vers List activities associated with an organization -Lists activities associated with an organization. +Lists activities associated with an organization.
This endpoint has been deprecated. Please use GET /api/v2/activities?org_id={id} instead. ### Example @@ -570,7 +570,7 @@ getOrganizationDeals($id, $start, $limit, $status, $sort, $only_primary_associat List deals associated with an organization -Lists deals associated with an organization. +Lists deals associated with an organization.
This endpoint has been deprecated. Please use GET /api/v2/deals?org_id={id} instead. ### Example @@ -850,7 +850,7 @@ getOrganizationPersons($id, $start, $limit): \Pipedrive\versions\v1\Model\ListPe List persons of an organization -Lists persons associated with an organization.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. +Lists persons associated with an organization.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field.
This endpoint has been deprecated. Please use GET /api/v2/persons?org_id={id} instead. ### Example @@ -1130,9 +1130,9 @@ Name | Type | Description | Notes getOrganizationsCollection($cursor, $limit, $since, $until, $owner_id, $first_char): \Pipedrive\versions\v1\Model\InlineResponse200 ``` -Get all organizations (BETA) +Get all organizations collection -Returns all organizations. This is a cursor-paginated endpoint that is currently in BETA. For more information, please refer to our documentation on pagination. Please note that only global admins (those with global permissions) can access these endpoints. Users with regular permissions will receive a 403 response. Read more about global permissions here. +Returns all organizations. Please note that only global admins (those with global permissions) can access this endpoint. Users with regular permissions will receive a 403 response. Read more about global permissions here.
This endpoint has been deprecated. Please use GET /api/v2/organizations instead. ### Example diff --git a/docs/versions/v1/Api/PersonsApi.md b/docs/versions/v1/Api/PersonsApi.md index 8b9a0f8..7a4d1da 100644 --- a/docs/versions/v1/Api/PersonsApi.md +++ b/docs/versions/v1/Api/PersonsApi.md @@ -22,7 +22,7 @@ Method | HTTP request | Description [**getPersonUpdates()**](PersonsApi.md#getPersonUpdates) | **GET** /persons/{id}/flow | List updates about a person [**getPersonUsers()**](PersonsApi.md#getPersonUsers) | **GET** /persons/{id}/permittedUsers | List permitted users [**getPersons()**](PersonsApi.md#getPersons) | **GET** /persons | Get all persons -[**getPersonsCollection()**](PersonsApi.md#getPersonsCollection) | **GET** /persons/collection | Get all persons (BETA) +[**getPersonsCollection()**](PersonsApi.md#getPersonsCollection) | **GET** /persons/collection | Get all persons collection [**mergePersons()**](PersonsApi.md#mergePersons) | **PUT** /persons/{id}/merge | Merge two persons [**searchPersons()**](PersonsApi.md#searchPersons) | **GET** /persons/search | Search persons [**updatePerson()**](PersonsApi.md#updatePerson) | **PUT** /persons/{id} | Update a person @@ -440,7 +440,7 @@ deletePersons($ids): \Pipedrive\versions\v1\Model\DeletePersonsInBulkResponse Delete multiple persons in bulk -Marks multiple persons as deleted. After 30 days, the persons will be permanently deleted. +Marks multiple persons as deleted. After 30 days, the persons will be permanently deleted.
This endpoint has been deprecated. Please use DELETE /api/v2/persons/{id} instead. ### Example @@ -570,7 +570,7 @@ getPersonActivities($id, $start, $limit, $done, $exclude): \Pipedrive\versions\v List activities associated with a person -Lists activities associated with a person. +Lists activities associated with a person.
This endpoint has been deprecated. Please use GET /api/v2/activities?person_id={id} instead. ### Example @@ -712,7 +712,7 @@ getPersonDeals($id, $start, $limit, $status, $sort): \Pipedrive\versions\v1\Mode List deals associated with a person -Lists deals associated with a person. +Lists deals associated with a person.
This endpoint has been deprecated. Please use GET /api/v2/deals?person_id={id} instead. ### Example @@ -1270,9 +1270,9 @@ Name | Type | Description | Notes getPersonsCollection($cursor, $limit, $since, $until, $owner_id, $first_char): \Pipedrive\versions\v1\Model\InlineResponse2001 ``` -Get all persons (BETA) +Get all persons collection -Returns all persons. This is a cursor-paginated endpoint that is currently in BETA. For more information, please refer to our documentation on pagination. Please note that only global admins (those with global permissions) can access these endpoints. Users with regular permissions will receive a 403 response. Read more about global permissions here. +Returns all persons. Please note that only global admins (those with global permissions) can access this endpoint. Users with regular permissions will receive a 403 response. Read more about global permissions here.
This endpoint has been deprecated. Please use GET /api/v2/persons instead. ### Example diff --git a/docs/versions/v1/Api/PipelinesApi.md b/docs/versions/v1/Api/PipelinesApi.md index 901ac2d..c0f5e72 100644 --- a/docs/versions/v1/Api/PipelinesApi.md +++ b/docs/versions/v1/Api/PipelinesApi.md @@ -290,7 +290,7 @@ getPipelineDeals($id, $filter_id, $user_id, $everyone, $stage_id, $start, $limit Get deals in a pipeline -Lists deals in a specific pipeline across all its stages. If no parameters are provided open deals owned by the authorized user will be returned. +Lists deals in a specific pipeline across all its stages. If no parameters are provided open deals owned by the authorized user will be returned.
This endpoint has been deprecated. Please use GET /api/v2/deals?pipeline_id={id} instead. ### Example diff --git a/docs/versions/v1/Api/StagesApi.md b/docs/versions/v1/Api/StagesApi.md index c696a11..88b0807 100644 --- a/docs/versions/v1/Api/StagesApi.md +++ b/docs/versions/v1/Api/StagesApi.md @@ -151,7 +151,7 @@ deleteStages($ids): \Pipedrive\versions\v1\Model\DeleteStagesResponse Delete multiple stages in bulk -Marks multiple stages as deleted. +Marks multiple stages as deleted.
This endpoint has been deprecated. Please use DELETE /api/v2/stages/{id} instead. ### Example @@ -283,7 +283,7 @@ getStageDeals($id, $filter_id, $user_id, $everyone, $start, $limit): \Pipedrive\ Get deals in a stage -Lists deals in a specific stage. If no parameters are provided open deals owned by the authorized user will be returned. +Lists deals in a specific stage. If no parameters are provided open deals owned by the authorized user will be returned.
This endpoint has been deprecated. Please use GET /api/v2/deals?stage_id={id} instead. ### Example diff --git a/docs/versions/v1/Model/AddNoteRequest.md b/docs/versions/v1/Model/AddNoteRequest.md index 64d7c69..cb0efa1 100644 --- a/docs/versions/v1/Model/AddNoteRequest.md +++ b/docs/versions/v1/Model/AddNoteRequest.md @@ -5,15 +5,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **content** | **string** | The content of the note in HTML format. Subject to sanitization on the back-end. | -**lead_id** | **string** | The ID of the lead the note will be attached to. This property is required unless one of (`deal_id/person_id/org_id`) is specified. | [optional] -**deal_id** | **int** | The ID of the deal the note will be attached to. This property is required unless one of (`lead_id/person_id/org_id`) is specified. | [optional] -**person_id** | **int** | The ID of the person this note will be attached to. This property is required unless one of (`deal_id/lead_id/org_id`) is specified. | [optional] -**org_id** | **int** | The ID of the organization this note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id`) is specified. | [optional] +**lead_id** | **string** | The ID of the lead the note will be attached to. This property is required unless one of (`deal_id/person_id/org_id/project_id`) is specified. | [optional] +**deal_id** | **int** | The ID of the deal the note will be attached to. This property is required unless one of (`lead_id/person_id/org_id/project_id`) is specified. | [optional] +**person_id** | **int** | The ID of the person this note will be attached to. This property is required unless one of (`deal_id/lead_id/org_id/project_id`) is specified. | [optional] +**org_id** | **int** | The ID of the organization this note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id/project_id`) is specified. | [optional] +**project_id** | **int** | The ID of the project the note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id/org_id`) is specified. | [optional] **user_id** | **int** | The ID of the user who will be marked as the author of the note. Only an admin can change the author. | [optional] **add_time** | **string** | The optional creation date & time of the note in UTC. Can be set in the past or in the future. Format: YYYY-MM-DD HH:MM:SS | [optional] **pinned_to_lead_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to lead pinning state (`lead_id` is also required) | [optional] **pinned_to_deal_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to deal pinning state (`deal_id` is also required) | [optional] **pinned_to_organization_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to organization pinning state (`org_id` is also required) | [optional] **pinned_to_person_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to person pinning state (`person_id` is also required) | [optional] +**pinned_to_project_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to project pinning state (`project_id` is also required) | [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) diff --git a/docs/versions/v1/Model/AddNoteRequestAllOf.md b/docs/versions/v1/Model/AddNoteRequestAllOf.md index c7944be..dfcf1e9 100644 --- a/docs/versions/v1/Model/AddNoteRequestAllOf.md +++ b/docs/versions/v1/Model/AddNoteRequestAllOf.md @@ -5,9 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **content** | **string** | The content of the note in HTML format. Subject to sanitization on the back-end. | -**lead_id** | **string** | The ID of the lead the note will be attached to. This property is required unless one of (`deal_id/person_id/org_id`) is specified. | [optional] -**deal_id** | **int** | The ID of the deal the note will be attached to. This property is required unless one of (`lead_id/person_id/org_id`) is specified. | [optional] -**person_id** | **int** | The ID of the person this note will be attached to. This property is required unless one of (`deal_id/lead_id/org_id`) is specified. | [optional] -**org_id** | **int** | The ID of the organization this note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id`) is specified. | [optional] +**lead_id** | **string** | The ID of the lead the note will be attached to. This property is required unless one of (`deal_id/person_id/org_id/project_id`) is specified. | [optional] +**deal_id** | **int** | The ID of the deal the note will be attached to. This property is required unless one of (`lead_id/person_id/org_id/project_id`) is specified. | [optional] +**person_id** | **int** | The ID of the person this note will be attached to. This property is required unless one of (`deal_id/lead_id/org_id/project_id`) is specified. | [optional] +**org_id** | **int** | The ID of the organization this note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id/project_id`) is specified. | [optional] +**project_id** | **int** | The ID of the project the note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id/org_id`) is specified. | [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) diff --git a/docs/versions/v1/Model/BaseNote.md b/docs/versions/v1/Model/BaseNote.md index 2953882..830af4d 100644 --- a/docs/versions/v1/Model/BaseNote.md +++ b/docs/versions/v1/Model/BaseNote.md @@ -16,9 +16,12 @@ Name | Type | Description | Notes **organization** | [**\Pipedrive\versions\v1\Model\BaseNoteOrganization**](BaseNoteOrganization.md) | | [optional] **person** | [**\Pipedrive\versions\v1\Model\BaseNotePerson**](BaseNotePerson.md) | | [optional] **person_id** | **int** | The ID of the person the note is attached to | [optional] +**project_id** | **int** | The ID of the project the note is attached to | [optional] +**project** | [**\Pipedrive\versions\v1\Model\BaseNoteProject**](BaseNoteProject.md) | | [optional] **pinned_to_deal_flag** | **bool** | If true, the results are filtered by note to deal pinning state | [optional] **pinned_to_organization_flag** | **bool** | If true, the results are filtered by note to organization pinning state | [optional] **pinned_to_person_flag** | **bool** | If true, the results are filtered by note to person pinning state | [optional] +**pinned_to_project_flag** | **bool** | If true, the results are filtered by note to project pinning state | [optional] **update_time** | **string** | The last updated date and time of the note | [optional] **user** | [**\Pipedrive\versions\v1\Model\NoteCreatorUser**](NoteCreatorUser.md) | | [optional] **user_id** | **int** | The ID of the note creator | [optional] diff --git a/docs/versions/v1/Model/BaseNoteProject.md b/docs/versions/v1/Model/BaseNoteProject.md new file mode 100644 index 0000000..4ab3f6f --- /dev/null +++ b/docs/versions/v1/Model/BaseNoteProject.md @@ -0,0 +1,9 @@ +# # BaseNoteProject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | The title of the project the note is attached to | [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) diff --git a/docs/versions/v1/Model/DealSearchItemItem.md b/docs/versions/v1/Model/DealSearchItemItem.md index 846adea..31189e7 100644 --- a/docs/versions/v1/Model/DealSearchItemItem.md +++ b/docs/versions/v1/Model/DealSearchItemItem.md @@ -17,5 +17,6 @@ Name | Type | Description | Notes **organization** | [**\Pipedrive\versions\v1\Model\DealSearchItemItemOrganization**](DealSearchItemItemOrganization.md) | | [optional] **custom_fields** | **string[]** | Custom fields | [optional] **notes** | **string[]** | An array of notes | [optional] +**is_archived** | **bool** | A flag indicating whether the deal is archived or not | [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) diff --git a/docs/versions/v1/Model/Note.md b/docs/versions/v1/Model/Note.md index 714ad76..2db2dcd 100644 --- a/docs/versions/v1/Model/Note.md +++ b/docs/versions/v1/Model/Note.md @@ -9,11 +9,13 @@ Name | Type | Description | Notes **deal_id** | **int** | The ID of the deal the note will be attached to | [optional] **person_id** | **int** | The ID of the person the note will be attached to | [optional] **org_id** | **int** | The ID of the organization the note will be attached to | [optional] +**project_id** | **int** | The ID of the project the note will be attached to | [optional] **user_id** | **int** | The ID of the user who will be marked as the author of the note. Only an admin can change the author. | [optional] **add_time** | **string** | The optional creation date & time of the note in UTC. Can be set in the past or in the future. Format: YYYY-MM-DD HH:MM:SS | [optional] **pinned_to_lead_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to lead pinning state (`lead_id` is also required) | [optional] **pinned_to_deal_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to deal pinning state (`deal_id` is also required) | [optional] **pinned_to_organization_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to organization pinning state (`org_id` is also required) | [optional] **pinned_to_person_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to person pinning state (`person_id` is also required) | [optional] +**pinned_to_project_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to project pinning state (`project_id` is also required) | [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) diff --git a/docs/versions/v1/Model/NoteConnectToParams.md b/docs/versions/v1/Model/NoteConnectToParams.md index fc07561..44ae5e5 100644 --- a/docs/versions/v1/Model/NoteConnectToParams.md +++ b/docs/versions/v1/Model/NoteConnectToParams.md @@ -8,5 +8,6 @@ Name | Type | Description | Notes **deal_id** | **int** | The ID of the deal the note will be attached to | [optional] **person_id** | **int** | The ID of the person the note will be attached to | [optional] **org_id** | **int** | The ID of the organization the note will be attached to | [optional] +**project_id** | **int** | The ID of the project the note will be attached to | [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) diff --git a/docs/versions/v1/Model/NoteParams.md b/docs/versions/v1/Model/NoteParams.md index cd352a0..30a5862 100644 --- a/docs/versions/v1/Model/NoteParams.md +++ b/docs/versions/v1/Model/NoteParams.md @@ -10,5 +10,6 @@ Name | Type | Description | Notes **pinned_to_deal_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to deal pinning state (`deal_id` is also required) | [optional] **pinned_to_organization_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to organization pinning state (`org_id` is also required) | [optional] **pinned_to_person_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to person pinning state (`person_id` is also required) | [optional] +**pinned_to_project_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to project pinning state (`project_id` is also required) | [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) diff --git a/docs/versions/v1/README.md b/docs/versions/v1/README.md index b1e94c8..7ca2fa7 100644 --- a/docs/versions/v1/README.md +++ b/docs/versions/v1/README.md @@ -269,7 +269,7 @@ Class | Method | HTTP request | Description *ActivitiesApi* | [**deleteActivities**](Api/ActivitiesApi.md#deleteactivities) | **DELETE** /activities | Delete multiple activities in bulk *ActivitiesApi* | [**deleteActivity**](Api/ActivitiesApi.md#deleteactivity) | **DELETE** /activities/{id} | Delete an activity *ActivitiesApi* | [**getActivities**](Api/ActivitiesApi.md#getactivities) | **GET** /activities | Get all activities assigned to a particular user -*ActivitiesApi* | [**getActivitiesCollection**](Api/ActivitiesApi.md#getactivitiescollection) | **GET** /activities/collection | Get all activities (BETA) +*ActivitiesApi* | [**getActivitiesCollection**](Api/ActivitiesApi.md#getactivitiescollection) | **GET** /activities/collection | Get all activities collection *ActivitiesApi* | [**getActivity**](Api/ActivitiesApi.md#getactivity) | **GET** /activities/{id} | Get details of an activity *ActivitiesApi* | [**updateActivity**](Api/ActivitiesApi.md#updateactivity) | **PUT** /activities/{id} | Update an activity *ActivityFieldsApi* | [**getActivityFields**](Api/ActivityFieldsApi.md#getactivityfields) | **GET** /activityFields | Get all activity fields @@ -305,6 +305,9 @@ Class | Method | HTTP request | Description *DealsApi* | [**deleteDealProduct**](Api/DealsApi.md#deletedealproduct) | **DELETE** /deals/{id}/products/{product_attachment_id} | Delete an attached product from a deal *DealsApi* | [**deleteDeals**](Api/DealsApi.md#deletedeals) | **DELETE** /deals | Delete multiple deals in bulk *DealsApi* | [**duplicateDeal**](Api/DealsApi.md#duplicatedeal) | **POST** /deals/{id}/duplicate | Duplicate deal +*DealsApi* | [**getArchivedDeals**](Api/DealsApi.md#getarchiveddeals) | **GET** /deals/archived | Get all archived deals +*DealsApi* | [**getArchivedDealsSummary**](Api/DealsApi.md#getarchiveddealssummary) | **GET** /deals/summary/archived | Get archived deals summary +*DealsApi* | [**getArchivedDealsTimeline**](Api/DealsApi.md#getarchiveddealstimeline) | **GET** /deals/timeline/archived | Get archived deals timeline *DealsApi* | [**getDeal**](Api/DealsApi.md#getdeal) | **GET** /deals/{id} | Get details of a deal *DealsApi* | [**getDealActivities**](Api/DealsApi.md#getdealactivities) | **GET** /deals/{id}/activities | List activities associated with a deal *DealsApi* | [**getDealChangelog**](Api/DealsApi.md#getdealchangelog) | **GET** /deals/{id}/changelog | List updates about deal field values @@ -318,7 +321,7 @@ Class | Method | HTTP request | Description *DealsApi* | [**getDealUpdates**](Api/DealsApi.md#getdealupdates) | **GET** /deals/{id}/flow | List updates about a deal *DealsApi* | [**getDealUsers**](Api/DealsApi.md#getdealusers) | **GET** /deals/{id}/permittedUsers | List permitted users *DealsApi* | [**getDeals**](Api/DealsApi.md#getdeals) | **GET** /deals | Get all deals -*DealsApi* | [**getDealsCollection**](Api/DealsApi.md#getdealscollection) | **GET** /deals/collection | Get all deals (BETA) +*DealsApi* | [**getDealsCollection**](Api/DealsApi.md#getdealscollection) | **GET** /deals/collection | Get all deals collection *DealsApi* | [**getDealsSummary**](Api/DealsApi.md#getdealssummary) | **GET** /deals/summary | Get deals summary *DealsApi* | [**getDealsTimeline**](Api/DealsApi.md#getdealstimeline) | **GET** /deals/timeline | Get deals timeline *DealsApi* | [**mergeDeals**](Api/DealsApi.md#mergedeals) | **PUT** /deals/{id}/merge | Merge two deals @@ -354,6 +357,7 @@ Class | Method | HTTP request | Description *LeadSourcesApi* | [**getLeadSources**](Api/LeadSourcesApi.md#getleadsources) | **GET** /leadSources | Get all lead sources *LeadsApi* | [**addLead**](Api/LeadsApi.md#addlead) | **POST** /leads | Add a lead *LeadsApi* | [**deleteLead**](Api/LeadsApi.md#deletelead) | **DELETE** /leads/{id} | Delete a lead +*LeadsApi* | [**getArchivedLeads**](Api/LeadsApi.md#getarchivedleads) | **GET** /leads/archived | Get all archived leads *LeadsApi* | [**getLead**](Api/LeadsApi.md#getlead) | **GET** /leads/{id} | Get one lead *LeadsApi* | [**getLeadUsers**](Api/LeadsApi.md#getleadusers) | **GET** /leads/{id}/permittedUsers | List permitted users *LeadsApi* | [**getLeads**](Api/LeadsApi.md#getleads) | **GET** /leads | Get all leads @@ -413,7 +417,7 @@ Class | Method | HTTP request | Description *OrganizationsApi* | [**getOrganizationUpdates**](Api/OrganizationsApi.md#getorganizationupdates) | **GET** /organizations/{id}/flow | List updates about an organization *OrganizationsApi* | [**getOrganizationUsers**](Api/OrganizationsApi.md#getorganizationusers) | **GET** /organizations/{id}/permittedUsers | List permitted users *OrganizationsApi* | [**getOrganizations**](Api/OrganizationsApi.md#getorganizations) | **GET** /organizations | Get all organizations -*OrganizationsApi* | [**getOrganizationsCollection**](Api/OrganizationsApi.md#getorganizationscollection) | **GET** /organizations/collection | Get all organizations (BETA) +*OrganizationsApi* | [**getOrganizationsCollection**](Api/OrganizationsApi.md#getorganizationscollection) | **GET** /organizations/collection | Get all organizations collection *OrganizationsApi* | [**mergeOrganizations**](Api/OrganizationsApi.md#mergeorganizations) | **PUT** /organizations/{id}/merge | Merge two organizations *OrganizationsApi* | [**searchOrganization**](Api/OrganizationsApi.md#searchorganization) | **GET** /organizations/search | Search organizations *OrganizationsApi* | [**updateOrganization**](Api/OrganizationsApi.md#updateorganization) | **PUT** /organizations/{id} | Update an organization @@ -444,7 +448,7 @@ Class | Method | HTTP request | Description *PersonsApi* | [**getPersonUpdates**](Api/PersonsApi.md#getpersonupdates) | **GET** /persons/{id}/flow | List updates about a person *PersonsApi* | [**getPersonUsers**](Api/PersonsApi.md#getpersonusers) | **GET** /persons/{id}/permittedUsers | List permitted users *PersonsApi* | [**getPersons**](Api/PersonsApi.md#getpersons) | **GET** /persons | Get all persons -*PersonsApi* | [**getPersonsCollection**](Api/PersonsApi.md#getpersonscollection) | **GET** /persons/collection | Get all persons (BETA) +*PersonsApi* | [**getPersonsCollection**](Api/PersonsApi.md#getpersonscollection) | **GET** /persons/collection | Get all persons collection *PersonsApi* | [**mergePersons**](Api/PersonsApi.md#mergepersons) | **PUT** /persons/{id}/merge | Merge two persons *PersonsApi* | [**searchPersons**](Api/PersonsApi.md#searchpersons) | **GET** /persons/search | Search persons *PersonsApi* | [**updatePerson**](Api/PersonsApi.md#updateperson) | **PUT** /persons/{id} | Update a person @@ -644,6 +648,7 @@ Class | Method | HTTP request | Description - [BaseNoteDealTitle](Model/BaseNoteDealTitle.md) - [BaseNoteOrganization](Model/BaseNoteOrganization.md) - [BaseNotePerson](Model/BaseNotePerson.md) + - [BaseNoteProject](Model/BaseNoteProject.md) - [BaseOrganizationItem](Model/BaseOrganizationItem.md) - [BaseOrganizationItemFields](Model/BaseOrganizationItemFields.md) - [BaseOrganizationItemWithEditNameFlag](Model/BaseOrganizationItemWithEditNameFlag.md) diff --git a/docs/versions/v2/Api/ActivitiesApi.md b/docs/versions/v2/Api/ActivitiesApi.md index 7d2e982..5d0e85b 100644 --- a/docs/versions/v2/Api/ActivitiesApi.md +++ b/docs/versions/v2/Api/ActivitiesApi.md @@ -144,7 +144,7 @@ Name | Type | Description | Notes ## `getActivities()` ```php -getActivities($filter_id, $ids, $owner_id, $deal_id, $lead_id, $person_id, $org_id, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $limit, $cursor): \Pipedrive\versions\v2\Model\GetActivities +getActivities($filter_id, $ids, $owner_id, $deal_id, $lead_id, $person_id, $org_id, $done, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $limit, $cursor): \Pipedrive\versions\v2\Model\GetActivities ``` Get all activities @@ -180,16 +180,17 @@ $deal_id = 56; // int | If supplied, only activities linked to the specified dea $lead_id = 'lead_id_example'; // string | If supplied, only activities linked to the specified lead are returned. If filter_id is provided, this is ignored. $person_id = 56; // int | If supplied, only activities whose primary participant is the given person are returned. If filter_id is provided, this is ignored. $org_id = 56; // int | If supplied, only activities linked to the specified organization are returned. If filter_id is provided, this is ignored. +$done = True; // bool | If supplied, only activities with specified 'done' flag value are returned $updated_since = 'updated_since_example'; // string | If set, only activities with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. $updated_until = 'updated_until_example'; // string | If set, only activities with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. -$sort_by = 'id'; // string | The field to sort by. Supported fields: `id`, `update_time`, `add_time`. +$sort_by = 'id'; // string | The field to sort by. Supported fields: `id`, `update_time`, `add_time`, `due_date`. $sort_direction = 'asc'; // string | The sorting direction. Supported values: `asc`, `desc`. $include_fields = 'include_fields_example'; // string | Optional comma separated string array of additional fields to include $limit = 100; // int | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. $cursor = 'cursor_example'; // string | For pagination, the marker (an opaque string value) representing the first item on the next page try { - $result = $apiInstance->getActivities($filter_id, $ids, $owner_id, $deal_id, $lead_id, $person_id, $org_id, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $limit, $cursor); + $result = $apiInstance->getActivities($filter_id, $ids, $owner_id, $deal_id, $lead_id, $person_id, $org_id, $done, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $limit, $cursor); print_r($result); } catch (Exception $e) { echo 'Exception when calling ActivitiesApi->getActivities: ', $e->getMessage(), PHP_EOL; @@ -207,9 +208,10 @@ Name | Type | Description | Notes **lead_id** | **string**| If supplied, only activities linked to the specified lead are returned. If filter_id is provided, this is ignored. | [optional] **person_id** | **int**| If supplied, only activities whose primary participant is the given person are returned. If filter_id is provided, this is ignored. | [optional] **org_id** | **int**| If supplied, only activities linked to the specified organization are returned. If filter_id is provided, this is ignored. | [optional] + **done** | **bool**| If supplied, only activities with specified 'done' flag value are returned | [optional] **updated_since** | **string**| If set, only activities with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. | [optional] **updated_until** | **string**| If set, only activities with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. | [optional] - **sort_by** | **string**| The field to sort by. Supported fields: `id`, `update_time`, `add_time`. | [optional] [default to 'id'] + **sort_by** | **string**| The field to sort by. Supported fields: `id`, `update_time`, `add_time`, `due_date`. | [optional] [default to 'id'] **sort_direction** | **string**| The sorting direction. Supported values: `asc`, `desc`. | [optional] [default to 'asc'] **include_fields** | **string**| Optional comma separated string array of additional fields to include | [optional] **limit** | **int**| For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. | [optional] diff --git a/docs/versions/v2/Api/BetaApi.md b/docs/versions/v2/Api/BetaApi.md index 66af6db..02a645b 100644 --- a/docs/versions/v2/Api/BetaApi.md +++ b/docs/versions/v2/Api/BetaApi.md @@ -4,12 +4,148 @@ All URIs are relative to https://api.pipedrive.com/api/v2. Method | HTTP request | Description ------------- | ------------- | ------------- +[**convertDealToLead()**](BetaApi.md#convertDealToLead) | **POST** /deals/{id}/convert/lead | Convert a deal to a lead (BETA) +[**convertLeadToDeal()**](BetaApi.md#convertLeadToDeal) | **POST** /leads/{id}/convert/deal | Convert a lead to a deal (BETA) [**deleteInstallment()**](BetaApi.md#deleteInstallment) | **DELETE** /deals/{id}/installments/{installment_id} | Delete an installment from a deal +[**getDealConversionStatus()**](BetaApi.md#getDealConversionStatus) | **GET** /deals/{id}/convert/status/{conversion_id} | Get Deal conversion status (BETA) [**getInstallments()**](BetaApi.md#getInstallments) | **GET** /deals/installments | List installments added to a list of deals +[**getLeadConversionStatus()**](BetaApi.md#getLeadConversionStatus) | **GET** /leads/{id}/convert/status/{conversion_id} | Get Lead conversion status (BETA) [**postInstallment()**](BetaApi.md#postInstallment) | **POST** /deals/{id}/installments | Add an installment to a deal [**updateInstallment()**](BetaApi.md#updateInstallment) | **PATCH** /deals/{id}/installments/{installment_id} | Update an installment added to a deal +## `convertDealToLead()` + +```php +convertDealToLead($id): \Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse +``` + +Convert a deal to a lead (BETA) + +Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/deals/{deal_id}/convert/status/{conversion_id} endpoint. + +### Example + +```php +setApiKey('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('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\BetaApi( + // 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 deal to convert + +try { + $result = $apiInstance->convertDealToLead($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BetaApi->convertDealToLead: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal to convert | + +### Return type + +[**\Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse**](../Model/AddConvertDealToLeadResponse.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) + +## `convertLeadToDeal()` + +```php +convertLeadToDeal($id, $inline_object): \Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse +``` + +Convert a lead to a deal (BETA) + +Initiates a conversion of a lead to a deal. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/leads/{lead_id}/convert/status/{conversion_id} endpoint. + +### Example + +```php +setApiKey('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('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\BetaApi( + // 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 = 'id_example'; // string | The ID of the lead to convert +$inline_object = new \Pipedrive\versions\v2\Model\InlineObject(); // \Pipedrive\versions\v2\Model\InlineObject + +try { + $result = $apiInstance->convertLeadToDeal($id, $inline_object); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BetaApi->convertLeadToDeal: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of the lead to convert | + **inline_object** | [**\Pipedrive\versions\v2\Model\InlineObject**](../Model/InlineObject.md)| | [optional] + +### Return type + +[**\Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse**](../Model/AddConvertLeadToDealResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **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) + ## `deleteInstallment()` ```php @@ -77,6 +213,72 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## `getDealConversionStatus()` + +```php +getDealConversionStatus($id, $conversion_id) +``` + +Get Deal conversion status (BETA) + +Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days. + +### Example + +```php +setApiKey('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('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\BetaApi( + // 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 a deal +$conversion_id = 'conversion_id_example'; // string | The ID of the conversion + +try { + $apiInstance->getDealConversionStatus($id, $conversion_id); +} catch (Exception $e) { + echo 'Exception when calling BetaApi->getDealConversionStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of a deal | + **conversion_id** | **string**| The ID of the conversion | + +### Return type + +void (empty response body) + +### 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) + ## `getInstallments()` ```php @@ -150,6 +352,72 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## `getLeadConversionStatus()` + +```php +getLeadConversionStatus($id, $conversion_id) +``` + +Get Lead conversion status (BETA) + +Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days. + +### Example + +```php +setApiKey('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('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\BetaApi( + // 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 = 'id_example'; // string | The ID of a lead +$conversion_id = 'conversion_id_example'; // string | The ID of the conversion + +try { + $apiInstance->getLeadConversionStatus($id, $conversion_id); +} catch (Exception $e) { + echo 'Exception when calling BetaApi->getLeadConversionStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of a lead | + **conversion_id** | **string**| The ID of the conversion | + +### Return type + +void (empty response body) + +### 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) + ## `postInstallment()` ```php diff --git a/docs/versions/v2/Api/DealsApi.md b/docs/versions/v2/Api/DealsApi.md index 1466952..e4f98d3 100644 --- a/docs/versions/v2/Api/DealsApi.md +++ b/docs/versions/v2/Api/DealsApi.md @@ -7,13 +7,16 @@ Method | HTTP request | Description [**addDeal()**](DealsApi.md#addDeal) | **POST** /deals | Add a new deal [**addDealFollower()**](DealsApi.md#addDealFollower) | **POST** /deals/{id}/followers | Add a follower to a deal [**addDealProduct()**](DealsApi.md#addDealProduct) | **POST** /deals/{id}/products | Add a product to a deal +[**convertDealToLead()**](DealsApi.md#convertDealToLead) | **POST** /deals/{id}/convert/lead | Convert a deal to a lead (BETA) [**deleteAdditionalDiscount()**](DealsApi.md#deleteAdditionalDiscount) | **DELETE** /deals/{id}/discounts/{discount_id} | Delete a discount from a deal [**deleteDeal()**](DealsApi.md#deleteDeal) | **DELETE** /deals/{id} | Delete a deal [**deleteDealFollower()**](DealsApi.md#deleteDealFollower) | **DELETE** /deals/{id}/followers/{follower_id} | Delete a follower from a deal [**deleteDealProduct()**](DealsApi.md#deleteDealProduct) | **DELETE** /deals/{id}/products/{product_attachment_id} | Delete an attached product from a deal [**deleteInstallment()**](DealsApi.md#deleteInstallment) | **DELETE** /deals/{id}/installments/{installment_id} | Delete an installment from a deal [**getAdditionalDiscounts()**](DealsApi.md#getAdditionalDiscounts) | **GET** /deals/{id}/discounts | List discounts added to a deal +[**getArchivedDeals()**](DealsApi.md#getArchivedDeals) | **GET** /deals/archived | Get all archived deals [**getDeal()**](DealsApi.md#getDeal) | **GET** /deals/{id} | Get details of a deal +[**getDealConversionStatus()**](DealsApi.md#getDealConversionStatus) | **GET** /deals/{id}/convert/status/{conversion_id} | Get Deal conversion status (BETA) [**getDealFollowers()**](DealsApi.md#getDealFollowers) | **GET** /deals/{id}/followers | List followers of a deal [**getDealFollowersChangelog()**](DealsApi.md#getDealFollowersChangelog) | **GET** /deals/{id}/followers/changelog | List followers changelog of a deal [**getDealProducts()**](DealsApi.md#getDealProducts) | **GET** /deals/{id}/products | List products attached to a deal @@ -228,6 +231,71 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## `convertDealToLead()` + +```php +convertDealToLead($id): \Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse +``` + +Convert a deal to a lead (BETA) + +Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/deals/{deal_id}/convert/status/{conversion_id} endpoint. + +### Example + +```php +setApiKey('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('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\DealsApi( + // 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 deal to convert + +try { + $result = $apiInstance->convertDealToLead($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->convertDealToLead: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal to convert | + +### Return type + +[**\Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse**](../Model/AddConvertDealToLeadResponse.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) + ## `deleteAdditionalDiscount()` ```php @@ -626,6 +694,101 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## `getArchivedDeals()` + +```php +getArchivedDeals($filter_id, $ids, $owner_id, $person_id, $org_id, $pipeline_id, $stage_id, $status, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $custom_fields, $limit, $cursor): \Pipedrive\versions\v2\Model\GetDeals +``` + +Get all archived deals + +Returns data about all archived deals. + +### Example + +```php +setApiKey('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('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\DealsApi( + // 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 +); +$filter_id = 56; // int | If supplied, only deals matching the specified filter are returned +$ids = 'ids_example'; // string | Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. +$owner_id = 56; // int | If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. +$person_id = 56; // int | If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. +$org_id = 56; // int | If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. +$pipeline_id = 56; // int | If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. +$stage_id = 56; // int | If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. +$status = 'status_example'; // string | Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. +$updated_since = 'updated_since_example'; // string | If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. +$updated_until = 'updated_until_example'; // string | If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. +$sort_by = 'id'; // string | The field to sort by. Supported fields: `id`, `update_time`, `add_time`. +$sort_direction = 'asc'; // string | The sorting direction. Supported values: `asc`, `desc`. +$include_fields = 'include_fields_example'; // string | Optional comma separated string array of additional fields to include +$custom_fields = 'custom_fields_example'; // string | Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.
A maximum of 15 keys is allowed. +$limit = 100; // int | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. +$cursor = 'cursor_example'; // string | For pagination, the marker (an opaque string value) representing the first item on the next page + +try { + $result = $apiInstance->getArchivedDeals($filter_id, $ids, $owner_id, $person_id, $org_id, $pipeline_id, $stage_id, $status, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $custom_fields, $limit, $cursor); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getArchivedDeals: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filter_id** | **int**| If supplied, only deals matching the specified filter are returned | [optional] + **ids** | **string**| Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. | [optional] + **owner_id** | **int**| If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. | [optional] + **person_id** | **int**| If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. | [optional] + **org_id** | **int**| If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. | [optional] + **pipeline_id** | **int**| If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. | [optional] + **stage_id** | **int**| If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. | [optional] + **status** | **string**| Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. | [optional] + **updated_since** | **string**| If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. | [optional] + **updated_until** | **string**| If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. | [optional] + **sort_by** | **string**| The field to sort by. Supported fields: `id`, `update_time`, `add_time`. | [optional] [default to 'id'] + **sort_direction** | **string**| The sorting direction. Supported values: `asc`, `desc`. | [optional] [default to 'asc'] + **include_fields** | **string**| Optional comma separated string array of additional fields to include | [optional] + **custom_fields** | **string**| Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. | [optional] + **limit** | **int**| For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. | [optional] + **cursor** | **string**| For pagination, the marker (an opaque string value) representing the first item on the next page | [optional] + +### Return type + +[**\Pipedrive\versions\v2\Model\GetDeals**](../Model/GetDeals.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) + ## `getDeal()` ```php @@ -695,6 +858,72 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## `getDealConversionStatus()` + +```php +getDealConversionStatus($id, $conversion_id) +``` + +Get Deal conversion status (BETA) + +Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days. + +### Example + +```php +setApiKey('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('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\DealsApi( + // 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 a deal +$conversion_id = 'conversion_id_example'; // string | The ID of the conversion + +try { + $apiInstance->getDealConversionStatus($id, $conversion_id); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDealConversionStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of a deal | + **conversion_id** | **string**| The ID of the conversion | + +### Return type + +void (empty response body) + +### 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) + ## `getDealFollowers()` ```php @@ -914,7 +1143,7 @@ getDeals($filter_id, $ids, $owner_id, $person_id, $org_id, $pipeline_id, $stage_ Get all deals -Returns data about all deals. +Returns data about all not archived deals. ### Example diff --git a/docs/versions/v2/Api/LeadsApi.md b/docs/versions/v2/Api/LeadsApi.md index cf0d13c..9975fd0 100644 --- a/docs/versions/v2/Api/LeadsApi.md +++ b/docs/versions/v2/Api/LeadsApi.md @@ -4,9 +4,144 @@ All URIs are relative to https://api.pipedrive.com/api/v2. Method | HTTP request | Description ------------- | ------------- | ------------- +[**convertLeadToDeal()**](LeadsApi.md#convertLeadToDeal) | **POST** /leads/{id}/convert/deal | Convert a lead to a deal (BETA) +[**getLeadConversionStatus()**](LeadsApi.md#getLeadConversionStatus) | **GET** /leads/{id}/convert/status/{conversion_id} | Get Lead conversion status (BETA) [**searchLeads()**](LeadsApi.md#searchLeads) | **GET** /leads/search | Search leads +## `convertLeadToDeal()` + +```php +convertLeadToDeal($id, $inline_object): \Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse +``` + +Convert a lead to a deal (BETA) + +Initiates a conversion of a lead to a deal. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/leads/{lead_id}/convert/status/{conversion_id} endpoint. + +### Example + +```php +setApiKey('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('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\LeadsApi( + // 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 = 'id_example'; // string | The ID of the lead to convert +$inline_object = new \Pipedrive\versions\v2\Model\InlineObject(); // \Pipedrive\versions\v2\Model\InlineObject + +try { + $result = $apiInstance->convertLeadToDeal($id, $inline_object); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeadsApi->convertLeadToDeal: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of the lead to convert | + **inline_object** | [**\Pipedrive\versions\v2\Model\InlineObject**](../Model/InlineObject.md)| | [optional] + +### Return type + +[**\Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse**](../Model/AddConvertLeadToDealResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **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) + +## `getLeadConversionStatus()` + +```php +getLeadConversionStatus($id, $conversion_id) +``` + +Get Lead conversion status (BETA) + +Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days. + +### Example + +```php +setApiKey('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('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\LeadsApi( + // 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 = 'id_example'; // string | The ID of a lead +$conversion_id = 'conversion_id_example'; // string | The ID of the conversion + +try { + $apiInstance->getLeadConversionStatus($id, $conversion_id); +} catch (Exception $e) { + echo 'Exception when calling LeadsApi->getLeadConversionStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of a lead | + **conversion_id** | **string**| The ID of the conversion | + +### Return type + +void (empty response body) + +### 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) + ## `searchLeads()` ```php diff --git a/docs/versions/v2/Model/AddConvertDealToLeadResponse.md b/docs/versions/v2/Model/AddConvertDealToLeadResponse.md new file mode 100644 index 0000000..9989817 --- /dev/null +++ b/docs/versions/v2/Model/AddConvertDealToLeadResponse.md @@ -0,0 +1,11 @@ +# # AddConvertDealToLeadResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\versions\v2\Model\ConvertEntityResponse**](.md) | An object containing conversion job id that performs the conversion | [optional] +**additional_data** | **object** | | [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) diff --git a/docs/versions/v2/Model/AddConvertLeadToDealResponse.md b/docs/versions/v2/Model/AddConvertLeadToDealResponse.md new file mode 100644 index 0000000..1914fbb --- /dev/null +++ b/docs/versions/v2/Model/AddConvertLeadToDealResponse.md @@ -0,0 +1,11 @@ +# # AddConvertLeadToDealResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\versions\v2\Model\ConvertEntityResponse**](.md) | An object containing conversion job id that performs the conversion | [optional] +**additional_data** | **object** | | [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) diff --git a/docs/versions/v2/Model/ConvertEntityResponse.md b/docs/versions/v2/Model/ConvertEntityResponse.md new file mode 100644 index 0000000..f0e57d5 --- /dev/null +++ b/docs/versions/v2/Model/ConvertEntityResponse.md @@ -0,0 +1,9 @@ +# # ConvertEntityResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conversion_id** | **string** | The ID of the conversion job that can be used to retrieve conversion status and details. The ID has UUID format. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/versions/v2/Model/DealItem.md b/docs/versions/v2/Model/DealItem.md index 1445501..98cdb02 100644 --- a/docs/versions/v2/Model/DealItem.md +++ b/docs/versions/v2/Model/DealItem.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **add_time** | **string** | The creation date and time of the deal | [optional] **update_time** | **string** | The last updated date and time of the deal | [optional] **stage_change_time** | **string** | The last updated date and time of the deal stage | [optional] +**is_archived** | **bool** | Whether the deal is archived or not | [optional] **is_deleted** | **bool** | Whether the deal is deleted or not | [optional] **status** | **string** | The status of the deal | [optional] **probability** | **float** | The success probability percentage of the deal | [optional] diff --git a/docs/versions/v2/Model/DealSearchItemItem.md b/docs/versions/v2/Model/DealSearchItemItem.md index 3578a06..1e26713 100644 --- a/docs/versions/v2/Model/DealSearchItemItem.md +++ b/docs/versions/v2/Model/DealSearchItemItem.md @@ -17,5 +17,6 @@ Name | Type | Description | Notes **organization** | [**\Pipedrive\versions\v2\Model\DealSearchItemItemOrganization**](DealSearchItemItemOrganization.md) | | [optional] **custom_fields** | **string[]** | Custom fields | [optional] **notes** | **string[]** | An array of notes | [optional] +**is_archived** | **bool** | A flag indicating whether the deal is archived or not | [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) diff --git a/docs/versions/v2/Model/GetConvertResponse.md b/docs/versions/v2/Model/GetConvertResponse.md new file mode 100644 index 0000000..dabd672 --- /dev/null +++ b/docs/versions/v2/Model/GetConvertResponse.md @@ -0,0 +1,13 @@ +# # GetConvertResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**error** | **string** | The description of the error | [optional] +**error_info** | **string** | A message describing how to solve the problem | [optional] +**data** | **object** | | [optional] +**additional_data** | **object** | | [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) diff --git a/docs/versions/v2/Model/InlineObject.md b/docs/versions/v2/Model/InlineObject.md new file mode 100644 index 0000000..f564bd8 --- /dev/null +++ b/docs/versions/v2/Model/InlineObject.md @@ -0,0 +1,10 @@ +# # InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stage_id** | **int** | The ID of a stage the created 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] +**pipeline_id** | **int** | The ID of a pipeline the created 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] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/versions/v2/README.md b/docs/versions/v2/README.md index 572f992..2d90f7c 100644 --- a/docs/versions/v2/README.md +++ b/docs/versions/v2/README.md @@ -270,20 +270,27 @@ Class | Method | HTTP request | Description *ActivitiesApi* | [**getActivities**](Api/ActivitiesApi.md#getactivities) | **GET** /activities | Get all activities *ActivitiesApi* | [**getActivity**](Api/ActivitiesApi.md#getactivity) | **GET** /activities/{id} | Get details of an activity *ActivitiesApi* | [**updateActivity**](Api/ActivitiesApi.md#updateactivity) | **PATCH** /activities/{id} | Update an activity +*BetaApi* | [**convertDealToLead**](Api/BetaApi.md#convertdealtolead) | **POST** /deals/{id}/convert/lead | Convert a deal to a lead (BETA) +*BetaApi* | [**convertLeadToDeal**](Api/BetaApi.md#convertleadtodeal) | **POST** /leads/{id}/convert/deal | Convert a lead to a deal (BETA) *BetaApi* | [**deleteInstallment**](Api/BetaApi.md#deleteinstallment) | **DELETE** /deals/{id}/installments/{installment_id} | Delete an installment from a deal +*BetaApi* | [**getDealConversionStatus**](Api/BetaApi.md#getdealconversionstatus) | **GET** /deals/{id}/convert/status/{conversion_id} | Get Deal conversion status (BETA) *BetaApi* | [**getInstallments**](Api/BetaApi.md#getinstallments) | **GET** /deals/installments | List installments added to a list of deals +*BetaApi* | [**getLeadConversionStatus**](Api/BetaApi.md#getleadconversionstatus) | **GET** /leads/{id}/convert/status/{conversion_id} | Get Lead conversion status (BETA) *BetaApi* | [**postInstallment**](Api/BetaApi.md#postinstallment) | **POST** /deals/{id}/installments | Add an installment to a deal *BetaApi* | [**updateInstallment**](Api/BetaApi.md#updateinstallment) | **PATCH** /deals/{id}/installments/{installment_id} | Update an installment added to a deal *DealsApi* | [**addDeal**](Api/DealsApi.md#adddeal) | **POST** /deals | Add a new deal *DealsApi* | [**addDealFollower**](Api/DealsApi.md#adddealfollower) | **POST** /deals/{id}/followers | Add a follower to a deal *DealsApi* | [**addDealProduct**](Api/DealsApi.md#adddealproduct) | **POST** /deals/{id}/products | Add a product to a deal +*DealsApi* | [**convertDealToLead**](Api/DealsApi.md#convertdealtolead) | **POST** /deals/{id}/convert/lead | Convert a deal to a lead (BETA) *DealsApi* | [**deleteAdditionalDiscount**](Api/DealsApi.md#deleteadditionaldiscount) | **DELETE** /deals/{id}/discounts/{discount_id} | Delete a discount from a deal *DealsApi* | [**deleteDeal**](Api/DealsApi.md#deletedeal) | **DELETE** /deals/{id} | Delete a deal *DealsApi* | [**deleteDealFollower**](Api/DealsApi.md#deletedealfollower) | **DELETE** /deals/{id}/followers/{follower_id} | Delete a follower from a deal *DealsApi* | [**deleteDealProduct**](Api/DealsApi.md#deletedealproduct) | **DELETE** /deals/{id}/products/{product_attachment_id} | Delete an attached product from a deal *DealsApi* | [**deleteInstallment**](Api/DealsApi.md#deleteinstallment) | **DELETE** /deals/{id}/installments/{installment_id} | Delete an installment from a deal *DealsApi* | [**getAdditionalDiscounts**](Api/DealsApi.md#getadditionaldiscounts) | **GET** /deals/{id}/discounts | List discounts added to a deal +*DealsApi* | [**getArchivedDeals**](Api/DealsApi.md#getarchiveddeals) | **GET** /deals/archived | Get all archived deals *DealsApi* | [**getDeal**](Api/DealsApi.md#getdeal) | **GET** /deals/{id} | Get details of a deal +*DealsApi* | [**getDealConversionStatus**](Api/DealsApi.md#getdealconversionstatus) | **GET** /deals/{id}/convert/status/{conversion_id} | Get Deal conversion status (BETA) *DealsApi* | [**getDealFollowers**](Api/DealsApi.md#getdealfollowers) | **GET** /deals/{id}/followers | List followers of a deal *DealsApi* | [**getDealFollowersChangelog**](Api/DealsApi.md#getdealfollowerschangelog) | **GET** /deals/{id}/followers/changelog | List followers changelog of a deal *DealsApi* | [**getDealProducts**](Api/DealsApi.md#getdealproducts) | **GET** /deals/{id}/products | List products attached to a deal @@ -299,6 +306,8 @@ Class | Method | HTTP request | Description *DealsApi* | [**updateInstallment**](Api/DealsApi.md#updateinstallment) | **PATCH** /deals/{id}/installments/{installment_id} | Update an installment added to a deal *ItemSearchApi* | [**searchItem**](Api/ItemSearchApi.md#searchitem) | **GET** /itemSearch | Perform a search from multiple item types *ItemSearchApi* | [**searchItemByField**](Api/ItemSearchApi.md#searchitembyfield) | **GET** /itemSearch/field | Perform a search using a specific field from an item type +*LeadsApi* | [**convertLeadToDeal**](Api/LeadsApi.md#convertleadtodeal) | **POST** /leads/{id}/convert/deal | Convert a lead to a deal (BETA) +*LeadsApi* | [**getLeadConversionStatus**](Api/LeadsApi.md#getleadconversionstatus) | **GET** /leads/{id}/convert/status/{conversion_id} | Get Lead conversion status (BETA) *LeadsApi* | [**searchLeads**](Api/LeadsApi.md#searchleads) | **GET** /leads/search | Search leads *OrganizationsApi* | [**addOrganization**](Api/OrganizationsApi.md#addorganization) | **POST** /organizations | Add a new organization *OrganizationsApi* | [**addOrganizationFollower**](Api/OrganizationsApi.md#addorganizationfollower) | **POST** /organizations/{id}/followers | Add a follower to an organization @@ -355,6 +364,8 @@ Class | Method | HTTP request | Description - [ActivityItemParticipants](Model/ActivityItemParticipants.md) - [ActivityRequestBody](Model/ActivityRequestBody.md) - [AddAdditionalDiscountResponse](Model/AddAdditionalDiscountResponse.md) + - [AddConvertDealToLeadResponse](Model/AddConvertDealToLeadResponse.md) + - [AddConvertLeadToDealResponse](Model/AddConvertLeadToDealResponse.md) - [AddDealProductResponse](Model/AddDealProductResponse.md) - [AddInstallmentResponse](Model/AddInstallmentResponse.md) - [AddProductRequestBody](Model/AddProductRequestBody.md) @@ -375,6 +386,7 @@ Class | Method | HTTP request | Description - [BaseResponse](Model/BaseResponse.md) - [BillingFrequency](Model/BillingFrequency.md) - [BillingFrequency1](Model/BillingFrequency1.md) + - [ConvertEntityResponse](Model/ConvertEntityResponse.md) - [DealItem](Model/DealItem.md) - [DealProductRequestBody](Model/DealProductRequestBody.md) - [DealRequestBody](Model/DealRequestBody.md) @@ -414,6 +426,7 @@ Class | Method | HTTP request | Description - [FollowerRequestBody](Model/FollowerRequestBody.md) - [GetActivities](Model/GetActivities.md) - [GetActivitiesAllOf](Model/GetActivitiesAllOf.md) + - [GetConvertResponse](Model/GetConvertResponse.md) - [GetDealSearchResponse](Model/GetDealSearchResponse.md) - [GetDealSearchResponseAllOf](Model/GetDealSearchResponseAllOf.md) - [GetDealSearchResponseAllOfData](Model/GetDealSearchResponseAllOfData.md) @@ -437,6 +450,7 @@ Class | Method | HTTP request | Description - [GetPipelines](Model/GetPipelines.md) - [GetPipelinesAllOf](Model/GetPipelinesAllOf.md) - [GetStages](Model/GetStages.md) + - [InlineObject](Model/InlineObject.md) - [InstallmentRequestBody](Model/InstallmentRequestBody.md) - [InstallmentsResponse](Model/InstallmentsResponse.md) - [ItemSearchFieldResponse](Model/ItemSearchFieldResponse.md) diff --git a/lib/versions/v1/Api/ActivitiesApi.php b/lib/versions/v1/Api/ActivitiesApi.php index 7b2a69b..3447a77 100644 --- a/lib/versions/v1/Api/ActivitiesApi.php +++ b/lib/versions/v1/Api/ActivitiesApi.php @@ -132,6 +132,7 @@ public function getConfig(): Configuration * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\AddActivityResponse + * @deprecated */ public function addActivity($activity_post_object = null) { @@ -149,6 +150,7 @@ public function addActivity($activity_post_object = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\AddActivityResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function addActivityWithHttpInfo($activity_post_object = null) { @@ -249,6 +251,7 @@ public function addActivityWithHttpInfo($activity_post_object = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addActivityAsync($activity_post_object = null): PromiseInterface { @@ -269,6 +272,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addActivityAsyncWithHttpInfo($activity_post_object = null): PromiseInterface { @@ -316,6 +320,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function addActivityRequest($activity_post_object = null): Request { @@ -419,6 +424,7 @@ public function addActivityRequest($activity_post_object = null): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\DeleteActivitiesResponse + * @deprecated */ public function deleteActivities($ids) { @@ -436,6 +442,7 @@ public function deleteActivities($ids) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\DeleteActivitiesResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function deleteActivitiesWithHttpInfo($ids) { @@ -536,6 +543,7 @@ public function deleteActivitiesWithHttpInfo($ids) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteActivitiesAsync($ids): PromiseInterface { @@ -556,6 +564,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteActivitiesAsyncWithHttpInfo($ids): PromiseInterface { @@ -603,6 +612,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function deleteActivitiesRequest($ids): Request { @@ -715,6 +725,7 @@ public function deleteActivitiesRequest($ids): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\DeleteActivityResponse + * @deprecated */ public function deleteActivity($id) { @@ -732,6 +743,7 @@ public function deleteActivity($id) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\DeleteActivityResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function deleteActivityWithHttpInfo($id) { @@ -832,6 +844,7 @@ public function deleteActivityWithHttpInfo($id) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteActivityAsync($id): PromiseInterface { @@ -852,6 +865,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteActivityAsyncWithHttpInfo($id): PromiseInterface { @@ -899,6 +913,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function deleteActivityRequest($id): Request { @@ -1018,6 +1033,7 @@ public function deleteActivityRequest($id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetActivitiesResponse + * @deprecated */ public function getActivities($user_id = null, $filter_id = null, $type = null, $limit = null, $start = null, $start_date = null, $end_date = null, $done = null) { @@ -1042,6 +1058,7 @@ public function getActivities($user_id = null, $filter_id = null, $type = null, * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetActivitiesResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getActivitiesWithHttpInfo($user_id = null, $filter_id = null, $type = null, $limit = null, $start = null, $start_date = null, $end_date = null, $done = null) { @@ -1149,6 +1166,7 @@ public function getActivitiesWithHttpInfo($user_id = null, $filter_id = null, $t * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getActivitiesAsync($user_id = null, $filter_id = null, $type = null, $limit = null, $start = null, $start_date = null, $end_date = null, $done = null): PromiseInterface { @@ -1176,6 +1194,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getActivitiesAsyncWithHttpInfo($user_id = null, $filter_id = null, $type = null, $limit = null, $start = null, $start_date = null, $end_date = null, $done = null): PromiseInterface { @@ -1230,6 +1249,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getActivitiesRequest($user_id = null, $filter_id = null, $type = null, $limit = null, $start = null, $start_date = null, $end_date = null, $done = null): Request { @@ -1384,7 +1404,7 @@ public function getActivitiesRequest($user_id = null, $filter_id = null, $type = /** * Operation getActivitiesCollection * - * Get all activities (BETA) + * Get all activities collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -1397,6 +1417,7 @@ public function getActivitiesRequest($user_id = null, $filter_id = null, $type = * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetActivitiesCollectionResponse|\Pipedrive\versions\v1\Model\FailResponse + * @deprecated */ public function getActivitiesCollection($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $done = null, $type = null) { @@ -1407,7 +1428,7 @@ public function getActivitiesCollection($cursor = null, $limit = null, $since = /** * Operation getActivitiesCollectionWithHttpInfo * - * Get all activities (BETA) + * Get all activities collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -1420,6 +1441,7 @@ public function getActivitiesCollection($cursor = null, $limit = null, $since = * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetActivitiesCollectionResponse|\Pipedrive\versions\v1\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getActivitiesCollectionWithHttpInfo($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $done = null, $type = null) { @@ -1535,7 +1557,7 @@ public function getActivitiesCollectionWithHttpInfo($cursor = null, $limit = nul /** * Operation getActivitiesCollectionAsync * - * Get all activities (BETA) + * Get all activities collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -1547,6 +1569,7 @@ public function getActivitiesCollectionWithHttpInfo($cursor = null, $limit = nul * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getActivitiesCollectionAsync($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $done = null, $type = null): PromiseInterface { @@ -1561,7 +1584,7 @@ function ($response) { /** * Operation getActivitiesCollectionAsyncWithHttpInfo * - * Get all activities (BETA) + * Get all activities collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -1573,6 +1596,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getActivitiesCollectionAsyncWithHttpInfo($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $done = null, $type = null): PromiseInterface { @@ -1626,6 +1650,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getActivitiesCollectionRequest($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $done = null, $type = null): Request { @@ -1779,6 +1804,7 @@ public function getActivitiesCollectionRequest($cursor = null, $limit = null, $s * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetActivityResponse + * @deprecated */ public function getActivity($id) { @@ -1796,6 +1822,7 @@ public function getActivity($id) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetActivityResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getActivityWithHttpInfo($id) { @@ -1896,6 +1923,7 @@ public function getActivityWithHttpInfo($id) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getActivityAsync($id): PromiseInterface { @@ -1916,6 +1944,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getActivityAsyncWithHttpInfo($id): PromiseInterface { @@ -1963,6 +1992,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getActivityRequest($id): Request { @@ -2076,6 +2106,7 @@ public function getActivityRequest($id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\UpdateActivityResponse + * @deprecated */ public function updateActivity($id, $activity_put_object = null) { @@ -2094,6 +2125,7 @@ public function updateActivity($id, $activity_put_object = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\UpdateActivityResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function updateActivityWithHttpInfo($id, $activity_put_object = null) { @@ -2195,6 +2227,7 @@ public function updateActivityWithHttpInfo($id, $activity_put_object = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function updateActivityAsync($id, $activity_put_object = null): PromiseInterface { @@ -2216,6 +2249,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function updateActivityAsyncWithHttpInfo($id, $activity_put_object = null): PromiseInterface { @@ -2264,6 +2298,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function updateActivityRequest($id, $activity_put_object = null): Request { diff --git a/lib/versions/v1/Api/DealsApi.php b/lib/versions/v1/Api/DealsApi.php index f41d439..082729b 100644 --- a/lib/versions/v1/Api/DealsApi.php +++ b/lib/versions/v1/Api/DealsApi.php @@ -132,6 +132,7 @@ public function getConfig(): Configuration * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetAddedDeal + * @deprecated */ public function addDeal($new_deal = null) { @@ -149,6 +150,7 @@ public function addDeal($new_deal = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetAddedDeal, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function addDealWithHttpInfo($new_deal = null) { @@ -249,6 +251,7 @@ public function addDealWithHttpInfo($new_deal = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addDealAsync($new_deal = null): PromiseInterface { @@ -269,6 +272,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addDealAsyncWithHttpInfo($new_deal = null): PromiseInterface { @@ -316,6 +320,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function addDealRequest($new_deal = null): Request { @@ -1034,6 +1039,7 @@ public function addDealParticipantRequest($id, $add_deal_participant_request = n * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetAddProductAttachmentDetails + * @deprecated */ public function addDealProduct($id, $new_deal_product = null) { @@ -1052,6 +1058,7 @@ public function addDealProduct($id, $new_deal_product = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetAddProductAttachmentDetails, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function addDealProductWithHttpInfo($id, $new_deal_product = null) { @@ -1153,6 +1160,7 @@ public function addDealProductWithHttpInfo($id, $new_deal_product = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addDealProductAsync($id, $new_deal_product = null): PromiseInterface { @@ -1174,6 +1182,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addDealProductAsyncWithHttpInfo($id, $new_deal_product = null): PromiseInterface { @@ -1222,6 +1231,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function addDealProductRequest($id, $new_deal_product = null): Request { @@ -1340,6 +1350,7 @@ public function addDealProductRequest($id, $new_deal_product = null): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\DeleteDeal + * @deprecated */ public function deleteDeal($id) { @@ -1357,6 +1368,7 @@ public function deleteDeal($id) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\DeleteDeal, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function deleteDealWithHttpInfo($id) { @@ -1457,6 +1469,7 @@ public function deleteDealWithHttpInfo($id) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteDealAsync($id): PromiseInterface { @@ -1477,6 +1490,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteDealAsyncWithHttpInfo($id): PromiseInterface { @@ -1524,6 +1538,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function deleteDealRequest($id): Request { @@ -2269,6 +2284,7 @@ public function deleteDealParticipantRequest($id, $deal_participant_id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\DeleteDealProduct + * @deprecated */ public function deleteDealProduct($id, $product_attachment_id) { @@ -2287,6 +2303,7 @@ public function deleteDealProduct($id, $product_attachment_id) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\DeleteDealProduct, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function deleteDealProductWithHttpInfo($id, $product_attachment_id) { @@ -2388,6 +2405,7 @@ public function deleteDealProductWithHttpInfo($id, $product_attachment_id) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteDealProductAsync($id, $product_attachment_id): PromiseInterface { @@ -2409,6 +2427,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteDealProductAsyncWithHttpInfo($id, $product_attachment_id): PromiseInterface { @@ -2457,6 +2476,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function deleteDealProductRequest($id, $product_attachment_id): Request { @@ -2584,6 +2604,7 @@ public function deleteDealProductRequest($id, $product_attachment_id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\DeleteMultipleDeals + * @deprecated */ public function deleteDeals($ids) { @@ -2601,6 +2622,7 @@ public function deleteDeals($ids) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\DeleteMultipleDeals, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function deleteDealsWithHttpInfo($ids) { @@ -2701,6 +2723,7 @@ public function deleteDealsWithHttpInfo($ids) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteDealsAsync($ids): PromiseInterface { @@ -2721,6 +2744,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteDealsAsyncWithHttpInfo($ids): PromiseInterface { @@ -2768,6 +2792,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function deleteDealsRequest($ids): Request { @@ -3166,6 +3191,1215 @@ public function duplicateDealRequest($id): Request ); } + /** + * Operation getArchivedDeals + * + * Get all archived deals + * + * @param int|null $user_id If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param int|null $person_id If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $org_id If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $product_id If supplied, only deals linked to the specified product are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $pipeline_id If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $stage_id If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $owned_by_you When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\versions\v1\Model\GetDeals + * @deprecated + */ + public function getArchivedDeals($user_id = null, $filter_id = null, $person_id = null, $org_id = null, $product_id = null, $pipeline_id = null, $stage_id = null, $status = 'all_not_deleted', $start = 0, $limit = null, $sort = null, $owned_by_you = null) + { + list($response) = $this->getArchivedDealsWithHttpInfo($user_id, $filter_id, $person_id, $org_id, $product_id, $pipeline_id, $stage_id, $status, $start, $limit, $sort, $owned_by_you); + return $response; + } + + /** + * Operation getArchivedDealsWithHttpInfo + * + * Get all archived deals + * + * @param int|null $user_id If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param int|null $person_id If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $org_id If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $product_id If supplied, only deals linked to the specified product are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $pipeline_id If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $stage_id If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $owned_by_you When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\versions\v1\Model\GetDeals, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getArchivedDealsWithHttpInfo($user_id = null, $filter_id = null, $person_id = null, $org_id = null, $product_id = null, $pipeline_id = null, $stage_id = null, $status = 'all_not_deleted', $start = 0, $limit = null, $sort = null, $owned_by_you = null) + { + $request = $this->getArchivedDealsRequest($user_id, $filter_id, $person_id, $org_id, $product_id, $pipeline_id, $stage_id, $status, $start, $limit, $sort, $owned_by_you); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getArchivedDealsRequest($user_id, $filter_id, $person_id, $org_id, $product_id, $pipeline_id, $stage_id, $status, $start, $limit, $sort, $owned_by_you); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v1\Model\GetDeals' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\GetDeals', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v1\Model\GetDeals' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\GetDeals', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v1\Model\GetDeals', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getArchivedDealsAsync + * + * Get all archived deals + * + * @param int|null $user_id If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param int|null $person_id If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $org_id If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $product_id If supplied, only deals linked to the specified product are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $pipeline_id If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $stage_id If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $owned_by_you When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function getArchivedDealsAsync($user_id = null, $filter_id = null, $person_id = null, $org_id = null, $product_id = null, $pipeline_id = null, $stage_id = null, $status = 'all_not_deleted', $start = 0, $limit = null, $sort = null, $owned_by_you = null): PromiseInterface + { + return $this->getArchivedDealsAsyncWithHttpInfo($user_id, $filter_id, $person_id, $org_id, $product_id, $pipeline_id, $stage_id, $status, $start, $limit, $sort, $owned_by_you) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getArchivedDealsAsyncWithHttpInfo + * + * Get all archived deals + * + * @param int|null $user_id If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param int|null $person_id If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $org_id If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $product_id If supplied, only deals linked to the specified product are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $pipeline_id If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $stage_id If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $owned_by_you When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function getArchivedDealsAsyncWithHttpInfo($user_id = null, $filter_id = null, $person_id = null, $org_id = null, $product_id = null, $pipeline_id = null, $stage_id = null, $status = 'all_not_deleted', $start = 0, $limit = null, $sort = null, $owned_by_you = null): PromiseInterface + { + $returnType = '\Pipedrive\versions\v1\Model\GetDeals'; + $request = $this->getArchivedDealsRequest($user_id, $filter_id, $person_id, $org_id, $product_id, $pipeline_id, $stage_id, $status, $start, $limit, $sort, $owned_by_you); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getArchivedDeals' + * + * @param int|null $user_id If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param int|null $person_id If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $org_id If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $product_id If supplied, only deals linked to the specified product are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $pipeline_id If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $stage_id If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $owned_by_you When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + * @deprecated + */ + public function getArchivedDealsRequest($user_id = null, $filter_id = null, $person_id = null, $org_id = null, $product_id = null, $pipeline_id = null, $stage_id = null, $status = 'all_not_deleted', $start = 0, $limit = null, $sort = null, $owned_by_you = null): Request + { + + $resourcePath = '/deals/archived'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($filter_id)) { + $filter_id = ObjectSerializer::serializeCollection($filter_id, '', true); + } + if ($filter_id !== null) { + $queryParams['filter_id'] = $filter_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($person_id)) { + $person_id = ObjectSerializer::serializeCollection($person_id, '', true); + } + if ($person_id !== null) { + $queryParams['person_id'] = $person_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($org_id)) { + $org_id = ObjectSerializer::serializeCollection($org_id, '', true); + } + if ($org_id !== null) { + $queryParams['org_id'] = $org_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($product_id)) { + $product_id = ObjectSerializer::serializeCollection($product_id, '', true); + } + if ($product_id !== null) { + $queryParams['product_id'] = $product_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($pipeline_id)) { + $pipeline_id = ObjectSerializer::serializeCollection($pipeline_id, '', true); + } + if ($pipeline_id !== null) { + $queryParams['pipeline_id'] = $pipeline_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($stage_id)) { + $stage_id = ObjectSerializer::serializeCollection($stage_id, '', true); + } + if ($stage_id !== null) { + $queryParams['stage_id'] = $stage_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($status)) { + $status = ObjectSerializer::serializeCollection($status, '', true); + } + if ($status !== null) { + $queryParams['status'] = $status; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($owned_by_you)) { + $owned_by_you = ObjectSerializer::serializeCollection($owned_by_you, '', true); + } + if ($owned_by_you !== null) { + $queryParams['owned_by_you'] = $owned_by_you; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getArchivedDealsSummary + * + * Get archived deals summary + * + * @param string|null $status Only fetch deals with a specific status. open = Open, won = Won, lost = Lost. (optional) + * @param int|null $filter_id <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. (optional) + * @param int|null $user_id Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. (optional) + * @param int|null $pipeline_id Only deals within the given pipeline will be returned (optional) + * @param int|null $stage_id Only deals within the given stage will be returned (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\versions\v1\Model\GetDealsSummary + * @deprecated + */ + public function getArchivedDealsSummary($status = null, $filter_id = null, $user_id = null, $pipeline_id = null, $stage_id = null) + { + list($response) = $this->getArchivedDealsSummaryWithHttpInfo($status, $filter_id, $user_id, $pipeline_id, $stage_id); + return $response; + } + + /** + * Operation getArchivedDealsSummaryWithHttpInfo + * + * Get archived deals summary + * + * @param string|null $status Only fetch deals with a specific status. open = Open, won = Won, lost = Lost. (optional) + * @param int|null $filter_id <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. (optional) + * @param int|null $user_id Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. (optional) + * @param int|null $pipeline_id Only deals within the given pipeline will be returned (optional) + * @param int|null $stage_id Only deals within the given stage will be returned (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\versions\v1\Model\GetDealsSummary, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getArchivedDealsSummaryWithHttpInfo($status = null, $filter_id = null, $user_id = null, $pipeline_id = null, $stage_id = null) + { + $request = $this->getArchivedDealsSummaryRequest($status, $filter_id, $user_id, $pipeline_id, $stage_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getArchivedDealsSummaryRequest($status, $filter_id, $user_id, $pipeline_id, $stage_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v1\Model\GetDealsSummary' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\GetDealsSummary', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v1\Model\GetDealsSummary' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\GetDealsSummary', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v1\Model\GetDealsSummary', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getArchivedDealsSummaryAsync + * + * Get archived deals summary + * + * @param string|null $status Only fetch deals with a specific status. open = Open, won = Won, lost = Lost. (optional) + * @param int|null $filter_id <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. (optional) + * @param int|null $user_id Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. (optional) + * @param int|null $pipeline_id Only deals within the given pipeline will be returned (optional) + * @param int|null $stage_id Only deals within the given stage will be returned (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function getArchivedDealsSummaryAsync($status = null, $filter_id = null, $user_id = null, $pipeline_id = null, $stage_id = null): PromiseInterface + { + return $this->getArchivedDealsSummaryAsyncWithHttpInfo($status, $filter_id, $user_id, $pipeline_id, $stage_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getArchivedDealsSummaryAsyncWithHttpInfo + * + * Get archived deals summary + * + * @param string|null $status Only fetch deals with a specific status. open = Open, won = Won, lost = Lost. (optional) + * @param int|null $filter_id <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. (optional) + * @param int|null $user_id Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. (optional) + * @param int|null $pipeline_id Only deals within the given pipeline will be returned (optional) + * @param int|null $stage_id Only deals within the given stage will be returned (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function getArchivedDealsSummaryAsyncWithHttpInfo($status = null, $filter_id = null, $user_id = null, $pipeline_id = null, $stage_id = null): PromiseInterface + { + $returnType = '\Pipedrive\versions\v1\Model\GetDealsSummary'; + $request = $this->getArchivedDealsSummaryRequest($status, $filter_id, $user_id, $pipeline_id, $stage_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getArchivedDealsSummary' + * + * @param string|null $status Only fetch deals with a specific status. open = Open, won = Won, lost = Lost. (optional) + * @param int|null $filter_id <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. (optional) + * @param int|null $user_id Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. (optional) + * @param int|null $pipeline_id Only deals within the given pipeline will be returned (optional) + * @param int|null $stage_id Only deals within the given stage will be returned (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + * @deprecated + */ + public function getArchivedDealsSummaryRequest($status = null, $filter_id = null, $user_id = null, $pipeline_id = null, $stage_id = null): Request + { + + $resourcePath = '/deals/summary/archived'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($status)) { + $status = ObjectSerializer::serializeCollection($status, '', true); + } + if ($status !== null) { + $queryParams['status'] = $status; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($filter_id)) { + $filter_id = ObjectSerializer::serializeCollection($filter_id, '', true); + } + if ($filter_id !== null) { + $queryParams['filter_id'] = $filter_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($pipeline_id)) { + $pipeline_id = ObjectSerializer::serializeCollection($pipeline_id, '', true); + } + if ($pipeline_id !== null) { + $queryParams['pipeline_id'] = $pipeline_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($stage_id)) { + $stage_id = ObjectSerializer::serializeCollection($stage_id, '', true); + } + if ($stage_id !== null) { + $queryParams['stage_id'] = $stage_id; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getArchivedDealsTimeline + * + * Get archived deals timeline + * + * @param \DateTime $start_date The date when the first interval starts. Format: YYYY-MM-DD. (required) + * @param string $interval The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table> (required) + * @param int $amount The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). (required) + * @param string $field_key The date field key which deals will be retrieved from (required) + * @param int|null $user_id If supplied, only deals matching the given user will be returned (optional) + * @param int|null $pipeline_id If supplied, only deals matching the given pipeline will be returned (optional) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $exclude_deals Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. (optional) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\versions\v1\Model\GetDealsTimeline + * @deprecated + */ + public function getArchivedDealsTimeline($start_date, $interval, $amount, $field_key, $user_id = null, $pipeline_id = null, $filter_id = null, $exclude_deals = null, $totals_convert_currency = null) + { + list($response) = $this->getArchivedDealsTimelineWithHttpInfo($start_date, $interval, $amount, $field_key, $user_id, $pipeline_id, $filter_id, $exclude_deals, $totals_convert_currency); + return $response; + } + + /** + * Operation getArchivedDealsTimelineWithHttpInfo + * + * Get archived deals timeline + * + * @param \DateTime $start_date The date when the first interval starts. Format: YYYY-MM-DD. (required) + * @param string $interval The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table> (required) + * @param int $amount The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). (required) + * @param string $field_key The date field key which deals will be retrieved from (required) + * @param int|null $user_id If supplied, only deals matching the given user will be returned (optional) + * @param int|null $pipeline_id If supplied, only deals matching the given pipeline will be returned (optional) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $exclude_deals Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. (optional) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\versions\v1\Model\GetDealsTimeline, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getArchivedDealsTimelineWithHttpInfo($start_date, $interval, $amount, $field_key, $user_id = null, $pipeline_id = null, $filter_id = null, $exclude_deals = null, $totals_convert_currency = null) + { + $request = $this->getArchivedDealsTimelineRequest($start_date, $interval, $amount, $field_key, $user_id, $pipeline_id, $filter_id, $exclude_deals, $totals_convert_currency); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getArchivedDealsTimelineRequest($start_date, $interval, $amount, $field_key, $user_id, $pipeline_id, $filter_id, $exclude_deals, $totals_convert_currency); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v1\Model\GetDealsTimeline' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\GetDealsTimeline', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v1\Model\GetDealsTimeline' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\GetDealsTimeline', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v1\Model\GetDealsTimeline', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getArchivedDealsTimelineAsync + * + * Get archived deals timeline + * + * @param \DateTime $start_date The date when the first interval starts. Format: YYYY-MM-DD. (required) + * @param string $interval The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table> (required) + * @param int $amount The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). (required) + * @param string $field_key The date field key which deals will be retrieved from (required) + * @param int|null $user_id If supplied, only deals matching the given user will be returned (optional) + * @param int|null $pipeline_id If supplied, only deals matching the given pipeline will be returned (optional) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $exclude_deals Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. (optional) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function getArchivedDealsTimelineAsync($start_date, $interval, $amount, $field_key, $user_id = null, $pipeline_id = null, $filter_id = null, $exclude_deals = null, $totals_convert_currency = null): PromiseInterface + { + return $this->getArchivedDealsTimelineAsyncWithHttpInfo($start_date, $interval, $amount, $field_key, $user_id, $pipeline_id, $filter_id, $exclude_deals, $totals_convert_currency) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getArchivedDealsTimelineAsyncWithHttpInfo + * + * Get archived deals timeline + * + * @param \DateTime $start_date The date when the first interval starts. Format: YYYY-MM-DD. (required) + * @param string $interval The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table> (required) + * @param int $amount The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). (required) + * @param string $field_key The date field key which deals will be retrieved from (required) + * @param int|null $user_id If supplied, only deals matching the given user will be returned (optional) + * @param int|null $pipeline_id If supplied, only deals matching the given pipeline will be returned (optional) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $exclude_deals Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. (optional) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function getArchivedDealsTimelineAsyncWithHttpInfo($start_date, $interval, $amount, $field_key, $user_id = null, $pipeline_id = null, $filter_id = null, $exclude_deals = null, $totals_convert_currency = null): PromiseInterface + { + $returnType = '\Pipedrive\versions\v1\Model\GetDealsTimeline'; + $request = $this->getArchivedDealsTimelineRequest($start_date, $interval, $amount, $field_key, $user_id, $pipeline_id, $filter_id, $exclude_deals, $totals_convert_currency); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getArchivedDealsTimeline' + * + * @param \DateTime $start_date The date when the first interval starts. Format: YYYY-MM-DD. (required) + * @param string $interval The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table> (required) + * @param int $amount The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). (required) + * @param string $field_key The date field key which deals will be retrieved from (required) + * @param int|null $user_id If supplied, only deals matching the given user will be returned (optional) + * @param int|null $pipeline_id If supplied, only deals matching the given pipeline will be returned (optional) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $exclude_deals Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. (optional) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + * @deprecated + */ + public function getArchivedDealsTimelineRequest($start_date, $interval, $amount, $field_key, $user_id = null, $pipeline_id = null, $filter_id = null, $exclude_deals = null, $totals_convert_currency = null): Request + { + // verify the required parameter 'start_date' is set + /* @phpstan-ignore-next-line */ + if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $start_date when calling getArchivedDealsTimeline' + ); + } + // verify the required parameter 'interval' is set + /* @phpstan-ignore-next-line */ + if ($interval === null || (is_array($interval) && count($interval) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $interval when calling getArchivedDealsTimeline' + ); + } + // verify the required parameter 'amount' is set + /* @phpstan-ignore-next-line */ + if ($amount === null || (is_array($amount) && count($amount) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $amount when calling getArchivedDealsTimeline' + ); + } + // verify the required parameter 'field_key' is set + /* @phpstan-ignore-next-line */ + if ($field_key === null || (is_array($field_key) && count($field_key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $field_key when calling getArchivedDealsTimeline' + ); + } + + $resourcePath = '/deals/timeline/archived'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start_date)) { + $start_date = ObjectSerializer::serializeCollection($start_date, '', true); + } + if ($start_date !== null) { + $queryParams['start_date'] = $start_date; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($interval)) { + $interval = ObjectSerializer::serializeCollection($interval, '', true); + } + if ($interval !== null) { + $queryParams['interval'] = $interval; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($amount)) { + $amount = ObjectSerializer::serializeCollection($amount, '', true); + } + if ($amount !== null) { + $queryParams['amount'] = $amount; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($field_key)) { + $field_key = ObjectSerializer::serializeCollection($field_key, '', true); + } + if ($field_key !== null) { + $queryParams['field_key'] = $field_key; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($pipeline_id)) { + $pipeline_id = ObjectSerializer::serializeCollection($pipeline_id, '', true); + } + if ($pipeline_id !== null) { + $queryParams['pipeline_id'] = $pipeline_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($filter_id)) { + $filter_id = ObjectSerializer::serializeCollection($filter_id, '', true); + } + if ($filter_id !== null) { + $queryParams['filter_id'] = $filter_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($exclude_deals)) { + $exclude_deals = ObjectSerializer::serializeCollection($exclude_deals, '', true); + } + if ($exclude_deals !== null) { + $queryParams['exclude_deals'] = $exclude_deals; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($totals_convert_currency)) { + $totals_convert_currency = ObjectSerializer::serializeCollection($totals_convert_currency, '', true); + } + if ($totals_convert_currency !== null) { + $queryParams['totals_convert_currency'] = $totals_convert_currency; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation getDeal * @@ -3176,6 +4410,7 @@ public function duplicateDealRequest($id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetDeal + * @deprecated */ public function getDeal($id) { @@ -3193,6 +4428,7 @@ public function getDeal($id) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetDeal, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getDealWithHttpInfo($id) { @@ -3293,6 +4529,7 @@ public function getDealWithHttpInfo($id) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getDealAsync($id): PromiseInterface { @@ -3313,6 +4550,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getDealAsyncWithHttpInfo($id): PromiseInterface { @@ -3360,6 +4598,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getDealRequest($id): Request { @@ -3476,6 +4715,7 @@ public function getDealRequest($id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\DealListActivitiesResponse + * @deprecated */ public function getDealActivities($id, $start = 0, $limit = null, $done = null, $exclude = null) { @@ -3497,6 +4737,7 @@ public function getDealActivities($id, $start = 0, $limit = null, $done = null, * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\DealListActivitiesResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getDealActivitiesWithHttpInfo($id, $start = 0, $limit = null, $done = null, $exclude = null) { @@ -3601,6 +4842,7 @@ public function getDealActivitiesWithHttpInfo($id, $start = 0, $limit = null, $d * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getDealActivitiesAsync($id, $start = 0, $limit = null, $done = null, $exclude = null): PromiseInterface { @@ -3625,6 +4867,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getDealActivitiesAsyncWithHttpInfo($id, $start = 0, $limit = null, $done = null, $exclude = null): PromiseInterface { @@ -3676,6 +4919,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getDealActivitiesRequest($id, $start = 0, $limit = null, $done = null, $exclude = null): Request { @@ -5745,6 +6989,7 @@ public function getDealParticipantsChangelogRequest($id, $limit = null, $cursor * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ListPersonsResponse + * @deprecated */ public function getDealPersons($id, $start = 0, $limit = null) { @@ -5764,6 +7009,7 @@ public function getDealPersons($id, $start = 0, $limit = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ListPersonsResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getDealPersonsWithHttpInfo($id, $start = 0, $limit = null) { @@ -5866,6 +7112,7 @@ public function getDealPersonsWithHttpInfo($id, $start = 0, $limit = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getDealPersonsAsync($id, $start = 0, $limit = null): PromiseInterface { @@ -5888,6 +7135,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getDealPersonsAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface { @@ -5937,6 +7185,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getDealPersonsRequest($id, $start = 0, $limit = null): Request { @@ -6068,6 +7317,7 @@ public function getDealPersonsRequest($id, $start = 0, $limit = null): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ListProductsResponse + * @deprecated */ public function getDealProducts($id, $start = 0, $limit = null, $include_product_data = null) { @@ -6088,6 +7338,7 @@ public function getDealProducts($id, $start = 0, $limit = null, $include_product * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ListProductsResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getDealProductsWithHttpInfo($id, $start = 0, $limit = null, $include_product_data = null) { @@ -6191,6 +7442,7 @@ public function getDealProductsWithHttpInfo($id, $start = 0, $limit = null, $inc * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getDealProductsAsync($id, $start = 0, $limit = null, $include_product_data = null): PromiseInterface { @@ -6214,6 +7466,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getDealProductsAsyncWithHttpInfo($id, $start = 0, $limit = null, $include_product_data = null): PromiseInterface { @@ -6264,6 +7517,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getDealProductsRequest($id, $start = 0, $limit = null, $include_product_data = null): Request { @@ -7051,6 +8305,7 @@ public function getDealUsersRequest($id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetDeals + * @deprecated */ public function getDeals($user_id = null, $filter_id = null, $stage_id = null, $status = 'all_not_deleted', $start = 0, $limit = null, $sort = null, $owned_by_you = null) { @@ -7075,6 +8330,7 @@ public function getDeals($user_id = null, $filter_id = null, $stage_id = null, $ * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetDeals, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getDealsWithHttpInfo($user_id = null, $filter_id = null, $stage_id = null, $status = 'all_not_deleted', $start = 0, $limit = null, $sort = null, $owned_by_you = null) { @@ -7182,6 +8438,7 @@ public function getDealsWithHttpInfo($user_id = null, $filter_id = null, $stage_ * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getDealsAsync($user_id = null, $filter_id = null, $stage_id = null, $status = 'all_not_deleted', $start = 0, $limit = null, $sort = null, $owned_by_you = null): PromiseInterface { @@ -7209,6 +8466,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getDealsAsyncWithHttpInfo($user_id = null, $filter_id = null, $stage_id = null, $status = 'all_not_deleted', $start = 0, $limit = null, $sort = null, $owned_by_you = null): PromiseInterface { @@ -7263,6 +8521,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getDealsRequest($user_id = null, $filter_id = null, $stage_id = null, $status = 'all_not_deleted', $start = 0, $limit = null, $sort = null, $owned_by_you = null): Request { @@ -7417,7 +8676,7 @@ public function getDealsRequest($user_id = null, $filter_id = null, $stage_id = /** * Operation getDealsCollection * - * Get all deals (BETA) + * Get all deals collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -7430,6 +8689,7 @@ public function getDealsRequest($user_id = null, $filter_id = null, $stage_id = * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetDealsCollection|\Pipedrive\versions\v1\Model\FailResponse + * @deprecated */ public function getDealsCollection($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $stage_id = null, $status = null) { @@ -7440,7 +8700,7 @@ public function getDealsCollection($cursor = null, $limit = null, $since = null, /** * Operation getDealsCollectionWithHttpInfo * - * Get all deals (BETA) + * Get all deals collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -7453,6 +8713,7 @@ public function getDealsCollection($cursor = null, $limit = null, $since = null, * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetDealsCollection|\Pipedrive\versions\v1\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getDealsCollectionWithHttpInfo($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $stage_id = null, $status = null) { @@ -7568,7 +8829,7 @@ public function getDealsCollectionWithHttpInfo($cursor = null, $limit = null, $s /** * Operation getDealsCollectionAsync * - * Get all deals (BETA) + * Get all deals collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -7580,6 +8841,7 @@ public function getDealsCollectionWithHttpInfo($cursor = null, $limit = null, $s * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getDealsCollectionAsync($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $stage_id = null, $status = null): PromiseInterface { @@ -7594,7 +8856,7 @@ function ($response) { /** * Operation getDealsCollectionAsyncWithHttpInfo * - * Get all deals (BETA) + * Get all deals collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -7606,6 +8868,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getDealsCollectionAsyncWithHttpInfo($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $stage_id = null, $status = null): PromiseInterface { @@ -7659,6 +8922,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getDealsCollectionRequest($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $stage_id = null, $status = null): Request { @@ -8889,6 +10153,7 @@ public function mergeDealsRequest($id, $merge_deals_request = null): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\DealSearchResponse + * @deprecated */ public function searchDeals($term, $fields = null, $exact_match = null, $person_id = null, $organization_id = null, $status = null, $include_fields = null, $start = 0, $limit = null) { @@ -8914,6 +10179,7 @@ public function searchDeals($term, $fields = null, $exact_match = null, $person_ * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\DealSearchResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function searchDealsWithHttpInfo($term, $fields = null, $exact_match = null, $person_id = null, $organization_id = null, $status = null, $include_fields = null, $start = 0, $limit = null) { @@ -9022,6 +10288,7 @@ public function searchDealsWithHttpInfo($term, $fields = null, $exact_match = nu * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function searchDealsAsync($term, $fields = null, $exact_match = null, $person_id = null, $organization_id = null, $status = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface { @@ -9050,6 +10317,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function searchDealsAsyncWithHttpInfo($term, $fields = null, $exact_match = null, $person_id = null, $organization_id = null, $status = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface { @@ -9105,6 +10373,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function searchDealsRequest($term, $fields = null, $exact_match = null, $person_id = null, $organization_id = null, $status = null, $include_fields = null, $start = 0, $limit = null): Request { @@ -9282,6 +10551,7 @@ public function searchDealsRequest($term, $fields = null, $exact_match = null, $ * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetAddedDeal + * @deprecated */ public function updateDeal($id, $update_deal_request = null) { @@ -9300,6 +10570,7 @@ public function updateDeal($id, $update_deal_request = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetAddedDeal, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function updateDealWithHttpInfo($id, $update_deal_request = null) { @@ -9401,6 +10672,7 @@ public function updateDealWithHttpInfo($id, $update_deal_request = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function updateDealAsync($id, $update_deal_request = null): PromiseInterface { @@ -9422,6 +10694,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function updateDealAsyncWithHttpInfo($id, $update_deal_request = null): PromiseInterface { @@ -9470,6 +10743,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function updateDealRequest($id, $update_deal_request = null): Request { @@ -9590,6 +10864,7 @@ public function updateDealRequest($id, $update_deal_request = null): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetProductAttachmentDetails + * @deprecated */ public function updateDealProduct($id, $product_attachment_id, $update_deal_product = null) { @@ -9609,6 +10884,7 @@ public function updateDealProduct($id, $product_attachment_id, $update_deal_prod * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetProductAttachmentDetails, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function updateDealProductWithHttpInfo($id, $product_attachment_id, $update_deal_product = null) { @@ -9711,6 +10987,7 @@ public function updateDealProductWithHttpInfo($id, $product_attachment_id, $upda * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function updateDealProductAsync($id, $product_attachment_id, $update_deal_product = null): PromiseInterface { @@ -9733,6 +11010,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function updateDealProductAsyncWithHttpInfo($id, $product_attachment_id, $update_deal_product = null): PromiseInterface { @@ -9782,6 +11060,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function updateDealProductRequest($id, $product_attachment_id, $update_deal_product = null): Request { diff --git a/lib/versions/v1/Api/ItemSearchApi.php b/lib/versions/v1/Api/ItemSearchApi.php index 0539448..c9d1058 100644 --- a/lib/versions/v1/Api/ItemSearchApi.php +++ b/lib/versions/v1/Api/ItemSearchApi.php @@ -139,6 +139,7 @@ public function getConfig(): Configuration * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ItemSearchResponse + * @deprecated */ public function searchItem($term, $item_types = null, $fields = null, $search_for_related_items = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null) { @@ -163,6 +164,7 @@ public function searchItem($term, $item_types = null, $fields = null, $search_fo * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ItemSearchResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function searchItemWithHttpInfo($term, $item_types = null, $fields = null, $search_for_related_items = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null) { @@ -270,6 +272,7 @@ public function searchItemWithHttpInfo($term, $item_types = null, $fields = null * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function searchItemAsync($term, $item_types = null, $fields = null, $search_for_related_items = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface { @@ -297,6 +300,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function searchItemAsyncWithHttpInfo($term, $item_types = null, $fields = null, $search_for_related_items = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface { @@ -351,6 +355,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function searchItemRequest($term, $item_types = null, $fields = null, $search_for_related_items = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null): Request { @@ -525,6 +530,7 @@ public function searchItemRequest($term, $item_types = null, $fields = null, $se * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ItemSearchFieldResponse + * @deprecated */ public function searchItemByField($term, $field_type, $field_key, $exact_match = false, $return_item_ids = null, $start = null, $limit = null) { @@ -548,6 +554,7 @@ public function searchItemByField($term, $field_type, $field_key, $exact_match = * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ItemSearchFieldResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function searchItemByFieldWithHttpInfo($term, $field_type, $field_key, $exact_match = false, $return_item_ids = null, $start = null, $limit = null) { @@ -654,6 +661,7 @@ public function searchItemByFieldWithHttpInfo($term, $field_type, $field_key, $e * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function searchItemByFieldAsync($term, $field_type, $field_key, $exact_match = false, $return_item_ids = null, $start = null, $limit = null): PromiseInterface { @@ -680,6 +688,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function searchItemByFieldAsyncWithHttpInfo($term, $field_type, $field_key, $exact_match = false, $return_item_ids = null, $start = null, $limit = null): PromiseInterface { @@ -733,6 +742,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function searchItemByFieldRequest($term, $field_type, $field_key, $exact_match = false, $return_item_ids = null, $start = null, $limit = null): Request { diff --git a/lib/versions/v1/Api/LeadsApi.php b/lib/versions/v1/Api/LeadsApi.php index 7f73c55..7c6b645 100644 --- a/lib/versions/v1/Api/LeadsApi.php +++ b/lib/versions/v1/Api/LeadsApi.php @@ -726,6 +726,373 @@ public function deleteLeadRequest($id): Request ); } + /** + * Operation getArchivedLeads + * + * Get all archived leads + * + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) + * @param int|null $start For pagination, the position that represents the first result for the page (optional) + * @param int|null $owner_id If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. (optional) + * @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional) + * @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\versions\v1\Model\GetLeadsResponse + */ + public function getArchivedLeads($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null) + { + list($response) = $this->getArchivedLeadsWithHttpInfo($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort); + return $response; + } + + /** + * Operation getArchivedLeadsWithHttpInfo + * + * Get all archived leads + * + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) + * @param int|null $start For pagination, the position that represents the first result for the page (optional) + * @param int|null $owner_id If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. (optional) + * @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional) + * @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\versions\v1\Model\GetLeadsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getArchivedLeadsWithHttpInfo($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null) + { + $request = $this->getArchivedLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getArchivedLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v1\Model\GetLeadsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\GetLeadsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v1\Model\GetLeadsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\GetLeadsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v1\Model\GetLeadsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getArchivedLeadsAsync + * + * Get all archived leads + * + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) + * @param int|null $start For pagination, the position that represents the first result for the page (optional) + * @param int|null $owner_id If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. (optional) + * @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional) + * @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getArchivedLeadsAsync($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): PromiseInterface + { + return $this->getArchivedLeadsAsyncWithHttpInfo($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getArchivedLeadsAsyncWithHttpInfo + * + * Get all archived leads + * + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) + * @param int|null $start For pagination, the position that represents the first result for the page (optional) + * @param int|null $owner_id If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. (optional) + * @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional) + * @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getArchivedLeadsAsyncWithHttpInfo($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): PromiseInterface + { + $returnType = '\Pipedrive\versions\v1\Model\GetLeadsResponse'; + $request = $this->getArchivedLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getArchivedLeads' + * + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) + * @param int|null $start For pagination, the position that represents the first result for the page (optional) + * @param int|null $owner_id If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. (optional) + * @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional) + * @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getArchivedLeadsRequest($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): Request + { + + $resourcePath = '/leads/archived'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($owner_id)) { + $owner_id = ObjectSerializer::serializeCollection($owner_id, '', true); + } + if ($owner_id !== null) { + $queryParams['owner_id'] = $owner_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($person_id)) { + $person_id = ObjectSerializer::serializeCollection($person_id, '', true); + } + if ($person_id !== null) { + $queryParams['person_id'] = $person_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($organization_id)) { + $organization_id = ObjectSerializer::serializeCollection($organization_id, '', true); + } + if ($organization_id !== null) { + $queryParams['organization_id'] = $organization_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($filter_id)) { + $filter_id = ObjectSerializer::serializeCollection($filter_id, '', true); + } + if ($filter_id !== null) { + $queryParams['filter_id'] = $filter_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation getLead * @@ -1346,7 +1713,6 @@ public function getLeadUsersRequest($id): Request * * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) * @param int|null $start For pagination, the position that represents the first result for the page (optional) - * @param string|null $archived_status Filtering based on the archived status of a lead. If not provided, `All` is used. (optional) * @param int|null $owner_id If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. (optional) * @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional) * @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional) @@ -1357,9 +1723,9 @@ public function getLeadUsersRequest($id): Request * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetLeadsResponse */ - public function getLeads($limit = null, $start = null, $archived_status = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null) + public function getLeads($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null) { - list($response) = $this->getLeadsWithHttpInfo($limit, $start, $archived_status, $owner_id, $person_id, $organization_id, $filter_id, $sort); + list($response) = $this->getLeadsWithHttpInfo($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort); return $response; } @@ -1370,7 +1736,6 @@ public function getLeads($limit = null, $start = null, $archived_status = null, * * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) * @param int|null $start For pagination, the position that represents the first result for the page (optional) - * @param string|null $archived_status Filtering based on the archived status of a lead. If not provided, `All` is used. (optional) * @param int|null $owner_id If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. (optional) * @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional) * @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional) @@ -1381,9 +1746,9 @@ public function getLeads($limit = null, $start = null, $archived_status = null, * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetLeadsResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getLeadsWithHttpInfo($limit = null, $start = null, $archived_status = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null) + public function getLeadsWithHttpInfo($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null) { - $request = $this->getLeadsRequest($limit, $start, $archived_status, $owner_id, $person_id, $organization_id, $filter_id, $sort); + $request = $this->getLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort); try { $options = $this->createHttpClientOption(); @@ -1392,7 +1757,7 @@ public function getLeadsWithHttpInfo($limit = null, $start = null, $archived_sta } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->getLeadsRequest($limit, $start, $archived_status, $owner_id, $person_id, $organization_id, $filter_id, $sort); + $request = $this->getLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -1478,7 +1843,6 @@ public function getLeadsWithHttpInfo($limit = null, $start = null, $archived_sta * * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) * @param int|null $start For pagination, the position that represents the first result for the page (optional) - * @param string|null $archived_status Filtering based on the archived status of a lead. If not provided, `All` is used. (optional) * @param int|null $owner_id If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. (optional) * @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional) * @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional) @@ -1488,9 +1852,9 @@ public function getLeadsWithHttpInfo($limit = null, $start = null, $archived_sta * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getLeadsAsync($limit = null, $start = null, $archived_status = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): PromiseInterface + public function getLeadsAsync($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): PromiseInterface { - return $this->getLeadsAsyncWithHttpInfo($limit, $start, $archived_status, $owner_id, $person_id, $organization_id, $filter_id, $sort) + return $this->getLeadsAsyncWithHttpInfo($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort) ->then( function ($response) { return $response[0]; @@ -1505,7 +1869,6 @@ function ($response) { * * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) * @param int|null $start For pagination, the position that represents the first result for the page (optional) - * @param string|null $archived_status Filtering based on the archived status of a lead. If not provided, `All` is used. (optional) * @param int|null $owner_id If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. (optional) * @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional) * @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional) @@ -1515,10 +1878,10 @@ function ($response) { * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getLeadsAsyncWithHttpInfo($limit = null, $start = null, $archived_status = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): PromiseInterface + public function getLeadsAsyncWithHttpInfo($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): PromiseInterface { $returnType = '\Pipedrive\versions\v1\Model\GetLeadsResponse'; - $request = $this->getLeadsRequest($limit, $start, $archived_status, $owner_id, $person_id, $organization_id, $filter_id, $sort); + $request = $this->getLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1559,7 +1922,6 @@ function ($exception) { * * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) * @param int|null $start For pagination, the position that represents the first result for the page (optional) - * @param string|null $archived_status Filtering based on the archived status of a lead. If not provided, `All` is used. (optional) * @param int|null $owner_id If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. (optional) * @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional) * @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional) @@ -1569,7 +1931,7 @@ function ($exception) { * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function getLeadsRequest($limit = null, $start = null, $archived_status = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): Request + public function getLeadsRequest($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): Request { $resourcePath = '/leads'; @@ -1597,14 +1959,6 @@ public function getLeadsRequest($limit = null, $start = null, $archived_status = } // query params /* @phpstan-ignore-next-line */ - if (is_array($archived_status)) { - $archived_status = ObjectSerializer::serializeCollection($archived_status, '', true); - } - if ($archived_status !== null) { - $queryParams['archived_status'] = $archived_status; - } - // query params - /* @phpstan-ignore-next-line */ if (is_array($owner_id)) { $owner_id = ObjectSerializer::serializeCollection($owner_id, '', true); } diff --git a/lib/versions/v1/Api/NotesApi.php b/lib/versions/v1/Api/NotesApi.php index f67400b..a0a9de3 100644 --- a/lib/versions/v1/Api/NotesApi.php +++ b/lib/versions/v1/Api/NotesApi.php @@ -2272,6 +2272,7 @@ public function getNoteCommentsRequest($id, $start = 0, $limit = null): Request * @param int|null $deal_id The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. (optional) * @param int|null $person_id The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. (optional) * @param int|null $org_id The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. (optional) + * @param int|null $project_id The ID of the project which notes to fetch. If omitted, notes about all projects will be returned. (optional) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. (optional) @@ -2281,14 +2282,15 @@ public function getNoteCommentsRequest($id, $start = 0, $limit = null): Request * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_deal_flag If set, the results are filtered by note to deal pinning state (optional) * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_organization_flag If set, the results are filtered by note to organization pinning state (optional) * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_person_flag If set, the results are filtered by note to person pinning state (optional) + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_project_flag If set, the results are filtered by note to project pinning state (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetNotes */ - public function getNotes($user_id = null, $lead_id = null, $deal_id = null, $person_id = null, $org_id = null, $start = 0, $limit = null, $sort = null, $start_date = null, $end_date = null, $pinned_to_lead_flag = null, $pinned_to_deal_flag = null, $pinned_to_organization_flag = null, $pinned_to_person_flag = null) + public function getNotes($user_id = null, $lead_id = null, $deal_id = null, $person_id = null, $org_id = null, $project_id = null, $start = 0, $limit = null, $sort = null, $start_date = null, $end_date = null, $pinned_to_lead_flag = null, $pinned_to_deal_flag = null, $pinned_to_organization_flag = null, $pinned_to_person_flag = null, $pinned_to_project_flag = null) { - list($response) = $this->getNotesWithHttpInfo($user_id, $lead_id, $deal_id, $person_id, $org_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag); + list($response) = $this->getNotesWithHttpInfo($user_id, $lead_id, $deal_id, $person_id, $org_id, $project_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag, $pinned_to_project_flag); return $response; } @@ -2302,6 +2304,7 @@ public function getNotes($user_id = null, $lead_id = null, $deal_id = null, $per * @param int|null $deal_id The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. (optional) * @param int|null $person_id The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. (optional) * @param int|null $org_id The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. (optional) + * @param int|null $project_id The ID of the project which notes to fetch. If omitted, notes about all projects will be returned. (optional) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. (optional) @@ -2311,14 +2314,15 @@ public function getNotes($user_id = null, $lead_id = null, $deal_id = null, $per * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_deal_flag If set, the results are filtered by note to deal pinning state (optional) * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_organization_flag If set, the results are filtered by note to organization pinning state (optional) * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_person_flag If set, the results are filtered by note to person pinning state (optional) + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_project_flag If set, the results are filtered by note to project pinning state (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetNotes, HTTP status code, HTTP response headers (array of strings) */ - public function getNotesWithHttpInfo($user_id = null, $lead_id = null, $deal_id = null, $person_id = null, $org_id = null, $start = 0, $limit = null, $sort = null, $start_date = null, $end_date = null, $pinned_to_lead_flag = null, $pinned_to_deal_flag = null, $pinned_to_organization_flag = null, $pinned_to_person_flag = null) + public function getNotesWithHttpInfo($user_id = null, $lead_id = null, $deal_id = null, $person_id = null, $org_id = null, $project_id = null, $start = 0, $limit = null, $sort = null, $start_date = null, $end_date = null, $pinned_to_lead_flag = null, $pinned_to_deal_flag = null, $pinned_to_organization_flag = null, $pinned_to_person_flag = null, $pinned_to_project_flag = null) { - $request = $this->getNotesRequest($user_id, $lead_id, $deal_id, $person_id, $org_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag); + $request = $this->getNotesRequest($user_id, $lead_id, $deal_id, $person_id, $org_id, $project_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag, $pinned_to_project_flag); try { $options = $this->createHttpClientOption(); @@ -2327,7 +2331,7 @@ public function getNotesWithHttpInfo($user_id = null, $lead_id = null, $deal_id } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->getNotesRequest($user_id, $lead_id, $deal_id, $person_id, $org_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag); + $request = $this->getNotesRequest($user_id, $lead_id, $deal_id, $person_id, $org_id, $project_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag, $pinned_to_project_flag); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -2416,6 +2420,7 @@ public function getNotesWithHttpInfo($user_id = null, $lead_id = null, $deal_id * @param int|null $deal_id The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. (optional) * @param int|null $person_id The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. (optional) * @param int|null $org_id The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. (optional) + * @param int|null $project_id The ID of the project which notes to fetch. If omitted, notes about all projects will be returned. (optional) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. (optional) @@ -2425,13 +2430,14 @@ public function getNotesWithHttpInfo($user_id = null, $lead_id = null, $deal_id * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_deal_flag If set, the results are filtered by note to deal pinning state (optional) * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_organization_flag If set, the results are filtered by note to organization pinning state (optional) * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_person_flag If set, the results are filtered by note to person pinning state (optional) + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_project_flag If set, the results are filtered by note to project pinning state (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getNotesAsync($user_id = null, $lead_id = null, $deal_id = null, $person_id = null, $org_id = null, $start = 0, $limit = null, $sort = null, $start_date = null, $end_date = null, $pinned_to_lead_flag = null, $pinned_to_deal_flag = null, $pinned_to_organization_flag = null, $pinned_to_person_flag = null): PromiseInterface + public function getNotesAsync($user_id = null, $lead_id = null, $deal_id = null, $person_id = null, $org_id = null, $project_id = null, $start = 0, $limit = null, $sort = null, $start_date = null, $end_date = null, $pinned_to_lead_flag = null, $pinned_to_deal_flag = null, $pinned_to_organization_flag = null, $pinned_to_person_flag = null, $pinned_to_project_flag = null): PromiseInterface { - return $this->getNotesAsyncWithHttpInfo($user_id, $lead_id, $deal_id, $person_id, $org_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag) + return $this->getNotesAsyncWithHttpInfo($user_id, $lead_id, $deal_id, $person_id, $org_id, $project_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag, $pinned_to_project_flag) ->then( function ($response) { return $response[0]; @@ -2449,6 +2455,7 @@ function ($response) { * @param int|null $deal_id The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. (optional) * @param int|null $person_id The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. (optional) * @param int|null $org_id The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. (optional) + * @param int|null $project_id The ID of the project which notes to fetch. If omitted, notes about all projects will be returned. (optional) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. (optional) @@ -2458,14 +2465,15 @@ function ($response) { * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_deal_flag If set, the results are filtered by note to deal pinning state (optional) * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_organization_flag If set, the results are filtered by note to organization pinning state (optional) * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_person_flag If set, the results are filtered by note to person pinning state (optional) + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_project_flag If set, the results are filtered by note to project pinning state (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getNotesAsyncWithHttpInfo($user_id = null, $lead_id = null, $deal_id = null, $person_id = null, $org_id = null, $start = 0, $limit = null, $sort = null, $start_date = null, $end_date = null, $pinned_to_lead_flag = null, $pinned_to_deal_flag = null, $pinned_to_organization_flag = null, $pinned_to_person_flag = null): PromiseInterface + public function getNotesAsyncWithHttpInfo($user_id = null, $lead_id = null, $deal_id = null, $person_id = null, $org_id = null, $project_id = null, $start = 0, $limit = null, $sort = null, $start_date = null, $end_date = null, $pinned_to_lead_flag = null, $pinned_to_deal_flag = null, $pinned_to_organization_flag = null, $pinned_to_person_flag = null, $pinned_to_project_flag = null): PromiseInterface { $returnType = '\Pipedrive\versions\v1\Model\GetNotes'; - $request = $this->getNotesRequest($user_id, $lead_id, $deal_id, $person_id, $org_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag); + $request = $this->getNotesRequest($user_id, $lead_id, $deal_id, $person_id, $org_id, $project_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag, $pinned_to_project_flag); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2509,6 +2517,7 @@ function ($exception) { * @param int|null $deal_id The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. (optional) * @param int|null $person_id The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. (optional) * @param int|null $org_id The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. (optional) + * @param int|null $project_id The ID of the project which notes to fetch. If omitted, notes about all projects will be returned. (optional) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. (optional) @@ -2518,11 +2527,12 @@ function ($exception) { * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_deal_flag If set, the results are filtered by note to deal pinning state (optional) * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_organization_flag If set, the results are filtered by note to organization pinning state (optional) * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_person_flag If set, the results are filtered by note to person pinning state (optional) + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_project_flag If set, the results are filtered by note to project pinning state (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function getNotesRequest($user_id = null, $lead_id = null, $deal_id = null, $person_id = null, $org_id = null, $start = 0, $limit = null, $sort = null, $start_date = null, $end_date = null, $pinned_to_lead_flag = null, $pinned_to_deal_flag = null, $pinned_to_organization_flag = null, $pinned_to_person_flag = null): Request + public function getNotesRequest($user_id = null, $lead_id = null, $deal_id = null, $person_id = null, $org_id = null, $project_id = null, $start = 0, $limit = null, $sort = null, $start_date = null, $end_date = null, $pinned_to_lead_flag = null, $pinned_to_deal_flag = null, $pinned_to_organization_flag = null, $pinned_to_person_flag = null, $pinned_to_project_flag = null): Request { $resourcePath = '/notes'; @@ -2574,6 +2584,14 @@ public function getNotesRequest($user_id = null, $lead_id = null, $deal_id = nul } // query params /* @phpstan-ignore-next-line */ + if (is_array($project_id)) { + $project_id = ObjectSerializer::serializeCollection($project_id, '', true); + } + if ($project_id !== null) { + $queryParams['project_id'] = $project_id; + } + // query params + /* @phpstan-ignore-next-line */ if (is_array($start)) { $start = ObjectSerializer::serializeCollection($start, '', true); } @@ -2644,6 +2662,14 @@ public function getNotesRequest($user_id = null, $lead_id = null, $deal_id = nul if ($pinned_to_person_flag !== null) { $queryParams['pinned_to_person_flag'] = $pinned_to_person_flag; } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($pinned_to_project_flag)) { + $pinned_to_project_flag = ObjectSerializer::serializeCollection($pinned_to_project_flag, '', true); + } + if ($pinned_to_project_flag !== null) { + $queryParams['pinned_to_project_flag'] = $pinned_to_project_flag; + } diff --git a/lib/versions/v1/Api/OrganizationsApi.php b/lib/versions/v1/Api/OrganizationsApi.php index 5e68f25..20e1332 100644 --- a/lib/versions/v1/Api/OrganizationsApi.php +++ b/lib/versions/v1/Api/OrganizationsApi.php @@ -132,6 +132,7 @@ public function getConfig(): Configuration * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\OrganizationPostResponse + * @deprecated */ public function addOrganization($new_organization = null) { @@ -149,6 +150,7 @@ public function addOrganization($new_organization = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\OrganizationPostResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function addOrganizationWithHttpInfo($new_organization = null) { @@ -249,6 +251,7 @@ public function addOrganizationWithHttpInfo($new_organization = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addOrganizationAsync($new_organization = null): PromiseInterface { @@ -269,6 +272,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addOrganizationAsyncWithHttpInfo($new_organization = null): PromiseInterface { @@ -316,6 +320,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function addOrganizationRequest($new_organization = null): Request { @@ -726,6 +731,7 @@ public function addOrganizationFollowerRequest($id, $add_organization_follower_r * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\OrganizationDeleteResponse + * @deprecated */ public function deleteOrganization($id) { @@ -743,6 +749,7 @@ public function deleteOrganization($id) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\OrganizationDeleteResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function deleteOrganizationWithHttpInfo($id) { @@ -843,6 +850,7 @@ public function deleteOrganizationWithHttpInfo($id) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteOrganizationAsync($id): PromiseInterface { @@ -863,6 +871,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteOrganizationAsyncWithHttpInfo($id): PromiseInterface { @@ -910,6 +919,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function deleteOrganizationRequest($id): Request { @@ -1338,6 +1348,7 @@ public function deleteOrganizationFollowerRequest($id, $follower_id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\OrganizationsDeleteResponse + * @deprecated */ public function deleteOrganizations($ids) { @@ -1355,6 +1366,7 @@ public function deleteOrganizations($ids) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\OrganizationsDeleteResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function deleteOrganizationsWithHttpInfo($ids) { @@ -1455,6 +1467,7 @@ public function deleteOrganizationsWithHttpInfo($ids) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteOrganizationsAsync($ids): PromiseInterface { @@ -1475,6 +1488,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteOrganizationsAsyncWithHttpInfo($ids): PromiseInterface { @@ -1522,6 +1536,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function deleteOrganizationsRequest($ids): Request { @@ -1634,6 +1649,7 @@ public function deleteOrganizationsRequest($ids): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\OrganizationDetailsGetResponse + * @deprecated */ public function getOrganization($id) { @@ -1651,6 +1667,7 @@ public function getOrganization($id) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\OrganizationDetailsGetResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getOrganizationWithHttpInfo($id) { @@ -1751,6 +1768,7 @@ public function getOrganizationWithHttpInfo($id) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getOrganizationAsync($id): PromiseInterface { @@ -1771,6 +1789,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getOrganizationAsyncWithHttpInfo($id): PromiseInterface { @@ -1818,6 +1837,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getOrganizationRequest($id): Request { @@ -1934,6 +1954,7 @@ public function getOrganizationRequest($id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ListActivitiesResponse + * @deprecated */ public function getOrganizationActivities($id, $start = 0, $limit = null, $done = null, $exclude = null) { @@ -1955,6 +1976,7 @@ public function getOrganizationActivities($id, $start = 0, $limit = null, $done * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ListActivitiesResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getOrganizationActivitiesWithHttpInfo($id, $start = 0, $limit = null, $done = null, $exclude = null) { @@ -2059,6 +2081,7 @@ public function getOrganizationActivitiesWithHttpInfo($id, $start = 0, $limit = * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getOrganizationActivitiesAsync($id, $start = 0, $limit = null, $done = null, $exclude = null): PromiseInterface { @@ -2083,6 +2106,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getOrganizationActivitiesAsyncWithHttpInfo($id, $start = 0, $limit = null, $done = null, $exclude = null): PromiseInterface { @@ -2134,6 +2158,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getOrganizationActivitiesRequest($id, $start = 0, $limit = null, $done = null, $exclude = null): Request { @@ -2605,6 +2630,7 @@ public function getOrganizationChangelogRequest($id, $cursor = null, $limit = nu * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ListDealsResponse + * @deprecated */ public function getOrganizationDeals($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null, $only_primary_association = null) { @@ -2627,6 +2653,7 @@ public function getOrganizationDeals($id, $start = 0, $limit = null, $status = ' * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ListDealsResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getOrganizationDealsWithHttpInfo($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null, $only_primary_association = null) { @@ -2732,6 +2759,7 @@ public function getOrganizationDealsWithHttpInfo($id, $start = 0, $limit = null, * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getOrganizationDealsAsync($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null, $only_primary_association = null): PromiseInterface { @@ -2757,6 +2785,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getOrganizationDealsAsyncWithHttpInfo($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null, $only_primary_association = null): PromiseInterface { @@ -2809,6 +2838,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getOrganizationDealsRequest($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null, $only_primary_association = null): Request { @@ -3920,6 +3950,7 @@ public function getOrganizationMailMessagesRequest($id, $start = 0, $limit = nul * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ListPersonsResponse + * @deprecated */ public function getOrganizationPersons($id, $start = 0, $limit = null) { @@ -3939,6 +3970,7 @@ public function getOrganizationPersons($id, $start = 0, $limit = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ListPersonsResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getOrganizationPersonsWithHttpInfo($id, $start = 0, $limit = null) { @@ -4041,6 +4073,7 @@ public function getOrganizationPersonsWithHttpInfo($id, $start = 0, $limit = nul * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getOrganizationPersonsAsync($id, $start = 0, $limit = null): PromiseInterface { @@ -4063,6 +4096,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getOrganizationPersonsAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface { @@ -4112,6 +4146,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getOrganizationPersonsRequest($id, $start = 0, $limit = null): Request { @@ -4889,6 +4924,7 @@ public function getOrganizationUsersRequest($id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\AllOrganizationsGetResponse + * @deprecated */ public function getOrganizations($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null) { @@ -4911,6 +4947,7 @@ public function getOrganizations($user_id = null, $filter_id = null, $first_char * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\AllOrganizationsGetResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getOrganizationsWithHttpInfo($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null) { @@ -5016,6 +5053,7 @@ public function getOrganizationsWithHttpInfo($user_id = null, $filter_id = null, * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getOrganizationsAsync($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null): PromiseInterface { @@ -5041,6 +5079,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getOrganizationsAsyncWithHttpInfo($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null): PromiseInterface { @@ -5093,6 +5132,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getOrganizationsRequest($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null): Request { @@ -5231,7 +5271,7 @@ public function getOrganizationsRequest($user_id = null, $filter_id = null, $fir /** * Operation getOrganizationsCollection * - * Get all organizations (BETA) + * Get all organizations collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -5243,6 +5283,7 @@ public function getOrganizationsRequest($user_id = null, $filter_id = null, $fir * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\InlineResponse200|\Pipedrive\versions\v1\Model\FailResponse + * @deprecated */ public function getOrganizationsCollection($cursor = null, $limit = null, $since = null, $until = null, $owner_id = null, $first_char = null) { @@ -5253,7 +5294,7 @@ public function getOrganizationsCollection($cursor = null, $limit = null, $since /** * Operation getOrganizationsCollectionWithHttpInfo * - * Get all organizations (BETA) + * Get all organizations collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -5265,6 +5306,7 @@ public function getOrganizationsCollection($cursor = null, $limit = null, $since * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\InlineResponse200|\Pipedrive\versions\v1\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getOrganizationsCollectionWithHttpInfo($cursor = null, $limit = null, $since = null, $until = null, $owner_id = null, $first_char = null) { @@ -5380,7 +5422,7 @@ public function getOrganizationsCollectionWithHttpInfo($cursor = null, $limit = /** * Operation getOrganizationsCollectionAsync * - * Get all organizations (BETA) + * Get all organizations collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -5391,6 +5433,7 @@ public function getOrganizationsCollectionWithHttpInfo($cursor = null, $limit = * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getOrganizationsCollectionAsync($cursor = null, $limit = null, $since = null, $until = null, $owner_id = null, $first_char = null): PromiseInterface { @@ -5405,7 +5448,7 @@ function ($response) { /** * Operation getOrganizationsCollectionAsyncWithHttpInfo * - * Get all organizations (BETA) + * Get all organizations collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -5416,6 +5459,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getOrganizationsCollectionAsyncWithHttpInfo($cursor = null, $limit = null, $since = null, $until = null, $owner_id = null, $first_char = null): PromiseInterface { @@ -5468,6 +5512,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getOrganizationsCollectionRequest($cursor = null, $limit = null, $since = null, $until = null, $owner_id = null, $first_char = null): Request { @@ -5924,6 +5969,7 @@ public function mergeOrganizationsRequest($id, $merge_organizations_request = nu * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\OrganizationSearchResponse + * @deprecated */ public function searchOrganization($term, $fields = null, $exact_match = null, $start = 0, $limit = null) { @@ -5945,6 +5991,7 @@ public function searchOrganization($term, $fields = null, $exact_match = null, $ * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\OrganizationSearchResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function searchOrganizationWithHttpInfo($term, $fields = null, $exact_match = null, $start = 0, $limit = null) { @@ -6049,6 +6096,7 @@ public function searchOrganizationWithHttpInfo($term, $fields = null, $exact_mat * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function searchOrganizationAsync($term, $fields = null, $exact_match = null, $start = 0, $limit = null): PromiseInterface { @@ -6073,6 +6121,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function searchOrganizationAsyncWithHttpInfo($term, $fields = null, $exact_match = null, $start = 0, $limit = null): PromiseInterface { @@ -6124,6 +6173,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function searchOrganizationRequest($term, $fields = null, $exact_match = null, $start = 0, $limit = null): Request { @@ -6269,6 +6319,7 @@ public function searchOrganizationRequest($term, $fields = null, $exact_match = * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\OrganizationUpdateResponse + * @deprecated */ public function updateOrganization($id, $update_organization = null) { @@ -6287,6 +6338,7 @@ public function updateOrganization($id, $update_organization = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\OrganizationUpdateResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function updateOrganizationWithHttpInfo($id, $update_organization = null) { @@ -6388,6 +6440,7 @@ public function updateOrganizationWithHttpInfo($id, $update_organization = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function updateOrganizationAsync($id, $update_organization = null): PromiseInterface { @@ -6409,6 +6462,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function updateOrganizationAsyncWithHttpInfo($id, $update_organization = null): PromiseInterface { @@ -6457,6 +6511,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function updateOrganizationRequest($id, $update_organization = null): Request { diff --git a/lib/versions/v1/Api/PersonsApi.php b/lib/versions/v1/Api/PersonsApi.php index 868817a..3bede79 100644 --- a/lib/versions/v1/Api/PersonsApi.php +++ b/lib/versions/v1/Api/PersonsApi.php @@ -132,6 +132,7 @@ public function getConfig(): Configuration * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\AddPersonResponse + * @deprecated */ public function addPerson($new_person = null) { @@ -149,6 +150,7 @@ public function addPerson($new_person = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\AddPersonResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function addPersonWithHttpInfo($new_person = null) { @@ -249,6 +251,7 @@ public function addPersonWithHttpInfo($new_person = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addPersonAsync($new_person = null): PromiseInterface { @@ -269,6 +272,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addPersonAsyncWithHttpInfo($new_person = null): PromiseInterface { @@ -316,6 +320,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function addPersonRequest($new_person = null): Request { @@ -1083,6 +1088,7 @@ public function addPersonPictureRequest($id, $file, $crop_x = null, $crop_y = nu * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\DeletePersonResponse + * @deprecated */ public function deletePerson($id) { @@ -1100,6 +1106,7 @@ public function deletePerson($id) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\DeletePersonResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function deletePersonWithHttpInfo($id) { @@ -1200,6 +1207,7 @@ public function deletePersonWithHttpInfo($id) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deletePersonAsync($id): PromiseInterface { @@ -1220,6 +1228,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deletePersonAsyncWithHttpInfo($id): PromiseInterface { @@ -1267,6 +1276,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function deletePersonRequest($id): Request { @@ -1991,6 +2001,7 @@ public function deletePersonPictureRequest($id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\DeletePersonsInBulkResponse + * @deprecated */ public function deletePersons($ids) { @@ -2008,6 +2019,7 @@ public function deletePersons($ids) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\DeletePersonsInBulkResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function deletePersonsWithHttpInfo($ids) { @@ -2108,6 +2120,7 @@ public function deletePersonsWithHttpInfo($ids) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deletePersonsAsync($ids): PromiseInterface { @@ -2128,6 +2141,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deletePersonsAsyncWithHttpInfo($ids): PromiseInterface { @@ -2175,6 +2189,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function deletePersonsRequest($ids): Request { @@ -2287,6 +2302,7 @@ public function deletePersonsRequest($ids): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetPersonDetailsResponse + * @deprecated */ public function getPerson($id) { @@ -2304,6 +2320,7 @@ public function getPerson($id) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetPersonDetailsResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getPersonWithHttpInfo($id) { @@ -2404,6 +2421,7 @@ public function getPersonWithHttpInfo($id) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPersonAsync($id): PromiseInterface { @@ -2424,6 +2442,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPersonAsyncWithHttpInfo($id): PromiseInterface { @@ -2471,6 +2490,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getPersonRequest($id): Request { @@ -2587,6 +2607,7 @@ public function getPersonRequest($id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ListActivitiesResponse + * @deprecated */ public function getPersonActivities($id, $start = 0, $limit = null, $done = null, $exclude = null) { @@ -2608,6 +2629,7 @@ public function getPersonActivities($id, $start = 0, $limit = null, $done = null * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ListActivitiesResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getPersonActivitiesWithHttpInfo($id, $start = 0, $limit = null, $done = null, $exclude = null) { @@ -2712,6 +2734,7 @@ public function getPersonActivitiesWithHttpInfo($id, $start = 0, $limit = null, * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPersonActivitiesAsync($id, $start = 0, $limit = null, $done = null, $exclude = null): PromiseInterface { @@ -2736,6 +2759,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPersonActivitiesAsyncWithHttpInfo($id, $start = 0, $limit = null, $done = null, $exclude = null): PromiseInterface { @@ -2787,6 +2811,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getPersonActivitiesRequest($id, $start = 0, $limit = null, $done = null, $exclude = null): Request { @@ -3257,6 +3282,7 @@ public function getPersonChangelogRequest($id, $cursor = null, $limit = null): R * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ListDealsResponse + * @deprecated */ public function getPersonDeals($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null) { @@ -3278,6 +3304,7 @@ public function getPersonDeals($id, $start = 0, $limit = null, $status = 'all_no * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ListDealsResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getPersonDealsWithHttpInfo($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null) { @@ -3382,6 +3409,7 @@ public function getPersonDealsWithHttpInfo($id, $start = 0, $limit = null, $stat * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPersonDealsAsync($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null): PromiseInterface { @@ -3406,6 +3434,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPersonDealsAsyncWithHttpInfo($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null): PromiseInterface { @@ -3457,6 +3486,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getPersonDealsRequest($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null): Request { @@ -5529,6 +5559,7 @@ public function getPersonUsersRequest($id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetAllPersonsResponse + * @deprecated */ public function getPersons($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null) { @@ -5551,6 +5582,7 @@ public function getPersons($user_id = null, $filter_id = null, $first_char = nul * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetAllPersonsResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getPersonsWithHttpInfo($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null) { @@ -5656,6 +5688,7 @@ public function getPersonsWithHttpInfo($user_id = null, $filter_id = null, $firs * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPersonsAsync($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null): PromiseInterface { @@ -5681,6 +5714,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPersonsAsyncWithHttpInfo($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null): PromiseInterface { @@ -5733,6 +5767,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getPersonsRequest($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null): Request { @@ -5871,7 +5906,7 @@ public function getPersonsRequest($user_id = null, $filter_id = null, $first_cha /** * Operation getPersonsCollection * - * Get all persons (BETA) + * Get all persons collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -5883,6 +5918,7 @@ public function getPersonsRequest($user_id = null, $filter_id = null, $first_cha * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\InlineResponse2001|\Pipedrive\versions\v1\Model\FailResponse + * @deprecated */ public function getPersonsCollection($cursor = null, $limit = null, $since = null, $until = null, $owner_id = null, $first_char = null) { @@ -5893,7 +5929,7 @@ public function getPersonsCollection($cursor = null, $limit = null, $since = nul /** * Operation getPersonsCollectionWithHttpInfo * - * Get all persons (BETA) + * Get all persons collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -5905,6 +5941,7 @@ public function getPersonsCollection($cursor = null, $limit = null, $since = nul * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\InlineResponse2001|\Pipedrive\versions\v1\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getPersonsCollectionWithHttpInfo($cursor = null, $limit = null, $since = null, $until = null, $owner_id = null, $first_char = null) { @@ -6020,7 +6057,7 @@ public function getPersonsCollectionWithHttpInfo($cursor = null, $limit = null, /** * Operation getPersonsCollectionAsync * - * Get all persons (BETA) + * Get all persons collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -6031,6 +6068,7 @@ public function getPersonsCollectionWithHttpInfo($cursor = null, $limit = null, * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPersonsCollectionAsync($cursor = null, $limit = null, $since = null, $until = null, $owner_id = null, $first_char = null): PromiseInterface { @@ -6045,7 +6083,7 @@ function ($response) { /** * Operation getPersonsCollectionAsyncWithHttpInfo * - * Get all persons (BETA) + * Get all persons collection * * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -6056,6 +6094,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPersonsCollectionAsyncWithHttpInfo($cursor = null, $limit = null, $since = null, $until = null, $owner_id = null, $first_char = null): PromiseInterface { @@ -6108,6 +6147,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getPersonsCollectionRequest($cursor = null, $limit = null, $since = null, $until = null, $owner_id = null, $first_char = null): Request { @@ -6566,6 +6606,7 @@ public function mergePersonsRequest($id, $merge_persons_request = null): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\PersonSearchResponse + * @deprecated */ public function searchPersons($term, $fields = null, $exact_match = null, $organization_id = null, $include_fields = null, $start = 0, $limit = null) { @@ -6589,6 +6630,7 @@ public function searchPersons($term, $fields = null, $exact_match = null, $organ * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\PersonSearchResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function searchPersonsWithHttpInfo($term, $fields = null, $exact_match = null, $organization_id = null, $include_fields = null, $start = 0, $limit = null) { @@ -6695,6 +6737,7 @@ public function searchPersonsWithHttpInfo($term, $fields = null, $exact_match = * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function searchPersonsAsync($term, $fields = null, $exact_match = null, $organization_id = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface { @@ -6721,6 +6764,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function searchPersonsAsyncWithHttpInfo($term, $fields = null, $exact_match = null, $organization_id = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface { @@ -6774,6 +6818,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function searchPersonsRequest($term, $fields = null, $exact_match = null, $organization_id = null, $include_fields = null, $start = 0, $limit = null): Request { diff --git a/lib/versions/v1/Api/PipelinesApi.php b/lib/versions/v1/Api/PipelinesApi.php index 56560d3..a832079 100644 --- a/lib/versions/v1/Api/PipelinesApi.php +++ b/lib/versions/v1/Api/PipelinesApi.php @@ -132,6 +132,7 @@ public function getConfig(): Configuration * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\AddNewPipeline + * @deprecated */ public function addPipeline($pipeline = null) { @@ -149,6 +150,7 @@ public function addPipeline($pipeline = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\AddNewPipeline, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function addPipelineWithHttpInfo($pipeline = null) { @@ -249,6 +251,7 @@ public function addPipelineWithHttpInfo($pipeline = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addPipelineAsync($pipeline = null): PromiseInterface { @@ -269,6 +272,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addPipelineAsyncWithHttpInfo($pipeline = null): PromiseInterface { @@ -316,6 +320,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function addPipelineRequest($pipeline = null): Request { @@ -419,6 +424,7 @@ public function addPipelineRequest($pipeline = null): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\DeletePipelineResponse + * @deprecated */ public function deletePipeline($id) { @@ -436,6 +442,7 @@ public function deletePipeline($id) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\DeletePipelineResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function deletePipelineWithHttpInfo($id) { @@ -536,6 +543,7 @@ public function deletePipelineWithHttpInfo($id) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deletePipelineAsync($id): PromiseInterface { @@ -556,6 +564,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deletePipelineAsyncWithHttpInfo($id): PromiseInterface { @@ -603,6 +612,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function deletePipelineRequest($id): Request { @@ -716,6 +726,7 @@ public function deletePipelineRequest($id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetOnePipeline + * @deprecated */ public function getPipeline($id, $totals_convert_currency = null) { @@ -734,6 +745,7 @@ public function getPipeline($id, $totals_convert_currency = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetOnePipeline, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getPipelineWithHttpInfo($id, $totals_convert_currency = null) { @@ -835,6 +847,7 @@ public function getPipelineWithHttpInfo($id, $totals_convert_currency = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPipelineAsync($id, $totals_convert_currency = null): PromiseInterface { @@ -856,6 +869,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPipelineAsyncWithHttpInfo($id, $totals_convert_currency = null): PromiseInterface { @@ -904,6 +918,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getPipelineRequest($id, $totals_convert_currency = null): Request { @@ -1381,6 +1396,7 @@ public function getPipelineConversionStatisticsRequest($id, $start_date, $end_da * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetStageDeals + * @deprecated */ public function getPipelineDeals($id, $filter_id = null, $user_id = null, $everyone = null, $stage_id = null, $start = 0, $limit = null, $get_summary = null, $totals_convert_currency = null) { @@ -1406,6 +1422,7 @@ public function getPipelineDeals($id, $filter_id = null, $user_id = null, $every * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetStageDeals, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getPipelineDealsWithHttpInfo($id, $filter_id = null, $user_id = null, $everyone = null, $stage_id = null, $start = 0, $limit = null, $get_summary = null, $totals_convert_currency = null) { @@ -1514,6 +1531,7 @@ public function getPipelineDealsWithHttpInfo($id, $filter_id = null, $user_id = * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPipelineDealsAsync($id, $filter_id = null, $user_id = null, $everyone = null, $stage_id = null, $start = 0, $limit = null, $get_summary = null, $totals_convert_currency = null): PromiseInterface { @@ -1542,6 +1560,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPipelineDealsAsyncWithHttpInfo($id, $filter_id = null, $user_id = null, $everyone = null, $stage_id = null, $start = 0, $limit = null, $get_summary = null, $totals_convert_currency = null): PromiseInterface { @@ -1597,6 +1616,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getPipelineDealsRequest($id, $filter_id = null, $user_id = null, $everyone = null, $stage_id = null, $start = 0, $limit = null, $get_summary = null, $totals_convert_currency = null): Request { @@ -2121,6 +2141,7 @@ public function getPipelineMovementStatisticsRequest($id, $start_date, $end_date * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetAllPipelines + * @deprecated */ public function getPipelines() { @@ -2137,6 +2158,7 @@ public function getPipelines() * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetAllPipelines, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getPipelinesWithHttpInfo() { @@ -2236,6 +2258,7 @@ public function getPipelinesWithHttpInfo() * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPipelinesAsync(): PromiseInterface { @@ -2255,6 +2278,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getPipelinesAsyncWithHttpInfo(): PromiseInterface { @@ -2301,6 +2325,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getPipelinesRequest(): Request { @@ -2399,6 +2424,7 @@ public function getPipelinesRequest(): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\EditPipeline + * @deprecated */ public function updatePipeline($id, $pipeline = null) { @@ -2417,6 +2443,7 @@ public function updatePipeline($id, $pipeline = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\EditPipeline, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function updatePipelineWithHttpInfo($id, $pipeline = null) { @@ -2518,6 +2545,7 @@ public function updatePipelineWithHttpInfo($id, $pipeline = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function updatePipelineAsync($id, $pipeline = null): PromiseInterface { @@ -2539,6 +2567,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function updatePipelineAsyncWithHttpInfo($id, $pipeline = null): PromiseInterface { @@ -2587,6 +2616,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function updatePipelineRequest($id, $pipeline = null): Request { diff --git a/lib/versions/v1/Api/ProductsApi.php b/lib/versions/v1/Api/ProductsApi.php index 0f3e23b..390b86b 100644 --- a/lib/versions/v1/Api/ProductsApi.php +++ b/lib/versions/v1/Api/ProductsApi.php @@ -132,6 +132,7 @@ public function getConfig(): Configuration * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ProductResponse + * @deprecated */ public function addProduct($add_product_request_body = null) { @@ -149,6 +150,7 @@ public function addProduct($add_product_request_body = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ProductResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function addProductWithHttpInfo($add_product_request_body = null) { @@ -249,6 +251,7 @@ public function addProductWithHttpInfo($add_product_request_body = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addProductAsync($add_product_request_body = null): PromiseInterface { @@ -269,6 +272,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addProductAsyncWithHttpInfo($add_product_request_body = null): PromiseInterface { @@ -316,6 +320,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function addProductRequest($add_product_request_body = null): Request { @@ -726,6 +731,7 @@ public function addProductFollowerRequest($id, $add_product_follower_request = n * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\DeleteProductResponse + * @deprecated */ public function deleteProduct($id) { @@ -743,6 +749,7 @@ public function deleteProduct($id) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\DeleteProductResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function deleteProductWithHttpInfo($id) { @@ -843,6 +850,7 @@ public function deleteProductWithHttpInfo($id) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteProductAsync($id): PromiseInterface { @@ -863,6 +871,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteProductAsyncWithHttpInfo($id): PromiseInterface { @@ -910,6 +919,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function deleteProductRequest($id): Request { @@ -1338,6 +1348,7 @@ public function deleteProductFollowerRequest($id, $follower_id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ProductResponse + * @deprecated */ public function getProduct($id) { @@ -1355,6 +1366,7 @@ public function getProduct($id) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ProductResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getProductWithHttpInfo($id) { @@ -1455,6 +1467,7 @@ public function getProductWithHttpInfo($id) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getProductAsync($id): PromiseInterface { @@ -1475,6 +1488,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getProductAsyncWithHttpInfo($id): PromiseInterface { @@ -1522,6 +1536,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getProductRequest($id): Request { @@ -2932,6 +2947,7 @@ public function getProductUsersRequest($id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ProductsResponse + * @deprecated */ public function getProducts($user_id = null, $filter_id = null, $ids = null, $first_char = null, $get_summary = null, $start = 0, $limit = null) { @@ -2955,6 +2971,7 @@ public function getProducts($user_id = null, $filter_id = null, $ids = null, $fi * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ProductsResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getProductsWithHttpInfo($user_id = null, $filter_id = null, $ids = null, $first_char = null, $get_summary = null, $start = 0, $limit = null) { @@ -3061,6 +3078,7 @@ public function getProductsWithHttpInfo($user_id = null, $filter_id = null, $ids * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getProductsAsync($user_id = null, $filter_id = null, $ids = null, $first_char = null, $get_summary = null, $start = 0, $limit = null): PromiseInterface { @@ -3087,6 +3105,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getProductsAsyncWithHttpInfo($user_id = null, $filter_id = null, $ids = null, $first_char = null, $get_summary = null, $start = 0, $limit = null): PromiseInterface { @@ -3140,6 +3159,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getProductsRequest($user_id = null, $filter_id = null, $ids = null, $first_char = null, $get_summary = null, $start = 0, $limit = null): Request { @@ -3298,6 +3318,7 @@ public function getProductsRequest($user_id = null, $filter_id = null, $ids = nu * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ProductSearchResponse + * @deprecated */ public function searchProducts($term, $fields = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null) { @@ -3320,6 +3341,7 @@ public function searchProducts($term, $fields = null, $exact_match = null, $incl * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ProductSearchResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function searchProductsWithHttpInfo($term, $fields = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null) { @@ -3425,6 +3447,7 @@ public function searchProductsWithHttpInfo($term, $fields = null, $exact_match = * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function searchProductsAsync($term, $fields = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface { @@ -3450,6 +3473,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function searchProductsAsyncWithHttpInfo($term, $fields = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface { @@ -3502,6 +3526,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function searchProductsRequest($term, $fields = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null): Request { @@ -3655,6 +3680,7 @@ public function searchProductsRequest($term, $fields = null, $exact_match = null * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\UpdateProductResponse + * @deprecated */ public function updateProduct($id, $update_product_request_body = null) { @@ -3673,6 +3699,7 @@ public function updateProduct($id, $update_product_request_body = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\UpdateProductResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function updateProductWithHttpInfo($id, $update_product_request_body = null) { @@ -3774,6 +3801,7 @@ public function updateProductWithHttpInfo($id, $update_product_request_body = nu * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function updateProductAsync($id, $update_product_request_body = null): PromiseInterface { @@ -3795,6 +3823,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function updateProductAsyncWithHttpInfo($id, $update_product_request_body = null): PromiseInterface { @@ -3843,6 +3872,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function updateProductRequest($id, $update_product_request_body = null): Request { diff --git a/lib/versions/v1/Api/StagesApi.php b/lib/versions/v1/Api/StagesApi.php index 07ed2c7..2d46d59 100644 --- a/lib/versions/v1/Api/StagesApi.php +++ b/lib/versions/v1/Api/StagesApi.php @@ -132,6 +132,7 @@ public function getConfig(): Configuration * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetAddUpdateStage + * @deprecated */ public function addStage($stage = null) { @@ -149,6 +150,7 @@ public function addStage($stage = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetAddUpdateStage, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function addStageWithHttpInfo($stage = null) { @@ -249,6 +251,7 @@ public function addStageWithHttpInfo($stage = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addStageAsync($stage = null): PromiseInterface { @@ -269,6 +272,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function addStageAsyncWithHttpInfo($stage = null): PromiseInterface { @@ -316,6 +320,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function addStageRequest($stage = null): Request { @@ -419,6 +424,7 @@ public function addStageRequest($stage = null): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\DeleteStageResponse + * @deprecated */ public function deleteStage($id) { @@ -436,6 +442,7 @@ public function deleteStage($id) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\DeleteStageResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function deleteStageWithHttpInfo($id) { @@ -536,6 +543,7 @@ public function deleteStageWithHttpInfo($id) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteStageAsync($id): PromiseInterface { @@ -556,6 +564,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteStageAsyncWithHttpInfo($id): PromiseInterface { @@ -603,6 +612,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function deleteStageRequest($id): Request { @@ -715,6 +725,7 @@ public function deleteStageRequest($id): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\DeleteStagesResponse + * @deprecated */ public function deleteStages($ids) { @@ -732,6 +743,7 @@ public function deleteStages($ids) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\DeleteStagesResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function deleteStagesWithHttpInfo($ids) { @@ -832,6 +844,7 @@ public function deleteStagesWithHttpInfo($ids) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteStagesAsync($ids): PromiseInterface { @@ -852,6 +865,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function deleteStagesAsyncWithHttpInfo($ids): PromiseInterface { @@ -899,6 +913,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function deleteStagesRequest($ids): Request { @@ -1012,6 +1027,7 @@ public function deleteStagesRequest($ids): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetOneStage + * @deprecated */ public function getStage($id, $everyone = null) { @@ -1030,6 +1046,7 @@ public function getStage($id, $everyone = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetOneStage, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getStageWithHttpInfo($id, $everyone = null) { @@ -1131,6 +1148,7 @@ public function getStageWithHttpInfo($id, $everyone = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getStageAsync($id, $everyone = null): PromiseInterface { @@ -1152,6 +1170,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getStageAsyncWithHttpInfo($id, $everyone = null): PromiseInterface { @@ -1200,6 +1219,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getStageRequest($id, $everyone = null): Request { @@ -1325,6 +1345,7 @@ public function getStageRequest($id, $everyone = null): Request * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetStageDeals + * @deprecated */ public function getStageDeals($id, $filter_id = null, $user_id = null, $everyone = null, $start = 0, $limit = null) { @@ -1347,6 +1368,7 @@ public function getStageDeals($id, $filter_id = null, $user_id = null, $everyone * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetStageDeals, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getStageDealsWithHttpInfo($id, $filter_id = null, $user_id = null, $everyone = null, $start = 0, $limit = null) { @@ -1452,6 +1474,7 @@ public function getStageDealsWithHttpInfo($id, $filter_id = null, $user_id = nul * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getStageDealsAsync($id, $filter_id = null, $user_id = null, $everyone = null, $start = 0, $limit = null): PromiseInterface { @@ -1477,6 +1500,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getStageDealsAsyncWithHttpInfo($id, $filter_id = null, $user_id = null, $everyone = null, $start = 0, $limit = null): PromiseInterface { @@ -1529,6 +1553,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getStageDealsRequest($id, $filter_id = null, $user_id = null, $everyone = null, $start = 0, $limit = null): Request { @@ -1683,6 +1708,7 @@ public function getStageDealsRequest($id, $filter_id = null, $user_id = null, $e * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetStages + * @deprecated */ public function getStages($pipeline_id = null, $start = 0, $limit = null) { @@ -1702,6 +1728,7 @@ public function getStages($pipeline_id = null, $start = 0, $limit = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetStages, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getStagesWithHttpInfo($pipeline_id = null, $start = 0, $limit = null) { @@ -1804,6 +1831,7 @@ public function getStagesWithHttpInfo($pipeline_id = null, $start = 0, $limit = * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getStagesAsync($pipeline_id = null, $start = 0, $limit = null): PromiseInterface { @@ -1826,6 +1854,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function getStagesAsyncWithHttpInfo($pipeline_id = null, $start = 0, $limit = null): PromiseInterface { @@ -1875,6 +1904,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function getStagesRequest($pipeline_id = null, $start = 0, $limit = null): Request { @@ -1997,6 +2027,7 @@ public function getStagesRequest($pipeline_id = null, $start = 0, $limit = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\GetAddUpdateStage + * @deprecated */ public function updateStage($id, $update_stage_request = null) { @@ -2015,6 +2046,7 @@ public function updateStage($id, $update_stage_request = null) * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\GetAddUpdateStage, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function updateStageWithHttpInfo($id, $update_stage_request = null) { @@ -2116,6 +2148,7 @@ public function updateStageWithHttpInfo($id, $update_stage_request = null) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function updateStageAsync($id, $update_stage_request = null): PromiseInterface { @@ -2137,6 +2170,7 @@ function ($response) { * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface + * @deprecated */ public function updateStageAsyncWithHttpInfo($id, $update_stage_request = null): PromiseInterface { @@ -2185,6 +2219,7 @@ function ($exception) { * * @throws InvalidArgumentException|OAuthProviderException * @return Request + * @deprecated */ public function updateStageRequest($id, $update_stage_request = null): Request { diff --git a/lib/versions/v1/Model/AddNoteRequest.php b/lib/versions/v1/Model/AddNoteRequest.php index cb8756b..f917e99 100644 --- a/lib/versions/v1/Model/AddNoteRequest.php +++ b/lib/versions/v1/Model/AddNoteRequest.php @@ -71,12 +71,14 @@ class AddNoteRequest implements ModelInterface, ArrayAccess, JsonSerializable 'deal_id' => 'int', 'person_id' => 'int', 'org_id' => 'int', + 'project_id' => 'int', 'user_id' => 'int', 'add_time' => 'string', 'pinned_to_lead_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean', 'pinned_to_deal_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean', 'pinned_to_organization_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean', - 'pinned_to_person_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean' + 'pinned_to_person_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean', + 'pinned_to_project_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean' ]; /** @@ -92,12 +94,14 @@ class AddNoteRequest implements ModelInterface, ArrayAccess, JsonSerializable 'deal_id' => null, 'person_id' => null, 'org_id' => null, + 'project_id' => null, 'user_id' => null, 'add_time' => null, 'pinned_to_lead_flag' => null, 'pinned_to_deal_flag' => null, 'pinned_to_organization_flag' => null, - 'pinned_to_person_flag' => null + 'pinned_to_person_flag' => null, + 'pinned_to_project_flag' => null ]; /** @@ -136,12 +140,14 @@ public static function openAPIFormats(): array 'deal_id' => 'deal_id', 'person_id' => 'person_id', 'org_id' => 'org_id', + 'project_id' => 'project_id', 'user_id' => 'user_id', 'add_time' => 'add_time', 'pinned_to_lead_flag' => 'pinned_to_lead_flag', 'pinned_to_deal_flag' => 'pinned_to_deal_flag', 'pinned_to_organization_flag' => 'pinned_to_organization_flag', - 'pinned_to_person_flag' => 'pinned_to_person_flag' + 'pinned_to_person_flag' => 'pinned_to_person_flag', + 'pinned_to_project_flag' => 'pinned_to_project_flag' ]; /** @@ -155,12 +161,14 @@ public static function openAPIFormats(): array 'deal_id' => 'setDealId', 'person_id' => 'setPersonId', 'org_id' => 'setOrgId', + 'project_id' => 'setProjectId', 'user_id' => 'setUserId', 'add_time' => 'setAddTime', 'pinned_to_lead_flag' => 'setPinnedToLeadFlag', 'pinned_to_deal_flag' => 'setPinnedToDealFlag', 'pinned_to_organization_flag' => 'setPinnedToOrganizationFlag', - 'pinned_to_person_flag' => 'setPinnedToPersonFlag' + 'pinned_to_person_flag' => 'setPinnedToPersonFlag', + 'pinned_to_project_flag' => 'setPinnedToProjectFlag' ]; /** @@ -174,12 +182,14 @@ public static function openAPIFormats(): array 'deal_id' => 'getDealId', 'person_id' => 'getPersonId', 'org_id' => 'getOrgId', + 'project_id' => 'getProjectId', 'user_id' => 'getUserId', 'add_time' => 'getAddTime', 'pinned_to_lead_flag' => 'getPinnedToLeadFlag', 'pinned_to_deal_flag' => 'getPinnedToDealFlag', 'pinned_to_organization_flag' => 'getPinnedToOrganizationFlag', - 'pinned_to_person_flag' => 'getPinnedToPersonFlag' + 'pinned_to_person_flag' => 'getPinnedToPersonFlag', + 'pinned_to_project_flag' => 'getPinnedToProjectFlag' ]; /** @@ -254,12 +264,14 @@ public function __construct(array $data = null) $this->container['deal_id'] = $data['deal_id'] ?? null; $this->container['person_id'] = $data['person_id'] ?? null; $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['project_id'] = $data['project_id'] ?? null; $this->container['user_id'] = $data['user_id'] ?? null; $this->container['add_time'] = $data['add_time'] ?? null; $this->container['pinned_to_lead_flag'] = $data['pinned_to_lead_flag'] ?? null; $this->container['pinned_to_deal_flag'] = $data['pinned_to_deal_flag'] ?? null; $this->container['pinned_to_organization_flag'] = $data['pinned_to_organization_flag'] ?? null; $this->container['pinned_to_person_flag'] = $data['pinned_to_person_flag'] ?? null; + $this->container['pinned_to_project_flag'] = $data['pinned_to_project_flag'] ?? null; } /** @@ -328,7 +340,7 @@ public function getLeadId() /** * Sets lead_id * - * @param string|null $lead_id The ID of the lead the note will be attached to. This property is required unless one of (`deal_id/person_id/org_id`) is specified. + * @param string|null $lead_id The ID of the lead the note will be attached to. This property is required unless one of (`deal_id/person_id/org_id/project_id`) is specified. * * @return self */ @@ -352,7 +364,7 @@ public function getDealId() /** * Sets deal_id * - * @param int|null $deal_id The ID of the deal the note will be attached to. This property is required unless one of (`lead_id/person_id/org_id`) is specified. + * @param int|null $deal_id The ID of the deal the note will be attached to. This property is required unless one of (`lead_id/person_id/org_id/project_id`) is specified. * * @return self */ @@ -376,7 +388,7 @@ public function getPersonId() /** * Sets person_id * - * @param int|null $person_id The ID of the person this note will be attached to. This property is required unless one of (`deal_id/lead_id/org_id`) is specified. + * @param int|null $person_id The ID of the person this note will be attached to. This property is required unless one of (`deal_id/lead_id/org_id/project_id`) is specified. * * @return self */ @@ -400,7 +412,7 @@ public function getOrgId() /** * Sets org_id * - * @param int|null $org_id The ID of the organization this note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id`) is specified. + * @param int|null $org_id The ID of the organization this note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id/project_id`) is specified. * * @return self */ @@ -411,6 +423,30 @@ public function setOrgId($org_id): self return $this; } + /** + * Gets project_id + * + * @return int|null + */ + public function getProjectId() + { + return $this->container['project_id']; + } + + /** + * Sets project_id + * + * @param int|null $project_id The ID of the project the note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id/org_id`) is specified. + * + * @return self + */ + public function setProjectId($project_id): self + { + $this->container['project_id'] = $project_id; + + return $this; + } + /** * Gets user_id * @@ -554,6 +590,30 @@ public function setPinnedToPersonFlag($pinned_to_person_flag): self return $this; } + + /** + * Gets pinned_to_project_flag + * + * @return \Pipedrive\versions\v1\Model\NumberBoolean|null + */ + public function getPinnedToProjectFlag() + { + return $this->container['pinned_to_project_flag']; + } + + /** + * Sets pinned_to_project_flag + * + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_project_flag If set, the results are filtered by note to project pinning state (`project_id` is also required) + * + * @return self + */ + public function setPinnedToProjectFlag($pinned_to_project_flag): self + { + $this->container['pinned_to_project_flag'] = $pinned_to_project_flag; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/versions/v1/Model/AddNoteRequestAllOf.php b/lib/versions/v1/Model/AddNoteRequestAllOf.php index 0c750d5..c1f591f 100644 --- a/lib/versions/v1/Model/AddNoteRequestAllOf.php +++ b/lib/versions/v1/Model/AddNoteRequestAllOf.php @@ -70,7 +70,8 @@ class AddNoteRequestAllOf implements ModelInterface, ArrayAccess, JsonSerializab 'lead_id' => 'string', 'deal_id' => 'int', 'person_id' => 'int', - 'org_id' => 'int' + 'org_id' => 'int', + 'project_id' => 'int' ]; /** @@ -85,7 +86,8 @@ class AddNoteRequestAllOf implements ModelInterface, ArrayAccess, JsonSerializab 'lead_id' => 'uuid', 'deal_id' => null, 'person_id' => null, - 'org_id' => null + 'org_id' => null, + 'project_id' => null ]; /** @@ -123,7 +125,8 @@ public static function openAPIFormats(): array 'lead_id' => 'lead_id', 'deal_id' => 'deal_id', 'person_id' => 'person_id', - 'org_id' => 'org_id' + 'org_id' => 'org_id', + 'project_id' => 'project_id' ]; /** @@ -136,7 +139,8 @@ public static function openAPIFormats(): array 'lead_id' => 'setLeadId', 'deal_id' => 'setDealId', 'person_id' => 'setPersonId', - 'org_id' => 'setOrgId' + 'org_id' => 'setOrgId', + 'project_id' => 'setProjectId' ]; /** @@ -149,7 +153,8 @@ public static function openAPIFormats(): array 'lead_id' => 'getLeadId', 'deal_id' => 'getDealId', 'person_id' => 'getPersonId', - 'org_id' => 'getOrgId' + 'org_id' => 'getOrgId', + 'project_id' => 'getProjectId' ]; /** @@ -224,6 +229,7 @@ public function __construct(array $data = null) $this->container['deal_id'] = $data['deal_id'] ?? null; $this->container['person_id'] = $data['person_id'] ?? null; $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['project_id'] = $data['project_id'] ?? null; } /** @@ -292,7 +298,7 @@ public function getLeadId() /** * Sets lead_id * - * @param string|null $lead_id The ID of the lead the note will be attached to. This property is required unless one of (`deal_id/person_id/org_id`) is specified. + * @param string|null $lead_id The ID of the lead the note will be attached to. This property is required unless one of (`deal_id/person_id/org_id/project_id`) is specified. * * @return self */ @@ -316,7 +322,7 @@ public function getDealId() /** * Sets deal_id * - * @param int|null $deal_id The ID of the deal the note will be attached to. This property is required unless one of (`lead_id/person_id/org_id`) is specified. + * @param int|null $deal_id The ID of the deal the note will be attached to. This property is required unless one of (`lead_id/person_id/org_id/project_id`) is specified. * * @return self */ @@ -340,7 +346,7 @@ public function getPersonId() /** * Sets person_id * - * @param int|null $person_id The ID of the person this note will be attached to. This property is required unless one of (`deal_id/lead_id/org_id`) is specified. + * @param int|null $person_id The ID of the person this note will be attached to. This property is required unless one of (`deal_id/lead_id/org_id/project_id`) is specified. * * @return self */ @@ -364,7 +370,7 @@ public function getOrgId() /** * Sets org_id * - * @param int|null $org_id The ID of the organization this note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id`) is specified. + * @param int|null $org_id The ID of the organization this note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id/project_id`) is specified. * * @return self */ @@ -374,6 +380,30 @@ public function setOrgId($org_id): self return $this; } + + /** + * Gets project_id + * + * @return int|null + */ + public function getProjectId() + { + return $this->container['project_id']; + } + + /** + * Sets project_id + * + * @param int|null $project_id The ID of the project the note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id/org_id`) is specified. + * + * @return self + */ + public function setProjectId($project_id): self + { + $this->container['project_id'] = $project_id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/versions/v1/Model/BaseNote.php b/lib/versions/v1/Model/BaseNote.php index 41b70fe..a5267d9 100644 --- a/lib/versions/v1/Model/BaseNote.php +++ b/lib/versions/v1/Model/BaseNote.php @@ -78,9 +78,12 @@ class BaseNote implements ModelInterface, ArrayAccess, JsonSerializable 'organization' => '\Pipedrive\versions\v1\Model\BaseNoteOrganization', 'person' => '\Pipedrive\versions\v1\Model\BaseNotePerson', 'person_id' => 'int', + 'project_id' => 'int', + 'project' => '\Pipedrive\versions\v1\Model\BaseNoteProject', 'pinned_to_deal_flag' => 'bool', 'pinned_to_organization_flag' => 'bool', 'pinned_to_person_flag' => 'bool', + 'pinned_to_project_flag' => 'bool', 'update_time' => 'string', 'user' => '\Pipedrive\versions\v1\Model\NoteCreatorUser', 'user_id' => 'int' @@ -106,9 +109,12 @@ class BaseNote implements ModelInterface, ArrayAccess, JsonSerializable 'organization' => null, 'person' => null, 'person_id' => null, + 'project_id' => null, + 'project' => null, 'pinned_to_deal_flag' => null, 'pinned_to_organization_flag' => null, 'pinned_to_person_flag' => null, + 'pinned_to_project_flag' => null, 'update_time' => null, 'user' => null, 'user_id' => null @@ -157,9 +163,12 @@ public static function openAPIFormats(): array 'organization' => 'organization', 'person' => 'person', 'person_id' => 'person_id', + 'project_id' => 'project_id', + 'project' => 'project', 'pinned_to_deal_flag' => 'pinned_to_deal_flag', 'pinned_to_organization_flag' => 'pinned_to_organization_flag', 'pinned_to_person_flag' => 'pinned_to_person_flag', + 'pinned_to_project_flag' => 'pinned_to_project_flag', 'update_time' => 'update_time', 'user' => 'user', 'user_id' => 'user_id' @@ -183,9 +192,12 @@ public static function openAPIFormats(): array 'organization' => 'setOrganization', 'person' => 'setPerson', 'person_id' => 'setPersonId', + 'project_id' => 'setProjectId', + 'project' => 'setProject', 'pinned_to_deal_flag' => 'setPinnedToDealFlag', 'pinned_to_organization_flag' => 'setPinnedToOrganizationFlag', 'pinned_to_person_flag' => 'setPinnedToPersonFlag', + 'pinned_to_project_flag' => 'setPinnedToProjectFlag', 'update_time' => 'setUpdateTime', 'user' => 'setUser', 'user_id' => 'setUserId' @@ -209,9 +221,12 @@ public static function openAPIFormats(): array 'organization' => 'getOrganization', 'person' => 'getPerson', 'person_id' => 'getPersonId', + 'project_id' => 'getProjectId', + 'project' => 'getProject', 'pinned_to_deal_flag' => 'getPinnedToDealFlag', 'pinned_to_organization_flag' => 'getPinnedToOrganizationFlag', 'pinned_to_person_flag' => 'getPinnedToPersonFlag', + 'pinned_to_project_flag' => 'getPinnedToProjectFlag', 'update_time' => 'getUpdateTime', 'user' => 'getUser', 'user_id' => 'getUserId' @@ -296,9 +311,12 @@ public function __construct(array $data = null) $this->container['organization'] = $data['organization'] ?? null; $this->container['person'] = $data['person'] ?? null; $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['project_id'] = $data['project_id'] ?? null; + $this->container['project'] = $data['project'] ?? null; $this->container['pinned_to_deal_flag'] = $data['pinned_to_deal_flag'] ?? null; $this->container['pinned_to_organization_flag'] = $data['pinned_to_organization_flag'] ?? null; $this->container['pinned_to_person_flag'] = $data['pinned_to_person_flag'] ?? null; + $this->container['pinned_to_project_flag'] = $data['pinned_to_project_flag'] ?? null; $this->container['update_time'] = $data['update_time'] ?? null; $this->container['user'] = $data['user'] ?? null; $this->container['user_id'] = $data['user_id'] ?? null; @@ -618,6 +636,54 @@ public function setPersonId($person_id): self return $this; } + /** + * Gets project_id + * + * @return int|null + */ + public function getProjectId() + { + return $this->container['project_id']; + } + + /** + * Sets project_id + * + * @param int|null $project_id The ID of the project the note is attached to + * + * @return self + */ + public function setProjectId($project_id): self + { + $this->container['project_id'] = $project_id; + + return $this; + } + + /** + * Gets project + * + * @return \Pipedrive\versions\v1\Model\BaseNoteProject|null + */ + public function getProject() + { + return $this->container['project']; + } + + /** + * Sets project + * + * @param \Pipedrive\versions\v1\Model\BaseNoteProject|null $project project + * + * @return self + */ + public function setProject($project): self + { + $this->container['project'] = $project; + + return $this; + } + /** * Gets pinned_to_deal_flag * @@ -690,6 +756,30 @@ public function setPinnedToPersonFlag($pinned_to_person_flag): self return $this; } + /** + * Gets pinned_to_project_flag + * + * @return bool|null + */ + public function getPinnedToProjectFlag() + { + return $this->container['pinned_to_project_flag']; + } + + /** + * Sets pinned_to_project_flag + * + * @param bool|null $pinned_to_project_flag If true, the results are filtered by note to project pinning state + * + * @return self + */ + public function setPinnedToProjectFlag($pinned_to_project_flag): self + { + $this->container['pinned_to_project_flag'] = $pinned_to_project_flag; + + return $this; + } + /** * Gets update_time * diff --git a/lib/versions/v1/Model/BaseNoteProject.php b/lib/versions/v1/Model/BaseNoteProject.php new file mode 100644 index 0000000..b63f728 --- /dev/null +++ b/lib/versions/v1/Model/BaseNoteProject.php @@ -0,0 +1,346 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseNoteProject implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseNote_project'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'title' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'title' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'title' => 'getTitle' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['title'] = $data['title'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the project the note is attached to + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/versions/v1/Model/DealSearchItemItem.php b/lib/versions/v1/Model/DealSearchItemItem.php index 3087783..59fdfaa 100644 --- a/lib/versions/v1/Model/DealSearchItemItem.php +++ b/lib/versions/v1/Model/DealSearchItemItem.php @@ -78,7 +78,8 @@ class DealSearchItemItem implements ModelInterface, ArrayAccess, JsonSerializabl 'person' => '\Pipedrive\versions\v1\Model\DealSearchItemItemPerson', 'organization' => '\Pipedrive\versions\v1\Model\DealSearchItemItemOrganization', 'custom_fields' => 'string[]', - 'notes' => 'string[]' + 'notes' => 'string[]', + 'is_archived' => 'bool' ]; /** @@ -101,7 +102,8 @@ class DealSearchItemItem implements ModelInterface, ArrayAccess, JsonSerializabl 'person' => null, 'organization' => null, 'custom_fields' => null, - 'notes' => null + 'notes' => null, + 'is_archived' => null ]; /** @@ -147,7 +149,8 @@ public static function openAPIFormats(): array 'person' => 'person', 'organization' => 'organization', 'custom_fields' => 'custom_fields', - 'notes' => 'notes' + 'notes' => 'notes', + 'is_archived' => 'is_archived' ]; /** @@ -168,7 +171,8 @@ public static function openAPIFormats(): array 'person' => 'setPerson', 'organization' => 'setOrganization', 'custom_fields' => 'setCustomFields', - 'notes' => 'setNotes' + 'notes' => 'setNotes', + 'is_archived' => 'setIsArchived' ]; /** @@ -189,7 +193,8 @@ public static function openAPIFormats(): array 'person' => 'getPerson', 'organization' => 'getOrganization', 'custom_fields' => 'getCustomFields', - 'notes' => 'getNotes' + 'notes' => 'getNotes', + 'is_archived' => 'getIsArchived' ]; /** @@ -272,6 +277,7 @@ public function __construct(array $data = null) $this->container['organization'] = $data['organization'] ?? null; $this->container['custom_fields'] = $data['custom_fields'] ?? null; $this->container['notes'] = $data['notes'] ?? null; + $this->container['is_archived'] = $data['is_archived'] ?? null; } /** @@ -611,6 +617,30 @@ public function setNotes($notes): self return $this; } + + /** + * Gets is_archived + * + * @return bool|null + */ + public function getIsArchived() + { + return $this->container['is_archived']; + } + + /** + * Sets is_archived + * + * @param bool|null $is_archived A flag indicating whether the deal is archived or not + * + * @return self + */ + public function setIsArchived($is_archived): self + { + $this->container['is_archived'] = $is_archived; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/versions/v1/Model/Note.php b/lib/versions/v1/Model/Note.php index aa83e48..4e13c11 100644 --- a/lib/versions/v1/Model/Note.php +++ b/lib/versions/v1/Model/Note.php @@ -71,12 +71,14 @@ class Note implements ModelInterface, ArrayAccess, JsonSerializable 'deal_id' => 'int', 'person_id' => 'int', 'org_id' => 'int', + 'project_id' => 'int', 'user_id' => 'int', 'add_time' => 'string', 'pinned_to_lead_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean', 'pinned_to_deal_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean', 'pinned_to_organization_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean', - 'pinned_to_person_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean' + 'pinned_to_person_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean', + 'pinned_to_project_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean' ]; /** @@ -92,12 +94,14 @@ class Note implements ModelInterface, ArrayAccess, JsonSerializable 'deal_id' => null, 'person_id' => null, 'org_id' => null, + 'project_id' => null, 'user_id' => null, 'add_time' => null, 'pinned_to_lead_flag' => null, 'pinned_to_deal_flag' => null, 'pinned_to_organization_flag' => null, - 'pinned_to_person_flag' => null + 'pinned_to_person_flag' => null, + 'pinned_to_project_flag' => null ]; /** @@ -136,12 +140,14 @@ public static function openAPIFormats(): array 'deal_id' => 'deal_id', 'person_id' => 'person_id', 'org_id' => 'org_id', + 'project_id' => 'project_id', 'user_id' => 'user_id', 'add_time' => 'add_time', 'pinned_to_lead_flag' => 'pinned_to_lead_flag', 'pinned_to_deal_flag' => 'pinned_to_deal_flag', 'pinned_to_organization_flag' => 'pinned_to_organization_flag', - 'pinned_to_person_flag' => 'pinned_to_person_flag' + 'pinned_to_person_flag' => 'pinned_to_person_flag', + 'pinned_to_project_flag' => 'pinned_to_project_flag' ]; /** @@ -155,12 +161,14 @@ public static function openAPIFormats(): array 'deal_id' => 'setDealId', 'person_id' => 'setPersonId', 'org_id' => 'setOrgId', + 'project_id' => 'setProjectId', 'user_id' => 'setUserId', 'add_time' => 'setAddTime', 'pinned_to_lead_flag' => 'setPinnedToLeadFlag', 'pinned_to_deal_flag' => 'setPinnedToDealFlag', 'pinned_to_organization_flag' => 'setPinnedToOrganizationFlag', - 'pinned_to_person_flag' => 'setPinnedToPersonFlag' + 'pinned_to_person_flag' => 'setPinnedToPersonFlag', + 'pinned_to_project_flag' => 'setPinnedToProjectFlag' ]; /** @@ -174,12 +182,14 @@ public static function openAPIFormats(): array 'deal_id' => 'getDealId', 'person_id' => 'getPersonId', 'org_id' => 'getOrgId', + 'project_id' => 'getProjectId', 'user_id' => 'getUserId', 'add_time' => 'getAddTime', 'pinned_to_lead_flag' => 'getPinnedToLeadFlag', 'pinned_to_deal_flag' => 'getPinnedToDealFlag', 'pinned_to_organization_flag' => 'getPinnedToOrganizationFlag', - 'pinned_to_person_flag' => 'getPinnedToPersonFlag' + 'pinned_to_person_flag' => 'getPinnedToPersonFlag', + 'pinned_to_project_flag' => 'getPinnedToProjectFlag' ]; /** @@ -254,12 +264,14 @@ public function __construct(array $data = null) $this->container['deal_id'] = $data['deal_id'] ?? null; $this->container['person_id'] = $data['person_id'] ?? null; $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['project_id'] = $data['project_id'] ?? null; $this->container['user_id'] = $data['user_id'] ?? null; $this->container['add_time'] = $data['add_time'] ?? null; $this->container['pinned_to_lead_flag'] = $data['pinned_to_lead_flag'] ?? null; $this->container['pinned_to_deal_flag'] = $data['pinned_to_deal_flag'] ?? null; $this->container['pinned_to_organization_flag'] = $data['pinned_to_organization_flag'] ?? null; $this->container['pinned_to_person_flag'] = $data['pinned_to_person_flag'] ?? null; + $this->container['pinned_to_project_flag'] = $data['pinned_to_project_flag'] ?? null; } /** @@ -408,6 +420,30 @@ public function setOrgId($org_id): self return $this; } + /** + * Gets project_id + * + * @return int|null + */ + public function getProjectId() + { + return $this->container['project_id']; + } + + /** + * Sets project_id + * + * @param int|null $project_id The ID of the project the note will be attached to + * + * @return self + */ + public function setProjectId($project_id): self + { + $this->container['project_id'] = $project_id; + + return $this; + } + /** * Gets user_id * @@ -551,6 +587,30 @@ public function setPinnedToPersonFlag($pinned_to_person_flag): self return $this; } + + /** + * Gets pinned_to_project_flag + * + * @return \Pipedrive\versions\v1\Model\NumberBoolean|null + */ + public function getPinnedToProjectFlag() + { + return $this->container['pinned_to_project_flag']; + } + + /** + * Sets pinned_to_project_flag + * + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_project_flag If set, the results are filtered by note to project pinning state (`project_id` is also required) + * + * @return self + */ + public function setPinnedToProjectFlag($pinned_to_project_flag): self + { + $this->container['pinned_to_project_flag'] = $pinned_to_project_flag; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/versions/v1/Model/NoteConnectToParams.php b/lib/versions/v1/Model/NoteConnectToParams.php index cb23bd3..5becc54 100644 --- a/lib/versions/v1/Model/NoteConnectToParams.php +++ b/lib/versions/v1/Model/NoteConnectToParams.php @@ -69,7 +69,8 @@ class NoteConnectToParams implements ModelInterface, ArrayAccess, JsonSerializab 'lead_id' => 'string', 'deal_id' => 'int', 'person_id' => 'int', - 'org_id' => 'int' + 'org_id' => 'int', + 'project_id' => 'int' ]; /** @@ -83,7 +84,8 @@ class NoteConnectToParams implements ModelInterface, ArrayAccess, JsonSerializab 'lead_id' => 'uuid', 'deal_id' => null, 'person_id' => null, - 'org_id' => null + 'org_id' => null, + 'project_id' => null ]; /** @@ -120,7 +122,8 @@ public static function openAPIFormats(): array 'lead_id' => 'lead_id', 'deal_id' => 'deal_id', 'person_id' => 'person_id', - 'org_id' => 'org_id' + 'org_id' => 'org_id', + 'project_id' => 'project_id' ]; /** @@ -132,7 +135,8 @@ public static function openAPIFormats(): array 'lead_id' => 'setLeadId', 'deal_id' => 'setDealId', 'person_id' => 'setPersonId', - 'org_id' => 'setOrgId' + 'org_id' => 'setOrgId', + 'project_id' => 'setProjectId' ]; /** @@ -144,7 +148,8 @@ public static function openAPIFormats(): array 'lead_id' => 'getLeadId', 'deal_id' => 'getDealId', 'person_id' => 'getPersonId', - 'org_id' => 'getOrgId' + 'org_id' => 'getOrgId', + 'project_id' => 'getProjectId' ]; /** @@ -218,6 +223,7 @@ public function __construct(array $data = null) $this->container['deal_id'] = $data['deal_id'] ?? null; $this->container['person_id'] = $data['person_id'] ?? null; $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['project_id'] = $data['project_id'] ?? null; } /** @@ -341,6 +347,30 @@ public function setOrgId($org_id): self return $this; } + + /** + * Gets project_id + * + * @return int|null + */ + public function getProjectId() + { + return $this->container['project_id']; + } + + /** + * Sets project_id + * + * @param int|null $project_id The ID of the project the note will be attached to + * + * @return self + */ + public function setProjectId($project_id): self + { + $this->container['project_id'] = $project_id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/versions/v1/Model/NoteParams.php b/lib/versions/v1/Model/NoteParams.php index c025e1c..928b5be 100644 --- a/lib/versions/v1/Model/NoteParams.php +++ b/lib/versions/v1/Model/NoteParams.php @@ -71,7 +71,8 @@ class NoteParams implements ModelInterface, ArrayAccess, JsonSerializable 'pinned_to_lead_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean', 'pinned_to_deal_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean', 'pinned_to_organization_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean', - 'pinned_to_person_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean' + 'pinned_to_person_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean', + 'pinned_to_project_flag' => '\Pipedrive\versions\v1\Model\NumberBoolean' ]; /** @@ -87,7 +88,8 @@ class NoteParams implements ModelInterface, ArrayAccess, JsonSerializable 'pinned_to_lead_flag' => null, 'pinned_to_deal_flag' => null, 'pinned_to_organization_flag' => null, - 'pinned_to_person_flag' => null + 'pinned_to_person_flag' => null, + 'pinned_to_project_flag' => null ]; /** @@ -126,7 +128,8 @@ public static function openAPIFormats(): array 'pinned_to_lead_flag' => 'pinned_to_lead_flag', 'pinned_to_deal_flag' => 'pinned_to_deal_flag', 'pinned_to_organization_flag' => 'pinned_to_organization_flag', - 'pinned_to_person_flag' => 'pinned_to_person_flag' + 'pinned_to_person_flag' => 'pinned_to_person_flag', + 'pinned_to_project_flag' => 'pinned_to_project_flag' ]; /** @@ -140,7 +143,8 @@ public static function openAPIFormats(): array 'pinned_to_lead_flag' => 'setPinnedToLeadFlag', 'pinned_to_deal_flag' => 'setPinnedToDealFlag', 'pinned_to_organization_flag' => 'setPinnedToOrganizationFlag', - 'pinned_to_person_flag' => 'setPinnedToPersonFlag' + 'pinned_to_person_flag' => 'setPinnedToPersonFlag', + 'pinned_to_project_flag' => 'setPinnedToProjectFlag' ]; /** @@ -154,7 +158,8 @@ public static function openAPIFormats(): array 'pinned_to_lead_flag' => 'getPinnedToLeadFlag', 'pinned_to_deal_flag' => 'getPinnedToDealFlag', 'pinned_to_organization_flag' => 'getPinnedToOrganizationFlag', - 'pinned_to_person_flag' => 'getPinnedToPersonFlag' + 'pinned_to_person_flag' => 'getPinnedToPersonFlag', + 'pinned_to_project_flag' => 'getPinnedToProjectFlag' ]; /** @@ -230,6 +235,7 @@ public function __construct(array $data = null) $this->container['pinned_to_deal_flag'] = $data['pinned_to_deal_flag'] ?? null; $this->container['pinned_to_organization_flag'] = $data['pinned_to_organization_flag'] ?? null; $this->container['pinned_to_person_flag'] = $data['pinned_to_person_flag'] ?? null; + $this->container['pinned_to_project_flag'] = $data['pinned_to_project_flag'] ?? null; } /** @@ -401,6 +407,30 @@ public function setPinnedToPersonFlag($pinned_to_person_flag): self return $this; } + + /** + * Gets pinned_to_project_flag + * + * @return \Pipedrive\versions\v1\Model\NumberBoolean|null + */ + public function getPinnedToProjectFlag() + { + return $this->container['pinned_to_project_flag']; + } + + /** + * Sets pinned_to_project_flag + * + * @param \Pipedrive\versions\v1\Model\NumberBoolean|null $pinned_to_project_flag If set, the results are filtered by note to project pinning state (`project_id` is also required) + * + * @return self + */ + public function setPinnedToProjectFlag($pinned_to_project_flag): self + { + $this->container['pinned_to_project_flag'] = $pinned_to_project_flag; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/versions/v2/Api/ActivitiesApi.php b/lib/versions/v2/Api/ActivitiesApi.php index eee6577..6e214eb 100644 --- a/lib/versions/v2/Api/ActivitiesApi.php +++ b/lib/versions/v2/Api/ActivitiesApi.php @@ -717,9 +717,10 @@ public function deleteActivityRequest($id): Request * @param string|null $lead_id If supplied, only activities linked to the specified lead are returned. If filter_id is provided, this is ignored. (optional) * @param int|null $person_id If supplied, only activities whose primary participant is the given person are returned. If filter_id is provided, this is ignored. (optional) * @param int|null $org_id If supplied, only activities linked to the specified organization are returned. If filter_id is provided, this is ignored. (optional) + * @param bool|null $done If supplied, only activities with specified 'done' flag value are returned (optional) * @param string|null $updated_since If set, only activities with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) * @param string|null $updated_until If set, only activities with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) - * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `update_time`, `add_time`. (optional, default to 'id') + * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `update_time`, `add_time`, `due_date`. (optional, default to 'id') * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -729,9 +730,9 @@ public function deleteActivityRequest($id): Request * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v2\Model\GetActivities */ - public function getActivities($filter_id = null, $ids = null, $owner_id = null, $deal_id = null, $lead_id = null, $person_id = null, $org_id = null, $updated_since = null, $updated_until = null, $sort_by = 'id', $sort_direction = 'asc', $include_fields = null, $limit = null, $cursor = null) + public function getActivities($filter_id = null, $ids = null, $owner_id = null, $deal_id = null, $lead_id = null, $person_id = null, $org_id = null, $done = null, $updated_since = null, $updated_until = null, $sort_by = 'id', $sort_direction = 'asc', $include_fields = null, $limit = null, $cursor = null) { - list($response) = $this->getActivitiesWithHttpInfo($filter_id, $ids, $owner_id, $deal_id, $lead_id, $person_id, $org_id, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $limit, $cursor); + list($response) = $this->getActivitiesWithHttpInfo($filter_id, $ids, $owner_id, $deal_id, $lead_id, $person_id, $org_id, $done, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $limit, $cursor); return $response; } @@ -747,9 +748,10 @@ public function getActivities($filter_id = null, $ids = null, $owner_id = null, * @param string|null $lead_id If supplied, only activities linked to the specified lead are returned. If filter_id is provided, this is ignored. (optional) * @param int|null $person_id If supplied, only activities whose primary participant is the given person are returned. If filter_id is provided, this is ignored. (optional) * @param int|null $org_id If supplied, only activities linked to the specified organization are returned. If filter_id is provided, this is ignored. (optional) + * @param bool|null $done If supplied, only activities with specified 'done' flag value are returned (optional) * @param string|null $updated_since If set, only activities with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) * @param string|null $updated_until If set, only activities with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) - * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `update_time`, `add_time`. (optional, default to 'id') + * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `update_time`, `add_time`, `due_date`. (optional, default to 'id') * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -759,9 +761,9 @@ public function getActivities($filter_id = null, $ids = null, $owner_id = null, * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v2\Model\GetActivities, HTTP status code, HTTP response headers (array of strings) */ - public function getActivitiesWithHttpInfo($filter_id = null, $ids = null, $owner_id = null, $deal_id = null, $lead_id = null, $person_id = null, $org_id = null, $updated_since = null, $updated_until = null, $sort_by = 'id', $sort_direction = 'asc', $include_fields = null, $limit = null, $cursor = null) + public function getActivitiesWithHttpInfo($filter_id = null, $ids = null, $owner_id = null, $deal_id = null, $lead_id = null, $person_id = null, $org_id = null, $done = null, $updated_since = null, $updated_until = null, $sort_by = 'id', $sort_direction = 'asc', $include_fields = null, $limit = null, $cursor = null) { - $request = $this->getActivitiesRequest($filter_id, $ids, $owner_id, $deal_id, $lead_id, $person_id, $org_id, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $limit, $cursor); + $request = $this->getActivitiesRequest($filter_id, $ids, $owner_id, $deal_id, $lead_id, $person_id, $org_id, $done, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $limit, $cursor); try { $options = $this->createHttpClientOption(); @@ -770,7 +772,7 @@ public function getActivitiesWithHttpInfo($filter_id = null, $ids = null, $owner } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->getActivitiesRequest($filter_id, $ids, $owner_id, $deal_id, $lead_id, $person_id, $org_id, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $limit, $cursor); + $request = $this->getActivitiesRequest($filter_id, $ids, $owner_id, $deal_id, $lead_id, $person_id, $org_id, $done, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $limit, $cursor); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -861,9 +863,10 @@ public function getActivitiesWithHttpInfo($filter_id = null, $ids = null, $owner * @param string|null $lead_id If supplied, only activities linked to the specified lead are returned. If filter_id is provided, this is ignored. (optional) * @param int|null $person_id If supplied, only activities whose primary participant is the given person are returned. If filter_id is provided, this is ignored. (optional) * @param int|null $org_id If supplied, only activities linked to the specified organization are returned. If filter_id is provided, this is ignored. (optional) + * @param bool|null $done If supplied, only activities with specified 'done' flag value are returned (optional) * @param string|null $updated_since If set, only activities with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) * @param string|null $updated_until If set, only activities with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) - * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `update_time`, `add_time`. (optional, default to 'id') + * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `update_time`, `add_time`, `due_date`. (optional, default to 'id') * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -872,9 +875,9 @@ public function getActivitiesWithHttpInfo($filter_id = null, $ids = null, $owner * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getActivitiesAsync($filter_id = null, $ids = null, $owner_id = null, $deal_id = null, $lead_id = null, $person_id = null, $org_id = null, $updated_since = null, $updated_until = null, $sort_by = 'id', $sort_direction = 'asc', $include_fields = null, $limit = null, $cursor = null): PromiseInterface + public function getActivitiesAsync($filter_id = null, $ids = null, $owner_id = null, $deal_id = null, $lead_id = null, $person_id = null, $org_id = null, $done = null, $updated_since = null, $updated_until = null, $sort_by = 'id', $sort_direction = 'asc', $include_fields = null, $limit = null, $cursor = null): PromiseInterface { - return $this->getActivitiesAsyncWithHttpInfo($filter_id, $ids, $owner_id, $deal_id, $lead_id, $person_id, $org_id, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $limit, $cursor) + return $this->getActivitiesAsyncWithHttpInfo($filter_id, $ids, $owner_id, $deal_id, $lead_id, $person_id, $org_id, $done, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $limit, $cursor) ->then( function ($response) { return $response[0]; @@ -894,9 +897,10 @@ function ($response) { * @param string|null $lead_id If supplied, only activities linked to the specified lead are returned. If filter_id is provided, this is ignored. (optional) * @param int|null $person_id If supplied, only activities whose primary participant is the given person are returned. If filter_id is provided, this is ignored. (optional) * @param int|null $org_id If supplied, only activities linked to the specified organization are returned. If filter_id is provided, this is ignored. (optional) + * @param bool|null $done If supplied, only activities with specified 'done' flag value are returned (optional) * @param string|null $updated_since If set, only activities with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) * @param string|null $updated_until If set, only activities with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) - * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `update_time`, `add_time`. (optional, default to 'id') + * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `update_time`, `add_time`, `due_date`. (optional, default to 'id') * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -905,10 +909,10 @@ function ($response) { * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getActivitiesAsyncWithHttpInfo($filter_id = null, $ids = null, $owner_id = null, $deal_id = null, $lead_id = null, $person_id = null, $org_id = null, $updated_since = null, $updated_until = null, $sort_by = 'id', $sort_direction = 'asc', $include_fields = null, $limit = null, $cursor = null): PromiseInterface + public function getActivitiesAsyncWithHttpInfo($filter_id = null, $ids = null, $owner_id = null, $deal_id = null, $lead_id = null, $person_id = null, $org_id = null, $done = null, $updated_since = null, $updated_until = null, $sort_by = 'id', $sort_direction = 'asc', $include_fields = null, $limit = null, $cursor = null): PromiseInterface { $returnType = '\Pipedrive\versions\v2\Model\GetActivities'; - $request = $this->getActivitiesRequest($filter_id, $ids, $owner_id, $deal_id, $lead_id, $person_id, $org_id, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $limit, $cursor); + $request = $this->getActivitiesRequest($filter_id, $ids, $owner_id, $deal_id, $lead_id, $person_id, $org_id, $done, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $limit, $cursor); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -954,9 +958,10 @@ function ($exception) { * @param string|null $lead_id If supplied, only activities linked to the specified lead are returned. If filter_id is provided, this is ignored. (optional) * @param int|null $person_id If supplied, only activities whose primary participant is the given person are returned. If filter_id is provided, this is ignored. (optional) * @param int|null $org_id If supplied, only activities linked to the specified organization are returned. If filter_id is provided, this is ignored. (optional) + * @param bool|null $done If supplied, only activities with specified 'done' flag value are returned (optional) * @param string|null $updated_since If set, only activities with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) * @param string|null $updated_until If set, only activities with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) - * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `update_time`, `add_time`. (optional, default to 'id') + * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `update_time`, `add_time`, `due_date`. (optional, default to 'id') * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) @@ -965,7 +970,7 @@ function ($exception) { * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function getActivitiesRequest($filter_id = null, $ids = null, $owner_id = null, $deal_id = null, $lead_id = null, $person_id = null, $org_id = null, $updated_since = null, $updated_until = null, $sort_by = 'id', $sort_direction = 'asc', $include_fields = null, $limit = null, $cursor = null): Request + public function getActivitiesRequest($filter_id = null, $ids = null, $owner_id = null, $deal_id = null, $lead_id = null, $person_id = null, $org_id = null, $done = null, $updated_since = null, $updated_until = null, $sort_by = 'id', $sort_direction = 'asc', $include_fields = null, $limit = null, $cursor = null): Request { $resourcePath = '/activities'; @@ -1033,6 +1038,14 @@ public function getActivitiesRequest($filter_id = null, $ids = null, $owner_id = } // query params /* @phpstan-ignore-next-line */ + if (is_array($done)) { + $done = ObjectSerializer::serializeCollection($done, '', true); + } + if ($done !== null) { + $queryParams['done'] = $done; + } + // query params + /* @phpstan-ignore-next-line */ if (is_array($updated_since)) { $updated_since = ObjectSerializer::serializeCollection($updated_since, '', true); } diff --git a/lib/versions/v2/Api/BetaApi.php b/lib/versions/v2/Api/BetaApi.php index eaf5352..8c49822 100644 --- a/lib/versions/v2/Api/BetaApi.php +++ b/lib/versions/v2/Api/BetaApi.php @@ -123,38 +123,36 @@ public function getConfig(): Configuration } /** - * Operation deleteInstallment + * Operation convertDealToLead * - * Delete an installment from a deal + * Convert a deal to a lead (BETA) * - * @param int $id The ID of the deal (required) - * @param int $installment_id The ID of the installment (required) + * @param int $id The ID of the deal to convert (required) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return \Pipedrive\versions\v2\Model\DeleteInstallmentResponse + * @return \Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse|\Pipedrive\versions\v2\Model\GetConvertResponse */ - public function deleteInstallment($id, $installment_id) + public function convertDealToLead($id) { - list($response) = $this->deleteInstallmentWithHttpInfo($id, $installment_id); + list($response) = $this->convertDealToLeadWithHttpInfo($id); return $response; } /** - * Operation deleteInstallmentWithHttpInfo + * Operation convertDealToLeadWithHttpInfo * - * Delete an installment from a deal + * Convert a deal to a lead (BETA) * - * @param int $id The ID of the deal (required) - * @param int $installment_id The ID of the installment (required) + * @param int $id The ID of the deal to convert (required) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return array of \Pipedrive\versions\v2\Model\DeleteInstallmentResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse|\Pipedrive\versions\v2\Model\GetConvertResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteInstallmentWithHttpInfo($id, $installment_id) + public function convertDealToLeadWithHttpInfo($id) { - $request = $this->deleteInstallmentRequest($id, $installment_id); + $request = $this->convertDealToLeadRequest($id); try { $options = $this->createHttpClientOption(); @@ -163,7 +161,7 @@ public function deleteInstallmentWithHttpInfo($id, $installment_id) } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->deleteInstallmentRequest($id, $installment_id); + $request = $this->convertDealToLeadRequest($id); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -188,14 +186,27 @@ public function deleteInstallmentWithHttpInfo($id, $installment_id) switch($statusCode) { case 200: /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\DeleteInstallmentResponse' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v2\Model\GetConvertResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\GetConvertResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -215,14 +226,14 @@ public function deleteInstallmentWithHttpInfo($id, $installment_id) } /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\DeleteInstallmentResponse' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -232,7 +243,15 @@ public function deleteInstallmentWithHttpInfo($id, $installment_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse', + '\Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v2\Model\GetConvertResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -243,19 +262,18 @@ public function deleteInstallmentWithHttpInfo($id, $installment_id) } /** - * Operation deleteInstallmentAsync + * Operation convertDealToLeadAsync * - * Delete an installment from a deal + * Convert a deal to a lead (BETA) * - * @param int $id The ID of the deal (required) - * @param int $installment_id The ID of the installment (required) + * @param int $id The ID of the deal to convert (required) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function deleteInstallmentAsync($id, $installment_id): PromiseInterface + public function convertDealToLeadAsync($id): PromiseInterface { - return $this->deleteInstallmentAsyncWithHttpInfo($id, $installment_id) + return $this->convertDealToLeadAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -264,20 +282,19 @@ function ($response) { } /** - * Operation deleteInstallmentAsyncWithHttpInfo + * Operation convertDealToLeadAsyncWithHttpInfo * - * Delete an installment from a deal + * Convert a deal to a lead (BETA) * - * @param int $id The ID of the deal (required) - * @param int $installment_id The ID of the installment (required) + * @param int $id The ID of the deal to convert (required) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function deleteInstallmentAsyncWithHttpInfo($id, $installment_id): PromiseInterface + public function convertDealToLeadAsyncWithHttpInfo($id): PromiseInterface { - $returnType = '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse'; - $request = $this->deleteInstallmentRequest($id, $installment_id); + $returnType = '\Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse'; + $request = $this->convertDealToLeadRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -314,32 +331,24 @@ function ($exception) { } /** - * Create request for operation 'deleteInstallment' + * Create request for operation 'convertDealToLead' * - * @param int $id The ID of the deal (required) - * @param int $installment_id The ID of the installment (required) + * @param int $id The ID of the deal to convert (required) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function deleteInstallmentRequest($id, $installment_id): Request + public function convertDealToLeadRequest($id): Request { // verify the required parameter 'id' is set /* @phpstan-ignore-next-line */ if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteInstallment' - ); - } - // verify the required parameter 'installment_id' is set - /* @phpstan-ignore-next-line */ - if ($installment_id === null || (is_array($installment_id) && count($installment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $installment_id when calling deleteInstallment' + 'Missing the required parameter $id when calling convertDealToLead' ); } - $resourcePath = '/deals/{id}/installments/{installment_id}'; + $resourcePath = '/deals/{id}/convert/lead'; $formParams = []; $queryParams = []; $headerParams = []; @@ -356,14 +365,6 @@ public function deleteInstallmentRequest($id, $installment_id): Request $resourcePath ); } - // path params - if ($installment_id !== null) { - $resourcePath = str_replace( - '{' . 'installment_id' . '}', - ObjectSerializer::toPathValue($installment_id), - $resourcePath - ); - } /* @phpstan-ignore-next-line */ @@ -431,7 +432,7 @@ public function deleteInstallmentRequest($id, $installment_id): Request $query = Query::build($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -439,44 +440,38 @@ public function deleteInstallmentRequest($id, $installment_id): Request } /** - * Operation getInstallments + * Operation convertLeadToDeal * - * List installments added to a list of deals + * Convert a lead to a deal (BETA) * - * @param int[] $deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. (required) - * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) - * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) - * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. (optional, default to 'id') - * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') + * @param string $id The ID of the lead to convert (required) + * @param \Pipedrive\versions\v2\Model\InlineObject|null $inline_object inline_object (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return \Pipedrive\versions\v2\Model\InstallmentsResponse + * @return \Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse|\Pipedrive\versions\v2\Model\GetConvertResponse */ - public function getInstallments($deal_ids, $cursor = null, $limit = null, $sort_by = 'id', $sort_direction = 'asc') + public function convertLeadToDeal($id, $inline_object = null) { - list($response) = $this->getInstallmentsWithHttpInfo($deal_ids, $cursor, $limit, $sort_by, $sort_direction); + list($response) = $this->convertLeadToDealWithHttpInfo($id, $inline_object); return $response; } /** - * Operation getInstallmentsWithHttpInfo + * Operation convertLeadToDealWithHttpInfo * - * List installments added to a list of deals + * Convert a lead to a deal (BETA) * - * @param int[] $deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. (required) - * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) - * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) - * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. (optional, default to 'id') - * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') + * @param string $id The ID of the lead to convert (required) + * @param \Pipedrive\versions\v2\Model\InlineObject|null $inline_object (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return array of \Pipedrive\versions\v2\Model\InstallmentsResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse|\Pipedrive\versions\v2\Model\GetConvertResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getInstallmentsWithHttpInfo($deal_ids, $cursor = null, $limit = null, $sort_by = 'id', $sort_direction = 'asc') + public function convertLeadToDealWithHttpInfo($id, $inline_object = null) { - $request = $this->getInstallmentsRequest($deal_ids, $cursor, $limit, $sort_by, $sort_direction); + $request = $this->convertLeadToDealRequest($id, $inline_object); try { $options = $this->createHttpClientOption(); @@ -485,7 +480,7 @@ public function getInstallmentsWithHttpInfo($deal_ids, $cursor = null, $limit = } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->getInstallmentsRequest($deal_ids, $cursor, $limit, $sort_by, $sort_direction); + $request = $this->convertLeadToDealRequest($id, $inline_object); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -510,14 +505,27 @@ public function getInstallmentsWithHttpInfo($deal_ids, $cursor = null, $limit = switch($statusCode) { case 200: /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\InstallmentsResponse' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\InstallmentsResponse', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v2\Model\GetConvertResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\GetConvertResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -537,14 +545,14 @@ public function getInstallmentsWithHttpInfo($deal_ids, $cursor = null, $limit = } /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\InstallmentsResponse' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\InstallmentsResponse', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -554,7 +562,15 @@ public function getInstallmentsWithHttpInfo($deal_ids, $cursor = null, $limit = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Pipedrive\versions\v2\Model\InstallmentsResponse', + '\Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v2\Model\GetConvertResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -565,22 +581,19 @@ public function getInstallmentsWithHttpInfo($deal_ids, $cursor = null, $limit = } /** - * Operation getInstallmentsAsync + * Operation convertLeadToDealAsync * - * List installments added to a list of deals + * Convert a lead to a deal (BETA) * - * @param int[] $deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. (required) - * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) - * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) - * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. (optional, default to 'id') - * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') + * @param string $id The ID of the lead to convert (required) + * @param \Pipedrive\versions\v2\Model\InlineObject|null $inline_object (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getInstallmentsAsync($deal_ids, $cursor = null, $limit = null, $sort_by = 'id', $sort_direction = 'asc'): PromiseInterface + public function convertLeadToDealAsync($id, $inline_object = null): PromiseInterface { - return $this->getInstallmentsAsyncWithHttpInfo($deal_ids, $cursor, $limit, $sort_by, $sort_direction) + return $this->convertLeadToDealAsyncWithHttpInfo($id, $inline_object) ->then( function ($response) { return $response[0]; @@ -589,23 +602,20 @@ function ($response) { } /** - * Operation getInstallmentsAsyncWithHttpInfo + * Operation convertLeadToDealAsyncWithHttpInfo * - * List installments added to a list of deals + * Convert a lead to a deal (BETA) * - * @param int[] $deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. (required) - * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) - * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) - * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. (optional, default to 'id') - * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') + * @param string $id The ID of the lead to convert (required) + * @param \Pipedrive\versions\v2\Model\InlineObject|null $inline_object (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getInstallmentsAsyncWithHttpInfo($deal_ids, $cursor = null, $limit = null, $sort_by = 'id', $sort_direction = 'asc'): PromiseInterface + public function convertLeadToDealAsyncWithHttpInfo($id, $inline_object = null): PromiseInterface { - $returnType = '\Pipedrive\versions\v2\Model\InstallmentsResponse'; - $request = $this->getInstallmentsRequest($deal_ids, $cursor, $limit, $sort_by, $sort_direction); + $returnType = '\Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse'; + $request = $this->convertLeadToDealRequest($id, $inline_object); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -642,76 +652,1239 @@ function ($exception) { } /** - * Create request for operation 'getInstallments' + * Create request for operation 'convertLeadToDeal' * - * @param int[] $deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. (required) - * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) - * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) - * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. (optional, default to 'id') - * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') + * @param string $id The ID of the lead to convert (required) + * @param \Pipedrive\versions\v2\Model\InlineObject|null $inline_object (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function getInstallmentsRequest($deal_ids, $cursor = null, $limit = null, $sort_by = 'id', $sort_direction = 'asc'): Request + public function convertLeadToDealRequest($id, $inline_object = null): Request { - // verify the required parameter 'deal_ids' is set + // verify the required parameter 'id' is set /* @phpstan-ignore-next-line */ - if ($deal_ids === null || (is_array($deal_ids) && count($deal_ids) === 0)) { + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $deal_ids when calling getInstallments' + 'Missing the required parameter $id when calling convertLeadToDeal' ); } - $resourcePath = '/deals/installments'; + $resourcePath = '/leads/{id}/convert/deal'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - /* @phpstan-ignore-next-line */ - if (is_array($deal_ids)) { - $deal_ids = ObjectSerializer::serializeCollection($deal_ids, 'csv', true); - } - if ($deal_ids !== null) { - $queryParams['deal_ids'] = $deal_ids; - } - // query params - /* @phpstan-ignore-next-line */ - if (is_array($cursor)) { - $cursor = ObjectSerializer::serializeCollection($cursor, '', true); - } - if ($cursor !== null) { - $queryParams['cursor'] = $cursor; + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); } - // query params + + /* @phpstan-ignore-next-line */ - if (is_array($limit)) { - $limit = ObjectSerializer::serializeCollection($limit, '', true); - } - if ($limit !== null) { - $queryParams['limit'] = $limit; + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); } - // query params - /* @phpstan-ignore-next-line */ - if (is_array($sort_by)) { - $sort_by = ObjectSerializer::serializeCollection($sort_by, '', true); + + // for model (json/xml) + if (isset($inline_object)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($inline_object)); + } else { + $httpBody = $inline_object; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } } - if ($sort_by !== null) { - $queryParams['sort_by'] = $sort_by; + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; } - // query params - /* @phpstan-ignore-next-line */ - if (is_array($sort_direction)) { - $sort_direction = ObjectSerializer::serializeCollection($sort_direction, '', true); + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } - if ($sort_direction !== null) { - $queryParams['sort_direction'] = $sort_direction; + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteInstallment + * + * Delete an installment from a deal + * + * @param int $id The ID of the deal (required) + * @param int $installment_id The ID of the installment (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\versions\v2\Model\DeleteInstallmentResponse + */ + public function deleteInstallment($id, $installment_id) + { + list($response) = $this->deleteInstallmentWithHttpInfo($id, $installment_id); + return $response; + } + + /** + * Operation deleteInstallmentWithHttpInfo + * + * Delete an installment from a deal + * + * @param int $id The ID of the deal (required) + * @param int $installment_id The ID of the installment (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\versions\v2\Model\DeleteInstallmentResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteInstallmentWithHttpInfo($id, $installment_id) + { + $request = $this->deleteInstallmentRequest($id, $installment_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteInstallmentRequest($id, $installment_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v2\Model\DeleteInstallmentResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v2\Model\DeleteInstallmentResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteInstallmentAsync + * + * Delete an installment from a deal + * + * @param int $id The ID of the deal (required) + * @param int $installment_id The ID of the installment (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteInstallmentAsync($id, $installment_id): PromiseInterface + { + return $this->deleteInstallmentAsyncWithHttpInfo($id, $installment_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteInstallmentAsyncWithHttpInfo + * + * Delete an installment from a deal + * + * @param int $id The ID of the deal (required) + * @param int $installment_id The ID of the installment (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteInstallmentAsyncWithHttpInfo($id, $installment_id): PromiseInterface + { + $returnType = '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse'; + $request = $this->deleteInstallmentRequest($id, $installment_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteInstallment' + * + * @param int $id The ID of the deal (required) + * @param int $installment_id The ID of the installment (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteInstallmentRequest($id, $installment_id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteInstallment' + ); + } + // verify the required parameter 'installment_id' is set + /* @phpstan-ignore-next-line */ + if ($installment_id === null || (is_array($installment_id) && count($installment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $installment_id when calling deleteInstallment' + ); + } + + $resourcePath = '/deals/{id}/installments/{installment_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($installment_id !== null) { + $resourcePath = str_replace( + '{' . 'installment_id' . '}', + ObjectSerializer::toPathValue($installment_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDealConversionStatus + * + * Get Deal conversion status (BETA) + * + * @param int $id The ID of a deal (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return void + */ + public function getDealConversionStatus($id, $conversion_id) + { + $this->getDealConversionStatusWithHttpInfo($id, $conversion_id); + } + + /** + * Operation getDealConversionStatusWithHttpInfo + * + * Get Deal conversion status (BETA) + * + * @param int $id The ID of a deal (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealConversionStatusWithHttpInfo($id, $conversion_id) + { + $request = $this->getDealConversionStatusRequest($id, $conversion_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealConversionStatusRequest($id, $conversion_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v2\Model\GetConvertResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealConversionStatusAsync + * + * Get Deal conversion status (BETA) + * + * @param int $id The ID of a deal (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealConversionStatusAsync($id, $conversion_id): PromiseInterface + { + return $this->getDealConversionStatusAsyncWithHttpInfo($id, $conversion_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealConversionStatusAsyncWithHttpInfo + * + * Get Deal conversion status (BETA) + * + * @param int $id The ID of a deal (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealConversionStatusAsyncWithHttpInfo($id, $conversion_id): PromiseInterface + { + $returnType = ''; + $request = $this->getDealConversionStatusRequest($id, $conversion_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealConversionStatus' + * + * @param int $id The ID of a deal (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealConversionStatusRequest($id, $conversion_id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getDealConversionStatus' + ); + } + // verify the required parameter 'conversion_id' is set + /* @phpstan-ignore-next-line */ + if ($conversion_id === null || (is_array($conversion_id) && count($conversion_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $conversion_id when calling getDealConversionStatus' + ); + } + + $resourcePath = '/deals/{id}/convert/status/{conversion_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($conversion_id !== null) { + $resourcePath = str_replace( + '{' . 'conversion_id' . '}', + ObjectSerializer::toPathValue($conversion_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getInstallments + * + * List installments added to a list of deals + * + * @param int[] $deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. (required) + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. (optional, default to 'id') + * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\versions\v2\Model\InstallmentsResponse + */ + public function getInstallments($deal_ids, $cursor = null, $limit = null, $sort_by = 'id', $sort_direction = 'asc') + { + list($response) = $this->getInstallmentsWithHttpInfo($deal_ids, $cursor, $limit, $sort_by, $sort_direction); + return $response; + } + + /** + * Operation getInstallmentsWithHttpInfo + * + * List installments added to a list of deals + * + * @param int[] $deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. (required) + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. (optional, default to 'id') + * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\versions\v2\Model\InstallmentsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getInstallmentsWithHttpInfo($deal_ids, $cursor = null, $limit = null, $sort_by = 'id', $sort_direction = 'asc') + { + $request = $this->getInstallmentsRequest($deal_ids, $cursor, $limit, $sort_by, $sort_direction); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getInstallmentsRequest($deal_ids, $cursor, $limit, $sort_by, $sort_direction); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v2\Model\InstallmentsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\InstallmentsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v2\Model\InstallmentsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\InstallmentsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v2\Model\InstallmentsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getInstallmentsAsync + * + * List installments added to a list of deals + * + * @param int[] $deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. (required) + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. (optional, default to 'id') + * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getInstallmentsAsync($deal_ids, $cursor = null, $limit = null, $sort_by = 'id', $sort_direction = 'asc'): PromiseInterface + { + return $this->getInstallmentsAsyncWithHttpInfo($deal_ids, $cursor, $limit, $sort_by, $sort_direction) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getInstallmentsAsyncWithHttpInfo + * + * List installments added to a list of deals + * + * @param int[] $deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. (required) + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. (optional, default to 'id') + * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getInstallmentsAsyncWithHttpInfo($deal_ids, $cursor = null, $limit = null, $sort_by = 'id', $sort_direction = 'asc'): PromiseInterface + { + $returnType = '\Pipedrive\versions\v2\Model\InstallmentsResponse'; + $request = $this->getInstallmentsRequest($deal_ids, $cursor, $limit, $sort_by, $sort_direction); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getInstallments' + * + * @param int[] $deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. (required) + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. (optional, default to 'id') + * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getInstallmentsRequest($deal_ids, $cursor = null, $limit = null, $sort_by = 'id', $sort_direction = 'asc'): Request + { + // verify the required parameter 'deal_ids' is set + /* @phpstan-ignore-next-line */ + if ($deal_ids === null || (is_array($deal_ids) && count($deal_ids) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $deal_ids when calling getInstallments' + ); + } + + $resourcePath = '/deals/installments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($deal_ids)) { + $deal_ids = ObjectSerializer::serializeCollection($deal_ids, 'csv', true); + } + if ($deal_ids !== null) { + $queryParams['deal_ids'] = $deal_ids; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($cursor)) { + $cursor = ObjectSerializer::serializeCollection($cursor, '', true); + } + if ($cursor !== null) { + $queryParams['cursor'] = $cursor; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort_by)) { + $sort_by = ObjectSerializer::serializeCollection($sort_by, '', true); + } + if ($sort_by !== null) { + $queryParams['sort_by'] = $sort_by; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort_direction)) { + $sort_direction = ObjectSerializer::serializeCollection($sort_direction, '', true); + } + if ($sort_direction !== null) { + $queryParams['sort_direction'] = $sort_direction; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLeadConversionStatus + * + * Get Lead conversion status (BETA) + * + * @param string $id The ID of a lead (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return void + */ + public function getLeadConversionStatus($id, $conversion_id) + { + $this->getLeadConversionStatusWithHttpInfo($id, $conversion_id); + } + + /** + * Operation getLeadConversionStatusWithHttpInfo + * + * Get Lead conversion status (BETA) + * + * @param string $id The ID of a lead (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function getLeadConversionStatusWithHttpInfo($id, $conversion_id) + { + $request = $this->getLeadConversionStatusRequest($id, $conversion_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getLeadConversionStatusRequest($id, $conversion_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v2\Model\GetConvertResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLeadConversionStatusAsync + * + * Get Lead conversion status (BETA) + * + * @param string $id The ID of a lead (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getLeadConversionStatusAsync($id, $conversion_id): PromiseInterface + { + return $this->getLeadConversionStatusAsyncWithHttpInfo($id, $conversion_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLeadConversionStatusAsyncWithHttpInfo + * + * Get Lead conversion status (BETA) + * + * @param string $id The ID of a lead (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getLeadConversionStatusAsyncWithHttpInfo($id, $conversion_id): PromiseInterface + { + $returnType = ''; + $request = $this->getLeadConversionStatusRequest($id, $conversion_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLeadConversionStatus' + * + * @param string $id The ID of a lead (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getLeadConversionStatusRequest($id, $conversion_id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getLeadConversionStatus' + ); + } + // verify the required parameter 'conversion_id' is set + /* @phpstan-ignore-next-line */ + if ($conversion_id === null || (is_array($conversion_id) && count($conversion_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $conversion_id when calling getLeadConversionStatus' + ); + } + + $resourcePath = '/leads/{id}/convert/status/{conversion_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($conversion_id !== null) { + $resourcePath = str_replace( + '{' . 'conversion_id' . '}', + ObjectSerializer::toPathValue($conversion_id), + $resourcePath + ); + } /* @phpstan-ignore-next-line */ diff --git a/lib/versions/v2/Api/DealsApi.php b/lib/versions/v2/Api/DealsApi.php index 8615557..1004616 100644 --- a/lib/versions/v2/Api/DealsApi.php +++ b/lib/versions/v2/Api/DealsApi.php @@ -1024,38 +1024,36 @@ public function addDealProductRequest($id, $new_deal_product_request_body = null } /** - * Operation deleteAdditionalDiscount + * Operation convertDealToLead * - * Delete a discount from a deal + * Convert a deal to a lead (BETA) * - * @param int $id The ID of the deal (required) - * @param int $discount_id The ID of the discount (required) + * @param int $id The ID of the deal to convert (required) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return \Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse + * @return \Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse|\Pipedrive\versions\v2\Model\GetConvertResponse */ - public function deleteAdditionalDiscount($id, $discount_id) + public function convertDealToLead($id) { - list($response) = $this->deleteAdditionalDiscountWithHttpInfo($id, $discount_id); + list($response) = $this->convertDealToLeadWithHttpInfo($id); return $response; } /** - * Operation deleteAdditionalDiscountWithHttpInfo + * Operation convertDealToLeadWithHttpInfo * - * Delete a discount from a deal + * Convert a deal to a lead (BETA) * - * @param int $id The ID of the deal (required) - * @param int $discount_id The ID of the discount (required) + * @param int $id The ID of the deal to convert (required) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return array of \Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse|\Pipedrive\versions\v2\Model\GetConvertResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteAdditionalDiscountWithHttpInfo($id, $discount_id) + public function convertDealToLeadWithHttpInfo($id) { - $request = $this->deleteAdditionalDiscountRequest($id, $discount_id); + $request = $this->convertDealToLeadRequest($id); try { $options = $this->createHttpClientOption(); @@ -1064,7 +1062,7 @@ public function deleteAdditionalDiscountWithHttpInfo($id, $discount_id) } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->deleteAdditionalDiscountRequest($id, $discount_id); + $request = $this->convertDealToLeadRequest($id); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -1089,14 +1087,27 @@ public function deleteAdditionalDiscountWithHttpInfo($id, $discount_id) switch($statusCode) { case 200: /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v2\Model\GetConvertResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\GetConvertResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1116,14 +1127,14 @@ public function deleteAdditionalDiscountWithHttpInfo($id, $discount_id) } /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1133,7 +1144,15 @@ public function deleteAdditionalDiscountWithHttpInfo($id, $discount_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse', + '\Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v2\Model\GetConvertResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1144,19 +1163,18 @@ public function deleteAdditionalDiscountWithHttpInfo($id, $discount_id) } /** - * Operation deleteAdditionalDiscountAsync + * Operation convertDealToLeadAsync * - * Delete a discount from a deal + * Convert a deal to a lead (BETA) * - * @param int $id The ID of the deal (required) - * @param int $discount_id The ID of the discount (required) + * @param int $id The ID of the deal to convert (required) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function deleteAdditionalDiscountAsync($id, $discount_id): PromiseInterface + public function convertDealToLeadAsync($id): PromiseInterface { - return $this->deleteAdditionalDiscountAsyncWithHttpInfo($id, $discount_id) + return $this->convertDealToLeadAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -1165,20 +1183,19 @@ function ($response) { } /** - * Operation deleteAdditionalDiscountAsyncWithHttpInfo + * Operation convertDealToLeadAsyncWithHttpInfo * - * Delete a discount from a deal + * Convert a deal to a lead (BETA) * - * @param int $id The ID of the deal (required) - * @param int $discount_id The ID of the discount (required) + * @param int $id The ID of the deal to convert (required) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function deleteAdditionalDiscountAsyncWithHttpInfo($id, $discount_id): PromiseInterface + public function convertDealToLeadAsyncWithHttpInfo($id): PromiseInterface { - $returnType = '\Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse'; - $request = $this->deleteAdditionalDiscountRequest($id, $discount_id); + $returnType = '\Pipedrive\versions\v2\Model\AddConvertDealToLeadResponse'; + $request = $this->convertDealToLeadRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1215,32 +1232,24 @@ function ($exception) { } /** - * Create request for operation 'deleteAdditionalDiscount' + * Create request for operation 'convertDealToLead' * - * @param int $id The ID of the deal (required) - * @param int $discount_id The ID of the discount (required) + * @param int $id The ID of the deal to convert (required) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function deleteAdditionalDiscountRequest($id, $discount_id): Request + public function convertDealToLeadRequest($id): Request { // verify the required parameter 'id' is set /* @phpstan-ignore-next-line */ if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteAdditionalDiscount' - ); - } - // verify the required parameter 'discount_id' is set - /* @phpstan-ignore-next-line */ - if ($discount_id === null || (is_array($discount_id) && count($discount_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $discount_id when calling deleteAdditionalDiscount' + 'Missing the required parameter $id when calling convertDealToLead' ); } - $resourcePath = '/deals/{id}/discounts/{discount_id}'; + $resourcePath = '/deals/{id}/convert/lead'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1257,14 +1266,6 @@ public function deleteAdditionalDiscountRequest($id, $discount_id): Request $resourcePath ); } - // path params - if ($discount_id !== null) { - $resourcePath = str_replace( - '{' . 'discount_id' . '}', - ObjectSerializer::toPathValue($discount_id), - $resourcePath - ); - } /* @phpstan-ignore-next-line */ @@ -1332,7 +1333,7 @@ public function deleteAdditionalDiscountRequest($id, $discount_id): Request $query = Query::build($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1340,36 +1341,38 @@ public function deleteAdditionalDiscountRequest($id, $discount_id): Request } /** - * Operation deleteDeal + * Operation deleteAdditionalDiscount * - * Delete a deal + * Delete a discount from a deal * * @param int $id The ID of the deal (required) + * @param int $discount_id The ID of the discount (required) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return \Pipedrive\versions\v2\Model\DeleteDealResponse + * @return \Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse */ - public function deleteDeal($id) + public function deleteAdditionalDiscount($id, $discount_id) { - list($response) = $this->deleteDealWithHttpInfo($id); + list($response) = $this->deleteAdditionalDiscountWithHttpInfo($id, $discount_id); return $response; } /** - * Operation deleteDealWithHttpInfo + * Operation deleteAdditionalDiscountWithHttpInfo * - * Delete a deal + * Delete a discount from a deal * * @param int $id The ID of the deal (required) + * @param int $discount_id The ID of the discount (required) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return array of \Pipedrive\versions\v2\Model\DeleteDealResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteDealWithHttpInfo($id) + public function deleteAdditionalDiscountWithHttpInfo($id, $discount_id) { - $request = $this->deleteDealRequest($id); + $request = $this->deleteAdditionalDiscountRequest($id, $discount_id); try { $options = $this->createHttpClientOption(); @@ -1378,7 +1381,7 @@ public function deleteDealWithHttpInfo($id) } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->deleteDealRequest($id); + $request = $this->deleteAdditionalDiscountRequest($id, $discount_id); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -1403,14 +1406,14 @@ public function deleteDealWithHttpInfo($id) switch($statusCode) { case 200: /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\DeleteDealResponse' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteDealResponse', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1430,14 +1433,14 @@ public function deleteDealWithHttpInfo($id) } /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\DeleteDealResponse' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteDealResponse', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1447,7 +1450,7 @@ public function deleteDealWithHttpInfo($id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Pipedrive\versions\v2\Model\DeleteDealResponse', + '\Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1458,18 +1461,19 @@ public function deleteDealWithHttpInfo($id) } /** - * Operation deleteDealAsync + * Operation deleteAdditionalDiscountAsync * - * Delete a deal + * Delete a discount from a deal * * @param int $id The ID of the deal (required) + * @param int $discount_id The ID of the discount (required) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function deleteDealAsync($id): PromiseInterface + public function deleteAdditionalDiscountAsync($id, $discount_id): PromiseInterface { - return $this->deleteDealAsyncWithHttpInfo($id) + return $this->deleteAdditionalDiscountAsyncWithHttpInfo($id, $discount_id) ->then( function ($response) { return $response[0]; @@ -1478,19 +1482,20 @@ function ($response) { } /** - * Operation deleteDealAsyncWithHttpInfo + * Operation deleteAdditionalDiscountAsyncWithHttpInfo * - * Delete a deal + * Delete a discount from a deal * * @param int $id The ID of the deal (required) + * @param int $discount_id The ID of the discount (required) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function deleteDealAsyncWithHttpInfo($id): PromiseInterface + public function deleteAdditionalDiscountAsyncWithHttpInfo($id, $discount_id): PromiseInterface { - $returnType = '\Pipedrive\versions\v2\Model\DeleteDealResponse'; - $request = $this->deleteDealRequest($id); + $returnType = '\Pipedrive\versions\v2\Model\DeleteAdditionalDiscountResponse'; + $request = $this->deleteAdditionalDiscountRequest($id, $discount_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1527,24 +1532,32 @@ function ($exception) { } /** - * Create request for operation 'deleteDeal' + * Create request for operation 'deleteAdditionalDiscount' * * @param int $id The ID of the deal (required) + * @param int $discount_id The ID of the discount (required) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function deleteDealRequest($id): Request + public function deleteAdditionalDiscountRequest($id, $discount_id): Request { // verify the required parameter 'id' is set /* @phpstan-ignore-next-line */ if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteDeal' + 'Missing the required parameter $id when calling deleteAdditionalDiscount' + ); + } + // verify the required parameter 'discount_id' is set + /* @phpstan-ignore-next-line */ + if ($discount_id === null || (is_array($discount_id) && count($discount_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $discount_id when calling deleteAdditionalDiscount' ); } - $resourcePath = '/deals/{id}'; + $resourcePath = '/deals/{id}/discounts/{discount_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1561,6 +1574,14 @@ public function deleteDealRequest($id): Request $resourcePath ); } + // path params + if ($discount_id !== null) { + $resourcePath = str_replace( + '{' . 'discount_id' . '}', + ObjectSerializer::toPathValue($discount_id), + $resourcePath + ); + } /* @phpstan-ignore-next-line */ @@ -1636,38 +1657,36 @@ public function deleteDealRequest($id): Request } /** - * Operation deleteDealFollower + * Operation deleteDeal * - * Delete a follower from a deal + * Delete a deal * * @param int $id The ID of the deal (required) - * @param int $follower_id The ID of the following user (required) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return \Pipedrive\versions\v2\Model\DeleteFollowerResponse + * @return \Pipedrive\versions\v2\Model\DeleteDealResponse */ - public function deleteDealFollower($id, $follower_id) + public function deleteDeal($id) { - list($response) = $this->deleteDealFollowerWithHttpInfo($id, $follower_id); + list($response) = $this->deleteDealWithHttpInfo($id); return $response; } /** - * Operation deleteDealFollowerWithHttpInfo + * Operation deleteDealWithHttpInfo * - * Delete a follower from a deal + * Delete a deal * * @param int $id The ID of the deal (required) - * @param int $follower_id The ID of the following user (required) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return array of \Pipedrive\versions\v2\Model\DeleteFollowerResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Pipedrive\versions\v2\Model\DeleteDealResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteDealFollowerWithHttpInfo($id, $follower_id) + public function deleteDealWithHttpInfo($id) { - $request = $this->deleteDealFollowerRequest($id, $follower_id); + $request = $this->deleteDealRequest($id); try { $options = $this->createHttpClientOption(); @@ -1676,7 +1695,7 @@ public function deleteDealFollowerWithHttpInfo($id, $follower_id) } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->deleteDealFollowerRequest($id, $follower_id); + $request = $this->deleteDealRequest($id); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -1701,14 +1720,14 @@ public function deleteDealFollowerWithHttpInfo($id, $follower_id) switch($statusCode) { case 200: /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\DeleteFollowerResponse' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\DeleteDealResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteFollowerResponse', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteDealResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1728,14 +1747,14 @@ public function deleteDealFollowerWithHttpInfo($id, $follower_id) } /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\DeleteFollowerResponse' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\DeleteDealResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteFollowerResponse', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteDealResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1745,7 +1764,7 @@ public function deleteDealFollowerWithHttpInfo($id, $follower_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Pipedrive\versions\v2\Model\DeleteFollowerResponse', + '\Pipedrive\versions\v2\Model\DeleteDealResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1756,19 +1775,18 @@ public function deleteDealFollowerWithHttpInfo($id, $follower_id) } /** - * Operation deleteDealFollowerAsync + * Operation deleteDealAsync * - * Delete a follower from a deal + * Delete a deal * * @param int $id The ID of the deal (required) - * @param int $follower_id The ID of the following user (required) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function deleteDealFollowerAsync($id, $follower_id): PromiseInterface + public function deleteDealAsync($id): PromiseInterface { - return $this->deleteDealFollowerAsyncWithHttpInfo($id, $follower_id) + return $this->deleteDealAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -1777,20 +1795,19 @@ function ($response) { } /** - * Operation deleteDealFollowerAsyncWithHttpInfo + * Operation deleteDealAsyncWithHttpInfo * - * Delete a follower from a deal + * Delete a deal * * @param int $id The ID of the deal (required) - * @param int $follower_id The ID of the following user (required) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function deleteDealFollowerAsyncWithHttpInfo($id, $follower_id): PromiseInterface + public function deleteDealAsyncWithHttpInfo($id): PromiseInterface { - $returnType = '\Pipedrive\versions\v2\Model\DeleteFollowerResponse'; - $request = $this->deleteDealFollowerRequest($id, $follower_id); + $returnType = '\Pipedrive\versions\v2\Model\DeleteDealResponse'; + $request = $this->deleteDealRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1827,32 +1844,24 @@ function ($exception) { } /** - * Create request for operation 'deleteDealFollower' + * Create request for operation 'deleteDeal' * * @param int $id The ID of the deal (required) - * @param int $follower_id The ID of the following user (required) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function deleteDealFollowerRequest($id, $follower_id): Request + public function deleteDealRequest($id): Request { // verify the required parameter 'id' is set /* @phpstan-ignore-next-line */ if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteDealFollower' - ); - } - // verify the required parameter 'follower_id' is set - /* @phpstan-ignore-next-line */ - if ($follower_id === null || (is_array($follower_id) && count($follower_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $follower_id when calling deleteDealFollower' + 'Missing the required parameter $id when calling deleteDeal' ); } - $resourcePath = '/deals/{id}/followers/{follower_id}'; + $resourcePath = '/deals/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1869,14 +1878,6 @@ public function deleteDealFollowerRequest($id, $follower_id): Request $resourcePath ); } - // path params - if ($follower_id !== null) { - $resourcePath = str_replace( - '{' . 'follower_id' . '}', - ObjectSerializer::toPathValue($follower_id), - $resourcePath - ); - } /* @phpstan-ignore-next-line */ @@ -1952,38 +1953,38 @@ public function deleteDealFollowerRequest($id, $follower_id): Request } /** - * Operation deleteDealProduct + * Operation deleteDealFollower * - * Delete an attached product from a deal + * Delete a follower from a deal * * @param int $id The ID of the deal (required) - * @param int $product_attachment_id The product attachment ID (required) + * @param int $follower_id The ID of the following user (required) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return \Pipedrive\versions\v2\Model\DeleteDealProduct + * @return \Pipedrive\versions\v2\Model\DeleteFollowerResponse */ - public function deleteDealProduct($id, $product_attachment_id) + public function deleteDealFollower($id, $follower_id) { - list($response) = $this->deleteDealProductWithHttpInfo($id, $product_attachment_id); + list($response) = $this->deleteDealFollowerWithHttpInfo($id, $follower_id); return $response; } /** - * Operation deleteDealProductWithHttpInfo + * Operation deleteDealFollowerWithHttpInfo * - * Delete an attached product from a deal + * Delete a follower from a deal * * @param int $id The ID of the deal (required) - * @param int $product_attachment_id The product attachment ID (required) + * @param int $follower_id The ID of the following user (required) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return array of \Pipedrive\versions\v2\Model\DeleteDealProduct, HTTP status code, HTTP response headers (array of strings) + * @return array of \Pipedrive\versions\v2\Model\DeleteFollowerResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteDealProductWithHttpInfo($id, $product_attachment_id) + public function deleteDealFollowerWithHttpInfo($id, $follower_id) { - $request = $this->deleteDealProductRequest($id, $product_attachment_id); + $request = $this->deleteDealFollowerRequest($id, $follower_id); try { $options = $this->createHttpClientOption(); @@ -1992,7 +1993,7 @@ public function deleteDealProductWithHttpInfo($id, $product_attachment_id) } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->deleteDealProductRequest($id, $product_attachment_id); + $request = $this->deleteDealFollowerRequest($id, $follower_id); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -2017,14 +2018,14 @@ public function deleteDealProductWithHttpInfo($id, $product_attachment_id) switch($statusCode) { case 200: /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\DeleteDealProduct' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\DeleteFollowerResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteDealProduct', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteFollowerResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2044,14 +2045,14 @@ public function deleteDealProductWithHttpInfo($id, $product_attachment_id) } /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\DeleteDealProduct' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\DeleteFollowerResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteDealProduct', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteFollowerResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2061,7 +2062,7 @@ public function deleteDealProductWithHttpInfo($id, $product_attachment_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Pipedrive\versions\v2\Model\DeleteDealProduct', + '\Pipedrive\versions\v2\Model\DeleteFollowerResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2072,19 +2073,19 @@ public function deleteDealProductWithHttpInfo($id, $product_attachment_id) } /** - * Operation deleteDealProductAsync + * Operation deleteDealFollowerAsync * - * Delete an attached product from a deal + * Delete a follower from a deal * * @param int $id The ID of the deal (required) - * @param int $product_attachment_id The product attachment ID (required) + * @param int $follower_id The ID of the following user (required) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function deleteDealProductAsync($id, $product_attachment_id): PromiseInterface + public function deleteDealFollowerAsync($id, $follower_id): PromiseInterface { - return $this->deleteDealProductAsyncWithHttpInfo($id, $product_attachment_id) + return $this->deleteDealFollowerAsyncWithHttpInfo($id, $follower_id) ->then( function ($response) { return $response[0]; @@ -2093,20 +2094,20 @@ function ($response) { } /** - * Operation deleteDealProductAsyncWithHttpInfo + * Operation deleteDealFollowerAsyncWithHttpInfo * - * Delete an attached product from a deal + * Delete a follower from a deal * * @param int $id The ID of the deal (required) - * @param int $product_attachment_id The product attachment ID (required) + * @param int $follower_id The ID of the following user (required) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function deleteDealProductAsyncWithHttpInfo($id, $product_attachment_id): PromiseInterface + public function deleteDealFollowerAsyncWithHttpInfo($id, $follower_id): PromiseInterface { - $returnType = '\Pipedrive\versions\v2\Model\DeleteDealProduct'; - $request = $this->deleteDealProductRequest($id, $product_attachment_id); + $returnType = '\Pipedrive\versions\v2\Model\DeleteFollowerResponse'; + $request = $this->deleteDealFollowerRequest($id, $follower_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2143,32 +2144,32 @@ function ($exception) { } /** - * Create request for operation 'deleteDealProduct' + * Create request for operation 'deleteDealFollower' * * @param int $id The ID of the deal (required) - * @param int $product_attachment_id The product attachment ID (required) + * @param int $follower_id The ID of the following user (required) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function deleteDealProductRequest($id, $product_attachment_id): Request + public function deleteDealFollowerRequest($id, $follower_id): Request { // verify the required parameter 'id' is set /* @phpstan-ignore-next-line */ if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteDealProduct' + 'Missing the required parameter $id when calling deleteDealFollower' ); } - // verify the required parameter 'product_attachment_id' is set + // verify the required parameter 'follower_id' is set /* @phpstan-ignore-next-line */ - if ($product_attachment_id === null || (is_array($product_attachment_id) && count($product_attachment_id) === 0)) { + if ($follower_id === null || (is_array($follower_id) && count($follower_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $product_attachment_id when calling deleteDealProduct' + 'Missing the required parameter $follower_id when calling deleteDealFollower' ); } - $resourcePath = '/deals/{id}/products/{product_attachment_id}'; + $resourcePath = '/deals/{id}/followers/{follower_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2186,10 +2187,10 @@ public function deleteDealProductRequest($id, $product_attachment_id): Request ); } // path params - if ($product_attachment_id !== null) { + if ($follower_id !== null) { $resourcePath = str_replace( - '{' . 'product_attachment_id' . '}', - ObjectSerializer::toPathValue($product_attachment_id), + '{' . 'follower_id' . '}', + ObjectSerializer::toPathValue($follower_id), $resourcePath ); } @@ -2268,38 +2269,38 @@ public function deleteDealProductRequest($id, $product_attachment_id): Request } /** - * Operation deleteInstallment + * Operation deleteDealProduct * - * Delete an installment from a deal + * Delete an attached product from a deal * * @param int $id The ID of the deal (required) - * @param int $installment_id The ID of the installment (required) + * @param int $product_attachment_id The product attachment ID (required) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return \Pipedrive\versions\v2\Model\DeleteInstallmentResponse + * @return \Pipedrive\versions\v2\Model\DeleteDealProduct */ - public function deleteInstallment($id, $installment_id) + public function deleteDealProduct($id, $product_attachment_id) { - list($response) = $this->deleteInstallmentWithHttpInfo($id, $installment_id); + list($response) = $this->deleteDealProductWithHttpInfo($id, $product_attachment_id); return $response; } /** - * Operation deleteInstallmentWithHttpInfo + * Operation deleteDealProductWithHttpInfo * - * Delete an installment from a deal + * Delete an attached product from a deal * * @param int $id The ID of the deal (required) - * @param int $installment_id The ID of the installment (required) + * @param int $product_attachment_id The product attachment ID (required) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return array of \Pipedrive\versions\v2\Model\DeleteInstallmentResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Pipedrive\versions\v2\Model\DeleteDealProduct, HTTP status code, HTTP response headers (array of strings) */ - public function deleteInstallmentWithHttpInfo($id, $installment_id) + public function deleteDealProductWithHttpInfo($id, $product_attachment_id) { - $request = $this->deleteInstallmentRequest($id, $installment_id); + $request = $this->deleteDealProductRequest($id, $product_attachment_id); try { $options = $this->createHttpClientOption(); @@ -2308,7 +2309,7 @@ public function deleteInstallmentWithHttpInfo($id, $installment_id) } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->deleteInstallmentRequest($id, $installment_id); + $request = $this->deleteDealProductRequest($id, $product_attachment_id); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -2333,14 +2334,14 @@ public function deleteInstallmentWithHttpInfo($id, $installment_id) switch($statusCode) { case 200: /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\DeleteInstallmentResponse' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\DeleteDealProduct' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteDealProduct', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2360,14 +2361,14 @@ public function deleteInstallmentWithHttpInfo($id, $installment_id) } /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\DeleteInstallmentResponse' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\DeleteDealProduct' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteDealProduct', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2377,7 +2378,7 @@ public function deleteInstallmentWithHttpInfo($id, $installment_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse', + '\Pipedrive\versions\v2\Model\DeleteDealProduct', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2388,19 +2389,19 @@ public function deleteInstallmentWithHttpInfo($id, $installment_id) } /** - * Operation deleteInstallmentAsync + * Operation deleteDealProductAsync * - * Delete an installment from a deal + * Delete an attached product from a deal * * @param int $id The ID of the deal (required) - * @param int $installment_id The ID of the installment (required) + * @param int $product_attachment_id The product attachment ID (required) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function deleteInstallmentAsync($id, $installment_id): PromiseInterface + public function deleteDealProductAsync($id, $product_attachment_id): PromiseInterface { - return $this->deleteInstallmentAsyncWithHttpInfo($id, $installment_id) + return $this->deleteDealProductAsyncWithHttpInfo($id, $product_attachment_id) ->then( function ($response) { return $response[0]; @@ -2409,20 +2410,20 @@ function ($response) { } /** - * Operation deleteInstallmentAsyncWithHttpInfo + * Operation deleteDealProductAsyncWithHttpInfo * - * Delete an installment from a deal + * Delete an attached product from a deal * * @param int $id The ID of the deal (required) - * @param int $installment_id The ID of the installment (required) + * @param int $product_attachment_id The product attachment ID (required) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function deleteInstallmentAsyncWithHttpInfo($id, $installment_id): PromiseInterface + public function deleteDealProductAsyncWithHttpInfo($id, $product_attachment_id): PromiseInterface { - $returnType = '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse'; - $request = $this->deleteInstallmentRequest($id, $installment_id); + $returnType = '\Pipedrive\versions\v2\Model\DeleteDealProduct'; + $request = $this->deleteDealProductRequest($id, $product_attachment_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2459,32 +2460,32 @@ function ($exception) { } /** - * Create request for operation 'deleteInstallment' + * Create request for operation 'deleteDealProduct' * * @param int $id The ID of the deal (required) - * @param int $installment_id The ID of the installment (required) + * @param int $product_attachment_id The product attachment ID (required) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function deleteInstallmentRequest($id, $installment_id): Request + public function deleteDealProductRequest($id, $product_attachment_id): Request { // verify the required parameter 'id' is set /* @phpstan-ignore-next-line */ if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteInstallment' + 'Missing the required parameter $id when calling deleteDealProduct' ); } - // verify the required parameter 'installment_id' is set + // verify the required parameter 'product_attachment_id' is set /* @phpstan-ignore-next-line */ - if ($installment_id === null || (is_array($installment_id) && count($installment_id) === 0)) { + if ($product_attachment_id === null || (is_array($product_attachment_id) && count($product_attachment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $installment_id when calling deleteInstallment' + 'Missing the required parameter $product_attachment_id when calling deleteDealProduct' ); } - $resourcePath = '/deals/{id}/installments/{installment_id}'; + $resourcePath = '/deals/{id}/products/{product_attachment_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2502,10 +2503,10 @@ public function deleteInstallmentRequest($id, $installment_id): Request ); } // path params - if ($installment_id !== null) { + if ($product_attachment_id !== null) { $resourcePath = str_replace( - '{' . 'installment_id' . '}', - ObjectSerializer::toPathValue($installment_id), + '{' . 'product_attachment_id' . '}', + ObjectSerializer::toPathValue($product_attachment_id), $resourcePath ); } @@ -2584,36 +2585,38 @@ public function deleteInstallmentRequest($id, $installment_id): Request } /** - * Operation getAdditionalDiscounts + * Operation deleteInstallment * - * List discounts added to a deal + * Delete an installment from a deal * * @param int $id The ID of the deal (required) + * @param int $installment_id The ID of the installment (required) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return \Pipedrive\versions\v2\Model\AdditionalDiscountsResponse + * @return \Pipedrive\versions\v2\Model\DeleteInstallmentResponse */ - public function getAdditionalDiscounts($id) + public function deleteInstallment($id, $installment_id) { - list($response) = $this->getAdditionalDiscountsWithHttpInfo($id); + list($response) = $this->deleteInstallmentWithHttpInfo($id, $installment_id); return $response; } /** - * Operation getAdditionalDiscountsWithHttpInfo + * Operation deleteInstallmentWithHttpInfo * - * List discounts added to a deal + * Delete an installment from a deal * * @param int $id The ID of the deal (required) + * @param int $installment_id The ID of the installment (required) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return array of \Pipedrive\versions\v2\Model\AdditionalDiscountsResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Pipedrive\versions\v2\Model\DeleteInstallmentResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getAdditionalDiscountsWithHttpInfo($id) + public function deleteInstallmentWithHttpInfo($id, $installment_id) { - $request = $this->getAdditionalDiscountsRequest($id); + $request = $this->deleteInstallmentRequest($id, $installment_id); try { $options = $this->createHttpClientOption(); @@ -2622,7 +2625,7 @@ public function getAdditionalDiscountsWithHttpInfo($id) } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->getAdditionalDiscountsRequest($id); + $request = $this->deleteInstallmentRequest($id, $installment_id); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -2647,14 +2650,14 @@ public function getAdditionalDiscountsWithHttpInfo($id) switch($statusCode) { case 200: /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\AdditionalDiscountsResponse' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\DeleteInstallmentResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\AdditionalDiscountsResponse', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2674,14 +2677,14 @@ public function getAdditionalDiscountsWithHttpInfo($id) } /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\AdditionalDiscountsResponse' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\DeleteInstallmentResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\AdditionalDiscountsResponse', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2691,7 +2694,7 @@ public function getAdditionalDiscountsWithHttpInfo($id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Pipedrive\versions\v2\Model\AdditionalDiscountsResponse', + '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2702,18 +2705,19 @@ public function getAdditionalDiscountsWithHttpInfo($id) } /** - * Operation getAdditionalDiscountsAsync + * Operation deleteInstallmentAsync * - * List discounts added to a deal + * Delete an installment from a deal * * @param int $id The ID of the deal (required) + * @param int $installment_id The ID of the installment (required) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getAdditionalDiscountsAsync($id): PromiseInterface + public function deleteInstallmentAsync($id, $installment_id): PromiseInterface { - return $this->getAdditionalDiscountsAsyncWithHttpInfo($id) + return $this->deleteInstallmentAsyncWithHttpInfo($id, $installment_id) ->then( function ($response) { return $response[0]; @@ -2722,19 +2726,20 @@ function ($response) { } /** - * Operation getAdditionalDiscountsAsyncWithHttpInfo + * Operation deleteInstallmentAsyncWithHttpInfo * - * List discounts added to a deal + * Delete an installment from a deal * * @param int $id The ID of the deal (required) + * @param int $installment_id The ID of the installment (required) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getAdditionalDiscountsAsyncWithHttpInfo($id): PromiseInterface + public function deleteInstallmentAsyncWithHttpInfo($id, $installment_id): PromiseInterface { - $returnType = '\Pipedrive\versions\v2\Model\AdditionalDiscountsResponse'; - $request = $this->getAdditionalDiscountsRequest($id); + $returnType = '\Pipedrive\versions\v2\Model\DeleteInstallmentResponse'; + $request = $this->deleteInstallmentRequest($id, $installment_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2771,24 +2776,32 @@ function ($exception) { } /** - * Create request for operation 'getAdditionalDiscounts' + * Create request for operation 'deleteInstallment' * * @param int $id The ID of the deal (required) + * @param int $installment_id The ID of the installment (required) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function getAdditionalDiscountsRequest($id): Request + public function deleteInstallmentRequest($id, $installment_id): Request { // verify the required parameter 'id' is set /* @phpstan-ignore-next-line */ if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getAdditionalDiscounts' + 'Missing the required parameter $id when calling deleteInstallment' + ); + } + // verify the required parameter 'installment_id' is set + /* @phpstan-ignore-next-line */ + if ($installment_id === null || (is_array($installment_id) && count($installment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $installment_id when calling deleteInstallment' ); } - $resourcePath = '/deals/{id}/discounts'; + $resourcePath = '/deals/{id}/installments/{installment_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2805,6 +2818,14 @@ public function getAdditionalDiscountsRequest($id): Request $resourcePath ); } + // path params + if ($installment_id !== null) { + $resourcePath = str_replace( + '{' . 'installment_id' . '}', + ObjectSerializer::toPathValue($installment_id), + $resourcePath + ); + } /* @phpstan-ignore-next-line */ @@ -2872,7 +2893,7 @@ public function getAdditionalDiscountsRequest($id): Request $query = Query::build($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2880,40 +2901,36 @@ public function getAdditionalDiscountsRequest($id): Request } /** - * Operation getDeal + * Operation getAdditionalDiscounts * - * Get details of a deal + * List discounts added to a deal * * @param int $id The ID of the deal (required) - * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) - * @param string|null $custom_fields Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return \Pipedrive\versions\v2\Model\PostPatchGetDeal + * @return \Pipedrive\versions\v2\Model\AdditionalDiscountsResponse */ - public function getDeal($id, $include_fields = null, $custom_fields = null) + public function getAdditionalDiscounts($id) { - list($response) = $this->getDealWithHttpInfo($id, $include_fields, $custom_fields); + list($response) = $this->getAdditionalDiscountsWithHttpInfo($id); return $response; } /** - * Operation getDealWithHttpInfo + * Operation getAdditionalDiscountsWithHttpInfo * - * Get details of a deal + * List discounts added to a deal * * @param int $id The ID of the deal (required) - * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) - * @param string|null $custom_fields Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException - * @return array of \Pipedrive\versions\v2\Model\PostPatchGetDeal, HTTP status code, HTTP response headers (array of strings) + * @return array of \Pipedrive\versions\v2\Model\AdditionalDiscountsResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getDealWithHttpInfo($id, $include_fields = null, $custom_fields = null) + public function getAdditionalDiscountsWithHttpInfo($id) { - $request = $this->getDealRequest($id, $include_fields, $custom_fields); + $request = $this->getAdditionalDiscountsRequest($id); try { $options = $this->createHttpClientOption(); @@ -2922,7 +2939,7 @@ public function getDealWithHttpInfo($id, $include_fields = null, $custom_fields } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->getDealRequest($id, $include_fields, $custom_fields); + $request = $this->getAdditionalDiscountsRequest($id); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -2947,14 +2964,14 @@ public function getDealWithHttpInfo($id, $include_fields = null, $custom_fields switch($statusCode) { case 200: /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\PostPatchGetDeal' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\AdditionalDiscountsResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\PostPatchGetDeal', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\AdditionalDiscountsResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2974,14 +2991,14 @@ public function getDealWithHttpInfo($id, $include_fields = null, $custom_fields } /* @phpstan-ignore-next-line */ - if ('\Pipedrive\versions\v2\Model\PostPatchGetDeal' === '\SplFileObject') { + if ('\Pipedrive\versions\v2\Model\AdditionalDiscountsResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\PostPatchGetDeal', []), + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\AdditionalDiscountsResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2991,7 +3008,7 @@ public function getDealWithHttpInfo($id, $include_fields = null, $custom_fields case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Pipedrive\versions\v2\Model\PostPatchGetDeal', + '\Pipedrive\versions\v2\Model\AdditionalDiscountsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3002,18 +3019,802 @@ public function getDealWithHttpInfo($id, $include_fields = null, $custom_fields } /** - * Operation getDealAsync + * Operation getAdditionalDiscountsAsync * - * Get details of a deal + * List discounts added to a deal * * @param int $id The ID of the deal (required) - * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) - * @param string|null $custom_fields Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getDealAsync($id, $include_fields = null, $custom_fields = null): PromiseInterface + public function getAdditionalDiscountsAsync($id): PromiseInterface + { + return $this->getAdditionalDiscountsAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAdditionalDiscountsAsyncWithHttpInfo + * + * List discounts added to a deal + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getAdditionalDiscountsAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\versions\v2\Model\AdditionalDiscountsResponse'; + $request = $this->getAdditionalDiscountsRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAdditionalDiscounts' + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getAdditionalDiscountsRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getAdditionalDiscounts' + ); + } + + $resourcePath = '/deals/{id}/discounts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getArchivedDeals + * + * Get all archived deals + * + * @param int|null $filter_id If supplied, only deals matching the specified filter are returned (optional) + * @param string|null $ids Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. (optional) + * @param int|null $owner_id If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $person_id If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $org_id If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $pipeline_id If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $stage_id If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. (optional) + * @param string|null $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. (optional) + * @param string|null $updated_since If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) + * @param string|null $updated_until If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) + * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `update_time`, `add_time`. (optional, default to 'id') + * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') + * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) + * @param string|null $custom_fields Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\versions\v2\Model\GetDeals + */ + public function getArchivedDeals($filter_id = null, $ids = null, $owner_id = null, $person_id = null, $org_id = null, $pipeline_id = null, $stage_id = null, $status = null, $updated_since = null, $updated_until = null, $sort_by = 'id', $sort_direction = 'asc', $include_fields = null, $custom_fields = null, $limit = null, $cursor = null) + { + list($response) = $this->getArchivedDealsWithHttpInfo($filter_id, $ids, $owner_id, $person_id, $org_id, $pipeline_id, $stage_id, $status, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $custom_fields, $limit, $cursor); + return $response; + } + + /** + * Operation getArchivedDealsWithHttpInfo + * + * Get all archived deals + * + * @param int|null $filter_id If supplied, only deals matching the specified filter are returned (optional) + * @param string|null $ids Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. (optional) + * @param int|null $owner_id If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $person_id If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $org_id If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $pipeline_id If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $stage_id If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. (optional) + * @param string|null $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. (optional) + * @param string|null $updated_since If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) + * @param string|null $updated_until If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) + * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `update_time`, `add_time`. (optional, default to 'id') + * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') + * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) + * @param string|null $custom_fields Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\versions\v2\Model\GetDeals, HTTP status code, HTTP response headers (array of strings) + */ + public function getArchivedDealsWithHttpInfo($filter_id = null, $ids = null, $owner_id = null, $person_id = null, $org_id = null, $pipeline_id = null, $stage_id = null, $status = null, $updated_since = null, $updated_until = null, $sort_by = 'id', $sort_direction = 'asc', $include_fields = null, $custom_fields = null, $limit = null, $cursor = null) + { + $request = $this->getArchivedDealsRequest($filter_id, $ids, $owner_id, $person_id, $org_id, $pipeline_id, $stage_id, $status, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $custom_fields, $limit, $cursor); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getArchivedDealsRequest($filter_id, $ids, $owner_id, $person_id, $org_id, $pipeline_id, $stage_id, $status, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $custom_fields, $limit, $cursor); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v2\Model\GetDeals' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\GetDeals', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v2\Model\GetDeals' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\GetDeals', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v2\Model\GetDeals', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getArchivedDealsAsync + * + * Get all archived deals + * + * @param int|null $filter_id If supplied, only deals matching the specified filter are returned (optional) + * @param string|null $ids Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. (optional) + * @param int|null $owner_id If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $person_id If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $org_id If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $pipeline_id If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $stage_id If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. (optional) + * @param string|null $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. (optional) + * @param string|null $updated_since If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) + * @param string|null $updated_until If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) + * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `update_time`, `add_time`. (optional, default to 'id') + * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') + * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) + * @param string|null $custom_fields Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getArchivedDealsAsync($filter_id = null, $ids = null, $owner_id = null, $person_id = null, $org_id = null, $pipeline_id = null, $stage_id = null, $status = null, $updated_since = null, $updated_until = null, $sort_by = 'id', $sort_direction = 'asc', $include_fields = null, $custom_fields = null, $limit = null, $cursor = null): PromiseInterface + { + return $this->getArchivedDealsAsyncWithHttpInfo($filter_id, $ids, $owner_id, $person_id, $org_id, $pipeline_id, $stage_id, $status, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $custom_fields, $limit, $cursor) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getArchivedDealsAsyncWithHttpInfo + * + * Get all archived deals + * + * @param int|null $filter_id If supplied, only deals matching the specified filter are returned (optional) + * @param string|null $ids Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. (optional) + * @param int|null $owner_id If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $person_id If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $org_id If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $pipeline_id If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $stage_id If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. (optional) + * @param string|null $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. (optional) + * @param string|null $updated_since If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) + * @param string|null $updated_until If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) + * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `update_time`, `add_time`. (optional, default to 'id') + * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') + * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) + * @param string|null $custom_fields Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getArchivedDealsAsyncWithHttpInfo($filter_id = null, $ids = null, $owner_id = null, $person_id = null, $org_id = null, $pipeline_id = null, $stage_id = null, $status = null, $updated_since = null, $updated_until = null, $sort_by = 'id', $sort_direction = 'asc', $include_fields = null, $custom_fields = null, $limit = null, $cursor = null): PromiseInterface + { + $returnType = '\Pipedrive\versions\v2\Model\GetDeals'; + $request = $this->getArchivedDealsRequest($filter_id, $ids, $owner_id, $person_id, $org_id, $pipeline_id, $stage_id, $status, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $custom_fields, $limit, $cursor); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getArchivedDeals' + * + * @param int|null $filter_id If supplied, only deals matching the specified filter are returned (optional) + * @param string|null $ids Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. (optional) + * @param int|null $owner_id If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $person_id If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $org_id If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $pipeline_id If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. (optional) + * @param int|null $stage_id If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. (optional) + * @param string|null $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. (optional) + * @param string|null $updated_since If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) + * @param string|null $updated_until If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. (optional) + * @param string|'id' $sort_by The field to sort by. Supported fields: `id`, `update_time`, `add_time`. (optional, default to 'id') + * @param string|'asc' $sort_direction The sorting direction. Supported values: `asc`, `desc`. (optional, default to 'asc') + * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) + * @param string|null $custom_fields Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getArchivedDealsRequest($filter_id = null, $ids = null, $owner_id = null, $person_id = null, $org_id = null, $pipeline_id = null, $stage_id = null, $status = null, $updated_since = null, $updated_until = null, $sort_by = 'id', $sort_direction = 'asc', $include_fields = null, $custom_fields = null, $limit = null, $cursor = null): Request + { + + $resourcePath = '/deals/archived'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($filter_id)) { + $filter_id = ObjectSerializer::serializeCollection($filter_id, '', true); + } + if ($filter_id !== null) { + $queryParams['filter_id'] = $filter_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($ids)) { + $ids = ObjectSerializer::serializeCollection($ids, '', true); + } + if ($ids !== null) { + $queryParams['ids'] = $ids; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($owner_id)) { + $owner_id = ObjectSerializer::serializeCollection($owner_id, '', true); + } + if ($owner_id !== null) { + $queryParams['owner_id'] = $owner_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($person_id)) { + $person_id = ObjectSerializer::serializeCollection($person_id, '', true); + } + if ($person_id !== null) { + $queryParams['person_id'] = $person_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($org_id)) { + $org_id = ObjectSerializer::serializeCollection($org_id, '', true); + } + if ($org_id !== null) { + $queryParams['org_id'] = $org_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($pipeline_id)) { + $pipeline_id = ObjectSerializer::serializeCollection($pipeline_id, '', true); + } + if ($pipeline_id !== null) { + $queryParams['pipeline_id'] = $pipeline_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($stage_id)) { + $stage_id = ObjectSerializer::serializeCollection($stage_id, '', true); + } + if ($stage_id !== null) { + $queryParams['stage_id'] = $stage_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($status)) { + $status = ObjectSerializer::serializeCollection($status, '', true); + } + if ($status !== null) { + $queryParams['status'] = $status; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($updated_since)) { + $updated_since = ObjectSerializer::serializeCollection($updated_since, '', true); + } + if ($updated_since !== null) { + $queryParams['updated_since'] = $updated_since; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($updated_until)) { + $updated_until = ObjectSerializer::serializeCollection($updated_until, '', true); + } + if ($updated_until !== null) { + $queryParams['updated_until'] = $updated_until; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort_by)) { + $sort_by = ObjectSerializer::serializeCollection($sort_by, '', true); + } + if ($sort_by !== null) { + $queryParams['sort_by'] = $sort_by; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort_direction)) { + $sort_direction = ObjectSerializer::serializeCollection($sort_direction, '', true); + } + if ($sort_direction !== null) { + $queryParams['sort_direction'] = $sort_direction; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($include_fields)) { + $include_fields = ObjectSerializer::serializeCollection($include_fields, '', true); + } + if ($include_fields !== null) { + $queryParams['include_fields'] = $include_fields; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($custom_fields)) { + $custom_fields = ObjectSerializer::serializeCollection($custom_fields, '', true); + } + if ($custom_fields !== null) { + $queryParams['custom_fields'] = $custom_fields; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($cursor)) { + $cursor = ObjectSerializer::serializeCollection($cursor, '', true); + } + if ($cursor !== null) { + $queryParams['cursor'] = $cursor; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDeal + * + * Get details of a deal + * + * @param int $id The ID of the deal (required) + * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) + * @param string|null $custom_fields Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\versions\v2\Model\PostPatchGetDeal + */ + public function getDeal($id, $include_fields = null, $custom_fields = null) + { + list($response) = $this->getDealWithHttpInfo($id, $include_fields, $custom_fields); + return $response; + } + + /** + * Operation getDealWithHttpInfo + * + * Get details of a deal + * + * @param int $id The ID of the deal (required) + * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) + * @param string|null $custom_fields Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\versions\v2\Model\PostPatchGetDeal, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealWithHttpInfo($id, $include_fields = null, $custom_fields = null) + { + $request = $this->getDealRequest($id, $include_fields, $custom_fields); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealRequest($id, $include_fields, $custom_fields); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v2\Model\PostPatchGetDeal' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\PostPatchGetDeal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v2\Model\PostPatchGetDeal' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\PostPatchGetDeal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v2\Model\PostPatchGetDeal', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealAsync + * + * Get details of a deal + * + * @param int $id The ID of the deal (required) + * @param string|null $include_fields Optional comma separated string array of additional fields to include (optional) + * @param string|null $custom_fields Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealAsync($id, $include_fields = null, $custom_fields = null): PromiseInterface { return $this->getDealAsyncWithHttpInfo($id, $include_fields, $custom_fields) ->then( @@ -3201,6 +4002,270 @@ public function getDealRequest($id, $include_fields = null, $custom_fields = nul ); } + /** + * Operation getDealConversionStatus + * + * Get Deal conversion status (BETA) + * + * @param int $id The ID of a deal (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return void + */ + public function getDealConversionStatus($id, $conversion_id) + { + $this->getDealConversionStatusWithHttpInfo($id, $conversion_id); + } + + /** + * Operation getDealConversionStatusWithHttpInfo + * + * Get Deal conversion status (BETA) + * + * @param int $id The ID of a deal (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealConversionStatusWithHttpInfo($id, $conversion_id) + { + $request = $this->getDealConversionStatusRequest($id, $conversion_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealConversionStatusRequest($id, $conversion_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v2\Model\GetConvertResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealConversionStatusAsync + * + * Get Deal conversion status (BETA) + * + * @param int $id The ID of a deal (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealConversionStatusAsync($id, $conversion_id): PromiseInterface + { + return $this->getDealConversionStatusAsyncWithHttpInfo($id, $conversion_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealConversionStatusAsyncWithHttpInfo + * + * Get Deal conversion status (BETA) + * + * @param int $id The ID of a deal (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealConversionStatusAsyncWithHttpInfo($id, $conversion_id): PromiseInterface + { + $returnType = ''; + $request = $this->getDealConversionStatusRequest($id, $conversion_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealConversionStatus' + * + * @param int $id The ID of a deal (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealConversionStatusRequest($id, $conversion_id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getDealConversionStatus' + ); + } + // verify the required parameter 'conversion_id' is set + /* @phpstan-ignore-next-line */ + if ($conversion_id === null || (is_array($conversion_id) && count($conversion_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $conversion_id when calling getDealConversionStatus' + ); + } + + $resourcePath = '/deals/{id}/convert/status/{conversion_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($conversion_id !== null) { + $resourcePath = str_replace( + '{' . 'conversion_id' . '}', + ObjectSerializer::toPathValue($conversion_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation getDealFollowers * diff --git a/lib/versions/v2/Api/LeadsApi.php b/lib/versions/v2/Api/LeadsApi.php index 43938e9..e7b3eaa 100644 --- a/lib/versions/v2/Api/LeadsApi.php +++ b/lib/versions/v2/Api/LeadsApi.php @@ -122,6 +122,598 @@ public function getConfig(): Configuration return $this->config; } + /** + * Operation convertLeadToDeal + * + * Convert a lead to a deal (BETA) + * + * @param string $id The ID of the lead to convert (required) + * @param \Pipedrive\versions\v2\Model\InlineObject|null $inline_object inline_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse|\Pipedrive\versions\v2\Model\GetConvertResponse + */ + public function convertLeadToDeal($id, $inline_object = null) + { + list($response) = $this->convertLeadToDealWithHttpInfo($id, $inline_object); + return $response; + } + + /** + * Operation convertLeadToDealWithHttpInfo + * + * Convert a lead to a deal (BETA) + * + * @param string $id The ID of the lead to convert (required) + * @param \Pipedrive\versions\v2\Model\InlineObject|null $inline_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse|\Pipedrive\versions\v2\Model\GetConvertResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function convertLeadToDealWithHttpInfo($id, $inline_object = null) + { + $request = $this->convertLeadToDealRequest($id, $inline_object); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->convertLeadToDealRequest($id, $inline_object); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v2\Model\GetConvertResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\GetConvertResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v2\Model\GetConvertResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation convertLeadToDealAsync + * + * Convert a lead to a deal (BETA) + * + * @param string $id The ID of the lead to convert (required) + * @param \Pipedrive\versions\v2\Model\InlineObject|null $inline_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function convertLeadToDealAsync($id, $inline_object = null): PromiseInterface + { + return $this->convertLeadToDealAsyncWithHttpInfo($id, $inline_object) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation convertLeadToDealAsyncWithHttpInfo + * + * Convert a lead to a deal (BETA) + * + * @param string $id The ID of the lead to convert (required) + * @param \Pipedrive\versions\v2\Model\InlineObject|null $inline_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function convertLeadToDealAsyncWithHttpInfo($id, $inline_object = null): PromiseInterface + { + $returnType = '\Pipedrive\versions\v2\Model\AddConvertLeadToDealResponse'; + $request = $this->convertLeadToDealRequest($id, $inline_object); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'convertLeadToDeal' + * + * @param string $id The ID of the lead to convert (required) + * @param \Pipedrive\versions\v2\Model\InlineObject|null $inline_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function convertLeadToDealRequest($id, $inline_object = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling convertLeadToDeal' + ); + } + + $resourcePath = '/leads/{id}/convert/deal'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($inline_object)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($inline_object)); + } else { + $httpBody = $inline_object; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLeadConversionStatus + * + * Get Lead conversion status (BETA) + * + * @param string $id The ID of a lead (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return void + */ + public function getLeadConversionStatus($id, $conversion_id) + { + $this->getLeadConversionStatusWithHttpInfo($id, $conversion_id); + } + + /** + * Operation getLeadConversionStatusWithHttpInfo + * + * Get Lead conversion status (BETA) + * + * @param string $id The ID of a lead (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function getLeadConversionStatusWithHttpInfo($id, $conversion_id) + { + $request = $this->getLeadConversionStatusRequest($id, $conversion_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getLeadConversionStatusRequest($id, $conversion_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\versions\v2\Model\GetConvertResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLeadConversionStatusAsync + * + * Get Lead conversion status (BETA) + * + * @param string $id The ID of a lead (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getLeadConversionStatusAsync($id, $conversion_id): PromiseInterface + { + return $this->getLeadConversionStatusAsyncWithHttpInfo($id, $conversion_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLeadConversionStatusAsyncWithHttpInfo + * + * Get Lead conversion status (BETA) + * + * @param string $id The ID of a lead (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getLeadConversionStatusAsyncWithHttpInfo($id, $conversion_id): PromiseInterface + { + $returnType = ''; + $request = $this->getLeadConversionStatusRequest($id, $conversion_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLeadConversionStatus' + * + * @param string $id The ID of a lead (required) + * @param string $conversion_id The ID of the conversion (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getLeadConversionStatusRequest($id, $conversion_id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getLeadConversionStatus' + ); + } + // verify the required parameter 'conversion_id' is set + /* @phpstan-ignore-next-line */ + if ($conversion_id === null || (is_array($conversion_id) && count($conversion_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $conversion_id when calling getLeadConversionStatus' + ); + } + + $resourcePath = '/leads/{id}/convert/status/{conversion_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($conversion_id !== null) { + $resourcePath = str_replace( + '{' . 'conversion_id' . '}', + ObjectSerializer::toPathValue($conversion_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation searchLeads * diff --git a/lib/versions/v2/Model/AddConvertDealToLeadResponse.php b/lib/versions/v2/Model/AddConvertDealToLeadResponse.php new file mode 100644 index 0000000..ae6b4a9 --- /dev/null +++ b/lib/versions/v2/Model/AddConvertDealToLeadResponse.php @@ -0,0 +1,405 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddConvertDealToLeadResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddConvertDealToLeadResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\versions\v2\Model\ConvertEntityResponse', + 'additional_data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\versions\v2\Model\ConvertEntityResponse|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\versions\v2\Model\ConvertEntityResponse|null $data An object containing conversion job id that performs the conversion + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return object|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param object|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/versions/v2/Model/AddConvertLeadToDealResponse.php b/lib/versions/v2/Model/AddConvertLeadToDealResponse.php new file mode 100644 index 0000000..be6b453 --- /dev/null +++ b/lib/versions/v2/Model/AddConvertLeadToDealResponse.php @@ -0,0 +1,405 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddConvertLeadToDealResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddConvertLeadToDealResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\versions\v2\Model\ConvertEntityResponse', + 'additional_data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\versions\v2\Model\ConvertEntityResponse|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\versions\v2\Model\ConvertEntityResponse|null $data An object containing conversion job id that performs the conversion + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return object|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param object|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/versions/v2/Model/ConvertEntityResponse.php b/lib/versions/v2/Model/ConvertEntityResponse.php new file mode 100644 index 0000000..cf70ad4 --- /dev/null +++ b/lib/versions/v2/Model/ConvertEntityResponse.php @@ -0,0 +1,349 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ConvertEntityResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ConvertEntityResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'conversion_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conversion_id' => 'uuid' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'conversion_id' => 'conversion_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conversion_id' => 'setConversionId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conversion_id' => 'getConversionId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['conversion_id'] = $data['conversion_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['conversion_id'] === null) { + $invalidProperties[] = "'conversion_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets conversion_id + * + * @return string + */ + public function getConversionId() + { + return $this->container['conversion_id']; + } + + /** + * Sets conversion_id + * + * @param string $conversion_id The ID of the conversion job that can be used to retrieve conversion status and details. The ID has UUID format. + * + * @return self + */ + public function setConversionId($conversion_id): self + { + $this->container['conversion_id'] = $conversion_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/versions/v2/Model/DealItem.php b/lib/versions/v2/Model/DealItem.php index 987f844..92d4b30 100644 --- a/lib/versions/v2/Model/DealItem.php +++ b/lib/versions/v2/Model/DealItem.php @@ -78,6 +78,7 @@ class DealItem implements ModelInterface, ArrayAccess, JsonSerializable 'add_time' => 'string', 'update_time' => 'string', 'stage_change_time' => 'string', + 'is_archived' => 'bool', 'is_deleted' => 'bool', 'status' => 'string', 'probability' => 'float', @@ -94,7 +95,8 @@ class DealItem implements ModelInterface, ArrayAccess, JsonSerializable 'channel_id' => 'string', 'arr' => 'float', 'mrr' => 'float', - 'acv' => 'float' + 'acv' => 'float', + 'custom_fields' => 'array' ]; /** @@ -117,6 +119,7 @@ class DealItem implements ModelInterface, ArrayAccess, JsonSerializable 'add_time' => null, 'update_time' => null, 'stage_change_time' => null, + 'is_archived' => null, 'is_deleted' => null, 'status' => null, 'probability' => null, @@ -133,7 +136,8 @@ class DealItem implements ModelInterface, ArrayAccess, JsonSerializable 'channel_id' => null, 'arr' => null, 'mrr' => null, - 'acv' => null + 'acv' => null, + 'custom_fields' => null ]; /** @@ -179,6 +183,7 @@ public static function openAPIFormats(): array 'add_time' => 'add_time', 'update_time' => 'update_time', 'stage_change_time' => 'stage_change_time', + 'is_archived' => 'is_archived', 'is_deleted' => 'is_deleted', 'status' => 'status', 'probability' => 'probability', @@ -195,7 +200,8 @@ public static function openAPIFormats(): array 'channel_id' => 'channel_id', 'arr' => 'arr', 'mrr' => 'mrr', - 'acv' => 'acv' + 'acv' => 'acv', + 'custom_fields' => 'custom_fields' ]; /** @@ -216,6 +222,7 @@ public static function openAPIFormats(): array 'add_time' => 'setAddTime', 'update_time' => 'setUpdateTime', 'stage_change_time' => 'setStageChangeTime', + 'is_archived' => 'setIsArchived', 'is_deleted' => 'setIsDeleted', 'status' => 'setStatus', 'probability' => 'setProbability', @@ -232,7 +239,8 @@ public static function openAPIFormats(): array 'channel_id' => 'setChannelId', 'arr' => 'setArr', 'mrr' => 'setMrr', - 'acv' => 'setAcv' + 'acv' => 'setAcv', + 'custom_fields' => 'setCustomFields' ]; /** @@ -253,6 +261,7 @@ public static function openAPIFormats(): array 'add_time' => 'getAddTime', 'update_time' => 'getUpdateTime', 'stage_change_time' => 'getStageChangeTime', + 'is_archived' => 'getIsArchived', 'is_deleted' => 'getIsDeleted', 'status' => 'getStatus', 'probability' => 'getProbability', @@ -269,7 +278,8 @@ public static function openAPIFormats(): array 'channel_id' => 'getChannelId', 'arr' => 'getArr', 'mrr' => 'getMrr', - 'acv' => 'getAcv' + 'acv' => 'getAcv', + 'custom_fields' => 'getCustomFields' ]; /** @@ -351,6 +361,7 @@ public function __construct(array $data = null) $this->container['add_time'] = $data['add_time'] ?? null; $this->container['update_time'] = $data['update_time'] ?? null; $this->container['stage_change_time'] = $data['stage_change_time'] ?? null; + $this->container['is_archived'] = $data['is_archived'] ?? null; $this->container['is_deleted'] = $data['is_deleted'] ?? null; $this->container['status'] = $data['status'] ?? null; $this->container['probability'] = $data['probability'] ?? null; @@ -368,6 +379,7 @@ public function __construct(array $data = null) $this->container['arr'] = $data['arr'] ?? null; $this->container['mrr'] = $data['mrr'] ?? null; $this->container['acv'] = $data['acv'] ?? null; + $this->container['custom_fields'] = $data['custom_fields'] ?? null; } /** @@ -684,6 +696,30 @@ public function setStageChangeTime($stage_change_time): self return $this; } + /** + * Gets is_archived + * + * @return bool|null + */ + public function getIsArchived() + { + return $this->container['is_archived']; + } + + /** + * Sets is_archived + * + * @param bool|null $is_archived Whether the deal is archived or not + * + * @return self + */ + public function setIsArchived($is_archived): self + { + $this->container['is_archived'] = $is_archived; + + return $this; + } + /** * Gets is_deleted * @@ -1091,6 +1127,31 @@ public function setAcv($acv): self return $this; } + + /** + * Gets custom_fields + * + * @return array|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param array|null $custom_fields The custom fields of the deal + * + * @return self + */ + public function setCustomFields($custom_fields): self + { + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + /** * Returns true if offset exists. False otherwise. * diff --git a/lib/versions/v2/Model/DealSearchItemItem.php b/lib/versions/v2/Model/DealSearchItemItem.php index a6c7aac..5927a8a 100644 --- a/lib/versions/v2/Model/DealSearchItemItem.php +++ b/lib/versions/v2/Model/DealSearchItemItem.php @@ -78,7 +78,8 @@ class DealSearchItemItem implements ModelInterface, ArrayAccess, JsonSerializabl 'person' => '\Pipedrive\versions\v2\Model\DealSearchItemItemPerson', 'organization' => '\Pipedrive\versions\v2\Model\DealSearchItemItemOrganization', 'custom_fields' => 'string[]', - 'notes' => 'string[]' + 'notes' => 'string[]', + 'is_archived' => 'bool' ]; /** @@ -101,7 +102,8 @@ class DealSearchItemItem implements ModelInterface, ArrayAccess, JsonSerializabl 'person' => null, 'organization' => null, 'custom_fields' => null, - 'notes' => null + 'notes' => null, + 'is_archived' => null ]; /** @@ -147,7 +149,8 @@ public static function openAPIFormats(): array 'person' => 'person', 'organization' => 'organization', 'custom_fields' => 'custom_fields', - 'notes' => 'notes' + 'notes' => 'notes', + 'is_archived' => 'is_archived' ]; /** @@ -168,7 +171,8 @@ public static function openAPIFormats(): array 'person' => 'setPerson', 'organization' => 'setOrganization', 'custom_fields' => 'setCustomFields', - 'notes' => 'setNotes' + 'notes' => 'setNotes', + 'is_archived' => 'setIsArchived' ]; /** @@ -189,7 +193,8 @@ public static function openAPIFormats(): array 'person' => 'getPerson', 'organization' => 'getOrganization', 'custom_fields' => 'getCustomFields', - 'notes' => 'getNotes' + 'notes' => 'getNotes', + 'is_archived' => 'getIsArchived' ]; /** @@ -272,6 +277,7 @@ public function __construct(array $data = null) $this->container['organization'] = $data['organization'] ?? null; $this->container['custom_fields'] = $data['custom_fields'] ?? null; $this->container['notes'] = $data['notes'] ?? null; + $this->container['is_archived'] = $data['is_archived'] ?? null; } /** @@ -611,6 +617,30 @@ public function setNotes($notes): self return $this; } + + /** + * Gets is_archived + * + * @return bool|null + */ + public function getIsArchived() + { + return $this->container['is_archived']; + } + + /** + * Sets is_archived + * + * @param bool|null $is_archived A flag indicating whether the deal is archived or not + * + * @return self + */ + public function setIsArchived($is_archived): self + { + $this->container['is_archived'] = $is_archived; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/versions/v2/Model/GetConvertResponse.php b/lib/versions/v2/Model/GetConvertResponse.php new file mode 100644 index 0000000..ce047c4 --- /dev/null +++ b/lib/versions/v2/Model/GetConvertResponse.php @@ -0,0 +1,465 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetConvertResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetConvertResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'error' => 'string', + 'error_info' => 'string', + 'data' => 'object', + 'additional_data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'error' => null, + 'error_info' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'error' => 'error', + 'error_info' => 'error_info', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'error' => 'setError', + 'error_info' => 'setErrorInfo', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'error' => 'getError', + 'error_info' => 'getErrorInfo', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['error_info'] = $data['error_info'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The description of the error + * + * @return self + */ + public function setError($error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets error_info + * + * @return string|null + */ + public function getErrorInfo() + { + return $this->container['error_info']; + } + + /** + * Sets error_info + * + * @param string|null $error_info A message describing how to solve the problem + * + * @return self + */ + public function setErrorInfo($error_info): self + { + $this->container['error_info'] = $error_info; + + return $this; + } + + /** + * Gets data + * + * @return object|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return object|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param object|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/versions/v2/Model/InlineObject.php b/lib/versions/v2/Model/InlineObject.php new file mode 100644 index 0000000..d1af4c6 --- /dev/null +++ b/lib/versions/v2/Model/InlineObject.php @@ -0,0 +1,375 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineObject implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'inline_object'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'stage_id' => 'int', + 'pipeline_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'stage_id' => null, + 'pipeline_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'stage_id' => 'stage_id', + 'pipeline_id' => 'pipeline_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'stage_id' => 'setStageId', + 'pipeline_id' => 'setPipelineId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'stage_id' => 'getStageId', + 'pipeline_id' => 'getPipelineId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['stage_id'] = $data['stage_id'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets stage_id + * + * @return int|null + */ + public function getStageId() + { + return $this->container['stage_id']; + } + + /** + * Sets stage_id + * + * @param int|null $stage_id The ID of a stage the created 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. + * + * @return self + */ + public function setStageId($stage_id): self + { + $this->container['stage_id'] = $stage_id; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of a pipeline the created 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. + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + +