diff --git a/CHANGELOG.md b/CHANGELOG.md index 932576a..2ee9c48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ 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] +### Removed +- Removed deprecated bulk delete endpoints: + - `DELETE /v1/activities` + - `DELETE /v1/activityTypes` + - `DELETE /v1/deals` + - `DELETE /v1/organizations` + - `DELETE /v1/persons` + - `DELETE /v1/stages` +Please use the single delete endpoints instead, for example `DELETE /api/v2/activities/{id}`. + +## [15.0.0](https://github.com/pipedrive/client-php/compare/14.9.0...15.0.0) (2026-01-27) ## [14.9.0](https://github.com/pipedrive/client-php/compare/14.8.0...14.9.0) (2026-01-27) diff --git a/docs/versions/v1/Api/ActivitiesApi.md b/docs/versions/v1/Api/ActivitiesApi.md index e6d48ad..b85cdb1 100644 --- a/docs/versions/v1/Api/ActivitiesApi.md +++ b/docs/versions/v1/Api/ActivitiesApi.md @@ -5,7 +5,6 @@ All URIs are relative to https://api.pipedrive.com/v1. Method | HTTP request | Description ------------- | ------------- | ------------- [**addActivity()**](ActivitiesApi.md#addActivity) | **POST** /activities | Add an activity -[**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 collection @@ -78,71 +77,6 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## `deleteActivities()` - -```php -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.
This endpoint has been deprecated. Please use DELETE /api/v2/activities/{id} instead. - -### Example - -```php -setApiKey('x-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('x-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\ActivitiesApi( - // 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 -); -$ids = 'ids_example'; // string | The comma-separated IDs of activities that will be deleted - -try { - $result = $apiInstance->deleteActivities($ids); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ActivitiesApi->deleteActivities: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ids** | **string**| The comma-separated IDs of activities that will be deleted | - -### Return type - -[**\Pipedrive\versions\v1\Model\DeleteActivitiesResponse**](../Model/DeleteActivitiesResponse.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) - ## `deleteActivity()` ```php diff --git a/docs/versions/v1/Api/ActivityTypesApi.md b/docs/versions/v1/Api/ActivityTypesApi.md index f5028cc..c3ccad3 100644 --- a/docs/versions/v1/Api/ActivityTypesApi.md +++ b/docs/versions/v1/Api/ActivityTypesApi.md @@ -6,7 +6,6 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**addActivityType()**](ActivityTypesApi.md#addActivityType) | **POST** /activityTypes | Add new activity type [**deleteActivityType()**](ActivityTypesApi.md#deleteActivityType) | **DELETE** /activityTypes/{id} | Delete an activity type -[**deleteActivityTypes()**](ActivityTypesApi.md#deleteActivityTypes) | **DELETE** /activityTypes | Delete multiple activity types in bulk [**getActivityTypes()**](ActivityTypesApi.md#getActivityTypes) | **GET** /activityTypes | Get all activity types [**updateActivityType()**](ActivityTypesApi.md#updateActivityType) | **PUT** /activityTypes/{id} | Update an activity type @@ -141,71 +140,6 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## `deleteActivityTypes()` - -```php -deleteActivityTypes($ids): \Pipedrive\versions\v1\Model\ActivityTypeBulkDeleteResponse -``` - -Delete multiple activity types in bulk - -Marks multiple activity types as deleted. - -### Example - -```php -setApiKey('x-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('x-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\ActivityTypesApi( - // 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 -); -$ids = 'ids_example'; // string | The comma-separated activity type IDs - -try { - $result = $apiInstance->deleteActivityTypes($ids); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ActivityTypesApi->deleteActivityTypes: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ids** | **string**| The comma-separated activity type IDs | - -### Return type - -[**\Pipedrive\versions\v1\Model\ActivityTypeBulkDeleteResponse**](../Model/ActivityTypeBulkDeleteResponse.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) - ## `getActivityTypes()` ```php diff --git a/docs/versions/v1/Api/DealsApi.md b/docs/versions/v1/Api/DealsApi.md index 267671a..9c3ddb3 100644 --- a/docs/versions/v1/Api/DealsApi.md +++ b/docs/versions/v1/Api/DealsApi.md @@ -12,7 +12,6 @@ Method | HTTP request | Description [**deleteDealFollower()**](DealsApi.md#deleteDealFollower) | **DELETE** /deals/{id}/followers/{follower_id} | Delete a follower from a deal [**deleteDealParticipant()**](DealsApi.md#deleteDealParticipant) | **DELETE** /deals/{id}/participants/{deal_participant_id} | Delete a participant from a deal [**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 @@ -571,71 +570,6 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## `deleteDeals()` - -```php -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.
This endpoint has been deprecated. Please use DELETE /api/v2/deals/{id} instead. - -### Example - -```php -setApiKey('x-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('x-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 -); -$ids = 'ids_example'; // string | The comma-separated IDs that will be deleted - -try { - $result = $apiInstance->deleteDeals($ids); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling DealsApi->deleteDeals: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ids** | **string**| The comma-separated IDs that will be deleted | - -### Return type - -[**\Pipedrive\versions\v1\Model\DeleteMultipleDeals**](../Model/DeleteMultipleDeals.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) - ## `duplicateDeal()` ```php diff --git a/docs/versions/v1/Api/OrganizationsApi.md b/docs/versions/v1/Api/OrganizationsApi.md index 6140e92..aea38ff 100644 --- a/docs/versions/v1/Api/OrganizationsApi.md +++ b/docs/versions/v1/Api/OrganizationsApi.md @@ -8,7 +8,6 @@ Method | HTTP request | Description [**addOrganizationFollower()**](OrganizationsApi.md#addOrganizationFollower) | **POST** /organizations/{id}/followers | Add a follower to an organization [**deleteOrganization()**](OrganizationsApi.md#deleteOrganization) | **DELETE** /organizations/{id} | Delete an organization [**deleteOrganizationFollower()**](OrganizationsApi.md#deleteOrganizationFollower) | **DELETE** /organizations/{id}/followers/{follower_id} | Delete a follower from an organization -[**deleteOrganizations()**](OrganizationsApi.md#deleteOrganizations) | **DELETE** /organizations | Delete multiple organizations in bulk [**getOrganization()**](OrganizationsApi.md#getOrganization) | **GET** /organizations/{id} | Get details of an organization [**getOrganizationActivities()**](OrganizationsApi.md#getOrganizationActivities) | **GET** /organizations/{id}/activities | List activities associated with an organization [**getOrganizationChangelog()**](OrganizationsApi.md#getOrganizationChangelog) | **GET** /organizations/{id}/changelog | List updates about organization field values @@ -290,71 +289,6 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## `deleteOrganizations()` - -```php -deleteOrganizations($ids): \Pipedrive\versions\v1\Model\OrganizationsDeleteResponse -``` - -Delete multiple organizations in bulk - -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 - -```php -setApiKey('x-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('x-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\OrganizationsApi( - // 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 -); -$ids = 'ids_example'; // string | The comma-separated IDs that will be deleted - -try { - $result = $apiInstance->deleteOrganizations($ids); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling OrganizationsApi->deleteOrganizations: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ids** | **string**| The comma-separated IDs that will be deleted | - -### Return type - -[**\Pipedrive\versions\v1\Model\OrganizationsDeleteResponse**](../Model/OrganizationsDeleteResponse.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) - ## `getOrganization()` ```php diff --git a/docs/versions/v1/Api/PersonsApi.md b/docs/versions/v1/Api/PersonsApi.md index f994e54..f2209ba 100644 --- a/docs/versions/v1/Api/PersonsApi.md +++ b/docs/versions/v1/Api/PersonsApi.md @@ -10,7 +10,6 @@ Method | HTTP request | Description [**deletePerson()**](PersonsApi.md#deletePerson) | **DELETE** /persons/{id} | Delete a person [**deletePersonFollower()**](PersonsApi.md#deletePersonFollower) | **DELETE** /persons/{id}/followers/{follower_id} | Delete a follower from a person [**deletePersonPicture()**](PersonsApi.md#deletePersonPicture) | **DELETE** /persons/{id}/picture | Delete person picture -[**deletePersons()**](PersonsApi.md#deletePersons) | **DELETE** /persons | Delete multiple persons in bulk [**getPerson()**](PersonsApi.md#getPerson) | **GET** /persons/{id} | Get details of a person [**getPersonActivities()**](PersonsApi.md#getPersonActivities) | **GET** /persons/{id}/activities | List activities associated with a person [**getPersonChangelog()**](PersonsApi.md#getPersonChangelog) | **GET** /persons/{id}/changelog | List updates about person field values @@ -432,71 +431,6 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## `deletePersons()` - -```php -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.
This endpoint has been deprecated. Please use DELETE /api/v2/persons/{id} instead. - -### Example - -```php -setApiKey('x-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('x-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\PersonsApi( - // 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 -); -$ids = 'ids_example'; // string | The comma-separated IDs that will be deleted - -try { - $result = $apiInstance->deletePersons($ids); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling PersonsApi->deletePersons: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ids** | **string**| The comma-separated IDs that will be deleted | - -### Return type - -[**\Pipedrive\versions\v1\Model\DeletePersonsInBulkResponse**](../Model/DeletePersonsInBulkResponse.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) - ## `getPerson()` ```php diff --git a/docs/versions/v1/Api/StagesApi.md b/docs/versions/v1/Api/StagesApi.md index 13178fa..78ab161 100644 --- a/docs/versions/v1/Api/StagesApi.md +++ b/docs/versions/v1/Api/StagesApi.md @@ -6,7 +6,6 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**addStage()**](StagesApi.md#addStage) | **POST** /stages | Add a new stage [**deleteStage()**](StagesApi.md#deleteStage) | **DELETE** /stages/{id} | Delete a stage -[**deleteStages()**](StagesApi.md#deleteStages) | **DELETE** /stages | Delete multiple stages in bulk [**getStage()**](StagesApi.md#getStage) | **GET** /stages/{id} | Get one stage [**getStageDeals()**](StagesApi.md#getStageDeals) | **GET** /stages/{id}/deals | Get deals in a stage [**getStages()**](StagesApi.md#getStages) | **GET** /stages | Get all stages @@ -143,71 +142,6 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## `deleteStages()` - -```php -deleteStages($ids): \Pipedrive\versions\v1\Model\DeleteStagesResponse -``` - -Delete multiple stages in bulk - -Marks multiple stages as deleted.
This endpoint has been deprecated. Please use DELETE /api/v2/stages/{id} instead. - -### Example - -```php -setApiKey('x-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('x-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\StagesApi( - // 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 -); -$ids = 'ids_example'; // string | The comma-separated stage IDs to delete - -try { - $result = $apiInstance->deleteStages($ids); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling StagesApi->deleteStages: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ids** | **string**| The comma-separated stage IDs to delete | - -### Return type - -[**\Pipedrive\versions\v1\Model\DeleteStagesResponse**](../Model/DeleteStagesResponse.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) - ## `getStage()` ```php diff --git a/docs/versions/v1/Model/RequiredTitleParameter.md b/docs/versions/v1/Model/RequiredTitleParameter.md new file mode 100644 index 0000000..3837cc2 --- /dev/null +++ b/docs/versions/v1/Model/RequiredTitleParameter.md @@ -0,0 +1,9 @@ +# # RequiredTitleParameter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | The title of the deal | + +[[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 c071f82..c8ad9e6 100644 --- a/docs/versions/v1/README.md +++ b/docs/versions/v1/README.md @@ -266,7 +266,6 @@ All URIs are relative to *https://api.pipedrive.com/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *ActivitiesApi* | [**addActivity**](Api/ActivitiesApi.md#addactivity) | **POST** /activities | Add an activity -*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 collection @@ -275,7 +274,6 @@ Class | Method | HTTP request | Description *ActivityFieldsApi* | [**getActivityFields**](Api/ActivityFieldsApi.md#getactivityfields) | **GET** /activityFields | Get all activity fields *ActivityTypesApi* | [**addActivityType**](Api/ActivityTypesApi.md#addactivitytype) | **POST** /activityTypes | Add new activity type *ActivityTypesApi* | [**deleteActivityType**](Api/ActivityTypesApi.md#deleteactivitytype) | **DELETE** /activityTypes/{id} | Delete an activity type -*ActivityTypesApi* | [**deleteActivityTypes**](Api/ActivityTypesApi.md#deleteactivitytypes) | **DELETE** /activityTypes | Delete multiple activity types in bulk *ActivityTypesApi* | [**getActivityTypes**](Api/ActivityTypesApi.md#getactivitytypes) | **GET** /activityTypes | Get all activity types *ActivityTypesApi* | [**updateActivityType**](Api/ActivityTypesApi.md#updateactivitytype) | **PUT** /activityTypes/{id} | Update an activity type *BillingApi* | [**getCompanyAddons**](Api/BillingApi.md#getcompanyaddons) | **GET** /billing/subscriptions/addons | Get all add-ons for a single company @@ -303,7 +301,6 @@ Class | Method | HTTP request | Description *DealsApi* | [**deleteDealFollower**](Api/DealsApi.md#deletedealfollower) | **DELETE** /deals/{id}/followers/{follower_id} | Delete a follower from a deal *DealsApi* | [**deleteDealParticipant**](Api/DealsApi.md#deletedealparticipant) | **DELETE** /deals/{id}/participants/{deal_participant_id} | Delete a participant from a deal *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 @@ -406,7 +403,6 @@ Class | Method | HTTP request | Description *OrganizationsApi* | [**addOrganizationFollower**](Api/OrganizationsApi.md#addorganizationfollower) | **POST** /organizations/{id}/followers | Add a follower to an organization *OrganizationsApi* | [**deleteOrganization**](Api/OrganizationsApi.md#deleteorganization) | **DELETE** /organizations/{id} | Delete an organization *OrganizationsApi* | [**deleteOrganizationFollower**](Api/OrganizationsApi.md#deleteorganizationfollower) | **DELETE** /organizations/{id}/followers/{follower_id} | Delete a follower from an organization -*OrganizationsApi* | [**deleteOrganizations**](Api/OrganizationsApi.md#deleteorganizations) | **DELETE** /organizations | Delete multiple organizations in bulk *OrganizationsApi* | [**getOrganization**](Api/OrganizationsApi.md#getorganization) | **GET** /organizations/{id} | Get details of an organization *OrganizationsApi* | [**getOrganizationActivities**](Api/OrganizationsApi.md#getorganizationactivities) | **GET** /organizations/{id}/activities | List activities associated with an organization *OrganizationsApi* | [**getOrganizationChangelog**](Api/OrganizationsApi.md#getorganizationchangelog) | **GET** /organizations/{id}/changelog | List updates about organization field values @@ -437,7 +433,6 @@ Class | Method | HTTP request | Description *PersonsApi* | [**deletePerson**](Api/PersonsApi.md#deleteperson) | **DELETE** /persons/{id} | Delete a person *PersonsApi* | [**deletePersonFollower**](Api/PersonsApi.md#deletepersonfollower) | **DELETE** /persons/{id}/followers/{follower_id} | Delete a follower from a person *PersonsApi* | [**deletePersonPicture**](Api/PersonsApi.md#deletepersonpicture) | **DELETE** /persons/{id}/picture | Delete person picture -*PersonsApi* | [**deletePersons**](Api/PersonsApi.md#deletepersons) | **DELETE** /persons | Delete multiple persons in bulk *PersonsApi* | [**getPerson**](Api/PersonsApi.md#getperson) | **GET** /persons/{id} | Get details of a person *PersonsApi* | [**getPersonActivities**](Api/PersonsApi.md#getpersonactivities) | **GET** /persons/{id}/activities | List activities associated with a person *PersonsApi* | [**getPersonChangelog**](Api/PersonsApi.md#getpersonchangelog) | **GET** /persons/{id}/changelog | List updates about person field values @@ -512,7 +507,6 @@ Class | Method | HTTP request | Description *RolesApi* | [**updateRolePipelines**](Api/RolesApi.md#updaterolepipelines) | **PUT** /roles/{id}/pipelines | Update pipeline visibility for a role *StagesApi* | [**addStage**](Api/StagesApi.md#addstage) | **POST** /stages | Add a new stage *StagesApi* | [**deleteStage**](Api/StagesApi.md#deletestage) | **DELETE** /stages/{id} | Delete a stage -*StagesApi* | [**deleteStages**](Api/StagesApi.md#deletestages) | **DELETE** /stages | Delete multiple stages in bulk *StagesApi* | [**getStage**](Api/StagesApi.md#getstage) | **GET** /stages/{id} | Get one stage *StagesApi* | [**getStageDeals**](Api/StagesApi.md#getstagedeals) | **GET** /stages/{id}/deals | Get deals in a stage *StagesApi* | [**getStages**](Api/StagesApi.md#getstages) | **GET** /stages | Get all stages @@ -556,9 +550,6 @@ Class | Method | HTTP request | Description - [ActivityRecordAdditionalData](Model/ActivityRecordAdditionalData.md) - [ActivityResponseObject](Model/ActivityResponseObject.md) - [ActivityResponseObjectAllOf](Model/ActivityResponseObjectAllOf.md) - - [ActivityTypeBulkDeleteResponse](Model/ActivityTypeBulkDeleteResponse.md) - - [ActivityTypeBulkDeleteResponseAllOf](Model/ActivityTypeBulkDeleteResponseAllOf.md) - - [ActivityTypeBulkDeleteResponseAllOfData](Model/ActivityTypeBulkDeleteResponseAllOfData.md) - [ActivityTypeCount](Model/ActivityTypeCount.md) - [ActivityTypeCreateRequest](Model/ActivityTypeCreateRequest.md) - [ActivityTypeCreateUpdateDeleteResponse](Model/ActivityTypeCreateUpdateDeleteResponse.md) @@ -750,8 +741,6 @@ Class | Method | HTTP request | Description - [DealsMovementsInfo](Model/DealsMovementsInfo.md) - [DealsMovementsInfoFormattedValues](Model/DealsMovementsInfoFormattedValues.md) - [DealsMovementsInfoValues](Model/DealsMovementsInfoValues.md) - - [DeleteActivitiesResponse](Model/DeleteActivitiesResponse.md) - - [DeleteActivitiesResponseData](Model/DeleteActivitiesResponseData.md) - [DeleteActivityResponse](Model/DeleteActivityResponse.md) - [DeleteActivityResponseData](Model/DeleteActivityResponseData.md) - [DeleteChannelSuccess](Model/DeleteChannelSuccess.md) @@ -773,17 +762,12 @@ Class | Method | HTTP request | Description - [DeleteFileData](Model/DeleteFileData.md) - [DeleteGoalResponse](Model/DeleteGoalResponse.md) - [DeleteLeadIdResponse](Model/DeleteLeadIdResponse.md) - - [DeleteMultipleDeals](Model/DeleteMultipleDeals.md) - - [DeleteMultipleDealsData](Model/DeleteMultipleDealsData.md) - [DeleteMultipleProductFieldsResponse](Model/DeleteMultipleProductFieldsResponse.md) - [DeleteMultipleProductFieldsResponseData](Model/DeleteMultipleProductFieldsResponseData.md) - [DeleteNote](Model/DeleteNote.md) - [DeletePersonResponse](Model/DeletePersonResponse.md) - [DeletePersonResponseAllOf](Model/DeletePersonResponseAllOf.md) - [DeletePersonResponseAllOfData](Model/DeletePersonResponseAllOfData.md) - - [DeletePersonsInBulkResponse](Model/DeletePersonsInBulkResponse.md) - - [DeletePersonsInBulkResponseAllOf](Model/DeletePersonsInBulkResponseAllOf.md) - - [DeletePersonsInBulkResponseAllOfData](Model/DeletePersonsInBulkResponseAllOfData.md) - [DeletePipelineResponse](Model/DeletePipelineResponse.md) - [DeletePipelineResponseData](Model/DeletePipelineResponseData.md) - [DeleteProductFieldResponse](Model/DeleteProductFieldResponse.md) @@ -807,8 +791,6 @@ Class | Method | HTTP request | Description - [DeleteRoleResponseDataData](Model/DeleteRoleResponseDataData.md) - [DeleteStageResponse](Model/DeleteStageResponse.md) - [DeleteStageResponseData](Model/DeleteStageResponseData.md) - - [DeleteStagesResponse](Model/DeleteStagesResponse.md) - - [DeleteStagesResponseData](Model/DeleteStagesResponseData.md) - [DeleteTask](Model/DeleteTask.md) - [DeleteTaskData](Model/DeleteTaskData.md) - [DeleteTaskResponse](Model/DeleteTaskResponse.md) @@ -1116,8 +1098,6 @@ Class | Method | HTTP request | Description - [OrganizationUpdateResponseAllOf](Model/OrganizationUpdateResponseAllOf.md) - [OrganizationsCollectionResponseObject](Model/OrganizationsCollectionResponseObject.md) - [OrganizationsCollectionResponseObjectAllOf](Model/OrganizationsCollectionResponseObjectAllOf.md) - - [OrganizationsDeleteResponse](Model/OrganizationsDeleteResponse.md) - - [OrganizationsDeleteResponseData](Model/OrganizationsDeleteResponseData.md) - [OrganizationsMergeResponse](Model/OrganizationsMergeResponse.md) - [OrganizationsMergeResponseData](Model/OrganizationsMergeResponseData.md) - [Owner](Model/Owner.md) @@ -1237,7 +1217,7 @@ Class | Method | HTTP request | Description - [RelationshipOrganizationInfoItemWithActiveFlagAllOf](Model/RelationshipOrganizationInfoItemWithActiveFlagAllOf.md) - [RequiredPostProjectParameters](Model/RequiredPostProjectParameters.md) - [RequiredPostTaskParameters](Model/RequiredPostTaskParameters.md) - - [RequredTitleParameter](Model/RequredTitleParameter.md) + - [RequiredTitleParameter](Model/RequiredTitleParameter.md) - [ResponseCallLogObject](Model/ResponseCallLogObject.md) - [ResponseCallLogObjectAllOf](Model/ResponseCallLogObjectAllOf.md) - [RoleAssignment](Model/RoleAssignment.md) diff --git a/lib/versions/v1/Api/ActivitiesApi.php b/lib/versions/v1/Api/ActivitiesApi.php index 0572182..4c7fc30 100644 --- a/lib/versions/v1/Api/ActivitiesApi.php +++ b/lib/versions/v1/Api/ActivitiesApi.php @@ -414,307 +414,6 @@ public function addActivityRequest($activity_post_object = null): Request ); } - /** - * Operation deleteActivities - * - * Delete multiple activities in bulk - * - * @param string $ids The comma-separated IDs of activities that will be deleted (required) - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException|GuzzleException - * @return \Pipedrive\versions\v1\Model\DeleteActivitiesResponse - * @deprecated - */ - public function deleteActivities($ids) - { - list($response) = $this->deleteActivitiesWithHttpInfo($ids); - return $response; - } - - /** - * Operation deleteActivitiesWithHttpInfo - * - * Delete multiple activities in bulk - * - * @param string $ids The comma-separated IDs of activities that will be deleted (required) - * - * @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) - { - $request = $this->deleteActivitiesRequest($ids); - - 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->deleteActivitiesRequest($ids); - $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\DeleteActivitiesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\DeleteActivitiesResponse', []), - $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\DeleteActivitiesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\DeleteActivitiesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Pipedrive\versions\v1\Model\DeleteActivitiesResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation deleteActivitiesAsync - * - * Delete multiple activities in bulk - * - * @param string $ids The comma-separated IDs of activities that will be deleted (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return PromiseInterface - * @deprecated - */ - public function deleteActivitiesAsync($ids): PromiseInterface - { - return $this->deleteActivitiesAsyncWithHttpInfo($ids) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deleteActivitiesAsyncWithHttpInfo - * - * Delete multiple activities in bulk - * - * @param string $ids The comma-separated IDs of activities that will be deleted (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return PromiseInterface - * @deprecated - */ - public function deleteActivitiesAsyncWithHttpInfo($ids): PromiseInterface - { - $returnType = '\Pipedrive\versions\v1\Model\DeleteActivitiesResponse'; - $request = $this->deleteActivitiesRequest($ids); - - 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 'deleteActivities' - * - * @param string $ids The comma-separated IDs of activities that will be deleted (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return Request - * @deprecated - */ - public function deleteActivitiesRequest($ids): Request - { - // verify the required parameter 'ids' is set - /* @phpstan-ignore-next-line */ - if ($ids === null || (is_array($ids) && count($ids) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $ids when calling deleteActivities' - ); - } - - $resourcePath = '/activities'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - /* @phpstan-ignore-next-line */ - if (is_array($ids)) { - $ids = ObjectSerializer::serializeCollection($ids, '', true); - } - if ($ids !== null) { - $queryParams['ids'] = $ids; - } - - - - - /* @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('x-api-token'); - if ($apiKey !== null) { - $headers['x-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 deleteActivity * diff --git a/lib/versions/v1/Api/ActivityTypesApi.php b/lib/versions/v1/Api/ActivityTypesApi.php index 837dda2..d54a81a 100644 --- a/lib/versions/v1/Api/ActivityTypesApi.php +++ b/lib/versions/v1/Api/ActivityTypesApi.php @@ -633,302 +633,6 @@ public function deleteActivityTypeRequest($id): Request } - /* @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('x-api-token'); - if ($apiKey !== null) { - $headers['x-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 deleteActivityTypes - * - * Delete multiple activity types in bulk - * - * @param string $ids The comma-separated activity type IDs (required) - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException|GuzzleException - * @return \Pipedrive\versions\v1\Model\ActivityTypeBulkDeleteResponse - */ - public function deleteActivityTypes($ids) - { - list($response) = $this->deleteActivityTypesWithHttpInfo($ids); - return $response; - } - - /** - * Operation deleteActivityTypesWithHttpInfo - * - * Delete multiple activity types in bulk - * - * @param string $ids The comma-separated activity type IDs (required) - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException|GuzzleException - * @return array of \Pipedrive\versions\v1\Model\ActivityTypeBulkDeleteResponse, HTTP status code, HTTP response headers (array of strings) - */ - public function deleteActivityTypesWithHttpInfo($ids) - { - $request = $this->deleteActivityTypesRequest($ids); - - 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->deleteActivityTypesRequest($ids); - $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\ActivityTypeBulkDeleteResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\ActivityTypeBulkDeleteResponse', []), - $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\ActivityTypeBulkDeleteResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\ActivityTypeBulkDeleteResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Pipedrive\versions\v1\Model\ActivityTypeBulkDeleteResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation deleteActivityTypesAsync - * - * Delete multiple activity types in bulk - * - * @param string $ids The comma-separated activity type IDs (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return PromiseInterface - */ - public function deleteActivityTypesAsync($ids): PromiseInterface - { - return $this->deleteActivityTypesAsyncWithHttpInfo($ids) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deleteActivityTypesAsyncWithHttpInfo - * - * Delete multiple activity types in bulk - * - * @param string $ids The comma-separated activity type IDs (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return PromiseInterface - */ - public function deleteActivityTypesAsyncWithHttpInfo($ids): PromiseInterface - { - $returnType = '\Pipedrive\versions\v1\Model\ActivityTypeBulkDeleteResponse'; - $request = $this->deleteActivityTypesRequest($ids); - - 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 'deleteActivityTypes' - * - * @param string $ids The comma-separated activity type IDs (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return Request - */ - public function deleteActivityTypesRequest($ids): Request - { - // verify the required parameter 'ids' is set - /* @phpstan-ignore-next-line */ - if ($ids === null || (is_array($ids) && count($ids) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $ids when calling deleteActivityTypes' - ); - } - - $resourcePath = '/activityTypes'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - /* @phpstan-ignore-next-line */ - if (is_array($ids)) { - $ids = ObjectSerializer::serializeCollection($ids, '', true); - } - if ($ids !== null) { - $queryParams['ids'] = $ids; - } - - - - /* @phpstan-ignore-next-line */ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( diff --git a/lib/versions/v1/Api/DealsApi.php b/lib/versions/v1/Api/DealsApi.php index 0833700..e18e66a 100644 --- a/lib/versions/v1/Api/DealsApi.php +++ b/lib/versions/v1/Api/DealsApi.php @@ -2522,307 +2522,6 @@ public function deleteDealProductRequest($id, $product_attachment_id): Request } - /* @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('x-api-token'); - if ($apiKey !== null) { - $headers['x-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 deleteDeals - * - * Delete multiple deals in bulk - * - * @param string $ids The comma-separated IDs that will be deleted (required) - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException|GuzzleException - * @return \Pipedrive\versions\v1\Model\DeleteMultipleDeals - * @deprecated - */ - public function deleteDeals($ids) - { - list($response) = $this->deleteDealsWithHttpInfo($ids); - return $response; - } - - /** - * Operation deleteDealsWithHttpInfo - * - * Delete multiple deals in bulk - * - * @param string $ids The comma-separated IDs that will be deleted (required) - * - * @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) - { - $request = $this->deleteDealsRequest($ids); - - 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->deleteDealsRequest($ids); - $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\DeleteMultipleDeals' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\DeleteMultipleDeals', []), - $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\DeleteMultipleDeals' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\DeleteMultipleDeals', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Pipedrive\versions\v1\Model\DeleteMultipleDeals', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation deleteDealsAsync - * - * Delete multiple deals in bulk - * - * @param string $ids The comma-separated IDs that will be deleted (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return PromiseInterface - * @deprecated - */ - public function deleteDealsAsync($ids): PromiseInterface - { - return $this->deleteDealsAsyncWithHttpInfo($ids) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deleteDealsAsyncWithHttpInfo - * - * Delete multiple deals in bulk - * - * @param string $ids The comma-separated IDs that will be deleted (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return PromiseInterface - * @deprecated - */ - public function deleteDealsAsyncWithHttpInfo($ids): PromiseInterface - { - $returnType = '\Pipedrive\versions\v1\Model\DeleteMultipleDeals'; - $request = $this->deleteDealsRequest($ids); - - 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 'deleteDeals' - * - * @param string $ids The comma-separated IDs that will be deleted (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return Request - * @deprecated - */ - public function deleteDealsRequest($ids): Request - { - // verify the required parameter 'ids' is set - /* @phpstan-ignore-next-line */ - if ($ids === null || (is_array($ids) && count($ids) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $ids when calling deleteDeals' - ); - } - - $resourcePath = '/deals'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - /* @phpstan-ignore-next-line */ - if (is_array($ids)) { - $ids = ObjectSerializer::serializeCollection($ids, '', true); - } - if ($ids !== null) { - $queryParams['ids'] = $ids; - } - - - - /* @phpstan-ignore-next-line */ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( diff --git a/lib/versions/v1/Api/OrganizationsApi.php b/lib/versions/v1/Api/OrganizationsApi.php index 4d9b9a3..7f06825 100644 --- a/lib/versions/v1/Api/OrganizationsApi.php +++ b/lib/versions/v1/Api/OrganizationsApi.php @@ -1266,307 +1266,6 @@ public function deleteOrganizationFollowerRequest($id, $follower_id): Request } - /* @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('x-api-token'); - if ($apiKey !== null) { - $headers['x-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 deleteOrganizations - * - * Delete multiple organizations in bulk - * - * @param string $ids The comma-separated IDs that will be deleted (required) - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException|GuzzleException - * @return \Pipedrive\versions\v1\Model\OrganizationsDeleteResponse - * @deprecated - */ - public function deleteOrganizations($ids) - { - list($response) = $this->deleteOrganizationsWithHttpInfo($ids); - return $response; - } - - /** - * Operation deleteOrganizationsWithHttpInfo - * - * Delete multiple organizations in bulk - * - * @param string $ids The comma-separated IDs that will be deleted (required) - * - * @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) - { - $request = $this->deleteOrganizationsRequest($ids); - - 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->deleteOrganizationsRequest($ids); - $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\OrganizationsDeleteResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\OrganizationsDeleteResponse', []), - $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\OrganizationsDeleteResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\OrganizationsDeleteResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Pipedrive\versions\v1\Model\OrganizationsDeleteResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation deleteOrganizationsAsync - * - * Delete multiple organizations in bulk - * - * @param string $ids The comma-separated IDs that will be deleted (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return PromiseInterface - * @deprecated - */ - public function deleteOrganizationsAsync($ids): PromiseInterface - { - return $this->deleteOrganizationsAsyncWithHttpInfo($ids) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deleteOrganizationsAsyncWithHttpInfo - * - * Delete multiple organizations in bulk - * - * @param string $ids The comma-separated IDs that will be deleted (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return PromiseInterface - * @deprecated - */ - public function deleteOrganizationsAsyncWithHttpInfo($ids): PromiseInterface - { - $returnType = '\Pipedrive\versions\v1\Model\OrganizationsDeleteResponse'; - $request = $this->deleteOrganizationsRequest($ids); - - 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 'deleteOrganizations' - * - * @param string $ids The comma-separated IDs that will be deleted (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return Request - * @deprecated - */ - public function deleteOrganizationsRequest($ids): Request - { - // verify the required parameter 'ids' is set - /* @phpstan-ignore-next-line */ - if ($ids === null || (is_array($ids) && count($ids) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $ids when calling deleteOrganizations' - ); - } - - $resourcePath = '/organizations'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - /* @phpstan-ignore-next-line */ - if (is_array($ids)) { - $ids = ObjectSerializer::serializeCollection($ids, '', true); - } - if ($ids !== null) { - $queryParams['ids'] = $ids; - } - - - - /* @phpstan-ignore-next-line */ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( diff --git a/lib/versions/v1/Api/PersonsApi.php b/lib/versions/v1/Api/PersonsApi.php index 7b973c5..9f9a324 100644 --- a/lib/versions/v1/Api/PersonsApi.php +++ b/lib/versions/v1/Api/PersonsApi.php @@ -1919,307 +1919,6 @@ public function deletePersonPictureRequest($id): Request } - /* @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('x-api-token'); - if ($apiKey !== null) { - $headers['x-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 deletePersons - * - * Delete multiple persons in bulk - * - * @param string $ids The comma-separated IDs that will be deleted (required) - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException|GuzzleException - * @return \Pipedrive\versions\v1\Model\DeletePersonsInBulkResponse - * @deprecated - */ - public function deletePersons($ids) - { - list($response) = $this->deletePersonsWithHttpInfo($ids); - return $response; - } - - /** - * Operation deletePersonsWithHttpInfo - * - * Delete multiple persons in bulk - * - * @param string $ids The comma-separated IDs that will be deleted (required) - * - * @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) - { - $request = $this->deletePersonsRequest($ids); - - 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->deletePersonsRequest($ids); - $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\DeletePersonsInBulkResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\DeletePersonsInBulkResponse', []), - $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\DeletePersonsInBulkResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\DeletePersonsInBulkResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Pipedrive\versions\v1\Model\DeletePersonsInBulkResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation deletePersonsAsync - * - * Delete multiple persons in bulk - * - * @param string $ids The comma-separated IDs that will be deleted (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return PromiseInterface - * @deprecated - */ - public function deletePersonsAsync($ids): PromiseInterface - { - return $this->deletePersonsAsyncWithHttpInfo($ids) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deletePersonsAsyncWithHttpInfo - * - * Delete multiple persons in bulk - * - * @param string $ids The comma-separated IDs that will be deleted (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return PromiseInterface - * @deprecated - */ - public function deletePersonsAsyncWithHttpInfo($ids): PromiseInterface - { - $returnType = '\Pipedrive\versions\v1\Model\DeletePersonsInBulkResponse'; - $request = $this->deletePersonsRequest($ids); - - 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 'deletePersons' - * - * @param string $ids The comma-separated IDs that will be deleted (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return Request - * @deprecated - */ - public function deletePersonsRequest($ids): Request - { - // verify the required parameter 'ids' is set - /* @phpstan-ignore-next-line */ - if ($ids === null || (is_array($ids) && count($ids) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $ids when calling deletePersons' - ); - } - - $resourcePath = '/persons'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - /* @phpstan-ignore-next-line */ - if (is_array($ids)) { - $ids = ObjectSerializer::serializeCollection($ids, '', true); - } - if ($ids !== null) { - $queryParams['ids'] = $ids; - } - - - - /* @phpstan-ignore-next-line */ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( diff --git a/lib/versions/v1/Api/StagesApi.php b/lib/versions/v1/Api/StagesApi.php index dfe76c4..38e1502 100644 --- a/lib/versions/v1/Api/StagesApi.php +++ b/lib/versions/v1/Api/StagesApi.php @@ -643,307 +643,6 @@ public function deleteStageRequest($id): Request } - /* @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('x-api-token'); - if ($apiKey !== null) { - $headers['x-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 deleteStages - * - * Delete multiple stages in bulk - * - * @param string $ids The comma-separated stage IDs to delete (required) - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException|GuzzleException - * @return \Pipedrive\versions\v1\Model\DeleteStagesResponse - * @deprecated - */ - public function deleteStages($ids) - { - list($response) = $this->deleteStagesWithHttpInfo($ids); - return $response; - } - - /** - * Operation deleteStagesWithHttpInfo - * - * Delete multiple stages in bulk - * - * @param string $ids The comma-separated stage IDs to delete (required) - * - * @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) - { - $request = $this->deleteStagesRequest($ids); - - 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->deleteStagesRequest($ids); - $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\DeleteStagesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\DeleteStagesResponse', []), - $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\DeleteStagesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Pipedrive\versions\v1\Model\DeleteStagesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Pipedrive\versions\v1\Model\DeleteStagesResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation deleteStagesAsync - * - * Delete multiple stages in bulk - * - * @param string $ids The comma-separated stage IDs to delete (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return PromiseInterface - * @deprecated - */ - public function deleteStagesAsync($ids): PromiseInterface - { - return $this->deleteStagesAsyncWithHttpInfo($ids) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deleteStagesAsyncWithHttpInfo - * - * Delete multiple stages in bulk - * - * @param string $ids The comma-separated stage IDs to delete (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return PromiseInterface - * @deprecated - */ - public function deleteStagesAsyncWithHttpInfo($ids): PromiseInterface - { - $returnType = '\Pipedrive\versions\v1\Model\DeleteStagesResponse'; - $request = $this->deleteStagesRequest($ids); - - 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 'deleteStages' - * - * @param string $ids The comma-separated stage IDs to delete (required) - * - * @throws InvalidArgumentException|OAuthProviderException - * @return Request - * @deprecated - */ - public function deleteStagesRequest($ids): Request - { - // verify the required parameter 'ids' is set - /* @phpstan-ignore-next-line */ - if ($ids === null || (is_array($ids) && count($ids) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $ids when calling deleteStages' - ); - } - - $resourcePath = '/stages'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - /* @phpstan-ignore-next-line */ - if (is_array($ids)) { - $ids = ObjectSerializer::serializeCollection($ids, '', true); - } - if ($ids !== null) { - $queryParams['ids'] = $ids; - } - - - - /* @phpstan-ignore-next-line */ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( diff --git a/lib/versions/v1/Configuration.php b/lib/versions/v1/Configuration.php index 682c41a..86e83cb 100644 --- a/lib/versions/v1/Configuration.php +++ b/lib/versions/v1/Configuration.php @@ -111,11 +111,11 @@ class Configuration */ protected string $host = 'https://api.pipedrive.com/v1'; /** - * User agent of the HTTP request, set to "Pipedrive-SDK-PHP-14.x" by default + * User agent of the HTTP request, set to "Pipedrive-SDK-PHP-15.x" by default * * @var string */ - protected string $userAgent = 'Pipedrive-SDK-PHP-14.x'; + protected string $userAgent = 'Pipedrive-SDK-PHP-15.x'; /** * Debug switch (default set to false) diff --git a/lib/versions/v1/Model/RequiredTitleParameter.php b/lib/versions/v1/Model/RequiredTitleParameter.php new file mode 100644 index 0000000..18f0b8d --- /dev/null +++ b/lib/versions/v1/Model/RequiredTitleParameter.php @@ -0,0 +1,348 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RequiredTitleParameter implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RequiredTitleParameter'; + + /** + * 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 = []; + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' 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 title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The title of the deal + * + * @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/v2/Configuration.php b/lib/versions/v2/Configuration.php index 90cca17..5b016ee 100644 --- a/lib/versions/v2/Configuration.php +++ b/lib/versions/v2/Configuration.php @@ -111,11 +111,11 @@ class Configuration */ protected string $host = 'https://api.pipedrive.com/api/v2'; /** - * User agent of the HTTP request, set to "Pipedrive-SDK-PHP-14.x" by default + * User agent of the HTTP request, set to "Pipedrive-SDK-PHP-15.x" by default * * @var string */ - protected string $userAgent = 'Pipedrive-SDK-PHP-14.x'; + protected string $userAgent = 'Pipedrive-SDK-PHP-15.x'; /** * Debug switch (default set to false)